• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Red, Kris, May - which Pokémon protagonist is your favorite? Let us know by voting in our semifinal favorite protagonist poll!
  • 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.

[Script] How do you get the move ID of a Pokemon?

So, while programming, I have ran into a (fairly important) problem. I am here to ask the community for a solution.
How would I get a move Id of the move I select with special 0xDC? I have looked all around for this and the closest I got was this: https://www.pokecommunity.com/threads/168600 , however I cannot/don't know how to get the move Id of the move I select from the special. Any help would be great.
 
according to JPANs thread on specials, I believe you would set variable 0x8004 to a specific pokemon slot (0x0-0x5), and then use special2 0x8005 0xDC to open the move menu screen. Selecting a move should store the move position into variable 0x8005.

It appears to be a move reminder/deleter special so I'm not sure if there is an inherent special to get this move ID, I believe it just stores the slot number of the selected move into 0x8005. But, you could write an assembly routine to then load the appropriate move from the pokemon data using the Get Attribute function. Let me know if you need help writing the assembly :)
 
Last edited:
I have already used special 0xDC, however, like you said, it returns to 0x8005 the move position. I need the move ID. I may be able to edit a little bit of ASM, but I cannot write it (I have already done tutorials on ASM, however not for pokemon, and only a small portion). If there is a special I can use to get the move ID or if anyone can tell me where the move ID is stored when I use callasm on the pokemon data decipher code, it would be appreciated.
Here is my example script of what I want:
Code:
#dynamic 0x800000
#org @start
faceplayer
lock
special 0x9F
//special to bring up menu
waitstate
special2 0x8005 0xBA
//special to read pokemon number from the position stored to 0x8004
compare 0x8005 0x0
//If pokemon if bulbasaur
if 0x1 goto @bulbasaur
release
end
#org @bulbasaur
special 0xDC
//Displays move menu of pokemon in the party position of 0x8004
//Here is where I want to get the moveID of the move slot on 0x8005 of the pokemon on 0x8004
compare 0x8005 0x1
//If move is pound
if 0x1 goto @pound
buffernumber 0x8005
msgbox @test 0x6
release
end
#org @pound
msgbox @test2 0x6
release
end
#org @test
= That's not pound, thats [buffer1],
#org @test2
= That's...!\pThat's pound! Finally, after\nall this time! Thank you.
 
No problem, I may use something similar like this in the future so I wrote up a simple routine. Fair warning: I haven't tested it, so you'll have to let me know if it works. I heavily commented it to help you get the hang of assembly.

I wasn't sure if special 0xDC returned the move position as 0x0-0x3 or 0x1-0x4. If the latter, you'll have to add a line to the routine (specifics in the comments)

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r2, lr}
	ldr r0, .var8005
	ldrb r0, [r0]                      @r0 = selected move position
	mov r1, #0xD                  @r1 is the attribute to "decrypt" move IDs are between 0xD-0x10
	add r1, r1, r0				@get move ID of attack (1+0x8005 value) - if special 0xDC returns 0x1-0x4 instead of 0x0-0x3, add a sub r1, r1, #0x1 below this line
	ldr r0, .var8004
	ldrb r0, [r0]                  @get selected pokemon's slot number (0x0-0x5)
	mov r2, #0x64
	mul r0, r0, r2                @100*slot#
	ldr r2, .PartyPoke         @address for first pokemon in your party
	add r0, r2, r0                @r0 = address of selected pokemon
	ldr r2, .GetAttr
	bl linker					@store move ID in r0
	ldr r1, .var8006			@change to .var8005 if you want to store the moveID back in 0x8005 instead
	strh r0, [r1]                     @store move ID in var 0x8006
	pop {r0-r2, pc}
	
linker:
	bx r2

.align 2
.var8005:	.word 0x020370C2
.GetAttr:	.word 0x0803FBE9
.var8004:	.word 0x020370C0
.PartyPoke:	.word 0x02024284
.var8006:	.word 0x020370C4

Hope this helps!
 
Back
Top