- 14
- Posts
- 6
- Years
- Seen May 4, 2025
I'm currently trying to make it so that Escape Ropes teleport you to the last pokemon centre as opposed to the escape location.
I ultimately want to make a mark/recall type teleportation system (like in Morrowind) for an open world region.
In field_effect.c there is a section which seems relevant to the escape rope's functionality:
The specific reference to "SetWarpDestinationToEscapeWarp();" seems to be what I'm looking for, but simply changing it to "SetWarpDestinationToLastHealLocation();" gives me an undeclared identifier error when I attempt to compile.
Obviously I need to declare the HealLocation bit somehow, but I have no idea how/where to do it. I can't even tell how the EscapeWarp bit is being declared. I'm further confused because later on in field_effect.c there are references to "SetWarpDestinationToLastHealLocation();" which have no problem compiling.
I'm sure this is something blindingly obvious but I just can't see it.
Can anybody help?
I ultimately want to make a mark/recall type teleportation system (like in Morrowind) for an open world region.
In field_effect.c there is a section which seems relevant to the escape rope's functionality:
Code:
static void EscapeRopeWarpOutEffect_Spin(struct Task *task)
{
struct ObjectEvent *objectEvent;
u8 spinDirections[5] = {DIR_SOUTH, DIR_WEST, DIR_EAST, DIR_NORTH, DIR_SOUTH};
if (task->tTimer != 0 && (--task->tTimer) == 0)
{
TryFadeOutOldMapMusic();
WarpFadeOutScreen();
}
objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
if (!ObjectEventIsMovementOverridden(objectEvent) || ObjectEventClearHeldMovementIfFinished(objectEvent))
{
if (task->tTimer == 0 && !gPaletteFade.active && BGMusicStopped() == TRUE)
{
SetObjectEventDirection(objectEvent, task->tStartDir);
[COLOR="Lime"] [B]SetWarpDestinationToEscapeWarp();
WarpIntoMap();[/B][/COLOR]
gFieldCallback = FieldCallback_EscapeRopeWarpIn;
SetMainCallback2(CB2_LoadMap);
DestroyTask(FindTaskIdByFunc(Task_EscapeRopeWarpOut));
}
else if (task->tSpinDelay == 0 || (--task->tSpinDelay) == 0)
{
ObjectEventSetHeldMovement(objectEvent, GetFaceDirectionMovementAction(spinDirections[objectEvent->facingDirection]));
if (task->tNumTurns < 12)
task->tNumTurns++;
task->tSpinDelay = 8 >> (task->tNumTurns >> 2);
}
}
}
The specific reference to "SetWarpDestinationToEscapeWarp();" seems to be what I'm looking for, but simply changing it to "SetWarpDestinationToLastHealLocation();" gives me an undeclared identifier error when I attempt to compile.
Obviously I need to declare the HealLocation bit somehow, but I have no idea how/where to do it. I can't even tell how the EscapeWarp bit is being declared. I'm further confused because later on in field_effect.c there are references to "SetWarpDestinationToLastHealLocation();" which have no problem compiling.
I'm sure this is something blindingly obvious but I just can't see it.
Can anybody help?