[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  General
. . -> [Subject]  Turn-Based combat
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Turn-Based combat

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Malucifer   (2 posts)  [Biography] bio
Date Sun 03 Jul 2005 05:18 AM (UTC)
Message
Im looking for help on a true-type turn based combat system. I want it to be based on my agility stat. The person in the room with the highest agility will get to go first then down the list until it reaches bottom and then returns. (IE. A goes then B then A then B etc..) While A is currently taking his turn B cannot take an action. Im not sure if I can set up a for-loop(or how-to) or if i need to add a struct for it. Im lost if someone can help me with sorting the fight to get who goes first on through Id be greatly appreciated. Thank you very much.
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #1 on Sun 03 Jul 2005 05:53 AM (UTC)
Message
The problem with this is that it slows down combat and leaves one play sitting, potentially forever, giving each person an unlimited amount of time to take their action.

Even so, if you are bent on such a thing, I would probably add a structure allocated for a combat. Have it keep a list of characters, and have the char struct have a pointer to the combat. It should keep track of the peoples turns, possible options and various other things. Of course, thats how I would do it.

Then in the overall general scheme of the mud you keep a list of current combats, you loop through them and analyze each one, and update it if it needs updating. You would really have to figure out a way to keep things moving though.

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Malucifer   (2 posts)  [Biography] bio
Date Reply #2 on Sun 03 Jul 2005 04:47 PM (UTC)
Message
This idea would work although Im not sure on where to start with it. If anyone can give me an example really quick so I get the idea I would appreciate it.

(How the for-loop would cycle and store turns)
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #3 on Tue 05 Jul 2005 05:53 PM (UTC)
Message
This would be something fairly difficult to code; how much experience do you have tinkering with MUD code or programming in general?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


3,390 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]