I am afraid it is consistent and works correctly even though it seems completely weird. To understand why this is happening you need to know how the character script execution works.
Basically, when a script is running, the executor goes command by command and executes it. Some commands stop the executor (
move* commands) until the next command and some do not (
no-move). In normal player speed that's how it works.
The problem starts when you speed the player up - now on each half turn the script executor is ran
BUT ONLY only for
no-move commands. Wait is kinda peculiar command, because it is at the same a
move command (executor stops when it encounters this command and the counter only starts counting on full turns, which is why Wait 0 and 1 results in simply a pause until next turn, usually**) and
no-move command (because the timer ticks even on half turns). I have attached a hold where the characters speak and move after the wait command ends and you may notice that...
...If you step from full turn onto half turn:
- First character with no wait command speaks immediately after you step at the starting square
- Second character with Wait 0 speaks 1 HT**** after start
- Third character with Wait 1 speaks 2 HTs after start
- Fourth character with Wait 2 speaks 3 HTs after start
- Etc
But if you step from half turn onto full turn:
- First character with no wait command speaks immediately after you step at the starting square
- Second character with Wait 0 speaks 1 half-turn after start
- Third character with Wait 1 speaks 1 HTs after start
- Fourth character with Wait 2 speaks 2 HTs after start
- Etc
But it looks different for moving. If you start by stepping on the start tile from full turn onto half turn:
- First character (no wait) moves 1 HT after you start, because during half turn execution
move commands cannot be executed
- Second character (Wait 0) moves 1 HT after you start, because after start executor encountered Wait 0 and stopped execution. On the next HT (which is full turn) it moved past Wait and executed move command
- Third character (Wait 1) moves 3 HT after you start, after start executor encountered Wait 1 but it could do nothing**, so it will to process Wait 1 again next turn. Next HT is a full turn, Wait is executed and goes down from 1 to 0***. Next HT is half turn, executor goes to the next command and stops on Move becausse you can't execute
move commands on half turns. Next HT is full turn, character moves.
- Fourth character (Wait 2) moves 3 HT after start. Next HT=Full, Wait 2 to 1. Next HT=Half, Wait 1 to 0. Next HT=Full do Move.
- Fifth and Sixth will move 5 HT after start.
If you step on the start tile from half turn onto full turn:
- First character (no wait) moves immediately, because it's a full turn and you can execute move commands.
- Second character (0 wait) moves 2 HT after start, on the turn you enter it encounters Wait 0 and stops execution**. Next HT=half, wait for full turn to execute Move. Next HT=Full, execute Move.
- Third character (1 wait) moves 2 HT after start, Wait 1 to 0. Next HT=half, can't execute Move on half turn. Next HT=Full, execute move.
- Fourth character (2 wait) moves 2 HT after start, Wait 2 to 1. Next HT=half, wait 1 to 0. Next HT=Full, execute Move
- Fifth character (3 wait) moves 4 HT after start, Wait 3 to 2. Next HT=half, wait 2 to 1. Next HT=Full wait 1 to 0. Next HT=Half, can't execute Move. Next HT=Full, execute Move
- Sixth moves after 4 HT.
- 7th and 8th moves after 6 HT.
It's surprisingly complicated for such a simple thing, but I hope my explanation is sufficient, but just in case a summary of all facts:
- On half turn Characters can only execute
No-move commands
- Wait starts counting down only on Full Turns, but counts down each turn (be it full or half)
- Wait 0 is an exception, it starts counting even on half turns. Wait 0 should be named "
Interrupt script execution until next turn"
.
- When wait starts counting, next command will execute on Nth turn after the current one, so 1 will continue with following command on next turn, 2 on next next turn, 3 on next next next turn
--- Footnotes:
*Move and No-move are just names I am using to reference these two types of commands, not actual Move command.
**Wait 0 is equal to "
stop executing script now, continue next turn"
wherein Wait 1 or more is "
Stop executing script now and continue after N-1 turns, provided we are also executing
move commands now, if we are only executing
no-move commands stop execution and try this command again next turn"
. The difference is noticeable on half turns when speeded or on 0th turn, the one happening when entering a room.
***When Wait 1+ command executes a Waiter variable is set to N-1. Each turn, if waiter is >
0, waiter is reduced by one. So Wait 1, when encountered, stops execution and... sets waiter to 0.
****HT is = 1 player turn when sped up
____________________________
My website |
Facebook |
Twitter
[Last edited by skell at 02-13-2015 09:18 PM]