Has anyone been able to mod Toolset?
#51
Posté 25 juin 2011 - 05:18
If you link me the .ncs file, I can check that (if it's the .ncs for the source text you provided above).
#52
Posté 25 juin 2011 - 05:31
Modifié par ShadowM, 25 juin 2011 - 05:33 .
#53
Posté 25 juin 2011 - 07:34
#54
Posté 25 juin 2011 - 05:54
Modifié par ShadowM, 25 juin 2011 - 05:54 .
#55
Posté 25 juin 2011 - 06:07
#56
Posté 25 juin 2011 - 10:28
#57
Posté 26 juin 2011 - 04:36
http://valera-ext.ny...CompilerDll.ndl
There were several problems here.
1) There was a longstanding bug in the compiler (also in the PRC builds) where, in the event that a global variable was assigned to during global variable initialization but never written to afterwards, it would be promoted into a 'constant expression' even if the assignment included a function call. The 'constant expression' was then inlined every time the global was referenced. This behavior was erroneous as replicating the function call changes program behavior and can in some cases lead to stack mismanagement (which was the original issue ShadowM reported). This issue only occurred if optimizations were enabled.
2) There was a seperate longstanding and very subtle bug in the compiler (also in the PRC builds) where assigments to global variables during global variable initialization would use an incorrect stack offset in the event where the global variable initialization expression referenced another global variable, and the initialization expression was of the optimized form (enabled if optimizations are turned on) and not the 'traditional' form used by the BioWare compiler. The issue occurred because the compiler was not correctly taking into account that, while traditional initialization results in storage space for the variable being reserved at the start of the initialization expression, optimized initialization results in storage space for the variable being reserved at the end of the initialization expression. As a result, references to globals during optimized global initialization would read the wrong global. This bug was hidden by the fact that, due to the global constant expression optimization issue, most of the global references that would be impacted were being inlined out of #globals.
3) There was an additional separate longstanding bug in the compiler (also in the PRC builds) where assignments of a variable to itself during initialization would not work correctly if a constant or global was involved. This was also partially hidden (in some cases) by the global constant expression optimization bug.
I've made the following code generation changes to fix these problems:
- The compiler scans the initialization expressions of all globals to determine whether a function call, action service handler call, or internal compiler intrinsic call is present before permitting promotion of the global to a constant expression. This fixes the issue with globals that involved function calls causing the function call to be improperly replicated to each call site if optimizations were enabled.
- When processing a global variable initializer, the compiler now correctly takes into account whether storage space for the global variable on the execution stack is logically allocated at the start of the expression or at the end of the expression. This fixes the problem with global initializers that referenced other global variables working improperly if optimizations were enabled (and the global wasn't treated as a constant expression).
- When processing a variable initializer expression where the variable being initialized is referenced within the expression itself, the initializer expression is forced to the traditional, non-optimized form so that stack space for the variable is available throughout the expression. This allows operators that operate on the variable to work correctly even if optimizations were turned on.
Additionally, the compiler previously did not allow default initialization for some esoteric corner cases such as "struct mystruc global1 = global1;" that the BioWare compiler permits (though not particularly usefully); these are now allowed.
Modifié par SkywingvL, 26 juin 2011 - 04:38 .
#58
Posté 26 juin 2011 - 06:02
#59
Posté 26 juin 2011 - 09:23
NWNTX Compiler 1.0.2
http://data.virusman...piler-1.0.2.rar
Added an ini file to enable/disable compiler optimizations and extensions.
Also, the compiler now generates debug data if it's enabled in nwtoolset.ini.
New compiler dll and msvcr100.dll are bundled with the package.
Modifié par virusman, 26 juin 2011 - 09:23 .
#60
Posté 26 juin 2011 - 09:41
At present, the toolset does not recognize function comments in this format:
/* Return a StringList struct containing strings extracted from sString * separated by sSep. */ struct StringList GetStringList (string sString, string sSep=" ", int nLimit=16); /* Return an IntList struct containing integers extracted from sString * separated by sSep. */ struct IntList GetIntList (string sString, string sSep=" ", int nLimit=10); /* Justify a string to a given number of pixels wide. */ string JustifyString (string sStr, int nPixelWidth, int bRight=FALSE, int nFont=0, string sJustifyWith=" "); /* Return either the resref or playername of oObject. */ string GetObjectString (object oObject); /* Return vPos in string form X, Y, Z. */ string GetPositionStringFromVector (vector vPos);
They simply won't appear in the help section - only // comments will. Unfortunately, we use an auto-formatter which converts comments to the /* */ format. Any chance there's a magic switch you can flip somewhere? I know this is pretty nitty gritty stuff without much broad utility.
Funky
#61
Posté 26 juin 2011 - 11:25
#62
Posté 27 juin 2011 - 09:10
#63
Posté 28 juin 2011 - 12:20
Regards
Karvon
#64
Posté 28 juin 2011 - 01:30
Changes include:
- The 'const' qualifier is now forbidden with struct declarations (compliance improvement)
- Compilation performance in extensions mode is significantly improved relative to the previous build that introduced preprocessor conditional comilation support
- Overall compliation performance for larger scripts is slightly improved due to some tweaks to the compiler's symbol hash table.
#65
Posté 28 juin 2011 - 02:03
#66
Posté 28 juin 2011 - 02:45
Does this build include the #pragma defaulting functionality as well? I haven't seen you mention it outside of pms. We're still running error-free, by the way.SkywingvL wrote...
New compiler DLL: http://valera-ext.ny...CompilerDll.ndl
Changes include:
- The 'const' qualifier is now forbidden with struct declarations (compliance improvement)
- Compilation performance in extensions mode is significantly improved relative to the previous build that introduced preprocessor conditional comilation support
- Overall compliation performance for larger scripts is slightly improved due to some tweaks to the compiler's symbol hash table.
Thanks,
Funky
#67
Posté 28 juin 2011 - 03:08
Modifié par SkywingvL, 28 juin 2011 - 03:09 .
#68
Posté 08 juillet 2011 - 12:08
When I try to run it I get "MSVCS100.dll is not a windows image". (Running on XP Pro SP3)
#69
Posté 13 juillet 2011 - 01:28
"Windows can not access the specified device, path or file. You may not have the appropriate permissions to access the item."
Grrr
Karvon
#70
Posté 14 juillet 2011 - 11:22
#71
Posté 18 juillet 2011 - 02:54
I tried redownloading and reinstalling the program a couple of times, but that didn't make any difference.
Quite puzzling to me.
Karvon
#72
Posté 18 juillet 2011 - 05:02
Say you have a simple script -
#include "test_inc"
int StartingConditional()
{
object oPC = GetPCSpeaker())))))))))))));
return TRUE;
}And the test_inc script looks like this:
void TestFunction(object oPC)
{
//whatever this function does, etc, etc
}
/*IMPORTANT: Make sure you end this script with comments that start with the forward slash-asterisk at the end of it, but don't close it!!!!
If there is a /* at the end of the include, but no */ to close it up, it will allow the obviously messed up script above to compile without a problem! I'm not a coder or scripter by trade, so I assume just having a /* is not recommended practice. But it appears that was causing all of my scripts using this 'bad' include to compile without errors, when really they were not compiling at all. I'm not sure if it is something you can fix, but I just wanted to let you know.
Thanks - and again, this kicks butt!
Modifié par Thayan, 18 juillet 2011 - 05:07 .
#73
Posté 18 juillet 2011 - 10:12
It even caught a problem that the normal bioware debugger wasnt helping me out with much.
I had declared
void FunctionName(int arg1,int arg2);
and then called it via
object = FunctionName(int arg1,int arg2);
and having the definition as
object FunctionName(int arg1, int arg2)
{
}
When run in the bioware compiler, it returned a non-helpful message of
Unknown identifier ()
with no line number.
With the new compiler, it told me the line number, and function causing the problem.
Modifié par Baaleos, 18 juillet 2011 - 10:13 .
#74
Posté 18 juillet 2011 - 03:42
Thayan wrote...
SkywingvL, I apologize for never getting back to you in regard to my issue. I banged my head against a wall for ages and I think I have figure out what the problem is/was with my issue.
Say you have a simple script -#include "test_inc" int StartingConditional() { object oPC = GetPCSpeaker()))))))))))))); return TRUE; }
And the test_inc script looks like this:void TestFunction(object oPC) { //whatever this function does, etc, etc } /*IMPORTANT: Make sure you end this script with comments that start with the forward slash-asterisk at the end of it, but don't close it!!!!
If there is a /* at the end of the include, but no */ to close it up, it will allow the obviously messed up script above to compile without a problem! I'm not a coder or scripter by trade, so I assume just having a /* is not recommended practice. But it appears that was causing all of my scripts using this 'bad' include to compile without errors, when really they were not compiling at all. I'm not sure if it is something you can fix, but I just wanted to let you know.
Thanks - and again, this kicks butt!
You should get a warning if you have an unmatched comment at the end of the translation unit. Perhaps virusman can chime in on how warning-only notifications are communicated to the user with the NWN1 toolset integration.
#75
Posté 18 juillet 2011 - 05:05





Retour en haut







