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

Closed Thread
 
Thread Tools
  #7476    
Old December 11th, 2012 (9:17 AM).
TrjanFaic's Avatar
TrjanFaic TrjanFaic is offline
     
    Join Date: Dec 2012
    Location: Under the rainbow, racking some leprechauns.
    Gender: Male
    Posts: 6
    Quote:
    Originally Posted by itman View Post
    (I assume you're using pokescript due to the use of '$', so I wrote this assuming it's for pokescript)

    #org $script
    lock
    faceplayer
    message $example
    boxset 6
    release
    end

    #org $example
    = Hello there!
    I have no idea what is wrong but now it will not react whenever i try to talk to the guy, I'm using pokescript and Advance map to put the script in, could anyone also explain some stuff about the script?
    I know lock locks the player and faceplayer makes him look at the main character, but can you change the: $script part in the #org $script?
    I'm just wondering, seems like most people use their own little text there, like this: #org $lolfaic
    But anyhow, if you need me to show you what is happening i could easily upload a video of it on youtube if you would like that?
    __________________
    TrojanFaic, spelled wrong.
    Hunger games fan, pokemon fan, and all the sorts, even a....
    PURPLE BACON FAN!!!

    Relevant Advertising!

      #7477    
    Old December 11th, 2012 (9:56 AM).
    itman itman is offline
    Back to ROM hacking. :D
       
      Join Date: May 2007
      Age: 23
      Nature: Adamant
      Posts: 100
      Quote:
      Originally Posted by TrjanFaic View Post
      I have no idea what is wrong but now it will not react whenever i try to talk to the guy, I'm using pokescript and Advance map to put the script in, could anyone also explain some stuff about the script?
      I know lock locks the player and faceplayer makes him look at the main character, but can you change the: $script part in the #org $script?
      I'm just wondering, seems like most people use their own little text there, like this: #org $lolfaic
      But anyhow, if you need me to show you what is happening i could easily upload a video of it on youtube if you would like that?
      Try it now...I haven't used pokescript in like 3 years xD

      #org $script
      lock
      faceplayer
      message $example
      boxset 6
      release
      end

      #org $example
      $example 1 = Hello there!
        #7478    
      Old December 12th, 2012 (8:50 AM).
      TrjanFaic's Avatar
      TrjanFaic TrjanFaic is offline
         
        Join Date: Dec 2012
        Location: Under the rainbow, racking some leprechauns.
        Gender: Male
        Posts: 6
        Quote:
        Originally Posted by itman View Post
        Try it now...I haven't used pokescript in like 3 years xD

        #org $script
        lock
        faceplayer
        message $example
        boxset 6
        release
        end

        #org $example
        $example 1 = Hello there!
        Do I add the last bit at the end or what?
        Heh heh.
        __________________
        TrojanFaic, spelled wrong.
        Hunger games fan, pokemon fan, and all the sorts, even a....
        PURPLE BACON FAN!!!
          #7479    
        Old December 12th, 2012 (8:56 PM).
        Noossab Blue's Avatar
        Noossab Blue Noossab Blue is offline
           
          Join Date: Dec 2012
          Location: USA
          Gender: Female
          Nature: Quirky
          Posts: 241
          I've only been scripting a few weeks, and I'm trying to make a relatively simple script where a man checks if you have a badge and moves if you do. I used the pallet town sign girl as a model. Currently he talks but doesn't move...help?

          Spoiler:
          #dynamic 0x800000
          #org @start
          lock
          faceplayer
          checkflag 0x822
          if 0x1 goto @beat
          msgbox @lose
          callstd 0x4
          release
          end

          #org @beat
          msgbox @win
          callstd 0x4
          closeonkeypress
          compare PLAYERFACING 0x4
          if 0x1 call @move1
          compare PLAYERFACING 0x4
          if 0x5 call @move2
          release
          end

          #org @move1
          applymovement 0x16 @moveone
          waitmovement 0x0
          return

          #org @move2
          applymovement 0x16 @movetwo
          waitmovement 0x0
          return

          #org @moveone
          #raw 13
          #raw 2F
          #raw FE

          #org @movetwo
          #raw 12
          #raw 30
          #raw FE

          #org @lose
          = You haven't beaten COLE yet?\nThen you have no chance against DAISY.

          #org @win
          = Ah, I see you've beaten COLE.\nThen take your chance with DAISY!
            #7480    
          Old December 12th, 2012 (11:23 PM). Edited December 12th, 2012 by miksy91.
          miksy91's Avatar
          miksy91 miksy91 is offline
          Dark Energy is back in action! ;)
             
            Join Date: Oct 2008
            Location: A small country in the North
            Gender: Male
            Nature: Relaxed
            Posts: 1,435
            Quote:
            Originally Posted by Noossab Blue View Post
            I've only been scripting a few weeks, and I'm trying to make a relatively simple script where a man checks if you have a badge and moves if you do. I used the pallet town sign girl as a model. Currently he talks but doesn't move...help?

            Spoiler:
            #dynamic 0x800000
            #org @start
            lock
            faceplayer
            checkflag 0x822
            if 0x1 goto @beat
            msgbox @lose
            callstd 0x4
            release
            end

            #org @beat
            msgbox @win
            callstd 0x4
            closeonkeypress
            compare PLAYERFACING 0x4
            if 0x1 call @move1
            compare PLAYERFACING 0x4
            if 0x5 call @move2
            release
            end

            #org @move1
            applymovement 0x16 @moveone
            waitmovement 0x0
            return

            #org @move2
            applymovement 0x16 @movetwo
            waitmovement 0x0
            return

            #org @moveone
            #raw 13
            #raw 2F
            #raw FE

            #org @movetwo
            #raw 12
            #raw 30
            #raw FE

            #org @lose
            = You haven't beaten COLE yet?\nThen you have no chance against DAISY.

            #org @win
            = Ah, I see you've beaten COLE.\nThen take your chance with DAISY!
            I won't be much of help saying specifically what to fix and where (never used XSE to hack 3rd gen) but by the looks of it, you've got something here written wrong:

            callstd 0x4
            closeonkeypress
            compare PLAYERFACING 0x4
            if 0x1 call @move1

            If "closeonkeypress" stands for closing the text box after A button is displayed then that's not the problem. What's "callstd 0x4" for? If you're simply going to load the variable "PLAYERFACING" somewhere in ram and compare it to 0x1 (with "if 0x1 then..."), I don't see a point in having that kind of command there.

            In GSC, "if codes" cannot be used to call anything so that may be your problem as well. In GSC, they're type "if 0x1 "pointer" (or instead of "pointer", put that jump @move1 here).
            Try ending the scripts without "if call" codes by replacing them to "jumps". Also that way, if the person can only be talked from two directions like I assume by your script, you should change the ending of the script a little bit (this time, I made an assumption that subscripts are ended with "return" while the main scripts ends with "end"):

            Code:
            compare PLAYERFACING 0x4
            if 0x1 @move1 (not sure if this instruction is now right or not)
            applymovement 0x16 @movetwo
            waitmovement 0x0
            release
            end
             
            @move1
            applymovement 0x16 @moveone
            waitmovement 0x0
            release
            end
            And if the upper doesn't solve the problem, try what happens if you take out that "0x4" next to PLAYERFACING (it can be right to have it there but doesn't sound right to me, really depends on how "compare" command works).
            __________________
            My Rom Hack



            Fixing bugs in a ROM hack
            CP of encountered pokemon in GO

            Learn how to hack GB/C games:

            Check my GameBoy/Color hacking videos in Youtube
            -The video set uses Pokemon Silver (U) rom for demonstrations
              #7481    
            Old December 13th, 2012 (10:00 AM).
            TrjanFaic's Avatar
            TrjanFaic TrjanFaic is offline
               
              Join Date: Dec 2012
              Location: Under the rainbow, racking some leprechauns.
              Gender: Male
              Posts: 6
              Could someone help me?
              Really new at scripting and such so i am confused, but anyhow, it would be a problem i have never confronted in all my days of scripting xD
              __________________
              TrojanFaic, spelled wrong.
              Hunger games fan, pokemon fan, and all the sorts, even a....
              PURPLE BACON FAN!!!
                #7482    
              Old December 13th, 2012 (1:57 PM).
              Noossab Blue's Avatar
              Noossab Blue Noossab Blue is offline
                 
                Join Date: Dec 2012
                Location: USA
                Gender: Female
                Nature: Quirky
                Posts: 241
                Quote:
                Originally Posted by miksy91 View Post
                I won't be much of help saying specifically what to fix and where (never used XSE to hack 3rd gen) but by the looks of it, you've got something here written wrong:

                callstd 0x4
                closeonkeypress
                compare PLAYERFACING 0x4
                if 0x1 call @move1

                If "closeonkeypress" stands for closing the text box after A button is displayed then that's not the problem. What's "callstd 0x4" for? If you're simply going to load the variable "PLAYERFACING" somewhere in ram and compare it to 0x1 (with "if 0x1 then..."), I don't see a point in having that kind of command there.

                In GSC, "if codes" cannot be used to call anything so that may be your problem as well. In GSC, they're type "if 0x1 "pointer" (or instead of "pointer", put that jump @move1 here).
                Try ending the scripts without "if call" codes by replacing them to "jumps". Also that way, if the person can only be talked from two directions like I assume by your script, you should change the ending of the script a little bit (this time, I made an assumption that subscripts are ended with "return" while the main scripts ends with "end"):

                Code:
                compare PLAYERFACING 0x4
                if 0x1 @move1 (not sure if this instruction is now right or not)
                applymovement 0x16 @movetwo
                waitmovement 0x0
                release
                end
                 
                @move1
                applymovement 0x16 @moveone
                waitmovement 0x0
                release
                end
                And if the upper doesn't solve the problem, try what happens if you take out that "0x4" next to PLAYERFACING (it can be right to have it there but doesn't sound right to me, really depends on how "compare" command works).
                -callstd 0x4 I believe just assigns the correct text box to the above message.
                -When I remove call from the if command and debug it it says it assumes call, and when I reopen the script it adds call back in.
                -When I removed 0x4 from compare PLAYERFACING it gives me an error saying I'm missing a parameter.

                I think I might need to use a different command than compare PLAYERFACING. The man with this script is standing directly infront of a gym door, so he can be approached from 3 sides. From below or from the left I want him to move right and from the right I want him to move left. I believe the script I modeled this after is the same, so I don't know why it isn't working...

                Here's the original again:
                Spoiler:
                Code:
                '-----------------------
                #org 0x8010FD
                lock
                faceplayer
                checkflag 0x822
                if 0x1 goto 0x8801113
                msgbox 0x8801155 '"You haven't beaten COLE yet?\nThen ..."
                callstd 0x4
                release
                end
                
                '-----------------------
                #org 0x801113
                msgbox 0x880119B '"Ah, I see you've beaten COLE.\nThen..."
                callstd 0x4
                closeonkeypress
                compare PLAYERFACING 0x4
                if 0x1 call 0x8801135
                compare PLAYERFACING 0x4
                if 0x5 call 0x8801141
                release
                end
                
                '-----------------------
                #org 0x801135
                applymovement 0x1000 0x880114D
                waitmovement 0x0
                return
                
                '-----------------------
                #org 0x801141
                applymovement 0x1000 0x8801151
                waitmovement 0x0
                return
                
                
                '-----------
                ' Movements
                '-----------
                #org 0x80114D
                #raw 13 'Step Right (Normal)
                #raw 2F 'Face Left (Delayed)
                #raw FE 'End of Movements
                
                #org 0x801151
                #raw 12 'Step Left (Normal)
                #raw 30 'Face Right (Delayed)
                #raw FE 'End of Movements
                
                
                '---------
                ' Strings
                '---------
                #org 0x801155
                = You haven't beaten COLE yet?\nThen you have no chance against DAISY.
                
                #org 0x80119B
                = Ah, I see you've beaten COLE.\nThen take your chance with DAISY!
                __________________
                IGN: Anna/Noossab Blue
                3DS FC: 3196 3609 8450

                Thanks to SilverGrey for the awesome banner! Click to see!
                Current as of 1/31/14: I updated again!

                  #7483    
                Old December 13th, 2012 (9:40 PM).
                miksy91's Avatar
                miksy91 miksy91 is offline
                Dark Energy is back in action! ;)
                   
                  Join Date: Oct 2008
                  Location: A small country in the North
                  Gender: Male
                  Nature: Relaxed
                  Posts: 1,435
                  Then I believe the problem is with the parameter adjusted to the PLAYERFACING command there. Also are you certain the values with if commands have to be certainly 0x1 and 0x5 there?

                  Personally, I'd assume the four directions would be numbered from 00 to 03 or from 01 to 04. Again I'm talking about G/S/C here but in it, Gamefreak programmed facing values so that when you were facing down, your facing in ram would be set to 00, if up 01, if left 02 and if right 03. If this is the case in the game you're hacking, the values would most likely be 01 and 03 (because you can approach him from below making you face up and from the left making you face right).

                  Also one thing to note would be that you don't need to compare PLAYERFACING twice. This is how the coding works out; compare PLAYERFACING actually (very likely) moves a byte from certain ram address, "PLAYERFACING", to another ram location, let's call this "RAM". "if" instructions are made to check whether "RAM" is set to a certain value and if it is, then continue interpreting after the pointer (like you have here, 0x8801135 and 0x8801141).
                  Because "if" insctructions don't affect "RAM" in any way, you can have a multiply of them in an order if you're using them for checking the exactly same thing (like is done here).

                  But yeah, try changing the values followed by "if" and if that doesn't work, check what XSE has told about PLAYERFACING command and its usage.
                  Also as it's not a problem with this script, you don't have to change it but it's often simplifies stuff a lot if you use "if" instructions to jump to another part of that main-/subscript instead of calling anything. As you said it didn't work out by removing the "call" part, try re-writing it with jump and see if something else happens (or check what XSE has written about this instruction as well).

                  Hopefully this will work out
                  __________________
                  My Rom Hack



                  Fixing bugs in a ROM hack
                  CP of encountered pokemon in GO

                  Learn how to hack GB/C games:

                  Check my GameBoy/Color hacking videos in Youtube
                  -The video set uses Pokemon Silver (U) rom for demonstrations
                    #7484    
                  Old December 14th, 2012 (5:24 AM).
                  Saigyouji Yuyuko's Avatar
                  Saigyouji Yuyuko Saigyouji Yuyuko is offline
                  Meikai no Ohime-sama
                     
                    Join Date: Nov 2012
                    Location: Ya karikuran kanimu
                    Gender: Male
                    Nature: Relaxed
                    Posts: 5
                    ;Notes
                    ;Placeholders will be, of course, replaced by proper pointers when empty regions that fit their size requirements are found.
                    ;Pokemart sales will be divided by three clerks.
                    ;Only samples to showcase my theory will be posted here; I wouldn't bother with the complete code as of yet.
                    ;Please tell me if there is something wrong with anything within this theory. I would love to have the layout perfected before I start bothering with actually finding the free space and creating the actual scripts.
                    ;If it is alright, can someone give me estimations as to the total space needed for the entire codeset [or at least tell me how to estimate]? I have a hundred and ten megabytes free space in my ROM.
                    ;---------------------------------------------
                    #org [Placeholder_Masterscriptclerk1]
                    lock
                    faceplayer
                    msgbox 0x81A6211
                    checkflag FR_BADGE_8
                    if true jump [Placeholder_Mart8Clerk1]
                    checkflag FR_BADGE_7
                    if true jump [Placeholder_Mart7Clerk1]
                    checkflag FR_BADGE_6
                    if true jump [Placeholder_Mart6Clerk1]
                    checkflag FR_BADGE_5
                    if true jump [Placeholder_Mart5Clerk1]
                    checkflag FR_BADGE_4
                    if true jump [Placeholder_Mart4Clerk1]
                    checkflag FR_BADGE_3
                    if true jump [Placeholder_Mart3Clerk1]
                    checkflag FR_BADGE_2
                    if true jump [Placeholder_Mart2Clerk1]
                    checkflag FR_BADGE_1
                    if true jump [Placeholder_Mart1Clerk1]
                    mart [Placeholder_Mart0Clerk1Mart]
                    msgbox 0x81A5190
                    callstd MSG_NOCLOSE
                    release
                    end
                    ;---------------------------------------------
                    ;Clerk 2 cannot be unlocked until the 3rd badge and 3 until the 5rd badge, so their codes will follow this pattern:
                    '-----------------------------------
                    #org [Placeholder_Masterscriptclerk3]
                    lock
                    faceplayer
                    checkflag FR_BADGE_5
                    if false jump [Placeholder_DiaUnavailableClerk]
                    msgbox 0x81A6211
                    checkflag FR_BADGE_8
                    if true jump [Placeholder_Mart8Clerk3]
                    checkflag FR_BADGE_7
                    if true jump [Placeholder_Mart7Clerk3]
                    checkflag FR_BADGE_6
                    if true jump [Placeholder_Mart6Clerk3]
                    mart [Placeholder_Mart5Clerk3Mart]
                    msgbox 0x81A5190
                    callstd MSG_NOCLOSE
                    release
                    end
                    ;------------------------------
                    #org [Placeholder_DiaUnavailableClerk]
                    msgbox [Placeholder_Unavailableclerk]
                    end
                    ;-------------------------------
                    #org [Placeholder_Mart1Clerk1]
                    showmsg
                    pokemart [Placeholder_Mart1Clerk1Mart]
                    msgbox 0x81A5190
                    callstd MSG_NOCLOSE
                    release
                    end
                    ;------------------------------------
                    #org [Placeholder_Mart4Clerk1]
                    showmsg
                    pokemart [Placeholder_Mart4Clerk1Mart]
                    msgbox 0x81A5190
                    callstd MSG_NOCLOSE
                    release
                    end
                    ;------------------------------------

                    #org 0x81A6211
                    = Hi, there!\nMay I help you?

                    #org 0x81A5190
                    = Please come again!

                    #org [Placeholder_Unavailableclerk]
                    = I am sorry, but you may not buy wares\nfrom me until you gain more\lbadges.

                    #org [Placeholder_Mart0Clerk1Mart]
                    item POKEBALL
                    item POTION
                    item ANTIDOTE
                    item PARLYZHEAL
                    item AWAKENING
                    endmart

                    #org [Placeholder_Mart1Clerk1Mart]
                    item POKEBALL
                    item POTION
                    item ANTIDOTE
                    item PARLYZHEAL
                    item AWAKENING
                    item BURNHEAL
                    item ICEHEAL
                    endmart

                    #org [Placeholder_Mart4Clerk1Mart] [is retaining the pokeballs, basic status healers and basic potions a good idea?]
                    item POKEBALL
                    item GREATBALL
                    item ULTRABALL
                    item POTION
                    item SUPERPOTION
                    item ANTIDOTE
                    item PARLYZHEAL
                    item AWAKENING
                    item BURNHEAL
                    item ICEHEAL
                    item FULLHEAL
                    endmart

                    ;I want to know if there's anything wrong with this and if it will work.
                    __________________
                    Kono kata e
                    Kai kono tao ra
                    Mou ba kara?

                    Kon kata e
                    Namatai na kono
                    Nawara ba ta?

                    Quote:
                    This person has a Touhoumon hack in progress. What is Touhoumon? A touhou hack of Pokemon. In other words, this person is hacking a hack. This person is a writer as well, but has resorted to this person's old hobby of hacking as this person has been hit by a writer's block.
                    -Yterv Godrul
                      #7485    
                    Old December 14th, 2012 (6:50 AM).
                    metalflygon08's Avatar
                    metalflygon08 metalflygon08 is offline
                    BIG PECKS
                       
                      Join Date: Jan 2010
                      Gender: Male
                      Posts: 189
                      I've been scripting for a while now, but never have figured out how to do this.

                      (Scripting in HGSS fyi)

                      How do you do the scripts where you step somewhere and an event happens from that? (like the oak before you can leave Pallet town in 1st gen)
                      __________________

                      Current Fakemon Creation
                        #7486    
                      Old December 14th, 2012 (9:10 AM).
                      TrjanFaic's Avatar
                      TrjanFaic TrjanFaic is offline
                         
                        Join Date: Dec 2012
                        Location: Under the rainbow, racking some leprechauns.
                        Gender: Male
                        Posts: 6
                        RAWR!
                        Canz someon halp me?
                        This would be a very helpful forum if someone did.
                        LOL, it already is quite helpful, but still, need that script helped on.
                        Just a basic script making a guy talk to you, that is it, just like the fat guy in PKMN Sapphire, i am using Advance Map 1.95 and poke script.
                        __________________
                        TrojanFaic, spelled wrong.
                        Hunger games fan, pokemon fan, and all the sorts, even a....
                        PURPLE BACON FAN!!!
                          #7487    
                        Old December 14th, 2012 (5:05 PM). Edited December 14th, 2012 by Noossab Blue.
                        Noossab Blue's Avatar
                        Noossab Blue Noossab Blue is offline
                           
                          Join Date: Dec 2012
                          Location: USA
                          Gender: Female
                          Nature: Quirky
                          Posts: 241
                          Quote:
                          Originally Posted by miksy91 View Post
                          Then I believe the problem is with the parameter adjusted to the PLAYERFACING command there. Also are you certain the values with if commands have to be certainly 0x1 and 0x5 there?

                          Personally, I'd assume the four directions would be numbered from 00 to 03 or from 01 to 04. Again I'm talking about G/S/C here but in it, Gamefreak programmed facing values so that when you were facing down, your facing in ram would be set to 00, if up 01, if left 02 and if right 03. If this is the case in the game you're hacking, the values would most likely be 01 and 03 (because you can approach him from below making you face up and from the left making you face right).

                          Also one thing to note would be that you don't need to compare PLAYERFACING twice. This is how the coding works out; compare PLAYERFACING actually (very likely) moves a byte from certain ram address, "PLAYERFACING", to another ram location, let's call this "RAM". "if" instructions are made to check whether "RAM" is set to a certain value and if it is, then continue interpreting after the pointer (like you have here, 0x8801135 and 0x8801141).
                          Because "if" insctructions don't affect "RAM" in any way, you can have a multiply of them in an order if you're using them for checking the exactly same thing (like is done here).

                          But yeah, try changing the values followed by "if" and if that doesn't work, check what XSE has told about PLAYERFACING command and its usage.
                          Also as it's not a problem with this script, you don't have to change it but it's often simplifies stuff a lot if you use "if" instructions to jump to another part of that main-/subscript instead of calling anything. As you said it didn't work out by removing the "call" part, try re-writing it with jump and see if something else happens (or check what XSE has written about this instruction as well).

                          Hopefully this will work out
                          Here's what I did try to fix this script:

                          Spoiler:
                          I tried changing that part of the script to this, with the same problem:
                          Code:
                          #org @beat
                          msgbox @win
                          callstd 0x4
                          closeonkeypress
                          compare PLAYERFACING 0x2
                          if 0x1 call @move1
                          compare PLAYERFACING 0x4
                          if 0x1 call @move1
                          compare PLAYERFACING 0x3
                          if 0x1 call @move2
                          release
                          end
                          this...also with the same problem
                          Code:
                          #org @beat
                          msgbox @win
                          callstd 0x4
                          closeonkeypress
                          compare PLAYERFACING 0x4
                          if 0x2 call @move1
                          compare PLAYERFACING 0x4
                          if 0x4 call @move1
                          compare PLAYERFACING 0x4
                          if 0x3 call @move2
                          release
                          end
                          and this...which now keeps the npc from facing you (faceplayer earlier in the script) for some reason
                          Code:
                          #org @beat
                          msgbox @win
                          callstd 0x4
                          closeonkeypress
                          compare PLAYERFACING 0x2
                          if 0x1 goto @move1
                          compare PLAYERFACING 0x4
                          if 0x1 goto @move1
                          compare PLAYERFACING 0x3
                          if 0x1 goto @move2
                          release
                          end
                          in addition I found another thread with a similar question and tried adding its suggestion, which also didn't work.
                          Code:
                          #org @beat
                          msgbox @win
                          callstd 0x4
                          closeonkeypress
                          setvar PLAYERFACING 0x0000
                          copybyte 0x02036E58
                          compare PLAYERFACING 0x2
                          if 0x1 call @move1
                          compare PLAYERFACING 0x4
                          if 0x1 call @move1
                          compare PLAYERFACING 0x3
                          if 0x1 call @move2
                          release
                          end
                          I tried looking up what XSE had to say about playerfacing and it didn't have an entry, nor have I been able to find much info just searching online. I honestly don't know why the original doesnt work when it's used elsewhere in the game :/.

                          At this point I'd settle for any script that can block entry...I sprite that just disappears after you beat the previous gym or a doors locked/unlocked script...but I don't really know how to approach either of those...

                          ----------------------------------------
                          EDIT: OK I decided to try a door unlocked/locked script instead, which turns out to be seemingly much simpler. This is my script:
                          Spoiler:
                          Code:
                          #dynamic 0x800000
                          
                          #org @begin
                          lock
                          checkflag 0x822
                          if 0x0 goto @lose
                          if 0x1 goto @win
                          release
                          end
                          
                          #org @win
                          release
                          end
                          
                          #org @lose
                          applymovement MOVE_PLAYER @look
                          waitmovement 0x0
                          pause 0x14
                          msgbox @locked
                          callstd 0x4
                          closeonkeypress
                          applymovement MOVE_PLAYER @done
                          waitmovement 0x0
                          releaseall
                          end
                          
                          #org @look
                          #raw 2E
                          #raw FE
                          
                          #org @done
                          #raw 10
                          #raw FE
                          
                          #org @locked
                          = The door is locked[.]\nThere is a note here:\p"Business in CINNABAR.\nBe back soon.\p-Daisy"


                          ...all it does is lock you and never let you go...

                          The win part was just me trying to fix the lock-up, but it should really work without that part...
                          ---------------------------------------
                          EDIT 2.0: Fixed the door lock script! Here's my solution in case anyone else wants to do the same thing
                          Spoiler:
                          Code:
                          #dynamic 0x800000
                          
                          #org @begin
                          lockall
                          setvar 0x7000 0x1
                          checkflag 0x822
                          if 0x1 goto @win
                          applymovement MOVE_PLAYER @look
                          waitmovement 0x0
                          msgbox @locked
                          callstd 0x4
                          closeonkeypress
                          applymovement MOVE_PLAYER @done
                          waitmovement 0x0
                          setvar 0x7000 0x0
                          releaseall
                          end
                          
                          #org @win
                          releaseall
                          end
                          
                          #org @look
                          #raw 2E
                          #raw FE
                          
                          #org @done
                          #raw 10
                          #raw FE
                          
                          #org @locked
                          = The door is locked[.]\nThere is a note here:\p"Business in CINNABAR.\nBe back soon.\p-Daisy"
                          My biggest mistake was not changing the var # in advance map >.<. I changed it to 7000 to match the script and tada!
                          __________________
                          IGN: Anna/Noossab Blue
                          3DS FC: 3196 3609 8450

                          Thanks to SilverGrey for the awesome banner! Click to see!
                          Current as of 1/31/14: I updated again!

                            #7488    
                          Old December 16th, 2012 (2:08 PM). Edited December 17th, 2012 by mefh.
                          mefh mefh is offline
                             
                            Join Date: Dec 2012
                            Gender: Male
                            Posts: 1
                            Nevermind fixed it myself...
                              #7489    
                            Old December 17th, 2012 (8:05 AM). Edited December 17th, 2012 by raging-inferno-1986.
                            raging-inferno-1986 raging-inferno-1986 is offline
                               
                              Join Date: Jul 2012
                              Gender: Male
                              Posts: 21
                              Hi, i made the following code to get the AuroraTicket and clear the flag (so that the Vermillion sailor will let me go to Birth Island). However it didn't work.

                              Code:
                              #dynamic 0x800000
                              
                              #org @start
                              lock
                              faceplayer
                              checkflag 0x200
                              if 0x1 goto @done
                              msgbox @1 0x5
                              compare 0x800D 0x1
                              if 0x1 goto @take
                              msgbox @2 0x6
                              release
                              end
                              
                              #org @done
                              msgbox @3 0x6
                              release
                              end
                              
                              #org @take
                              giveitem 0x173 0x1 MSG_OBTAIN
                              msgbox @3 0x6
                              setflag 0x200
                              clearflag 0x2F1
                              release
                              end
                              
                              #org @1
                              = Hi!\pWould you like an AURORA TICKET?.\pIt will allow access to BIRTH ISLAND. 
                              
                              #org @2
                              = That's okay. I'm sure someone\nelse will enjoy it.
                              
                              #org @3
                              = I knew you would want it.
                              What did i do wrong? Thanks.
                                #7490    
                              Old December 18th, 2012 (9:10 AM).
                              robosllim's Avatar
                              robosllim robosllim is offline
                                 
                                Join Date: Jan 2012
                                Gender: Male
                                Posts: 13
                                I'm trying to do a wild Pokemon script and everything seems to be right, based on what I've read. However, this script will make a message box pop up, then the box and the sprite will disappear without a wild battle ever happening.

                                Code:
                                '-----------------------
                                #org 0x71B8C9
                                lock
                                faceplayer
                                msgbox 0x871B959 '"GRAAAAK!!"
                                callstd 0x2
                                startwildbattle 0x1 0x32 0x0
                                hidesprite LASTTALKED
                                setflag 0x999
                                release
                                end
                                
                                
                                '---------
                                ' Strings
                                '---------
                                #org 0x71B959
                                = GRAAAAK!!
                                  #7491    
                                Old December 20th, 2012 (6:28 PM).
                                Munsie Munsie is offline
                                   
                                  Join Date: Dec 2012
                                  Gender: Male
                                  Posts: 3
                                  Game: LeafGreen
                                  Type: Person Event
                                  Editor: NotePad / PokeScript
                                  Script: Trade a Rare Candy for a Lapras
                                  This is the first script I've written, so I hope it isn't too afwul. Any advice on getting it to work (properly) would be great. In-game it gives you a Lapras, but doesn't properly check if you have a Rare Candy, nor does it take it from your bag. He won't talk to you afterwards either. :x
                                  Spoiler:
                                  #org $begin
                                  lock
                                  faceplayer
                                  checkflag 0x599
                                  if b_true goto $gone
                                  message $wantlapras
                                  $wantlapras 1 =Do you have a RARE CANDY?\nI'll give you my LAPRAS!
                                  boxset 5
                                  compare LASTRESULT 1
                                  if 1 goto $give
                                  message $no
                                  $no 1 =Awww, if you change your\nmind, let me know!
                                  boxset 6
                                  release
                                  end

                                  #org $give
                                  checkitem 0x44
                                  if B_<< goto $nocandy
                                  removeitem 0x44 1
                                  givepokemon 0x83 0x99 0x1
                                  message $ty
                                  $ty 1 =Thank you for the RARE CANDY!\p\v\h01\ received a LAPRAS!\p
                                  boxset 6
                                  setflag 0x599
                                  release
                                  end

                                  #org $gone
                                  message $go
                                  $go 1 =I hope LAPRAS is doing well!
                                  release
                                  end

                                  #org $nocandy
                                  message $nc
                                  $nc 1 =Sorry, you don't have a RARE CANDY!
                                  release
                                  end

                                  After compiling it (to 800000, this is the first script I've made for the ROM), it seems to be a bit ****ed up... Not exactly sure why-- If it was my fault, or something with the compiler, or something else. I dunno.
                                  Spoiler:
                                  #org 0x8800000
                                  '-----------------------------------
                                  lock
                                  faceplayer
                                  checkflag 0x599
                                  if true jump 0x8800062 ' Flag is set
                                  msgbox 0x8800072 ' Do you have a RARE C...
                                  callstd MSG_YESNO ' Yes/No message
                                  compare LASTRESULT YES
                                  if == jump 0x8800028 ' Equal To
                                  msgbox 0x88000A5 ' Awww, if you change ...
                                  callstd MSG_LOCK ' Built-in lock command
                                  release
                                  end

                                  #org 0x8800062
                                  '-----------------------------------
                                  msgbox 0x8800106 ' I hope LAPRAS is doi...
                                  release
                                  end

                                  #org 0x8800028
                                  '-----------------------------------
                                  checkitem RARECANDY 6
                                  lock
                                  nop0 ' #raw 0x0
                                  storeitem 0x8 0x4445
                                  nop0 ' #raw 0x0
                                  nop1 ' #raw 0x1
                                  nop0 ' #raw 0x0
                                  copyvar 0x8004 LASTRESULT
                                  addpokemon LAPRAS 153 MASTERBALL 0x0 0x0 0x7D000000
                                  nop1 ' #raw 0x1
                                  copyvar 0x0 0x0
                                  nop0 ' #raw 0x0
                                  nop0 ' #raw 0x0
                                  nop0 ' #raw 0x0
                                  nop0 ' #raw 0x0
                                  nop0 ' #raw 0x0
                                  msgbox 0x88000D1 ' Thank you for the RA...
                                  callstd MSG_LOCK ' Built-in lock command
                                  setflag 0x599
                                  release
                                  end


                                  #org 0x8800072
                                  = Do you have a RARE CANDY?\nI'll give you my LAPRAS!

                                  #org 0x88000A5
                                  = Awww, if you change your\nmind, let me know!

                                  #org 0x8800106
                                  = I hope LAPRAS is doing well!

                                  #org 0x88000D1
                                  = Thank you for the RARE CANDY!\p\v\h01 received a LAPRAS!\p

                                    #7492    
                                  Old December 24th, 2012 (3:11 AM). Edited December 24th, 2012 by divinemamgai.
                                  divinemamgai's Avatar
                                  divinemamgai divinemamgai is offline
                                     
                                    Join Date: Dec 2012
                                    Gender: Male
                                    Posts: 19
                                    Hi, I'm pretty new to these Pokemon Scripting so I guess the problem I'm having isn't going to be a big trouble for you.
                                    So, I tried to create a simple script just to test. But I guess it didn't worked well. The script has to executed when the player steps on a script box. So I created the following script:
                                    Code:
                                    #org 0x8740040
                                    '-----------------------------------
                                    lock
                                    checkflag 0x250
                                    if true jump 0x8740058 ' Flag is set
                                    msgbox 0x8740062 ' OAK: Hey! Wait!\nDon...
                                    callstd MSG_NORMAL
                                    setflag 0x250
                                    releaseend
                                    
                                    #org 0x8740058
                                    '-----------------------------------
                                    msgbox 0x8740095 ' OAK: Hey! Wait!\nDon...
                                    callstd MSG_NORMAL
                                    release
                                    end
                                    
                                    
                                    #org 0x8740062
                                    = Hey, wait! You should first \nget your own pokemon!
                                    
                                    #org 0x8740095
                                    = Oh, so you have got your Pokemon, that's great!\p You should take this too.
                                    I have not set any VAR Number or VAR Value. Also for Unknown I have just kept it to 03 and 0003
                                    Also I'm using Pokemon Script Editor(PKSV) and Advanced Map 1.5 and for rom Pokemon Fire Red.

                                    The script works with the spirit but not with the plain script boxes, why?
                                    Please help me with this I really want to make my own hacked rom.
                                      #7493    
                                    Old December 26th, 2012 (3:00 PM).
                                    vitamurmillo's Avatar
                                    vitamurmillo vitamurmillo is offline
                                       
                                      Join Date: Mar 2012
                                      Posts: 10
                                      I wrote this script in PKSV, its meant to check if someone has beaten Brock, and turn them back if they haven't yet, but all it does is just freeze the screen. What's wrong with the script?

                                      Its based on the policeman script from the Saffron city gatehouses in FR when you need the Tea.


                                      #org 0x87404CC
                                      '-----------------------------------
                                      lockall
                                      textcolor BLUE
                                      applymovement PLAYER 0x81A75E7 ' look_left_delayed en...
                                      pauseevent 0x0
                                      checkflag FR_BADGE_1
                                      if true jump 0x874054D ' Flag is set
                                      msgbox 0x819E04B ' I think you still ha...
                                      callstd MSG_NOCLOSE ' Non-closing message
                                      closemsg
                                      applymovement PLAYER 0x816F9C4 ' walk_down end
                                      pauseevent 0x0
                                      releaseall
                                      end

                                      #org 0x874054D
                                      '-----------------------------------
                                      msgbox 0x8740559 ' Well done on beating...
                                      callstd MSG_NOCLOSE ' Non-closing message
                                      closemsg
                                      releaseall
                                      end


                                      #org 0x819E04B
                                      = I think you still have\n something left to do.

                                      #org 0x8740559
                                      = Well done on beating Brock.

                                      #org 0x81A75E7
                                      M look_left_delayed end

                                      #org 0x816F9C4
                                      M walk_down end
                                        #7494    
                                      Old December 26th, 2012 (7:36 PM).
                                      FrozenInfernoZX's Avatar
                                      FrozenInfernoZX FrozenInfernoZX is offline
                                      What is out there?
                                         
                                        Join Date: Jun 2012
                                        Location: United States
                                        Gender: Male
                                        Nature: Adamant
                                        Posts: 766
                                        Send a message via AIM to FrozenInfernoZX
                                        Does anybody know the command to use to continue the script after a battle? No matter what I do, my script always ends after the battle.

                                        Here's my script:
                                        Spoiler:
                                        #dyn 0x800000
                                        #org @offset
                                        '------------------------------------
                                        checkflag 0x218
                                        if true jump @offset3
                                        msgbox @text
                                        callstd msg_faceplayer
                                        call @offset2
                                        msgbox @text3
                                        release
                                        end

                                        #org @offset2
                                        trainerbattle 0x0 0x19E 0x0 @intro @defeat
                                        setflag 0x218
                                        return

                                        #org @offset3
                                        msgbox @text2
                                        callstd msg_faceplayer
                                        closemsg
                                        sound 0x9
                                        fadescreen fadeout_black
                                        disappear 0x1
                                        fadescreen fadein_black
                                        setflag 0x214
                                        setflag 0x217
                                        release
                                        end

                                        #org @text
                                        = Hey kiddo!\pHow are ya today?\pI am Bugsler, the Gym Leader of\nSeaview Town.\p.....\pWhat's that?\pI'm a bit busy right now.\pI'm trying to catch some Surskits\nfor my girlfriend Laura.\p.....\pI'll tell you what.\pWhy don't you battle me\nlater in the Gym!\p.....\pHmmm, impatient much?

                                        #org @intro
                                        = How about I squish you right\nnow at this instance!

                                        #org @defeat
                                        = I... I got squished... no fair!

                                        #org @text2
                                        = Hmmphh, you want your Gym Ba...\pWell come and get it!

                                        #org @text3
                                        = Don't talk to me!


                                        I want him to say, "Don't talk to me!" right after the battle.
                                        __________________

                                        Current Live Update: Build 3.0 RC 2.73 No more Flag Errors!
                                        Always periodically make backup saves!
                                          #7495    
                                        Old December 26th, 2012 (8:28 PM).
                                        Renegade's Avatar
                                        Renegade Renegade is offline
                                        Time for real life...
                                           
                                          Join Date: Nov 2011
                                          Location: United States
                                          Gender: Male
                                          Nature: Careful
                                          Posts: 998
                                          Quote:
                                          Originally Posted by FrozenInfernoZX View Post
                                          Does anybody know the command to use to continue the script after a battle? No matter what I do, my script always ends after the battle.

                                          Here's my script:
                                          Spoiler:
                                          #dyn 0x800000
                                          #org @offset
                                          '------------------------------------
                                          checkflag 0x218
                                          if true jump @offset3
                                          msgbox @text
                                          callstd msg_faceplayer
                                          call @offset2
                                          msgbox @text3
                                          release
                                          end

                                          #org @offset2
                                          trainerbattle 0x0 0x19E 0x0 @intro @defeat
                                          setflag 0x218
                                          return

                                          #org @offset3
                                          msgbox @text2
                                          callstd msg_faceplayer
                                          closemsg
                                          sound 0x9
                                          fadescreen fadeout_black
                                          disappear 0x1
                                          fadescreen fadein_black
                                          setflag 0x214
                                          setflag 0x217
                                          release
                                          end

                                          #org @text
                                          = Hey kiddo!\pHow are ya today?\pI am Bugsler, the Gym Leader of\nSeaview Town.\p.....\pWhat's that?\pI'm a bit busy right now.\pI'm trying to catch some Surskits\nfor my girlfriend Laura.\p.....\pI'll tell you what.\pWhy don't you battle me\nlater in the Gym!\p.....\pHmmm, impatient much?

                                          #org @intro
                                          = How about I squish you right\nnow at this instance!

                                          #org @defeat
                                          = I... I got squished... no fair!

                                          #org @text2
                                          = Hmmphh, you want your Gym Ba...\pWell come and get it!

                                          #org @text3
                                          = Don't talk to me!


                                          I want him to say, "Don't talk to me!" right after the battle.
                                          There are many tutorials on trainerbattle commands. You can find your answer here:
                                          http://www.pokecommunity.com/showthread.php?t=164276
                                            #7496    
                                          Old December 27th, 2012 (4:57 AM).
                                          vitamurmillo's Avatar
                                          vitamurmillo vitamurmillo is offline
                                             
                                            Join Date: Mar 2012
                                            Posts: 10
                                            I have a basic generate givepokemon script made by pksv. What do I need to add to that to make the pokeball (the sprite I gave the event using A-map) disappear?
                                              #7497    
                                            Old December 27th, 2012 (1:02 PM). Edited December 27th, 2012 by aljohnston112.
                                            aljohnston112's Avatar
                                            aljohnston112 aljohnston112 is offline
                                               
                                              Join Date: Jul 2010
                                              Gender: Male
                                              Nature: Naughty
                                              Posts: 25
                                              Whenever I save my game and load it. Both the variables and the flags are reset back to 0 even though I set them both to 1 in my script. I'm using pksv, but that shouldn't make a difference as far as I know.

                                              Spoiler:
                                              #dyn 0x740000
                                              #org @start
                                              lockall
                                              applymovement PLAYER @faceup
                                              pauseevent 0x0
                                              compare 0x8000 0x1
                                              if == jump :end
                                              compare 0x1000 0x1
                                              if == jump :end
                                              jump @give
                                              :end
                                              releaseall
                                              end

                                              #org @give
                                              applymovement 0x1 @walk
                                              pauseevent 0x0
                                              countpokemon
                                              compare LASTRESULT 6
                                              if == jump @noroom
                                              addpokemon POLIWHIRL 0x5 NONE 0 0 0
                                              setflag FR_POKEMON
                                              setflag 0x1000
                                              setvar 0x8000 0x1
                                              storepokemon 0 POLIWHIRL
                                              message @get-msg
                                              fanfare 0x101
                                              showmsg
                                              waitfanfare
                                              waitbutton
                                              release
                                              end

                                              #org @noroom
                                              msgbox @noroom-msg
                                              callstd MSG_NOCLOSE
                                              release
                                              end

                                              #org @noroom-msg
                                              = You don't have enough room in your party.

                                              #org @get-msg
                                              = Oh wait!\nDon't forget Poliwhirl. \pWe had a great night yesterday!

                                              #org @walk
                                              m walk_down walk_down walk_left walk_left walk_left walk_left walk_down end

                                              #org @faceup
                                              m look_up end


                                              Quote:
                                              Originally Posted by vitamurmillo View Post
                                              I have a basic generate givepokemon script made by pksv. What do I need to add to that to make the pokeball (the sprite I gave the event using A-map) disappear?
                                              You need to set a flag in your script (you should start flags around 1000). Then you need to set the person id of the pokeball to the same number as the flag (if you setflag 1000 then the person id of the pokeball should be 1000).
                                              __________________
                                              Courage is not the absence of fear. Courage is the overcoming of fear.
                                                #7498    
                                              Old December 27th, 2012 (1:33 PM).
                                              Spherical Ice's Avatar
                                              Spherical Ice Spherical Ice is online now
                                              • Moderator
                                              • Silver Tier
                                               
                                              Join Date: Nov 2007
                                              Location: Bristol, UK
                                              Age: 19
                                              Posts: 5,104
                                              the variables in the 8000 range are temporary. they get reset so they can be used over and over. use variables in the 4000 range. davidjcobb has a list of the actually safe variables but the 4000 range in general is okay
                                              __________________

                                              A Pokemon that is discriminated!
                                              Support squirtle and make it everyone's favourite.
                                                #7499    
                                              Old December 27th, 2012 (1:43 PM). Edited December 27th, 2012 by aljohnston112.
                                              aljohnston112's Avatar
                                              aljohnston112 aljohnston112 is offline
                                                 
                                                Join Date: Jul 2010
                                                Gender: Male
                                                Nature: Naughty
                                                Posts: 25
                                                Quote:
                                                Originally Posted by Spherical Ice View Post
                                                the variables in the 8000 range are temporary. they get reset so they can be used over and over. use variables in the 4000 range. davidjcobb has a list of the actually safe variables but the 4000 range in general is okay
                                                Could you give me the link? Oh and what about the flags? 1000 is checked for in the script, that has to be getting reset too

                                                Alright. Now my game doesn't even start up. I started from a backup that does start and used the dynamic 740000 and I even looked in a hex editor to be sure it was writing in the right place, and it was. I am now using variable 4050, though it hasn't had a chance to set the variable, so that shouldn't be the problem. Anyway why is it when my script is added after 740000 that it causes my game to stop loading?

                                                Alright. Now my game doesn't even start up. I started from a backup that does start and used the dynamic 740000 and I even looked in a hex editor to be sure it was writing in the right place, and it was. I am now using variable 4050, though it hasn't had a chance to set the variable, so that shouldn't be the problem. Anyway why is it when my script is added after 740000 that it causes my game to stop loading?
                                                __________________
                                                Courage is not the absence of fear. Courage is the overcoming of fear.
                                                  #7500    
                                                Old December 29th, 2012 (12:36 AM). Edited December 29th, 2012 by Kyouhei_ii00.
                                                Kyouhei_ii00 Kyouhei_ii00 is offline
                                                I'm male
                                                   
                                                  Join Date: Dec 2012
                                                  Gender: Male
                                                  Posts: 9
                                                  I made a trainer but I need to talk to it to battle.

                                                  Script:
                                                  Spoiler:

                                                  #dynamic 0x71E400

                                                  #org @start
                                                  trainerbattle 0x0 0x202 0x0 @yo @do
                                                  msgbox @talk 0x6
                                                  release
                                                  end

                                                  #org @yo
                                                  = Come at me Bro!!!

                                                  #org @do
                                                  = ....

                                                  #org @talk
                                                  = ....


                                                  Here are the AMap settings:
                                                  Spoiler:

                                                  Movement = $11
                                                  Trainer = $01
                                                  View Radius = $0004
                                                  Person ID = $0000


                                                  I want it so that the trainer walks up to the player then battles
                                                  Closed Thread
                                                  Quick Reply

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