• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Modify Start Truck Warp Location

3
Posts
234
Days
    • Seen Mar 28, 2024
    I want to change the map destination of the inside truck starting sequence to my new map.
    I made two new maps for InsideOfTruck (STARTING_TRUCK; basically a copy) and the first town (MAP_FIRST_TOWN).

    First I changed the warp destination of WarpToTruck to the new truck map in src/new_game.c
    Code:
    static void WarpToTruck(void)
    {
        DebugPrintf("Debug WarpToTruck");
        //SetWarpDestination(MAP_GROUP(INSIDE_OF_TRUCK), MAP_NUM(INSIDE_OF_TRUCK), WARP_ID_NONE, -1, -1);
        SetWarpDestination(MAP_GROUP(STARTING_TRUCK), MAP_NUM(STARTING_TRUCK), WARP_ID_NONE, -1, -1);
        WarpIntoMap();
    }
    The trigger inside the truck:
    Code:
    Script: StartingTruck_EventScript_SetIntroFlags
    Var: VAR_LITTLEROOT_INTRO_STATE
    Var Value: 0
    Map scripts in data/maps/StartingTruck/scripts.inc
    Code:
    StartingTruck_EventScript_SetIntroFlags::
        lockall
        setflag FLAG_HIDE_MAP_NAME_POPUP
        checkplayergender
        goto_if_eq VAR_RESULT, MALE, StartingTruck_EventScript_SetIntroFlagsMale
        goto_if_eq VAR_RESULT, FEMALE, StartingTruck_EventScript_SetIntroFlagsFemale
        end

    Not neccessary because I want both gender to start on the same location. Could reduce it in one script.
    They start the following SetIntroFlags
    Code:
    StartingTruck_EventScript_SetIntroFlagsMale::
        setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F
        setvar VAR_LITTLEROOT_INTRO_STATE, 1
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_TRUCK
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_SIBLING
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_POKE_BALL
        setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 1
        setdynamicwarp MAP_FIRST_TOWN, 6, 15
        releaseall
        end
    
    StartingTruck_EventScript_SetIntroFlagsFemale::
        setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F
        setvar VAR_LITTLEROOT_INTRO_STATE, 2
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_TRUCK
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_SIBLING
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_POKE_BALL
        setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 1
        setdynamicwarp MAP_FIRST_TOWN_PROFESSOR_LAB, 5, 14
        releaseall
        end

    For debug purpose I setup a DebugPrintf for X,Y coords in src/overworld.c
    Code:
    void SetDynamicWarpWithCoords(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y)
    {
        DebugPrintf("Debug SetDynamicWarpWithCoords");
        DebugPrintf("d mapgroup: %d, mapnum:%d", mapNum, mapNum);
        SetWarpData(&gSaveBlock1Ptr->dynamicWarp, mapGroup, mapNum, warpId, x, y);
    }

    Log file: First try for male, second for female.
    Code:
    [INFO] GBA Debug: Debug SetDynamicWarpWithCoords
    [INFO] GBA Debug: d mapgroup: 0, mapnum:0
    [INFO] GBA Debug: x: 6, y:15
    ----------------------------------------------------------
    [INFO] GBA Debug: Debug SetDynamicWarpWithCoords
    [INFO] GBA Debug: d mapgroup: 0, mapnum:0
    [INFO] GBA Debug: x: 5, y:14

    The problem:
    Both gender start in the middle of MAP_FIRST_TOWN (X 20 / Y 15) (40 / 30 map), even when female got another starting location.

    X, Y coords of "StartingTruck_EventScript_SetIntroFlags" get through but not the mapgroup and mapnum?

    Is there a mapgroup mapnum error and MAP_FIRST_TOWN is in the first(0) MapGroup and first(0) MapNum?
    Unbenannt.PNG

    What is wrong here?
    I just started and got no more ideas XD
    HELP!
     
    448
    Posts
    6
    Years
    • Seen May 6, 2024
    I want to change the map destination of the inside truck starting sequence to my new map.
    I made two new maps for InsideOfTruck (STARTING_TRUCK; basically a copy) and the first town (MAP_FIRST_TOWN).

    First I changed the warp destination of WarpToTruck to the new truck map in src/new_game.c
    Code:
    static void WarpToTruck(void)
    {
        DebugPrintf("Debug WarpToTruck");
        //SetWarpDestination(MAP_GROUP(INSIDE_OF_TRUCK), MAP_NUM(INSIDE_OF_TRUCK), WARP_ID_NONE, -1, -1);
        SetWarpDestination(MAP_GROUP(STARTING_TRUCK), MAP_NUM(STARTING_TRUCK), WARP_ID_NONE, -1, -1);
        WarpIntoMap();
    }
    The trigger inside the truck:
    Code:
    Script: StartingTruck_EventScript_SetIntroFlags
    Var: VAR_LITTLEROOT_INTRO_STATE
    Var Value: 0
    Map scripts in data/maps/StartingTruck/scripts.inc
    Code:
    StartingTruck_EventScript_SetIntroFlags::
        lockall
        setflag FLAG_HIDE_MAP_NAME_POPUP
        checkplayergender
        goto_if_eq VAR_RESULT, MALE, StartingTruck_EventScript_SetIntroFlagsMale
        goto_if_eq VAR_RESULT, FEMALE, StartingTruck_EventScript_SetIntroFlagsFemale
        end

    Not neccessary because I want both gender to start on the same location. Could reduce it in one script.
    They start the following SetIntroFlags
    Code:
    StartingTruck_EventScript_SetIntroFlagsMale::
        setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F
        setvar VAR_LITTLEROOT_INTRO_STATE, 1
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_TRUCK
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_SIBLING
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F_POKE_BALL
        setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 1
        setdynamicwarp MAP_FIRST_TOWN, 6, 15
        releaseall
        end
    
    StartingTruck_EventScript_SetIntroFlagsFemale::
        setrespawn HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE_2F
        setvar VAR_LITTLEROOT_INTRO_STATE, 2
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_TRUCK
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_MOM
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_SIBLING
        setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_POKE_BALL
        setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 1
        setdynamicwarp MAP_FIRST_TOWN_PROFESSOR_LAB, 5, 14
        releaseall
        end

    For debug purpose I setup a DebugPrintf for X,Y coords in src/overworld.c
    Code:
    void SetDynamicWarpWithCoords(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y)
    {
        DebugPrintf("Debug SetDynamicWarpWithCoords");
        DebugPrintf("d mapgroup: %d, mapnum:%d", mapNum, mapNum);
        SetWarpData(&gSaveBlock1Ptr->dynamicWarp, mapGroup, mapNum, warpId, x, y);
    }

    Log file: First try for male, second for female.
    Code:
    [INFO] GBA Debug: Debug SetDynamicWarpWithCoords
    [INFO] GBA Debug: d mapgroup: 0, mapnum:0
    [INFO] GBA Debug: x: 6, y:15
    ----------------------------------------------------------
    [INFO] GBA Debug: Debug SetDynamicWarpWithCoords
    [INFO] GBA Debug: d mapgroup: 0, mapnum:0
    [INFO] GBA Debug: x: 5, y:14

    The problem:
    Both gender start in the middle of MAP_FIRST_TOWN (X 20 / Y 15) (40 / 30 map), even when female got another starting location.

    X, Y coords of "StartingTruck_EventScript_SetIntroFlags" get through but not the mapgroup and mapnum?

    Is there a mapgroup mapnum error and MAP_FIRST_TOWN is in the first(0) MapGroup and first(0) MapNum?
    View attachment 156960

    What is wrong here?
    I just started and got no more ideas XD
    HELP!
    If you're warping into the middle of map (0,0) it sounds like the warp you're taking is set up wrong.
    Is the destination of the warp in StartingTruck set to use the dynamic warp like the warp in InsideOfTruck?
     
    Back
    Top