Open fmatthew5876 opened 4 years ago
Create a battle event triggered by a switch which spawns a message
This behavior is maybe a bug. I've seen it before when play testing. Then again, it does give you a way to trigger events before starting the battle round so maybe thats useful?
These values are used by RPG_RT for the 2k3 battle branch commands.
Class | Value | meaning |
---|---|---|
SceneBattle | currentEnemyTargetIndex | The 0 based index of the last enemy we targeted |
SceneBattle | currentTargetRange | The range of the last action used by an actor |
SceneBattle | currentActingHeroId | The 1 based ID of the last hero to act |
Actor | comboUsedBattleCommand | Shared with combo system, last 1 based battle command id used by an actor |
(currentTargetRange == TARGET_MONSTER || currentTargetRange == TARGET_MONSTERS) && currentEnemyTargetIndex == param[1]
currentActingHeroId == param[1] && actor->comboUsedBattleCommand == param[2]
User | Action | currentEnemyTargetIndex | currentTargetRange | currentActingHeroId | comboUsedBattleCommand | |
---|---|---|---|---|---|---|
Battle Started | -1, and then 0 when first actor acts | 0 | 0 | 0 | -1 | |
Hero | normal attack | enemy target | TARGET_MONSTER | hero | attack | |
Hero | single target skill or skill item | enemy | TARGET_MONSTER | hero | skill | |
Hero | multi target skill or skill item | unchanged for same hero :exclamation: | TARGET_MONSTERS | hero | skill | |
Hero | switch skill | unchanged | TARGET_NONE | hero item | ||
Hero | defend / row / escape | unchanged for same hero :exclamation: | unchanged for the same hero :exclamation: | hero | defend / row / escape | |
Hero | medicine | actor target | TARGET_ALLY | hero | item | |
Hero | auto battle / confuse / provoke | target | target range | hero | -1 | |
Enemy | any | unchanged | unchanged | -1 | N/A |
The unchanged values in the above cause a lot of strange behavior when you do consecutive actions with the same hero.
currentEnemyTargetId
is initialized to 0 and will branch successful on the first enemy.currentTargetEnemyIndex
initializes at the beginning of the battle, so if enemies go first before any actor the branch will always fail. This is correct behavior.
Verify all the cases where RPG_RT runs the battle interpreter and do the same, to ensure battle events run at the right times.
I'm still not 100% clear on all the edge cases for this one. The code is very hard to follow, especially for 2k3.
Battle 2k
RPG_SceneBattle::CheckEventsAndBattleEnd
RPG_RT 2ke: 0047A8D0
Battle 2k3
RPG_SceneBattle::CheckBattleEndAndUpdateEvents
DynRPG: 00499800
If:
Then:
For the
trigger_type == 1
, this function is repeated each frame if the battle action is not able to be executed yet. Basically it calls a function to run the algo, which returns 0 and causes the whole cycle to repeat next frame if the algo can't run yet. The cases include:AS_FINAL_PHASE
(Not sure what this used for yet)AS_FINAL_PHASE
(??)Each time 2k3 battle runs events, it will only allow events to run with the following triggers