The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Code ASM Resource Thread (https://www.pokecommunity.com/showthread.php?t=339153)

Blah March 28th, 2015 7:35 PM

Quote:

Originally Posted by leyn09 (Post 8678550)
I have a little problem with this sleep clause. As the post requires, I need to put battle by turn routine, the table pointer, and the sleep clause routine in my rom. So I put these in the following addresses:

1. Battle by turn routine: 850000
2. BbT table: 850040 (I already put at the first entry the sleep clause routine)
3. Sleep clause routine: 800050


Then I insert 00 48 00 47 41 00 85 08 to 0x13cb0


So, I'm about to test it but I'm not able to because whenever I battle a trainer/wild encountered pokemon, it freezes or restarts after the first round. Also, there are some cases of resetting when I encounter wild pokemon.

I direly in need of these sleeping clause. Btw, I used MrDollSteak Rom base and JPAN's fire red Hacked Engine.

Thanks in advance!

I think you forgot the 08 prefix in the BBT table when compiling the BBT routine.

robinjea March 28th, 2015 8:29 PM

Quote:

Originally Posted by FBI agent (Post 8678699)
I've fixed it. My brain went IDA mode when I wrote that, so accidentally did lsls instead of lsl, ect. :P

Alright, now I don't know what I've done wrong. I just compiled your newly changed routine and for somewhat reason, the game freezes on my player's first step.

These are what I did.

Spoiler:
First I compiled this exact routine at 0x71ACC0.

Code:

.text
.align 2
.thumb
.thumb_func

main:
    push {r0-r7}
    ldr r0, =(0x2024284)
    mov r6, #0x0
    ldr r7, =(0x2024029)
    ldrb r7, [r7]

loop:
    cmp r6, r7
    beq end
    mov r1, #0x64
    mul r1, r1, r6
    add r0, r0, r1
    mov r5, r0
    mov r1, #0x39
    ldr r3, =(0x803FBE8 +1)
    bl linker
    mov r4, r0
    cmp r4, #0x0
    beq next
    mov r0, r5
    mov r1, #0x3A
    ldr r3, =(0x803FBE8 +1)
    bl linker
    add r6, r6, #0x1
    cmp r4, r0
    beq loop

addOn:
    add r4, r4, #0x3
    cmp r4, r5
    ble cont
    mov r4, r5

cont:
    mov r0, r5
    mov r1, #0x39
    ldr r2, =(0x20370D0)
    strh r4, [r2]
    ldr r3, =(0x804037C)
    bl linker
    b loop

next:
    add r6, r6, #0x1
    b loop

end:
    pop {r0-r7}
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #0x1
    beq brancher
    mov r0, r5
    ldr r1, =(0x806D600 +1)
    bx r1

brancher:
    ldr r0, =(0x806D650 +1)
    bx r0

linker:
    bx r3

.align 2


Then I changed the bytes at 0x6D5F6 to the following.

Code:

01 4A 10 47 00 00 C1 AC 71 08


But then again, it still freezes on my player's first step.


And also, me too, I'm having problems with the BBT and HP Regen Addon for it.

Spoiler:
I compiled this exact routine at 0x800000.

Code:

.text
.align 2
.thumb
.thumb_func

main:
        mov r0, #0xBE
        lsl r0, r0, #0x2
        ldr r2, =(0x806E6D0 +1)
        bl linker
        cmp r0, #0x0
        beq skip
        ldr r4, .table

loop:
        ldr r2, [r4]
        cmp r2, #0x00
        beq skip
        bl linker
        add r4, #0x4
        b loop

skip:
        ldr r1, = 0x3004F90
        ldrb r0, [r1, #0x13]
        cmp r0, #0xFE
        bhi replacer
        add r0, #0x1
        strb r0, [r1, #0x13]

replacer:
        ldr r2, = (0x8013CBC + 1)

linker:
        bx r2

.align 2

.table:
        .word 0x0871B000


I removed all the @'s because I believe it was comments? Am I right?

Then my table at 0x71B000 contained:

Code:

01 00 81 08 00 00 00 00


Because this exact routine (HP Regen Addon) was compiled at 0x810000.

Code:

.text
.align 2
.thumb
.thumb_func

main:
    push {r0-r7, lr}
    ldr r0, =(0x3004FA3)
    ldrb r0, [r0]
    mov r1, #0x2
    ldr r3, =(0x81E4684 +1)
    bl linker
    cmp r0, #0x0
    beq end
    ldr r0, =(0x2024284)
    mov r6, #0x0
    ldr r7, =(0x2024029)
    ldrb r7, [r7]

loop:
    cmp r6, r7
    beq end
    mov r1, #0x64
    mul r1, r1, r6
    add r0, r0, r1
    mov r5, r0
    mov r1, #0x39
    ldr r3, =(0x803FBE8 +1)
    bl linker
    mov r4, r0
    cmp r4, #0x0
    beq next
    mov r0, r5
    mov r1, #0x3A
    ldr r3, =(0x803FBE8 +1)
    bl linker
    add r6, r6, #0x1
    cmp r4, r0
    beq loop

addOn:
    add r4, r4, #0x5
    cmp r4, r5
    ble cont
    mov r4, r5

cont:
    mov r0, r5
    mov r1, #0x39
    ldr r2, =(0x20370D0)
    strh r4, [r2]
    ldr r3, =(0x804037C)
    bl linker
    b loop

next:
    add r6, r6, #0x1
    b loop

end:
    pop {r0-r7, pc}

linker:
    bx r3

.align 2


And then, I created an NPC that sets the flag 0x2F8. And when I go to battle, boom! Freezes after the first round.

Blah March 28th, 2015 8:57 PM

Quote:

Originally Posted by robin22gongon (Post 8678765)
Alright, now I don't know what I've done wrong. I just compiled your newly changed routine and for somewhat reason, the game freezes on my player's first step.

These are what I did.

Spoiler:
First I compiled this exact routine at 0x71ACC0.

Code:

.text
.align 2
.thumb
.thumb_func

main:
    push {r0-r7}
    ldr r0, =(0x2024284)
    mov r6, #0x0
    ldr r7, =(0x2024029)
    ldrb r7, [r7]

loop:
    cmp r6, r7
    beq end
    mov r1, #0x64
    mul r1, r1, r6
    add r0, r0, r1
    mov r5, r0
    mov r1, #0x39
    ldr r3, =(0x803FBE8 +1)
    bl linker
    mov r4, r0
    cmp r4, #0x0
    beq next
    mov r0, r5
    mov r1, #0x3A
    ldr r3, =(0x803FBE8 +1)
    bl linker
    add r6, r6, #0x1
    cmp r4, r0
    beq loop

addOn:
    add r4, r4, #0x3
    cmp r4, r5
    ble cont
    mov r4, r5

cont:
    mov r0, r5
    mov r1, #0x39
    ldr r2, =(0x20370D0)
    strh r4, [r2]
    ldr r3, =(0x804037C)
    bl linker
    b loop

next:
    add r6, r6, #0x1
    b loop

end:
    pop {r0-r7}
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    cmp r0, #0x1
    beq brancher
    mov r0, r5
    ldr r1, =(0x806D600 +1)
    bx r1

brancher:
    ldr r0, =(0x806D650 +1)
    bx r0

linker:
    bx r3

.align 2


Then I changed the bytes at 0x6D5F6 to the following.

Code:

01 4A 10 47 00 00 C1 AC 71 08


But then again, it still freezes on my player's first step.


And also, me too, I'm having problems with the BBT and HP Regen Addon for it.

Spoiler:
I compiled this exact routine at 0x800000.

Code:

.text
.align 2
.thumb
.thumb_func

main:
        mov r0, #0xBE
        lsl r0, r0, #0x2
        ldr r2, =(0x806E6D0 +1)
        bl linker
        cmp r0, #0x0
        beq skip
        ldr r4, .table

loop:
        ldr r2, [r4]
        cmp r2, #0x00
        beq skip
        bl linker
        add r4, #0x4
        b loop

skip:
        ldr r1, = 0x3004F90
        ldrb r0, [r1, #0x13]
        cmp r0, #0xFE
        bhi replacer
        add r0, #0x1
        strb r0, [r1, #0x13]

replacer:
        ldr r2, = (0x8013CBC + 1)

linker:
        bx r2

.align 2

.table:
        .word 0x0871B000


I removed all the @'s because I believe it was comments? Am I right?

Then my table at 0x71B000 contained:

Code:

01 00 81 08 00 00 00 00


Because this exact routine (HP Regen Addon) was compiled at 0x810000.

Code:

.text
.align 2
.thumb
.thumb_func

main:
    push {r0-r7, lr}
    ldr r0, =(0x3004FA3)
    ldrb r0, [r0]
    mov r1, #0x2
    ldr r3, =(0x81E4684 +1)
    bl linker
    cmp r0, #0x0
    beq end
    ldr r0, =(0x2024284)
    mov r6, #0x0
    ldr r7, =(0x2024029)
    ldrb r7, [r7]

loop:
    cmp r6, r7
    beq end
    mov r1, #0x64
    mul r1, r1, r6
    add r0, r0, r1
    mov r5, r0
    mov r1, #0x39
    ldr r3, =(0x803FBE8 +1)
    bl linker
    mov r4, r0
    cmp r4, #0x0
    beq next
    mov r0, r5
    mov r1, #0x3A
    ldr r3, =(0x803FBE8 +1)
    bl linker
    add r6, r6, #0x1
    cmp r4, r0
    beq loop

addOn:
    add r4, r4, #0x5
    cmp r4, r5
    ble cont
    mov r4, r5

cont:
    mov r0, r5
    mov r1, #0x39
    ldr r2, =(0x20370D0)
    strh r4, [r2]
    ldr r3, =(0x804037C)
    bl linker
    b loop

next:
    add r6, r6, #0x1
    b loop

end:
    pop {r0-r7, pc}

linker:
    bx r3

.align 2


And then, I created an NPC that sets the flag 0x2F8. And when I go to battle, boom! Freezes after the first round.

I made a small edit to the original step based HP thing. Try it again. As for the battle by turn thing, there could be a lot of reasons. I can't check without first looking at your ROM. Anyways, I'm going to go take another look at the battle by turn routine (even though it was working for me) it seems I may have broken it during transfer. I'll look at it and get back to you.

robinjea March 28th, 2015 9:26 PM

Quote:

Originally Posted by FBI agent (Post 8678787)
I made a small edit to the original step based HP thing. Try it again. As for the battle by turn thing, there could be a lot of reasons. I can't check without first looking at your ROM. Anyways, I'm going to go take another look at the battle by turn routine (even though it was working for me) it seems I may have broken it during transfer. I'll look at it and get back to you.

Did it, still to no avail. It freezes on the first step I take whenever I have a Pokemon with damaged HP. Also, I'm not sure if this helps in any way, but my compiler actually says this everytime I compile your HP Regen per Step, BBT and BBT Addon HP Regen routines:

Code:

Warning: end of the file not at end of the line; newline inserted


P.S. Sorry for the trouble you're going through because of me and thank you for your hard work. :)

GoGoJJTech March 28th, 2015 9:33 PM

Quote:

Originally Posted by robin22gongon (Post 8678815)
Did it, still to no avail. It freezes on the first step I take whenever I have a Pokemon with damaged HP. Also, I'm not sure if this helps in any way, but my compiler actually says this everytime I compile your HP Regen per Step, BBT and BBT Addon HP Regen routines:

Code:

Warning: end of the file not at end of the line; newline inserted


P.S. Sorry for the trouble you're going through because of me and thank you for your hard work. :)

That warning just means there's no empty line at the end of the file. It doesn't stop compilation or anything, it's just something it looks for that you missed.

Z-nogyroP March 29th, 2015 5:43 AM

Alright, hopefully it's okay if I make a request here for FireRed? I'm not sure if this would be considered ASM, but would there be a way to change attacks as you gain more badges? I'm mostly thinking of making HMs more useful here, or making them less useful at first but better later for hacks where you need Surf early on or something. Basically what I'm asking is, would there be a way to change attacks the more badges you have?

For example, let's take Rock Smash. If you have zero to two badges, it's standard- 40 power, 50% chance of lowering defense. If you have three to six badges, however, it becomes 70 power with a 30% chance to lower defense. From seven to eight badges, it's 90 power with a 10% chance of lowering defense. Would there be a way to do this?

Adnihil March 30th, 2015 12:23 AM

Hey, let me start this post by saying thanks! Awesome thread! I already found a bunch of things I will be adding to my game!

I am trying to make a game that revolves around the starter pokémon. I was gonna do it with an Emerald ROM but there seems to be a lot more support for Fire Red so I guess I'll do it with Fire Red instead! There are some features I'd like to put in the game but I have no idea how to do it, so I am hereby humbly requesting help.

The two most important ones are that the starter pokémon should not be able to be stored in the PC or daycare, and as soon as it loses all of its HP the battle should be lost.
Are these two things possible to do?
Then it'd also be cool if the starter pokémon was forced to always be the first to enter battle, as if it's always the first in the party.
And if switching pokémon would be affected by the pokémons speed stat (so a pokémon can be attacked before it has the chance to switch out).

And then there's also some other things I'd like to put in my game but I'll start by asking for just these :p Don't want to seem too demanding. And by the time I'm done experimenting with routines I might have learned how to do it myself (since they're kind of related to the ones I just requested).

Thanks in advance!

MrDollSteak March 30th, 2015 1:27 AM

Quote:

Originally Posted by Z-nogyroP (Post 8679337)
Alright, hopefully it's okay if I make a request here for FireRed? I'm not sure if this would be considered ASM, but would there be a way to change attacks as you gain more badges? I'm mostly thinking of making HMs more useful here, or making them less useful at first but better later for hacks where you need Surf early on or something. Basically what I'm asking is, would there be a way to change attacks the more badges you have?

For example, let's take Rock Smash. If you have zero to two badges, it's standard- 40 power, 50% chance of lowering defense. If you have three to six badges, however, it becomes 70 power with a 30% chance to lower defense. From seven to eight badges, it's 90 power with a 10% chance of lowering defense. Would there be a way to do this?

There is definitely away to change the base power and effect accuracy in the battles themselves. You just need to add checks in the damage and effect roll routines, for the move, followed by a simple flag check.

That being said, getting these changes to be reflected in the move descriptions would be more difficult.

Mana March 30th, 2015 1:52 AM

Quote:

Originally Posted by Z-nogyroP (Post 8679337)
Alright, hopefully it's okay if I make a request here for FireRed? I'm not sure if this would be considered ASM, but would there be a way to change attacks as you gain more badges? I'm mostly thinking of making HMs more useful here, or making them less useful at first but better later for hacks where you need Surf early on or something. Basically what I'm asking is, would there be a way to change attacks the more badges you have?

For example, let's take Rock Smash. If you have zero to two badges, it's standard- 40 power, 50% chance of lowering defense. If you have three to six badges, however, it becomes 70 power with a 30% chance to lower defense. From seven to eight badges, it's 90 power with a 10% chance of lowering defense. Would there be a way to do this?

If you had a stalk of my VM conversation with FBI you can pick out the bits of advice he gave me. I was trying to increase the power of Cut depending on the number of badges you had.

I got it working in battle, but couldn't get the descriptions to update (and MrDollSteak mentioned). I don't actually know which routine I used in the end ;-; I got frustrated and threw them all in one folder with pretty lackluster names :P.

Christos March 30th, 2015 1:57 AM

Quote:

Originally Posted by Magic (Post 8680872)
If you had a stalk of my VM conversation with FBI you can pick out the bits of advice he gave me. I was trying to increase the power of Cut depending on the number of badges you had.

I got it working in battle, but couldn't get the descriptions to update (and MrDollSteak mentioned). I don't actually know which routine I used in the end ;-; I got frustrated and threw them all in one folder with pretty lackluster names :P.

You could have the power be "--" and the description include "power depends on number of badges" or something.

Blah March 30th, 2015 8:08 AM

Quote:

Originally Posted by robin22gongon (Post 8678815)
Did it, still to no avail. It freezes on the first step I take whenever I have a Pokemon with damaged HP. Also, I'm not sure if this helps in any way, but my compiler actually says this everytime I compile your HP Regen per Step, BBT and BBT Addon HP Regen routines:

Code:

Warning: end of the file not at end of the line; newline inserted


P.S. Sorry for the trouble you're going through because of me and thank you for your hard work. :)

At this point I'm not sure if it's the routine or a mistake on your part. I'll have to debug the whole thing soon, normally a test these things to make sure it's right. These days I've been getting quite cocky with myself and just posting them after a first attempt. I apologize about that!

@the guy who was wondering about BBT: I'll look at it soon too

Quote:

Originally Posted by Z-nogyroP (Post 8679337)
Alright, hopefully it's okay if I make a request here for FireRed? I'm not sure if this would be considered ASM, but would there be a way to change attacks as you gain more badges? I'm mostly thinking of making HMs more useful here, or making them less useful at first but better later for hacks where you need Surf early on or something. Basically what I'm asking is, would there be a way to change attacks the more badges you have?

For example, let's take Rock Smash. If you have zero to two badges, it's standard- 40 power, 50% chance of lowering defense. If you have three to six badges, however, it becomes 70 power with a 30% chance to lower defense. From seven to eight badges, it's 90 power with a 10% chance of lowering defense. Would there be a way to do this?

The implementations would be kind of specific for each hack (in terms of what powers and such). Actually making it happen is a pretty simple hook. You should be able to do this after reading my ASM tutorial and upto 5/10-ish.

I could post the routine, but it wouldn't be very scalable unless I complicated it.

Quote:

Originally Posted by Adnihil (Post 8680733)
Hey, let me start this post by saying thanks! Awesome thread! I already found a bunch of things I will be adding to my game!

I am trying to make a game that revolves around the starter pokémon. I was gonna do it with an Emerald ROM but there seems to be a lot more support for Fire Red so I guess I'll do it with Fire Red instead! There are some features I'd like to put in the game but I have no idea how to do it, so I am hereby humbly requesting help.

The two most important ones are that the starter pokémon should not be able to be stored in the PC or daycare, and as soon as it loses all of its HP the battle should be lost.
Are these two things possible to do?
Then it'd also be cool if the starter pokémon was forced to always be the first to enter battle, as if it's always the first in the party.
And if switching pokémon would be affected by the pokémons speed stat (so a pokémon can be attacked before it has the chance to switch out).

And then there's also some other things I'd like to put in my game but I'll start by asking for just these :p Don't want to seem too demanding. And by the time I'm done experimenting with routines I might have learned how to do it myself (since they're kind of related to the ones I just requested).

Thanks in advance!

I've already done your first request, it's somewhere in this thread. I haven't been updating the first post because I've been putting it off :P

Unfortunately, I don't really like doing battle routines :/
The switching after being attacked may actually be a little hard, but if you ask someone who's worked on moves like baton pass, maybe they can help.


Quote:

Originally Posted by MrDollSteak (Post 8680846)
There is definitely away to change the base power and effect accuracy in the battles themselves. You just need to add checks in the damage and effect roll routines, for the move, followed by a simple flag check.

That being said, getting these changes to be reflected in the move descriptions would be more difficult.

It's the same difficulty to set the move descriptions number shown :c
The text for the damage number is still derived from the table in each instance, so if you hook after that derivation, you can adjust it in either case.

Quote:

Originally Posted by Magic (Post 8680872)
If you had a stalk of my VM conversation with FBI you can pick out the bits of advice he gave me. I was trying to increase the power of Cut depending on the number of badges you had.

I got it working in battle, but couldn't get the descriptions to update (and MrDollSteak mentioned). I don't actually know which routine I used in the end ;-; I got frustrated and threw them all in one folder with pretty lackluster names :P.

Maybe after the workshops you can!

Quote:

Originally Posted by Christos (Post 8680878)
You could have the power be "--" and the description include "power depends on number of badges" or something.

maybe if ur hack sux

jToTheAvacola March 30th, 2015 4:49 PM

Quote:

Originally Posted by FBI agent (Post 8509596)
About that, I feel very bad shutting down all of your suggestions, but that seems like a lot of work for a feature that's not even that great. There's already a large amount of space in the PC, and I'm sure to expand it will take hours and hours of work :/

Capturing Opponent's Pokemon:


So I was working on making trainer's Pokemon capture-able, and it does this check to see if the Pokemon is capturable, and if it was it'd check to see if it's a trainer's Pokemon. Well, I disabled the check and was successful in capturing a Pokemon that didn't belong to me :P

Sadly, the Pokemon turned into a bad egg the moment I caught it. The only solution to this was to edit the checksum so it'd make sense again, however that would be a lot of work, and honestly the checksum is calculated relatively frequently. So upon investigation (mostly by Shinyquagsire, thanks for the deduction detective!) we were able to determine the egg was turning bad because the checksum was no longer valid with the player's trainer ID. So, after diving through the code a bit I found the part of the code that overwrote the trainer ID with the player ID. Then it was a matter of disabling it!

To insert:
insert the following bytes at the following offsets:
0x2D496: E0 E0
0x40B36: 00 00 00 00 00

To fix the Pokedex bug
Follow the instructions in this link: http://www.pokecommunity.com/showpost.php?p=8536920&postcount=333

Here's Brock's Onix :3

http://i.imgur.com/9Q92xd9.png?1

So there's no on/off switch for this routine? I want to mimic the pokemon coliseum feature of being able to catch trainer's shadow pokemon. If I can't make it specific to just the shadow pokemon that's fine, but I'd at least need to be able to only make trainer's pokemon catchable during the battles with trainers who have shadow pokemon.

MrDollSteak March 30th, 2015 8:36 PM

Quote:

Originally Posted by jToTheAvacola (Post 8682020)
So there's no on/off switch for this routine? I want to mimic the pokemon coliseum feature of being able to catch trainer's shadow pokemon. If I can't make it specific to just the shadow pokemon that's fine, but I'd at least need to be able to only make trainer's pokemon catchable during the battles with trainers who have shadow pokemon.

Heaps of ways to go about this, just think creatively. FBI's put up a snag ball routine, all you need to do is make the ball only activate on shadow pokemon. That can be done with comparing index numbers through a table etc.

leyn09 March 31st, 2015 5:21 AM

Quote:

Originally Posted by FBI agent (Post 8678704)
I think you forgot the 08 prefix in the BBT table when compiling the BBT routine.

Thanks! I've made it work but it seems to end the battle in the player's favor after putting two of the opp. pokemon to sleep? Was the code is purposed to behave that way?

Blah March 31st, 2015 6:55 AM

Quote:

Originally Posted by leyn09 (Post 8682789)
Thanks! I've made it work but it seems to end the battle in the player's favor after putting two of the opp. pokemon to sleep? Was the code is purposed to behave that way?

I had to end it in the player's favor, or it would result in a whiteout. What you can do is read the byte at 02023E8A and if it's 0x1 then the player won by fair means, else they lost/sleepclause happened.

PurpleOrange March 31st, 2015 9:41 AM

i'm not 100% sure if this requires asm, but is there a way to temporarily change what pokemon appear in the wild? i'm thinking something like Mr. Backlot and the trophy garden from Diamond/Pearl/Platinum

jToTheAvacola March 31st, 2015 11:26 AM

Quote:

Originally Posted by MrDollSteak (Post 8682322)
Heaps of ways to go about this, just think creatively. FBI's put up a snag ball routine, all you need to do is make the ball only activate on shadow pokemon. That can be done with comparing index numbers through a table etc.

Thanks for the suggestion. I'll probably do this. I just didn't necessarily feel like having to make it a new ball because it wasn't that way in Colosseum and I'd have to think up a way for the player to get them that makes sense. It should be fine though.

Quote:

Originally Posted by PurpleOrange (Post 8683164)
i'm not 100% sure if this requires asm, but is there a way to temporarily change what pokemon appear in the wild? i'm thinking something like Mr. Backlot and the trophy garden from Diamond/Pearl/Platinum

You can use FBI's Swarm routine for that: http://www.pokecommunity.com/showpost.php?p=8535820&postcount=314

robinjea March 31st, 2015 7:31 PM

@FBI Agent - Thanks really. Hope you finish it soon. :)

Oh and a few questions.

1. Does the PSS Addon: Experience Gains have an on/off switch?
2. (Even though it's not yet fixed, I believe) Does the BBT Addon: HP-Regen also regenerate the opponent's HP? Because it's kinda unfair if it doesn't. :)
3. And lastly, I don't know if this involves ASM (if not, ignore it) but can we make it so that Trainers' Pokemon get levels according to the average level of your party (yes, as if it works with the Average Party Level routine)?

Thanks! ^_^

PurpleOrange April 1st, 2015 5:04 AM

Quote:

Originally Posted by jTaThaAvacola (Post 8683345)

i probably should have mentioned that this is for emerald, so it won't work

Adnihil April 2nd, 2015 3:52 AM

Quote:

Originally Posted by FBI agent (Post 8681287)
I've already done your first request, it's somewhere in this thread. I haven't been updating the first post because I've been putting it off :P

Oh, cool! Well, thanks :p

Edit: Hey, I scanned the thread but couldn't seem to find it. Do you remember what you called it or a sentence from your post so I can search for it in an other way?

Also, I just realized that there is a simpler way to achieve the same goal; Just remove the option to change the order of your Pokémon.
Do you think you could do this? (I assume this must be a hell of a lot easier to do since it's just removing a feature instead of adding them, but I might be completely wrong on this.)
Spoiler:
You see, this way the starter Pokémon will always be the first in the party (if it's unable to be stored in the PC or daycare it'll be impossible to switch it from place) and it will always go into battle first. Not being able to change the order of the rest of your Pokémon would be a problem for most games but not for mine, as the player will white out when the starter faints, so the order of the other Pokémon doesn't matter.

leyn09 April 4th, 2015 5:41 AM

Is there any easier way to disable the bag option during battle in Fire red? Like another asm besides bag deleter/restorer or hex editing to permanently disable it? Thanks! :D

leyn09 April 4th, 2015 6:24 PM

Quote:

Originally Posted by FBI agent (Post 8520402)

Set static party level



First of all, I need to mention that this routine works off percentage increases and decreases. So if you're planning to go from level 1 to 100 all in one go for 6 Pokemon it will take around 5 seconds to increment about 35 million experience points. The reason for the percentage increase is so that we don't go over. This was a pain to test, as in some occasions the percentage between levels 1-2 would be enough to set negative exp, and sometimes the levels 99 -100 would set exp over 100...it was just a huge pain. It now works off a lookup table and is quite spiffy now :3

How to insert:

Compile and insert into free space the following routine:

Spoiler:

Code:

.text
.align 2
.thumb
.thumb_func

main:
        push {r0-r7, lr}
        mov r7, #0x0

loop:
        ldr r6, =(0x2024029)
        ldrb r6, [r6]
        cmp r7, r6
        beq end
        ldr r0, =(0x2024284)
        mov r1, #0x64
        mul r1, r1, r7
        push {r7}
        add r0, r0, [email protected]
        mov r4, r0

set_level:
        mov r1, #0xB
        push {r4}
        ldr r3, = (0x803FBE8 +1) @get species
        bl linker
        pop {r4}
        mov r2, r0
        ldr r6, =(0x8253AE4)
        ldr r1, =(0x8254784)
        lsl r0, r2, #0x3
        sub r0, r0, r2
        lsl r0, r0, #0x2
        add r1, r1, r0
        ldrb r0, [r1, #0x13]
        mov r5, #0xCA
        lsl r5, r5, #0x1
        mul r0, r0, r5
        add r0, r0, r6
        ldr r1, .VAR
        ldrb r1, [r1]
        mov r3, #0x4
        mul r1, r1, r3
        add r1, r1, r0
        ldr r1, [r1]
        ldr r2, = (0x20370D0)
        str r1, [r2]
        mov r0, r4
        push {r4}
        mov r1, #0x19
        ldr r3, =(0x804037C +1)
        bl linker
        pop {r4}
        mov r0, r4
        ldr r3, =(0x803E47C +1)
        bl linker

next:
        pop {r7}
        add r7, r7, #0x1
        b loop       

end:
        pop {r0-r7, pc}

linker:
        bx r3

.align 2

.VAR:
        .word 0x020270B8 + (0x8000 *2)


Here is a compiled version:
Code:

FF B5 00 27 1A 4E 36 78 B7 42 2D D0 19 48 64 21 79 43 80 B4 40 18 04 1C 0B 21 10 B4 16 4B 00 F0 24 F8 10 BC 02 1C 15 4E 15 49 D0 00 80 1A 80 00 09 18 C8 7C CA 25 6D 00 68 43 80 19 0B 49 09 78 04 23 59 43 09 18 09 68 0E 4A 11 60 20 1C 10 B4 19 21 0D 4B 00 F0 09 F8 10 BC 20 1C 0B 4B 00 F0 04 F8 80 BC 01 37 CD E7 FF BD 18 47 B8 70 03 02 29 40 02 02 84 42 02 02 E9 FB 03 08 E4 3A 25 08 84 47 25 08 D0 70 03 02 7D 03 04 08 7D E4 03 08




Usage:
setvar 0x8000 0x[Level you want Pokemon to be set to (in hex)]
callasm 0x[this routine +1]

That's it. I should mention, you should apply this as often as possible to speed up the computation time for next time.

I would like to ask how to revert back their original levels after setting them to a certain level? Thanks a bunch! :)

HungLikeATauros April 5th, 2015 6:13 PM

Quote:

Originally Posted by FBI agent (Post 8533235)

Roaming Pokemon!



I can't seem to get the BattleByMove compiled. I'm getting an error message saying "bad instruction 'main'"at line 6, and also one at line 47 "junk at end of line, first unrecognized character is 0"

Any idea why it would say this?

kearnseyboy6 April 10th, 2015 3:51 AM

May I request custom moves for givepokemon. I feel this would really complete the player switching routines :)

Percy April 10th, 2015 3:56 PM

Quote:

Originally Posted by kearnseyboy6 (Post 8699804)
May I request custom moves for givepokemon. I feel this would really complete the player switching routines :)

This should help you!
if it doesn't work, sorry!


All times are GMT -8. The time now is 8:46 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.