Generate local IDs from map.json files

This commit is contained in:
GriffinR
2024-10-11 21:30:52 -04:00
parent 6518f1e3ff
commit 9f31b0fe90
146 changed files with 878 additions and 833 deletions

View File

@@ -1,3 +1,4 @@
# Will be moved to build/ eventually
map_groups.h
layouts.h
layouts.h
map_event_ids.h

View File

@@ -1,6 +1,9 @@
#ifndef GUARD_CONSTANTS_EVENT_OBJECTS_H
#define GUARD_CONSTANTS_EVENT_OBJECTS_H
#include "constants/global.h"
#include "constants/map_event_ids.h"
#define OBJ_EVENT_GFX_BRENDAN_NORMAL 0
#define OBJ_EVENT_GFX_BRENDAN_MACH_BIKE 1
#define OBJ_EVENT_GFX_BRENDAN_SURFING 2
@@ -291,38 +294,14 @@
#define OBJ_KIND_NORMAL 0
#define OBJ_KIND_CLONE 255 // Exclusive to FRLG
// Special object event local ids
#define OBJ_EVENT_ID_PLAYER 0xFF
#define OBJ_EVENT_ID_CAMERA 0x7F
// Object event local ids referenced in C files
#define LOCALID_ROUTE111_PLAYER_FALLING 45
#define LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK 1
#define LOCALID_FARAWAY_ISLAND_MEW 1
#define LOCALID_UNION_ROOM_PLAYER_4 2
#define LOCALID_UNION_ROOM_PLAYER_8 3
#define LOCALID_UNION_ROOM_PLAYER_7 4
#define LOCALID_UNION_ROOM_PLAYER_6 5
#define LOCALID_UNION_ROOM_PLAYER_5 6
#define LOCALID_UNION_ROOM_PLAYER_3 7
#define LOCALID_UNION_ROOM_PLAYER_2 8
#define LOCALID_UNION_ROOM_PLAYER_1 9
#define LOCALID_BATTLE_TOWER_LOBBY_REPORTER 5
#define LOCALID_TRUCK_BOX_TOP 1
#define LOCALID_TRUCK_BOX_BOTTOM_L 2
#define LOCALID_TRUCK_BOX_BOTTOM_R 3
#define LOCALID_OLDALE_MART_CLERK 1
#define LOCALID_LAVARIDGE_MART_CLERK 1
#define LOCALID_FALLARBOR_MART_CLERK 1
#define LOCALID_VERDANTURF_MART_CLERK 1
#define LOCALID_PETALBURG_MART_CLERK 1
#define LOCALID_SLATEPORT_MART_CLERK 1
#define LOCALID_MAUVILLE_MART_CLERK 1
#define LOCALID_RUSTBORO_MART_CLERK 1
#define LOCALID_FORTREE_MART_CLERK 1
#define LOCALID_MOSSDEEP_MART_CLERK 1
#define LOCALID_SOOTOPOLIS_MART_CLERK 1
#define LOCALID_BATTLE_FRONTIER_MART_CLERK 1
#define LOCALID_SLATEPORT_ENERGY_GURU 25
// Each object event template gets an ID that can be used to refer to it in scripts and elsewhere.
// This is referred to as the "local id" (and it's really just 1 + its index in the templates array).
// There are a few special IDs reserved for objects that don't have a templates in the map data -- one for the player
// in regular offline play, five for linked players while playing Berry Blender, and one for an invisible object that
// can be spawned for the camera to track instead of the player. Additionally, the value 0 is reserved as an "empty" indicator.
#define LOCALID_NONE 0
#define OBJ_EVENT_ID_CAMERA 127
#define LOCALID_BERRY_BLENDER_PLAYER_END 240 // This will use 5 (MAX_RFU_PLAYERS) IDs ending at 240, i.e. 236-240
#define OBJ_EVENT_ID_PLAYER 255
#endif // GUARD_CONSTANTS_EVENT_OBJECTS_H

View File

@@ -847,7 +847,7 @@
#define FLAG_HIDE_ROUTE_111_GABBY_AND_TY_1 0x31C
#define FLAG_HIDE_ROUTE_118_GABBY_AND_TY_1 0x31D
#define FLAG_HIDE_ROUTE_120_GABBY_AND_TY_1 0x31E
#define FLAG_HIDE_ROUTE_111_GABBY_AND_TY_3 0x31F
#define FLAG_HIDE_ROUTE_111_GABBY_AND_TY_2 0x31F
#define FLAG_HIDE_LUGIA 0x320
#define FLAG_HIDE_HO_OH 0x321
#define FLAG_HIDE_LILYCOVE_CONTEST_HALL_REPORTER 0x322
@@ -951,7 +951,7 @@
#define FLAG_HIDE_ROUTE_110_TEAM_AQUA 0x384
#define FLAG_HIDE_ROUTE_118_GABBY_AND_TY_2 0x385
#define FLAG_HIDE_ROUTE_120_GABBY_AND_TY_2 0x386
#define FLAG_HIDE_ROUTE_111_GABBY_AND_TY_2 0x387
#define FLAG_HIDE_ROUTE_111_GABBY_AND_TY_3 0x387
#define FLAG_HIDE_ROUTE_118_GABBY_AND_TY_3 0x388
#define FLAG_HIDE_SLATEPORT_CITY_HARBOR_PATRONS 0x389
#define FLAG_HIDE_ROUTE_104_WHITE_HERB_FLORIST 0x38A

View File

@@ -618,7 +618,7 @@ struct RamScriptData
u8 magic;
u8 mapGroup;
u8 mapNum;
u8 objectId;
u8 localId;
u8 script[995];
//u8 padding;
};