-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Overworld Expansion
Link to ghoulslash's original pokecommunity post
This guide expands the graphicsId's from U8 to U16, allowing for up to 65535 new NPC/overworld objects (vanilla pokeemerald only allows for a total of 255)
This is an updated guide to ghoulslash's overworld-expansion branch. I only updated a small part of the code to make it compatible with the latest pokeemerald code.
Pull ghoulslash's branch or manually input from the compare
git remote add ghoulslash https://github.com/ghoulslash/pokeemerald.git
git pull ghoulslash overworld-expansion
Then manually make the changes below or pull from my branch:
git remote add tenaya15 https://github.com/tenaya15/tenaya15emerald.git
git pull tenaya15 overworld-expansion-updated
in section .macro createvobject graphicsId:req... (at line 1401)
replace the whole section (lines 1402 to 1409) with:
.byte SCR_OP_CREATEVOBJECT
.2byte \graphicsId
.byte \id
.2byte \x
.2byte \y
.byte \elevation
.byte \direction
.endm
if you pulled from ghoulslash's branch, change to the following in the first <<<<<<<<<<<< HEAD conflict (lines 129 to 134):
u8 SpawnSpecialObjectEventParameterized(u16 graphicsId, u8 movementBehavior, u8 localId, s16 x, s16 y, u8 elevation);
u8 SpawnSpecialObjectEvent(struct ObjectEventTemplate *objectEventTemplate);
void SetSpritePosToMapCoords(s16 mapX, s16 mapY, s16 *destX, s16 *destY);
void CameraObjectReset(void);
void ObjectEventSetGraphicsId(struct ObjectEvent *objectEvent, u16 graphicsId);
void ObjectEventTurn(struct ObjectEvent *objectEvent, u8 direction);
__
and in the second <<<<<<<<<<<< HEAD conflict (around line 303)
the only line that you want to change is:
u8 CreateVirtualObject(u8 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 elevation, u8 direction);
to
u8 CreateVirtualObject(u16 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 elevation, u8 direction);
if there are any other new additions in this conflict section, remove them as the changes are not needed (it wants to revert these lines to an earlier version and we don't want that to happen)
if you pulled from ghoulslash's branch, we don't want to use any of the branch changes in the 1st and 3rd <<<<<<< HEAD conflicts as they are obsolete (it wants to revert these lines to an earlier version)
in the first <<<<<<<<<<<< HEAD conflict (line 6):
delete the changed lines and manually change lines 7 and 8
void SetPlayerAvatarExtraStateTransition(u8 graphicsId, u8 transitionFlag);
u8 GetPlayerAvatarGenderByGraphicsId(u8 gfxId);
to
void SetPlayerAvatarExtraStateTransition(u16 graphicsId, u8 transitionFlag);
u8 GetPlayerAvatarGenderByGraphicsId(u16 gfxId);
__
in the second <<<<<<<<<<<< HEAD conflict (line 39)
the only line you want to change is
u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender);
to
u16 GetRivalAvatarGraphicsIdByStateIdAndGender(u8 state, u8 gender);
remove any other changed lines
__
in the third <<<<<<<<<<<< HEAD conflict (line 53)
delete the changed lines and manually change lines 54 and 55
u8 GetFRLGAvatarGraphicsIdByGender(u8 gender);
u8 GetRSAvatarGraphicsIdByGender(u8 gender);
to
u16 GetFRLGAvatarGraphicsIdByGender(u8 gender);
u16 GetRSAvatarGraphicsIdByGender(u8 gender);
in first <<<<<<< HEAD conflict, manually change line 234
static const u8 sRivalAvatarGfxIds[][GENDER_COUNT] =
to
static const u16 sRivalAvatarGfxIds[][GENDER_COUNT] =
__
in second <<<<<<< HEAD conflict, manually change line 246
static const u8 sPlayerAvatarGfxIds[][GENDER_COUNT] =
to
static const u16 sPlayerAvatarGfxIds[][GENDER_COUNT] =
__
in third <<<<<<< HEAD conflict, in section static const struct __attribute__((packed)) (line 270)
manually change line 272
u8 graphicsId;
to
u16 graphicsId;
delete the changed line and manually change line 444
static void SpawnGroupMember(u32 leaderId, u32 memberId, u8 graphicsId, struct RfuGameData *gameData)
to
static void SpawnGroupMember(u32 leaderId, u32 memberId, u16 graphicsId, struct RfuGameData *gameData)
You can now add new NPCs / Overworld objects without breaking the game using this guide
Run
make cleanbefore compiling, or all the overworld objects may look like your player character.