• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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.

[Other✓] Escape Rope Warp

  • 14
    Posts
    6
    Years
    • Seen today
    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:

    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?
     
    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:

    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?

    I tried it and it works perfectly without any errors.

    Code:
    @@ -2261,7 +2261,7 @@ static void EscapeRopeWarpOutEffect_Spin(struct Task *task)
             if (task->tTimer == 0 && !gPaletteFade.active && BGMusicStopped() == TRUE)
             {
                 SetObjectEventDirection(objectEvent, task->tStartDir);
    [COLOR="Red"]-            SetWarpDestinationToEscapeWarp();[/COLOR]
    [COLOR="Lime"]+            SetWarpDestinationToLastHealLocation();[/COLOR]
                 WarpIntoMap();
                 gFieldCallback = FieldCallback_EscapeRopeWarpIn;
                 SetMainCallback2(CB2_LoadMap);

    Maybe you made a typo or edited something else which is causing the error.
     
    Back
    Top