• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Script] Applymovement failure :(

  • 222
    Posts
    7
    Years
    • Seen Nov 18, 2023
    Hey, I made a script that applies movement to the player:

    EDIT: Even after adding #raw 0xFE to end the movements (updated script below) it still is broken.

    Spoiler:


    But upon walking on that tile the game softlocks. What am I doing wrong?

    Note: this is the compiled version of the script in XSE; I used dynamic everything beforehand
     
    Last edited:
    If you put this script on a green "Script" tile (in AdvanceMap) than you must add setvar (and a var number) to the script.
    Like this:
    '---------------
    #org 0x71B317
    countpokemon
    compare LASTRESULT 0x0
    if 0x1 goto 0x871B337
    end

    '---------------
    #org 0x71B337
    lock
    msgbox 0x871B352 MSG_NORMAL '"OAK: Hold up!"
    applymovement MOVE_PLAYER 0x871B386
    msgbox 0x871B362 MSG_NORMAL '"OAK: Get a starter from me first!"
    setvar 0xVar number 0x1 <----------------------------------------------------------------------------------------------------------------------
    release
    end


    '---------
    ' Strings
    '---------
    #org 0x71B352
    = OAK: Hold up!

    #org 0x71B362
    = OAK: Get a starter from me first!


    '-----------
    ' Movements
    '-----------
    #org 0x71B386
    #raw 0x23 'Step on the Spot Left (Normal)
    #raw 0xFE
     
    You can do what Vytron said or add a 2 at var number and a 2 aat var value (at advance map)
     
    Newbie Mistakes Alert:
    1. The script you posted is complied. Posting uncompiled scripts is easier to read, to edit and to help with.
    I have uncompiled your script for you, please save all your scripts before putting them in your game and post the correct ones.
    Spoiler:

    2. You should explain what type of script you're using, what's working and what's not.
    Let's assume you're using an S Tile script, the green one in a-map.
    If NOTHING works, including the text, that's most likely because your S Tile does not have a var.

    To put it simply, when the player walks on the tile, the game checks if the var is equal to it's value. If it does, the script works, if it doesn't, it ignores them.
    Search for a list of free variables for the ROM you're hacking, don't forget to set it in a different script to the correct value and then the script will work.

    Other than that, the other possibility is that you've forgotten a waitmovement 0x0 line after the movement command.
    Spoiler:

    3. Your movement commands don't make sense.
    #raw 0x23
    #raw 0xFE
    Make the player only to stay on his spot and look left. It doesn't deny entry in any way as the player can just keep walking after the text is finished. Change them too, but you'll realize this after testing.

    4. In the case you messed up, and your script is for some reason incorrect and you'd like to edit it:
    DO NOT DIRECTLY EDIT THE SCRIPT FROM THE GAME
    Take your uncompiled script, edit it and recompile it.
    You're taking in more space, but it's worth it so you don't overwrite something and mess up your game.

    If you're hacking Emerald, in the beginning of each script write "#freespace 0xFF" so you don't overwrite anything [in XSE].
    If you're hacking Fire Red, stop and hack Emerald.

    Sorry for the lack of pictures, I'm pretty lazy;
    [as long as you're not too annoying] Come to PokeCommunity's Discord for further help, my current nickname is "Bliz But Better".​

    Happy hacking.
     
    Back
    Top