• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ARCHIVE] Simple Questions (SEARCH BEFORE ASKING A QUESTION)

Status
Not open for further replies.

EdensElite

No0b, but getting there.
190
Posts
12
Years
  • Age 29
  • UK
  • Seen Jul 4, 2014
You don't allocate space at all. You use XSE's "#dynamic" preprocessing directive; place it at the top of your script.

Essentially, "#dynamic 0xXXYYZZ" tells XSE to search for free space starting at (and including) the ROM offset 0x08XXYYZZ. Every time you use a "#org @NameOfSomething" statement, XSE will find free space for the associated data.

When you compile the script, a small log window should pop up. At the bottom are two listboxes, showing the offsets that were found and used for each named "#org" statement. You'd copy the offset for whichever "#org" is the start of your script, and that is what you would put into AdvanceMap or some other program.

No. The GBA can only have 32 palettes loaded at a time; 16 for the background (maps, box frames, etc.) and 16 for sprites.

Thanks. Thats really helpful :)

I have a problem with OWs. It worked with the first couple of OWS but when I inserted this certain one, when I try and use this particular one, it only show the first frame in-game. All my other ones work though...
 

Thrasher24

~Legendary Master~
55
Posts
13
Years
You need to have a script in your ROM that, when it is activated, uses the commands that make your Pokédex work.
As treeckopa said, you should first use the command setflag 0x861 to activate your Regional Pokédex, then after that use special 0x1F3 to turn it into a National Pokédex.
If you have AdvanceMap and XSE, you really don't need anything else to edit scripts (AdvanceMap to find the offsets, XSE to edit the script and put it in the ROM).
Hex editing won't really help you write this script.
If you have no idea how to write scripts, then check out one of these tutorials:
http://www.pokecommunity.com/showthread.php?t=164276
http://www.pokecommunity.com/showthread.php?t=146174


DUDE! Thnx man, it took me a while to figure out how to put it in2 the game but i got it. thnx a BUNCH!!!
 
4
Posts
12
Years
  • Seen Dec 22, 2011
Okay, so ive been searching around for a way to force an egg to hatch through an XSE script, and ive come across Special 0x0C2. This special is supposed to hatch an egg, but whenever i test it, another egg hatches out of it. Any tips on what im doing wrong or how to use the special right?
 

EdensElite

No0b, but getting there.
190
Posts
12
Years
  • Age 29
  • UK
  • Seen Jul 4, 2014
Thanks. Thats really helpful :)

I have a problem with OWs. It worked with the first couple of OWS but when I inserted this certain one, when I try and use this particular one, it only show the first frame in-game. All my other ones work though...


Note to people: Fire Red BPRE, NSE Palette 13 is dodgy. I tried a different palette and it worked perfectly.
 

EdensElite

No0b, but getting there.
190
Posts
12
Years
  • Age 29
  • UK
  • Seen Jul 4, 2014
Ok picture this: There are a bunch of OWs in game, These are starter pokemon. When I click on them I want there to be a message and a pokepic of them and then ask me if I want them. When I accept one of them, I want a flag to activate that will stop asking if I want them but keep the OW and the message and pokepic there. btw Can script at all. Help please.
 
275
Posts
13
Years
  • Seen Oct 9, 2019
Ok picture this: There are a bunch of OWs in game, These are starter pokemon. When I click on them I want there to be a message and a pokepic of them and then ask me if I want them. When I accept one of them, I want a flag to activate that will stop asking if I want them but keep the OW and the message and pokepic there. btw Can script at all. Help please.
Use checkflag before asking to accept one, and end the script if the flag is set. After accepting one, setflag.

Code:
...
checkflag 0x123 // random flag, make sure you pick a safe one
if 0x1 goto @end
msgbox @sAskPlayer 0x05
compare LASTRESULT 0x0
if 0x1 goto @end
goto @giveStarter

#org @giveStarter
// code to give the starter

#org @end
releaseall
end

#org @sAskPlayer
= Do you want this Pokemon?
 
3
Posts
12
Years
  • Seen Nov 1, 2015
Heyho, just another newb asking some questions. ;)

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.

Another question is how to use the Pokedollar/Yen/whatever sign in a msgbox?
Second question got answered (ty for that), but I still got no idea how to check the levels. Any help would be highly appreciated.
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
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.
 
1
Posts
12
Years
  • Seen Sep 24, 2011
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?
 

Flowerchild

fleeting assembly
8,709
Posts
13
Years
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.
2) Can you change the Professor's "New Game" speech in Leaf Green?
Just use Advance-Text. Google it.
 
3
Posts
12
Years
  • Seen Nov 1, 2015
Spoiler:
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.
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
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.
 

tente2

"Outta my way, dammit!"
403
Posts
14
Years
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:
Advancetextcrap.jpg

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!
 
1,344
Posts
14
Years
  • Seen Dec 10, 2021
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:
Advancetextcrap.jpg

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.
 
275
Posts
13
Years
  • Seen Oct 9, 2019
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.

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.
 
4
Posts
12
Years
  • Seen Nov 6, 2014
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.
 
Last edited:
275
Posts
13
Years
  • Seen Oct 9, 2019
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. :\

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. :\
 
4
Posts
12
Years
  • Seen Nov 6, 2014
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...

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... :\
 
275
Posts
13
Years
  • Seen Oct 9, 2019
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.
 
Status
Not open for further replies.
Back
Top