Problems with Script Hidden
#1
Posté 09 août 2011 - 01:48
Does anyone have any ideas why they would properly unhide without a full run-through, but fail to becom visible in a full run-through?
Also, I have 25 script hidden creatures in another area which behave properly in the full run-through.
I do have a script that causes certain creatures in the area to be script hidden as part of the ambience, but I turn it off before the part where the 62 creatures are revealed.
I am baffled!
#2
Posté 09 août 2011 - 04:02
#3
Posté 09 août 2011 - 04:29
How is the script getting hold of the creatures to un-hide them? Does it cycle through all creatures in the area and only unhide those with a specific tag, or are they in a custom group? If the former, then a slight delay between un-hidings might be kinder on the game engine (0.01 sec for the first, 0.02 for the second, etc).
Could you not spawn them via an encounter instead? It might be a bit more stable.
#4
Posté 09 août 2011 - 11:22
Lugaid of the Red Stripes wrote...
Having disable AI when hidden set to FALSE might cause it, though I assume you haven't changed that in the meantime. It's also possible that some other section of code set them off--I've seen NPCs keep attacking creatures after they've become scripthidden. So maybe something else is causing your allied NPCs to attack the nearest hostile creature, some legacy NWN code that doesn't take into account being scripthidden.
I do have a script that could possibly have changed disable AI to false. I'll check it. That could explain why they remain hidden but still do stuff.
#5
Posté 09 août 2011 - 11:28
If you have disabled the AI while hidden, and they are remaining invisible when un-hidden, then you may be pushing the limits of script-hidden-ness trying to un-hide so many at once.
[/quote]
I'm hoping that is not the case and I think it may not be since everything worked great when I was doing testing on this script without a full run through, but I don't know. Could going through several areas versus just 2 like I did in the isolated testing change how the game engine addresses script-hidden?
[quote]
How is the script getting hold of the creatures to un-hide them? Does it cycle through all creatures in the area and only unhide those with a specific tag, or are they in a custom group? [/quote]
Each of the creatures has a specific tag and I use a loop to cycle through them. it is coded like this:
while (nCounter<32)
{
do stuff that unhides creatures;
}
[quote]
If the former, then a slight delay between un-hidings might be kinder on the game engine (0.01 sec for the first, 0.02 for the second, etc).
[/quote]
I'll try that. Thanks.
[quote]
Could you not spawn them via an encounter instead? It might be a bit more stable.[/quote]
[/quote]
I had not thought of doing this. One challenge I have with this is I have a script that has to run on them to make them charge across the battlefield, but I suppose I could put that in their "on spawn" script, right? This is definitely an option. Thanks.
#6
Posté 09 août 2011 - 03:10
Are you placing the creatures in the toolset, or spawing them via script?
#7
Posté 09 août 2011 - 03:18
#8
Posté 09 août 2011 - 04:22
Lugaid of the Red Stripes wrote...
With large numbers, I think script-hidden is the way to go. For most of my big battles I spawn them script-hidden on the player's area enter event (not client enter), and unhide them at the appropriate time. Mass spawnings always create some sort of lag.
Are you placing the creatures in the toolset, or spawing them via script?
I placed them in the toolset.
#9
Posté 09 août 2011 - 04:23
BartjeD wrote...
Did it work? (interested)
Not yet. I haven't gotten back to the toolset yet.
#10
Posté 10 août 2011 - 01:22





Retour en haut






