poryscript
poryscript copied to clipboard
Allow multiple vars/var values of the same mapscript to use a single script
Would allow converting something like this:
MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE [
VAR_BIRCH_LAB_STATE, 2 {
turnobject (OBJ_EVENT_ID_PLAYER, DIR_NORTH)
}
VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 1: LittlerootTown_ProfessorBirchsLab_EventScript_SetObjectPosForDexUpgrade
VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2: LittlerootTown_ProfessorBirchsLab_EventScript_SetObjectPosForDexUpgrade
}
Into this:
MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE [
VAR_BIRCH_LAB_STATE, 2 {
turnobject (OBJ_EVENT_ID_PLAYER, DIR_NORTH)
}
VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 1,
VAR_DEX_UPGRADE_JOHTO_STARTER_STATE, 2
{
// Content of LittlerootTown_ProfessorBirchsLab_EventScript_SetObjectPosForDexUpgrade
}
I looked into this in the past, but I couldn't come up with a good syntax at the time. There was difficulty with using switch-case-like syntax due to ambiguity in the parsing logic. I'd still like to do this, though.