The PokéCommunity Forums Fan Games ROM Hacking
Script PLAYERFACING? [Emerald]

ROM Hacking Need a helping hand? You can get help on any ROM Hacking-related problems or questions you have here.


Reply
 
Thread Tools
  #1    
Old 4 Weeks Ago (10:59 AM).
Synonym's Avatar
Synonym Synonym is offline
Creator of Pokémon Darkfire
     
    Join Date: Nov 2010
    Location: London, UK
    Gender: Male
    Posts: 17
    Facing a problem with my XSE script. I wonder if anyone could help me. I'm hacking Pokémon 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

    Relevant Advertising!

      #2    
    Old 4 Weeks Ago (12:27 PM). Edited 4 Weeks Ago by Sky0fBlades.
    Sky0fBlades's Avatar
    Sky0fBlades Sky0fBlades is offline
       
      Join Date: Jan 2017
      Gender: Male
      Nature: Mild
      Posts: 63
      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 YouTube Channel
      My AdventureQuest/BattleOn character

      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    
      Old 3 Weeks Ago (11:12 AM).
      Synonym's Avatar
      Synonym Synonym is offline
      Creator of Pokémon Darkfire
         
        Join Date: Nov 2010
        Location: London, UK
        Gender: Male
        Posts: 17
        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

        Sponsored Links
        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 10:16 PM.