I'm having a problem with NWnsscomp, and I'm wondering if it's just me. What happens is this:
Regardless if I'm using KotOR Tool or using NWnsscomp directly from the command line, for certain scripts, it claims that it has compiled without any errors, but no output file is generated. It's seemingly random, except that once a given script file decides not to compile, I can rename, move, or even copy the text into an entirely new script, and it still won't generate any output. This makes me think that it has something to do with the text of the script itself. However, I haven't found any common denominator, such as a certain type of expression or a certain function call that is present in all failed files. From little three line scripts such as:
void Main()
{
object oPC = GetFirstPC();
object myrobes = CreateItemOnObject("jf_missionsrobe", oPC);
ActionEquipItem(myrobes, INVENTORY_SLOT_BODY, TRUE);
}
To an unmodified copy of k_inc_force.nss - they compile, but there's no output.
Anybody got any idea what's going on?
K1 or TSL?
TSL introduced a syntax error in the nwscript.nss
http://www.lucasforums.com/showthread.php?t=146472)
KotOR 1.
Sorry I didn't specify.
I have experienced this, and have second-guessed myself, but it seems to me that when using kotor tool as a compiler, I have to remember to change the specific output filetype to .ncs. I am convinced on my own part that those "failed" compilations are mostly user-error on my part.
I have never used nwnsscomp directly as my compiler, so I cannot speak to that experience.
I've tried extensively, specifying output as both nss and ncs, and the same scripts refuse to compile. Any idea why the below script would compile with no errors, but generate no output?
void Main()
{
object oPC = GetFirstPC();
object myrobes = CreateItemOnObject("jf_missionsrobe",oPC);
ActionEquipItem(myrobes, INVENTORY_SLOT_BODY, TRUE);
}
Well, using KTool Text Editor to compile the above script, it compiled to .ncs in about 11ms.
Then when I looked for the .ncs file, it was (and is) non-existent :lol:
Very strange indeed.... never seen this before. I will have to think about it a bit, but this is curious. I am wondering if it is because of the logic of CreateItemOnObject v. ActionEquipItem... but at this point at a bit of a loss.
I did some testing, and even if I change it to:
void Main()
{
}
it doesn't generate any output. Should Main not be capitalized?
I was able to get a nearly identical script to compile, where it was "main()" however.
interesting idea on the whole "Main" vs "main"... I have never capitalized main, and I just copy & pasted your script into the editor. I will test this in a minute for you. Wild wacky stuff.
Good news - I've tested an identical file, one saying
void Main()
{
}
and the other saying
void main()
{
}
They both compile fine, but the first doesn't generate any output, while the second does. Absolutely nothing changed other than that; same file, and I didn't even close the KotOR tool text editor between compiles.
I think this pins it down; for some reason, scripts with "Main()" compile, but NWnsscomp doesn't generate any output.
Qui-Gon, do your results match this?
Good news - I've tested an identical file, one saying
void Main()
{
}
and the other saying
void main()
{
}
They both compile fine, but the first doesn't generate any output, while the second does. Absolutely nothing changed other than that; same file, and I didn't even close the KotOR tool text editor between compiles.
I think this pins it down; for some reason, scripts with "Main()" compile, but NWnsscomp doesn't generate any output.
Qui-Gon, do your results match this?
Yes :D I just tested this on your earlier script with the AddEquip scripts, changed Main to main and compiled... and you have a working script that was properly output into my override. It seems that a tiny detail like a "M" where an "m" should be will hose the machine :p
Glad you figured it out, take this as confirmation on your problem and solution
Snazzy. Thanks for your help.