The PokéCommunity Forums Fan Games ROM Hacking
Script Help Thread (DO NOT REQUEST SCRIPTS)

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
  #6151    
Old October 3rd, 2011 (11:32 AM).
Missingyep Missingyep is offline
     
    Join Date: Jul 2010
    Posts: 275
    Quote:
    Originally Posted by treeckopa View Post
    I have some questions about trainerbattle.
    For trainerbattle 0x1, it can be used for both rival and GYM leader? What about the music during the battle? How can I change it?
    For trainerbattle 0x3, it seems that it's for elite four, but some said that for 0x3, the script will continue even if you've lost in the battle. So what is the exact function for 0x3?
    And for other kinds of trainerbattle, what are their functions?
    Type 0 is an ordinary battle. Script execution stops after the battle, regardless of its outcome.

    1 and 2 are identical, and run scripts after the battle ends (but only if the player won). They except one extra argument: the offset of the script to run. (The script with "trainerbattle" stops running, and the offset you specify starts running.)

    3 is a continue-battle. The script that calls "trainerbattle" keeps running after the battle (but only if the player won).

    4 is a double battle. It accepts one extra argument: the offset of some text to display if the player does not have two or more usable Pokemon (and hence can't start the battle).

    5 is a rematch battle. It's almost identical to 0, but it will actually check the trainer number and do a lookup, to see if you're supposed to battle one of their rematch battles instead. To use this to its fullest potential, you would need to learn more about the rematch functionality.

    6 is a special kind of double battle that accepts two extra arguments. I have no idea what the second extra argument is.

    7 is a double rematch battle.

    8 is a clone of 6.

    9 is a tutorial battle. So far as I know, it functions identically to 0 except that the player will not whiteout if they lose the battle. Passing in 0x0003 instead of 0x0000 (as the unknown halfword argument) enables Oak's mid-battle narration.

    All other values are treated as type-0 battles.

    Note that if the trainer you specify has already been defeated, "trainerbattle" does nothing and the script that calls it will keep running unless you used a rematch battle type. And I think you need an ASM hack to change the music.
      #6152    
    Old October 9th, 2011 (10:02 AM).
    M.L's Avatar
    M.L M.L is offline
    Invisible
       
      Join Date: Oct 2010
      Gender: Male
      Nature: Quiet
      Posts: 765
      Help me please i took the daycare script from Firered and used it so the player must give in a poke but i cant get it so that the player can recall the pokes i have done this...
      Quote:
      #dynamic 0x800000

      #org @start
      lock
      countpokemon
      compare 0x800D 0x1
      if 0x1 goto @stop
      special2 LASTRESULT 0x84
      compare LASTRESULT 0x1
      special 0xBC
      waitstate
      compare 0x8004 0x6
      special2 LASTRESULT 0x85
      compare LASTRESULT 0x0
      special2 0x8005 0xBA
      special 0x176
      cmdc3 0x2F
      goto 0x81BF541
      special 0xBC
      special2 LASTRESULT 0x85
      compare LASTRESULT 0x0
      special2 LASTRESULT 0x179
      compare LASTRESULT 0x0
      special2 LASTRESULT 0x178
      compare LASTRESULT 0x1
      special2 0x8005 0xBA
      special 0x177
      special 0x176
      cmdc3 0x2F
      special2 LASTRESULT 0x17A
      call 0x81A6675
      release
      end

      #org @stop
      release
      end
      __________________
      Fluffy
        #6153    
      Old October 9th, 2011 (3:54 PM).
      Missingyep Missingyep is offline
         
        Join Date: Jul 2010
        Posts: 275
        Quote:
        Originally Posted by M.L View Post
        Help me please i took the daycare script from Firered and used it so the player must give in a poke but i cant get it so that the player can recall the pokes i have done this...

        Spoiler:
        Code:
        #dynamic 0x800000
        
        #org @start
        lock
        countpokemon
        compare 0x800D 0x1
        if 0x1 goto @stop
        special2 LASTRESULT 0x84
        compare LASTRESULT 0x1
        special 0xBC
        waitstate
        compare 0x8004 0x6
        special2 LASTRESULT 0x85
        compare LASTRESULT 0x0
        special2 0x8005 0xBA
        special 0x176
        cmdc3 0x2F
        goto 0x81BF541
        special 0xBC
        special2 LASTRESULT 0x85
        compare LASTRESULT 0x0
        special2 LASTRESULT 0x179
        compare LASTRESULT 0x0
        special2 LASTRESULT 0x178
        compare LASTRESULT 0x1
        special2 0x8005 0xBA
        special 0x177
        special 0x176
        cmdc3 0x2F
        special2 LASTRESULT 0x17A
        call 0x81A6675
        release
        end
        
        #org @stop
        release
        end
        You're not using "compare" properly.

        Code:
        special2 LASTRESULT 0x84
         compare LASTRESULT 0x1
         special 0xBC
        You're doing a comparison, but you're not checking the result (with an "if" command). You make the same mistake with every comparison in the script except for the first one, which is why it's broken.
          #6154    
        Old October 10th, 2011 (12:38 PM).
        BlazingMagmar's Avatar
        BlazingMagmar BlazingMagmar is offline
           
          Join Date: Feb 2009
          Gender:
          Posts: 76
          hi im trying to make all team rocket grunts use the RSE trainer battle music in pokemon leaf green. What script command can do this?
            #6155    
          Old October 10th, 2011 (7:16 PM).
          SupahNinja's Avatar
          SupahNinja SupahNinja is offline
          Scripting Ninja
             
            Join Date: Mar 2011
            Gender: Male
            Posts: 34
            Hello.
            I was wondering how to change the character's sprite at will.
            I know it's possible, because that's what happens every time the player rides their bike or goes fishing, but I don't know the proper commands to use in XSE.
            This is for FRLG, by the way.

            Help would be greatly appreciated, as I'm using this for a puzzle in my hack.
            Thanks.
            __________________
            SupahNinja

            My feelings on
            ROM hacking:

            -I like scripting a lot.
            -Mapping is almost as fun.
            -Hex editing isn't bad at all.
            -I do NOT enjoy spriting.
            -I've been meaning to start learning ASM for a while, but I don't ever seem to have enough time.

            Favorites:

            -My favorite color is green.
            -My favorite type is fire.
            -My favorite Pokémon are:
            Growlithe, Charizard, Mew,
            Giratina, Haxorus, and Aggron.
            SupahNinja
              #6156    
            Old October 10th, 2011 (7:17 PM).
            Missingyep Missingyep is offline
               
              Join Date: Jul 2010
              Posts: 275
              Quote:
              Originally Posted by SupahNinja View Post
              I know it's possible, because that's what happens every time the player rides their bike or goes fishing, but I don't know the proper commands to use in XSE.
              Those aren't implemented with script commands. There are no script commands that can change the player's sprite...

              Quote:
              Originally Posted by SupahNinja View Post
              This is for FRLG, by the way.
              ...unless you're modding FireRed and you've applied JPAN's Hacked Engine.
                #6157    
              Old October 10th, 2011 (7:36 PM).
              SupahNinja's Avatar
              SupahNinja SupahNinja is offline
              Scripting Ninja
                 
                Join Date: Mar 2011
                Gender: Male
                Posts: 34
                Quote:
                Originally Posted by DavidJCobb View Post
                Quote:
                Originally Posted by SupahNinja View Post
                I know it's possible, because that's what happens every time the player rides their bike or goes fishing, but I don't know the proper commands to use in XSE.
                Those aren't implemented with script commands. There are no script commands that can change the player's sprite...

                Quote:
                Originally Posted by SupahNinja View Post
                This is for FRLG, by the way.
                ...unless you're modding FireRed and you've applied JPAN's Hacked Engine.
                Hmm...

                How is it done in the game?
                ASM? Because I was planning on learning that soon, and I might as well start here.
                __________________
                SupahNinja

                My feelings on
                ROM hacking:

                -I like scripting a lot.
                -Mapping is almost as fun.
                -Hex editing isn't bad at all.
                -I do NOT enjoy spriting.
                -I've been meaning to start learning ASM for a while, but I don't ever seem to have enough time.

                Favorites:

                -My favorite color is green.
                -My favorite type is fire.
                -My favorite Pokémon are:
                Growlithe, Charizard, Mew,
                Giratina, Haxorus, and Aggron.
                SupahNinja
                  #6158    
                Old October 11th, 2011 (12:27 AM).
                Missingyep Missingyep is offline
                   
                  Join Date: Jul 2010
                  Posts: 275
                  Quote:
                  Originally Posted by SupahNinja View Post
                  Hmm...

                  How is it done in the game?
                  ASM? Because I was planning on learning that soon, and I might as well start here.
                  It's ASM, but that knowledge alone wouldn't be enough to reverse-engineer it. I'd imagine that the code for that particular sprite-change is buried deep in the game engine. It'd be hard to find, let alone reverse-engineer -- unless someone already has, that is.

                  JPAN's FireRed Hacked Engine adds functionality that allows you to change the player's overworld sprites from a script. His patch is meant to be applied only to a clean FR ROM (it deletes a lot of stuff), but he also has a hack tool that can apply the changes to a hack-in-progress (it's trickier, though).
                    #6159    
                  Old October 11th, 2011 (2:47 AM). Edited October 11th, 2011 by SupahNinja.
                  SupahNinja's Avatar
                  SupahNinja SupahNinja is offline
                  Scripting Ninja
                     
                    Join Date: Mar 2011
                    Gender: Male
                    Posts: 34
                    Quote:
                    Originally Posted by DavidJCobb View Post
                    Quote:
                    Originally Posted by SupahNinja View Post
                    Hmm...

                    How is it done in the game?
                    ASM? Because I was planning on learning that soon, and I might as well start here.
                    It's ASM, but that knowledge alone wouldn't be enough to reverse-engineer it. I'd imagine that the code for that particular sprite-change is buried deep in the game engine. It'd be hard to find, let alone reverse-engineer -- unless someone already has, that is.

                    JPAN's FireRed Hacked Engine adds functionality that allows you to change the player's overworld sprites from a script. His patch is meant to be applied only to a clean FR ROM (it deletes a lot of stuff), but he also has a hack tool that can apply the changes to a hack-in-progress (it's trickier, though).
                    I've looked up some videos of it in action, and some of them do state that it's an ASM hack. But no one gives details.

                    http://www.youtube.com/watch?v=FKJM4L7xP84
                    http://www.youtube.com/watch?v=WteLk6tXwDA
                    http://www.youtube.com/watch?v=25JQ08zfp2M

                    Which means that if none of them reply to their YouTube messages, I'll check out JPAN's Hacked Engine.

                    Thank you, David.
                    __________________
                    SupahNinja

                    My feelings on
                    ROM hacking:

                    -I like scripting a lot.
                    -Mapping is almost as fun.
                    -Hex editing isn't bad at all.
                    -I do NOT enjoy spriting.
                    -I've been meaning to start learning ASM for a while, but I don't ever seem to have enough time.

                    Favorites:

                    -My favorite color is green.
                    -My favorite type is fire.
                    -My favorite Pokémon are:
                    Growlithe, Charizard, Mew,
                    Giratina, Haxorus, and Aggron.
                    SupahNinja
                      #6160    
                    Old October 14th, 2011 (2:41 PM).
                    Valentin Valentin is offline
                       
                      Join Date: Oct 2011
                      Posts: 18
                      Hi, member's of Pokemon community , I was wondering if there is a script for the ROM Pokemon firered To make Whichever one you don't choose [Boy ,Girl ] become your rival like pokemon Emerald . Including pokemon overworld sprite changing gender.
                        #6161    
                      Old October 14th, 2011 (4:53 PM).
                      Missingyep Missingyep is offline
                         
                        Join Date: Jul 2010
                        Posts: 275
                        Quote:
                        Originally Posted by Valentin View Post
                        Hi, member's of Pokemon community , I was wondering if there is a script for the ROM Pokemon firered To make Whichever one you don't choose [Boy ,Girl ] become your rival like pokemon Emerald . Including pokemon overworld sprite changing gender.
                        There isn't one single script, but there are a combination of techniques you could use.

                        In the maps on which the rival appears, you could use the dynamic OW functionality in JPAN's Hacked Engine. Have a level script check the player's gender and change the rival OW accordingly.

                        In battle scripts, things get more difficult... The simplest way would be to simply create one trainer for every possible rival -- one trainer per gender per starter. Then, when you trigger the battle from a script, check the player's gender in addition to the player's starter and initiate the appropriate trainer battle.

                        The only trouble I can see happening is in the intro sequence, where you actually name the rival. You'd need ASM modifications to conditionally alter their big sprite and to set a different OW to appear on the naming screen.
                          #6162    
                        Old October 15th, 2011 (8:21 AM).
                        Sephiroth2009 Sephiroth2009 is offline
                        Banned
                           
                          Join Date: Oct 2011
                          Posts: 18
                          Is there a script that can make the NPC walk backwards?
                            #6163    
                          Old October 15th, 2011 (4:46 PM).
                          Teh Blazer's Avatar
                          Teh Blazer Teh Blazer is offline
                          Divider of Zero
                             
                            Join Date: Feb 2009
                            Location: 'MERICA
                            Age: 23
                            Gender: Male
                            Nature: Relaxed
                            Posts: 777
                            Quote:
                            Originally Posted by Sephiroth2009 View Post
                            Is there a script that can make the NPC walk backwards?
                            Hmm... I don't think so. Sorry.

                            My Question:
                            If I move a NPC through a script over to another map, they won't disappear unless they leave my sight. Now, this is awesome and all, but how do I make it disappear in front of my eyes? Will the Person Id stay the same and all I have to do is hidesprite, or is there some other way? Or is the only way to make them disappear is to make them leave my sight?
                            __________________
                            Being a hero is overrated anyways
                              #6164    
                            Old October 15th, 2011 (5:33 PM).
                            hinkage's Avatar
                            hinkage hinkage is offline
                            Everyone currently in an argument with this member: I really suggest you stop.
                             
                            Join Date: Aug 2010
                            Age: 23
                            Posts: 378
                            Quote:
                            Originally Posted by Teh Blazer View Post

                            My Question:
                            If I move a NPC through a script over to another map, they won't disappear unless they leave my sight. Now, this is awesome and all, but how do I make it disappear in front of my eyes? Will the Person Id stay the same and all I have to do is hidesprite, or is there some other way? Or is the only way to make them disappear is to make them leave my sight?

                            You can make the NPC disappear with hidesprite. Person ID is flag-based, not map-based.

                            So, if you didn't know, just use hidesprite, then setflag that person's Person ID.
                            __________________
                            (ღ˘⌣˘ღ)
                              #6165    
                            Old October 15th, 2011 (10:26 PM).
                            Satoshi Ookami's Avatar
                            Satoshi Ookami Satoshi Ookami is offline
                            Memento Mori
                             
                            Join Date: Jul 2008
                            Location: Abyss of Time, Great Seal
                            Age: 26
                            Gender: Male
                            Nature: Calm
                            Posts: 14,530
                            The best way to make NPC disappear is by using applymovement.
                            applymovement 'hide'
                            applymovement 'movements that make NPC to some place player cannot reach'
                            setflag
                            And once you leave the map, NPC won't be there until you clear its flag =D
                            __________________
                            ROM hacking FAQ - Read before asking how to play a hack.

                            Anime List | PSN Trophy List
                              #6166    
                            Old October 15th, 2011 (10:42 PM).
                            Sephiroth2009 Sephiroth2009 is offline
                            Banned
                               
                              Join Date: Oct 2011
                              Posts: 18
                              Yes using clearflag is useful when there's a sprite you want hidden for the moment until another time when you want it resurfaced on a map you've been through a dozen times.
                                #6167    
                              Old October 15th, 2011 (10:44 PM).
                              Vladimir312's Avatar
                              Vladimir312 Vladimir312 is offline
                                 
                                Join Date: Sep 2011
                                Location: Las Vegas, Nevada
                                Gender: Male
                                Posts: 27
                                I'm looking to create a "train" script where you can see the players sprite as the train moves. How would I keep the character moving in sync with the train without making it walk as the train is moving?
                                  #6168    
                                Old October 15th, 2011 (10:50 PM).
                                Satoshi Ookami's Avatar
                                Satoshi Ookami Satoshi Ookami is offline
                                Memento Mori
                                 
                                Join Date: Jul 2008
                                Location: Abyss of Time, Great Seal
                                Age: 26
                                Gender: Male
                                Nature: Calm
                                Posts: 14,530
                                Quote:
                                Originally Posted by Vladimir312 View Post
                                I'm looking to create a "train" script where you can see the players sprite as the train moves. How would I keep the character moving in sync with the train without making it walk as the train is moving?
                                Why in the world don't you want sync movement? o.O
                                Make player disappear when he "enters" train, make him reappear when you want "looking through the window" and use sync movement.
                                There's no point in trying it by using other means o.O
                                __________________
                                ROM hacking FAQ - Read before asking how to play a hack.

                                Anime List | PSN Trophy List
                                  #6169    
                                Old October 16th, 2011 (12:34 PM).
                                zacharianinja zacharianinja is offline
                                   
                                  Join Date: Oct 2008
                                  Posts: 11
                                  Im currently hacking a fire red rom and i have found a huge bug, when i go into a battle then select the bag option in the battle interface the game restarts to the start screen at the beginning of the game, i havent added any scripts yet. do i have to set a flag or anything? (i copied the file and made a give pokemon script also and it still occurs)
                                    #6170    
                                  Old October 16th, 2011 (1:04 PM).
                                  Missingyep Missingyep is offline
                                     
                                    Join Date: Jul 2010
                                    Posts: 275
                                    Quote:
                                    Originally Posted by Ash493 View Post
                                    Why in the world don't you want sync movement? o.O
                                    Make player disappear when he "enters" train, make him reappear when you want "looking through the window" and use sync movement.
                                    There's no point in trying it by using other means o.O
                                    Wouldn't it be easier to use some script or ASM (i.e. JPAN's engine) to change the player's OW into one whose walking and standing frames are identical, and then use applymovement?
                                      #6171    
                                    Old October 17th, 2011 (3:10 AM).
                                    Satoshi Ookami's Avatar
                                    Satoshi Ookami Satoshi Ookami is offline
                                    Memento Mori
                                     
                                    Join Date: Jul 2008
                                    Location: Abyss of Time, Great Seal
                                    Age: 26
                                    Gender: Male
                                    Nature: Calm
                                    Posts: 14,530
                                    Quote:
                                    Originally Posted by DavidJCobb View Post
                                    Wouldn't it be easier to use some script or ASM (i.e. JPAN's engine) to change the player's OW into one whose walking and standing frames are identical, and then use applymovement?
                                    Since ASM is concerned I must say no. ;)
                                    And remember, not everyone can do ASM. :)
                                    __________________
                                    ROM hacking FAQ - Read before asking how to play a hack.

                                    Anime List | PSN Trophy List
                                      #6172    
                                    Old October 18th, 2011 (7:10 AM).
                                    bambambiker's Avatar
                                    bambambiker bambambiker is offline
                                       
                                      Join Date: Oct 2011
                                      Gender: Male
                                      Posts: 5
                                      hello folks!


                                      Appologise for my first post being that of a requesting nature, but I'm having a fair
                                      bit of trouble with a script I'm working on for a questline.

                                      So far i've managed to finish the quest scripts apart from the final event, which is as follows.


                                      player talks to npc, npc warps him outside building,
                                      two new npcs are stood blocking the door which was previously used to access
                                      this building.

                                      Any ideas?

                                      quick over view

                                      *have building with entrance clear
                                      *enter building, do quest
                                      * finish quest, warp back outside building
                                      *entrance to building now blocked by two npcs


                                      Using Fire Red, english type BRP, v1.0
                                        #6173    
                                      Old October 18th, 2011 (9:39 AM).
                                      Satoshi Ookami's Avatar
                                      Satoshi Ookami Satoshi Ookami is offline
                                      Memento Mori
                                       
                                      Join Date: Jul 2008
                                      Location: Abyss of Time, Great Seal
                                      Age: 26
                                      Gender: Male
                                      Nature: Calm
                                      Posts: 14,530
                                      Pretty easy to do.
                                      1) Put those 2 NPC that will block the entrance in A-Map.
                                      2) Assign them with some flag.
                                      3) Set that flag before you do actual script. It means that those two blocking the way will disappear.
                                      4) Script the script where NPC warps player and add clearflag 0x(number of flag that was assigned to those 2 NPCs) command =)
                                      __________________
                                      ROM hacking FAQ - Read before asking how to play a hack.

                                      Anime List | PSN Trophy List
                                        #6174    
                                      Old October 18th, 2011 (12:13 PM).
                                      bambambiker's Avatar
                                      bambambiker bambambiker is offline
                                         
                                        Join Date: Oct 2011
                                        Gender: Male
                                        Posts: 5
                                        Aaaaaaack!! So simple!! I was trying to
                                        over complicate it! I guess sometimes you need to step out of the forest to see the trees.

                                        Happy to report it worked beautifully, the variable is now set in pallet town during the oak script.

                                        Thanks Ash!
                                          #6175    
                                        Old October 18th, 2011 (2:35 PM).
                                        zacharianinja zacharianinja is offline
                                           
                                          Join Date: Oct 2008
                                          Posts: 11
                                          alright this is probably gonna seem like a stupid question because its gonna be a simple answer but hope do i make a pokeball with an item in it. i can make it and gives you the item and everything but i dont know how to get it to disapear right after so you cant get it anymore
                                          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
                                          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 6:26 AM.