- 3
- Posts
- 1
- Years
- 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
The trigger inside the truck:
Map scripts in data/maps/StartingTruck/scripts.inc
Not neccessary because I want both gender to start on the same location. Could reduce it in one script.
They start the following SetIntroFlags
For debug purpose I setup a DebugPrintf for X,Y coords in src/overworld.c
Log file: First try for male, second for female.
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?
![[PokeCommunity.com] Modify Start Truck Warp Location [PokeCommunity.com] Modify Start Truck Warp Location](https://data.pokecommunity.com/attachments/71/71082-499384170959abaf7ef52b1119dec96b.jpg)
What is wrong here?
I just started and got no more ideas XD
HELP!
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();
}
Code:
Script: StartingTruck_EventScript_SetIntroFlags
Var: VAR_LITTLEROOT_INTRO_STATE
Var Value: 0
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?
![[PokeCommunity.com] Modify Start Truck Warp Location [PokeCommunity.com] Modify Start Truck Warp Location](https://data.pokecommunity.com/attachments/71/71082-499384170959abaf7ef52b1119dec96b.jpg)
What is wrong here?
I just started and got no more ideas XD
HELP!