The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Game freezes when this script runs

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old March 8th, 2021 (8:53 AM).
exoticbutters50's Avatar
exoticbutters50 exoticbutters50 is offline
 
Join Date: Mar 2021
Location: Bri' 'an
Gender: Male
Nature: Adamant
Posts: 10
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)
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old March 8th, 2021 (9:47 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
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
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old March 8th, 2021 (11:10 AM). Edited March 8th, 2021 by exoticbutters50.
exoticbutters50's Avatar
exoticbutters50 exoticbutters50 is offline
 
Join Date: Mar 2021
Location: Bri' 'an
Gender: Male
Nature: Adamant
Posts: 10
Quote:
Originally Posted by Asith View Post
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
Quote:
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.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old March 8th, 2021 (7:11 PM). Edited March 8th, 2021 by Asith.
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Quote:
Originally Posted by exoticbutters50 View Post
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)

Quote:
Originally Posted by exoticbutters50 View Post
-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".
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old March 9th, 2021 (7:37 AM).
exoticbutters50's Avatar
exoticbutters50 exoticbutters50 is offline
 
Join Date: Mar 2021
Location: Bri' 'an
Gender: Male
Nature: Adamant
Posts: 10
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
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old March 9th, 2021 (10:04 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Quote:
Originally Posted by exoticbutters50 View Post
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
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old March 9th, 2021 (10:36 AM).
exoticbutters50's Avatar
exoticbutters50 exoticbutters50 is offline
 
Join Date: Mar 2021
Location: Bri' 'an
Gender: Male
Nature: Adamant
Posts: 10
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 :)
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:18 AM.