PDA

View Full Version : [TSL]Inserting animation in scripts.


oldflash
07-31-2006, 05:32 AM
I make a useable item (after darth333's and chanintz.2da's utility devices - thanks) and set to fire this script

void main()
{
ClearAllActions();
ClearAllEffects();
object oPC = GetFirstPC();
int nHealAmount = GetMaxForcePoints(oPC) - GetCurrentForcePoints(oPC);
int nHealAmount2 = GetMaxHitPoints(oPC) - GetCurrentHitPoints(oPC);
while ( (nHealAmount + nHealAmount2) > 0 ) {
{
if( nHealAmount > 0 )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHealForcePoints( nHealAmount ),oPC);
}
if( nHealAmount2 > 0 )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal( nHealAmount2 ),oPC);
}
}
}
}

The initial reason for that was to clear all forceppowers effect, all visual effect (shields) and to regenerate fast hp and fp.
The effect is instant.
I have try to insert a animation (play meditate animation for few seconds) without succes. When I activate the item also pc play "use force" animation which I don't want it. All I want is to have a pc which play meditate animation (and if is possible some visual effect to suggest revitalize) for 5 sec before or after this script is executed.
Right now I use this to cheat. :)

Thanks.

stoffe
07-31-2006, 07:11 AM
I make a useable item (after darth333's and chanintz.2da's utility devices - thanks) and set to fire this script
(...snip...)
The initial reason for that was to clear all forceppowers effect, all visual effect (shields) and to regenerate fast hp and fp.
The effect is instant.
I have try to insert a animation (play meditate animation for few seconds) without succes.
When I activate the item also pc play "use force" animation which I don't want it.


Try this variant, it should make the player sit down and meditate briefly as well. As far as I know you can't get rid of the "activate" animation when you trigger an object tied to a "spell", i think that is hardcoded since the "cast" animations set in spells.2da only seem to be used if you cast it as a force power. Thus the character will first do the activation animation and then sit down and meditate right afterwards.


void main() {
object oPC = GetSpellTargetObject();

AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ClearAllEffects());

int nHealAmount = GetMaxForcePoints(oPC) - GetCurrentForcePoints(oPC);
if( nHealAmount > 0 )
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHealForcePoints(nHealAmount), oPC);

nHealAmount = GetMaxHitPoints(oPC) - GetCurrentHitPoints(oPC);
if( nHealAmount > 0 )
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHealAmount), oPC);

DelayCommand(1.0, AssignCommand(oPC, ActionPlayAnimation( ANIMATION_LOOPING_SIT_AND_MEDITATE, 1.0, 6.0 )));
}

oldflash
07-31-2006, 07:26 AM
Thank stoffe -mkb- I will use this.

Edit: It works perfect. Thanks again.

Lit Ridl
08-01-2006, 05:41 AM
I'll use it too. Thank you too!