-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battle 2k3: Implement in-battle row command #2322
Conversation
for (auto& actor: Main_Data::game_party->GetActors()) { | ||
if (actor->GetBattleRow() == Game_Actor::RowType::RowType_front) front_row_battlers++; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case doesn't appear to handle back attacks etc..
I checked in RE tools and found that RPG_RT counts the number of actors which row == mirrored
and then allows the row command if count >= 2 || current_hero.row != current_hero.mirrored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the change as requested and tested it. I have amended the commit and force pushed it because I assume you want this in one commit.
For bonus points, are you bug compatible with this? 😄 |
Okay, that thing mentioned in #1486 is a really crazy one. I have tried to reproduce that bug in RPG_RT without avail. Probably I'm missing something obvious. But do we want to emulate that bug? I'm pretty sure the implementation in this PR doesn't. And because this is the pincer battle condition it doesn't matter anyway in which row the battler is. |
The in-battle row command has been added now.
I don't care about the bug it's dumb and better we fix it. I suspect it's because you reset the actor position after processing row command. RPG_RT just adds or subtracts 24 from x. |
Then we are all set! 😄 |
src/scene_battle_rpg2k3.cpp
Outdated
const lcf::rpg::BattleCommand* command = static_cast<Game_Actor*>(for_battler)->GetBattleCommands()[index]; | ||
for_battler->SetLastBattleAction(command->ID); | ||
} else { | ||
for_battler->SetLastBattleAction(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be verified because the last battle action is a battle page start condition (or was it a condition in a conditional branch?). So this value must match.
Even if the row command can't be picked there through the editor I bet there is at least one game that patched the value and checks for it (see Change Vehicle position with -1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 is indeed the Row command, just tested this via LDB-patching 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's actually -1. The logic I've seen in RPG_RT is usually something like this:
auto* batcmd = GetBattleCommandByIndex(window->currentchoice);
if (batcmd) {
switch(batcmd->type) {
// Handle each command
}
} else {
// Handle row command
}
What if you try -2 or a large value greater than the number of configured battle commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only tested -1 and -2. -2 didn't activate my event page. Note that I talk about the page condition, not about the Command index in the menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured it out by now: That's (kinda) a bug. Only kinda because this needs external tools to be utilized:
The GetBattleCommandByIndex
function checks if the cmd idx is >= 6
and if yes it returns -1
.
Otherwise it resolves the battle command of the actor. For the row this is 0
.
Conclusion:
When an actor has 6 battle commands then row has an action ID of -1, otherwise it has an action ID of 0.
@rueter37 can you implement this behaviour? (SetLastBattleAction(-1)
for "all/6 cmds", else SetLastBattleAction(0)
). And add a comment that this is RPG_RT behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the LastBattleAction changes.
If an actor uses the row command and has at least 6 battle commands, then return -1 as last battle action, otherwise 0.
This PR adds the in-battle row command used in RPG Maker 2003. Merging this PR and #2321 into master fixes #680.