I am trying to make a turned-based battle system for a game I am making, that is determined by RNG+that character’s speed, but I cannot get the system to choose how to pick an order that the enemies go in, I cannot even figure out how to assign the enemy to their initiative values, what in the world am I doing wrong
Script link: PlayCanvas | HTML5 Game Engine
Hey @Linkplayer ! Can you send your editor/ project link so I can take a look?
https://playcanvas.com/editor/scene/2112576
I saw this message right as I got onto my computer, here is the link to the project
Thanks, I’m in the car rn but I’ll look at it as soon as I can.
Ok, thx
I am pretty sure I need to take the initiative of both the ally characters and enemies(I am only doing 4 enemies max right now before trying 6 enemies max) and add them to a list, then order that list from biggest to smallest(I know how to do that, but it will be a bit hard to even get the enemies and allies on the same turn order) and one problem I just realized a bit ago is how to figure show which entities have the specific initiative they got, and turn that into the turn order
I do have the other 2 extra slimes that are not being used until I get the script working for 4 enemies, then I will adjust it for 6, and try the other 2 with it
Can you elaborate what you mean by
Also
Do you have a system made yet that isn’t working or do you not have a system at all?
That seems kinda complex. This might be a bit less complex:
- Make a variable for each slime for their initiative and another one for the order.
- set the initiative variable to the random 1-20 and add their speed
- use greater than or less land stuff to figure out if a slime goes before or after a different slime (maybe set all their order variables to 6 to start, then set it to the order # of the slime that is more than it -1)
I know that’s a lot, feel free to ask any questions.