Page 1 of 1
Wandering mobs do not stop to fight
Posted: Sun Aug 10, 2008 6:44 pm
by John Adams
So I walked up to one of my invaders who is set to wander off shortly... attacked him, and beat him down a ways - then suddenly, he wanders off!! exactly as I instructed - however, I was fighting him at the time, so maybe they should ignore their moveto commands while in combat?
Posted: Sun Aug 10, 2008 8:54 pm
by John Adams
I have an opposite effect to this which I'll just lump in here. Using the new factions, I got the Invaders to wander to the two Defenders and get killed. It was thrilling to watch

However, when the invaders respawned, they did not move. Only one round of invaders per /repop.
Posted: Mon Aug 11, 2008 3:29 am
by LethalEncounter
When a mob respawns they call the respawn function of the LUA scripts. So you will need to have the same commands in both spawn and respawn functions. Alternatively you can create a LUA function in the script and just call it from both.
Posted: Mon Aug 11, 2008 6:27 am
by John Adams
Is there any reason why a respawned mob will not continue it's previous course of action automatically? Meaning, if a wandering gobbie gets killed, respawns 60 seconds later, why would it not just assume it needs to wander again?
We can write our scripts with the respawn function, I am just curious.
Posted: Mon Aug 11, 2008 2:31 pm
by LethalEncounter
Well when a spawn is removed from the zone all information associated with the spawn is removed as well so that when the new spawn respawns it is a fresh version of the spawn. The new spawn will have no knowledge of any previous spawn commands you gave to the last spawn which is why you need to include the commands in the respawn method as spawn is only called for the first spawned instance of the spawn.
Posted: Mon Aug 11, 2008 4:31 pm
by John Adams
~singing~ "Spawn, spawn, spawn, spawn, spawn-diddy spawn wonderful spawn!"
ugh...
Posted: Mon Aug 11, 2008 7:18 pm
by John Adams
Ok, part 2 of this is resolved by doing what you said, and using the function respawn(NPC):
Code: Select all
function respawn(NPC)
spawn(NPC)
end
However, I still have part 1 that is a problem.

Posted: Tue Aug 12, 2008 2:25 pm
by LethalEncounter
Yah, I am rewriting a lot of the NPC aattack and faction code so that will be fixed with it.