So im trying to setup code for a turn based rpg. The battle system I'm getting stuck on. The battles would be like the old school final fantasy. I have the initiating the fight done using bump but its the multiples problems of gathering multiple mobs, pausing actions till its the correct mobs turn, having a timer, and turn order that are getting me stopped up for the moment. Any advice will help.
ID:2000440
Dec 19 2015, 6:52 am (Edited on Dec 19 2015, 5:04 pm)
|
|
In response to Hebrons
|
|
Hebrons wrote:
> while(a.turn == TRUE) //while it is still your turn. This will still crash, I'm assuming you want a sleep instead of a spawn in here. |
Well ill tweak this to fit for the game but i still got to grab multiple mobs into the battle and pausing actions. I dont know how to stop the players from mashing commands when its not their turn. Thanks btw guys for the turn timer stuff
|
no problem (; , and just put this in all of your commands.
if(!turn) |
In response to Hebrons
|
|
Don't do this, as the semantics don't match the actual behavior. If turn = null, then turn is false but turn != FALSE. Likewise, if turn = 2 then turn is true but turn != TRUE.
|
I dunno what you did with the other code you posted, but doing turn != TRUE for false and turn != FALSE for true still won't work. E.g., null is considered false in DM, and null != TRUE is true, so that would evaluate as true.
The correct way to do it is just use boolean evaluation. if(turn) Values considered false in DM are 0, "" (a 0-length string), and null. At least, IIRC these are the false values. |
not trying to over complicate stuff for you tried making it simple , hopefully this help's you get the jist though i've never done turn based things so this is just how i think it would be passed down.