Aller au contenu

Photo

Numpty fx scripting


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

#1
PJ156

PJ156
  • Members
  • 2 988 messages
I have written the script below to play when the pc first enter the area with his party. He has been teleported in and I want to run a star trek style entrance.

Not working so far. Can anyone see why?

Functionally I start an conversation on enter and then run this script from the conversation (after a couple of intro screens)


* * * * * * * * * * * * * * * * * * * * * * * * * 

//Arrival fx for Beregost.
void main()
{
object oPC = GetPCSpeaker();
object oTarget = oPC;
object oHon = GetObjectByTag("hon");
object oEmb = GetObjectByTag("ember");
effect eEffect = EffectDazed();
effect heal = EffectNWN2SpecialEffectFile("sp_sonic_aoe_2",oTarget);
effect nova = EffectNWN2SpecialEffectFile("fx_cleansing_nova",oTarget);
//Apply Nova
DelayCommand(0.2f,ApplyEffectToObject(DURATION_TYPE_INSTANT,nova,oTarget));
DelayCommand(0.2f,ApplyEffectToObject(DURATION_TYPE_INSTANT,nova,oHon));
DelayCommand(0.2f,ApplyEffectToObject(DURATION_TYPE_INSTANT,nova,oEmb));
//Apply Sonic
DelayCommand(0.5f,ApplyEffectToObject(DURATION_TYPE_INSTANT,heal,oTarget));
DelayCommand(0.5f,ApplyEffectToObject(DURATION_TYPE_INSTANT,heal,oHon));
DelayCommand(0.5f,ApplyEffectToObject(DURATION_TYPE_INSTANT,heal,oEmb));
//apply daze
DelayCommand(0.8f,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 5.0f));
DelayCommand(0.8f,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oHon, 5.0f));
DelayCommand(0.8f,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oEmb, 5.0f));
oTarget = OBJECT_SELF;
DestroyObject(oTarget, 0.0);
}

* * * * * * * * * * * * * * * * * * * * * * * * * 

Help would be appreciated,

PJ

#2
PJ156

PJ156
  • Members
  • 2 988 messages
Is the line "object oPC = GetPCSpeaker();" redundant since I get the PC as oTarget or perhaps the other way round? Either way I define the Pc twice, does that matter?

PJ

#3
Bardil2

Bardil2
  • Members
  • 5 messages
Hi Pj,

Looks to me as if you may be destroying the placeable/whatever that's running the script. So the DelayCommand's won't work. At least I think that may be what your problem is.

Regards, Bardil

#4
PJ156

PJ156
  • Members
  • 2 988 messages
Ahh yes. At the start this was to fire direct off the trigger without the conversation.

Oooops and thank you :)

PJ