hi, i have problems with the EV berries script.... always reboots the ROM even when i set the asm offset to +1 since it's thumb.... please help..
Oooh, your storage system was exactly what I wanted for making a 'leader of a team' (like Rocket/Magma) hack / any hack where you have a team larger than 6 / any hack where you play as more than one person. However, I have just one question.
Can I manually set the experience gained in the counter variable so I can alter the pokemon stored to the levels I want? It would be a pain, but I could do a check for instance to see what level the rest of your party is, what level the stored pokemon are, and then alter the EXP variable accordingly, and it would be like they were genuinely part of your party, sorta. I mean, it would be a little clumsy - the best version would be to check the EXP and set that to exactly the parties' (I didn't check your stat checker program yet; if that does EXP checking then epic! and with a little math would solve that neatly)- but it would be pretty dang cool.
Also, if I made said script (I prolly will), would you like me to post it here as an example for other people?
How bout an item that can capture a trainers pokemon, like a "Team Rocket Ball"... but no other balls will do it...
I was thinking use the capture trainers pokemon hack, then hack the trainers routine so it always sets var 0x8000 to 0x1, then during the capture script of this specific item, itll change 0x8000 to 0x0...
and of course at the end of any trainer battle, 0x8000 goes back to 0x0 so wild pokemon can still be caught...
problem is, i dont know where the trainer battle script it, or how to write pokeball scripts...
.text
.align 2
.thumb
.thumb_func
main:
ldr r0, .Ball
ldrb r0, [r0]
cmp r0, #0x1 @masterball
beq capture
mov r0, #0x0
mov r1, #0x5
ldr r3, =(0x800E194 +1)
bl linker
ldr r0, =(0x802D4A0 +1)
bx r0
capture:
ldr r0, =(0x802D4B4 +1)
bx r0
linker:
bx r3
.align 2
.Ball:
.word 0x2023D68
06 48 00 78 01 28 06 D0 00 20 05 21 04 4B 00 F0 04 F8 04 48 00 47 04 48 00 47 18 47 68 3D 02 02 95 E1 00 08 A1 D4 02 08 B5 D4 02 08
00 48 00 47 XX XX XX 08
Hmm, I've been asked to do this before and it's quite the common request. However, it's so easy and straight forward, I'm always left wondering why people don't do it themselves. Then I remember, even if it's easy for me, I guess it's not as easy if you don't know what to do :P
Trainer Capture toggle by Pokeball
Before I begin, if you want to learn how to make your own Pokeball, look at danillS work over here: https://www.pokecommunity.com/threads/326311
What this does right now, if check if the thrown Pokeball is a masterball. If it is, allow capture. If it's not a masterball then the normal "trainer has blocked the ball" will occur. To change which ball toggles the capture look at my comments in the code and change 0x1 - masterball to something else of your choice.
Spoiler:
Taken from XSE:
#define ITEM_MASTERBALL 0x1
#define ITEM_ULTRABALL 0x2
#define ITEM_GREATBALL 0x3
#define ITEM_POKEBALL 0x4
#define ITEM_SAFARIBALL 0x5
#define ITEM_NETBALL 0x6
#define ITEM_DIVEBALL 0x7
#define ITEM_NESTBALL 0x8
#define ITEM_REPEATBALL 0x9
#define ITEM_TIMERBALL 0xA
#define ITEM_LUXURYBALL 0xB
#define ITEM_PREMIERBALL 0xC
How to insert:
Compile and insert the following routine into freespace:
Spoiler:
Code:.text .align 2 .thumb .thumb_func main: ldr r0, .Ball ldrb r0, [r0] cmp r0, #0x1 @masterball beq capture mov r0, #0x0 mov r1, #0x5 ldr r3, =(0x800E194 +1) bl linker ldr r0, =(0x802D4A0 +1) bx r0 capture: ldr r0, =(0x802D4B4 +1) bx r0 linker: bx r3 .align 2 .Ball: .word 0x2023D68
Here is a compiled version:
Code:06 48 00 78 01 28 06 D0 00 20 05 21 04 4B 00 F0 04 F8 04 48 00 47 04 48 00 47 18 47 68 3D 02 02 95 E1 00 08 A1 D4 02 08 B5 D4 02 08
Now navigate to 0x2D498 and insert the following:
Where XX XX XX is the reverse hex pointer +1 of where you inserted the routine.Code:00 48 00 47 XX XX XX 08
Usage:
No usage! It's all done with the power of ASMAGIX!
Hey in my team rocket hack of fire red I want Jessie and James to be main characters and I don't wanna be able to pick a name o just want Jessie to be default name if u pick Jessie and James to be default name if u play as James. If u could help with this that'd be greatly appreciated thanks
Alright, I'll give it a try.The reason why Im active here is because your thread, and since I have Compiler now, Ill be able to test all your routines, and about the one who posted the routine for when the player losses to battle, the game restarts, I really like it!
Trainers Pokemon-Players Pokemon
A routine for a Trainers pokemon party is same in your Pokemon Party including the level.
Yeah, it's quite useful once you learn.you sir, rock my sox off... I really should learn ASM...
Intro skipping is already done by Knizz in the quick Research and development thread.Hey in my team rocket hack of fire red I want Jessie and James to be main characters and I don't wanna be able to pick a name o just want Jessie to be default name if u pick Jessie and James to be default name if u play as James. If u could help with this that'd be greatly appreciated thanks
.text
.align 2
.thumb
.thumb_func
main:
ldr r7, .VAR
ldrb r7, [r7]
cmp r7, #0x1
bne noCrash
ldr r4, =0x300500C @data
ldr r2, [r4]
mov r1, #0x7
ldr r0, =(0x202402C) @src
mov r6, r0
ldr r3, =(0x804037C +1) @set non-BadEggness
bl linker
ldr r2, [r4]
add r2, r2, #0x8
mov r0, r6
mov r1, #0x31
ldr r3, =(0x804037C +1)
bl linker
ldr r2, [r4]
add r2, r2, #0xA
mov r0, r6
mov r1, #0x1
ldr r3, =(0x804037C +1)
bl linker
toStorage:
ldr r1, =(0x203C000)
ldrb r0, [r0]
mov r2, #0x50
mul r0, r0, r2
add r0, r0, r1
add r0, r0, #0x1 @destination
ldr r0, =(0x202402C) @src
mov r2, #0x50 @size
ldr r3, =(0x8040B08 +1) @func
bl linker
ldr r0, =(0x202402C)
mov r1, #0xB
ldr r3, =(0x803FBE8 +1) @get species
bl linker
mov r6, r0
toDex:
ldr r3, =(0x8043298 +1) @add to dex
bl linker
mov r0, r6
mov r1, #0x2
ldr r3, =(0x8088E74 +1)
bl linker
mov r0, r6
mov r1, #0x3
ldr r3, =(0x8088E74 +1)
bl linker
ldr r3, =(0x802D920 +1)
bx r3
nickname: @commented out because untested, and likely to crash.
@bl PartySwap
@ldr r0, =(0x80370C0)
@ldr r1, =(0x2024029)
@ldrb r1, [r1]
@strb r1, [r0]
@ldr r3, = (0x80CC088 +1)
@bl linker
@@need someway to wait until this is executed
@@before executing the next line
@bl PartySwap
@ldr r3, =(0x802D920 +1)
@bx r3
noCrash:
mov r7, #0x64
mul r0, r0, r7
ldr r1, =(0x202402C)
mov r8, r1
add r0, r8
ldr r3, =(0x802D824 +1)
linker:
bx r3
.align 2
.VAR:
.word 0x20370D8 @var 0x8011
20 4F 3F 78 01 2F 35 D1 1F 4C 22 68 07 21 1F 48 06 1C 1F 4B 00 F0 34 F8 22 68 08 32 30 1C 31 21 1B 4B 00 F0 2D F8 22 68 0A 32 30 1C 01 21 18 4B 00 F0 26 F8 17 49 00 78 50 22 50 43 40 18 01 30 12 48 50 22 14 4B 00 F0 1B F8 10 48 0B 21 13 4B 00 F0 16 F8 06 1C 12 4B 00 F0 12 F8 30 1C 02 21 10 4B 00 F0 0D F8 30 1C 03 21 0E 4B 00 F0 08 F8 0D 4B 18 47 64 27 78 43 04 49 88 46 40 44 0B 4B 18 47 C0 46 D8 70 03 02 0C 50 00 03 2C 40 02 02 7D 03 04 08 00 C0 03 02 09 0B 04 08 E9 FB 03 08 99 32 04 08 75 8E 08 08 21 D9 02 08 25 D8 02 08
01 48 00 47 00 00 XX XX XX 08
Alright, I'll give it a try.
Intro skipping is already done by Knizz in the quick Research and development thread.
As for naming, I'll look into setting default names.
My intro text editor edits the default names...
.text
.align 2
.thumb
.thumb_func
main:
push {r0-r2, lr}
ldr r0, .Name
ldr r0, [r0]
add r1, r0, #0x1
ldrb r1, [r1]
cmp r1, #0x1 @girl
beq Girl
ldr r1, .CustomNameBoy
ldr r2, [r1]
add r1, r1, #0x4
ldr r1, [r1]
str r2, [r0]
add r0, r0, #0x4
str r1, [r0]
pop {r0-r2, pc}
Girl:
ldr r1, .CustomNameGirl
ldr r2, [r1]
add r1, r1, #0x4
ldr r1, [r1]
str r2, [r0]
add r0, r0, #0x4
str r1, [r0]
pop {r0-r2, pc}
.align 2
.Name:
.word 0x300500C
.CustomNameBoy:
.word 0x@pointer to boy name
.CustomNameGirl:
.word 0x@pointer to girl name
.CustomNameBoy:
.word 0x@pointer to boy name
.CustomNameGirl:
.word 0x@pointer to girl name
Alright. I took a look and it seems EXP is stored in a substructure that moves depending on poke's personality, which is extremely annoying. However, it is possible to easily calculate medium growth rate exp, which is just the level cubed, and should suffice for most purposes.
I haven't finished a script yet, don't know when I'll get to it, but it seems quite doable (at least with the hacked engine, which has division and multiplication math specials) and here's the bulk of it (I haven't tested/debugged yet, obvs) which does basically everything but the levels grab/check part that could be easily added. I will finish later, I think, but for anyone who wants to implement themselves this will get you started and does most of the hard work.
It does remind me, though; I haven't looked yet FBI Agent to see if you gave the answer to this earlier, but you can check the levels/stats of the stored team as well as the party right? That's all that's needed to finish the script. (well, besides the obligatory flavor text, like 'Ready to take out the Team for a mission?' or something silly.)
edit: actually, just had a thought; I don't need to be able to get the stored pokemons level, since I could just temporarily put them in the party and check their levels, and then put them back in storage, but that seems very silly!
Set Stored Team Exp Closer to Party Team Levels Script //not plug and chuggable yet
Spoiler:
Code:@grablevels 'grab level stuff here, put in 8000 and 8006 @compare compare 0x8000 0x8006 if 0x4 goto @stop ' if bigger, stop, do not do this operation 'Script for using given levels to get EXP, assumes one level bigger than other subvar 0x8006 0x8000 'substract levels, 8000 should be the smaller one, that of the stored party, if I remember right. Writebytetooffset 0x50 0x0203f4d8 Writebytetooffset 0x60 0x0203f4d9 Writebytetooffset 0x06 0x0203f4da Writebytetooffset 0x80 0x0203f4db 'vars 6050, first var and 8006 the second var, specials copy to first var copyvar 0x6050 0x8006 'make the two the same, copy 8006 onto 6050 if I remember my order right special 0x40 'multiply vars special in hacked engine special 0x40 special 0x40 'three times will cube it. setvar 0x8006 0xFF special 0x41 'divide variables in JPAN hacked engine 'your script for setting the given exp setvar LASTRESULT 0x6050 ' value is multiplied by 0xFF in calculation, which is why I divided earlier copybyte 0x203BFFE 0x20370D0 copybyte 0x203BFFF 0x20370D1 callasm 0x[Exp setting routine] 'domorestuff here, give the pokemon back or whatevers, end
Alright, I'll give it a try.
Yeah, it's quite useful once you learn.
Intro skipping is already done by Knizz in the quick Research and development thread.
As for naming, I'll look into setting default names.
PSS addon: Captured Pokemon to storage
Basically, it puts a Pokemon you capture into storage as you capture it. I should remind you that the code here isn't 100% complete. There's still a few details including nicknaming, which I haven't quite done yet. This code simply takes a Pokemon you've captured, intercepts it before it goes into the party/PC storage, and puts it right into your storage.
How to insert:
Compile and insert the following code into free space:
Spoiler:
Code:.text .align 2 .thumb .thumb_func main: ldr r7, .VAR ldrb r7, [r7] cmp r7, #0x1 bne noCrash ldr r4, =0x300500C @data ldr r2, [r4] mov r1, #0x7 ldr r0, =(0x202402C) @src mov r6, r0 ldr r3, =(0x804037C +1) @set non-BadEggness bl linker ldr r2, [r4] add r2, r2, #0x8 mov r0, r6 mov r1, #0x31 ldr r3, =(0x804037C +1) bl linker ldr r2, [r4] add r2, r2, #0xA mov r0, r6 mov r1, #0x1 ldr r3, =(0x804037C +1) bl linker toStorage: ldr r1, =(0x203C000) ldrb r0, [r0] mov r2, #0x50 mul r0, r0, r2 add r0, r0, r1 add r0, r0, #0x1 @destination ldr r0, =(0x202402C) @src mov r2, #0x50 @size ldr r3, =(0x8040B08 +1) @func bl linker ldr r0, =(0x202402C) mov r1, #0xB ldr r3, =(0x803FBE8 +1) @get species bl linker mov r6, r0 toDex: ldr r3, =(0x8043298 +1) @add to dex bl linker mov r0, r6 mov r1, #0x2 ldr r3, =(0x8088E74 +1) bl linker mov r0, r6 mov r1, #0x3 ldr r3, =(0x8088E74 +1) bl linker ldr r3, =(0x802D920 +1) bx r3 nickname: @commented out because untested, and likely to crash. @bl PartySwap @ldr r0, =(0x80370C0) @ldr r1, =(0x2024029) @ldrb r1, [r1] @strb r1, [r0] @ldr r3, = (0x80CC088 +1) @bl linker @@need someway to wait until this is executed @@before executing the next line @bl PartySwap @ldr r3, =(0x802D920 +1) @bx r3 noCrash: mov r7, #0x64 mul r0, r0, r7 ldr r1, =(0x202402C) mov r8, r1 add r0, r8 ldr r3, =(0x802D824 +1) linker: bx r3 .align 2 .VAR: .word 0x20370D8 @var 0x8011
Here's a compiled version:
Code:20 4F 3F 78 01 2F 35 D1 1F 4C 22 68 07 21 1F 48 06 1C 1F 4B 00 F0 34 F8 22 68 08 32 30 1C 31 21 1B 4B 00 F0 2D F8 22 68 0A 32 30 1C 01 21 18 4B 00 F0 26 F8 17 49 00 78 50 22 50 43 40 18 01 30 12 48 50 22 14 4B 00 F0 1B F8 10 48 0B 21 13 4B 00 F0 16 F8 06 1C 12 4B 00 F0 12 F8 30 1C 02 21 10 4B 00 F0 0D F8 30 1C 03 21 0E 4B 00 F0 08 F8 0D 4B 18 47 64 27 78 43 04 49 88 46 40 44 0B 4B 18 47 C0 46 D8 70 03 02 0C 50 00 03 2C 40 02 02 7D 03 04 08 00 C0 03 02 09 0B 04 08 E9 FB 03 08 99 32 04 08 75 8E 08 08 21 D9 02 08 25 D8 02 08
Now navigate to 0x2D81A and insert the following:
Where XX XX XX is the reverse hex pointer to where you've inserted the routine.Code:01 48 00 47 00 00 XX XX XX 08
Usage:
setvar 0x8011 0x1 = toggle this routine
The rest is handled via magical ponies.
I think he wants to set a default name while skipping the intro. If you skip the intro via ASM, the default name is left as 0s aka blank.
checkgender
compare LASTRESULT 0x0
if == jump @boyname
compare LASTRESULT 0x1
if == jump @girlname
end
#org @boyname
'-----------------------------------
virtualbuffer 0x1 @stringboy
end
#org @girlname
'-----------------------------------
virtualbuffer 0x1 @stringgirl
end
#org @stringboy
= JAMES
#org @stringgirl
= JESSE
I just did it for FR. :PAutomatic name setting? I think Touched did that, but for EM.
The trainer card, start menu, and a lot of "behind the scenes" generated scripts are going to use blank as your name regardless of any script you may try.skipping the intro via ASM still lets you set the buffer \v\h01 (players name) with a script
Code:checkgender compare LASTRESULT 0x0 if == jump @boyname compare LASTRESULT 0x1 if == jump @girlname end #org @boyname '----------------------------------- virtualbuffer 0x1 @stringboy end #org @girlname '----------------------------------- virtualbuffer 0x1 @stringgirl end #org @stringboy = JAMES #org @stringgirl = JESSE
something like that should work to set the name of the player if you skipped the intro... (PKSV)
The trainer card, start menu, and a lot of "behind the scenes" generated scripts are going to use blank as your name regardless of any script you may try.
All praise the god and savior ASM.