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

Code: Move Resource Thread

89
Posts
10
Years
It's alright, all of us procrastinate to some extent. By the way since you have added a updated animations section, I might as well share my updated Mud Shot animation:
Spoiler:
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
Payback (FireRed):
Spoiler:


Trump Card (FireRed):
Spoiler:


EDIT: Also here's my really lame Trump Card particle, for Trump Card I just used Swift's animation but with this particle instead:
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
Natural Gift for FireRed:

Step 1: First, add this command in commands.bsh for Battle Script Pro (credit to KDS for first discovering this when he posted his Incinerate script):
Spoiler:
(this command to remove items is already in the game so you don't need to add code or anything, it's just unidentified by BSP)

Step 2:
Compile the following table and put it into free space, make sure you take note of the offset you put it in. We'll refer to this table as NATURAL GIFT TABLE:
Spoiler:

When compiled, the format of this table will be [XX XX] [YY] [ZZ], with XXXX being the index number of the item, YY being the type that Natural Gift will change into, and ZZ being the base power. This table only covers the berries that are in Gen 3, so if you've added new berries then you'll have to add them into the table. MAKE SURE YOU LEAVE THE FOUR FF BYTES AT THE END, DO NOT OVERWRITE IT. (or change them to FE bytes, and in Step 3 modify the line "mov r4, 0xFF" to "mov r4, 0xFE").

Step 3:
Insert this routine into free space, and take note of its offset. We'll refer to this as ASM ROUTINE 1:
Spoiler:

Make sure you put in the offset of the Natural Gift table at the last line.

Step 4:
Now, insert this routine into free space as well, and take note of its offset. We'll refer to this as ASM ROUTINE 2:
Spoiler:

Note: If you have repointed your type chart, then you will have to put its new offset where I've bolded above.

Step 5:
Now here's the battle script:
Spoiler:


And here's an animation:
Code:
02 24 7B 3E 08 02 05 01 00 01 00 00 00 0A 00 ED 33 05 03 19 34 0B 08 02 00 19 EC 00 C0 04 10 19 EC 00 C0 05 00 97 27 0A 01 0C 0C 08 19 7F 00 3F 02 08 7C 3E 08 02 04 00 00 00 00 01 00 02 00 03 F9 89 09 08 02 05 01 00 03 00 00 00 06 00 01 00 05 0B 01 0D 02 24 7B 3E 08 02 05 01 00 01 00 0A 00 00 00 ED 33 05 0B 03 0D 08

Here's an explanation as to how this works:
So as you can see, "ASM ROUTINE 1" looks up the custom table we inserted and matches your held item to it (the move will fail if you're not holding an item or if you're holding an item that's not in the table), and then updates the type and base power accordingly. Now, with this routine alone, the damage and type calculations are correct, but the outcome message will always act as a regular move (regular as in not super-effective or not not-very-effective) unless if you don't have an item in the table (then it will just fail), and turns out the reason why is for some reason the outcome RAM offset (02023DCC) wasn't getting updated even though the battle engine should theoretically already have done so (if you have the routine be the first thing in the script). So what "ASM ROUTINE 2" does is that it looks up the type chart and the opponent's types and determines the outcome that way (and yes, I checked and double checked and triple checked with various berry & type combinations, so it works). It wasn't ideal, but it was necessary in order to get the correct message to show up.

"But Chaos, couldn't you just look at how Weather Ball and Hidden Power does it"? Well, I did (for anyone curious, the Weather Ball command's routine is at 0802D090, while the Hidden Power command's routine is at 0802B678), and what both do is that they update the value held by the pointer at 02023FE8(a dynamic memory location) + 0x13, usually the pointer at 02023FE8 leads to 02000010, so the type value is (usually) at 02000023. No matter what I tried with updating that value, it always played the normal hit sound (but would still do more or less damage depending on type, such as Electric type Natural Gift doing more damage to Pidgey than Water type Natural Gift), unless if it was a type immunity in which case it worked as expected. For testing reasons I tried giving a new test move Hidden Power's battle script ID, and turns out the correct sound effect doesn't play either (but it does with Hidden Power itself, even though I gave them the same battle script ID), and turns out the outcome offset was only being updated when using the actual Hidden Power, which leads me to believe that Hidden Power and Weather Ball's move ID's are hard-coded to update the outcome offset. So the whole purpose of "ASM ROUTINE 2" is to circumvent that. "ASM ROUTINE 2" manually looks up the type chart and what outcome it should be, and updates the outcome value at 02023DCC accordingly.
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
All for FireRed:
Gastro Acid: (note that all this does is change the target's ability to ability #0x0)
First insert this string:
FD 10 B4 E7 00 FE BB D6 DD E0 DD E8 ED 00 EB D5 E7 00 E7 E9 E4 E4 E6 D9 E7 E7 D9 D8 AB FF 00
(it says, "[the target]'s Ability was suppressed!")

Next insert this ASM code:
Spoiler:


And finally, use this battle script:
Spoiler:


As for the animation, I just use Acid's animation but modified with Sleep Powder's palette, which makes it look a nice greenish-brown color just like the official games.

----------------------------------------------------------------------

Power Trick: (note that this doesn't account for Baton Passing like the official games, sorry :P)
Exactly the same as above for Gastro Acid, but use this string and ASM instead.

String:
FD 0F 00 E7 EB DD E8 D7 DC D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF 00 FE D5 E2 D8 00 BE D9 DA D9 E2 E7 D9 AB FF 00

ASM:
Spoiler:


Battle script:
Spoiler:


As for the animation, I used Psych Up's animation movement with the particle I've attached to the bottom of this post.

----------------------------------------------------------------------

Me First:

We're going to have to insert three ASM routines.

ASM routine 1:
Spoiler:

Note: The bolded section can be removed if you want, I rigged it to fail if the opponent is going to use Natural Gift.

ASM routine 2:
Spoiler:


ASM routine 3:
Spoiler:


And finally, use this battle script:
Spoiler:


I know this method seems rather ridiculous to require 3 callasm's (and maybe there might be some redundant checks left in there because they were all modified heavily from Doesnt's Sucker Punch routine), but basically this method insures that it first prints "[user] used Me First!", does Me First's unique animation, then updates the RAM to the stolen Move ID, then says, "[user] used [stolen move]!" and plays the stolen move's animation. Having three check routines in between commands was necessary for Me First to have it's own unique animation AND still play the new animation afterwards AND display the updated string afterwards.

-----------------------------------------------------
(these particles are just for Power Trick and Wring Out. Use Psych Up's movement for Power Trick, and use Gust's movement for Wring Out)
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
(FireRed) Psycho Cut animation that looks more similar to the in-game one. Psycho Cut is not a contact move, so this would be more fitting (it's basically Air Cutter with the Psychic background). Basically the concept is that the user creates a blade with his/her Psychic powers.
Code:
0E BB 59 1D 08 00 13 27 00 9A 27 00 97 27 04 00 0A 03 0C 0C 08 04 00 03 F1 76 0A 08 02 05 20 00 E8 FF 00 06 02 00 80 00 05 19 79 00 3F 02 AC 32 3E 08 02 04 28 00 E0 FF 00 00 02 00 04 05 03 1D 8B 09 08 02 05 01 00 02 00 00 00 08 00 01 00 03 1D 8B 09 08 02 05 03 00 02 00 00 00 08 00 01 00 05 0D 0B 03 04 00 0E C7 59 1D 08 08

Also have some particles. They're already indexed. Use the Aura Sphere particle with Shadow Ball's movement and that bright-blue BG. Use the Energy Ball particle with Shadow Ball's movement as well. Use the Power Gem particle with Hidden Power's movement. And lastly, the Sucker Punch particle can be used for any Dark or Poison move where you want a purple hit marker.
 

BadgerLordZeus

Spooniest of Bards
11
Posts
9
Years
I made a Parabolic Charge animation for Fire Red. Its nothing fancy, but It'll do.

Spoiler:


EDIT: I've made a few more animations for Fire Red if anyone is interested.

Mystical Fire (I'm very happy with how this animation turned out)

Spoiler:


Power-Up Punch (this one is pretty basic, overall)

Spoiler:


And heres my take on a Dragon Rush animation. Since the 4th/5th gen animations are kind of generic, my one is also. Its just the slam animation with Blaze Burn/Hydro Cannon's "solarize" like effect.

Dragon Rush

Spoiler:
 
Last edited:

kearnseyboy6

Aussie's Toughest Mudder
300
Posts
15
Years
  • Seen Jun 22, 2019
Payback (FireRed):
Spoiler:


Trump Card (FireRed):
Spoiler:


EDIT: Also here's my really lame Trump Card particle, for Trump Card I just used Swift's animation but with this particle instead:

My compiler doesn't recognise callasm. Which cmd do I need to update?

Actually my whole command.bsh is empty and everytime I redownload it is empty as well. Can someone please share it?
 
Last edited:
457
Posts
10
Years
  • Age 28
  • Seen Mar 17, 2024

Rock Wrecker Animation (Emerald):

Code:
14 XX 17 03 61 76 11 08 05 04 00 F4 00 00 01 00 FF FF 00 AA 27 00 4A 27 00 97 27 0A 03 0C 0C 08 02 D8 72 59 08 02 04 04 00 01 00 0A 00 01 00 02 10 6C 59 08 02 05 14 00 20 00 D0 FF 32 00 02 00 02 10 6C 59 08 02 05 00 00 20 00 DA FF 19 00 05 00 02 10 6C 59 08 02 05 20 00 20 00 E4 FF 28 00 03 00 02 10 6C 59 08 02 05 EC FF 20 00 D0 FF 32 00 02 00 02 10 6C 59 08 02 05 14 00 20 00 E4 FF 3C 00 01 00 02 10 6C 59 08 02 05 00 00 20 00 E4 FF 1E 00 04 00 03 D1 52 0D 08 02 05 00 00 01 00 00 00 1E 00 01 00 19 AB 00 C0 04 0A 02 10 6C 59 08 02 05 0F 00 20 00 D0 FF 19 00 05 00 02 10 6C 59 08 02 05 F6 FF 20 00 D6 FF 1E 00 04 00 04 0A 02 10 6C 59 08 02 05 00 00 20 00 D6 FF 19 00 05 00 02 10 6C 59 08 02 05 E7 FF 20 00 D0 FF 1E 00 04 00 05 02 28 FE 57 08 02 02 04 00 06 00 04 03 19 B1 00 C0 02 98 6C 59 08 82 06 10 00 00 00 00 00 00 00 19 00 01 01 05 02 58 73 59 08 83 04 00 00 00 00 01 00 01 00 19 83 00 3F 02 1C 6B 59 08 82 06 00 00 00 00 14 00 18 00 0E 00 02 00 03 AD 51 0D 08 02 05 01 00 03 00 00 00 05 00 01 00 02 1C 6B 59 08 82 06 05 00 00 00 EC FF 18 00 0E 00 01 00 02 1C 6B 59 08 82 06 00 00 05 00 14 00 E8 FF 0E 00 02 00 02 1C 6B 59 08 82 06 FB FF 00 00 EC FF E8 FF 0E 00 02 00 05 02 58 FE 57 08 02 03 00 00 00 00 07 00 05 0B 03 0D 0E 15 7D 2D 08 08

The recharging stones part from the Ancient Power's animation then blast from the Rock Blast animation with an attack background like it was shown in D/P/Pt/HG/SS. The animation almost looks like from the games but I would make a particle of the Rock Wrecker soon.

But first, you need to have the attack backgrounds expanded. If you don't know how, read this thread: http://www.pokecommunity.com/showthread.php?t=281520. If you do, you need to have the image, palette, and tilemap inserted in game. To where you have inserted it, replace XX with that value (example: 1B is the background). The image, palette, and tilemap are in the zip in the attachment below. Credits to MrDollSteak for the Rock Wrecker background. Sorry to rip from your ROM Base since it is an open resource anyway. :3
 
Last edited:
218
Posts
10
Years
  • Seen Nov 12, 2021
Here is Frost breath effect for Emerald :

1E 00 04 00 8A 2D 08 1E 00 4B 00 8A 2D 08 01 5E 8A 2D 08 00 00 00 02 03 2E 11 42 02 02 02 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 28 47 8A 2D 08

Thank's to pawell6, I've just changed some pointers

Hello, I ported some effects you made for Fire Red to Emerald.

Blizzard Updated :
Spoiler:


Charge Updated :
Spoiler:


Freeze Shock Ice Burn and Sky Attack :
Spoiler:


Geomancy :
Spoiler:


Hex :
Spoiler:


Venoshock :
Spoiler:


Knock Off Updated :
Spoiler:


Toxic Updated :
Spoiler:


I also made one effect by myself. (For Emerald too).

U-Turn :
Spoiler:


PS : I wanted to created an effect like Judgment, but I don't know if there is a function to set the attack's type. And I don't remember the function to check the held object. Also, is it possible to change the ratio of drained HP in the drain effect, in order to make Oblivion Wing ? Thanks.

Didn't test the other, but U-turn doesn't take in count Shadowtag ability. A jumpifability 0x0 0x17 should be enough I guess
And it fail if you have only one pokemon

EDIT : Nope, I still can switch in double battle. And the move completely fail in one vs one. It's a progress I guess..
 
Last edited:
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
4. Cure Primary Status Command

Tested your command out on Emerald and got some weird result. Since the final command on the Emerald Battle Command Table is F8, and I use F9 for callasm, I set cureprimarystatus as FA.

When I tried to attack a sleeping opponent with Wake-Up Slap, the game froze when the battle script reached cureprimary status.

I pretty much copy pasted all your stuff so it should be all right. I did not forget to put +1 at asm offsets either.

EDIT: Scald just completely glitches out before the attack-animation. This is unlikely to be due to the command though.
 
Last edited:

Trainer 781

Guest
0
Posts
Tested your command out on Emerald and got some weird result. Since the final command on the Emerald Battle Command Table is F8, and I use F9 for callasm, I set cureprimarystatus as FA.

When I tried to attack a sleeping opponent with Wake-Up Slap, the game froze when the battle script reached cureprimary status.

I pretty much copy pasted all your stuff so it should be all right. I did not forget to put +1 at asm offsets either.

EDIT: Scald just completely glitches out before the attack-animation. This is unlikely to be due to the command though.

Weird.
Shouldn't happen. I have tested this on emerald too and it is working fine. I recommend to cross-check everything.
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
Weird.
Shouldn't happen. I have tested this on emerald too and it is working fine. I recommend to cross-check everything.

Got it to work. Sorry for bothering :) Was working with two roms and mixed them up.

Edit: Also, great job on this. Really appreciate it!
 
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
Psycho Shift

Quick question: I'm trying to get your Psycho Shift to work, but I just get "the move failed" every time. When I tried to complie the script, BSP wouldn't let me include "#include std.bsh" -- could that be the reason?

What does std.bsh do and would you know how I can get BSP to compile with it?
 

Trainer 781

Guest
0
Posts
Quick question: I'm trying to get your Psycho Shift to work, but I just get "the move failed" every time. When I tried to complie the script, BSP wouldn't let me include "#include std.bsh" -- could that be the reason?

What does std.bsh do and would you know how I can get BSP to compile with it?

If you have probleMs with the include statement then remove it and replace every instance BANK_TARGET with 0x0 and BANK_USER with 0x1
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Made a routine that changes the attack into the user's primary type (Judgment...), here :

Spoiler:


Just callasm this routine before the attackcanceler in battle script. Pm if there is bug/problem/other
I think it's not optimized but whatever, it works. I'll see if I can change it

Edited, thanks KDS
 
Last edited:

Trainer 781

Guest
0
Posts

Only problem in 2 lines.
1. mul r2,r0 should be mul r0,r2 (this can spoil the results)
2. ldrh r0, [r1] is redundant not needed.

Also for anyone wanting this for FR:
Code:
.BattleData:.word 0x02023BE4
.UserBank:.word 0x02023D6B
.MemAddress:.word 0x02023fe8

Natural Gift for FireRed:

I actually got this and Judgement without the help of your second routine.
It is also displaying the correct outcome and the proper effectiveness sound is playing.
(I used Tackle and Move Effect ID 1 for this).

The problem lies with the placement of the 1st routine.
The battle script should be:
Code:
#org @main
callasm 0x8(offset of ASM ROUTINE 1+1)
attackcanceler
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x02023DCC 0x8 0x81D694E
removeitem 0x1
goto 0x81D6947

Move type changing routines should be placed before the attack canceler because it contains checks for abilities like Flash Fire, Water Absorb etc. The original battle script wouldn't account for this.
Also this might be the reason why the outcome might not be properly handled.
Judgment should a script like that of Weatherball i.e callasm then goto the regular attack routine.

Also the fail address pointer in the 1st routine should be (0x081D7DF2 - 0x5). Even though with the original value it is working. It might not be the case with other scripts.
While branching to custom scripts with callasm command, 0x5 must be subtracted from their offset, because callasm always adds 0x5 to the script pointer regardless of the branch.
 
Last edited:
180
Posts
10
Years
  • Age 34
  • Seen Jan 10, 2017
Did any1 find a way to make Bind etc. do 1/8 damage as opposed to 1/16? I know it's been found for Rough skin so I guess it would only require a byte change or two.
 

Trainer 781

Guest
0
Posts
[/spoiler]

Got a problem here. I put my routine before the attackcanceler as you adviced, water/volt absorb didn't work, but levitate did. Do I have to callasm (myroutine - 0x5 +1) or (myroutine - 0x5) or just (myroutine +1) as usual ? I didn't get what you said in your last post.

Hmm, I'll like into the volt absorb thingy if I have time.
Routine+1 is correct. (The -5 is for an alternate script. It is used if the routine specified in the callasm command can branch to more than one different battle scripts.)
Accuracy checker should be there in thd battle script. If you want infinite accuracy you can just set the move accuracy to zero using an editor.
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Hmm, I'll like into the volt absorb thingy if I have time.
Routine+1 is correct. (The -5 is for an alternate script. It is used if the routine specified in the callasm command can branch to more than one different battle scripts.)
Accuracy checker should be there in thd battle script. If you want infinite accuracy you can just set the move accuracy to zero using an editor.

Thank's, so that's what I did.

For the accuracy, I just followed the Jambo51's advice in his tutorial. Because set accuracy to zero make the move always miss, but set it to 255 will make it never miss. The problem is I don't like seeing accuracy = 255 in move description, it doesn't look legit at all.

Would be great to have a routine that make appear "---" instead of "255" but anyway. Would be cool if you find a way to fix absorb ability
 

Trainer 781

Guest
0
Posts
Thank's, so that's what I did.

For the accuracy, I just followed the Jambo51's advice in his tutorial. Because set accuracy to zero make the move always miss, but set it to 255 will make it never miss. The problem is I don't like seeing accuracy = 255 in move description, it doesn't look legit at all.

Would be great to have a routine that make appear "---" instead of "255" but anyway. Would be cool if you find a way to fix absorb ability

Actually it seems that the absorb abilities are called from the accuracy checker command. So you need to include the accuracy checker as well.
To set the move accuracy to display --- , you need to set the accuracy to 0.
Judgment has 100% accuracy according to bulbapedia not infinite.
Also, you can reduce Judgement's battle script to 2 lines only.
I.e 1. callasm offset
2. goto basic damage script
 
Back
Top