How to make the "random" turn calculation only happen at the beginning of the battle, and keep the original randomly generated turn order for the rest of the battle? (like a ttrpg initiative role)
How to get the enemies to spawn in random enemy spawn cells? (right now, if i have 10 enemy spawn cells and spawn 5 enemies, all of the enemies will just spawn in the same enemy spawn cells nearest to the player every time a battle starts. I'm trying to give the enemy random start positions, though)
- Check Battle Turn node to check if it's the first turn (should be turn 1)
- reuse the previous turn value using a Turn Value node if it's not the first turn
Grid battles still use the battle spots to find the nearest available cell (e.g. when using the Spawn Battle Combatants node). E.g. only use the Additional Spot setup for your enemies and add random offsets there.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
when "check battle turn" is set to 1, the game will only do the randomized order calculation on the first turn as intended, but it doesn't reuse the result on the following turns. it instead reverts back to a default turn order for the rest of the battle.
I'm guessing the turn calculation resets on every battle turn?? Is there a way to stop it from doing that? Or maybe I just didn't implement your instructions correctly?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
it's the setup from the "2d grid-based battle" tutorial, but set to turn based instead of phase based.
turn based mode: active (I don't want classic or multi-turn)
turn calculation: random (because it redoes the random calculation before each new round, the last combatant in a round can get back-to-back turns before any other combatant can get their next turn. I definitely don't want that.)
this is all I can think to tell you about the turn-based setup.
I'll look into it.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
In your formula, after Check Battle Turn and using a random value, store the current formula result into a float variable in the user's object variables.
I.e. use a Change Variables node:
- variable key e.g.: initialTurnValue
- variable origin: Object
- game object (variable origin): User
- type: Float
- operator: Set
- float value: Value > Current Value (Formula)
This stores the random value that was previously set to the formula value into a variable on the combatant.
In the not-first-turn outcome of the formula, instead of using a Turn Value node, use a Value node that uses the Float Variable you stored (Object variable origin using the User, variable key initialTurnValue, etc.).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I'm gonna keep testing it, but I guess it will just keep working right.