The PokéCommunity Forums Fan Games ROM Hacking
[ARCHIVE] Simple Questions (SEARCH BEFORE ASKING A QUESTION)

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
  #19651    
Old September 21st, 2011 (6:13 PM).
Darthatron's Avatar
Darthatron Darthatron is offline
巨大なトロール。
  • Silver Tier
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 26
Gender: Male
Nature: Modest
Posts: 1,152
Quote:
Originally Posted by xyer View Post
I was wondering if there is a possibility to check the levels of the pokemons that are in the players party? If someone could show me a way to do this that would be really helpful.
Not in an overly easy way, no. You can either implement some ASM code to store the level of a pokemon in a variable then use a script to display it, or you can do it ALL in a script. The ASM code is a much better option.

ASM Code option:
Code:
.align 2
.thumb

start:

	push {r0-r3, lr}
	
		ldr r0, Var_8004		/*load the pointer of variable 0x8004 into r0*/
		ldrh r1, [r0]			/*load the value of variable 0x8004 into r1*/
		
		cmp r1, #0x5			/*compares the value of r1 to 0x5*/
		bgt quit				/*if greater than 0x5, goto quit label*/
		
		mov r0, #0x64			/*set the value of r1 to 0x64*/
		mul r1, r0				/*multiply by r1 (0x64) to 'move' to that pokemon slot*/

		ldr r2, Party_Pointer	/*load the pointer for party data into r2*/
		add r2, #0x54			/*move to where the level is stored*/
		add r2, r1				/*add the value of r1 to r2*/
		
		ldrb r3, [r2]			/*load the level byte into r0*/

quit:

		ldr r1, Var_800D		/*load the pointer for variable 0x800D into r1*/
		strh r3, [r1]			/*store the (halfword) level value into var 0x800D*/
 
	pop {r0-r3, pc}

Party_Pointer: .word 0x02024284
Var_8004: .word 0x020370c0
Var_800D: .word 0x020370d0
Script option:
Code:
#dynamic 0x800000

#org @Pokemon1
setvar LASTRESULT 0x0000
copybyte 0x020370d0 0x020242D8
return
end

#org @Pokemon2
setvar LASTRESULT 0x0000
copybyte 0x020370d0 0x0202433C
return
end

#org @Pokemon3
setvar LASTRESULT 0x0000
copybyte 0x020370d0 0x020242A0
return
end

#org @Pokemon4
setvar LASTRESULT 0x0000
copybyte 0x020370d0 0x02024404
return
end

#org @Pokemon5
setvar LASTRESULT 0x0000
copybyte 0x020370d0 0x02024468
return
end

#org @Pokemon6
setvar LASTRESULT 0x0000
copybyte 0x020370d0 0x020244CC
return
end
Hope that helps.
__________________
あなた は しきしゃ です
わたし は ばか です

Relevant Advertising!

  #19652    
Old September 21st, 2011 (11:04 PM).
penguinpanda0 penguinpanda0 is offline
     
    Join Date: Sep 2011
    Gender: Male
    Posts: 1
    1) Is there a format for obstacles cleared by HMs (such as the tree for cut, the rock for rock smash)? Also, how do the movement permission numbers in Advance Map apply to these obstacles?

    2) Can you change the Professor's "New Game" speech in Leaf Green?
      #19653    
    Old September 22nd, 2011 (3:06 PM).
    Rainbow's Avatar
    Rainbow Rainbow is online now
    • Moderator
    • Platinum Tier
    • PokéCommunity Daily
    • Discord Moderoid
    • Developer
     
    Join Date: May 2010
    Age: 18
    Gender: Female
    Nature: Quirky
    Posts: 6,050
    Quote:
    Originally Posted by penguinpanda0 View Post
    1) Is there a format for obstacles cleared by HMs (such as the tree for cut, the rock for rock smash)? Also, how do the movement permission numbers in Advance Map apply to these obstacles?
    I don't know what you mean by "a format", but there are no movement permissions for those. They're not tiles; they're events, just like a person that you talk to. Naturally, they have a script attached to them which allows them to be smashed, cut, pushed around, etc.
    Quote:
    Originally Posted by penguinpanda0 View Post
    2) Can you change the Professor's "New Game" speech in Leaf Green?
    Just use Advance-Text. Google it.
      #19654    
    Old September 22nd, 2011 (5:09 PM).
    xyer xyer is offline
       
      Join Date: Sep 2011
      Gender: Male
      Posts: 3
      Quote:
      Originally Posted by Darthatron View Post
      Spoiler:
      Not in an overly easy way, no. You can either implement some ASM code to store the level of a pokemon in a variable then use a script to display it, or you can do it ALL in a script. The ASM code is a much better option.

      ASM Code option:
      Code:
      .align 2
      .thumb
      
      start:
      
          push {r0-r3, lr}
          
              ldr r0, Var_8004        /*load the pointer of variable 0x8004 into r0*/
              ldrh r1, [r0]            /*load the value of variable 0x8004 into r1*/
              
              cmp r1, #0x5            /*compares the value of r1 to 0x5*/
              bgt quit                /*if greater than 0x5, goto quit label*/
              
              mov r0, #0x64            /*set the value of r1 to 0x64*/
              mul r1, r0                /*multiply by r1 (0x64) to 'move' to that pokemon slot*/
      
              ldr r2, Party_Pointer    /*load the pointer for party data into r2*/
              add r2, #0x54            /*move to where the level is stored*/
              add r2, r1                /*add the value of r1 to r2*/
              
              ldrb r3, [r2]            /*load the level byte into r0*/
      
      quit:
      
              ldr r1, Var_800D        /*load the pointer for variable 0x800D into r1*/
              strh r3, [r1]            /*store the (halfword) level value into var 0x800D*/
       
          pop {r0-r3, pc}
      
      Party_Pointer: .word 0x02024284
      Var_8004: .word 0x020370c0
      Var_800D: .word 0x020370d0
      Script option:
      Code:
      #dynamic 0x800000
      
      #org @Pokemon1
      setvar LASTRESULT 0x0000
      copybyte 0x020370d0 0x020242D8
      return
      end
      
      #org @Pokemon2
      setvar LASTRESULT 0x0000
      copybyte 0x020370d0 0x0202433C
      return
      end
      
      #org @Pokemon3
      setvar LASTRESULT 0x0000
      copybyte 0x020370d0 0x020242A0
      return
      end
      
      #org @Pokemon4
      setvar LASTRESULT 0x0000
      copybyte 0x020370d0 0x02024404
      return
      end
      
      #org @Pokemon5
      setvar LASTRESULT 0x0000
      copybyte 0x020370d0 0x02024468
      return
      end
      
      #org @Pokemon6
      setvar LASTRESULT 0x0000
      copybyte 0x020370d0 0x020244CC
      return
      end
      Hope that helps.
      Ok, I started hacking a few days ago and I don't understand too much of it yet. But I will work it over and I'm sure it will be helpful. Thank you very much.
        #19655    
      Old September 22nd, 2011 (7:31 PM).
      Darthatron's Avatar
      Darthatron Darthatron is offline
      巨大なトロール。
      • Silver Tier
       
      Join Date: Jan 2006
      Location: Melbourne, Australia
      Age: 26
      Gender: Male
      Nature: Modest
      Posts: 1,152
      Quote:
      Originally Posted by xyer View Post
      Ok, I started hacking a few days ago and I don't understand too much of it yet. But I will work it over and I'm sure it will be helpful. Thank you very much.
      Check out this thread for help with scripting. The scripting option will definitely be the option for you. It takes a long time to understand ASM. And you're very welcome. PM me if you have any questions.
      __________________
      あなた は しきしゃ です
      わたし は ばか です
        #19656    
      Old September 23rd, 2011 (8:35 AM).
      tente2's Avatar
      tente2 tente2 is offline
      "Outta my way, dammit!"
         
        Join Date: Sep 2009
        Location: Snowpoint City
        Gender: Male
        Nature: Bashful
        Posts: 403
        Well, I'll feel like a total idiot if this has already been answered, but I searched the thread for a while and couldn't find very helpful answers to some of my questions. Also, I had a problem with Advance Text.

        First is Advance Text. Whenever I try to open it I get this:

        First of all, when I first got the file I copied the contents onto another folder instead of extracting them (is that bad?) Also, I've tried putting Advance Text in the ini folder in case that helped. It didn't.

        Next, my questions:

        1. I did see an answer for this one, but it wasn't extremely clear in my opinion. So, my question is how do I enable the Pokemon tab (without Oak)? I did see some kind of code, but my question is a) can I just copy and paste this code in whatever script I wish and b) does it work in Pokewitch? If not, in which script program does it work in? (I have PKSUVI too, I just don't know how to use it at all)

        2. How do I make a script to give the player the National Pokedex?

        3. Okay, promise this is the last one (for now): Is there any step-by-step newbie guide for changing Oak's sprite?

        Thanks a lot if anybody answers!
        __________________
          #19657    
        Old September 23rd, 2011 (4:08 PM).
        chrunch chrunch is offline
        • Gold Tier
         
        Join Date: Oct 2009
        Gender: Male
        Posts: 1,350
        Quote:
        Originally Posted by tente2 View Post
        Well, I'll feel like a total idiot if this has already been answered, but I searched the thread for a while and couldn't find very helpful answers to some of my questions. Also, I had a problem with Advance Text.

        First is Advance Text. Whenever I try to open it I get this:

        First of all, when I first got the file I copied the contents onto another folder instead of extracting them (is that bad?) Also, I've tried putting Advance Text in the ini folder in case that helped. It didn't.
        you need to get comctl32.ocx on your computer. download it and follow the instructions here.

        Or at least that's how I fixed that error.
        __________________
          #19658    
        Old September 23rd, 2011 (5:21 PM).
        Missingyep Missingyep is offline
           
          Join Date: Jul 2010
          Posts: 275
          Quote:
          Originally Posted by tente2 View Post
          1. I did see an answer for this one, but it wasn't extremely clear in my opinion. So, my question is how do I enable the Pokemon tab (without Oak)? I did see some kind of code, but my question is a) can I just copy and paste this code in whatever script I wish and b) does it work in Pokewitch? If not, in which script program does it work in? (I have PKSUVI too, I just don't know how to use it at all)
          I have no idea what Pokewitch is, and I'm told that PKSVUI is unreliable. Use XSE.

          Anyway, enabling the Pokemon and Pokedex menus is done by setting certain flags in the game. The flag number varies across games but, to my knowledge, is always between 0x800 and 0x8FF.

          If you check XSE's "std.rbh" file, it should have... Well, basically it's a list matching shorthand names to various in-game numbers, and the flags for each game should be in there.

          Quote:
          Originally Posted by tente2 View Post
          2. How do I make a script to give the player the National Pokedex?
          In FireRed, it's a special. I think XSE's Guide lists which one.
            #19659    
          Old September 24th, 2011 (7:43 PM). Edited September 24th, 2011 by Nitrus015.
          Nitrus015 Nitrus015 is offline
             
            Join Date: Sep 2011
            Gender: Male
            Posts: 4
            I've been searching my a** off and can't find a solution to my problem, so I'm sorry if this has been asked, but I tried to be thorough:

            FireRed (without JPAN engine)

            I'm using the addpokemon command in PKSV to give me a Pokemon with an index chosen through the Mart (similar to DavidJCobb's method (wish I'd seen that sooner, would have saved me a lot of time), but mine uses only ones). Switching to XSE should be easy enough, I just prefer PKSV, it's proved to be simpler, at least for me.

            I'm able to set the Pokemon's index with a var set in the first field, but not it's level, as it seems to take only HEX (or decimal) values directly.

            For example, if I use:
            addpokemon 0x4002 0x4003 NONE 0x0 0x0 0x0

            I'm given the Pokemon I chose through the Market, and I use the same method to choose it's level, but no matter what value is in my 0x4003, I only get level 3. If I try var 0x4004 I'd only get level 4, which means it takes in the level directly as HEX, and not as a var.
            I tried LASTRESULT (or 0x800D), of course, didn't work either, as it's stil HEX after all.

            Anybody know a way around this? Changing Pokemon's levels I mean...
            Thanks in advance.

            P.S.: I'm VERY limited in my knowledge regarding ASM, so if your answer is related to it, please supply an explanation of your code, just for me to know what's happening... If possible of course.
              #19660    
            Old September 24th, 2011 (8:17 PM).
            Missingyep Missingyep is offline
               
              Join Date: Jul 2010
              Posts: 275
              Quote:
              Originally Posted by Nitrus015 View Post
              similar to DavidJCobb's method (wish I'd seen that sooner, would have saved me a lot of time)
              I should note that that method is bloody terrible unless it's a debugging script. Sloppy. :\

              Quote:
              Originally Posted by Nitrus015 View Post
              I'm able to set the Pokemon's index with a var set in the first field, but not it's level, as it seems to take only HEX values directly.

              Anybody know a way around this? Changing Pokemon's levels I mean...
              Thanks in advance.

              P.S.: I'm VERY limited in my knowledge regarding ASM, so if your answer is related to it, please supply an explanation of your code, just for me to know what's happening... If possible of course.
              I myself don't know a method, but JPAN has code for changing a Pokemon's happiness. I mention this because theoretically, you would change a Pokemon's experience using the exact same method (experience and happiness are stored in the same data substructure).

              (Any ASM that does this will need to change experience. A Pokemon's level is only stored with it when that Pokemon is in your party -- and even then, it's only kept for convenience' sake. Level is recalculated from experience, always.)

              Unfortunately, you may not find that code easy to understand if you don't know ASM very well. But it's a starting point. :\
                #19661    
              Old September 24th, 2011 (8:30 PM).
              Nitrus015 Nitrus015 is offline
                 
                Join Date: Sep 2011
                Gender: Male
                Posts: 4
                Quote:
                Originally Posted by DavidJCobb View Post
                I should note that that method is bloody terrible unless it's a debugging script. Sloppy. :\
                I was thinking the exact same thing when making it, but it for personal use, to make the game more enjoyable...

                Quote:
                Originally Posted by DavidJCobb View Post
                Unfortunately, you may not find that code easy to understand if you don't know ASM very well. But it's a starting point. :\
                True. Oh well... I was thinking of playing around with Rare Candies, but might as well push myself to learn ASM... I've prolonged not learning it for a while now... :\
                  #19662    
                Old September 24th, 2011 (8:59 PM).
                Missingyep Missingyep is offline
                   
                  Join Date: Jul 2010
                  Posts: 275
                  Quote:
                  Originally Posted by Nitrus015 View Post
                  True. Oh well... I was thinking of playing around with Rare Candies, but might as well push myself to learn ASM... I've prolonged not learning it for a while now... :\
                  ASM's a good thing to learn. It'll make it so much easier to understand FireRed and do more advanced things than scripts can provide.

                  Word of advice 1: Start by just trying to read and understand ASM. Put off writing your own routines until you've a good grasp of the language.

                  Word of advice 2: If you already know your own programming languages, you may find translation to be an easier way to understand the game's ASM. For example, when I read ASM, I literally do a line-by-line translation into something that resembles JavaScript more than it does ASM. Makes it more readable, IMO.
                    #19663    
                  Old September 24th, 2011 (10:13 PM).
                  Thrasher24's Avatar
                  Thrasher24 Thrasher24 is offline
                  ~Legendary Master~
                     
                    Join Date: Mar 2011
                    Location: Outside of Pallet Town, Kanto
                    Gender: Male
                    Nature: Adamant
                    Posts: 55
                    RE: NATDEX WORKS

                    Nvm, it worked once but now it doesnt. I open XSE and the script offset, and it has the nat dex info but i still only get the old dex. How do i fix this?
                      #19664    
                    Old September 24th, 2011 (11:33 PM).
                    Missingyep Missingyep is offline
                       
                      Join Date: Jul 2010
                      Posts: 275
                      Quote:
                      Originally Posted by Thrasher24 View Post
                      RE: NATDEX WORKS

                      Nvm, it worked once but now it doesnt. I open XSE and the script offset, and it has the nat dex info but i still only get the old dex. How do i fix this?
                      Uh... Could you perhaps post the script (in a spoiler tag, please) for us to look at, so we can see if there are errors in it? And which game are you working with? FireRed, right?
                        #19665    
                      Old September 25th, 2011 (5:53 AM).
                      PunkRock PunkRock is offline
                         
                        Join Date: Sep 2011
                        Posts: 5
                        Hey I have a question is it possible to replace a pokemons moves? Like for example I want to change quick attack to " Roar of time " Is it possible to import it like importing a new sprite?
                          #19666    
                        Old September 25th, 2011 (8:03 AM).
                        Rainbow's Avatar
                        Rainbow Rainbow is online now
                        • Moderator
                        • Platinum Tier
                        • PokéCommunity Daily
                        • Discord Moderoid
                        • Developer
                         
                        Join Date: May 2010
                        Age: 18
                        Gender: Female
                        Nature: Quirky
                        Posts: 6,050
                        Quote:
                        Originally Posted by PunkRock View Post
                        Hey I have a question is it possible to replace a pokemons moves? Like for example I want to change quick attack to " Roar of time " Is it possible to import it like importing a new sprite?
                        No, don't get rid of quick attack, do you want a bunch of Rattata that know Roar of Time?

                        The move animations can be edited in uNLZ, the effects and stats, in A-Tack. I'm not sure how to change the name of the moves themselves, but I know there is a way.
                          #19667    
                        Old September 25th, 2011 (10:12 AM).
                        EdensElite's Avatar
                        EdensElite EdensElite is offline
                        No0b, but getting there.
                           
                          Join Date: Jun 2011
                          Location: UK
                          Gender: Male
                          Nature: Bold
                          Posts: 190
                          Does anybody know the flag for recieving a pokemon
                          __________________

                          ROM Hacking was getting frustrating for me. I've now stopped productions and writing the game from scratch in HTML 5.

                          That means it will be playable in the browser, and across multiple devices such as the iPod touch.
                            #19668    
                          Old September 25th, 2011 (10:21 AM).
                          Rainbow's Avatar
                          Rainbow Rainbow is online now
                          • Moderator
                          • Platinum Tier
                          • PokéCommunity Daily
                          • Discord Moderoid
                          • Developer
                           
                          Join Date: May 2010
                          Age: 18
                          Gender: Female
                          Nature: Quirky
                          Posts: 6,050
                          Quote:
                          Originally Posted by EdensElite View Post
                          Does anybody know the flag for recieving a pokemon
                          There's no flag, it's a givepokemon script. Flags are for stuff like Pokedex, Running Shoes, etc.
                            #19669    
                          Old September 25th, 2011 (11:07 AM).
                          PunkRock PunkRock is offline
                             
                            Join Date: Sep 2011
                            Posts: 5
                            Quote:
                            Originally Posted by HackDeoxys View Post
                            No, don't get rid of quick attack, do you want a bunch of Rattata that know Roar of Time?

                            The move animations can be edited in uNLZ, the effects and stats, in A-Tack. I'm not sure how to change the name of the moves themselves, but I know there is a way.
                            Haha nah i wasn't it was just an example, and do you mind linking me to " A-tack ". Much appreciated man.
                              #19670    
                            Old September 25th, 2011 (11:42 AM).
                            Truality Truality is offline
                            Left for good
                               
                              Join Date: Aug 2011
                              Gender: Male
                              Posts: 1,007
                              Quote:
                              Originally Posted by EdensElite View Post
                              Does anybody know the flag for recieving a pokemon
                              Quote:
                              Originally Posted by HackDeoxys View Post
                              There's no flag, it's a givepokemon script. Flags are for stuff like Pokedex, Running Shoes, etc.
                              He probably meant the flag that enables the pokemon menu. You can't get ahold of your pokemon if you don't enable it. It's the flag 0x820.
                              __________________
                              This is my December . . .
                                #19671    
                              Old September 25th, 2011 (12:32 PM).
                              Rainbow's Avatar
                              Rainbow Rainbow is online now
                              • Moderator
                              • Platinum Tier
                              • PokéCommunity Daily
                              • Discord Moderoid
                              • Developer
                               
                              Join Date: May 2010
                              Age: 18
                              Gender: Female
                              Nature: Quirky
                              Posts: 6,050
                              Quote:
                              Originally Posted by PunkRock View Post
                              Haha nah i wasn't it was just an example, and do you mind linking me to " A-tack ". Much appreciated man.
                              Sorry, you're not allowed to post links to other forums, but you can look for it on Whack A Hack.
                                #19672    
                              Old September 25th, 2011 (1:09 PM).
                              EdensElite's Avatar
                              EdensElite EdensElite is offline
                              No0b, but getting there.
                                 
                                Join Date: Jun 2011
                                Location: UK
                                Gender: Male
                                Nature: Bold
                                Posts: 190
                                Sorry, I wasn't clear enough, what I meant was, the flag that checks you have a pokemon, for the starters etc.

                                Also, What the easiest way of replacing a pokemon's cry?
                                __________________

                                ROM Hacking was getting frustrating for me. I've now stopped productions and writing the game from scratch in HTML 5.

                                That means it will be playable in the browser, and across multiple devices such as the iPod touch.
                                  #19673    
                                Old September 25th, 2011 (2:01 PM).
                                ThundahCakes ThundahCakes is offline
                                   
                                  Join Date: Sep 2011
                                  Gender: Male
                                  Posts: 1
                                  I can't be bothered to go through 788 pages of ROM hacking, so can someone please tell me (or give me a program/tutorial) how to put sprites from a Gen. IV/V 'mon into a Gen. III game?
                                    #19674    
                                  Old September 25th, 2011 (3:45 PM).
                                  PunkRock PunkRock is offline
                                     
                                    Join Date: Sep 2011
                                    Posts: 5
                                    Quote:
                                    Originally Posted by ThundahCakes View Post
                                    I can't be bothered to go through 788 pages of ROM hacking, so can someone please tell me (or give me a program/tutorial) how to put sprites from a Gen. IV/V 'mon into a Gen. III game?
                                    At least check the forum before asking a question... if your looking for a tutorial its kind of obvious that it would be in the TUTORIAL Section...
                                      #19675    
                                    Old September 25th, 2011 (3:50 PM). Edited September 25th, 2011 by Missingyep.
                                    Missingyep Missingyep is offline
                                       
                                      Join Date: Jul 2010
                                      Posts: 275
                                      Quote:
                                      Originally Posted by EdensElite View Post
                                      Sorry, I wasn't clear enough, what I meant was, the flag that checks you have a pokemon, for the starters etc.
                                      Flags don't check for anything, but they can be set or unset by other things that check things.

                                      If you're referring to the "Pokemon" option in the Start Menu, though, then you would need to set flag 0x828 in FireRed. You can find other flags listed in XSE's "std.rbh" (which maps numerical values to textual names, so that you don't need to memorize so much).

                                      Quote:
                                      Originally Posted by ThundahCakes View Post
                                      I can't be bothered to go through 788 pages of ROM hacking,
                                      You don't need to.

                                      Quote:
                                      Originally Posted by ThundahCakes View Post
                                      so can someone please tell me (or give me a program/tutorial) how to put sprites from a Gen. IV/V 'mon into a Gen. III game?
                                      Download any one of several Pokemon-editing programs from the "Toolbox" section. Find the Gen IV sprites you want to insert. Scale them down to 64x64px in an image editor -- and don't use resampling or anti-aliasing. Insert into the ROM using a program from the Toolbox.

                                      If you have palette issues, make sure that the front and back sprites use the exact same sixteen colors. (In Gen IV, the two are allowed to have different palettes. The same is not true for Gen III.)
                                      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 6:59 AM.