Games Support Forums BioWare Info My Account Login Community Sign Up Store
Neverwinter Nights 2 Forums

NWN2: Builders - NWN2 Scripting

New Topic    Post Reply

Go to Page ( 1 , 2 , 3 Next )

    Add this To My Topics

   Go To Bottom

Author Sticky: Helpful Scripts
Rob McGinnis
Assistant Producer


Joined: 02 Nov 2006
Posted: Thursday, 05 July 2007 06:18PM
If you have a script that you feel would be helpful to the community at large, and would like to share it with the community, post it here.
_________________
Don't let your life be about the donuts!
  Profile: Rob McGinnis   Send Message To: Rob McGinnis
weby
Moderator

Joined: 07 Jul 2002
From: Cerea Island
Posted: Thursday, 05 July 2007 08:45PM
simple ones:

XP for level and level for XP:
Code:

View Post/Code in separate window


_________________
Cerea Island 2 for NWN2, Read more at: www.cerea2.com
Community representative: Persistent worlds
  Profile: weby   Send Message To: weby
Olblach
Game Owner
Profile: OlblachNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 19 May 2003
From: France
Posted: Friday, 06 July 2007 12:09AM
A rest script, hardcoded for 8 hours rest:

Code:

View Post/Code in separate window

  Profile: Olblach   Send Message To: Olblach
Mithdradates
Game Owner
Profile: MithdradatesNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
Jade Empire:SE
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 04 Jul 2002
Posted: Friday, 06 July 2007 04:34AM
Here a couple of scripts that the community might find useful. Some of them use each other, so you might want to put all of them into one file.

This one returns the size of the either the weapon passed to it, or the size of the weapon in the right hand of the creature passed to it.

Code:

View Post/Code in separate window



This function determines if a creature is using a weapon as a two-handed weapon.
Code:

View Post/Code in separate window



This function determines whether a creature is using a ranged weapon.
Code:

View Post/Code in separate window



This function determines whether a creature is dual wielding.
Code:

View Post/Code in separate window



Function to return the AB of a creature's highest AB attack (why this isn't a default function I will never know).
Code:

View Post/Code in separate window


_________________
Mithdradates' Hall of Training: Build and test your characters against simulated PvP opponents with custom AI.
  Profile: Mithdradates   Send Message To: Mithdradates
sirlucifier
Game Owner
Profile: sirlucifierNWN
NWN: SoU
NWN: HotU
NWN 2


Joined: 29 Jun 2002
From: My PC
Posted: Wednesday, 11 July 2007 03:34AM
Here is a scripit for pc race it uses a portal/door as the trigger. youll have to create the waypoints in your mod for there spawn location from the portal.



Rather than have separate portals, one portal could suffice with the following:

Set Waypoints in all the start area locations with TAGs that correspond to the racial types, for this example, I'm using:

TAG="WP_START_" as the prefix

I wrote this for an OnUse event.
If Subraces are needed, some modification for RACIAL_ SUBTYPE_ will be required.

The Racial Types are:
Dawrf = 0
Elf = 1
Gnome = 2
Halfling = 3
Half-Elf = 4
Half-Orc = 5
Human = 6
Tiefling = 21
Assimar = 21
Outsider = 20

So the Waypoint for an Elven char would have the tag "WP_START_1" or a Half-Orc start location would have a waypoint with the tag "WP_START_5"


NWScript:

View Post/Code in separate window




Just cut and past this script to portal/doors on used script area. DONT ALTER IT, it worls fine this way just make the waypoints and you be all set. Props to Calimvar
its his scripit. Hope that gets ya started.

Edited By sirlucifier on 07/11/07 03:37

  Profile: sirlucifier   Send Message To: sirlucifier
Lugoun
Game Owner
Profile: LugounNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 25 Apr 2002
From: CA
Posted: Wednesday, 11 July 2007 11:41PM
Maybe there's an easier way to do it, but this has come in handy for me a few times:

Code:

View Post/Code in separate window


_________________
Lugoun
Heroes of the Third Age
http://hotta-rpg.org/index.php

Edited By Lugoun on 07/11/07 23:43

  Profile: Lugoun   Send Message To: Lugoun
emsquared
Game Owner
Profile: emsquaredNWN 2


Joined: 18 Feb 2007
Posted: Monday, 16 July 2007 02:16AM
May I humbley request some of you more completely describe what your script does, most people that will be using these I would think do not script themselves and will not be able to tell what it does by "I've found this came in handy alot..." then a bunch of code...
  Profile: emsquared   Send Message To: emsquared
jackyo123
Game Owner
Profile: jackyo123NWN 2
NWN 2: MotB


Joined: 13 Dec 2006
Posted: Tuesday, 24 July 2007 06:38PM
This thread is long overdue, and a great idea.

I've got a bunch of scripts that I use over and over again, and will post them up here soon.
  Profile: jackyo123   Send Message To: jackyo123
jackyo123
Game Owner
Profile: jackyo123NWN 2
NWN 2: MotB


Joined: 13 Dec 2006
Posted: Monday, 30 July 2007 06:29PM
Here is a laydown/sleep script (none of these are mine - just found them up here at one point, and been saving things that look useful and I find I use over and over)

Code:

View Post/Code in separate window



Cutscene attack script
Code:

View Post/Code in separate window




Here is sir elric's cutscene invisibility script:

Code:

View Post/Code in separate window



Here is a conditional convo brach script that starts different convos with an npc depending upon where he is found:

Code:

View Post/Code in separate window

  Profile: jackyo123   Send Message To: jackyo123
Sunjammer
Game Owner
Profile: SunjammerNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
Jade Empire:SE
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Joined: 03 Jul 2002
From: Scotland
Posted: Saturday, 04 August 2007 04:19PM
An alternative to weby's C_GetLevelByXP

NWScript:

View Post/Code in separate window


_________________
Sunjammer
Code Monkey
  Profile: Sunjammer   Send Message To: Sunjammer
ciViLiZed
Game Owner
Profile: ciViLiZedNWN
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Joined: 15 Feb 2005
From: Montreal, Quebec, Canada
Posted: Wednesday, 15 August 2007 02:29AM
Here's a custom function that will identify all carried items, make them undroppable and make them unremovable (i.e. cursed). Helpful say for a companion whose inventory you don't want the player to empty. Also circumvents having to create identified versions of blueprints of magic items. Use anywhere, but a logical place is in an OnSpawn script.

NWScript:

View Post/Code in separate window


_________________
E.C.Patterson
Gaming Parents Studios

Trinity - A NWN2 adventure Download.

Edited By ciViLiZed on 08/15/07 02:30

  Profile: ciViLiZed   Send Message To: ciViLiZed
flem1
Game Owner
Profile: flem1Jade Empire:SE
NWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Joined: 31 Oct 2006
Posted: Wednesday, 15 August 2007 08:48AM
jackyo, the lay down script is missing a ) in the DelayCommand line.
  Profile: flem1   Send Message To: flem1
jackyo123
Game Owner
Profile: jackyo123NWN 2
NWN 2: MotB


Joined: 13 Dec 2006
Posted: Tuesday, 21 August 2007 07:39PM
thanks flem - damn cut n paste!

;>
  Profile: jackyo123   Send Message To: jackyo123
Wyrin_D'njargo
Game Owner
Profile: Wyrin_D'njargoNWN 2
NWN 2: SoZ
Mass Effect PC


Joined: 16 Nov 2006
From: Cambridge, UK
Posted: Thursday, 30 August 2007 06:43AM
Here's a simple script to use for a treasure placeable to give the PC some gold when they click on it and destroy the gold pile afterwards. Placeable must be useable and non-static, and attach a variable - integer called iGold, set to the amount of gold you wish to give

Code:

View Post/Code in separate window



Here's the core of my inflence script - not the most elegant, but just chaneg the companion tags for your needs

Code:

View Post/Code in separate window


_________________
My blog

The Dark Avenger series
  Profile: Wyrin_D'njargo   Send Message To: Wyrin_D'njargo
Graegos
Game Owner
Profile: GraegosNWN
NWN: SoU
NWN: HotU
NWN 2


Joined: 19 Feb 2003
Posted: Friday, 21 September 2007 10:21PM
Thank you VERY much for this thread!

Very nice scripts, keep em' coming!
  Profile: Graegos   Send Message To: Graegos

Go to Page ( 1 , 2 , 3 Next )

New Topic    Post Reply

What do these icons mean?
Where can I learn how to use the forums?

Jump To:

Search Forums | Forums FAQ | Forum Archives

 

 

  Visit the Official Site | Technical Support
Neverwinter Nights 2 Official Support
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

6,251,297 Users
170 Online
11 Logged In

9,046,484 posts in forums

Newest Forum Topics:
1. These forums are now closed (NWN 1: Scripting)

2. These forums are now closed (NWN2: Guilds and Registry)

3. These forums are now closed (BioWare News Discussion)

4. Can you level items? (NWN 1: Scripting)

5. Thank you! (NWN 1: Scripting)


Current time is: (set time)
Fri, 03 September 2010 12:58AM