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

Code: Move Resource Thread

239
Posts
8
Years
    • Seen Apr 15, 2024
    I followed everything you said, but for some reason now all the between turn animations have become wrap. Do you know what I could have done wrong?
    I also modified the routine a little:
    Spoiler:

    Thanks!

    If it's doing the wrap animation between turns, it's somehow getting to the Default part of the assembly routine. I would double check your move IDs. It looks like Infestation is move ID 570, for example.

    Also since you load ldr r1, =(0x02037F02) at Ending, you shouldn't need to add that at every check, just in case you want to save a few bytes :)
     
    71
    Posts
    7
    Years
    • Seen Jul 11, 2022
    If it's doing the wrap animation between turns, it's somehow getting to the Default part of the assembly routine. I would double check your move IDs. It looks like Infestation is move ID 570, for example.

    Also since you load ldr r1, =(0x02037F02) at Ending, you shouldn't need to add that at every check, just in case you want to save a few bytes :)
    I've checked my move ids many times. Infestation is supposed to be 570; I expanded my level up move data. Assuming the move ids are correct, what could I be doing wrong?
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    I've checked my move ids many times. Infestation is supposed to be 570; I expanded my level up move data. Assuming the move ids are correct, what could I be doing wrong?

    Ah, that makes sense then. It's possible expanding the move IDs over 511 is the issue, then? The original routine loads the attack ID in a strange manner, so I would go through and make sure that you are actually loading the move ID in Main.

    These are my notes on what the routine actually does to load the move ID into r1:
    Code:
    	ldr r0, =(0x02024018)
    	ldr r0, [r0]				@r0 = word at 02024018 -> 02005484
    	ldr r1, [r0, #0x8]			@r1 = word at 0200548C -> 02005504
    	ldrh r1, [r1]				@r1 = move ID
     
    71
    Posts
    7
    Years
    • Seen Jul 11, 2022
    Ah, that makes sense then. It's possible expanding the move IDs over 511 is the issue, then? The original routine loads the attack ID in a strange manner, so I would go through and make sure that you are actually loading the move ID in Main.

    These are my notes on what the routine actually does to load the move ID into r1:
    Code:
    	ldr r0, =(0x02024018)
    	ldr r0, [r0]				@r0 = word at 02024018 -> 02005484
    	ldr r1, [r0, #0x8]			@r1 = word at 0200548C -> 02005504
    	ldrh r1, [r1]				@r1 = move ID
    I don't believe it's an issue with expanding the moves. I tested the old function with the new table and the original entries worked fine. However with this new function, even the old entries (I've been mostly trying with Whirlpool) appear as wrap. I checked 0x02005504 and FA was appearing there so I don't know what could be going wrong at this point.
     
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    I don't believe it's an issue with expanding the moves. I tested the old function with the new table and the original entries worked fine. However with this new function, even the old entries (I've been mostly trying with Whirlpool) appear as wrap. I checked 0x02005504 and FA was appearing there so I don't know what could be going wrong at this point.

    Just took a closer look at your assembly routine, and I found the issue. In main, it should be:
    Code:
    ldr r1, [r0, #0x8]
    ldrh r1, [B][r1][/B]

    whereas you have:
    Code:
    ldr r1, [r0, #0x8]
    ldrh r1, [B][r0][/B]	@r1 = move ID

    So the move ID isn't actually getting loaded into r1
     
    71
    Posts
    7
    Years
    • Seen Jul 11, 2022
    Just took a closer look at your assembly routine, and I found the issue. In main, it should be:
    Code:
    ldr r1, [r0, #0x8]
    ldrh r1, [B][r1][/B]

    whereas you have:
    Code:
    ldr r1, [r0, #0x8]
    ldrh r1, [B][r0][/B]	@r1 = move ID
    So the move ID isn't actually getting loaded into r1
    Yup, that was it. It works like a charm now. Thanks!
     
    22
    Posts
    11
    Years
    • Seen Jun 14, 2020
    Are there any tutorials on how / where to replace existing battle scripts? the one on the OP is ruined by photobucket and its obviously not using ASM thumb compilers.
     

    NoMansBubble

    My bed English.....
    3
    Posts
    6
    Years
    • Seen Sep 8, 2018
    Gen7 Move effect
    [FR]Shore Up
    Spoiler:


    [FR]First Impression
    Spoiler:
     
    Last edited:
    239
    Posts
    8
    Years
    • Seen Apr 15, 2024
    Here are a couple quick routines for Magic Room, Wonder Room, and Lucky Chant ([FR])

    Note that these may or may not be ideal routines. I haven't tested these routines much. Please report bugs or any item/defense check I may have overlooked. They are meant more or less as a placeholder until the new battle system arrives.

    Magic Room:
    -Every item check routine I've seen includes a call to a function to load the held effect ID from the item data table. This routine just returns 0 if Magic Room is in effect (except for exp/money items)
    -This routine is based on the assumption that all held items call said function, which may or may not be correct... It also requires that all added items perform this same function call
    -NOTE: Life Orb in MrDS's rombase does not call this function. It is checked at 08909fe4
    EDIT: Here is a fix for this
    Spoiler:


    Spoiler:


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Wonder Room:
    -This routine hijacks the base damage calculator and switches the storage of the target's def and sp. def for the calculation. This, of course, assumes that no other function in game needs to load a pkmn's def or sp. def. This is likely a rash assumption, though.
    Spoiler:


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    EDIT: And here's Lucky Chant: It just sets the critical marker to 1 (aka no critical hit) at the end of the crit calc routine if lucky chant is active on the user's side
    Spoiler:


    Enjoy!
     
    Last edited:
    23
    Posts
    7
    Years
    • Seen Nov 12, 2023
    Does anyone have Emerald version Water Shuriken animation?Currently making Emerald 802, Greninja Battle Blond already done, when kill one pokemon will become Ash-Greninja, only water shuriken lack of animation
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • Hey, I'm trying to download Battle Script Pro from the GitHub page and it builds with errors in Microsoft Visual 2017, so I tried to get an older version, which it recommends, but I don't have a subscription; therefore I can't. In order to convert battle scripts to asm or whatever language, I need BSP correct? If I do, does some one have a exe that doesn't need to be compiled?
     
    112
    Posts
    8
    Years
    • Seen Mar 15, 2024
    Here are some effects and animations for Fire Red. I will convert animations to commands when I get the chance.

    Effects:
    Spoiler:


    Animations:
    Spoiler:

    For some reason Electro ball, Gyro Ball and some other animations do not work.

    I remember Electro ball working but I don't know it doesn't now...


    Edit:

    I got the hang of move animations and I managed to create a working Water Shuriken animation for FR:

    Spoiler:


    As well as an updated version of Aqua Tail:
    Spoiler:
     
    Last edited:

    Skeli

    Lord of the Rings
    300
    Posts
    10
    Years
  • A whole bunch of move animations for [FR]. Some of them require insert offsets, so when inserting any with a .org 0xAAAAAA at the top, replace that with the offset you plan on inserting the animation at (don't add an extra 08 at the front!). They can all be compiled with a THUMB compiler.

    First, paste this at the top of all of the files:
    Spoiler:

    Aromatic Mist:
    Spoiler:

    Cotton Guard:
    Spoiler:

    Dragon Breath:
    Spoiler:

    Dragon Rush:
    Spoiler:

    Dragon Tail:
    Spoiler:

    Fire Fang:
    Spoiler:

    Flamethrower:
    Spoiler:

    Fling:
    Spoiler:

    Gear Grind:
    Spoiler:

    Ice Fang:
    Spoiler:

    Leech Life:
    Spoiler:

    Magma Storm:
    Spoiler:

    Retaliate
    Spoiler:

    Roar of Time:
    Spoiler:

    Shadow Force:
    Spoiler:

    Spotlight:
    Spoiler:

    Thunder Fang:
    Spoiler:

    Toxic Thread:
    Spoiler:
     
    Last edited:

    Prof. Leon Dias

    Let your memes be dreams
    118
    Posts
    11
    Years
  • This lists moves from the first three generations whose effects have been changed or updated in Generations 4, 5 and 6.

    Code:
    Whirlwind		no longer works on same/higher levelled wild PKMN
    			ignores accuracy and evasion
    			bypasses protect and detect
    Bind			inflicts 1/8 of max. HP*
    Stomp		x2 base power & ignores accuracy and evasion if target has used Minimize**
    Jump Kick		Crash damage = 1/2 of user's max. HP, rounded down***
    Thrash		disrupted by:	missing
    						sleeping
    						paralysis
    						freeze
    						flinching
    						protecting target
    						immune target
    			if disrupted on final turn of Thrash, confusion still occurs****
    Roar			ignores accuracy and evasion
    			bypasses protect and detect
    Supersonic		bypasses sub
    Disable		always lasts 4 turns
    			reflected by Magic Coat++
    Acid			10% chance to drop Sp.D by 1 stage
    Growth		raises Atk and Sp.A stats by 1 stage
    			raises Atk and Sp.A stats by 2 stages in Sun
    Surf			hits all Pokémon on the field except the user
    Blizzard		ignores accuracy and evasion in Hail
    String Shot	drops Speed by 2 stages
    Thunder		ignores accuracy and evasion in Rain
    			lowered accuracy in Sun
    Dig			underground wild PKMN canot be captured
    Toxic			ignores accuracy and evasion if used by a Poison-type
    Rage			raging users get Attack stat boosts every time they get hit
    Mimic		mimicked moves have max PP, not 5 PP
    Focus Energy	increases crit ratio by 2 stages, not 1
    Bide			only endures 2 turns
    			hits Ghost-types, as well semi-invulnerable PKMN in Dive, Bounce or Shadow Force
    			broken by sleep
    Selfdestruct	user faints before dealing damage +
    			no longer halves target's Def +
    Waterfall		20% flinch chance
    Sky Attack		displays "<user> became cloaked in a harsh light!" instead of "<user> is glowing!" on turn 1
    Transform		copies shininess
    			fails on subs
    Conversion		can be stolen by Snatch
    			can be used on Curse (because Curse is Ghost-type)
    			changes the user's current type to match the type of the first of the user's moves
    Substitute		multi-strike moves continue after breaking sub
    			blocks intimidate
    			blocks transform
    			doesn't block sound-based moves
    Struggle		ignores accuracy & evasion
    			user takes 1/4 max. HP as recoil
    Sketch		can copy Metronome and Transform
    Spider Web	no longer traps Ghost-types+++
    Thief			doesn't permanently steal a Trainer's Pokémon's item
    			items can be stolen back
    Flail			base damage = (48 * CurrentHP) / MaxHP
    Conversion2	changes user's type to resist target's last move, including non-damaging moves
    Spite			reflected by Magic Coat
    			always deducts 4 PP
    Destiny Bond	target faints after the user
    Sandstorm		boosts Rock-type Pokémon's Sp.D by 50%
    Sleep Talk		can use PP-less moves
    Heal Bell		bypasses sub
    			bypasses Soundproof
    Encore		lasts 3 turns
    			reflected by Magic Coat, but then fails
    Sweet Scent	lowers evasion by 2 stages
    Hidden Power	base power of 60
    Crunch		20% chance to lower Def by 1 stage, not Sp.D
    Future Sight	now does Psychic-type damage
    			uses Sp.D stat of receiving Pokémon, not original target
    Beat Up		base power = (party member's base Attack) / 10 + 5
    			receives STAB from Dark-type users
    Uproar		lasts exactly 3 turns
    Stockpile		raises user's Def and Sp.D stat by 1 stage
    Spit Up		removes Stockpile boosts
    Swallow		removes Stockpile boosts
    Torment		activates the turn it is used
    			reflected by Magic Coat
    Facade		ignores Burn Attack cut
    Focus Punch	charging turn has +6 priority
    Nature Power	calls different moves: http://bulbapedia.bulbagarden.net/wiki/Nature_Power_(move)#Generation_VI
    Charge		boosts Sp.D by one stat
    Taunt		lasts exactly 3 turns
    			reflected by Magic Coat
    Trick			no longer permanently switches a Trainer's Pokémon's items
    Wish			heals for half of the user's max. HP, not the recipient's
    			affected by Snatch
    Ingrain		Ghost-types who have ingrained can switch
    Recycle		affected by Snatch
    Magic Coat		reflects Teeter Dance, Taunt, Torment
    Brick Break		no longer removes screens if target is Ghost-type
    Knock Off		deals 50% more damage if target has item
    Skill Swap		switch-in abilities like intimidate activate after being swapped
    Secret Power	different effects: http://bulbapedia.bulbagarden.net/wiki/Secret_Power_(move)#Generation_VI
    Dive			underwater wild PKMN canot be captured
    Camouflage	more types for different terrain: http://bulbapedia.bulbagarden.net/wiki/Camouflage_(move)#Generation_VI
    Tail Glow		raises Sp.A by 3 stages
    Mud Sport		active for exactly 5 turns++++
    Poison Fang	50% chance to badly poison target
    Aromatherapy	lists PKMN that are healed
    Covet		no longer permanently steals a Trainer's Pokémon's items
    Doom Desire	now does Steel-type damage
    			uses Sp.D stat of receiving Pokémon, not original target
    
    *applies to Bind, Wrap, Fire Spin, Clamp, Whirlpool, Sand Tomb
    **applies to Stomp, Body Slam
    ***applies to Hi Jump Kick
    ****applies to Thrash, Outrage, Petal Dance
    +applies to Selfdestruct, Explosion
    ++applies to Disable, Spite, Spkies, Foresight, Torment, Taunt, Odor Sleuth
    +++applies to Spider Web, Block, Mean Look
    ++++applies to Mud Sport, Water Sport

    This link may also be useful, as it lists all of the other changes that have been done to moves, such as base power and accuracy:
    http://bulbapedia.bulbagarden.net/wiki/List_of_modified_moves

    I decided to write up a document showing the changed effects of Gen 1-3 moves in greater detail, as the Bulbapedia link leaves out a lot of changes and some things have since been updated as of this post. Not trying to one-up you, just thought I would share a contribution. You can find the document here if you would like to take a look: https://www.pokecommunity.com/showpost.php?p=9834136&postcount=1
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • Hey people, maybe a dumb question...

    I want to make sing affect all pokemon except user, this doesn't work it still targets a single pokemon even when I change the target...

    I tried making it hit both foe's pokemon, this also didn't work.

    Anyone have this problem? Or am I just missing some easy step.
     

    BluRose

    blu rass
    811
    Posts
    10
    Years
  • Hey people, maybe a dumb question...

    I want to make sing affect all pokemon except user, this doesn't work it still targets a single pokemon even when I change the target...

    I tried making it hit both foe's pokemon, this also didn't work.

    Anyone have this problem? Or am I just missing some easy step.
    okay
    so this works as a bitfield
    so you're gonna have some byte
    and you're gonna take the value that the byte is set to when it hits your partner
    and you're gonna take the value that the byte is set to when it hits both foes
    and you're going to squeeze them together; combine their bitfields from binary)
    say that hitting your partner has value 20 (in binary, 00100000)
    and hitting both foes has value 80 (in binary, 10000000)
    so hitting everyone on field would be 10100000 (in hex, A0)

    tl;dr
    just add the two together and you get your resulting value~
     

    pikachux2

    Never Evolve
    115
    Posts
    14
    Years
  • okay
    so this works as a bitfield
    so you're gonna have some byte
    and you're gonna take the value that the byte is set to when it hits your partner
    and you're gonna take the value that the byte is set to when it hits both foes
    and you're going to squeeze them together; combine their bitfields from binary)
    say that hitting your partner has value 20 (in binary, 00100000)
    and hitting both foes has value 80 (in binary, 10000000)
    so hitting everyone on field would be 10100000 (in hex, A0)

    tl;dr
    just add the two together and you get your resulting value~

    EDIT: The target byte is the same as other moves that hit two pokemon's target byte, but it still will not function properly..



    I broke up the hex for a few moves here(attached a txt file).. Notice I changed tackle to hit all pokemon except the user (as a test).
    In game Tackle will say its targeting all users but it instead only targets one, whereas earthquake surf and explosion function
    properly. Has anyone else has this problem? This code was taken from in game.


    EDIT AGAIN!!: So it seems the only way a move can function when it targets both foes and your partner is if it has some effect... I'm sure if this is true, most of you already know it... Can someone confirm this?
    FINAL:: Use effect 147 for moves that hit both foes and your partner

    How could I theoretically merge the effects of putting the target to sleep while the move also hits both foes and my partner? How could I interpret the attack effect table?
     

    Attachments

    • moves.txt
      437 bytes · Views: 13
    Last edited:

    Lance Koijer 2.0

    Lance Koijer
    105
    Posts
    6
    Years
  • You'll need to apply this stuff, credit to Doesnt.
    Also huge props to kleenexfeu, he helped me through this and is awesome.

    RELIC SONG
    Spoiler:


    ~EDIT~ now completely bug free yay

    This is indeed great... but it only checks Pok?mon from 0x0 to 0xFF

    I made the compare part like this
    mov r2, #0xFF
    lsl r2, r2, #0x2
    add r2, r2, #0
    cmp r1, r2

    but that didn't work...

    what if the Pok?mon's index number is 0x2CF?

    It would be nice if it supports Pokemon above 0xFF
     
    81
    Posts
    7
    Years
    • Seen today
    Some people (like me) may not have known that Volt Tackle has another effect besides recoil past generation IV. From Diamond/Pearl onward, Volt Tackle has a 10% chance to paralyze.

    To get that in FireRed, replace Battle Scrip 198 with this:
    Spoiler:


    The above routine takes into account whether the opponent is Electric Type, and if they are, bypasses the paralysis chance. You can do this with other attacks too by using these three scripts:

    Replace Battle Script 6 with this:
    Spoiler:

    This just checks the Type of the opponent, and if they are an Electric Type, just goes straight to the damage calculation script.

    Replace Battle Script 152 with this:
    Spoiler:


    Replace Battle Script 67 with this:
    Spoiler:

    This also includes the check for Stun Spore. If the opponent is a Grass Type, it will have no effect.

    Of course, I have checks for the other spore moves.

    Replace Battle Script 66 with this:
    Spoiler:


    Replace Battle Script 1 with this:
    Spoiler:


    I also have a script for "100% Accurate When Used by a Poison Type" Toxic for FireRed (there was one for Emerald but not for FireRed).

    Replace Battle Script 33 with this:
    Spoiler:


    Last but not least, in the current games, Ghost Types are no longer affected by trapping moves like Mean Look or by abilities like Shadow Tag. I haven't updated the abilities yet, but if you want Mean Look (and any move that uses its script) to not affect Ghost Types...

    Replace Battle Script 106 with this:
    Spoiler:


    Whew! That was a lot! I'm not sure if this stuff is already on here, but I wasn't able to find it anywhere. Hopefully at least one of these things haven't been posted yet haha.


    this only works for FR?
     
    Back
    Top