HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Noob Question: Critter Respawn

08-08-2003, 03:06 AM#1
Dark_Army
Easy enough question. I am new to critter spawning, and what trigger would I make to respawn a critter (or group of critters) after they die, say after 140 seconds.

Do I create any regions?

If someone could give me the full instructions I would really appreciate it.
08-08-2003, 04:00 AM#2
junithorn !
Simple trigger

E - Every 140 seconds
A - Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Create 1 Stag for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees)


that makes a new one every 140 seconds.
08-08-2003, 04:01 AM#3
junithorn !
What i would do:

E - every 140 seconds
A - Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Explode (Picked unit))
08-08-2003, 06:09 AM#4
Silenkiller
Quote:
Originally posted by Dark_Army
Easy enough question. I am new to critter spawning, and what trigger would I make to respawn a critter (or group of critters) after they die, say after 140 seconds.

Do I create any regions?

If someone could give me the full instructions I would really appreciate it.


Junit.. i think he is looking for a way so when creeps die they respawn.. unless im mistaken ur trigger just keeps making them =?

Here, try this

Events: A unit owned by Neutral Hostile Dies
Conditions:
Actions: Wait game time or whatever, lets say 20 seconds
Replace (dying unit) with a (unit-type of (dying unit) using the new unit's max life and mana.
08-08-2003, 07:53 AM#5
Divvy
My first post in this forum :) If anyone has played those open RPG maps Slivers etc how is it made there? Actually they are not protected so I could just check.

Anyway the way those kinda triggers are made in those maps have a SERIOUS problem. If you use dark arrows they don't respawn anymore. I figure it replaces the corpse with a new unit and when you use dark arrow there are no corpses.

Fun ridding the map of all the creeps hehe, makes the map completly pointless.
08-08-2003, 01:28 PM#6
Grater
Okay there are a few possible ways, depending on specific requirements.

Heres one possible way, I know of several others that work in different ways to give subtely different results.

Basic idea:
When a critter dies, make a copy of it and hide,pause the copy. I'll call it a ghost.
When it's time to revive the critters, just unhide all the ghosts :)

Heres one possible implementation, pretty much as simple as they get. It's black arrow safe and uses 1 variable, "Creeps" - a unit group. It is 3 triggers.
Code:
Populate Array
    Events
        Map initialization
    Conditions
    Actions
        Unit Group - Add all units of (Units owned by Neutral Hostile) to Creeps



Creep Dies
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        ((Dying unit) is in Creeps) Equal to True
    Actions
        Unit Group - Remove (Dying unit) from Creeps
        Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Position of (Dying unit)) facing Default building facing degrees
        Unit Group - Add (Last created unit) to Creeps
        Unit - Hide (Last created unit)
        Unit - Pause (Last created unit)
        Unit - Turn collision for (Last created unit) Off


Respawn
    Events
        Time - Every 140.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Creeps and do (Actions)
            Loop - Actions
                Unit - Unhide (Picked unit)
                Unit - Unpause (Picked unit)
                Unit - Turn collision for (Picked unit) On


Chances are you'll want to have some additional conditions for choosing whether or not to respawn particular creeps....
Also to make it charm/posses safe you need to write another trigger simialler to the "creep dies" one using the "unit changes owner" event.