• 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!
  • Dawn, Gloria, Juliana, or Summer - 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.

[Other✓] Good ol' script freeze. [ANSWERED]

  • 63
    Posts
    12
    Years
    • Seen Dec 17, 2014
    I was simply wondering if anyone could take a quick look at this script here which causes the player to freeze when stepping on the script tile. I would be ever grateful tho whoever spots my mishap.

    Spoiler:
     
    Try getting rid of the "lock" command.

    I added the lock command after the freeze happened. So I've tested both with and without it, sadly, still a freeze. :/
    (Just did an additional test to doublecheck, froze.)
     
    Last edited:
    The script looks fine to me. I have dealt with similar problems when the script does not have a var number. Have you read "Flags, Vars, & Script Tiles"? (click here and go to the Script Tiles part.)

    Edit:
    This is what I usually make my script tiles look like:
    Spoiler:
     
    Last edited:
    Well apart from that, your message box has no type. It's far more simple to use a type than to use callstd for the same effect. But the freeze seems more like a script-to-map problem than anything else.

    ...You're using XSE, right? I'm not sure if some new script editor has come to take the crown in the past couple of years or not.
     
    The script looks fine to me. I have dealt with similar problems when the script does not have a var number. Have you read "Flags, Vars, & Script Tiles"? (click here and go to the Script Tiles part.)

    Edit:
    This is what I usually make my script tiles look like:
    Spoiler:

    So you are suggesting I remove the flag, which is only used due to the @done. And substitute it for a setvar which works, if I have understood it correctly as follows:
    Instead of setflag, I put for example
    setvar 4050 0x1

    for then to set the scripts to var 4050 and value 0.


    ...You're using XSE, right? I'm not sure if some new script editor has come to take the crown in the past couple of years or not.

    I do indeed, XSE is still the king, atleast to my understanding. I'll try removing callstd 0x5 and rather put msgbox @talk1 0x5. As you said, doubt that is it as its really more of a simpler process rather than a bugcause.


    EDIT.
    You could do that for efficiency, though I do not believe it to be necessary. As I said, I do not think anything is wrong with the script; however, I do believe the problem to be the script tile. If the var number of the script tile is 0000, the game freezes. So if it is 0000, change it to a safe var number (i.e. 4050 like in the image).

    The event now works, I am very grateful, however, it repeats itself whenever I step on the tile. What I did was setting the scripts var to 4011 and value 0. At the end of the script I set var 4050 to 0x1. (when it is compiled it says setvar FAB, no idea why.) Ah yes, so this has solved the freeze, which I am truly happy about, now to solve the repeating script. Unless you immediently see what I have done wrong I guess I can troubleshoot in the tutorial you linked to.
     
    Last edited:
    So you are suggesting I remove the flag, which is only used due to the @done. And substitute it for a setvar which works, if I have understood it correctly as follows:
    Instead of setflag, I put for example
    setvar 4050 0x1

    for then to set the scripts to var 4050 and value 0.

    You could do that for efficiency, though I do not believe it to be necessary. As I said, I do not think anything is wrong with the script; however, I do believe the problem to be the script tile. If the var number of the script tile is 0000, the game freezes. So if it is 0000, change it to a safe var number (i.e. 4050 like in the image).
     
    I'll agree with Mystery. It repeats itself because you have no flag, and thus, there is nothing to tell it not to replay the script. The checkflag and the pointer to @done exist so that the script will initiate, but it will end immediately after the check (giving the illusion that the script doesn't initiate at all).
     
    The event now works, I am very grateful, however, it repeats itself whenever I step on the tile. What I did was setting the scripts var to 4011 and value 0. At the end of the script I set var 4050 to 0x1. (when it is compiled it says setvar FAB, no idea why.) Ah yes, so this has solved the freeze, which I am truly happy about, now to solve the repeating script. Unless you immediently see what I have done wrong I guess I can troubleshoot in the tutorial you linked to.

    Variable numbers are in hex. As such, put the 0x before the var number in the script to tell XSE that it is in hex.

    Change the script tile's var number to the one you used in the script. You used 0x4011, so change the script tile var number to that. I believe this is the reason it repeats itself -- if you want to use a variable number as a prevention for it to repeat itself, you would need to make the variable number in the script match that of the script tile. If it continues to repeat itself after doing that, change the var value you have on the script tile to the one you are using (var value 0000 --> 0001)
     
    Script is working perfectly fine now. It repeated itself due to the Var number changed itself when compiling for some reason.
    Thank you very much guys, I did learn a lot today. I can finally continue this hack.

    Quick question though. Can I use the same var for different maps? or is it destructive to do so?
     
    Last edited:
    Script is working perfectly fine now. It repeated itself due to the Var number changed itself when compiling for some reason.
    Thank you very much guys, I did learn a lot today. I can finally continue this hack.

    Quick question though. Can I use the same var for different maps? or is it destructive to do so?

    The scripts with variables set to them will only activate if their variable is the exact value as the one in the script. in your case 0. Once you set it to 1 when the script is executed, it won't be repeated unless you set it to 0 again. So, the only way to actually reuse a variable properly, is to have your next script check for the variable with a value 1 instead of 0, then set its value to 2 in the script and so on. However, these scripts shouldn't be able to be avoided, since if you miss the script where the variable's value becomes 1 then the script that checks for value of 1 won't be executed. So it is possible to reuse a variable, perhaps for storyline or linked event. By doing this, you would have plenty of variables left for other kinds of script events.
     
    The scripts with variables set to them will only activate if their variable is the exact value as the one in the script. in your case 0. Once you set it to 1 when the script is executed, it won't be repeated unless you set it to 0 again. So, the only way to actually reuse a variable properly, is to have your next script check for the variable with a value 1 instead of 0, then set its value to 2 in the script and so on. However, these scripts shouldn't be able to be avoided, since if you miss the script where the variable's value becomes 1 then the script that checks for value of 1 won't be executed. So it is possible to reuse a variable, perhaps for storyline or linked event. By doing this, you would have plenty of variables left for other kinds of script events.

    Sounds good, cheers for answer. Var's have opened a new world for me, woopwoop.
     
    Back
    Top