Effects scripting on Levelup
Moderator: Event DM
- Neve
- Prince of Bloated Discourse
- Posts: 192
- Joined: Mon Apr 14, 2003 4:09 pm
- Location: The Netherlands
- Contact:
Effects scripting on Levelup
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...
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...
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
- Aloro
- Team Member; Retired with Honors
- Posts: 12805
- Joined: Sat Dec 28, 2002 5:11 am
- Location: Rainbow's End
- Contact:
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.
- Aloro
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);
}
- Neve
- Prince of Bloated Discourse
- Posts: 192
- Joined: Mon Apr 14, 2003 4:09 pm
- Location: The Netherlands
- Contact:
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.

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.
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
- Jordicus
- Team Member; Retired with Honors
- Posts: 8042
- Joined: Tue Jan 21, 2003 3:46 pm
- Location: Whitehall, PA (GMT -4)
- Contact:
you could probably use this:
and change ApplyEffectAtLocation to ApplyEffectToTarget (something like that...) instead..
i've noticed certain effects will not work on locations, only on targets.
Code: Select all
object oPC = GetPCLevellingUp();
i've noticed certain effects will not work on locations, only on targets.
- Neve
- Prince of Bloated Discourse
- Posts: 192
- Joined: Mon Apr 14, 2003 4:09 pm
- Location: The Netherlands
- Contact:
Random lightningblasts :
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 
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);
}
}

- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
- Neve
- Prince of Bloated Discourse
- Posts: 192
- Joined: Mon Apr 14, 2003 4:09 pm
- Location: The Netherlands
- Contact:
Hm...
Didn't work either...
Code: Select all
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFX, oPC, 1.5);
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
- Neve
- Prince of Bloated Discourse
- Posts: 192
- Joined: Mon Apr 14, 2003 4:09 pm
- Location: The Netherlands
- Contact:
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
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

- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.