• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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] Pokemon Script Box freezes game?

  • 7
    Posts
    9
    Years
    • Seen May 25, 2015
    Hi guys, I'm a new ROM hacker, started a few day ago. I got all my necessary tools ready.

    Yesterday, I created a script box on A-Map and placed it on of the tiles. I scripted a cutscene there. I decompiled, debugged and saved my ROM, then I decided to give it a test. I opened the file and when I stepped on that tile, my game froze. The cutscene did not play out but instead freezes my game. The music was playing but I can't seem to move. I searched for solutions on the Internet but to no avail.

    Then, I edited the script into a basic message box script, thinking that the long cutscene one might have some mistakes in it, causing the error. However, my game froze again. I have set everything right, debugged with no errors. My settings of the Script Box event can be found here : https://imgur.com/hJfEcAp

    Any ideas out there? Please help me, thanks for reading :)
     
  • 417
    Posts
    9
    Years
    • Seen Nov 20, 2016
    Here's how those script tiles work: when the player steps on the tile, the game essentially compares the "Var Value" of "Var number" indicated in A-Map to the var value of that var in the game. So with what you've posted, when your in game player steps on the tile you've scripted, the game basically tries to read the value of the nonexistent variable zero, and unsurprisingly, freezes. To make your scene work, you need to change "Var value" to a safe variable.

    Fire Red: https://www.pokecommunity.com/showthread.php?t=302347
    Emerald: https://www.pokecommunity.com/showthread.php?t=330008 That's just flags but I'm sure a variable list exists somewhere...

    If this is the first time using the variable in the game, leaving "Var value" at zero should be fine. Then, if you only want it to trigger one time, you need to add to your script: setvar 0x[YourChosenVar] 0x[SomeOtherValue]
     
    Last edited:
  • 7
    Posts
    9
    Years
    • Seen May 25, 2015
    Uhh, I have an issue again. It works but after that I set var to 0x6000 0x0001 so that it only happens once. Then, I tested it out to see if it will work, and it worked! But, I have already set the var value and no. differently but the script is still occuring again.Why is this so?
     
    Last edited:
  • 417
    Posts
    9
    Years
    • Seen Nov 20, 2016
    Uhh, I have an issue again. It works but after that I set var to 0x6000 0x0001 so that it only happens once. Then, I tested it out to see if it will work, and it worked! But, I have already set the var value and no. differently but the script is still occuring again.Why is this so?
    Did you read the list in the link? Variable 6000 is "confirmed unsafe," at least in fire red. If you're using emerald, perhaps the vars are a little different, but I highly doubt 0x6000 is even close to a real variable.
     
    Last edited:

    C me

    Creator of Pokemon League Of Legends
  • 681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    Did you read the list in the link? Variable 6000 is "confirmed unsafe," at least in fire red. If you're using emerald, perhaps the vars are a little different, but I highly doubt 0x6000 is even close to a real variable.

    6000 is unsafe in Emerald too.
     
  • 7
    Posts
    9
    Years
    • Seen May 25, 2015
    I'm sorry for my mistake. Now I've set my variables to a safe one but now, my game freezes. This is really confusing, can someone please explain it to me :(

    EDIT: Now, I set my var value to 4051 and my var no. to 4051 and nothing happened. I walked past it and the script didn't activate at all.
    I think for the previous error I got, (setting a safe var. but freezing) is because some other var. in this ROM I'm modifying has that same var. Is it possible?
     
    Last edited:

    C me

    Creator of Pokemon League Of Legends
  • 681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    Var number could be 4051 but var value is usually a small number like 0-5. The var value being 1 less than the setvar from the script.

    Can we see your script?
     
  • 7
    Posts
    9
    Years
    • Seen May 25, 2015
    Thanks for the reply :) I would like to ask, if I don't set my var value to 4051, my script wouldn't run because they have to be the same. Anyways, here's my script. ( I made a simpler version with just a msgbox and setvar. )

    Spoiler:


    Here's my settings for the script event: https://imgur.com/K5n0qd3
     

    C me

    Creator of Pokemon League Of Legends
  • 681
    Posts
    10
    Years
    • Seen Apr 9, 2021
    Thanks for the reply :) I would like to ask, if I don't set my var value to 4051, my script wouldn't run because they have to be the same. Anyways, here's my script. ( I made a simpler version with just a msgbox and setvar. )

    Spoiler:


    Here's my settings for the script event: https://imgur.com/K5n0qd3

    Make it sevar 0x4051 0x1 and change the var value to 0.
     
    Back
    Top