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 (33):

  1  2 Next>

Posted by charlievale at 2011-04-08 22:12:24    
Updated for Toolset 1765.

Cheers
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by Onad at 2009-10-22 04:47:51    
Oops...meant to say Epolson not Tani....D'OH ! ...sorry

Dan

Posted by Onad at 2009-10-22 04:46:48    
Just a follow up to my previuous post...now updated to the newest patch 1765....Apparently Tani is no longer supporting this file or maybe not reading this forum any more...anyway, this seemed like a good set of scripts...I will look elsewhere...thanks for the start of something wonderful. Perhaps someone else will carry on with this...Cheers !
Dan

Posted by Onad at 2009-10-18 15:31:44    
Hi Tani...
Just so you know, your link does not work...lol...anyway I only have nwn2 with 1.0.1763.0 patch and I would really like to use this neat script set. I can see where this would be sooooo handy.....anyone have the csftool.dll compiled for my version?
Thanks
Dan

Posted by oveboncc at 2009-08-25 22:58:56    
Followup to previous comment this was in response to Tani's post 3-16-2009...using C# express

Posted by oveboncc at 2009-08-25 22:55:27    
For those with no or little programming experience...at least with C#. File links in C# can be done choosing Project > Add Reference. Reference linking (pointing) most likely refers to driver (.dll) files in NWN2 root game directory...although you can can try compilation to see what link errors are generated otherwise to see what needs reference.

Posted by Alvi_Leiz at 2009-03-08 12:02:48    
Please, Update the CSF Plugin to Electron Toolset for Nwn2 1.22.1588

Posted by charlievale at 2009-02-28 13:48:52    
I have not had much time for NwN2 lately and I am starting uni studies this year. At this point I don't think I will be doing any further updates to my NwN2 Vault submissions. Thank you all for the suggestions and support you have given.

cheers
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2008-11-19 03:13:03    
Updated for 1.21
cheers
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2008-10-04 14:52:35    
PoeticDreamer, from your email it seams you have this sorted now.
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by charlievale at 2008-08-19 03: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 2008-08-16 13:55:17    Voted 10.00 on 08/16/08
Invaluable builder tool. Plug-in for 1.0.13.1409 coming? Thanks.

Posted by charlievale at 2008-08-02 04: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 2008-08-01 03:38:15    Voted 9.50 on 08/01/08
Keep the good work ;)

Please, could you update the plugin for Nwn2 1.13?

Thanks

Posted by charlievale at 2008-03-22 02: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-21 12: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-13 01: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-04 01: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-03 16: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-31 00: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

Posted by mobiusrit at 2007-10-11 19:13:16    Voted 10.00 on 09/27/07
I believe I have resolved the issue. I had a single script that executed off an item AND dealt with the feedback from the conversation it launched. Every so often, it would crash the server.

Separating it into two scripts (one that launched the conversation from the item and one that dealt with the output from the conversation) has seemed to cure the problem -- no crashes after a week of use.

Posted by charlievale at 2007-10-02 20:48:37    
Thanks for the feedback. I have updated the plugin for NwN 1.10. Thanks for the detailed info on the problem you are having with item on activate scripts. I will look into this, but probably not until I finish uni exams on the 9th of November.

cheers
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by mobiusrit at 2007-09-27 07:03:16    Voted 10.00 on 09/27/07
I'd like to echo Accerak's post (well, at least mostly). I too am having trouble with my tag-based item activate. I created a NEW mod, then immediately imported the CSF. I created my one test area and dropped down the default waypoint (that does indeed have all the @ events on it). My item is called cph_i_pcwidget and my script is thusly i_cph_i_pcwidget_ac. I have put PrintString and SendMessage lines in the activate script.

As soon as the PC activates the item, the module crashes. I can watch the nwn2server process on the server. The INSTANT I hit activate, the process dies (and then NWNx launches it again). It happens every time. I switched scripts to something incredibly simple (like just a SendMessage) and it still crashes.

As a note, the waypoints are being read correctly (at least a new one I put in for a NWNx onClientEnter module event, because it fires correctly).

Any thoughts?

Posted by ladydesire at 2007-09-09 15:19:18    Voted 10.00 on 09/09/07
Thanks for posting the source. :)

Posted by indio at 2007-08-13 02:01:10    Voted 10.00 on 08/13/07
Love this system, and that you've decided to maintain it for us charlievale. Much obliged.

Posted by charlievale at 2007-07-24 17:31:26    
G'day DomFada,

If you have made changes to the csf that you would like me to take up, please send them to charlievale at gmail dot com

I haven't changed the original code by EPOIson (yet), so there should be no problem just putting your code up as the next version.

I have read that the vault email system was disabled, so I hope you read this.

cheers
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by DomFada at 2007-07-24 13:10:26    
Hi charlievale. I tried sending you an email, but never got an answer. I'm doing update to the codebase - a rather large one. Namely, separating the event queue into several named ones, to which each object can subscribe independantly. I hope it can integrate seamlessly into what you are doing. Can't promise any delivery date, though, but I'm 70% finished. You can contact me through the nwvault form.

Posted by charlievale at 2007-07-21 14:28:30    
Yes, I will keep the source code up to date as/when I make changes to it. I am also happy (more than) to manage any code additions others might want included here. So far I have a few ideas of things I would like to add / improve, and I am working on a tool to 'export systems' for upload to the vault (as that is a big time sink for me). However I haven't officially added anything to the code yet - just re-pluged it. The big need at the moment is to create some systems and convert others to use the csf, and make the components / packages available here, so non scripters can begin to see the potential of this.

My development mod uses the csf and I have a number of systems under development that use it. I also have made quite a few on activate items. I did however have the csf installed first. Here are a few things you should check if your tag based on activate isn't working:

1. Have you placed the CSF Default Scripts way-point/placeable. This attaches the standard nwn2 event scripts, which includes the OnActivate event code that enables tag based scripting. Check its variables and make sure there is an entry for the OnActivate event.

2. According to the tool-set documentation your on-activate script should be prefixed with an "i_", i.e. it should be "i__ac". I believe it is possible to change those requirements by editing the tag base scripting launch code in the OnActivate event. Unlikely you did that though as you would remember it...

3. Put a SendMessageToPC(GetFirstPC(), "My script is running!"); line at the beginning of your code. If you are using csf as a builder, I am probably telling you what you already know by now...

Let me know how you go.
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by Accerak at 2007-07-21 06:28:42    Voted 10.00 on 07/21/07
This is a 10. It really is ground breaking. A couple of questions though charlie.

1. Will you be continuing in EP's footsteps with also releasing the updated source code?

2. Have you experienced any issues in the modules on activate event? I am working on a script that has a custom widget for the pc. It's tag based, and works 100% until I put in the new CSF. Then the script doesn't seem to fire any longer. Basically the item's tag is "value", the script it's supposed to fire is "value_ac". I even tried the ol' NWN non-tag based approach and modified the default x2 default activate script, specifically calling the script if the item is used... no dice with the CSF, works fine without it. Are you seeing anything like this? Any ideas (or did I just not read the docs well enough :)
_________________________
"Victory is built from the ashes of your enemies." - unknown

Posted by charlievale at 2007-07-14 15:56:57    
Plugin updated for hotfix 1.06.980
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

  1  2 Next>

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