Skip to content

Conversation

@jetrotal
Copy link
Contributor

@jetrotal jetrotal commented Jan 7, 2025

Supporting usage of variables when game uses maniac patch
and parameters size is bigger than 7.

//TPC Example
@ev.flash .player .rgbv v[100], v[101], v[102], v[103] .time 100

@Ghabry
Copy link
Member

Ghabry commented Jan 8, 2025

You can use the other overload of ValueOrVariableBitfield which does already do the Maniac and size checking:

int event_id = VariableOrVariableBitfield(com, 7, 0, 0);
// and so on...

See PlayBGM:

bool Game_Interpreter::CommandPlayBGM(lcf::rpg::EventCommand const& com) { // code 11510
lcf::rpg::Music music;
music.name = ToString(CommandStringOrVariableBitfield(com, 4, 0, 5));
music.fadein = ValueOrVariableBitfield(com, 4, 1, 0);
music.volume = ValueOrVariableBitfield(com, 4, 2, 1);
music.tempo = ValueOrVariableBitfield(com, 4, 3, 2);
music.balance = ValueOrVariableBitfield(com, 4, 4, 3);
Main_Data::game_system->BgmPlay(music);
return true;
}

@Ghabry Ghabry added this to the 0.8.1 milestone Jan 8, 2025
Supporting usage of variables when
game uses maniac patch
and parameters size is bigger than 7.

Update game_interpreter_map.cpp
@Ghabry Ghabry merged commit ea2f6c0 into EasyRPG:master Jan 14, 2025
13 checks passed
@jetrotal jetrotal deleted the maniacs-FlashEvent branch December 15, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants