The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script PLAYERFACING? [Emerald]

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 June 20th, 2018 (10:59 AM).
Karl's Avatar
Karl Karl is offline
Creator of Pokémon Darkfire
 
Join Date: Nov 2010
Location: London, UK
Gender: Male
Nature: Calm
Posts: 168
Facing a problem with my XSE script. I wonder if anyone could help me. I'm hacking Pokmon Emerald.

My plan is to get the player to jump in a direction depending on where they are facing when they interact with the script.

I'm using an orange signpost script in AdvanceMap (not a person event or green tile), and I'm getting the @failed message when I compile the following script:

Spoiler:
Code:
#clean
#dynamic 0xB9B9E6

#org @start
lock
comparefarbytetobyte 0x2036E58 0x1
if 0x1 call @up
comparefarbytetobyte 0x2036E58 0x2
if 0x1 call @down
comparefarbytetobyte 0x2036E58 0x3
if 0x1 call @nope
comparefarbytetobyte 0x2036E58 0x4
if 0x1 call @nope
msgbox @failed 0x6
release
end

#org @up
msgbox @prompt 0x5
compare LASTRESULT 0x1
if 0x1 goto @ju
release
end

#org @nope
msgbox @no 0x6
release
end

#org @down
msgbox @prompt 0x5
compare LASTRESULT 0x1
if 0x1 goto @jd
release
end

#org @ju
pause 0x10
release
applymovement 0xFF @jumpup
sound 0xA
checksound
waitmovement 0x0
end

#org @jd
pause 0x10
release
applymovement 0xFF @jumpdown
sound 0xA
checksound
waitmovement 0x0
end

#org @prompt
= There is a small gap between the water.\nWould you like to jump across it?

#org @no
= Sorry\hb0\nYou can't do that now.

#org @jumpup
#raw 0xD
#raw 0xFE

#org @jumpdown
#raw 0xC
#raw 0xFE

#org @failed
= Script error.


I'm 99% sure the comparefarbytetobyte value of 0x2036E58 is wrong (I copied this from a working FR script but have no idea how to find the right value).

I have tried copying var 0x8000 and comparing, and I've also tried the standard PLAYERFACING command, but both don't work on an orange script box (on a person event it works fine).

If anyone knows a way to get this to work I'd appreciate it!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old June 24th, 2018 (12:27 PM). Edited June 24th, 2018 by SkyVortex.
SkyVortex's Avatar
SkyVortex SkyVortex is offline
 
Join Date: Jan 2017
Location: Ice Path
Gender: Male
Nature: Mild
Posts: 228
I have ran into a similar problem before. I don't know if this will work in your case, but you could try having the script check the player's X-Y coordinates ("getplayerpos" command) instead of which way they are facing.

Try something like this:
Code:
getplayerpos 0x[Variable to store X] 0x[Variable to store Y]
compare 0x[Variable X] 0x[X-coordinate in Advance Map]
if 0x1 goto @next
__________________

My Twitch.TV Channel
My YouTube Channel
My AdventureQuest/BattleOn character (best viewed with a Flash Player extension enabled)
My OldSchool RuneScape character (if I'm online in-game, feel free to send me a message)

My Tutorials:
Stabilizing Pokemon Emerald (Preventing Corruption)
[Emerald] Controlling Trainer Battle Music... Without ASM
How to Fix the 64K Save 'White-Screen' in VBA Without Save-States

My ROM Hack:
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old June 27th, 2018 (11:12 AM).
Karl's Avatar
Karl Karl is offline
Creator of Pokémon Darkfire
 
Join Date: Nov 2010
Location: London, UK
Gender: Male
Nature: Calm
Posts: 168
Quote:
Originally Posted by Sky0fBlades View Post
I have ran into a similar problem before. I don't know if this will work in your case, but you could try having the script check the player's X-Y coordinates ("getplayerpos" command) instead of which way they are facing.
Thanks for sharing this method (and your Stabilizing Emerald tutorial), it's working great for me!
__________________

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