Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUDs
➜ General
➜ Turn-Based combat
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Malucifer
(2 posts) 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. | Top |
|
Posted by
| Nick Cash
USA (626 posts) 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 | Top |
|
Posted by
| Malucifer
(2 posts) 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) | Top |
|
Posted by
| David Haley
USA (3,881 posts) 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 | 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.
12,515 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top