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)
-   -   Research Exploring Ruby and Emerald (https://www.pokecommunity.com/showthread.php?t=321951)

Artemis64 September 5th, 2014 7:55 PM

Please use more diplomatic language in the future. However, I agree that the type table is corrupted, but I copied the old type table over from a backup, and it works like a charm. Despite that, the battle system seems to work perfectly.
More importantly, there seems to be an error with the animation system in my game. I suspect it has something to do with the mass decapitalisation of Anti-Exploud, because it was already present before applying the Physical/Special split, Fairy-type and Pokédex Expansion. That said, I won't rule out one of those as a potential cause.
The glitch happens when Pokémon are switched out, then Peck is used. The Pokémon does not have to be specific. Then, the Pokémon that used Peck will start stretching on horizontally.
Here is a GIF (I changed the animation to that of Peck's):
http://i.imgur.com/DhFTOt8.gif
Sorry about the quality, I had to shrink it so it could be uploaded.
However, this glitch, while minor, seems to be related to another similar bug in which, if a Pokémon uses any move that includes the Pokémon sprite moving forward, the sprite expands a few times, but is cut off beyond its 64x64 size. Entering the Bag and exiting seems to clear the issue.
Can someone help me research into this? I'm not good at ASM...

Le pug September 5th, 2014 9:39 PM

Quote:

Originally Posted by Artemis64 (Post 8427547)
Please use more diplomatic language in the future. However, I agree that the type table is corrupted, but I copied the old type table over from a backup, and it works like a charm. Despite that, the battle system seems to work perfectly.
More importantly, there seems to be an error with the animation system in my game. I suspect it has something to do with the mass decapitalisation of Anti-Exploud, because it was already present before applying the Physical/Special split, Fairy-type and Pokédex Expansion. That said, I won't rule out one of those as a potential cause.
The glitch happens when Pokémon are switched out, then Peck is used. The Pokémon does not have to be specific. Then, the Pokémon that used Peck will start stretching on horizontally.
Here is a GIF (I changed the animation to that of Peck's):
http://i.imgur.com/DhFTOt8.gif
Sorry about the quality, I had to shrink it so it could be uploaded.
However, this glitch, while minor, seems to be related to another similar bug in which, if a Pokémon uses any move that includes the Pokémon sprite moving forward, the sprite expands a few times, but is cut off beyond its 64x64 size. Entering the Bag and exiting seems to clear the issue.
Can someone help me research into this? I'm not good at ASM...

Not only that ...
"I also changed the type picture sprite as well."

I applied this patch to an untouched rom and it doesn't update the type picture at all lol. This patch needs all sorts of lovin' or at least, he needs to rewrite what features are apart of it until he fixes it.

Artemis64 September 7th, 2014 12:27 AM

I think you must have used an older version. Either that, or Advance Map may have repointed a map or Tileset and overwritten a part of the patch.
Examples:
http://i.imgur.com/kegOQ9Q.png
http://i.imgur.com/aP5rl14.png
By the way, I've been working on an Emerald remake/expansion, and it seems that either there is something wrong with my Map editor, or it's an inherent bug in the game-Route 111 reverts to the original tile map after a battle or exiting a house on Route 111. Going into the PokéCenter and exiting seems to fix it.

Aruaruu September 9th, 2014 4:01 PM

Had this in my notes and forgot about it :\
At offset 0x329D48 in Emerald is Deoxys Speed forme stats in the usual HP/ATK/DEF/SPD/SPATK/SPDEF format.
Editing HP here doesn't seem to affect anything, but editing its Normal forme stats in G3HS/YAPE allows it to change.

Subin Lee September 13th, 2014 9:17 AM

good work! ruby was my favorite game

Danny0317 September 27th, 2014 3:46 PM

Okay guys, does anyone know the proper way of using hidebox2 in emerald? It seems like a fairly useful command, I got it to do this once:
http://i.snag.gy/9yI60.jpg

but that ended up hiding the msgbox as well.

Aruaruu September 29th, 2014 9:24 AM

Quote:

Originally Posted by Dark Sneasel (Post 8451552)
Okay guys, does anyone know the proper way of using hidebox2 in emerald? It seems like a fairly useful command, I got it to do this once:
http://i.snag.gy/9yI60.jpg

but that ended up hiding the msgbox as well.

It probably won't work, but try using it with a signpost event types?
In the Emerald script dump I have, all instances of hidebox2 come under signpost events.

Click here to get Emerald script dump

Artemis64 October 12th, 2014 1:19 AM

What is the table in Emerald that is used to decide how the frames are flopped between each other? I changed Pidgey's sprite to the HGSS one so I want to change the rapid Frame 0/Frame 1 alternation of default Pidgey

Artemis64 October 12th, 2014 9:38 PM

By the way, the offset for the move effects table is 0x2D86A8. Just plug this in instead of 0x1D65A8 in Itman's Creating new Move Effects tutorial. And Shiny Quagsire or maybe Chaos Rush, could you please post the offset of the table that decides how Pokemon's frames are interchanged in Emerald?

AtecainCorp. October 15th, 2014 1:49 AM

Someone can help me with my problem? I have strange failure with Type Chart. I remade ??? To Fairy. And I have some trouble with it becouse when I use Fairy Type Move it allways afect as 1 point of damage <Even when supereffective> Someone know how to fix it?

Jambo51 October 15th, 2014 4:34 AM

Quote:

Originally Posted by Ksiazek Bartlomiej (Post 8469955)
Someone can help me with my problem? I have strange failure with Type Chart. I remade ??? To Fairy. And I have some trouble with it becouse when I use Fairy Type Move it allways afect as 1 point of damage <Even when supereffective> Someone know how to fix it?

That's because the ASM code behind the damage calculator doesn't know whether to categorise moves of that type as physical or special, and so does neither - simply returning 1 as the final damage.

It's fairly easy to fix with a little ASM knowledge, but fundamentally the change you're making is a hex edit.

I can't tell you where the byte(s) you'd need to change are as I never hacked Ruby or Emerald, so you'll need to find someone who either knows where the byte(s) are, or find them yourself using ASM research techniques.

Xencleamas October 15th, 2014 5:56 PM

Quote:

Originally Posted by HidoranBlaze (Post 8225070)
So since this is the "Exploring R/S/E" thread, I think this might be a good place to re-post my reply to Artemis64 in the battle backgrounds tutorial. Hopefully someone can make heads and tails of what I've looked into. (I can't really hack as of now)

This is already posted in Inserting Battle Backgrounds thread but I decided to post it in this thread as well.

Emerald Battle Backgrounds
Alright! This is the Battle Backgrounds table for Emerald. The table has the same concept for each background as FireRed has. I dunno if anyone already posted this kind of research but let's just say that I made fine research. LOL Having this format of having five pointers for each background:

Code:

VV VV VV 08  WW WW WW 08  XX XX XX 08  YY YY YY 08  ZZ ZZ ZZ 08

VV = Image Offset
WW = TileMap Offset
XX = Entry Image
(Ex. The Grass that moves in front of the screen at the beginning of a grass battle.)
YY = Entry Image Tilemap
ZZ = Palette


The difference between FireRed and Emerald is that the Emerald's table only covers 10 backgrounds which are in this list:
  • Grass 1 (Normal Grass)
  • Grass 2 (Tall Grass)
  • Sand
  • Dive
  • Sea
  • Pond
  • Craggy
  • Cave
  • Trainer Battles (Indoor)
  • Trainer Battles (Outdoor) "can be called as the outdoor FIELD"

The table begins at 31ABA8 and ends at 31AC6F. The table hasn't the background for Gym Leader battles, Hideout battles, Pokemon League battles, Battle Frontier battles (doesn't count the Smeargle cave underneath Battle Frontier), and the backgrounds for the Weather Trio battles isn't in the table too. I'm pretty sure that the table is somewhere else but they are located separatedly. Here is the documentation of each background and their offsets and pointers in the original table:

Code:

- Grass 1 (Normal Grass)
--- D77D68 (image) - pointer 68 7D D7 08 at 31ABA8
--- D75008 (image tilemap) - pointer 08 50 D7 08 at 31ABAC
--- D7E280 (entry image) - pointer 80 E2 D7 08 at 31ABB0
--- D7E808 (entry image tilemap) - pointer 08 E8 D7 08 at 31ABB4
--- D78318 (image palette) - pointer 18 83 D7 08 at 31ABB8

- Grass 2 (Tall Grass)
--- D78600 (image) - pointer 00 86 D7 08 at 31ABBC
--- D78CB8 (image tilemap) - pointer B8 8C D7 08 at 31ABC0
--- D7E9C4 (entry image) - pointer C4 E9 D7 08 at 31ABC4
--- D7F0D4 (entry image tilemap) - pointer D4 F0 D7 08 at 31ABC8
--- D78C78 (image palette) - pointer 78 8C D7 08 at 31ABCC

- Sand
--- D78F68 (image) - pointer 68 8F D7 08 at 31ABD0
--- D795A8 (image tilemap) - pointer A8 95 D7 08 at 31ABD4
--- D7F3C0 (entry image) - pointer C0 F3 D7 08 at 31ABD8
--- D7F850 (entry image tilemap) - pointer 50 F8 D7 08 at 31ABDC
--- D79560 (image palette) - pointer 60 95 D7 08 at 31ABE0

- Dive
--- D79858 (image) - pointer 58 98 D7 08 at 31ABE4
--- D79E58 (image tilemap) - pointer 58 9E D7 08 at 31ABE8
--- D7F9F8 (entry image) - pointer F8 F9 D7 08 at 31ABEC
--- D7FEC4 (entry image tilemap) - pointer C4 FE D7 08 at 31ABF0
--- D79E10 (image palette) - pointer 10 9E D7 08 at 31ABF4

- Sea
--- D7A108 (image) - pointer 08 A1 D7 08 at 31ABF8
--- D7A720 (image tilemap) - pointer 20 A7 D7 08 at 31ABFC
--- D80054 (entry image) - pointer 54 00 D8 08 at 31AC00
--- D80660 (entry image tilemap) - pointer 60 06 D8 08 at 31AC04
--- D7A6DC (image palette) - pointer DC A6 D7 08 at 31AC08

- Pond
--- D7A9D0 (image) - pointer D0 A9 D7 08 at 31AC0C
--- D7AFB8 (image tilemap) - pointer B8 AF D7 08 at 31AC10
--- D80804 (entry image) - pointer 04 08 D8 08 at 31AC14
--- D80D50 (entry image tilemap) - pointer 50 0D D8 08 at 31AC18
--- D7AF78 (image palette) - pointer 78 AF D7 08 at 31AC1C

- Craggy
--- D7B268 (image) - pointer 68 B2 D7 08 at 31AC20
--- D7B864 (image tilemap) - pointer 64 B8 D7 08 at 31AC24
--- D80E9C (entry image) - pointer 9C 0E D8 08 at 31AC28
--- D8147C (entry image tilemap) - pointer 7C 14 D8 08 at 31AC2C
--- D7B828 (image palette) - pointer 28 B8 D7 08 at 31AC30

- Cave
--- D7BB14 (image) - pointer 14 BB D7 08 at 31AC34
--- D7C154 (image tilemap) - pointer 54 C1 D7 08 at 31AC38
--- D81610 (entry image) - pointer 10 16 D8 08 at 31AC3C
--- D81E2C (entry image tilemap) - pointer 2C 1E D8 08 at 31AC40
--- D7C10C (image palette) - pointer 0C C1 D7 08 at 31AC44

- Trainer Battles (Indoor)
--- D7C440 (image) - pointer 40 C4 D7 08 at 31AC48
--- D7CA28 (image tilemap) - pointer 28 CA D7 08 at 31AC4C
--- D820D4 (entry image) - pointer D4 20 D8 08 at 31AC50
--- D824E4 (entry image tilemap) - pointer E4 24 D8 08 at 31AC54
--- D7DEB4 (image palette) - pointer B4 DE D7 08 at 31AC58
* Noted that the Trainer Battles for Indoor and Outdoor are sharing the same except for the image palette. Trainer Battles for Indoors contains white-ish and dark-brown-ish palette while Trainer Battles for Outdoors contains yellow-green-ish and light-brown-ish palette.

- Trainer Battles (Outdoor) "almost going to be called as the outdoor field"
--- D7C440 (image) - pointer 40 C4 D7 08 at 31AC5C
--- D7CA28 (image tilemap) - pointer 28 CA D7 08 at 31AC60
--- D820D4 (entry image) - pointer D4 20 D8 08 at 31AC64
--- D824E4 (entry image tilemap) - pointer E4 24 D8 08 at 31AC68
--- D7C404 (image palette) - pointer 04 C4 D7 08 at 31AC6C
* Noted that the Trainer Battles for Indoor and Outdoor are sharing the same except for the image palette. Trainer Battles for Indoors contains white-ish and dark-brown-ish palette while Trainer Battles for Outdoors contains yellow-green-ish and light-brown-ish palette.


For Gym Leader and Battle Frontier battles, they have separated backgrounds. Now, here is the documentation on other special backgrounds and I just give the location of their pointers:

Code:

BATTLE FRONTIER image pointer @ 03579C
BATTLE FRONTIER image tilemap pointer @ 0357A4
BATTLE FRONTIER image palette pointer @ 0357AC

GROUDON image pointer @ 0357D0
GROUDON image tilemap pointer @ 0357D8
GROUDON image palette pointer @ 0357E0

KYOGRE image pointer @ 035804
KYOGRE image tilemap pointer @ 03580C
KYOGRE image palette pointer @ 035814

RAYQUAZA image pointer @ 035838
RAYQUAZA image tilemap pointer @ 035840
RAYQUAZA image palette pointer @ 035848

GYM LEADER image pointer @ 035884
GYM LEADER image tilemap pointer @ 03588C
GYM LEADER image palette pointer @ 035894

CHAMPION image pointer @ 0358B0
CHAMPION image tilemap pointer @ 0358B8
CHAMPION image palette pointer @ 0358C0

"Gym Style (AM)" image pointer @ 035964
"Gym Style (AM)" image tilemap pointer @ 03596C
"Gym Style (AM)" image palette pointer @ 035974
* (AM) - Advance Map

MAGMA HIDEOUT "Team Rocket Style (AM)" image pointer @ 03598C
MAGMA HIDEOUT "Team Rocket Style (AM)" image tilemap pointer @ 035994
MAGMA HIDEOUT "Team Rocket Style (AM)" image palette pointer @ 03599C
* (AM) - Advance Map
* Although that the Ruby's Magma Hideout isn't used in the normal gameplay of Emerald, it exists in Emerald just for a standard "Team Rocket Style" and for FireRed, it is used in Pokemon Tower.

AQUA HIDEOUT "03 (AM)" image pointer @ 0359B4
AQUA HIDEOUT "03 (AM)" image tilemap pointer @ 0359BC
AQUA HIDEOUT "03 (AM)" image palette pointer @ 0359C4
* (AM) - Advance Map
* In Emerald, the "03 ???" from the Fight Type, it is the Aqua Hideout. Although that in FireRed, it appears to be for Rocket Hideout.

ELITE FOUR 1 image pointer @ 0359DC
ELITE FOUR 1 image tilemap pointer @ 0359E4
ELITE FOUR 1 image palette pointer @ 0359EC

ELITE FOUR 2 image pointer @ 035A04
ELITE FOUR 2 image tilemap pointer @ 035A0C
ELITE FOUR 2 image palette pointer @ 035A14

ELITE FOUR 3 image pointer @ 035A2C
ELITE FOUR 3 image tilemap pointer @ 035A34
ELITE FOUR 3 image palette pointer @ 035A3C

ELITE FOUR 4 image pointer @ 035A5C
ELITE FOUR 4 image tilemap pointer @ 035A64
ELITE FOUR 4 image palette pointer @ 035A6C

"Big Red Pokeball (AM)" image pointer @ 035A90
"Big Red Pokeball (AM)" image tilemap pointer @ 035A98
"Big Red Pokeball (AM)" image palette pointer @ 035AA0
* (AM) - Advance Map


So far, that's only the separated backgrounds I've found in Emerald. Some of the images are aligned with the first ten backgrounds or the other backgrounds so be careful while repointing. Example: You have a background for the Elite Four and Champion but it relates with the Team Rocket Style background. I suggest that if you have good instincts, insert the image without repointing and just edit the pointers manually by using a HEX editor. I just gave all the information I have found so you won't be having problems dealing with Emerald background. I hope this help you a lot. Good luck!

----

Quote:

Originally Posted by LCCoolJ95 (Post 8257165)
I did some research into TM extension in Emerald. It seems that the TMs are located at 616040. When I looked at the data, they were two bytes long each. It was a move IDs, in hex, FLIPPED. I used a Pokémon Ruby Gameshark Codes listing to prove it (Here's the link: http://www.ign.com/faqs/2004/pokemon-battle-e-gameshark-sp-codes-list-541208). For example, the move ID for Focus Punch, or or Fighting Punch as the rough Japanese to English translation, in hex would be 108. However, within the TM Data,
it is actually 08 01. It just flipped the first number, 01, with the two other numbers, 08.

The TMs in hex are:
Spoiler:
08 01 51 01 60 01 5B 01 2E 00 5C 00 02 01 53 01 4B 01 ED 00 F1 00 0D 01 3A 00 3B 00 3F 00 71 00 B6 00 F0 00 CA 00 DB 00 DA 00 4C 00 E7 00 55 00 57 00 59 00 D8 00 5B 00 5E 00 F7 00 18 01 68 00 73 00 5F 01 35 00 BC 00 C9 00 7E 00 3D 01 4C 01 03 01 07 01 22 01 9C 00 D5 00 A8 00 D3 00 1D 01 21 01 3B 01


But what about the HMs? They follow right after:
Spoiler:
0F 00 13 00 39 00 46 00 94 00 F9 00 7F 00 23 01


I asked someone about this, and they stated that, no matter what, if the move IDs (in hex) are added BEFORE the HM data, this would be the beginning of the expansion of TMs in the game. HMs, however, will always be the last 8 move IDs (in hex).

Here, I just did an example of doing this process, using an expanded moves table:
Spoiler:
08 01 51 01 60 01 5B 01 2E 00 5C 00 02 01 53 01 4B 01 ED 00 F1 00 0D 01 3A 00 3B 00 3F 00 71 00 B6 00 F0 00 CA 00 DB 00 DA 00 4C 00 E7 00 55 00 57 00 59 00 D8 00 5B 00 5E 00 F7 00 18 01 68 00 73 00 5F 01 35 00 BC 00 C9 00 7E 00 3D 01 4C 01 03 01 07 01 22 01 9C 00 D5 00 A8 00 D3 00 1D 01 21 01 3B 01 AE 01 63 01 B4 01 B8 01 BA 01 83 01 84 01 C0 01 A7 01 C3 01 05 01 C4 01 8D 01 6A 01 C5 01 88 01 75 01 A2 01 65 01 C7 01 C8 01 C9 01 7C 01 CA 01 E7 01 76 01 A5 01 96 01 CC 01 D6 01 77 01 E8 01 E4 01 68 01 79 01 54 01 57 01 7E 01 81 01 CD 01 86 01 BC 01 9F 01 A0 01 C8 00 7A 01 44 01 14 01 94 01 8B 01 0F 00 13 00 39 00 46 00 94 00 F9 00 7F 00 23 01


If you compare it to the original, there are an extra 50 TMs added. Now, I just need to know how to make the legitimate TM item work. If someone were to look into that, that would be awesome.

I think you should expand the items too. If the list of items ISN'T somewhat "DMA protected", that would be possible. I like the idea of expanding TMs but the items should too (in case you don't want replacing ????????????-s at all). Even with the INFINITE USAGE, how does the no-sell and no-buy-it-again will work on Gen III? And even with the expanded TMs (example 100 for now), I think expanding TM/HM compatibility table should be expanded too.

AtecainCorp. October 16th, 2014 11:13 PM

Quote:

Originally Posted by Jambo51 (Post 8470021)
That's because the ASM code behind the damage calculator doesn't know whether to categorise moves of that type as physical or special, and so does neither - simply returning 1 as the final damage.

It's fairly easy to fix with a little ASM knowledge, but fundamentally the change you're making is a hex edit.

I can't tell you where the byte(s) you'd need to change are as I never hacked Ruby or Emerald, so you'll need to find someone who either knows where the byte(s) are, or find them yourself using ASM research techniques.

Ok. Thank you. Meybe still I do not known the pointer of bytes which I must change. But now I know what I must do.

AtecainCorp. October 27th, 2014 2:34 AM

So Someone can told me from where to where is Safe Flags in Ruby?

mamamama October 27th, 2014 9:50 AM

I feel that translating this to Emerald would open up a huge door as many moves and held items need this hack. While the regular ROM offsets are easy to translate (I'll post them when I have access to my HEX-editor), I can't seem to find the corresponding RAM-locations in Emerald.

How would I go about finding them? 0x0202298C and 0x0203C020. I've searched for pointers in the ROM without luck.

Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global battlestringloaderhack
main:
mov r0, #0xC2
lsl r0, r0, #0x1
cmp r0, r6
bne normalcode
ldr r0, ramlocation
ldr r7, [r0, #0x0]
cmp r7, #0x0
beq alternative
mov r0, #0xA
lsl r0, r0, #0x18
cmp r7, r0
bge alternative
mov r0, #0x8
lsl r0, r0, #0x18
cmp r7, r0
blt alternative
b continue
alternative: mov r6, #0xC
ldr r1, returntwo
bx r1
continue: ldr r0, returnone
bx r0
normalcode: ldr r1, otherramloc
mov r0, #0xFF
strb r0, [r1, #0x0]
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align
ramlocation: .word 0x0203C020
returntwo: .word 0x080D77D1
returnone: .word 0x080D77DD
otherramloc: .word 0x0202298C



HidoranBlaze October 27th, 2014 10:49 AM

Quote:

Originally Posted by mamamama (Post 8481100)
I feel that translating this to Emerald would open up a huge door as many moves and held items need this hack. While the regular ROM offsets are easy to translate (I'll post them when I have access to my HEX-editor), I can't seem to find the corresponding RAM-locations in Emerald.

How would I go about finding them? 0x0202298C and 0x0203C020. I've searched for pointers in the ROM without luck.

Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global battlestringloaderhack
main:
mov r0, #0xC2
lsl r0, r0, #0x1
cmp r0, r6
bne normalcode
ldr r0, ramlocation
ldr r7, [r0, #0x0]
cmp r7, #0x0
beq alternative
mov r0, #0xA
lsl r0, r0, #0x18
cmp r7, r0
bge alternative
mov r0, #0x8
lsl r0, r0, #0x18
cmp r7, r0
blt alternative
b continue
alternative: mov r6, #0xC
ldr r1, returntwo
bx r1
continue: ldr r0, returnone
bx r0
normalcode: ldr r1, otherramloc
mov r0, #0xFF
strb r0, [r1, #0x0]
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align
ramlocation: .word 0x0203C020
returntwo: .word 0x080D77D1
returnone: .word 0x080D77DD
otherramloc: .word 0x0202298C



The otherramloc seems to be 0x02022E2C. I haven't found the corresponding offset for 0x0203C020 yet, but I'll update this post if I do.
So for reference:
returntwo: .word 0x0814E6CD
returnone: .word 0x0814E6D9
otherramloc: .word 0x02022E2C
EDIT: This is a big assumption on my part, but 0x0203c020 seems to be free ram space. Under that assumption, I've found a place that'll hopefully work: 0x0203B200.
I haven't found any references to this in the ROM, so hopefully this'll work. Please make a backup before testing this though.

EDIT2: How does this look?

http://snag.gy/kijp0.jpg

MrDollSteak October 27th, 2014 3:01 PM

Quote:

Originally Posted by HidoranBlaze (Post 8481134)
The otherramloc seems to be 0x02022E2C. I haven't found the corresponding offset for 0x0203C020 yet, but I'll update this post if I do.
So for reference:
returntwo: .word 0x0814E6CD
returnone: .word 0x0814E6D9
otherramloc: .word 0x02022E2C
EDIT: This is a big assumption on my part, but 0x0203c020 seems to be free ram space. Under that assumption, I've found a place that'll hopefully work: 0x0203B200.
I haven't found any references to this in the ROM, so hopefully this'll work. Please make a backup before testing this though.

EDIT2: How does this look?

http://snag.gy/kijp0.jpg

That's what I had found to. I personally used something different to 203B200, but that works too!
I was going to post my port, but you guys have beaten me there.

HidoranBlaze October 27th, 2014 4:06 PM

Quote:

Originally Posted by MrDollSteak (Post 8481321)
That's what I had found to. I personally used something different to 203B200, but that works too!
I was going to post my port, but you guys have beaten me there.

Just curious, what RAM offset did you use? I ask this since I imagine people will add their own moves to your rombase once you release your Emerald version, and it'd be nice to have consistency.

Anyway, I realized I should probably post how I ported this to EM.

1.
Code:

.text
.align 2
.thumb
.thumb_func
.global battlestringloaderhack
main:
mov r0, #0xC2
lsl r0, r0, #0x1
cmp r0, r6
bne normalcode
ldr r0, ramlocation
ldr r7, [r0, #0x0]
cmp r7, #0x0
beq alternative
mov r0, #0xA
lsl r0, r0, #0x18
cmp r7, r0
bge alternative
mov r0, #0x8
lsl r0, r0, #0x18
cmp r7, r0
blt alternative
b continue
alternative: mov r6, #0xC
ldr r1, returntwo
bx r1
continue: ldr r0, returnone
bx r0
normalcode: ldr r1, otherramloc
mov r0, #0xFF
strb r0, [r1, #0x0]
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align
ramlocation: .word 0x0203B200
returntwo: .word 0x0814E6CD
returnone: .word 0x0814E6D9
otherramloc: .word 0x02022E2C


Insert this routine into your ROM. Take note of the offset you insert it to.

2. Go to 0x14E6C2 in your hex editor and change FF 20 to 08 47. Then go to 0x14E6C8 and change the pointer to the location of your ASM routine +1.

Using it is as simple as putting
setword 0x203B200 0x8(location of your string)
printstring 0x184
in your battle script.

MrDollSteak October 27th, 2014 4:12 PM

Quote:

Originally Posted by HidoranBlaze (Post 8481378)
Just curious, which RAM offset did you use? I ask this since I imagine people will add their own moves to your rombase once you release your Emerald version, and it'd be nice to have consistency.

Anyway, I realized I should probably post how I ported this to EM.

1.
Code:

.text
.align 2
.thumb
.thumb_func
.global battlestringloaderhack
main:
mov r0, #0xC2
lsl r0, r0, #0x1
cmp r0, r6
bne normalcode
ldr r0, ramlocation
ldr r7, [r0, #0x0]
cmp r7, #0x0
beq alternative
mov r0, #0xA
lsl r0, r0, #0x18
cmp r7, r0
bge alternative
mov r0, #0x8
lsl r0, r0, #0x18
cmp r7, r0
blt alternative
b continue
alternative: mov r6, #0xC
ldr r1, returntwo
bx r1
continue: ldr r0, returnone
bx r0
normalcode: ldr r1, otherramloc
mov r0, #0xFF
strb r0, [r1, #0x0]
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align
ramlocation: .word 0x0203B200
returntwo: .word 0x0814E6CD
returnone: .word 0x0814E6D9
otherramloc: .word 0x02022E2C


Insert this routine into your ROM. Take note of the offset you insert it to.

2. Go to 0x14E6C2 in your hex editor and change FF 20 to 08 47. Then go to 0x14E6C8 and change the pointer to the location of your ASM routine +1.

Using it is as simple as putting
setword 0x203B200 0x8(location of your string)
printstring 0x184
in your battle script.

I doubt people would be adding moves to my rombase as I've expanded it to 1023 available moves, so that it can include every actual move. As for custom moves, I doubt anyone would make effects that don't currently exist. But anyway I used 203E320 instead of 2023B200.

That being said I don't know much about the Emerald ram. Much less than Fire Red anyway, so I'll trust your judgment for what is unused, and will probably change it.

AtecainCorp. October 28th, 2014 12:46 AM

It was nice. But I wonder that it was possible to make Pokemon Evolving During Battle? Not like Mega Evolutions. But normally. For example. Torchic gained lvl 16 in the middle of battle and start evolving in that moment beafore rival sent next Pokemon. That feature make game more like Anime series.

Artemis64 November 29th, 2014 7:20 PM

Chaos Rush or Shiny Quagsire, could you please post the tables that control how frames alternate between each other? Also, I would appreciate it if someone actually posts how to find limiters, I haven't seen a tutorial for this of all important things, as I intend to try and expand the animation table in Emerald and the Abilities table.

AtecainCorp. November 30th, 2014 2:05 PM

Someone know where is Trainer Sprites showing Limiter on Pokemon Ruby?

Percy December 18th, 2014 5:42 PM

Anyone know an ASM code where I can name the player from the Overworld?

Aruaruu December 18th, 2014 9:19 PM

Quote:

Originally Posted by BlazikenXY (Post 8538161)
Anyone know an ASM code where I can name the player from the Overworld?

I found this somewhere for Emerald
callasm 0xE5075

Percy December 18th, 2014 9:21 PM

Quote:

Originally Posted by Aruaruu (Post 8538363)
I found this somewhere for Emerald
callasm 0xE5075

Wow, thank you very much! I'll test it if it will work!

sonicfan7895 December 20th, 2014 10:13 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8257165)
I did some research into TM extension in Emerald. It seems that the TMs are located at 616040. When I looked at the data, they were two bytes long each. It was a move IDs, in hex, FLIPPED. I used a Pokémon Ruby Gameshark Codes listing to prove it (Here's the link: http://www.ign.com/faqs/2004/pokemon-battle-e-gameshark-sp-codes-list-541208). For example, the move ID for Focus Punch, or or Fighting Punch as the rough Japanese to English translation, in hex would be 108. However, within the TM Data,
it is actually 08 01. It just flipped the first number, 01, with the two other numbers, 08.

The TMs in hex are:
Spoiler:
08 01 51 01 60 01 5B 01 2E 00 5C 00 02 01 53 01 4B 01 ED 00 F1 00 0D 01 3A 00 3B 00 3F 00 71 00 B6 00 F0 00 CA 00 DB 00 DA 00 4C 00 E7 00 55 00 57 00 59 00 D8 00 5B 00 5E 00 F7 00 18 01 68 00 73 00 5F 01 35 00 BC 00 C9 00 7E 00 3D 01 4C 01 03 01 07 01 22 01 9C 00 D5 00 A8 00 D3 00 1D 01 21 01 3B 01


But what about the HMs? They follow right after:
Spoiler:
0F 00 13 00 39 00 46 00 94 00 F9 00 7F 00 23 01


I asked someone about this, and they stated that, no matter what, if the move IDs (in hex) are added BEFORE the HM data, this would be the beginning of the expansion of TMs in the game. HMs, however, will always be the last 8 move IDs (in hex).

Here, I just did an example of doing this process, using an expanded moves table:
Spoiler:
08 01 51 01 60 01 5B 01 2E 00 5C 00 02 01 53 01 4B 01 ED 00 F1 00 0D 01 3A 00 3B 00 3F 00 71 00 B6 00 F0 00 CA 00 DB 00 DA 00 4C 00 E7 00 55 00 57 00 59 00 D8 00 5B 00 5E 00 F7 00 18 01 68 00 73 00 5F 01 35 00 BC 00 C9 00 7E 00 3D 01 4C 01 03 01 07 01 22 01 9C 00 D5 00 A8 00 D3 00 1D 01 21 01 3B 01 AE 01 63 01 B4 01 B8 01 BA 01 83 01 84 01 C0 01 A7 01 C3 01 05 01 C4 01 8D 01 6A 01 C5 01 88 01 75 01 A2 01 65 01 C7 01 C8 01 C9 01 7C 01 CA 01 E7 01 76 01 A5 01 96 01 CC 01 D6 01 77 01 E8 01 E4 01 68 01 79 01 54 01 57 01 7E 01 81 01 CD 01 86 01 BC 01 9F 01 A0 01 C8 00 7A 01 44 01 14 01 94 01 8B 01 0F 00 13 00 39 00 46 00 94 00 F9 00 7F 00 23 01


If you compare it to the original, there are an extra 50 TMs added. Now, I just need to know how to make the legitimate TM item work. If someone were to look into that, that would be awesome.

I think if we need to make more legitimate TM items work, we would first need to take a large chunk of data starting at wherever the item table starts (which in this case is at 0x5839A0), and take the entire item table (plus a larger chunk of data in order to account for how many more TMs we may need (in this case, 50)), and copy & paste it into free space, change all pointers to the NEW item table, and give respective item stats (sell price, mystery values, etc.). Judging from a certain hex viewer, the item data should last anywhere from 20-34 bytes long, but I can't tell for sure. The hex viewer I'm looking through is called ps2dis, which is actually a hex viewer for handling files specifically for PS2 games, but it works in a pinch (it also views hex in NORMAL hex order, not REVERSE hex order). For actually teaching the new TMs, I believe we would also have to repoint the TM/HM compatibility table within the game (located at 0x252BC8), so that the entire table accounts for the new TMs being able to be taught to a Pokemon. Not only that, but we would also have to put the TM data (starting at 0x616040, ending at 0x6160b0 with Dive), and put new data in between Overheat and Cut (if there are 50 new TMs you want to insert (at least two bytes per new TM), we would have to insert 100 new bytes of data for all the new TMs, which would result in the table ending later. Say the new TMs table was at something like 0xE40000, and I added 100 bytes to the already present bytes for the TMs, that would mean that the new table would end at 0xE4006C. In themselves, they would be pointers to the moves being taught in question (if I'm not mistaken). There's so much to do that it might take a while before expanding on the amount of TMs could even come close to working for Emerald. Anyone want to help in furthering our understanding on item data, and more importantly, come up with a more viable solution to expanding on the amount of TMs within Emerald? I kind of sound like I don't know what I'm talking about, but I think you could see where I'm going with this?

HidoranBlaze December 21st, 2014 11:19 AM

Quote:

Originally Posted by sonicfan7895 (Post 8541164)
I think if we need to make more legitimate TM items work, we would first need to take a large chunk of data starting at wherever the item table starts (which in this case is at 0x5839A0), and take the entire item table (plus a larger chunk of data in order to account for how many more TMs we may need (in this case, 50)), and copy & paste it into free space, change all pointers to the NEW item table, and give respective item stats (sell price, mystery values, etc.). Judging from a certain hex viewer, the item data should last anywhere from 20-34 bytes long, but I can't tell for sure. The hex viewer I'm looking through is called ps2dis, which is actually a hex viewer for handling files specifically for PS2 games, but it works in a pinch (it also views hex in NORMAL hex order, not REVERSE hex order). For actually teaching the new TMs, I believe we would also have to repoint the TM/HM compatibility table within the game (located at 0x252BC8), so that the entire table accounts for the new TMs being able to be taught to a Pokemon. Not only that, but we would also have to put the TM data (starting at 0x616040, ending at 0x6160b0 with Dive), and put new data in between Overheat and Cut (if there are 50 new TMs you want to insert (at least two bytes per new TM), we would have to insert 100 new bytes of data for all the new TMs, which would result in the table ending later. Say the new TMs table was at something like 0xE40000, and I added 100 bytes to the already present bytes for the TMs, that would mean that the new table would end at 0xE4006C. In themselves, they would be pointers to the moves being taught in question (if I'm not mistaken). There's so much to do that it might take a while before expanding on the amount of TMs could even come close to working for Emerald. Anyone want to help in furthering our understanding on item data, and more importantly, come up with a more viable solution to expanding on the amount of TMs within Emerald? I kind of sound like I don't know what I'm talking about, but I think you could see where I'm going with this?

The item data structure has been documented pretty well, actually. You can look at Bulbapedia, or this thread. It's 44 bytes for each item.

With TM expansion, the compatibility table can't be extended with a simple repoint, since the structure is limited to 8 bytes per mon. Luckily, I've found the routine that reads this table (and optimized it, actually), so expanding the structure to 16 bytes per mon, which should be more than enough, won't be hard. I also believe I've found the limiters for the TMs. The main problem I'm running into actually is item limiter problems, which I'm too lazy to fix at the moment. Once I force myself to work on this though, TM expansion should be a thing.

Of course, there's bag space problems that'll probably show up as well. I'll probably just have people deposit their TMs in the PC or something, because screw memory allocation. Not going to find a solution to that. But yeah, that's basically the info I have on TM expansion.

Aruaruu December 21st, 2014 11:56 AM

Quote:

Originally Posted by HidoranBlaze (Post 8541731)
With TM expansion, the compatibility table can't be extended with a simple repoint, since the structure is limited to 8 bytes per mon. Luckily, I've found the routine that reads this table (and optimized it, actually), so expanding the structure to 16 bytes per mon, which should be more than enough, won't be hard.

Would it be possible to do this with the Move Tutors too?

Joexv December 30th, 2014 3:49 PM

Ok so im posting some title screen logs from emerald,so that someone better at tracing that me can do something with them.
Spoiler:
LZ77UnCompWram: 0x0853fb3c,0x0201c000 (VCOUNT=91)----Pokemon logo shine
LZ77UnCompWram: 0x08de03e8,0x0201c000 (VCOUNT=66)----Press Start
LZ77UnCompWram: 0x08ddfd94,0x0201c000 (VCOUNT=8)-----Emerald logo
LZ77UnCompVram: 0x08dde458,0x0600d800 (VCOUNT=150)-----transparent clouds?
LZ77UnCompVram: 0x0853fc8c,0x0600c000 (VCOUNT=100)-----clouds
LZ77UnCompVram: 0x0853f83c,0x0600d000 (VCOUNT=69)-----title image raw
LZ77UnCompVram: 0x0853f058,0x06008000 (VCOUNT=170)----Rayquaza/title screen image

also 0xde03c8 -----Press Start Pallet

Something I found odd about the log is that the only raw file is the Title screen image, is the entire title screen controlled by asm?

Also upon editing the press start button's location and repointing this appeared in the log
LZ77UnCompVram: 0x09000000,0x06004800 (VCOUNT=150)
This offset is not going to be the same as yours since this is an edited rom.
Upon going to it in gba graphics editor it looks like some raw file, but it isnt.. Its odd. When edited in anyway even reinserting it with the exact same image deletes the Pokemon logo. which is why i feel like its a raw file. It also has a pallet, which I forgot to write the offset down....
http://i.imgur.com/qa0dILy.png

And here is the pallet location for the color of the flashing colors of the title screen BEFORE the whole image appears. 0x5dffb0 first 3 colors are the flashing colors. Rest unknown or maybe the colors for the emerald logo.

Hopefully this information will come of use to someone.

AtecainCorp. January 19th, 2015 11:10 AM

It was any possiblity to port GHOST battle system into Pokemon Emerald?

Artemis64 January 19th, 2015 10:42 PM

By the way, does anyone have the offsets of the tables that need to be repointed to expand the number of Pokémon animations on Emerald? And also, how do they work? I want to change how the frames are flopped between each other.

Edwearth February 11th, 2015 3:57 AM

Hello,

How do attacks work? When an attack is chosen, is it load somewhere in ram in a defined address? And the foes, the attack's user, the type of the attack?
Where does the stat changes (like after leer or growl) are stored? And confusion? And field effects (like after spikes)?

Xencleamas February 13th, 2015 9:17 AM

Emerald Encounter Music


I don't know where should I post this. But then I guess I have found this thread that deals about every research done for R/S/E engine. Was this right? Well, let's just move on to the main topic...

I have been using Unnamed Trainer Editor always for trainer editing. I also wondered why it doesn't list up which encounter music uses (being 0 to end being 0x1A0). I have research that on. And, guess what? Just like in FireRed, an assigned encounter music number plays a certain theme. Since UTE didn't listed up for Emerald so here it goes:

Encounter Themes:
  • 0x0: The Youngster encounter theme which music number is 0x17C
  • 0x1: The Lass encounter theme which music number is 0x197
  • 0x2: The Tuber encounter theme which music number is 0x17B
  • 0x3: The Bug Maniac encounter theme which music number is 0x1A7
  • 0x4: The Black Belt encounter theme which music number is 0x1A0
  • 0x5: The Cool Trainer (now Ace Trainer) encounter theme which music number is 0x1A1
  • 0x6: The Team Aqua encounter theme which music number is 0x1A3
  • 0x7: The Team Magma encounter theme which music number is 0x1B9
  • 0x8: The Swimmer encounter theme which music number is 0x181 (edit at 0xB1C30 to change song number 81 01 00 00)
  • 0x9: The Kid encounter theme which music number is 0x1C1
  • 0xA: The Elite Four encounter theme which music number is 0x1C2
  • 0xB: The Hiker encounter theme which music number is 0x1C3
  • 0xC: The Reporters Gabby and Ty encounter theme which music number is 0x1C5
  • 0xD: The Gentleman encounter theme which music number is 0x18D

0xE until 0xF (14 until 255) plays the Bug Maniac encounter theme which music number is 0x1A7. Alright! That goes for a while. I still need to research them more since there are further information about them on how they work and how they are listed up. I will update this post as soon as I have gathered information.

One important thing: If you have followed the tutorial of expanded Pokedex for Emerald, the ninth step messes up the load of 0x8 encounter music which I have discovered earlier. It seems that in the first twenty-nine 81 01 00 00-s, something related to encounter themes are there. To fix the 0x8 encounter music once again: go to 0xB1C30 then type 81 01 00 00.

To conclude this, you can have no longer translating the Controlling/Extending Encounter Music which is only for FireRed. You can have fourteen kinds of encounter music in Emerald (than FireRed being three unless you have applied that hack) Alright! That concludes for a while. Hope this helps.

Emerald Overworld and Battle Textboxes


Getting lazy all the time screwing up with the unLZ and VBA's Logs? There are few people ask about that nowadays. Alright! For being fair, here are the data you need... again for Emerald:

Emerald Overworld Textbox: 0x08DDD768 (uncompressed image)
Emerald Overworld Textbox Palette: 0x08DDD728 (uncompressed palette)
Emerald Battle Textbox: 0x08C00000 (compressed image)
Emerald Battle Textbox Pal: 0x08C004E0 (compressed palette)

I guess you know what compressed and uncompressed images and palettes are? Good! These things can be done in the latest version of NSE. Good luck!

Joexv March 10th, 2015 11:46 AM

Not really that big of a deal but quite annoying, but pallet 12 for Emerald's sprites causes any sprite assigned to it to be frozen facing down. Good for store clerks or pokeballs, but not really for npcs.
So just a heads up for u peeps.

EDIT: So it turns out any pallet with a pal register 4a000000 is effected with the freeze. Simply changing it to a safe pal register should fix it. I may get a list of safe ones made up soon.

kleenexfeu April 19th, 2015 5:02 AM

Quote:

Originally Posted by Tlachtli (Post 8184068)
Spoiler:
http://s29.postimg.org/siju36mn9/Protean.gif

I think I've finally worked the bugs out of Protean, and I'm 96% sure it'll work with no problem now. As promised here's the (Emerald BPEE) ASM for it, so hold on to your butts:

Code:

.align 2
.thumb

GetPokeTypes:
    push {r0-r5}
    ldr r1, .BattleData
    ldr r0, .CurPokeIndex
    ldrb r0, [r0]
    mov r2, #0x58
    mul r2, r0
    add r1, #0x21
    add r1, r2
    ldrh r0, [r1]
    mov r2, r0
    lsr r0, #2
    lsl r2, #24
    lsr r2, #24

GetMoveType:
    ldr r3, .CurMoveIndex
    ldrh r3, [r3]
    ldr r4, .MoveData
    mov r5, #0xC
    mul r5, r3
    add r4, r5
    add r4, #0x2
    ldrb r4, [r4]

ChangePokeType:
    cmp r0, r4
    beq End
    cmp r2, r4
    beq End
    lsl r4, #2
    ldr r5, .TypeList1
    add r5, r4
    mov r0, r5
    mov r2, #0x2
    sub r1, #0x1
    swi #0x0B
    ldr r0, .TypeList1
    ldr r1, .CheckForChange
    mov r2, #0x1
    swi #0x0B
    ldr r0, .TypeList2
    add r0, r4
    ldr r1, .TypeBuffer
    mov r2, #0x2
    swi #0x0B

End:
    pop {r0-r5}
    bx lr

.align 2
.BattleData:        .word 0x02024084
.CurPokeIndex:        .word 0x0202420B
.CurMoveIndex:        .word 0x020241EA
.MoveData:        .word 0x08E3E680
.CheckForChange:    .word 0x02024200
.TypeBuffer:        .word 0x02022F58
.TypeList1:        .word 0x[address1]
.TypeList2:        .word 0x[address2]


For TypeList1, copy this hex somewhere and use its start as address1:
Code:

6A 00 00 00 6A 01 01 00 6A 02 02 00 6A 03 03 00 6A 04 04 00 6A 05 05 00  6A 06 06 00 6A 07 07 00 6A 08 08 00 6A 09 09 00 6A 0A 0A 00 6A 0B 0B 00  6A 0C 0C 00 6A 0D 0D 00 6A 0E 0E 00 6A 0F 0F 00 6A 10 10 00 6A 11 11 00


For TypeList2, copy this hex somewhere and use its start as address2
Code:

FD 03 00 FF FD 03 01 FF FD 03 02 FF FD 03 03 FF FD 03 04 FF FD 03 05 FF  FD 03 06 FF FD 03 07 FF FD 03 08 FF FD 03 09 FF FD 03 0A FF FD 03 0B FF  FD 03 0C FF FD 03 0D FF FD 03 0E FF FD 03 0F FF FD 03 10 FF FD 03 11 FF


Now actually implementing it is the tricky part, it won't be a simple copy/paste job; you'll need some insight on what the battle scripts for different moves are actually doing to decide the appropriate place(s) to put ability checks. For any move you want to be affected by Protean you'll need to add a check for it somewhere in the battle script before calculatedamage. In order for a notification string to print out correctly callasm must be before printstring 0x49, and the printstring must be before attackcanceller. You should add a check to see if the user's ability is Protean, if so execute the ASM and optionally print a message if the type is changed, then jump back to the right point in the script. A potential script segment would look something like:

Code:

... (move script stuff is here) ...
jumpifability BANK_USER ABILITY_PROTEAN @Protean        /Note 1
goto 0x082D8A26                                        /Note 2

#org @Protean
callasm [address of Protean asm, plus 0x1]
jumpifbyte B_!= 0x02024200 0x0 @Change                  /Note 3
jumpifbyte B_= 0x02024200 0x0 @AttackCanceller

#org @Change
setbyte 0x02024200 0x0
printstring 0x49                                        /Note 4
waitmessage 0x40
goto @AttackCanceller

#org @AttackCanceller
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
goto 0x82D8A34


Note 1: You'll either need to define ABILITY_PROTEAN in BSP's abilities.bsh, or just use the hex for the ability here instead.
Note 2: A goto jump to an address somewhere in the area of 0x082D8A26 usually signifies the end of a moves' unique scripting, as that jumps to a segment of script shared by nearly all damaging moves. In damaging moves I'd suggest putting the check for Protean before that jump. In status moves the jump may be different.
Note 3: The ASM for Protean does the following: gets the type of the move being used, checks it against the user's type(s), and if necessary changes type to match the move. If there is a type change it will always result in a monotype, if one is not needed though the Poke can retain a dual typing. If a type change is done the byte at 0x02024200 is set to a non-zero garbage byte (in this case 0x6A). This can be used to decide whether or not to display a message, and should be reset to 0x0 somewhere in the battle script.
Note 4: String 0x49 is "[User] transformed into the [Type] type!". This is the string used in Gen 6 games.

As a demo, here's the script I used while testing it. It changes Psybeam, Feint Attack, and Slash (all moves known by the Kecleon I was testing with). After compiling the test script change Psybeam's move effect (effect 76) pointer to match @Psybeam, and change Slash and Feint Attack (effects 43 and 17) to both match @Slash. You'll also need Jambo's callasm for BSP and to define Protean in abilities.bsh.
Spoiler:
Code:

#dynamic 0xE446B0
#freespace 0xFF
#include abilities.bsh

#org @Psybeam
setbyte 0x2024335 0x7
goto @Slash

#org @Slash
jumpifhalfword 0x1 0x20241EA 0x39 @ProteanCheck
jumpifspecialstatusflag 0x0 0x40000 0x1 @ProteanCheck
orword 0x2024280 0x40000
setbyte 0x2024482 0x2
jumpifability BANK_USER ABILITY_PROTEAN @Protean
goto 0x082D8A26

#org @ProteanCheck
jumpifability 0x1 0x6A @Protean
goto 0x82D8A26

#org @Protean
setbyte 0x02024200 0x0
callasm 0x08E44621
jumpifbyte 0x1 0x02024200 0x0 @Change
goto @AttackCanceller

#org @Change
printstring 0x49
waitmessage 0x40
goto @AttackCanceller

#org @AttackCanceller
setbyte 0x02024200 0x0
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
goto 0x82D8A34




Even though it seems complicated and may not be the most concise or elegant way to add Protean, it does indeed work. The only known issue is that when using Hidden Power it will change to Normal instead of the hidden type, but honestly it seems like a small issue and writing more asm to fix that is fairly low on my priority list.

I think there is an issue in the routine because everytime I use a move it says "Scizor transform into the type!" what type ?
Maybe a wrong argument is used or a bad address because every moves have a correct STAB, but the defense part won't work. I mean if I'm transformed in dark type, dark moves are neutral for exemple.
Any clue ?

EDIT : Nevermind I am a dumb, it works perfectly.. Except for a pokemon that is double type, scizor for exemple. If I use bullet punch and receive a fight move, it's supper effective
And for the type list one, it a weird coincidence that it shares the same number of the ability (6A). It has something to do with the ability's number ou simple coincidence ? Not sure
Don't forget to change .MoveData: .word 0x08E3E680 into your actual move data location. It took me one hour to figure out why it did not work x)

EDIT 2 : Protean seems to work just one time
Seems to be fixed if I change 6A to the number of my ability in my typelistone

Trainer 781 April 19th, 2015 10:46 AM

I
Quote:

Originally Posted by kleenexfeu (Post 8714483)
I think there is an issue in the routine because everytime I use a move it says "Scizor transform into the type!" what type ?
Maybe a wrong argument is used or a bad address because every moves have a correct STAB, but the defense part won't work. I mean if I'm transformed in dark type, dark moves are neutral for exemple.
Any clue ?

EDIT : Nevermind I am a dumb, it works perfectly.. Except for a pokemon that is double type, scizor for exemple. If I use bullet punch and receive a fight move, it's supper effective
And for the type list one, it a weird coincidence that it shares the same number of the ability (6A). It has something to do with the ability's number ou simple coincidence ? Not sure
Don't forget to change .MoveData: .word 0x08E3E680 into your actual move data location. It took me one hour to figure out why it did not work x)

EDIT 2 : Protean seems to work just one time
Seems to be fixed if I change 6A to 51 in my first typelist

Protean always changes the pokemon to a monotype regardless of the initial typing. So a surf using protean greninja changes to a mono water type.

kleenexfeu April 19th, 2015 11:35 AM

Quote:

Originally Posted by KDS (Post 8714877)
I

Protean always changes the pokemon to a monotype regardless of the initial typing. So a surf using protean greninja changes to a mono water type.

Well, it works fine then.

But a thing to note :
You can edit almost all the move that deal damage at once :
Spoiler:
#org 0xA207A0
jumpifhalfword 0x1 0x20241EA 0x39 0x8A207D2
jumpifspecialstatusflag 0x0 0x40000 0x1 0x8A207D2
orword 0x2024280 0x40000
setbyte 0x2024482 0x2
jumpifability 0x1 0x51 0x8A207DE
goto 0x82D8A26

#org 0xA207D2
jumpifability 0x1 0x51 0x8A207DE
goto 0x82D8A26

#org 0xA207DE
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A207F9
goto 0x8A20804

#org 0xA207F9
printstring 0x49
waitmessage 0x40
goto 0x8A20804

#org 0xA20804
setbyte 0x2024200 0x0
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
goto 0x82D8A34

#org 0x2D8A5E
attackstring
ppreduce
pause 0x20
missmessage
resultmessage
waitmessage 0x40
goto 0x82D8A4E

#org 0x2D8A4E
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

// Used Strings
// String 0x49
// = [buffer 0xFD:0xF] transformed\ninto the [buffer 0xFD:0x0] type!

#org 0x2D8A34
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0x2D8A26
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0x2D8A26
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end


You just have to repoint all the 2D8A00 pointer on A207A0 (in my example), but there's some move that need an individual editing like earthquake (a pain to me) or hyper beam (perhaps other, I'll edit).
So, the effect for : Absorb, hyperbeam earthquake, fly/bounce/dig/dive, multi-hit moves, return, magnitude and doom desire have to be edited individually, the rest is handled by the first script

EDIT : There you can fix earthquake :
Spoiler:
#org 0xA20B00
attackcanceler
attackstring
ppreduce
selectnexttarget
cmd25
jumpifspecialstatusflag 0x0 0x80 0x1 0x8A20B90
orword 0x2024280 0x20000
setbyte 0x2024482 0x2
jumpifability 0x1 0x51 0x8A20B90
goto 0x8A20C90

#org 0xA20B90
jumpifability 0x1 0x51 0x8A20D90
goto 0x8A21190

#org 0xA20D90
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A20E90
goto 0x8A20F90

#org 0xA20E90
printstring 0x49
waitmessage 0x40
goto 0x8A20F90

#org 0xA20F90
setbyte 0x2024200 0x0
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
goto 0x8A21190

#org 0xA21190
bicword 0x2024280 0x20000
setbyte 0x2024482 0x1
accuracycheck 0x8A21290 0x0
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x8A20B04
end

#org 0xA21290
pause 0x20
cmd6
missmessage
resultmessage
waitmessage 0x40
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x8A20B04
end

#org 0xA20C90
accuracycheck 0x8A21290 0x0
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x8A20B04
end


Don't use dynamic offset with bsp with a script that long, it doesn't compile correctly

Earthquake works perfectly now !

EDIT : Tried this way for multi hit move :
Spoiler:
#org 0xA20B10
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
jumpifability 0x1 0x51 0x8A20B70
setloopcounter 0x0
cmd8e
setbyte 0x202448A 0x0
jumpiffainted 0x1 0x8A20BB0
jumpiffainted 0x0 0x8A20BF0
jumpifhalfword 0x0 0x20241EC 0xD6 0x8A20C30
jumpifstatus 0x1 0x7 0x8A20BF0

#org 0xA20B70
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A20B90
goto 0x8A20B20

#org 0xA20B90
printstring 0x49
waitmessage 0x40
goto 0x8A20B20

#org 0xA20C30
cmd25
copyarray 0x2024335 0x202448A 0x1
critcalc
cmd5
cmd6
jumpifbyte 0x4 0x202427C 0x29 0x8A20CD0
cmd7
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
addbyte 0x2024480 0x1
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpifbyte 0x4 0x202427C 0x40 0x8A20BF0
cmd27 0x8A20E00
goto 0x8A20BF0

#org 0x2D8A5E
attackstring
ppreduce
pause 0x20
missmessage
resultmessage
waitmessage 0x40
goto 0x82D8A4E

#org 0x2D8A4E
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0xA20BF0
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x202427C 0x29 0x8A20BB0
copyarray 0x2022F58 0x202447C 0x6
printstring 0x22
waitmessage 0x40

#org 0xA20BB0
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x2
cmd49 0x1 0x0
setbyte 0x2024488 0x4
cmd49 0x0 0x0
end

#org 0xA20CD0
pause 0x20
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x202427C 0x29 0x8A20BB0
copyarray 0x2022F58 0x202447C 0x6
printstring 0x22
waitmessage 0x40

#org 0xA20E00
jumpiffainted 0x1 0x8A20BB0
jumpiffainted 0x0 0x8A20BF0
jumpifhalfword 0x0 0x20241EC 0xD6 0x8A20C30
jumpifstatus 0x1 0x7 0x8A20BF0
cmd25
copyarray 0x2024335 0x202448A 0x1
critcalc
cmd5
cmd6
jumpifbyte 0x4 0x202427C 0x29 0x8A20CD0
cmd7
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
addbyte 0x2024480 0x1
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpifbyte 0x4 0x202427C 0x40 0x8A20BF0
cmd27 0x8A20E00
goto 0x8A20BF0


My poke's type changes indeed and I have a beautiful freeze

I tried million times, can't figure out
I have one version that allow the poke to change type, hit the foe but then it freeze

Here is one cool, don't know why, it display a weird message instead of "hit X times"

Spoiler:
#org 0xA20B10
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
jumpifability 0x1 0x51 0x8A20B70
setloopcounter 0x0
cmd8e
setbyte 0x202448A 0x0
jumpiffainted 0x1 0x8A20BB0
jumpiffainted 0x0 0x8A20BF0
jumpifhalfword 0x0 0x20241EC 0xD6 0x8A20C30
jumpifstatus 0x1 0x7 0x8A20BF0
jumpifability 0x1 0x51 0xA20B70
goto 0x8A20C30

#org 0xA20B70
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A20B90
goto 0x8A20C30

#org 0xA20B90
printstring 0x49
waitmessage 0x40
goto 0x8A20C30

#org 0xA20C30
cmd25
copyarray 0x2024335 0x202448A 0x1
critcalc
cmd5
cmd6
jumpifbyte 0x4 0x202427C 0x29 0x8A20CD0
cmd7
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
addbyte 0x2024480 0x1
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpifbyte 0x4 0x202427C 0x40 0x8A20BF0
cmd27 0x8A20E00
goto 0x8A20BF0

#org 0x2D8A5E
attackstring
ppreduce
pause 0x20
missmessage
resultmessage
waitmessage 0x40
goto 0x82D8A4E

#org 0x2D8A4E
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0xA20BF0
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x202427C 0x29 0x8A20BB0
copyarray 0x2022F58 0x202447C 0x6
printstring 0x22
waitmessage 0x40

#org 0xA20BB0
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x2
cmd49 0x1 0x0
setbyte 0x2024488 0x4
cmd49 0x0 0x0
end

#org 0xA20CD0
pause 0x20
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x202427C 0x29 0x8A20BB0
copyarray 0x2022F58 0x202447C 0x6
printstring 0x22
waitmessage 0x40

#org 0xA20E00
jumpiffainted 0x1 0x8A20BB0
jumpiffainted 0x0 0x8A20BF0
jumpifhalfword 0x0 0x20241EC 0xD6 0x8A20C30
jumpifstatus 0x1 0x7 0x8A20BF0
cmd25
copyarray 0x2024335 0x202448A 0x1
critcalc
cmd5
cmd6
jumpifbyte 0x4 0x202427C 0x29 0x8A20CD0
cmd7
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
addbyte 0x2024480 0x1
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpifbyte 0x4 0x202427C 0x40 0x8A20BF0
cmd27 0x8A20E00
goto 0x8A20BF0


Think I get confuse but anyway, it could gives an idea to someone skilled x) :
Spoiler:
#org 0xA22B10
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
setloopcounter 0x0
cmd8e
setbyte 0x202448A 0x0
jumpiffainted 0x1 0x8A20D50
jumpiffainted 0x0 0x8A20D70
jumpifhalfword 0x0 0x20241EC 0xD6 0x8A20D90
jumpifstatus 0x1 0x7 0x8A20D70
jumpiffainted 0x1 0x8A20BB0
jumpiffainted 0x0 0x8A20BF0
jumpifhalfword 0x0 0x20241EC 0xD6 0x8A20C30
jumpifstatus 0x1 0x7 0x8A20BF0
jumpifability 0x1 0x51 0x8A21B70
goto 0x8A23600


#org 0xA20D50
jumpifability 0x1 0x51 0x8A21B70
goto 0x8A20BB0

#org 0xA20D70
jumpifability 0x1 0x51 0x8A22170
goto 0x8A20BF0

#org 0xA20D90
jumpifability 0x1 0x51 0x8A22370
goto 0x8A20C30

#org 0xA21B70
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A20F90
goto 0x8A20B00

#org 0xA22170
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A20F90
goto 0x8A20BF0

#org 0xA22370
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A20F90
goto 0x8A20C30

#org 0xA20F90
printstring 0x49
waitmessage 0x40
goto 0x8A22470

#org 0xA22470
setbyte 0x2024200 0x0
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
goto 0x8A22570

#org 0xA22570
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0xA23600
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0xA20C30
cmd25
copyarray 0x2024335 0x202448A 0x1
critcalc
cmd5
cmd6
jumpifbyte 0x4 0x202427C 0x29 0x8A20CD0
cmd7
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
addbyte 0x2024480 0x1
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpifbyte 0x4 0x202427C 0x40 0x8A20BF0
cmd27 0x8A20E00
goto 0x8A20BF0

#org 0x2D8A5E
attackstring
ppreduce
pause 0x20
missmessage
resultmessage
waitmessage 0x40
goto 0x82D8A4E

#org 0x2D8A4E
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0xA20BF0
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x202427C 0x29 0x8A20BB0
copyarray 0x2022F58 0x202447C 0x6
printstring 0x22
waitmessage 0x40

#org 0xA20BB0
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x2
cmd49 0x1 0x0
setbyte 0x2024488 0x4
cmd49 0x0 0x0
end

#org 0xA20CD0
pause 0x20
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x202427C 0x29 0x8A20BB0
copyarray 0x2022F58 0x202447C 0x6
printstring 0x22
waitmessage 0x40

#org 0xA20E00
jumpiffainted 0x1 0x8A20BB0
jumpiffainted 0x0 0x8A20BF0
jumpifhalfword 0x0 0x20241EC 0xD6 0x8A20C30
jumpifstatus 0x1 0x7 0x8A20BF0
cmd25
copyarray 0x2024335 0x202448A 0x1
critcalc
cmd5
cmd6
jumpifbyte 0x4 0x202427C 0x29 0x8A20CD0
cmd7
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
addbyte 0x2024480 0x1
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpifbyte 0x4 0x202427C 0x40 0x8A20BF0
cmd27 0x8A20E00
goto 0x8A20BF0


Ok you know what is a dumb ? No you cannot because you don't know me. Anyway I get tired I guess, so if you still want a working script :
Spoiler:
#org 0xA20B10
jumpifability 0x1 0x51 0x8A20B30
goto 0x82D8DEA

#org 0xA20B30
setbyte 0x2024200 0x0
callasm 0x8A20701
jumpifbyte 0x1 0x2024200 0x0 0x8A20B70
goto 0x82D8DEA

#org 0xA20B70
printstring 0x49
waitmessage 0x40
goto 0x82D8DEA


I think you can do the same for every "special effect" like fly and so. I'll edit
Works for Fly and the other. Only hidden power remains normal type, as Tlatchli said.


All times are GMT -8. The time now is 8:50 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.