The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script I'm having odd script issues.

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 November 16th, 2017 (12:40 PM).
Zelly_9191's Avatar
Zelly_9191 Zelly_9191 is offline
 
Join Date: Mar 2014
Location: Canada
Gender: Female
Posts: 7
This has been driving me crazy but I'm making a script on the ground and setting the variable at 8002.
I'm then using the following script in the script square.
Pksv UI script:
Spoiler:

#dyn 0x740000
#org @start
'-----------------------------------
lockall
setvar 0x8002 0x0
checkflag 0x21A
if true jump @finished ' Flag is set
checkflag 0x21C
if true jump @afterwarp ' Flag is set
checkflag 0x219
if true jump @staycave ' Flag is set
message @voice ' You hear a raspy voi...
callstd MSG_NORMAL
compare PLAYERFACING DOWN
if == call @sup
compare PLAYERFACING UP
if == call @sdown
releaseall
end

#org @finished
'-----------------------------------
releaseall
end

#org @afterwarp
'-----------------------------------
message @serious ' Seriously?
callstd MSG_NORMAL
compare PLAYERFACING DOWN
if == call @sup
compare PLAYERFACING UP
if == call @sdown
releaseall
end

#org @sdown
'-----------------------------------
applymovement PLAYER @down
pauseevent 0x0
return

#org @sup
'-----------------------------------
applymovement PLAYER @up
pauseevent 0x0
return

#org @staycave
'-----------------------------------
compare PLAYERFACING UP
if == jump @finished ' Equal To
message @waterhere ' Maybe someone here\n...
callstd MSG_NORMAL
call @sup
releaseall
end


#org @voice
= You hear a raspy voice\nto your right.\pHelp me.....\nplease.....

#org @serious
= Seriously?

#org @waterhere
= Maybe someone here\nhas some fresh water.

#org @down
m walk_down look_up end

#org @up
m walk_up look_down end

Sorry for my spaghetti code.

However, it seems the first time the script is walked on the player isn't moved. After the first flag (219), the player is always moved down regardless of the direction the script was walked on, and the second flag (21C ), once again won't move the player after going through the text it just releases all and ends. The final flag (21A) is working as intended it locks then releases and ends. can anyone tell me why this is happening? I just don't understand, it makes no sense.
If anyone can help me it would be very much appreciated. Thanks!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old December 2nd, 2017 (2:54 PM).
Zelly_9191's Avatar
Zelly_9191 Zelly_9191 is offline
 
Join Date: Mar 2014
Location: Canada
Gender: Female
Posts: 7
I'm going to try bumping this thread as I still need help sorry if it's against the rules. I couldn't find anything on it being disallowed.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old December 9th, 2017 (12:20 AM).
Bela Bela is offline
Banned
 
Join Date: Apr 2009
Location: United States
Age: 33
Gender: Male
Nature: Modest
Posts: 262
Quote:
Originally Posted by Nevik_9191 View Post
.
Oh man. That is very spaghetti scripting there.

I think your issue may have something to do with relying on PLAYERFACING to trigger your player's movement, which btw I think is a weird thing to do in a script anyway. Usually, you just allow the player to move the player on their own, not force them to move in a direction. That's just a minor game design critique for you, though. PLAYERFACING (var 0x800C in FireRed) only updates when you press the A button, so you can't reliably use it in event tiles like this.

I think you should rewrite this event, and use a single var instead of flags for the conditions. Tile scripts are more suited to var use anyway! I think it would look something like this:

(This is in XSE format, and assumes your script uses var 4001, a temp var used in events like the Safari Zone entrance scripts)

Code:
#org @event
lockall
compare 0x4050 0x3
if 0x4 goto @finished
compare 0x4050 0x2
if 0x1 goto @afterwarp
compare 0x4050 0x1
if 0x1 goto @staycave
msgbox @voice 0x4 'This is a preference of mine, used with closeonkeypress
closeonkeypress
setvar 0x4001 0x1
releaseall
end

#org @afterwarp
msgbox @serious 0x4
closeonkeypress
setvar 0x4001 0x1
releaseall
end

#org @afterwarp
msgbox @water 0x4
closeonkeypress
setvar 0x4050 0x2
setvar 0x4001 0x1
releaseall
end
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old January 3rd, 2018 (3:49 PM).
Zelly_9191's Avatar
Zelly_9191 Zelly_9191 is offline
 
Join Date: Mar 2014
Location: Canada
Gender: Female
Posts: 7
Ahh, thanks for the response I've been busy and didn't have a chance to reply. (Sorry about the bump. Mods, feel free to lock if this was against the rules.)
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

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:17 AM.