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  



NWN2 SCRIPTS

- Jump to comments -
Name  csf - common scripting framework
Author  EPOlson
Submitted / Updated  06-19-2007 / 04-08-2011
Category  Entire Module/PW systems
Type  Type - Event
Format  Module and Code
Patch  1.23
NWN2Game  NWN2:SoZ
Description
Don't combine event scripts to add new systems to your mod. The CSF does it for you!

Common Scripting Framework for NNW2

The Common Scripting Framework (CSF) simplifies the process for adding scripted systems to a module. Many modules will use several systems (e.g. DMFI, HABD, HCR, NESS, etc). Most require the editing/merging of module or area event scripts and demand the designer follow detailed instructions to install and update the systems. CSF allows the module designer to easily install, remove and configure any number of packaged systems.

* CSF allows plug-n-play installation of scripted packages.
* No scripting is required to install the CSF or CSF enabled components to a module.
* Component instances act as functional documentation for a system's requirements and configuration. They may double as in-game documentation for PCs or DMs.
* CSF supports installation and reconfiguration while the module is running
* Simple to use, but powerful enough to do what you need.

The CSF replaces all the event scripts for the module. It uses CSF Components to determine what events a system needs to be linked to. These components are placeables or waypoints with variables listing the required events and which script to run. The CSF then manages a list of all the system scripts that need to be called when any event script is fired.

The CSF is not just for builders who dislike scripting. It is a better way to maintain scripted systems. Using the CSF when making your own systems will simplify your event scripts, and make it easier to share your work with others.

For the full documentation see readme.html in the download.

Frequently Asked Questions
Q: What kind of object should I use as an instance for my component? A waypoint? A placeable?

A: The framework does not care. It searches for a "CSF" tag on any object. It would be very bad to use anything that could get killed or destroyed.

* Waypoints objects have the smallest data structure, so it uses the minimal resources. It also can't be seen or touched by players.

* Placeables can provide extra functionality through their OnUse event and the Description could be used to provide in-game documentation to the players or DMs. Placeables are not much larger than waypoint (unless they contain inventory). Inventory could be utilized to configure a csf object.


[Reading variables from a placeable and reading variables from a waypoint seem to take about the same amount of time, the performance difference happens when the object is repeatedly passed as a parameter to a subroutine.]

Q: Something does not seem to be working right. What is wrong?

A: Did you check your server log? Csf prints errors and warning to that file. Did you make a typo in the variable or script name? Does the debug object help?

Q: You said the [local] event scripts run with priority 7 by default, how do I change that?

A: You could change it in the source code, but you don't really want to do that. The simple thing to do is just assign "[local]:priority" for an event the module object. For example setting: @OnSpellhook = "[local]:first" on GetModule(), will give the local event script "first" priority for the OnSpellhook event queue. (any csf component, it does not matter which one - it can not be controlled per object - think about it)

Q: Why did you overwrite the gui_death_respawn_self script?

A: The module's OnPlayerRespawn event is never called in NWN2. When the "Respawn" button is pressed on the respawn GUI, it calls gui_death_respawn_self. Therefore, the CSF Framework needs that code to call the onPlayerRespawn script so that respawn events can get processes. (the gui_death_respawn_self_orig script contains the original resurrect code that was replaced.)

Q: My OnPlayerRespawn still does not work

A: As explained in the previous question, the OnPlayerRespawn event is never actually called, it gets called by "gui_death_respawn_self".

So first turn on debugging and check if the csf OnPlayerRespawn event is getting called. If you are not using the default death script (nw_o0_death) which creates a GUI called "SCREEN_DEATH_DEFAULT" (death_default.xml), then the button press might not call "gui_death_respawn_self". (also check to see if any other script has overwritten "gui_death_respawn_self"

For example, an OnPlayerDeath script like k_mod_death in the OC (and anything using the "ginc_death" functions) opens a different GUI called "SCREEN_PARTY_DEATH" (partydeath.xml). When respawn is pressed in that GUI, it called "gui_death_respawn" instead. So to use this, you will need to modify "gui_death_respawn" so it calls the csf OnPlayerRespawn event like the modified "gui_death_respawn_self".

If your script is getting called, it might not work because it uses GetLastRespawnButtonPresser() to get the spawner. Unfortunately, that function value never gets set, since the true "OnPlayerRespawn" event is never called. Since the gui respawn scripts are called with OBJECT_SELF set as the button presser, I wrote store that and wrote a function to access it: csfGetLastRespawnButtonPresser(). (so use that instead)

Credits

CSF Framework 1.2 for NWN2
By EPOlson

The CFS framework is a merging of ideas from members of the NWN community. An initial prototype was written by futurewavecs and the HRC team built a similar system into their new HCR package. The details of framework were based on discussions between Demetrious, Pentane, Sunjammer, EPOlson, and others. The first version was scripted by EPOlson. (with nwnx2 chat scripts by virusman/dumbo and listen scripts by Deva/Demetrious & the dmfi team) rdjparadis added extensions to support all events for all types of objects, as well as add the idea of [local] scripts.

Changes
1.2
* Cleaned up onListen events (created a seperate erf for the listen scripts)
* Updated and cleaned up some documentation
* Added a few functions to the event api (for getting and setting component variables)

1.1
* Added OnPCStart event (first time PC start the module)
* Cleaned up OnPlayerRespawn. (see notes, but instead of passing the respawner as OBJECT_SELF, like the respawn GUI scripts do, I wrote a function:
csfGetLastRespawnButtonPresser()
* Cleaned up the demo mod
* Fixed bugs in the plugin (and updated for 1.04)

Files

NameTypeSizeDownloads
csf_plugin_src.zipcsf_plugin_src.zip
Submitted: 06-19-2007 / Last Updated: 07-14-2007
zip1.5Mb373
CSF plugin source code
CSF_1_2b_1765.zipCSF_1_2b_1765.zip
Submitted: 06-19-2007 / Last Updated: 04-08-2011
zip557.17Kb303
Common Scripting Framework 1_2b for NwN2 1.23.1765
SCORE OUT OF 10
10
7 votes
View Stats
Cast Your Vote!
Voting FAQ

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


csf plugin





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

1 2 3

Posted by charlievale at 2008-08-1903:08:15    
Plug-in updated for for NwN2 1.13.1409 _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by chris421 at on08/16/08
Invaluable builder tool. Plug-in for 1.0.13.1409 coming? Thanks.

Posted by charlievale at 2008-08-0204:38:21    
Plug-in updated for for NwN2 1.13.1405 _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by Ankhalas at on08/01/08
Keep the good work ;) Please, could you update the plugin for Nwn2 1.13? Thanks

Posted by charlievale at 2008-03-2202:31:01    
Plug-in updated for for NwN2 1.12.1295 _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2007-12-2112:22:41    
Plugin updated for NwN2 1.11.1153 _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2007-12-1301:30:56    
Plugin updated for NwN2 1.11.1152 _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2007-11-0401:39:58    
Plugin updated for NwN2 1.10.1116 _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2007-11-0316:43:27    
MotB finally hit Australia, and so now I am back. _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2007-10-3100:59:08    
I am moving on to other projects and will no longer be making updates here. Thanks to all of you who have supported these projects with testing and feedback. Should anyone wish to take over one or more of my projects, contact charlievale at gmail dot com and I will have the project transfered to your vault account. All the best. _________________________ Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

1 2 3

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

10 - A Masterpiece, Genuinely Groundbreaking
9 - Outstanding, a Must Have
8 - Excellent, Recommended to Anyone
7 - Very Good, Deserves a Look
6 - Good, Qualified Recommendation
5 - Fair, Solid yet Unremarkable
4 - Some Merit, Requires Improvements
3 - Poor Execution, Potential Unrealized
2 - Very Little Appeal
1 - Not Recommended to Anyone

 
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 Other


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