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

TrollandToad.com
Closed Thread
 
Thread Tools
  #6651    
Old March 24th, 2012 (12:05 AM).
jhay21's Avatar
jhay21 jhay21 is offline
     
    Join Date: Jan 2010
    Nature: Timid
    Posts: 21
    Quote:
    Originally Posted by Epitaph93 View Post
    Hmm for some reason I thought it was set to the 6th byte... Okay, so the value isn't actually set to a particular byte. Instead, it's set to the lowest byte. So in this example : FC6A446D 44 would be the gender byte?

    The routine still shouldn't have made the game crash though right? It should return a value of some sort and the value will either be greater than 20 or less than 20, regardless of whether the particular value is the gender value. So I still need to figure out the problem with the routine itself.
    well, not exactly. if it is then it's much easier to just use copybyte on xse
    as for the routine the only error i see is when you called it you didn't add +1 to it. if you put the routine in 852828, when you use callasm it should be 852829

    i'll send you a pm about the whole gender thing,its kinda long and its not really script related anyway

    Relevant Advertising!

      #6652    
    Old March 24th, 2012 (10:47 AM).
    YouListeningROMs's Avatar
    YouListeningROMs YouListeningROMs is offline
       
      Join Date: Mar 2012
      Gender: Male
      Posts: 24
      Hello, again. I need some more help. I want a person to show up only after the second badge has been given. I've made sure the script is all handy dandy, but for some reason, he still appears at the very beginning of the game.
      Spoiler:
      Code:
      #dynamic 0x28072C
      
      #org @start
      checkflag 0x821
      if 0x1 gosub @showbro
      hidesprite 0x1
      checkflag 0xFF7
      if 0x1 goto @end
      random 0x13
      copyvar 0xFFFF 0x800D
      compare 0xFFFF 0x0
      if 0x1 goto @heavyrain
      compare 0xFFFF 0x1
      if 0x1 goto @lightrain
      compare 0xFFFF 0x2
      if 0x1 goto @cloudy
      compare 0xFFFF 0x3
      if 0x1 goto @lightrain
      compare 0xFFFF 0x4
      if 0x4 goto @regsun
      release
      end
      
      #org @showbro
      showsprite 0x1
      setmaptile 0xD 0x4 0xF3 0x1
      setmaptile 0xD 0x3 0xE8 0x1
      setmaptile 0xE 0x3 0xE6 0x1
      setmaptile 0xF 0x3 0xE6 0x1
      setmaptile 0x10 0x3 0xE9 0x1
      setmaptile 0x10 0x4 0xF2 0x1
      special 0x8E
      return
      
      #org @end
      release
      end
      
      #org @heavyrain
      setweather 0xD
      doweather
      applymovement 0xFF @exclamation
      waitmovement 0x0
      setflag 0xFF7
      release
      end
      
      #org @lightrain
      setweather 0x3
      doweather
      setflag 0xFF7
      release
      end
      
      #org @cloudy
      setweather 0xB
      doweather
      setflag 0xFF7
      release
      end
      
      #org @regsun
      setweather 0x2
      doweather
      setflag 0xFF7
      release
      end
      
      #org @exclamation
      #raw 0x62 0xFE
        #6653    
      Old March 24th, 2012 (12:11 PM).
      Mana's Avatar
      Mana Mana is offline
      • Platinum Tier
       
      Join Date: Jan 2009
      Location: UK
      Gender: Female
      Posts: 10,014
      Quote:
      Originally Posted by YouListeningROMs View Post
      Hello, again. I need some more help. I want a person to show up only after the second badge has been given. I've made sure the script is all handy dandy, but for some reason, he still appears at the very beginning of the game.
      To hide a person longer than simply for the length of a script you need to set a flag, and then put that flag number as the person ID number in A-Map.

      EG:setflag 0x100 will make any people with an ID of 100 not be shown.
      clearflag 0x100 will do the opposite.

      Therefore to make someone be shown after a gymbadge you need to edit a 'clearflag' command to the gym script, so not only is the badge-flag set, but the person-flag is cleared. You can set the flag originally in a levelscript early on in the game or something to make sure the character is hidden before you get to the map it's on.
        #6654    
      Old March 24th, 2012 (3:41 PM).
      binjamin007 binjamin007 is offline
         
        Join Date: Feb 2012
        Gender: Male
        Posts: 3
        I am using Pokemon Fire red room, A-trainer, A-map and XSE to make a trainer script.
        When I beat the trainer I want the sprite to be hiden but when I defeat him, he isn't hide. If I try to talk to him again he will be hiden but as soon as I move he appears. If anyone can help it would be nice.

        Here's the script:

        #org 0x8000DB
        trainerbattle 0x0 0x2 0x0 0x88000F4 0x8800102
        fadescreen 0x0
        hidesprite 0x5
        setflag 0x200
        release
        end


        '---------
        ' Strings
        '---------
        #org 0x8000F4
        = bla bla bla

        #org 0x800102
        = non non non


          #6655    
        Old March 24th, 2012 (3:48 PM).
        Mana's Avatar
        Mana Mana is offline
        • Platinum Tier
         
        Join Date: Jan 2009
        Location: UK
        Gender: Female
        Posts: 10,014
        Quote:
        Originally Posted by binjamin007 View Post
        I am using Pokemon Fire red room, A-trainer, A-map and XSE to make a trainer script.
        When I beat the trainer I want the sprite to be hiden but when I defeat him, he isn't hide. If I try to talk to him again he will be hiden but as soon as I move he appears. If anyone can help it would be nice.

        #org @Start
        trainerbattle 0x1 0x2 0x0 0x88000F4 0x8800102 @defeated
        end

        #org @defeated
        fadescreen 0x0
        hidesprite 0x5
        setflag 0x200
        release
        end

        #org 0x8000F4
        = bla bla bla

        #org 0x800102
        = non non non

        ===========================================

        Make sure to set the Person ID to 200 in A-Map to make the hidesprite permanent
          #6656    
        Old March 25th, 2012 (2:21 AM).
        Satoshi Ookami's Avatar
        Satoshi Ookami Satoshi Ookami is offline
        Memento Mori
        • Gold Tier
         
        Join Date: Jul 2008
        Location: Abyss of Time, Great Seal
        Age: 25
        Gender: Male
        Nature: Calm
        Posts: 14,497
        Using flags 2xx is not exactly nice... it might get buggy...
        Use 4xx/5xx, they should be fine.
        __________________
        ROM hacking FAQ - Read before asking how to play a hack.

        Anime List | PSN Trophy List
          #6657    
        Old March 25th, 2012 (6:13 AM). Edited March 25th, 2012 by ShadowGrey.
        ShadowGrey's Avatar
        ShadowGrey ShadowGrey is offline
        Graphix Master
           
          Join Date: Nov 2011
          Location: England
          Gender: Male
          Nature: Relaxed
          Posts: 49
          Hey everyone, just wondering if anyone can help me out a little with this script please.

          What Is supposed to happen:

          Check if the script has been activated before (flag 1207)
          Rival speech
          Player movement (exclamation, down left)
          Rival speech
          Pokemon cry (Umbreon)
          Pokemon 1 movement (Umbreon, left right - jump)
          Pokemon 2 movement (wild, exclamation)
          Rival speech
          Black screen
          Hide sprite (wild)
          Normal screen
          Rival speech
          Rival movement (face right, question mark)
          Rival speech
          Rival movement (question mark)
          Rival speech
          Rival movement (up right up)
          Pokemon movement (right up right up - following rival)
          Two sprites hidden offscreen (Rival and Umbreon)
          Setflag so event occurs once
          End

          What happens:

          Crash on contact with event script tile.

          In advance map
          Rival event no.11
          Umbreon event no.12
          Wild Pokemon event no.13

          I think that's all the basic info.

          The script follows:

          #dynamic 0x26DF05

          #org @start
          checkflag 0x1207
          if 0x1 goto @done
          msgbox @rival1 0x6
          applymovement 0xFF @player1
          waitmovement 0x0
          msgbox @rival2 0x6
          cry 0xC5 0x0
          applymovement 0xC @umbreon1
          waitmovement 0x0
          applymovement 0xD @wild1
          waitmovement 0x0
          msgbox @rival3 0x6
          fadescreen 0x1
          hidesprite 0xD
          fadescreen 0x0
          msgbox @rival4 0x6
          applymovement 0xB @rival5
          waitmovement 0x0
          msgbox @rival6 0x6
          applymovement 0xB @rival7
          waitmovement 0x0
          msgbox @rival8 0x6
          applymovement 0xB @rival9
          applymovement 0xC @umbreon2
          waitmovement 0x0
          hidesprite 0xB
          hidesprite 0xC
          setflag 0x1207
          end

          #org @done
          end

          #org @rival1
          = \v\h06: Come on Umbreon!\nWe can do this!

          #org @player1
          #raw 0x62
          #raw 0x10
          #raw 0x10
          #raw 0x10
          #raw 0x12
          #raw 0x12
          #raw 0x12
          #raw 0x12
          #raw 0xFE

          #org @rival2
          = \v\h06: Umbreon!\nUse Tackle!

          #org @umbreon1
          #raw 0x54
          #raw 0x49
          #raw 0xFE

          #org @wild1
          #raw 0x62
          #raw 0xFE

          #org @rival3
          = \v\h06: Go! Pokeball!

          #org @rival4
          = \v\h06: Gotcha!

          #org @rival5
          #raw 0x03
          #raw 0x63
          #raw 0xFE

          #org @rival6
          = Oh hey \v\h01!\pI've just decided, I need to brush\nup on my skills as a Pokemon\p\nTrainer.\pDon't look so alarmed! I'm not\ngoing to battle you!\pI don't think your ready for that\njust yet.

          #org @rival7
          #raw 0x62
          #raw 0xFE

          #org @rival8
          = What's that?\pMom is worried about me? I guess I\nhave been away for a while now.\pDon't fret \v\h01, I'll head back\nnow and put her heart at ease.\pAfter that it's off to Professor\nIssac's house! I'm going to see if\pI'm finally ready to begin my\nPokemon adventure!\pCatch you later!

          #org @rival9
          #raw 0x11
          #raw 0x13
          #raw 0x13
          #raw 0x13
          #raw 0x13
          #raw 0x13
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0xFE

          #org @umbreon2
          #raw 0x13
          #raw 0x11
          #raw 0x13
          #raw 0x13
          #raw 0x13
          #raw 0x13
          #raw 0x13
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0x11
          #raw 0xFE

          Please could someone examine this for flaws that could result in the script behaving in this way, I have spent so much time going over it my head is starting to spin! Many thanks,
          Shadow.

          Revised 1-
          SwiftSign suggested apply waitmovement 0x0 after applymovement instructions to allow for movement to end before any given textbox begins, this was applied but with no luck. Also that the #dynamic may be interfering with other scripts in the hack, the dynamic was found via FSF so we did not believe this would be the case but took it into account anyway and tried the script with #dynamic 0x800000 as a standard test point, this also did not seem to work.
          Please keep your suggestions coming!
          __________________



          http://www.pokecommunity.com/showthread.php?t=267674
            #6658    
          Old March 25th, 2012 (7:09 AM).
          Spherical Ice's Avatar
          Spherical Ice Spherical Ice is offline
          • Crystal Tier
           
          Join Date: Nov 2007
          Location: Bristol, UK
          Age: 19
          Posts: 5,222
          You should change the dynamic to 0x800000, as XSE will find offsets for you without the need of FSF and it's safe. Also, do the script tiles have the first Unknown set to 03? And have you set the var number? (4050)
          __________________

          A Pokemon that is discriminated!
          Support squirtle and make it everyone's favourite.
            #6659    
          Old March 25th, 2012 (5:03 PM).
          teejermiester's Avatar
          teejermiester teejermiester is offline
          Minnesotan, you betcha!
             
            Join Date: Jul 2010
            Location: Minnesota, ya!
            Age: 20
            Gender: Male
            Nature: Rash
            Posts: 322
            I think your best bet here is what S.I. said, shadow. But, I did notice this:

            #org @rival6
            = Oh hey \v\h01!\pI've just decided, I need to brush\nup on my skills as a Pokemon\p\nTrainer.\pDon't look so alarmed! I'm not\ngoing to battle you!\pI don't think your ready for that\njust yet.


            Correct grammar is a good thing, sir.
            __________________


            ----------------------------
            Beta 1 Coming Soon! ||||||||||
              #6660    
            Old March 27th, 2012 (5:13 PM).
            RicePigeonKKM's Avatar
            RicePigeonKKM RicePigeonKKM is offline
               
              Join Date: Feb 2006
              Nature: Rash
              Posts: 30
              Just encountered a problem in my new script (using JPAN's Hacked Fire Red ROM with pksv as script editor):

              Code:
              #dyn 0x740000
              #org @start
              lock
              sound 0x26
              fadescreen FADEIN_WHITE
              pause 12
              setvar 0x8004 0x0
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x1
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x2
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x3
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x4
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x5
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              msgbox @trap
              callstd MSG_NORMAL
              release
              end
              
              #org @damage
              setvar 0x8005 0x3D
              setvar 0x8006 0x0
              special 0x66
              setvar 0x8005 0x1
              setvar 0x8006 0x1
              special 0x66
              return
              
              #org @trap 
              = Triggered a ninja trap!\p\v\h01's POK\eMON were hurt by the\ntrap!
              Basically what it does is it checks to see if a Pokemon has fainted. If it hasn't, it inflicts 61 damage to that Pokemon. However, running the script does not affect the HP at all.
                #6661    
              Old March 28th, 2012 (12:58 AM).
              DrFuji's Avatar
              DrFuji DrFuji is offline
              Heiki Hecchara‌‌
              • Crystal Tier
               
              Join Date: Sep 2009
              Location: Downia-upside
              Age: 24
              Gender: Male
              Nature: Jolly
              Posts: 1,328
              Quote:
              Originally Posted by RicePigeonKKM View Post
              Just encountered a problem in my new script (using JPAN's Hacked Fire Red ROM with pksv as script editor):

              Code:
              #dyn 0x740000
              #org @start
              lock
              sound 0x26
              fadescreen FADEIN_WHITE
              pause 12
              setvar 0x8004 0x0
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x1
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x2
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x3
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x4
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              setvar 0x8004 0x5
              special 0x65
              copyvar 0x8008 LASTRESULT 
              compare 0x8008 0x0
              if != call @damage
              msgbox @trap
              callstd MSG_NORMAL
              release
              end
              
              #org @damage
              setvar 0x8005 0x3D
              setvar 0x8006 0x0
              special 0x66
              setvar 0x8005 0x1
              setvar 0x8006 0x1
              special 0x66
              return
              
              #org @trap 
              = Triggered a ninja trap!\p\v\h01's POKéMON were hurt by the\ntrap!
              Basically what it does is it checks to see if a Pokemon has fainted. If it hasn't, it inflicts 61 damage to that Pokemon. However, running the script does not affect the HP at all.
              Here's a working version of your script (written with XSE) that has been condensed considerably through the use of the 'addvar' command.

              Code:
              #dynamic 0x800000
              
              #org @start
              lock
              sound 0x26
              fadescreen 0x3
              pause 0xC
              fadescreen 0x2
              setvar 0x8004 0x0
              goto @Damage
              
              #org @Damage
              setvar 0x8005 0x3D
              setvar 0x8006 0x0
              special 0x66
              compare 0x8004 0x5
              if 0x1 goto @Finish
              addvar 0x8004 0x1
              goto @Damage
              
              #org @Finish
              msgbox @Trap 0x2
              release
              end
              
              #org @Trap 
              = Triggered a ninja trap!\p\v\h01's POK\eMON were hurt by the\ntrap!
              The main problem you were having was that where you wrote 'special 0x65' it should have been 'special2 0x65 0x[variable]'. This way the special would have written your Pokemon's current HP to the variable of your choosing which you could then check with a compare command. I took it out anyway as special 0x66 won't send your fainted Pokemon into negative HP or do anything bad like that so it was useless :P
              __________________
                #6662    
              Old March 28th, 2012 (6:07 AM).
              RicePigeonKKM's Avatar
              RicePigeonKKM RicePigeonKKM is offline
                 
                Join Date: Feb 2006
                Nature: Rash
                Posts: 30
                Quote:
                Originally Posted by DrFuji View Post
                Here's a working version of your script (written with XSE) that has been condensed considerably through the use of the 'addvar' command.

                Code:
                #dynamic 0x800000
                
                #org @start
                lock
                sound 0x26
                fadescreen 0x3
                pause 0xC
                fadescreen 0x2
                setvar 0x8004 0x0
                goto @Damage
                
                #org @Damage
                setvar 0x8005 0x3D
                setvar 0x8006 0x0
                special 0x66
                compare 0x8004 0x5
                if 0x1 goto @Finish
                addvar 0x8004 0x1
                goto @Damage
                
                #org @Finish
                msgbox @Trap 0x2
                release
                end
                
                #org @Trap 
                = Triggered a ninja trap!\p\v\h01's POK\eMON were hurt by the\ntrap!
                The main problem you were having was that where you wrote 'special 0x65' it should have been 'special2 0x65 0x[variable]'. This way the special would have written your Pokemon's current HP to the variable of your choosing which you could then check with a compare command. I took it out anyway as special 0x66 won't send your fainted Pokemon into negative HP or do anything bad like that so it was useless :P

                The main reason I was using special 0x65 wasn't to check for negative HP, but to check to see if the Pokemon hasnt fainted. In other words, I wanted special 0x66 to do damage, but to leave the Pokemon with at least 1 HP so as to avoid wonky things that shouldn't happen (like going into a battle with 6 fainted Pokemon. I know the game would cancel the fight but I would like to prevent this from happening).
                  #6663    
                Old March 28th, 2012 (8:11 AM).
                ShadowGrey's Avatar
                ShadowGrey ShadowGrey is offline
                Graphix Master
                   
                  Join Date: Nov 2011
                  Location: England
                  Gender: Male
                  Nature: Relaxed
                  Posts: 49
                  Okay thanks for the help everyone, all things taken into account the problem was solved, thanks! Anyway, I have what probably might be quite a generic question but it seems important enough to ask, and I haven't really found anything explaining this.

                  I know that using FSF gives you offsets through out the game that are free and available for use, but I also know that only so much can be done with this offset before it starts affecting other parts of the game, script overlap and so forth. My question is this: what is the best way to find and get an offset that you can be certain will cope with the amount of data you wish to input, also is it possible to know how many bytes a particular script will use before you insert it, and finally is there an offset cap? It would be really useful as this kind of thing is not really covered in most XSE tutorials or help.

                  Much appreciated,
                  Shadow.

                  Pokemon Shadow Gray - Still looking for a Scriptor!
                  __________________



                  http://www.pokecommunity.com/showthread.php?t=267674
                    #6664    
                  Old March 28th, 2012 (1:41 PM).
                  DrFuji's Avatar
                  DrFuji DrFuji is offline
                  Heiki Hecchara‌‌
                  • Crystal Tier
                   
                  Join Date: Sep 2009
                  Location: Downia-upside
                  Age: 24
                  Gender: Male
                  Nature: Jolly
                  Posts: 1,328
                  Quote:
                  Originally Posted by RicePigeonKKM View Post
                  The main reason I was using special 0x65 wasn't to check for negative HP, but to check to see if the Pokemon hasnt fainted. In other words, I wanted special 0x66 to do damage, but to leave the Pokemon with at least 1 HP so as to avoid wonky things that shouldn't happen (like going into a battle with 6 fainted Pokemon. I know the game would cancel the fight but I would like to prevent this from happening).
                  Oh sorry, I must have been misunderstanding how you were setting up the script. Anyway, here is an updated version of the script that I posted earlier which will always leave the affected Pokemon with 1 HP and won't affect Pokemon that have already fainted.

                  Code:
                  #dynamic 0x800000
                  
                  #org @start
                  lock
                  sound 0x26
                  fadescreen 0x1
                  pause 0xC
                  fadescreen 0x0
                  setvar 0x8004 0x0
                  goto @Damage
                  
                  #org @Damage
                  special2 0x8005 0x65
                  compare 0x8005 0x3C
                  if 0x3 goto @LessThan61
                  setvar 0x8005 0x3D
                  setvar 0x8006 0x0
                  special 0x66
                  compare 0x8004 0x5
                  if 0x1 goto @Finish
                  addvar 0x8004 0x1
                  goto @Damage
                  
                  #org @LessThan61
                  subvar 0x8005 0x1
                  setvar 0x8006 0x0
                  special 0x66
                  compare 0x8004 0x5
                  if 0x1 goto @Finish
                  addvar 0x8004 0x1
                  goto @Damage
                  
                  #org @Finish
                  msgbox @Trap 0x2
                  release
                  end
                  
                  #org @Trap 
                  = Triggered a ninja trap!\p\v\h01's POKéMON were hurt by the\ntrap!
                  __________________
                    #6665    
                  Old March 28th, 2012 (3:55 PM).
                  Hyperbolic's Avatar
                  Hyperbolic Hyperbolic is offline
                     
                    Join Date: Mar 2012
                    Gender: Male
                    Posts: 6
                    Im having problems with my givepokemon script.
                    Every time i talk to the sprite i hear a click and they just look at me.
                    When I warp back into the area, it does the same thing over again.
                    Spoiler:
                    #dynamic 0x3AE78E

                    #org @pokemon
                    lock
                    faceplayer
                    checkflag 0x828
                    if 0x1 goto @talked
                    setflag 0x828
                    msgbox @give 0x2
                    release
                    end

                    #org @give
                    givepokemon 0x11B 0x5 0x0 0x0 0x0 0x0

                    #org @talked
                    = Today's the big day!\nThe Academy of Steven Stone is a\lhard place to get into...\lAnd you managed to graduate with\lAmy and Perry!\p...........\n...........\lWait!\lBefore you leave,\lYour dad sent you a special gift.\p...\nIt's his Tarnaquax from many moons\lago...\p\v\h01 recieved a Tarnaquax!\pStay safe and have fun!

                    Also, I am using XSE 1.0.0 (because i cant get the newest one)
                      #6666    
                    Old March 28th, 2012 (4:19 PM). Edited March 28th, 2012 by RicePigeonKKM.
                    RicePigeonKKM's Avatar
                    RicePigeonKKM RicePigeonKKM is offline
                       
                      Join Date: Feb 2006
                      Nature: Rash
                      Posts: 30
                      Quote:
                      Originally Posted by DrFuji View Post
                      Oh sorry, I must have been misunderstanding how you were setting up the script. Anyway, here is an updated version of the script that I posted earlier which will always leave the affected Pokemon with 1 HP and won't affect Pokemon that have already fainted.

                      Code:
                      #dynamic 0x800000
                      
                      #org @start
                      lock
                      sound 0x26
                      fadescreen 0x1
                      pause 0xC
                      fadescreen 0x0
                      setvar 0x8004 0x0
                      goto @Damage
                      
                      #org @Damage
                      special2 0x8005 0x65
                      compare 0x8005 0x3C
                      if 0x3 goto @LessThan61
                      setvar 0x8005 0x3D
                      setvar 0x8006 0x0
                      special 0x66
                      compare 0x8004 0x5
                      if 0x1 goto @Finish
                      addvar 0x8004 0x1
                      goto @Damage
                      
                      #org @LessThan61
                      subvar 0x8005 0x1
                      setvar 0x8006 0x0
                      special 0x66
                      compare 0x8004 0x5
                      if 0x1 goto @Finish
                      addvar 0x8004 0x1
                      goto @Damage
                      
                      #org @Finish
                      msgbox @Trap 0x2
                      release
                      end
                      
                      #org @Trap 
                      = Triggered a ninja trap!\p\v\h01's POKéMON were hurt by the\ntrap!
                      Just tried this and its still KOing the Pokemon. For some reason I think it might be the compare routine, because I added a check at the end of the script that would set a flag if it wasnt already set, and unset it if it is and it's not executing at all. Never had this issue before

                      Disregard what I said. I was using the wrong syntax for variable subtraction in pksv. It works beautifully now. Though I am having an issue with a little addition I made at the end:

                      Code:
                      #org 0x8747737
                      '-----------------------------------
                      compare 0x6007 0x0
                      if == call 0x8747757 ' Equal To
                      compare 0x6007 0x1
                      if == call 0x874775D ' Equal To
                      msgbox 0x8747763 ' Triggered a ninja tr...
                      callstd MSG_LOCK ' Built-in lock command
                      release
                      end
                      
                      #org 0x8747757
                      '-----------------------------------
                      setvar 0x6007 0x1
                      return
                      
                      #org 0x874775D
                      '-----------------------------------
                      setvar 0x6007 0x0
                      return
                      0x6007 is the var used for the script tile, I have two versions of the same script: one with value 0 and one with value 1. The value 0 one does not deactivate and the value 1 does not activate.
                        #6667    
                      Old March 28th, 2012 (4:55 PM). Edited March 28th, 2012 by Mana.
                      Mana's Avatar
                      Mana Mana is offline
                      • Platinum Tier
                       
                      Join Date: Jan 2009
                      Location: UK
                      Gender: Female
                      Posts: 10,014
                      Quote:
                      Originally Posted by ShadowGrey View Post
                      Okay thanks for the help everyone, all things taken into account the problem was solved, thanks! Anyway, I have what probably might be quite a generic question but it seems important enough to ask, and I haven't really found anything explaining this.

                      I know that using FSF gives you offsets through out the game that are free and available for use, but I also know that only so much can be done with this offset before it starts affecting other parts of the game, script overlap and so forth. My question is this: what is the best way to find and get an offset that you can be certain will cope with the amount of data you wish to input, also is it possible to know how many bytes a particular script will use before you insert it, and finally is there an offset cap? It would be really useful as this kind of thing is not really covered in most XSE tutorials or help.

                      Much appreciated,
                      Shadow.

                      Pokemon Shadow Gray - Still looking for a Scriptor!
                      With XSE you don't want to use FSF at all to be honest. Always put #dynamic 0x800000 and XSE will automatically set the pointers to free space. However you have to remember but if you then decompile something using XSE if you change the number of bytes, then you run the risk of overwriting something that is later in the ROM.

                      Quote:
                      Originally Posted by Hyperbolic View Post
                      Im having problems with my givepokemon script.
                      Every time i talk to the sprite i hear a click and they just look at me.
                      When I warp back into the area, it does the same thing over again.
                      Spoiler:
                      #dynamic 0x3AE78E

                      #org @pokemon
                      lock
                      faceplayer
                      checkflag 0x828
                      if 0x1 goto @talked
                      setflag 0x828
                      msgbox @give 0x2
                      release
                      end

                      #org @give
                      givepokemon 0x11B 0x5 0x0 0x0 0x0 0x0

                      #org @talked
                      = Today's the big day!\nThe Academy of Steven Stone is a\lhard place to get into...\lAnd you managed to graduate with\lAmy and Perry!\p...........\n...........\lWait!\lBefore you leave,\lYour dad sent you a special gift.\p...\nIt's his Tarnaquax from many moons\lago...\p\v\h01 recieved a Tarnaquax!\pStay safe and have fun!

                      Also, I am using XSE 1.0.0 (because i cant get the newest one)
                      Your problem is that you have tried making the give pokemon command a message command, so the script won't work. You have also made the actual message not work by pointing directly to it, rather than to a new string, try this:

                      #dynamic 0x800000 <- Empty Space. Always use 0x800000

                      #org @pokemon
                      lock
                      faceplayer
                      checkflag 0x828
                      if 0x1 goto @talked
                      setflag 0x828
                      givepokemon 0x11B 0x5 0x0 0x0 0x0 0x0
                      release
                      end

                      #org @Talked
                      msgbox @Talk1 0x6
                      release
                      end

                      #org @Talk1
                      = Today's the big day!\nThe Academy of Steven Stone is a\lhard place to get into...\lAnd you managed to graduate with\lAmy and Perry!\p...........\n...........\lWait!\lBefore you leave,\lYour dad sent you a special gift.\p...\nIt's his Tarnaquax from many moons\lago...\p\v\h01 recieved a Tarnaquax!\pStay safe and have fun!

                      Quote:
                      Originally Posted by RicePigeonKKM View Post
                      Disregard what I said. I was using the wrong syntax for variable subtraction in pksv. It works beautifully now. Though I am having an issue with a little addition I made at the end:

                      Code:
                      #org 0x8747737
                      '-----------------------------------
                      compare 0x6007 0x0
                      if == call 0x8747757 ' Equal To
                      compare 0x6007 0x1
                      if == call 0x874775D ' Equal To
                      msgbox 0x8747763 ' Triggered a ninja tr...
                      callstd MSG_LOCK ' Built-in lock command
                      release
                      end
                      
                      #org 0x8747757
                      '-----------------------------------
                      setvar 0x6007 0x1
                      return
                      
                      #org 0x874775D
                      '-----------------------------------
                      setvar 0x6007 0x0
                      return
                      0x6007 is the var used for the script tile, I have two versions of the same script: one with value 0 and one with value 1. The value 0 one does not deactivate and the value 1 does not activate.
                      *butts in slightly*

                      The reason is the order of your script means that.

                      6007 = 0x0 -> 6007 = 0x1 -> 6007 = 0x0

                      Because the return function brings back to the second compare, just after the first compare, if that makes sense. Basically what your script is doing is just repeatedly resetting the variable to 0x0. Since that var never reaches 0x1 outside the script that's why the second script is not activating ever.

                      Try something like:

                      #org @start
                      compare 0x6007 0x0
                      if == call @Zero ' Equal To
                      setvar 0x6007 0x0
                      goto @Continue

                      #org @Zero
                      setvar 0x6007 0x1
                      goto @Continue

                      #org @Continue
                      msgbox 0x8747763 ' Triggered a ninja tr...
                      callstd MSG_LOCK ' Built-in lock command
                      release
                      end


                      This means if 6007 is 0x0, it is set to 0x1 and then locked into the continue script rather than returning directly. And the opposite for 0x1 -> 0x0.
                        #6668    
                      Old March 28th, 2012 (7:18 PM). Edited March 28th, 2012 by Amachi.
                      Amachi's Avatar
                      Amachi Amachi is offline
                      (。・ω・)ノ゙ Hello, I am Amachi-chan~♪
                         
                        Join Date: Jun 2006
                        Location: Australia
                        Gender: Male
                        Nature: Jolly
                        Posts: 5,877
                        Spoiler:
                        #dynamic 0x800000

                        #org @start
                        lock
                        faceplayer
                        checkflag 0x828
                        if 0x1 goto @heal
                        msgbox @1 0x4
                        closeonkeypress
                        givepokemon 0xAA 0x5 0x8B 0x0 0x0 0x0
                        fanfare 0x13E
                        msgbox @2 0x4
                        waitfanfare
                        closeonkeypress
                        setflag 0x828
                        msgbox @3 0x5
                        compare LASTRESULT 0x1
                        if 0x1 gosub @name
                        msgbox @5 0x6
                        release
                        end

                        #org @name
                        call 0x1A74EB
                        msgbox @4 0x6
                        return

                        #org @heal
                        msgbox @healstart 0x4
                        closeonkeypress
                        fadescreen 0x1
                        fanfare 0x100
                        special 0x0
                        waitfanfare
                        fadescreen 0x0
                        msgbox @healfinish 0x6
                        release
                        end

                        #org @1
                        = Hello, [player!]\nI presume you are here for your\lPok\h1Bmon, correct?\lDon't worry, it has been healed,\lnice and proper!\lNext time though, try not to let\lit get hurt so badly.

                        #org @2
                        = [black_fr] You got your Chinchou back!

                        #org @3
                        = Your Chinchou is delightful, but\nI wasn't sure if it had a nickname.\lDoes it?

                        #org @4
                        = I see, I see! I'll make sure to\nremember it for next time.

                        #org @5
                        = Well, I'm sure you must be off to\nwork now. Take care, and remember\lyou are always welcome to heal\lyour beloved Pok\h1Bmon here!

                        #org @healstart
                        = Your Pok\h1Bmon look tired.\nLet them rest here.

                        #org @healfinish
                        = There we go, all better now!


                        It's barely working. No text boxes show up at all.

                        Admittedly this is the first time in a long time that I'm scripting (and I never was too good at it to begin with), so I have no idea what's wrong here. Is it the order? I am using JPAN's hacked engine for FR, if that may cause trouble, but I doubt it. Any help would be immensely appreciated.

                        edit: okay, so I just tried to make another script, a simple sign, and no textbox showed up there either. I'm starting to think that it is this hack, but I didn't have any trouble with it before.
                        __________________
                        CHILL OUT DUDES, I GOT THIS
                        Paired with Juicy.
                          #6669    
                        Old March 28th, 2012 (8:18 PM).
                        DrFuji's Avatar
                        DrFuji DrFuji is offline
                        Heiki Hecchara‌‌
                        • Crystal Tier
                         
                        Join Date: Sep 2009
                        Location: Downia-upside
                        Age: 24
                        Gender: Male
                        Nature: Jolly
                        Posts: 1,328
                        Quote:
                        Originally Posted by Hyperbolic View Post
                        Im having problems with my givepokemon script.
                        Every time i talk to the sprite i hear a click and they just look at me.
                        When I warp back into the area, it does the same thing over again.
                        Spoiler:
                        #dynamic 0x3AE78E

                        #org @pokemon
                        lock
                        faceplayer
                        checkflag 0x828
                        if 0x1 goto @talked
                        setflag 0x828
                        msgbox @give 0x2
                        release
                        end

                        #org @give
                        givepokemon 0x11B 0x5 0x0 0x0 0x0 0x0

                        #org @talked
                        = Today's the big day!\nThe Academy of Steven Stone is a\lhard place to get into...\lAnd you managed to graduate with\lAmy and Perry!\p...........\n...........\lWait!\lBefore you leave,\lYour dad sent you a special gift.\p...\nIt's his Tarnaquax from many moons\lago...\p\v\h01 recieved a Tarnaquax!\pStay safe and have fun!

                        Also, I am using XSE 1.0.0 (because i cant get the newest one)
                        While your question has already been answered, here is an alternate link to XSE 1.1.1 - XSE 1.0.0 tends to be quite buggy and isn't really suitable for scripting.

                        Quote:
                        Originally Posted by Amachi View Post
                        Spoiler:
                        #dynamic 0x800000

                        #org @start
                        lock
                        faceplayer
                        checkflag 0x828
                        if 0x1 goto @heal
                        msgbox @1 0x4
                        closeonkeypress
                        givepokemon 0xAA 0x5 0x8B 0x0 0x0 0x0
                        fanfare 0x13E
                        msgbox @2 0x4
                        waitfanfare
                        closeonkeypress
                        setflag 0x828
                        msgbox @3 0x5
                        compare LASTRESULT 0x1
                        if 0x1 gosub @name
                        msgbox @5 0x6
                        release
                        end

                        #org @name
                        call 0x1A74EB
                        msgbox @4 0x6
                        return

                        #org @heal
                        msgbox @healstart 0x4
                        closeonkeypress
                        fadescreen 0x1
                        fanfare 0x100
                        special 0x0
                        waitfanfare
                        fadescreen 0x0
                        msgbox @healfinish 0x6
                        release
                        end

                        #org @1
                        = Hello, [player!]\nI presume you are here for your\lPok\h1Bmon, correct?\lDon't worry, it has been healed,\lnice and proper!\lNext time though, try not to let\lit get hurt so badly.

                        #org @2
                        = [black_fr] You got your Chinchou back!

                        #org @3
                        = Your Chinchou is delightful, but\nI wasn't sure if it had a nickname.\lDoes it?

                        #org @4
                        = I see, I see! I'll make sure to\nremember it for next time.

                        #org @5
                        = Well, I'm sure you must be off to\nwork now. Take care, and remember\lyou are always welcome to heal\lyour beloved Pok\h1Bmon here!

                        #org @healstart
                        = Your Pok\h1Bmon look tired.\nLet them rest here.

                        #org @healfinish
                        = There we go, all better now!


                        It's barely working. No text boxes show up at all.

                        Admittedly this is the first time in a long time that I'm scripting (and I never was too good at it to begin with), so I have no idea what's wrong here. Is it the order? I am using JPAN's hacked engine for FR, if that may cause trouble, but I doubt it. Any help would be immensely appreciated.

                        edit: okay, so I just tried to make another script, a simple sign, and no textbox showed up there either. I'm starting to think that it is this hack, but I didn't have any trouble with it before.
                        I believe that it may have something to do with your version of XSE as script should be working just fine. In addition, if something as simple as a sign won't activate properly then I'm fairly sure it has to do with your editor. Try downloading XSE 1.1.1 from the link earlier in this post.
                        __________________
                          #6670    
                        Old March 28th, 2012 (8:30 PM). Edited March 28th, 2012 by Amachi.
                        Amachi's Avatar
                        Amachi Amachi is offline
                        (。・ω・)ノ゙ Hello, I am Amachi-chan~♪
                           
                          Join Date: Jun 2006
                          Location: Australia
                          Gender: Male
                          Nature: Jolly
                          Posts: 5,877
                          Quote:
                          Originally Posted by DrFuji View Post
                          I believe that it may have something to do with your version of XSE as script should be working just fine. In addition, if something as simple as a sign won't activate properly then I'm fairly sure it has to do with your editor. Try downloading XSE 1.1.1 from the link earlier in this post.
                          Cool, updating XSE makes it work! Thanks mate.

                          Though now my script still sucks. Just says player and doesn't give the player the option to nickname.

                          edit: nevermind about the player bit, I figured out what I did wrong, haha. silly me.
                          __________________
                          CHILL OUT DUDES, I GOT THIS
                          Paired with Juicy.
                            #6671    
                          Old March 28th, 2012 (8:44 PM).
                          DrFuji's Avatar
                          DrFuji DrFuji is offline
                          Heiki Hecchara‌‌
                          • Crystal Tier
                           
                          Join Date: Sep 2009
                          Location: Downia-upside
                          Age: 24
                          Gender: Male
                          Nature: Jolly
                          Posts: 1,328
                          Quote:
                          Originally Posted by Amachi View Post
                          Cool, updating XSE makes it work! Thanks mate.

                          Though now my script still sucks. Just says player and doesn't give the player the option to nickname.
                          Awesome, I'm glad that part worked out :3

                          For your new problem, add this this to the start of '@name', replacing the 'call 0x1A74EB' command.

                          Code:
                          setvar 0x8004 0x0
                          fadescreen 0x1
                          special 0x9E
                          waitstate
                          One of the features of JPAN's engine is that it has deleted all of the scripts that are in the original FR (Not just the events that hold them, but the actual scripts themselves). As such, you're actually trying to use data that used to be there but now isn't with the advent of the engine.

                          I added the setvar command because from the way the script seems to be set up, the player is getting their first Pokemon, right? Setting 0x8004 to 0x0 will let the game know that it is nicknaming the first party slot (If it isn't then you'll have to do some other stuff to let the game know that) so now everything should be in shape :D
                          __________________
                            #6672    
                          Old March 28th, 2012 (9:07 PM).
                          Amachi's Avatar
                          Amachi Amachi is offline
                          (。・ω・)ノ゙ Hello, I am Amachi-chan~♪
                             
                            Join Date: Jun 2006
                            Location: Australia
                            Gender: Male
                            Nature: Jolly
                            Posts: 5,877
                            Quote:
                            Originally Posted by DrFuji View Post
                            Awesome, I'm glad that part worked out :3

                            For your new problem, add this this to the start of '@name', replacing the 'call 0x1A74EB' command.

                            Code:
                            setvar 0x8004 0x0
                            fadescreen 0x1
                            special 0x9E
                            waitstate
                            One of the features of JPAN's engine is that it has deleted all of the scripts that are in the original FR (Not just the events that hold them, but the actual scripts themselves). As such, you're actually trying to use data that used to be there but now isn't with the advent of the engine.

                            I added the setvar command because from the way the script seems to be set up, the player is getting their first Pokemon, right? Setting 0x8004 to 0x0 will let the game know that it is nicknaming the first party slot (If it isn't then you'll have to do some other stuff to let the game know that) so now everything should be in shape :D
                            Cheers mate, it does all work now.

                            That said, while I sort of new those changes were made, I just was unaware they ran that deep. Was this mentioned in the documentation? I didn't notice such a thing.

                            Looking over it now, I see that there are specials for random grass and water battles. Does that mean those no longer occur? Do I have to create a script for that?

                            Maybe I shouldn't have hacked the engine, haha.
                            __________________
                            CHILL OUT DUDES, I GOT THIS
                            Paired with Juicy.
                              #6673    
                            Old March 28th, 2012 (9:25 PM).
                            DrFuji's Avatar
                            DrFuji DrFuji is offline
                            Heiki Hecchara‌‌
                            • Crystal Tier
                             
                            Join Date: Sep 2009
                            Location: Downia-upside
                            Age: 24
                            Gender: Male
                            Nature: Jolly
                            Posts: 1,328
                            Quote:
                            Originally Posted by Amachi View Post
                            Cheers mate, it does all work now.

                            That said, while I sort of new those changes were made, I just was unaware they ran that deep. Was this mentioned in the documentation? I didn't notice such a thing.

                            Looking over it now, I see that there are specials for random grass and water battles. Does that mean those no longer occur? Do I have to create a script for that?

                            Maybe I shouldn't have hacked the engine, haha.
                            Haha, it was one of the main features of the engine as it gives a lot of new free space to work with :P

                            Nope, random battles of all types and other tile-based scripts should run properly - Only the scripts assigned to person events, signposts and green script tiles should have been removed. If you need to see what these scripts said then just open up a separate (unpatched) FR ROM and read the scripts from there. Believe me, the benefits the patch provides far outweigh any downsides XD
                            __________________
                              #6674    
                            Old March 29th, 2012 (4:54 AM).
                            Amachi's Avatar
                            Amachi Amachi is offline
                            (。・ω・)ノ゙ Hello, I am Amachi-chan~♪
                               
                              Join Date: Jun 2006
                              Location: Australia
                              Gender: Male
                              Nature: Jolly
                              Posts: 5,877
                              he didn't exactly list everything that was deleted or changed, how was I, a simple ROM hacking noob, supposed to know?! :P

                              Yeah I thought it was a much better deal as well. Thanks for the clarification.

                              Anyway dude, thanks for all the help today. It was greatly appreciated. Actually made a fair bit of progress in scripting, something I've never done before in my previous attempts at ROM hacking, haha.
                              __________________
                              CHILL OUT DUDES, I GOT THIS
                              Paired with Juicy.
                                #6675    
                              Old March 29th, 2012 (7:36 AM).
                              aablmd82 aablmd82 is offline
                                 
                                Join Date: Mar 2012
                                Gender: Male
                                Posts: 5
                                I need some help with the hidesprite and showsprite command.

                                I'm trying to set a var, and when that is set, have a sprite be shown and then do some stuff. However, when I put in the showsprite command, it doesn't work. I tried some testing using very basic hide/show sprite scripts, but it didn't work where I wanted to (Viridian City) I tried it in one of the houses in Viridian city and it worked just fine, but when I try to do it to a player in Viridian city, it has no effect.

                                I have all the person event #s lined up just fine, but it just won't work in Viridian City. Is there something else that I have to change to make it work?
                                Closed Thread

                                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 5:20 PM.