Aller au contenu

Photo

burning incence to once again apeal to you mighty script gods...


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
christinetooley

christinetooley
  • Members
  • 58 messages
 ok, so i am trying to freeze an npc animation to create statues in various poses. i found a couple complex scripts for doing something similiar but cant rip out the parts i need and compile correctly. i know how to make npc freeze on spawn but not how to make them freeze in an animated position. Any help would be greatly appreciated.  right now they look like dim wits who wandered into maduses lair said "hi gorgeous" and froze. thanks in advance!

#2
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
Look at this thread. Mithradates script should work for you.

Regards

Modifié par Kaldor Silverwand, 04 mai 2011 - 07:00 .


#3
christinetooley

christinetooley
  • Members
  • 58 messages
Oh for the love of Bioware! I actually got my statue script from Mithradates and didnt see this nice little addition! Thank you so much Kaldor for being more observant than me!

#4
christinetooley

christinetooley
  • Members
  • 58 messages
My star and garters! I've input this script into spawn and get nothing! Little more help maybe?

void WrapperStatue(){
effect ePet=EffectPetrify();
ePet=EffectLinkEffects(EffectVisualEffect(VFX_DUR_SPELL_STONESKIN),ePet);
ePet=SupernaturalEffect(ePet);
ePet=SetEffectSpellId(ePet,-100); //Set it to something unique so you can easily remove the effect later if you need to
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePet, OBJECT_SELF);
SetBumpState(OBJECT_SELF, BUMPSTATE_UNBUMPABLE);
SetCommandable(FALSE,OBJECT_SELF);
SetPlotFlag(OBJECT_SELF,TRUE); //If you want the creature to be destructable you don't need this line.
}
void main()
{
PlayCustomAnimation(OBJECT_SELF, "clapping", 1, 1.0);
DelayCommand(0.5, WrapperStatue());
}

#5
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
I always used my own scripts (which are also in that thread), but mine don't do anything with the animations. I'll take a closer look at his tonight. Probably something simple.

Regards

#6
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
Try this script:

// bb_statue_sp
// by Brendan Bellina
// June, 2008
// Updated 4/11 to allow animation before being hardened
// (inspired by Mithdradates' idea in this thread <http://nwn2forums.bi...2608&forum=114>)
// For more on playing animations see this thread <http://nwn2forums.bi...3781&forum=113>

// Based partly on gb_statue_sp

// Use this to spawn a creature in as a statue or frozen.

// Set creature variables:
// str SpawnScript to this script
// int InAbnormalState to 1 (stone) or 2 (frozen) (default is frozen)
// str ud_script to a user defined script like bb_unstatue_ud to allow reversal
// int HardeningAnimation to the int of an animation to play briefly before hardening (default is none) (see ANIMATION_* globals)

// In the creature conversation have the first node of the conversation exit if InAbnormalState is not 0

// Creatures should be set to a neutral faction so that cannot be attacked by anyone,
// and should be set to Plot so that they cannot be harmed. Use the local object variables
// SetHostile and PlotOff in conjunction with the bb_unstatue_ud script to make them
// unfrozen, hostile, and attack. bb_unstatue_ud will also use a local variable UnstatueScript
// to call a script like bb_startconv (to initiate a conversation) or other scripts.

#include "NW_I0_GENERIC"

void hardenCreature(object oTarget)
{
// Get the following local int from the creature to determine the initial state
int nAbnormalState = GetLocalInt(oTarget, "InAbnormalState");

if (nAbnormalState == 1) // if stone
{
effect eStoneskin = SupernaturalEffect( EffectVisualEffect( VFX_DUR_SPELL_FLESH_TO_STONE ) );
ApplyEffectToObject( DURATION_TYPE_PERMANENT, eStoneskin, oTarget );
}

if (nAbnormalState == 1 || nAbnormalState == 2 || !nAbnormalState) // if stone or just frozen
{
// This is needed to keep the creature from moving around
effect eFreeze = SupernaturalEffect( EffectVisualEffect( VFX_DUR_FREEZE_ANIMATION ) );
ApplyEffectToObject( DURATION_TYPE_PERMANENT, eFreeze, oTarget );

// Needed to prevent turning when spoken to
SetOrientOnDialog(oTarget, FALSE);

// Needed to prevent moving when bumped into
SetBumpState(oTarget, BUMPSTATE_UNBUMPABLE);
}
}

void main()
{
object oTarget = OBJECT_SELF;
int nAnimation = GetLocalInt(oTarget, "HardeningAnimation");
if (nAnimation)
{
float fDelay = 5.0;
AssignCommand(oTarget, DelayCommand(fDelay, PlayAnimation(nAnimation,1.0)));
AssignCommand(oTarget, DelayCommand(fDelay + 2.0, hardenCreature(oTarget)));
}
else
{
hardenCreature(oTarget);
}
}

I could only get it to work by building in some delays. It seems to work with the talk forceful animation (11). To make this work use the standard spawn script on your creature. Then set the following variables on the creature:
str SpawnScript = bb_statue_sp
int InAbnormalState = 1
int HardeningAnimation = 11 (or whatever other ANIMATION_* global you want to try)

Animations seem to be problematic at best. For more info on them see this thread.

Hope this helps.

Regards