PDA

View Full Version : Animations: The Case for Insanity


Dashus
11-11-2005, 11:18 PM
You'd think that after working on this bloody mod of our's for 8 months (!) we'd have figured out the whole animation thing. But apparently not. I'm trying to get a bunch of HK51's to activate and step forward sequentially.


void main(){
int i = -1;
object oHK51;
vector hkPos;
while( ++i < 10 ){
oHK51 = GetObjectByTag( "HK51deac", i );
DelayCommand( i + 1.0f, AssignCommand( oHK51, ActionPlayAnimation( ANIMATION_FIREFORGET_ACTIVATE ) ) );
hkPos = GetPosition( oHK51 );
DelayCommand( i + 2.0f, AssignCommand( oHK51, ActionMoveToLocation( Location( Vector( hkPos.x, hkPos.y - 2, hkPos.z ), 0.0f ) ) ) );
}
}

This code works randomly. Sometimes they'll work flawlessly and other times they mock me by doing absolutely nothing. Is there a specific animation I can play that will always work? Am I overloading the engine with this many delays? I've verified that all the units are valid (GetIsObjectValid)

Darth333
11-12-2005, 11:50 AM
The animation is fine. The problem seems to be with the delays. I just made a test and it works all the time with this (unfortunately the result is not the same):

DelayCommand( 1.0, AssignCommand( oHK51, ActionPlayAnimation( ANIMATION_FIREFORGET_ACTIVATE ) ) );
hkPos = GetPosition( oHK51 );
DelayCommand( 2.0, AssignCommand( oHK51, ActionMoveToLocation( Location( Vector( hkPos.x, hkPos.y - 2, hkPos.z ), 0.0f ) ) ) );

I've tried a couple more things to get to what you want but the results are the same: the script seems to fire randomly :giveup:

Darkkender
11-12-2005, 12:28 PM
Could it be possibly caused by the location of where you are firing the script from. Such as a trigger that is too small or something. I have noticed in K1 and K2 that they rarely have more than 3 of the same utc characters spawned and controlled at the same time in the game. Frequently if they have more than 3 Sith in a scene they have more than one UTC type. So your hunch that it may be overloading the game engine may be correct. Try breaking your HK51's down into 3 seperate utc's to be cloned and controlled. That may be the solution to your problem or I could be all wet.