The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Setting Person Events to specific OW frames (https://www.pokecommunity.com/showthread.php?t=357590)

Dystendo October 25th, 2015 4:37 PM

Setting Person Events to specific OW frames
 
Is there a simple way to set an OW sprite to a specific frame? Say I wanted to change a trainer OW to change to one of their mid-step frames after the player talks to them, until the map is exited.

Like this frame of this OW for example:
http://i58.tinypic.com/anhcar.jpg

Is there a way to script that OW to change to that frame? I tried spriteface for different values but it didn't work. Is there maybe a way to do it with applymovement?

Thanks in advance.

BrandoSheriff October 26th, 2015 8:47 AM

A simple but slightly weird solution would be to export that frame you want to show, then re-import it over frame 1 so no other work would be required. Though this doesn't work if you plan to have that sprite walk around. xD

Dystendo October 26th, 2015 12:04 PM

Quote:

Originally Posted by Darkrai Lv.1000 (Post 8976940)
A simple but slightly weird solution would be to export that frame you want to show, then re-import it over frame 1 so no other work would be required. Though this doesn't work if you plan to have that sprite walk around. xD

Yeah I considered this, and I'll probably just use multiple OW's if I can't find a solution.

I essentially just want to access all frames of an OW so that I can script custom animations easier.

Touched October 27th, 2015 10:12 PM

It's possible if you want to get your hands dirty with some ASM. You basically need to get your hands on the NPC data, find the associated sprite and manually set the active frame. It's pretty much what the ice sliding "animation" does. It's actually the walking animation stuck on the frame with one foot forward. I wouldn't say the ASM involved is too difficult, but you need to be able to call engine functions and work with the RAM, so you need a fair amount of literacy.

Dystendo October 28th, 2015 4:03 AM

Quote:

Originally Posted by Touched (Post 8978555)
It's possible if you want to get your hands dirty with some ASM. You basically need to get your hands on the NPC data, find the associated sprite and manually set the active frame. It's pretty much what the ice sliding "animation" does. It's actually the walking animation stuck on the frame with one foot forward. I wouldn't say the ASM involved is too difficult, but you need to be able to call engine functions and work with the RAM, so you need a fair amount of literacy.

Thanks for the informed reply,

I'm comfortable with ASM in general but not GBA ASM in particular. Looking at DavidJCobb's RAM map, it says that OW data starts at 0x02036E5C. Having played with the memory viewer a little I don't particularly see where explicit frame parameters are. Is there documentation on OW data structures in the RAM?

Thanks again.

Touched October 28th, 2015 10:29 AM

Quote:

Originally Posted by Dystendo (Post 8978693)
Thanks for the informed reply,

I'm comfortable with ASM in general but not GBA ASM in particular. Looking at DavidJCobb's RAM map, it says that OW data starts at 0x02036E5C. Having played with the memory viewer a little I don't particularly see where explicit frame parameters are. Is there documentation on OW data structures in the RAM?

Thanks again.

You probably want to get yourself a copy of IDA Pro and the Fire Red IDB (in my signature), as it is thousands of times more complete than the tiny RAM maps we have here. It has many structures documented, as well as function names and memory addresses so it's an indispensable tool if you want to do ASM hacking.

The thing I was talking about is (as you said) at 02036E38. There are 16 "npc_states", each 0x24 bytes in size. The byte at offset 4 inside the structure is the object id, which is an index in the objects list at 0202063C. Each object is 0x44 bytes in size and corresponds to a hardware sprite in the GBA OAM. The byte at offset 0x2B in this is the animation frame, while 0x2A is the animation number (I think this corresponds roughly to applymovement values for NPCs).

Also, you might want to look at a function which takes a person iD (from advance map) and translates it to an npc_state index, such as the function at 0805DF60.

Lastly, offset 1 in the NPC states gets logical ORed with 4 when doing the ice sliding animation, so that might be worth a look.


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