ID:169872
 
I cant figure it out. ive tried all the demos that are available. The only one that i found that worked, i couldnt understand... which doesn't make sense, as you dont go to demos because you know how to do something...

But i need something that can explain it...not just say "heres some code, it does what you need". That will just cause problems when you need to alter it and dont know how.

if you can explain in detail how i can learn a battle system like this, thanks. if your going to shout ot code fragments and demo links to me, why bother.
Alright, I've done this sort of thing before but never made anything out of it.

Basically, when someone enters a battle, move them to a battlefield map that just has battlefield turfs for a background to the fight, as such. Stick them and the mobs they're fighting into the middle of this, and then call a "main" proc with the enemies as mobs in a list and the player as the mob. This main procedure needs to set everything up, then loop (while works fine) until one of the sides is dead. In this loop, stick a call to a procedure that performs an action for the PC, and for the enemies.

I don't think I explained it very well, but I hope you get the idea. Just remember to sleep the procedure or you'll have some serious problems.
In response to Jp
Thanks for trying...i understand some of what your saying, but as i said, i dont just need a small bit...if i understood it, i wouldnt need help.
Okay lets see what I can do to help.

1. You are going to have to decide what the trigger is for your random combat. There are two obvious choices here. True ff style with a time to battle counter or byond style with a rand proc for every battle turf and an x in 10 chance of getting into a fight. While I am an advocate of the time to battle counter the rand proc is a little simpler.

2. You then need to determen what badguys you want the players to fight. (I use badguy instead of monster because sometimes you have them fight stuff like pirates or guardsmen and those are hardley monsters.)

3. Then you need to place the monsters on the field of combat and move the player to said field.

4. Start the fight. End the fight.

5. Move the player back to where they should be depending on if they won or lost.

I found that satansspawn put out a really good demo on the subject. If you have any other questions feel free to ask and I will give you all the extra help I can.
In response to Madcrackfiend
Although i said dont shout demo links at me, i didnt mean that demo. there was a comment for EVERY line,i could look at the code and knew why it was there,and what it did. thanks for it. the other demos i looked at had similiar code,but i didnt understand it, therefore i couldnt use it.