Subscripting is a NWN1 and NWN2 scripting design pattern that improves performance, streamlines module design and keeps things more organized.
It works with one main "Script Base" file whose "Nodes" are referenced by smaller scripts. Try out the demo and see source code for more information. Don't hesitate to contact me for help.
Posted by jallaix at 2007-09-07 10:46:37 Voted 8.00 on 09/07/07
8 because now I know why it improves performance !
In fact since you've submitted your pattern, I've written an include file that contains many functions to call scripts :
* Add arguments for script calling (int, float, string, object, location, itemproperty)
* Script execution (simple or with a subscript, that I called the fork system)
* Return value (int, float, string, object, location, itemproperty)
I've integrated it in my Spellcasting Framework (in fact it will be in the next version) as it permits to make something I really miss in the nwn scripting language : function overrides.
In fact, as it may interest other people, I think I'll submit it on the vault today. Just have a look and tell me what you think about it. _________________________ Spellcasting Framework Wild/Dead Magic Zone (Spellcasting Framework add-on)
The pattern improves perfomance because the module's filesize is smaller since you're not including libraries across multiple scripts but only in script base file.
SUBSCRIPT_EVENT_ONCE_VAR is a leftover from a subscript function tied to one of my modules, it was an event trigger function. Just ignore it, I'll remove it in the update.
I plan on adding support for other types of returned values and there will be a more user-friendly demo module.
If you're interested, you're free to collaborate
Posted by jallaix at 2007-08-26 03:32:06 Voted 8.00 on 09/07/07
Good attempt to standardize calls to ExecuteScript().
But could you explain why this pattern should improve performance ?
You also defined a SUBSCRIPT_EVENT_ONCE_VAR variable in inc_subscripts.nss, but it's never used. Do you intend to improve the pattern later ?
If yes do you intend to add more types of returned value (like string, object, etc.) as returning TRUE or FALSE as an integer is quite limitative.
And could you provide a more user-friendly demo module ? (I didn't understand what it should demonstrate when I tried it...) _________________________ Spellcasting Framework Wild/Dead Magic Zone (Spellcasting Framework add-on)
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