Scripts claim to compile, but don't sometimes?
#1
Posté 14 mars 2011 - 11:12
I've got custom scripts that I've changed - for example, to remove debugging messages that I put in earlier - that continue to act as if they were never changed even after a full build.
The function that's misbehaving is in an include file I made myself, so I assumed that it might require manual compilation of all scripts that use that include. However, even after opening, editing, and manually saving each script, starting with the include file and progressing through all the scripts that use the include, this behavior still continues.
Is there any known bug or common mistake that would cause this?
Thanks in advance for any help.
#2
Posté 14 mars 2011 - 11:32
#3
Posté 14 mars 2011 - 01:07
#4
Posté 14 mars 2011 - 01:22
#5
Posté 14 mars 2011 - 04:06
#6
Posté 14 mars 2011 - 04:28
When you 'include' a script, in another script.
If the included script is in a hak, and the script that is using the include file is not inside a hak, the script using the include, will NOT build fresh, because it will have included in it, hardcoded stuff from the hak version.
I had this same issue, I had to trace it from
ScriptA which was including ScriptB, which was including ScriptC which was the one which was in a Hak.
In order to get Script A and B to build fresh, I had to make sure that Script C was not in a hak, so it too would build.
#7
Posté 14 mars 2011 - 04:55
Baaleos wrote...
Note
When you 'include' a script, in another script.
If the included script is in a hak, and the script that is using the include file is not inside a hak, the script using the include, will NOT build fresh, because it will have included in it, hardcoded stuff from the hak version.
I had this same issue, I had to trace it from
ScriptA which was including ScriptB, which was including ScriptC which was the one which was in a Hak.
In order to get Script A and B to build fresh, I had to make sure that Script C was not in a hak, so it too would build.
Note - Once Script C is built fresh, it is then safe to put it back into the hak if desired.
#8
Posté 14 mars 2011 - 08:25
- The include file is not in a hak or override; it's one I wrote myself. Same with all the scripts that are using that include.
- When I made changes to the include (to add debugging messages), those changes worked. When I took the debugging messags back out, they refused to go.
- No compiler errors have appeared, either when saving the scripts or when doing a full build. I've made sure to save the include file with a void main(){} at the end, to reveal all errors, then save it again with the void main(){} commented out.
- The function that's refusing to give up its debugging messages appears in only one place - the include file - so I'm sure it's not duplicated elsewhere.
- I'm being sure to manually compile my include first, then any file that uses that include, then any file that includes those files, and so on, from top to bottom. At least, I think I am. I've gone over this again and again, assuming that I'm failing to compile some script somewhere, but I can't find any that I've missed.
---
One question that's bothering me quite a bit: I've been working under the belief that doing a full build recompiles all (non-hak, non-override) scripts. Is that actually true? I haven't been relying on this idea, but I still want to know if it's actually supposed to be true, or if I'm mistaken about that.
#9
Posté 14 mars 2011 - 08:31
If the changes doesn't manifest you must be doing something wrong, also compiling the include isn't a good idea, rather delete the include ncs file and in future compile it with any script that uses it to ensure you don't have there any error. Then compile all scripts if the include is used in numerours scripts in your module.
#10
Posté 14 mars 2011 - 08:33
#11
Posté 15 mars 2011 - 12:44
ShaDoOoW wrote...
Also, if you can test it as a singleplayer, consider debugging via NWN debugger. This overlooked feature is the best way to find out any errors in your scripts.
Well, I have never used the NWN debugger, that is used in singleplayer mode?
#12
Posté 15 mars 2011 - 02:04
#13
Posté 15 mars 2011 - 03:51
Thanks, all!
#14
Posté 16 mars 2011 - 02:39
#15
Posté 16 mars 2011 - 08:59
So, I changed the Lay on Hands feat category in my Community Patch for default AI, cos there were wrong set resulted in this ability wasn't afaik used at all. So I changed it into correct one (btw feat.2da, line 299, collumn CATEGORY, default value of 7 changed to 5). But the creature with this feat that also get very badly wounded and tried to use it become bugged. It had no effect and since she was still injured she tried that again and again still with no effect and also it "frozen" that creature animations.
So I went to find where is problem, I added debugs into default AI libraries and suddenly it worked. Which i can't explain...
When I resaved all nw_c2_default* AI scripts and just recompiled them without any change into any AI library it didn't worked and creatures were bugged with the Lay on Hands.
But when I resaved the x0_i0_talent library (with no change there) and recompiled them again, it magically start to work without problems.
I tried the same on few other libraries, but it haven't had this effect. And I also tried to look if there is this library compiled in core nwn datas, but it wasn't there, so how is this possible???
Modifié par ShaDoOoW, 16 mars 2011 - 09:02 .
#16
Posté 21 mars 2011 - 07:03
Also, I am an idiot.
I spent days trying to figure out which script was not compiling, when the actual problem was I had two identical debugging statements: one commented out, one not commented out.
Sorry for wasting everyone's time.





Retour en haut







