I was trying to combine a couple of mods (Zabrak Field Goggles & Kreia's Assorted Robes) and decided to give a go at recompiling k_oei_spawn.ncs and k_oei_userdef.ncs. I used to be pretty handy with C programming but it's been about 7 or 8 years since I've had a serious stab at it. Merged the k_oei_hench_inc.nss file by copying over the custom functions from both mods, but I keep getting a compile error from one of the functions from the Kreia's Robes mod:
k_oei_hench_inc.nss(89): Warning: Invalid character '#' (0x23) found in source, ignored
k_oei_hench_inc.nss(89): Syntax error at "DAMEMORY1"
k_oei_hench_inc.nss(89): Warning: Invalid character '#' (0x23) found in source, ignored
so line 89 from the script is:
if (sCurr == "a_robe_02") nType = #2DAMEMORY1#; /* Padawan Robe */
I've tried using the KOTOR Tool internal compiler and HazardX's compiler, but get the same error with both of them. I was hoping someone could shed some light on it. Though if not, it wouldn't be the end of the world, I can do most of the stuff from the ZFG mod manually with the save editor.
if (sCurr == "a_robe_02") nType = #2DAMEMORY1#; /* Padawan Robe */
I've tried using the KOTOR Tool internal compiler and HazardX's compiler, but get the same error with both of them. I was hoping someone could shed some light on it. Though if not, it wouldn't be the end of the world, I can do most of the stuff from the ZFG mod manually with the save editor.
#2DAMEMORY1# is not part of NWScript, it is a token used by a TSLPatcher mod installer to insert a dynamic value in its place in the script source before the script is being compiled by the mod installer.
In this case I believe it inserts line numbers of new lines the installer has added to the user's appearance.2da file into the script, which is then recompiled. (Since you can't know in advance what line numbers the newly added lines end up as, depending on what other mods modifying the same file are used, this could not be hardcoded in the script from the start.)
If you want to manually recompile such scripts without using the installer the mod comes with you have to replace all #2DAMEMORY# tokens that exists in the NSS files with the valid values they are placeholders for, and any #StrRef# tokens with the dialog.tlk StrRef values they are placeholders for, before compiling.
Ok thanks, didn't realize that TSLPatcher did script compiling on the fly. So I guess theoretically I could modify the nss file then run the patcher again. Or I could just dig thru the patcher and try and figure out what the placeholder values are in the 2da file. Thanks much.
All the source scripts for Kreia's Robes should be included with the mod.. and I tried to make it easy to find the comments should you need to dig deep into the script :)
Thanks guys, I just subbed in the line numbers from my patched appearance.2da and it worked. I didn't realize that TSLpatcher was able to dynamically insert values into scripts before compiling them. ChAiNz thanks for the comment blocks it did make it really clear what was new and what was stock. If I do anything cool enough to release script-wise I'll definately set up my source scripts the same way.