Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  Nightshade's Scrolls of Town Portal
Author  Nightshade
Submitted / Updated  12-15-2011 / 12-15-2011
Category  Scripting routines
Expansions  Requires All Expansions (SoU & HotU & CEP)
Format  Code Only
Type  Type - Other
Includes  Custom
Description
To install simply import the .erf. From there all you have to do is to place the Waypoint titled Portal Drop - Starkhaven in the location of your choice (Make certain it's a valid location first and as to where you can find the WP it's in under Items: Custum: Special - Custom 5). Once this is done all you have to do is to edit the modules events; OnActivate, OnAcquire and OnUnAcquire, I have included these for your use under the titles of ns_on(etc.). After you have done this you can then add the two example items into the module as drops, special acquires or sell them in shops. (You can find the two items under the tabs; Item: Custom: Special - Custom 5 (The names start with Scroll: [Party or Player] Town Portal)).

Modification of this script is fairly simple, to make more locations and scrolls all you have to do is make copies of the items and scripts (Make certain the item and script names are both unique and that they match) as well as make a copy of the waypoint with it's own unique tag and resref, open the scripts and add your new location tag to the target location for the teleportation script and viola you have your own location based teleportation scrolls.

Files

NameTypeSizeDownloads
ns_twn_prtscrl.erfns_twn_prtscrl.erf
Submitted: 12-15-2011 / Last Updated: 12-15-2011
erf10.59Kb39
Simply follow the instructions in the description section of my post or the ones in the imports comments.
SCORE OUT OF 10
N/A
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (5):

Posted by Mike_the_Chilander at 2011-12-16 05:17:48    
It is a rather well made point, however like I've said before I'm not a scripter I just like sharing some of the things I've made and found useful in my own modules. If it helps someone else in the process then I'm more than happy to have helped them.
_________________________
"Eloquence dear freind, Eloquence in simplicity."
-Arken Deadroth

Posted by The_Krit at 2011-12-15 23:45:58    
Correction to my earlier comments. Do not replace *all* underscores with spaces. Instead, replace all groups of four (or eight) underscores with spaces. (The underscores in the symbolic constants are supposed to be there. It's the underscores at the beginning of each line that need to be converted to spaces.)

Posted by The_Krit at 2011-12-15 23:41:51    
Come to think of it, you could make this more generic so that a new script does not need to be made for each "town" you can portal to. Tags are 32 characters long, while script names are only 16. You could set it up so that both the script and the destination are encoded in the scroll item's tag. (You could also use a local variable for the destination, but that would be lost if the item was in infinite supply in a store.) Add in support for standard tag-based scripting, and you would only need one script. Give that script a 16-character name (not shorter), and give the destination waypoint a tag of 16 or fewer characters. Then create the portal scroll with the ability to cast "unique power self-only" and with a tag consisting of the script name followed by the destination waypoint's tag. For example, if the script is called "ns_portalscroll_" and the destination waypoint's tag is "stp_link_strk", then the item's tag would be "ns_portalscroll_stp_link_strk".

The script needed would be a bit beyond what the script generator can produce (otherwise I would give you a chance to work on it before posting the script in the comments). It would look something like the following. (Replace all underscores with spaces. I'm using them so that the Vault does not clobber the indents.)

#include "x2_inc_switches"


void main()
{
____int nEvent = GetUserDefinedItemEventNumber();

____// Spells might continue to their spell scripts. All other events are
____// completely handled by this script.
____if ( nEvent != X2_ITEM_EVENT_SPELLCAST_AT )
________SetExecutedScriptReturnValue();

____// We are only interested in activation.
____if ( nEvent != X2_ITEM_EVENT_ACTIVATE )
________return;

____// Get information about this activation.
____object oActivator = GetItemActivator();
____object oItem = GetItemActivated();

____// Have the PC "read" the scroll.
____AssignCommand(oActivator, ClearAllActions());
____AssignCommand(oActivator, ActionPlayAnimation(ANIMATION_FIREFORGET_READ));

____// Apply some visual effects.
____effect eEffect = EffectVisualEffect(VFX_FNF_PWSTUN);
____DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oActivator));
____eEffect = EffectVisualEffect(VFX_IMP_UNSUMMON);
____DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oActivator));

____// Determine where to jump to.
____string sTargetTag = GetSubString(GetTag(oItem), 16, 16);
____object oTarget = GetWaypointByTag(sTargetTag);
____AssignCommand(oActivator, ActionWait(0.5)); // Adjust this wait if the timing of the jump seems off.
____AssignCommand(oActivator, ActionJumpToObject(oTarget));
}


With this script, each new destination would still need a new item and a new waypoint, but not a new script.

Posted by The_Krit at 2011-12-15 23:08:47    
Lilac Soul's NWN Script Generator is effective, but it produces rather ugly and inefficient scripts. Here is scrl_twnp_strk cleaned up with the standard tag-based check added to it: (Replace all underscores with spaces. I'm using them so that the Vault does not clobber the indents.)


#include "x2_inc_switches"


void main()
{
____// We are only interested in activation.
____if ( GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE )
________return;

____object oPC = GetItemActivator();

____AssignCommand(oPC, ClearAllActions());
____AssignCommand(oPC, ActionPlayAnimation(ANIMATION_FIREFORGET_READ));

____effect eEffect = EffectVisualEffect(VFX_FNF_PWSTUN);
____DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC));

____object oTarget = GetWaypointByTag("stp_link_strk");
____DelayCommand(3.9, AssignCommand(oPC, ClearAllActions()));
____DelayCommand(4.0, AssignCommand(oPC, JumpToObject(oTarget)));

____eEffect = EffectVisualEffect(VFX_IMP_UNSUMMON);
____DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC));
}


Posted by Mike_the_Chilander at 2011-12-15 17:09:52    
Slight Typo, the WP is actually located in the Waypoints tab and not the item tab... Heh whoops.
_________________________
"Eloquence dear freind, Eloquence in simplicity."
-Arken Deadroth

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Tools


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters