The PokéCommunity Forums
The PokéCommunity Forums > Fan Games > ROM Hacking > Research & Development
Development Move Animations General

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!


Reply
 
Thread Tools
  #1    
Old December 12th, 2016 (9:25 AM). Edited 4 Weeks Ago by DizzyEgg.
DizzyEgg's Avatar
DizzyEgg DizzyEgg is online now
 
Join Date: Feb 2014
Location: Poland
Age: 19
Gender: Male
Nature: Quiet
Posts: 517
I know move animations are already present in the move resource thread however I think they deserve their own.

I also made this thread, because I think it's the time we moved from animations as series of bytes to a scripting language. After all, that's how they were done. There are about 50(a bit less) commands in total and I'll go briefly about them. Note that I am not sure how some of them work.

Commands:
Spoiler:

00 loadparticle: [halfword]
Args:
Particle ID

This command lets us use particles throughout the animation script. The 'particle' is a rather small graphic that contains things like a water drop, a thunder, a note, cotton, etc. Basically particles are everything that appears on the screen while using a move. They're OAMs.

01 unloadparticle: [halfword]
Args:
Particle ID

Frees up the graphic that we loaded in the previous command. Only used in Synthesis, Revenge and Heal Bell. All other scripts do not use it, no reason why.

02 launchtemplate [word] [byte][byte] [...halfwords...]
Args:
Pointer to objtemplate structure
Unkown
Number of arguments
[Arguments]

Moving particles around, changing their size, rotating, etc. All those things are done by this command. Not directly of course, it's done by a function in the template structure which is as the following:
Code:
00000000 objtemplate     struc @ (sizeof=0x18, mappedto_243) @ XREF: ROM:stru_82F433C/r
00000000                                         @ ROM:stru_831C3C0/r ...
00000000 tiles_tag:      .short ?                @particle ID
00000002 pal_tag:        .short ?                @particle ID
00000004 oam:            .long ?                 @ offset (00000000)
00000008 image_anims:    .long ?                 @ offset (00000000)
0000000C gfx_table:      .long ?                 @ offset (00000000)
00000010 rotscale_anims: .long ?                 @ offset (00000000)
00000014 callback:       .long ?                 @ offset (00000000)
00000018 objtemplate     ends
This and the third command are the most important in move animation scripting.

03 launchtask [word][byte][byte][...halfwords..]
Args:
Pointer to an animation task
Unkown
Number of arguments
[Arguments]

Animation tasks usually modify graphically pokemon sprites and backgrounds. They're also used to get information about battle and moves(for example the turn and power). The information is usually stored in the seventh argument.

04 pause [byte]
Args:
Amount of time to wait

Simply pauses a bit.

05 waitanimation
No Args

Waits for an animation to be finished. Similar to the overworld waitstate command.

08 endanimation
No Args

Finishes the script execution.

09 playsound1 [halfword]
Args:
Song ID

Plays a sound.

0A animA [byte]
Args:
probably a bank

Used in lots of scripts. Not sure what it is for. Used at the beginnings of scripts.

0B animB [byte]
Args:
probably a bank

Appears to be a counterpart of animA. Used at the ends of scripts. Only used if animA has been called before.

0C set_BLDCNT_BLDALPHA [halfword]
Args:
value to set BLDCNT

Sets BLDCNT to 0x3F40 and BLDALPHA to the given value.

0D reset_BLDALPHA_BLDCNT
No Args

Sets both BLDALPHA and BLDCNT to 0;
Those two are LCD registers, btw.

0E call [word]
Args:
Pointer to a script

Same as in the overworld scripting we call a piece of code, it gets executed and it gets back to us. Note that we can only call one time at a time, no nested calls.

0F return
No Args

Returns to the script that called it.

10 setarg [byte] [value]
Args:
Argument ID, starting from 0
Value to set

There are 8 arguments that the script can use. Launchtask and launchtemplate use them for example for how fast to move an object or where to move it.

11 choosetwoturnanim [word] [word]
Args:
Pointer to script for the first turn
Pointer to script for the second turn

Used in two-turn moves to jump to a correct script. Note that it's used in multi-hit moves as well. Odd hits jump to the first script, even hits to second(think Double Slap and how the slap changes its position).

12 jumpifmoveturnEQ [byte] [word]
Args:
Number of turn, counted from 0
Script ptr to jump

Jumps to the given script if the hit turn is equal. Used only in Triple Kick, Swallow and Spit Up.

13 goto [word]
Args:
Script ptr to jump

Does the same what an overworld goto. Jumps to a script and continues execution from there.

14 loadBG1 [byte]
Args:
Which background to load

Changes battle background to the one given in argument. Has a very similar command hence the '1'.

15 loaddefaultBG
No Args

Changes battle background to the one default one for that terrain. Think how when you use a ghost move the background temporarily changes and goes back to normal later.

16 waitforscreenelements1
No Args

Probably waits for background to get loaded.

17 waitforscreenelements2
No Args

Same as above.

18 loadBG2 [byte]
Args:
Which background to load

Not sure what's the difference between this one and the 14th command.

19 playsound2 [halfword] [byte]
Args:
Song ID
pan

Similar to playsound1 but let's you change pan pot.

1A pancontrol [byte]
Args:
pan

Changes the pan pot to the one in argument unless you're in contests or a poke is behind substitute. Then it may change the value.

1B anim1B [halfword] [byte] [byte] [byte] [byte]
Args:
Song ID
Unkown
Unkown
Unkown
Unkown

Again, sound related.

1C soundcomplex [halfword] [byte] [byte] [byte]
Song ID
pan
How much to wait between playing sounds(note that they can play all at once or such as one starts while the other is in the middle)
Amount of times the sound will play

A more advanced version of playsound.

1D playsound3 [halfword] [byte] [byte]
SongID
pan
time to wait for the sound to play

Same as playsound2 except can set the time the sound will play.

1E set_BLDCNT [halfword]
Args:
Value to set

Sets the LCD register BLDCNT to the given value.

20 waitforsound
No Args

Seems to wait for sound to be finished, but I could be wrong on this one.

21 jumpifargmatches [byte] [halfword] [word]
Args:
Arg ID
Arg value
Pointer to script to jump

Jumps to a script if given argument is equal.

22 anim22 [byte]
Args:
Unkown

No idea.

23 anim23 [byte]
Args:
Unkown

No idea.

24 jumpifnotinbattle [word]
Args:
Pointer to a script

Jumps to a given script if we are currently not in a battle. (And that implies a move has been used during contests).

25 loadBG3 [byte] [byte] [byte]
Args:
bgID
bgID
bgID

A command created only for Guillotine. It acts the same way as loadBG1, except it chooses a background to load depending on specific conditions. It loads the background in the:
1. First argument if a move was used against an opponent's side
2. Second argument if a move was used against the player's side
3. Third argument if a move was used during contests

26 anim26 [halfword] [byte] [byte] [byte] [byte]
Args:
Unkown
Unkown
Unkown
Unkown
Unkown

No Idea.

27 anim27 [halfword] [byte] [byte] [byte] [byte]
Args:
Unkown
Unkown
Unkown
Unkown
Unkown

28 anim28 [byte]
Args:
Bank

Can do something with background priorities.

29 setBGprioritiestoBGIDs
No Args

If we're in battle, this one sets BG's 1 priority of 1 and BG's 2 priority of 2.

2A anim2A [byte]
Args:
Unkown

No idea.

2B makebankinvisible [byte]
Args:
bank

Makes a pokemon sprite invisible.

2C makebankvisible [byte]
Args:
bank

Makes a pokemon sprite visible.

2F: stopmusic
No Args

Appears to stop music.


Now some terms I've used while explaining commands not everyone may get.
Spoiler:

Bank - used to distinguish the animation attacker(0) and target(1). Note that both may be the same in moves like Harden, etc.
Animation Arguments - an array of 8 halfwords that's used in various commands. In Emerald the location is at 0x0203841E
Task - a function that gets executed repeatedly every frame until it's stopped.
Pan - in sound functions, a value between -126 and 127. The smaller it is, the more sound is going to play in the left speaker, similarly the higher the value the more intense the sound will be in the right speaker


All offsets below are for Emerald.

A list of all move animation tasks that are used: (Soon to add descriptions on what they do)
Spoiler:

Animation Tasks:
0x80d51ad
0x8116621
0x80d52d1
0x8117e61
0x815a8c9
0x8115f11
0x80d5831
0x8115d95
0x810ded9
0x80d5739
0x80d5db1
0x80d5eb9
0x80d6065
0x80d5485
0x80d6135
0x8117661
0x80d5c51
0x8104c39
0x8104ca5
0x8158e9d
0x8159079
0x8102be9
0x8102ca1
0x81045b1
0x8115a05
0x81076c9
0x8107955
0x8158c59
0x8117755
0x815a505
0x8107529
0x80d622d
0x810eb89
0x81114ed
0x811152d
0x8111591
0x80d5645
0x80fea59
0x810a7dd
0x810a095
0x81152dd
0x8115629
0x8114cbd
0x8114f15
0x810f7d5
0x81169c1
0x80a7b99
0x80d6389
0x810f83d
0x811188d
0x80ff459
0x81029b5
0x81144f9
0x8104675
0x815a161
0x8159279
0x8115c81
0x81036a1
0x811489d
0x815b339
0x810c0a1
0x8158b31
0x8101c95
0x815e115
0x81064f9
0x815e47d
0x81177ad
0x8116665
0x81136e9
0x8159245
0x8159211
0x81137e5
0x815b7d1
0x80fee1d
0x8117495
0x8104939
0x815d241
0x81022d5
0x815f20d
0x8104e75
0x8111c51
0x8112759
0x8116b15
0x815c771
0x81023e1
0x8111e51
0x80a8bc5
0x8117f61
0x8113889
0x81123c5
0x8110bcd
0x815c479
0x8110f75
0x8104ab5
0x8107145
0x8107169
0x81062e9
0x8105cb5
0x8105d61
0x815f8a1
0x815a905
0x80a8141
0x815c3a9
0x815ca21
0x8115601
0x815abed
0x8116961
0x815ac8d
0x815adb1
0x815bb85
0x80a7a75
0x81025c1
0x8107189
0x8115b0d
0x810577d
0x8105811
0x8105aad
0x810599d
0x8105eb1
0x8106021
0x8106d91
0x815b65d
0x815b6b5
0x815b779
0x8116849
0x810a061
0x8109dbd
0x810c919
0x815aff1
0x81143c1
0x8113bad
0x8114471
0x8113e79
0x815dca5
0x815df0d
0x815e841
0x810aafd
0x815ec49
0x81060b1
0x815ced9
0x815d64d
0x8109461
0x810fbf1
0x810f941
0x815dfcd
0x8112c6d
0x8117c25
0x81007c5
0x811675d
0x815a5c9
0x810c325
0x8160165
0x810cdfd
0x8160545
0x81590b9
0x81162a5
0x81604f1
0x8103cf1
0x8117c45
0x8117ca1
0x8117dd9
0x8117d3d
0x8117c71
0x815f621
0x8117781
0x8117611
0x81080e5
0x81085c9
0x810fe15
0x8110035
0x810dabd
0x80a9ef5
0x8158d8d
0x810afcd
0x810ae5d
0x81088e5
0x81177e5
0x80fffc1
0x81133e9
0x80a7cb5
0x810b29d
0x810b55d
0x8114961

Similarly a list of all templates:
Spoiler:

Templates:
0x8597358
0x8595e68
0x8595e98
0x8597274
0x8595f48
0x859728c
0x85934d8
0x85934f0
0x8595368
0x8595380
0x8595ae8
0x8595ad0
0x8595b68
0x8595b80
0x85956c0
0x85ce020
0x8593590
0x85935d0
0x8593550
0x85962d4
0x8593380
0x8592a1c
0x8596270
0x85962a4
0x857fe70
0x857fe58
0x85963d4
0x8596340
0x8596358
0x85928d0
0x857fe28
0x85928e8
0x8595f60
0x8595eb0
0x8595e80
0x8595ee0
0x85971a8
0x8592cd8
0x85973e8
0x8592f44
0x857fe40
0x8596a44
0x8596240
0x8597370
0x8596a5c
0x85ce150
0x8597080
0x85ce7d4
0x8593008
0x8593428
0x8593398
0x853ee84
0x85961c0
0x859620c
0x85954d4
0x85954ec
0x8595158
0x8595c2c
0x8595208
0x8597388
0x8595220
0x85950e4
0x8595b2c
0x8595b14
0x8595b98
0x8595bb0
0x859663c
0x8595068
0x8596258
0x85950b4
0x8592288
0x8596cb0
0x8592270
0x8592f2c
0x85922bc
0x8592390
0x85923d8
0x85921e0
0x85921f8
0x8592148
0x8592130
0x8592118
0x859231c
0x8592334
0x85969f8
0x85969e0
0x8596f80
0x8596f28
0x8596b88
0x8595810
0x85957e0
0x85957f8
0x8595840
0x85972d8
0x8596b04
0x85971fc
0x8597214
0x8596134
0x859368c
0x85924dc
0x8593440
0x85ce050
0x85ce038
0x8596d14
0x8596d2c
0x85ce338
0x85965a8
0x8596560
0x8596624
0x8596578
0x85965f4
0x8592d8c
0x8593114
0x85931bc
0x859371c
0x8593488
0x8596d8c
0x8595c44
0x85961a8
0x8597190
0x859551c
0x859556c
0x8595238
0x8595250
0x8597098
0x8592404
0x857fe88
0x8592494
0x8596744
0x85966dc
0x8593344
0x85937b0
0x859381c
0x8593a84
0x8595c9c
0x85969c8
0x8593af0
0x8593ac0
0x8596514
0x8595f78
0x85922ec
0x8595170
0x8593b38
0x8597178
0x8592c88
0x85ce1dc
0x8592de4
0x8592e74
0x85ce2f8
0x8595410
0x8592f74
0x8592d2c
0x8593b80
0x85936d4
0x8596a2c
0x85ce07c
0x85ce094
0x85ce0ac
0x8595584
0x85936ec
0x8596dd0
0x8596de8
0x85973a0
0x8592ea4
0x85ce5d8
0x8595bc8
0x8592adc
0x8593aa8
0x85939b8
0x859309c
0x8593068
0x85961d8
0x85971cc
0x8592dfc
0x8592e30
0x85ce11c
0x8595764
0x8595790
0x85ce8c4
0x8593c0c
0x8593c24
0x8595c04
0x8592ca0
0x8592cb8
0x8596e7c
0x8596ba0
0x8593970
0x8592d44
0x8592d5c
0x8593658
0x8592b3c
0x859574c
0x85ce104
0x85939a0
0x85939d0
0x85ce190
0x8593938
0x8593958
0x8592b94
0x8593868
0x8592610
0x8592658
0x85ce4d0
0x8593c64
0x85ce590
0x8595428
0x85953f8
0x8596974
0x8596ef4
0x85ce370
0x85ce22c
0x85ce244
0x85ce25c
0x85ce288
0x85ce544
0x8597138
0x85ce48c
0x8592b7c
0x8592ebc
0x8592eec
0x8593a04
0x8593a1c
0x8595ec8
0x85973d0
0x85923a8
0x8596cc8
0x85954a0
0x8596590
0x8596548
0x85973b8
0x8596c10
0x8596d58
0x8596b1c
0x8596b70
0x8593898
0x8593bb8
0x8592244
0x8593a50
0x85ce418
0x85ce5c0
0x85ce5a8
0x859563c
0x859566c
0x8596104
0x85ce864
0x85ce894
0x85931d4
0x859595c
0x859598c
0x859324c
0x85ce8ac
0x85926e8
0x85ce388
0x85ce804
0x859254c
0x859258c
0x8595fec
0x8596004
0x859601c
0x85965c0
0x85ce9b0
0x8596088
0x85960d0
0x8597400
0x8595f90
0x8595fa8
0x85ce68c
0x85ce984
0x85955e8
0x85967ac
0x8592888
0x85950fc
0x8596490
0x85964cc
0x85964e4
0x8596034
0x8596ac8
0x8596898
0x8595c70
0x8596388
0x8593050
0x8595f14
0x85971e4
0x8595de4
0x8595dfc
0x8593880
0x85951c0
0x85951d8
0x85ce8dc
0x853ee38
0x853ee50
0x859559c
0x8595328
0x8596ce0
0x8595d44
0x85927ac
0x85927c4
0x85970e8
0x8592a34
0x8596fb0
0x8596c58
0x8592830
0x8592848
0x8592860
0x8593458
0x8595114
0x859512c
0x8596b34
0x859351c
0x8596a74
0x85ce90c
0x8592564
0x8596420
0x859644c
0x85959a4
0x8593850
0x8596f98
0x8596c98
0x8595a18
0x85952f8
0x8593470
0x8596920


Now, I'd like to give you the most important thing in this post that I believe could make animation scripting MUCH much easier. And that is all move animation scripts decompiled. Link
They were decompiled in Emerald, but they look the same in other games, the difference being offsets.
I also attached the file in case someone can't get pastebin to work.

How to write scripts using those commands?
There is no script editor that supports custom commands, but it doesn't mean we have to write our scripts in hex. We can use ASM for that. Here's a file that contains macros for all the commands. All you'd have to do is include it at the top of your ASM file(or just copy the contents of it) and use the commands.
Example:
Spoiler:

Code:
.text 

.thumb 

.align 2

.include "anim_macros.s"


SCALD_animation:

 loadparticle 0x27A2
 loadparticle 0x27AB
 anim1A 0x3
 set_BLDALPHA_BLDCNT 0x80C
 launchtask 0x08116620 + 1 0xA 0x5
 .hword 0x01, 0x0, 0x0, 0x09, 0xA1F
 anim1A 0x1
 anim28 0x1
 set_BLDALPHA_BLDCNT 0x80C
 pause_cmd 0x1
 call_cmd 0x082CC1AD
 launchtask 0x08116620 + 1 0xA 0x5
 .hword 0x4, 0x5, 0x0, 0x9, 0x1F
 launchtask 0x080D5EB8 + 1 0x5 0x5
 .hword 0x1, 0x2, 0x3A00, 0x1A, 0x1
 call_cmd 0x082CC1AD
 call_cmd 0x082CC1AD
 waitanimation
 launchtask 0x08116620 + 1 0xA 0x5
 .hword 0x4, 0x4, 0x9, 0x0, 0x1f
 launchtask 0x08116620 + 1 0xA 0x5
 .hword 0x1, 0x1, 0x9, 0x0, 0xA1F
 call_cmd 0x082D7AE2
 waitanimation
 anim1B 0x1
 reset_BLDALPHA_BLDCNT
 endanimation


With that in mind I think that if we figured out what every command, task and template does we could easily write scripts for all moves past gen3.

If you have questions, wrote a script or researched a command/task/template please post it here.
Attached Files
File Type: txt anims.txt‎ (291.1 KB, 18 views) (Save to Dropbox)
__________________
Make Emerald Great Again

My works:
Battle Engine Upgrade
Pokemon Expansion
Items/TMs/Tutors Expansion
Various Features(Evo Methods, BW Repel, Levels Above 100, Trainers with EV, Nature Colored Stats)

Emerald Features:
Form Changes (KDS)
Reply With Quote

Relevant Advertising!

  #2    
Old December 12th, 2016 (1:09 PM).
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
For anyone wondering, you can find some additional documentation including FireRed addresses here:
https://www.pokecommunity.com/showthread.php?t=354621

For the list of tasks as well as templates which Dizzy has posted, they were made on a case by case basis for each move so there are no tables containing these functions. Additionally, if you made a new animation script, you would be forced into reusing the tasks which GameFreak had coded, or making your own task for the object's animation.

The current move animation system seems quite poor for making new move scripts as they use a setup overly complex to achieve something simpler. I think you can make more leverage with this if you reworked the task's object transformation operations into a scripting system as well.
__________________
...
Reply With Quote
  #3    
Old December 13th, 2016 (12:11 AM).
hashtag's Avatar
hashtag hashtag is online now
DSC
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 21
Gender: Male
Nature: Sassy
Posts: 9,407
HAVE A STICKY
__________________
Reply With Quote
  #4    
Old 4 Weeks Ago (4:59 AM).
MrDollSteak's Avatar
MrDollSteak MrDollSteak is offline
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 21
Gender: Male
Posts: 794
Crazy good stuff!

I made a move, I believe it was Flash Cannon use a custom loaded object template, or an edited one at least, to slightly change its size and/or trajectory I don't even remember. Maybe have a look at that in the moveanimations.s file Dizzy to see if theres an easier way to automate that process too.
__________________
Reply With Quote
  #5    
Old 4 Weeks Ago (10:18 AM).
DizzyEgg's Avatar
DizzyEgg DizzyEgg is online now
 
Join Date: Feb 2014
Location: Poland
Age: 19
Gender: Male
Nature: Quiet
Posts: 517
Quote:
Originally Posted by MrDollSteak View Post
Crazy good stuff!

I made a move, I believe it was Flash Cannon use a custom loaded object template, or an edited one at least, to slightly change its size and/or trajectory I don't even remember. Maybe have a look at that in the moveanimations.s file Dizzy to see if theres an easier way to automate that process too.
What process you're talking about?
__________________
Make Emerald Great Again

My works:
Battle Engine Upgrade
Pokemon Expansion
Items/TMs/Tutors Expansion
Various Features(Evo Methods, BW Repel, Levels Above 100, Trainers with EV, Nature Colored Stats)

Emerald Features:
Form Changes (KDS)
Reply With Quote
  #6    
Old 4 Weeks Ago (1:36 PM).
MrDollSteak's Avatar
MrDollSteak MrDollSteak is offline
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 21
Gender: Male
Posts: 794
Quote:
Originally Posted by DizzyEgg View Post
What process you're talking about?
I think its how to program the movement / size of the particle. For example with Flash Cannon I believe what I did was take the object movement from another animation but changed one of the bytes to make it bigger and / or faster. Sorry for not being more specific I'll try and explain more soon.
__________________
Reply With Quote
  #7    
Old 4 Weeks Ago (7:02 PM).
FBI's Avatar
FBI FBI is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,680
So what MrDollstead did was edit the object template to adjust the size, and then assign a different task. As you should know the Object Template is a template for the Object system to initialize an Object, and ofcourse that has an OAM field for you to scale the size. However, speed and direction are not controlled by the Object template, and rather the task.

I think you ought to make a central task for the animations and include time dependent positional delta vectors for movement and utilize GameFreak's animation scripting system for OAM animation (actually the system currently does make use of this) in addition to the rotscale scripting system (system does not make use of this).

Because the tasks themselves are doing the scaling and rotation, rather than through the script system. However, there is a good reason for this, and that reason is because there is no way to distinguish which instruction of the rotation/scaling script is currently running. So adjustments of vector positions and influencing movement based of the rotation is impossible normally.

There is a very easy solution, and that is to assign a task to assign rotation scripts one instruction at a time, while simultaneously adjusting position vectors. This is what I mean when I say make a new scripting system for animations. You want to combine both the animation script engine and the rotscale script engine GF has made in addition to the task system for positional updates. Ideally incorporating BGs as well. The result is an easy to use animation script system which abstracts all of the matrix and trigonometric calculations while maintaining nearly the same functionality (taking a minor speed hit of 1 frame per animation phase shift).

The downside is that it takes up a comparably larger amount of ROM space depending on the permutations of the rotscale scripts you plan to have and the length of the animation. You would need to somehow push the C2 callback, execute the script callback, pop C2 back and finish executing C2 (or you can make a very inefficient C2, but you would take a performance and potential FPS penalty).

I think most of this would become clear after I make another tutorial soon(TM).
__________________
...
Reply With Quote
  #8    
Old 4 Weeks Ago (7:10 PM).
MrDollSteak's Avatar
MrDollSteak MrDollSteak is offline
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 21
Gender: Male
Posts: 794
Quote:
Originally Posted by FBI View Post
So what MrDollstead did was edit the object template to adjust the size, and then assign a different task. As you should know the Object Template is a template for the Object system to initialize an Object, and ofcourse that has an OAM field for you to scale the size. However, speed and direction are not controlled by the Object template, and rather the task.

I think you ought to make a central task for the animations and include time dependent positional delta vectors for movement and utilize GameFreak's animation scripting system for OAM animation (actually the system currently does make use of this) in addition to the rotscale scripting system (system does not make use of this).

Because the tasks themselves are doing the scaling and rotation, rather than through the script system. However, there is a good reason for this, and that reason is because there is no way to distinguish which instruction of the rotation/scaling script is currently running. So adjustments of vector positions and influencing movement based of the rotation is impossible normally.

There is a very easy solution, and that is to assign a task to assign rotation scripts one instruction at a time, while simultaneously adjusting position vectors. This is what I mean when I say make a new scripting system for animations. You want to combine both the animation script engine and the rotscale script engine GF has made in addition to the task system for positional updates. Ideally incorporating BGs as well. The result is an easy to use animation script system which abstracts all of the matrix and trigonometric calculations while maintaining nearly the same functionality (taking a minor speed hit of 1 frame per animation phase shift).

The downside is that it takes up a comparably larger amount of ROM space depending on the permutations of the rotscale scripts you plan to have and the length of the animation. You would need to somehow push the C2 callback, execute the script callback, pop C2 back and finish executing C2 (or you can make a very inefficient C2, but you would take a performance and potential FPS penalty).

I think most of this would become clear after I make another tutorial soon(TM).
Cheers FBI, summed it up a lot better than I could. I made the animation a while ago and sort of forgot exactly what I did. But yes the pointers there all seem a bit unoptimised having certain tasks being linked to certain sizes, though there is obviously the capability to improve this.
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:36 AM.