This project includes a NWN2 toolset plugin that adds an improved script compiler (based on Edward T. Smith's nwnsnsscomp) to the NWN2 toolset. The compiler is seamlessly integrated and automatically used when compiling scripts from the toolset. Features include better code generation, better warnings and error messages, and the ability to receive more than one compile error at once.
Additionally, an improved console script compiler (replacing nwnnsscomp) is also included, with various bugfixes and improvements over nwnnsscomp. In particular, NWN1 datafiles aren't required anymore for the console compiler, and nwscript.nss can be loaded from the game zip files. Various fixes are also made to ensure that scripts compiled with the console compiler are also compileable by the stock script compiler.
yep (note to others, the default compiler returns 'unsuccessful' on a *cough perfectly good script) i should point out, though, that it doesn't seem confined to the console RunScript - it first popped up fer me in bad code I had been running 'successfully' for half a year (without so much as a peep, then i recompiled with the ACS and bang, so thanks too!) _________________________ All the world's a stage ... but so what.
Posted by Skywing at 2011-05-1810:08:39
kevL: The fact that this crashes is a bug in the game server. However, it's not something that I would consider an issue with the script compiler (it's luck that this works at all with the toolset script compiler). The root cause of the issue here is that the console RunScript command does not support scripts that take parameters or return values (i.e. it must be a "void main()" script). Any other scripts called via the console RunScript command may corrupt the internal state of the script VM. Thanks for the report!
Posted by Skywing at 2011-05-1719:23:05
Thanks. We did indeed crash in the script VM. I'll see if I can analyze this; I'll get back to you.
Posted by Skywing at 2011-05-1711:41:00
Please link me the .nss, .ncs. and .ndb files for the problematic script, including all dependencies, and I'll take a look. (Don't build with -g for this as I will need the .ndb file. This won't impact the .ncs file output at all.) Also, please link me the nwn2_errorlog.txt (or nwn2_servererrorlog.txt) from your game installation directory in Program Files. You may need to click 'ompatibility files' to see the error log in vista/win7.
Posted by kevL's at on05/19/11
( clarifications ) "specified in the code itself" should read "specified in the function itself" iBonusHP = nBonusHP, sry. _________________________ All the world's a stage ... but so what.
Posted by kevL's at on05/19/11
oh, my command line: -glo -v1.69 _________________________ All the world's a stage ... but so what.
Posted by kevL's at on05/19/11
hello Sky, have a look at this chunk of code: [code] /* asc_test */ void main(int iBonusHP) { effect eEffect = EffectBonusHitpoints(iBonusHP); //eEffect = SupernaturalEffect(eEffect); } [/code] note the commented line. If uncommented, the default compiler compiles the script and runs it from the console fine (if iBonusHP != 0, else unsuccessful); the ASC compiles the code (no errors) but *if nBonusHP is zero* (at the console) my game crashes to desktop with a Windows error message. ps. If iBonusHP is specified in the code itself, the ASC script behaves the same as the default compiler script (no crash, only unsuccessful if iBonusHP = 0). Have not tried other Effects, only passing a variable into EffectBonusHitpoints() then turning it into a SupernaturalEffect(). Personally I don't mind the operation as it is, causing me to tighten my code with a check for nBonusHP == 0 but .. have not tried this in the TS, only with the stand-alone ASC. _________________________ All the world's a stage ... but so what.
Posted by Skywing at 2011-05-1611:41:04
Release 2 posted. This includes the fix for the issue when compiling scripts with the same name as a built-in script in the game zip files. Changelog: Release 2: ---------- - Fixed a stability issue with GUI and conditional script detection in the toolset compiler plugin. This does not impact the standalone compiler. - Fixed a resource prioritization issue with the toolset compiler plugin that might result in resource files from the game data zips taking priority over in-module files (for example, overridden scripts with the same name in the module might not be used as expected in lieu of the in-zip versions). This does not impact the standalone compiler.
Posted by Skywing at 2011-05-1410:48:23
Lunamaria, Psionic-Entity: I believe that I have a fix for this issue (where sometimes .zip resources might be used instead of resources from the module if both had the same name). Drop me a line on IRC at #nwn2cr/irc.nwn2source.net so that we can verify the fix addresses your issue, and I'll release it after that point. This issue only impacts the toolset plugin and not the standalone compiler as it relates to how the compiler is plugged in to the toolset's resource system.
Posted by Psionic-Entity at 2011-05-1216:50:53
Ran this on scripts just before a stage, and it completely borked a few scripts that the standard nwn2 compiler runs just fine. (I've since tried adding and removing the plugin, the script compiles correctly during a one-off with the standard compiler, but instead creates a miniscule empty script with the advanced one, that does not fire ingame) The script is a modified nw_c2_default7 that's been customized for our server, which may have something to do with it.
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