October 10th, 2008, 03:18 AM | #1 |
Join Date: Jul 2005
Posts: 145
|
simple spawner question
This is a simple question:
- I want an object that spawns an NPC - once the NPC is killed, it is respawned - if the object is interacted with, the NPC does not spawn again, and the object is removed The object remover is easy, what is the most efficient way of having an object-dependent respawner? |
October 10th, 2008, 12:30 PM | #2 |
Join Date: Nov 2006
Location: Seattle, WA
Posts: 11
|
Re: simple spawner question
If you want the NPC to respawn instantly, add the "<NPC> deactives" and then the "<NPC> activates" actions, in that order, to the NPC's death event. Add the conditional "<Scenery Object Interaction X> has not triggered" so the respawn only happens if no one has interacted with your object yet.
This is rather abrupt, though, so you'll probably want a short timer. Make the NPC's death start the timer, again making it conditional on the object not being used yet. Put the deactivation/reactivation on the timer trigger event. (The reason for deactivating the NPC is to get rid of the corpse. A mob is still active while its corpse is on the ground, and trying to activate an active mob does nothing. Corpses take over a minute to vanish naturally. If you're always going to wait longer than that to respawn, you won't need to do an early manual deactivation.) |
October 10th, 2008, 07:30 PM | #3 | |
Join Date: Dec 2004
Posts: 1,331
|
Re: simple spawner question
I would do this by making a cyclic timer that goes off every second and activates the NPC every time it goes off. That way the NPC respawns right after the corpse disappears. If you need it to respawn right after death, add an "<NPC> deactives" event to it's death as Unkala said.
Then, make the object interaction deactivate the timer, so that it stops triggering the NPC spawn. (And ofcourse, uncheck the NPC's "autorespawn" so that it doesn't spawn on it's own.) Unkala's method probably works too though. Whatever suits you best. Quote:
I'd use an (empty) dialog, make the NPC's death start the dialog, and make the end of the dialog trigger the deactivation/reactivation of the NPC. You can make the dialog last as long as you want the NPC to stay dead, thus basicly using it as a timer. |
|
October 10th, 2008, 10:00 PM | #4 | |||
Join Date: Nov 2006
Location: Seattle, WA
Posts: 11
|
Re: simple spawner question
Quote:
Quote:
Quote:
Using a dialogue as a substitute timer instead of an actual timer doesn't sound like a good way to avoid confusion... |
|||
October 10th, 2008, 11:38 PM | #5 | ||
Join Date: Dec 2004
Posts: 1,331
|
Re: simple spawner question
Quote:
If you want a longer respawn delay, you'll have to use the dialog delay and let the scenery interaction deactivate the dialog. Quote:
A dialog, while not as accurate, responds much better to being started again and again. |
||
October 11th, 2008, 05:02 AM | #6 | |
Join Date: Jul 2005
Posts: 145
|
Re: simple spawner question
Quote:
I did it this way at first, but there seems to be a bug. The NPC does stop spawning when the cyclic timer is deactivated. However, it then respawns later, in a different place, and on a much longer timer. So I'm gonna try some of the other ideas here, thanks! edit: ok, this method works fine. I set up a route to take, so the mob is going to attack some other NPC's I have standing around. The first invocation works fine, the mob spawns, and runs the route into the NPC's and gets killed. Then the mob respawns, and then runs the route into the NPC's, but HAS NO AGGRO. I can kill him with no aggro either. So I tried adding some "can attack NPC's" and "can attack player" but then the mob WON'T RUN THE ROUTE. This seems very buggy to me (been a programmer for 30 years). I just want a mob to spawn, run the route, attack NPC's and get killed, then spawn, run the route, ....... Last edited by olepi : October 11th, 2008 at 05:49 AM. |
|
October 11th, 2008, 12:16 PM | #7 | ||
Join Date: Dec 2004
Posts: 1,331
|
Re: simple spawner question
Quote:
Quote:
|
||
«
Previous Thread
|
Next Thread
»
Thread Tools | Search this Thread |
Display Modes | |
|
|
All times are GMT +2. The time now is 04:00 AM.