Page 1 of 1

Effects scripting on Levelup

Posted: Tue Jun 24, 2003 2:53 pm
by Neve
Hi,

I tried lots of different things to get a special effect on the place of the player who levels up, but no effect appears. Anyone knows what I'm doing wrong ? This is the line of code I made last :

void main()
{
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3), GetLocation(GetPCLevellingUp()), 1.5);
}

It -should- create a summon creature effect...

Posted: Tue Jun 24, 2003 3:53 pm
by Aloro
Hey there. I've found NWScript gets a bit unreliable when nesting commands (especially effects), so I would separate out your function calls, e.g.

Code: Select all

void main() 
{ 
    object oPC = GetPCLevellingUp();
    location lPC = GetLocation(oPC);
    effect eFX = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
    ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eFX, lPC, 1.5); 
} 
- Aloro

Posted: Tue Jun 24, 2003 6:50 pm
by Neve
Hm, I just tried it, but it didn't work either... Could it be my NWN is a bit messed up ? Recently I found the Campaign button to be captionless :?

I made a script which randomly blasts lightning around, with about the same commands, and that one works, it's pretty annoying, because I saw it's possible in Mythos, and it looks very cool.

Posted: Tue Jun 24, 2003 7:07 pm
by Jordicus
you could probably use this:

Code: Select all

 object oPC = GetPCLevellingUp(); 
and change ApplyEffectAtLocation to ApplyEffectToTarget (something like that...) instead..

i've noticed certain effects will not work on locations, only on targets.

Posted: Tue Jun 24, 2003 7:10 pm
by Neve
Random lightningblasts :

Code: Select all

void main()
{
    object oLightning = GetObjectByTag("BLASTMARKER" + IntToString(d10()));
    location oStrike = GetLocation(oLightning);

    if (Random(3)-2)
    {
        effect Zap = EffectVisualEffect(VFX_IMP_LIGHTNING_M);
        location Thespot = Location(GetArea(oLightning), GetPosition(oLightning), GetFacing(GetFirstPC()));
        ApplyEffectAtLocation(DURATION_TYPE_INSTANT, Zap, Thespot, 1.0);
  }
}
All you have to do is place upto 10 waypoints and tag them as "BLASTMARKER1", "BLASTMARKER2" etc. Paste this in the OnHeartbeat of the desired area and you're finished. Feel free to use it too 8)

Posted: Tue Jun 24, 2003 7:15 pm
by Neve
Hm...

Code: Select all

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFX, oPC, 1.5);
Didn't work either...

Posted: Tue Jun 24, 2003 7:31 pm
by Jordicus
hmm... duration has to be float not int

did you try it with 1.5f instead of 1.5 ?

it might be assumed, but I'm not sure

Posted: Tue Jun 24, 2003 7:46 pm
by Neve
Hmm... The fact that 1.0 is used instead of just 1 should be enough indication that it's a float... Also, the lightning script that I wrote earlier works perfectly...

If I levelup in my module, I get a message like "Your char has gathered enough experience to gain a new level", could it be that the custom script isn't 'overwriting' a default script ? I added it in the module properties, any other places I should have to check besides that ?

Thanks for the replies too :)