Aller au contenu

Photo

Advanced Script Compiler for NWN2 release thread


  • Veuillez vous connecter pour répondre
116 réponses à ce sujet

#76
kevL

kevL
  • Members
  • 4 052 messages
Sky,
not sure if/when you'll see this, but i found a quirk in the Standalone compiler (release 15), where it compiles a faulty script, outputs a .NCS but the code doesn't run IG.

faulty line in 'x2_inc_itemprop':
#include "baseitem_inc"; // bad semi-colon!

stock compiler:
x2_inc_itemprop.nss(25): ERROR: INVALID DECLARATION TYPE

ASC plug-in compiler:
x2_inc_itemprop.nss(25): ERROR: INVALID DECLARATION TYPE Error: Script gui_enchanted_ints requires runtime compilation and errors were detected with the standard compiler.

ASC standalone compiler:
Compiling: gui_enchanted.NSS
Total Execution time = 2172ms
switches:
-aglo -i .;F: -v1.69 %f
( 'gui_enchanted_ints' (no relation to "int") & 'gui_enchanted' are the same script, just renamed so i could segregate output )

If you want to change it, hey great; if not, hey it was my fault anyway :)

#77
SkywingvL

SkywingvL
  • Members
  • 351 messages

Thanks for the report.  I will look into adding a diagnostic here where possible.

 

If you are not using the NWScript Accelerator NWNX4 plugin (PWs really should be), due to the way Obsidian implemented parameterized scripts, the game engine has to be able to parse the script source text in order to figure out the main arguments for the script.  This effectively means that the script has to be buildable with the stock compiler.  While I try to add warnings to the ASC if something will not build in the stock compiler, occasionally a new quirk is discovered.

 

The ASC toolset plugin will double check that the script can be parsed by the standard compiler if it is parameterized.  The standalone version dos not.

 

(The NWScript Accelerator avoids the need for the server to parse source text through some clever static analysis of the compiled script code to discover the main parameter types and count.  This enables such scripts to use nonstandard extensions, etc.)



#78
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi,

Just a quick note ... I tried using Release 15 of this Toolset Plugin version and when I went to use PowerBar to "compile all dependent files" (under Dependencies) related to my largest "functions" script, the toolset crashed with this plugin in place.

My functions script is long (nearly 6000 lines) and does support a large number of scripts ... and even PowerBar can take a good 60 seconds to compile everything (and even says "not responding" for a short while), but eventually pulls through.

My question is, does the amount of scripts I am trying to compile a problem .. or is Powerbar compile system not compatible with this one? It seems to me that the TOOLSET crash note appears when PowerBar would normally put up "Not Responding", BUT, as I say above, if I leave system for a few more seconds, it will pull through .... Is this plugin crashing me out too soon?

Cheers,
Lance.

#79
4760

4760
  • Members
  • 1 204 messages

I don't have the plugin installed, but I noticed that Powerbar doesn't compile all scripts if I'm working on a module only (but it works as you describe for a campaign).



#80
SkywingvL

SkywingvL
  • Members
  • 351 messages

There shouldn't be a crash in the absence of a bug.

 

First, please make sure that you have upgraded all of the plugin files (including NWNScriptCompiler.ndl) to the latest version.  I also don't have any experience with PowerBar, so could you confirm whether the repro happens even without that plugin in use so that we can better isolate. what happened?  Additionally, any other details or output from the crash would be helpful.

 

For non-parameterized scripts: The maximum size of a compiled script (the .ncs file output) is 64MB.  Practically speaking, a legitimate script program should be nowhere near this size limit and there would be performance problems in the game server if you even approached it.  There's no particular limit on the source text size input other than available memory.

For parameterized scripts:  The limitations of the standard compiler generally apply unless you are using the NWScript Accelerator NWNX4 plugin with the game server, as the script has to be parseable by the standard compiler which has more internal limits.  See the earlier post I made last evening for more details.



#81
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

I don't have the plugin installed, but I noticed that Powerbar doesn't compile all scripts if I'm working on a module only (but it works as you describe for a campaign).


Yes, mine is a campaign structure. 
 

There shouldn't be a crash in the absence of a bug.
 
First, please make sure that you have upgraded all of the plugin files (including NWNScriptCompiler.ndl) to the latest version.  I also don't have any experience with PowerBar, so could you confirm whether the repro happens even without that plugin in use so that we can better isolate. what happened?  Additionally, any other details or output from the crash would be helpful.
 
For non-parameterized scripts: The maximum size of a compiled script (the .ncs file output) is 64MB.  Practically speaking, a legitimate script program should be nowhere near this size limit and there would be performance problems in the game server if you even approached it.  There's no particular limit on the source text size input other than available memory.
For parameterized scripts:  The limitations of the standard compiler generally apply unless you are using the NWScript Accelerator NWNX4 plugin with the game server, as the script has to be parseable by the standard compiler which has more internal limits.  See the earlier post I made last evening for more details.


I only downloaded the latest version - I was late to the party. ;) I am using 1.23.1765 of NWN2 (with both expansions).

You need PowerBar installed to be able to do the "compile all scripts" routine. It cannot be done without it, and is one of its most useful tools for me. So, I can't test the problem without the PowerBar installed .. if you see what I mean.

Not to worry too much, as I can continue as I am for now ... I just thought you might like to hear about my experience, in case it affects anybody else.

Has anybody else got PowerBar installed and compiled all scripts for a campaign?

I could try doing the same thing for a smaller "include" file, when I have the chance again.

Cheers,
Lance.

#82
Tchos

Tchos
  • Members
  • 5 030 messages

Has anybody else got PowerBar installed and compiled all scripts for a campaign?

 

I do have PowerBar, but I have never used the "compile all scripts" option.



#83
4760

4760
  • Members
  • 1 204 messages

I am using v1.69 of NWN2 (with both expansions).

v1.69 is the latest for NWN

For NWN2, it's 1.23.1765  ;)



#84
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

v1.69 is the latest for NWN
For NWN2, it's 1.23.1765  ;)


Doh! Yes, I meant the latest for NWN2 ... I will edit that. Thanks!

I do have PowerBar, but I have never used the "compile all scripts" option.


Fair enough. :)

Lance.

#85
4760

4760
  • Members
  • 1 204 messages

Has anybody else got PowerBar installed and compiled all scripts for a campaign?

Yes, that's the main reason I have PowerBar: whenever I modify an include file, compiling all scripts is the best way to be sure the change is spread all over the place!

And I confirm it works nicely. Sometimes it hangs, but it never corrupted anything (yet). No crash to desktop to report so far.



#86
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Yes, that's the main reason I have PowerBar: whenever I modify an include file, compiling all scripts is the best way to be sure the change is spread all over the place!
And I confirm it works nicely. Sometimes it hangs, but it never corrupted anything (yet). No crash to desktop to report so far.


Hi 4760 ...

Definitely!

Have you tried this new plugin with this facility of PowerBar and experienced a Toolset crash? (Or is that what you are saying?)

Cheers,
Lance.

#87
kevL

kevL
  • Members
  • 4 052 messages

Lance,
there's a command in TS, under File|Compile|All Scripts in Module

it seems to do campaign scripts as well as module scripts (check Verify tab at bottom of TS).


I'm running some tests about this atm, comparing stock compiler vs. ASC plug-in ... preliminary results: ASC doesn't like *some* Campaign scripts and falls back on stock compiler, usually parameterized scripts (in the campaign folder)

[campaign, parameterized]

Information: Compiling kg_wm_c_check
Warning: Advanced script compiler: NscCompileScript failed to execute, falling back to standard script compiler - exception: System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\kL\My Documents\Neverwinter Nights 2\Campaigns\Kingz_Gate\__tempscript__\kg_wm_c_check.ncs' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.Delete(String path)
   at NWN2ToolsetCompilerPlugin.ScriptCompilerHook.CompileFile(String Name, String OutputDirectory)

but this non-parameterized script popped up also:

[campaign, not parameterized] <----------!!!!

Information: Compiling kg_c_onroster
Warning: Advanced script compiler: NscCompileScript failed to execute, falling back to standard script compiler - exception: System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings\kL\My Documents\Neverwinter Nights 2\Campaigns\Kingz_Gate\__tempscript__\kg_c_onroster.ncs' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.Delete(String path)
   at NWN2ToolsetCompilerPlugin.ScriptCompilerHook.CompileFile(String Name, String OutputDirectory)

it looks to me like a 'maximum path length' error?

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

--

Sky,
same test using stock compiler has no errors warnings.


Modifié par kevL, 01 septembre 2014 - 06:54 .


#88
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi KevL,

I have no idea what you have explained ... even though, I appreciate what you have written. :)

I have found that the PowerBar tool was the only way I could compile all scripts based on one "include" script. Are you saying that the Toolset already has a way to do this? If so, I was unaware of this.

Although, if I understand you correctly, the plugin may still have issues here anyway ... yes?

Anyway, I hope something I wrote somewhere is helpful somewhere to someone. ;)

Cheers,
Lance

EDIT: Just to be sure I am explaining what I do/require ...

If I update my own campaign script (which is a major "include" script for *many* module and other campaign scripts), I can use the PowerBar tool to update every script that relies on this include script.

When I had the ACS plugin installed, using this facility on the PowerBar tool crashed the toolset.

I do not know of a way to do this without PowerBar using just the Toolset.

EDIT: I am just running that toolset compile all scripts now ... OK, I just switched to the verify window ... but its results do NOT appear to be the kind of thing I need. Have you tried the PowerBar facility to see what I mean?

Interestingly, however, it does show that the OC "ginc_param_constant" script is not correct. ;)

#89
4760

4760
  • Members
  • 1 204 messages

Have you tried this new plugin with this facility of PowerBar and experienced a Toolset crash? 

No, I didn't try this ACS plugin. I was just saying that without it, I never experienced a toolset crash (well, I did, but that was because I was messing with 2da and animations!)



#90
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

No, I didn't try this ACS plugin. I was just saying that without it, I never experienced a toolset crash (well, I did, but that was because I was messing with 2da and animations!)


Ah! OK, That fits with my own experience then. :) As an aside, I notice that sometimes "sounds" attached to effects in an editor can crash the toolset too (when played). I often remove sounds (temporarily) from effects before testing an effect out.

Cheers,
Lance.

#91
kevL

kevL
  • Members
  • 4 052 messages

i think there may be issues in the ASC plug-in with pathlength tho. have to wait for SkyVL to verify ...

ps. yes i understand what you need to do, and i believe the PowerBar is just a fancy access to the File menu command.

HOWEVER, the TS did not crash when i tested, a moment ago, using PowerBar : BUT there were only 4 warnings instead of 8. All 4 resulted from scripts that are also among the 8 (the last four consecutively if that matters..).

 

 

If I update my own campaign script (which is a major "include" script for *many* module and other campaign scripts), I can use the PowerBar tool to update every script that relies on this include script.

When I had the ACS plugin installed, using this facility on the PowerBar tool crashed the toolset.

I do not know of a way to do this without PowerBar using just the Toolset.

EDIT: I am just running that toolset compile all scripts now ... OK, I just switched to the verify window ... but its results do NOT appear to be the kind of thing I need.

maybe maybe not .....

Interestingly, however, it does show that the OC "ginc_param_constant" script is not correct. ;)

That does not surprise me ;)

#92
kevL

kevL
  • Members
  • 4 052 messages

ps. i batch compile using the Standalone with a .BAT file, and i don't hit the/se issues.



#93
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

ps. i batch compile using the Standalone with a .BAT file, and i don't hit the/se issues.


Thanks for testing,

Unfortunately, this is out of my league and so I do not know what more to say. However, it sounds like you can use the PowerBar to compile smaller include files OK, if I am understanding you correctly. That's why I wondered if (for some reason) the amount of "compiling" across many cross-referenced includes stemming from my own major include file had caused an issue? For instance, the include I am referring to, also has #include "alb_constants" #include "ginc_death" #include "ginc_item" at the top. EDIT: And I forgot to add that some of these scripts that require this include (which are compiled at the time I use the function) also have other include files themselves! So, is the depth of includes involved a potential error maker?

Again, I have absolutely NO IDEA when it comes to this sort of thing .. except to say when it did and did not work for me. :)

Cheers,
Lance.

#94
kevL

kevL
  • Members
  • 4 052 messages

tbh I have a (no doubt highly parsed) version of 'alb_functions' in my tests, for Fog of War!! Although it's an include it keeps showing up in my tests as a script that's being compiled ... it's .. odd ....

might be because it's the only #include in my Campaign (or module) folder. might be a clue



#95
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

tbh I have a (no doubt highly parsed) version of 'alb_functions' in my tests, for Fog of War!! Although it's an include it keeps showing up in my tests as a script that's being compiled ... it's .. odd ....

might be because it's the only #include in my Campaign (or module) folder. might be a clue


Wow! That goes back a bit!

The "alb_functions" is now nearly 6000 lines long and that's now after I have removed the FOW functions to their own include (700 lines long), which now has "alb_functions" as an include itself!

EDIT: alb_functions now contains what I call the "core" campaign functions. It was necessary to do some tidying up and splitting that include into smaller ones when it became huge!

It certainly gets complicated. :)

Lance.

#96
kevL

kevL
  • Members
  • 4 052 messages

you might want to break your 6000 line #include, like you did for the FoW functions ... and there shouldn't be any problem with sub-including includes to whatever level,

on to further tests:


oops!

Now i'm getting TS crashes (to desktop) when using the File menu command Compile All Scripts in Module, using the plug-in. I'm running winXP 32-bit and might be having memory issues (full Override), but when I revert to the stock compiler nothing complains.

then re-inserting the plug-in stabilizes the TS (no crash) and warnings pop up again ... but they're pseudo-inconsistent: always the same scripts are involved, but now only 3 issue warnings.

note, I put another #include into the Campaign folder, and it exhibits the same behavior as the 'alb_functions' #include. That is, batch compiling from File menu seems to merely check it and move on to real, compilable scripts. (non issue ? there are no .NCS for them ofc) Same behavior as stock compiler, there.



#97
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

you might want to break your 6000 line #include, like you did for the FoW functions ... and there shouldn't be any problem with sub-including includes to whatever level,


6000 lines - That is the streamlined version. ;) I don't mess with that monster any more if I can help it. ;)

on to further tests:

oops!

Now i'm getting TS crashes (to desktop) when using the File menu command Compile All Scripts in Module, using the plug-in. I'm running winXP 32-bit and might be having memory issues (full Override), but when I revert to the stock compiler nothing complains.


Initial TS crash you mention sounds like my issue ... although I am running Win 7 64 Bit. Override not got too much in it ... and never a problem before.

then re-inserting the plug-in stabilizes the TS (no crash) and warnings pop up again ... but they're pseudo-inconsistent: always the same scripts are involved, but now only 3 issue warnings.

note, I put another #include into the Campaign folder, and it exhibits the same behavior as the 'alb_functions' #include. That is, batch compiling from File menu seems to merely check it and move on to real, compilable scripts. (non issue ? there are no .NCS for them ofc) Same behavior as stock compiler, there.


Cannot comment.

Cheers,
Lance.

#98
kevL

kevL
  • Members
  • 4 052 messages

Initial TS crash you mention sounds like my issue ... although I am running Win 7 64 Bit. Override not got too much in it ... and never a problem before.


i don't think its a memory issue either.

Cannot comment.

me too. I can't even say for sure it's a pathlength issue, because some of the files that issued warnings have names that are shorter than others that did not, iirc.

#99
CrystalDragon

CrystalDragon
  • Members
  • 2 messages

So sorry to bother all of you, but I seem to have run into a slight problem. Recently when I try to compile a script using the advanced script compiler it gives the error message:

 

Advanced Script Compiler: NscCompileScript Failed to Execute, falling back to standard script compiler - exception: System.IndexOutOfRangeException: Index was outside the bounds of the array. at OEIShared.IO.GFF.GFFFile.(upside down delta symbol)(GFFStruct, Int32, GFFIOStruct[]

 

it gives this error no matter what script I try to complie, and when I close the toolset it opens a popup box called "Microsoft Visual C++ Runtime Library" with the following linformation:

 

Runtime Error!

 

Program: C:\GOG...

 

This application has requested the Runtime to terminate it in an unusual way.

Please contact the application's support team for more information.

 

The first thing I tried was re-installing Visual C++ (2005, 2008, 2010, 2012, and 2013 both versions) none of these helped, though doing so has resolved a similar error in the past. I then performed a full reinstall of NWN2, also without effecting the error. At this point I'm unsure where to go from here, if you happen to have any knowledge of or insight into this error your assistance would be greatly appriciated. Thank you for your time.



#100
CrystalDragon

CrystalDragon
  • Members
  • 2 messages

After much trial and error, lots of time spent wracking my brains, I narrowed the issue down to the files in the module, I reverted them to a previous save, and the issue disappeared, I can only assume something became corrupt and that it was tripping the compiler up.