• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - 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] Game freezes when this script runs

  • 10
    Posts
    4
    Years
    Very new to rom hacking, the error i have is that when this script is walked on the player gets locked in place. I think the game crashes, but the music keeps playing but the visuals all stop. its using pksv-ui if that helps

    any help appreciated :)

    #org 0x8740BE6 - i have put this in the script offset
    '-----------------------------------
    checkflag 0x256
    if false jump 0x8740BA5
    end


    #org 0x8740BA5
    '-----------------------------------
    setflag 0x256
    lock
    msgbox 0x8740A6A
    callstd MSG_LOCK
    reappear 0x4
    applymovement PLAYER 0x8740B8B
    applymovement 0x4 0x8740B8E
    msgbox 0x8740A78
    callstd MSG_YESNO
    msgbox 0x8740AA9
    callstd MSG_LOCK
    applymovement 0x4 0x8740B94
    disappear 0x4
    releaseall
    end

    #org 0x8740A6A
    = (speech, igonre this)

    #org 0x8740A78
    = (speech, igonre this)

    #org 0x8740AA9
    = (speech, igonre this)

    #org 0x8740B8B
    M (movement, igonre this)

    #org 0x8740B8E
    M (movement, igonre this)

    #org 0x8740B94
    M (movement, igonre this)
     
    Try setting a variable into the tile's var number in advance map. Set the var value to 0 and then never increment it and the tile should work properly forever

    thanks for the help :) it worked when i set the variable number to 0001, but i have a few questions
    -do i have to set other script tiles different values per map or at all?
    -if i set it back to 0000 will i get the same problem?
    -the game now resets at the line
    reappear 0x4
    is there a fix for this?
    thanks for the help again, sorry to bother u :)

    edit: on doing some further research, i found out that it is only the specific person i am trying to make appear that doesnt. their movement on advance map is set to hidden and they have a person id.
     
    Last edited:
    thanks for the help :) it worked when i set the variable number to 0001, but i have a few questions
    -do i have to set other script tiles different values per map or at all?
    -if i set it back to 0000 will i get the same problem?

    To clarify, the game can use a var number and var value to choose whether to activate a script tile the player has walked on or not. This is the same as saying "IF [var number] is currently [var value], activate the script. ELSE, just do nothing". Without this bit, some script tiles will just freeze the screen. This is especially useful when you need to stop a script from activating after a certain point, but since you're doing that with a checkflag inside your script anyway, you can just have the script tile activate infinitely. For that, you need an static variable whose value will never change. iirc I personally use 4001 as my static variable with var number at 0 (every variable is at 0 by default).
    I never use that variable inside my scripts, so I know it will always be 0, so all my permanent script tiles will be set to it.
    I should've mentioned earlier, but don't use a variable like 0001. It's probably used by the game for other things. Variables 0x4000 to 0x40FF (inclusive) are the safe ones to use.
    So yeah, to attempt to sum up, pick a permanent variable, keep its value the same forever, and put it on any permanent script tiles that are freezing the game (regardless of the map)

    -the game now resets at the line
    is there a fix for this?
    thanks for the help again, sorry to bother u :)

    edit: on doing some further research, i found out that it is only the specific person i am trying to make appear that doesnt. their movement on advance map is set to hidden and they have a person id.

    Are you still having trouble with this or did you fix it? I'm not really sure what you mean by the game "resets".
     
    Last edited:
    first off, thanks a bunch for the help at the first part, i understand this now
    secondly, by reset i mean the rom completely restarts and im sent back to the title screen.
    i am still getting issues with this, is it maybe something to do with their movement number? it is currently at 0
     
    first off, thanks a bunch for the help at the first part, i understand this now
    secondly, by reset i mean the rom completely restarts and im sent back to the title screen.
    i am still getting issues with this, is it maybe something to do with their movement number? it is currently at 0

    I'm not familiar with pksv commands - I assume reappear is meant to make a sprite appear like showsprite in xse. If so, we can probably figure why the sprite is misbehaving, but I have no idea why the game would completely reset at that line. Are you sure the script is straight up resetting the game? I don't even know where to begin with a problem like that
     
    ok, so i think i averted the issue
    i just occupied the character with something else while the script wasn't running so it looked natural.
    thanks for all the help though, i am eternally greatful :)
     
    Back
    Top