poryscript icon indicating copy to clipboard operation
poryscript copied to clipboard

Allow multiple vars/var values of the same mapscript to use a single script

Open Jaizu opened this issue 3 years ago • 1 comments

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
        }

Jaizu avatar Jan 29 '23 18:01 Jaizu

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.

huderlem avatar Nov 11 '23 16:11 huderlem