WhiZard wrote...
If the error occured from an effect overload the display would be "StackOverflow", not "Too many instructions." So I am not convinced that this fluke is not a build up from stacking too many calls at once. (A delay command can take longer to carry out if there is competition).
Too many instructions means an infinite loop, right?
http://nwn.wikia.com/wiki/Loop"
Neverwinter Nights has a safeguard in place to prevent scripts from performing infinite loops, specifically a limit on the number of instructions a single script can execute. When this limit is broken, the game ends the script prematurely and reports "TOO MANY INSTRUCTIONS" to the player(s). There are a few cases where this "TMI" error is reported for other reasons, but usually it indicates the existence of an infinite loop."
What I'm saying is that SOMEHOW that Spit2's GetObjectInShape loop becomes infinite rather than ending normally and reacquires the animal companion an infinite number of times. Like if you looked at the loop it would be something like...
1.
Player
Animal
2.
Player
Animal
3.
Player
Animal
4.
Player
Animal
Animal
Animal
Animal
Animal
Animal
Animal
Animal
Animal
Animal
Animal
Animal
Animal
TMI cutoff
It should not trigger on the animal more than once per loop. But sometimes it does -- and I can't figure out WHY.
I mean, at most there are 10 calls a second happening during the fight in terms of stuff I'm doing.
4 from the boss/victim HP updating
1 from Hungerer
2 from existing Acid Clouds
2 from existing Webs
1 from Siphon
That's it. I have more calls than that per second going at the start of the module in the fight fight (10 from friendly NPCs plus potentially another 10-15 from enemy NPCs).
The problem is the Animal Companion somehow being counted an infinite number of times during the loop.
WhiZard wrote...
Have you tried this with a summon? PCs do not have onDamaged scripting, so if this occurs with a summon as well, then the issue is not your animal companion AI.
Not yet. Part of the problem is that it's very hard for me to reproduce it at all. It only happens rarely and with no real pattern that I can tell except that it occurs with scripts that do a loop to select damage targets.
I can try it with a summon but I'm not even sure when I could be sure that it's only an animal companion problem -- might not have the bug with a summon for a long time or something.
But the OnDamaged scripting is irrelevant anyway -- the question is HOW the OnDamaged script was called an infinite number of times in the first place!
Modifié par MagicalMaster, 30 octobre 2013 - 10:22 .