Scripting With The NWN Toolset

OOC General Discussion

Moderators: Forum Moderators, Active DMs

Post Reply
FrozenSolid
Posts: 423
Joined: Sun Jan 01, 2017 4:02 am

Scripting With The NWN Toolset

Post by FrozenSolid » Fri May 05, 2017 3:26 am

I'm messing around with the toolset maybe something I can show off later! But I've never scripted before, and after reading a few guides and messing with it I've not had much luck.

An example of what I'm trying to accomplish

1. An NPC speaks a dialog, upon completing the dialog the NPC makes a casting animation and "Teleports" aka makes the casting Animation, created a spell effect, then vanishes.

If anyone has an tips or a link to a better guide that'd be awesome!
*Didn't just do that* As an arrow flies hitting someone in the face.

Xerah
Posts: 2037
Joined: Wed Sep 23, 2015 5:39 pm

Re: Scripting With The NWN Toolset

Post by Xerah » Fri May 05, 2017 3:47 am

Here is a simple script for it (I didn't test it but it should work):

Code: Select all

void main()
{
    //The NPC Speaking
    object oSpeaker = OBJECT_SELF;

    //Casting animation
    ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1, 1.0f, 2.0f);

    //Get the VXF for the teleport animation
    effect eTeleport = EffectVisualEffect(VFX_FNF_IMPLOSION);
    DelayCommand(2.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eTeleport, oSpeaker));

    // teleport target
    //great waypoint with tag teleport_location somewhere in the module
    object oTeleport = GetObjectByTag("teleport_location");

    //Move the NPC
    DelayCommand(4.0f, JumpToObject(oTeleport));
    //You'll need to mess around with the timiing

    //You could kill him after this if you want

}
The best resource for standard NWScript is http://www.nwnlexicon.com.
Katernin Bersk, Chancellor of Divination; Kerri Amblecrown, Paladin of Milil; Xull'kacha Auvry'rae, Redcap Fey-pacted; Sadia yr Thuravya el Bhirax, Priestess of Umberlee; Lissa Whitehorn, Archmage of Artifice

Morderon
Technical Lead
Technical Lead
Posts: 1271
Joined: Mon Sep 08, 2014 2:24 am

Re: Scripting With The NWN Toolset

Post by Morderon » Fri May 05, 2017 12:57 pm

For simple scripts there's also this:

https://neverwintervault.org/project/nw ... -generator

The Guy everyone thinks is Memelord
Posts: 24
Joined: Mon May 01, 2017 3:41 pm
Location: Devving
Contact:

Re: Scripting With The NWN Toolset

Post by The Guy everyone thinks is Memelord » Wed May 10, 2017 11:26 pm

A bit late but I can also lend help with any further~ scripting questions, although I don't know how many specific queries I can tend to with my life schedule.

PM me~
Nitro wrote:About time to be honest, the forums have been a bit hostile of late.
Nitro wrote:a bit.

FrozenSolid
Posts: 423
Joined: Sun Jan 01, 2017 4:02 am

Re: Scripting With The NWN Toolset

Post by FrozenSolid » Sun May 21, 2017 11:18 am

Xerah wrote:Here is a simple script for it (I didn't test it but it should work):

Code: Select all

void main()
{
    //The NPC Speaking
    object oSpeaker = OBJECT_SELF;

    //Casting animation
    ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1, 1.0f, 2.0f);

    //Get the VXF for the teleport animation
    effect eTeleport = EffectVisualEffect(VFX_FNF_IMPLOSION);
    DelayCommand(2.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eTeleport, oSpeaker));

    // teleport target
    //great waypoint with tag teleport_location somewhere in the module
    object oTeleport = GetObjectByTag("teleport_location");

    //Move the NPC
    DelayCommand(4.0f, JumpToObject(oTeleport));
    //You'll need to mess around with the timiing

    //You could kill him after this if you want

}
The best resource for standard NWScript is http://www.nwnlexicon.com.
Just wanted to say I've been messing with this. It is seriously perfect. Ty XD
*Didn't just do that* As an arrow flies hitting someone in the face.

Post Reply