HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spawning Point Help!

07-21-2004, 08:18 AM#1
LightHeart84
I'm trying to create a spawning point trigger that does the following. A creature in a camp is killed, then after a certain amount of time, it appears again. I need this trigger on an infinite loop. Can anyone help me out?
07-21-2004, 08:27 AM#2
HexenLordX
Quote:
Originally Posted by LightHeart84
I'm trying to create a spawning point trigger that does the following. A creature in a camp is killed, then after a certain amount of time, it appears again. I need this trigger on an infinite loop. Can anyone help me out?

Try something like this

Events:
A unit dies
Conditions:
((Dying unit) is in (Units in (Camp01))) Equal to True
Events:
Wait 30 seconds
Unit - Create 1 (Unit-type of (Dying unit)) for (Owner of (Dying unit)) at (Center of (Camp01)) facing (Random point in (Camp01))

There's other spawn triggers out there if you look, but this is just something I use in my map, so give it a try, if it doesn't work do a quick forum search, I'm sure there's better ones out there.
07-21-2004, 09:15 AM#3
LightHeart84
Thx for the reply but it's not exactly what I'm looking for.
This is what I mean:

I need it so that when a specific unit at a specific starting point dies, regardless of where it is on the map, after a certain time, will respawn back to it's original starting point. Think of some MMORPGS like EverQuest or DAoC, where let's say you're camping a mob that drops a piece of your epic, you kill it, then after some time, it reappears back at it's spawning point. With the trigger you sent me, if the Unit does NOT die within the REGION, it will not respawn.

I've seen it done before, just don't remember where.... If this is impossible, I better start looking for some alternate ways of doing this =)
07-21-2004, 01:23 PM#4
CyborgDragon
This belongs in the trigger haven main page not the repository, please read the bold stickies.
07-21-2004, 02:28 PM#5
Milkman
Your answer is a monster array, paired with a few variables and some loops.

Here's an example:
First the Array for the monsters:
Code:
Initialize Monster Spawners
    Events
    Conditions
    Actions
        Set NumSpawners = 5
        -------- Note that 'frequency' controls how often the monster spawns. --------
        -------- 1 frequency is 0.5 seconds.  4 frequency is 2 seconds.  8 frequency is 
        -------- 4 seconds 
        -------- By default it is 4 (2 seconds)  --------
        For each (Integer A) from 0 to NumSpawners, do (Set Frequencies[(Integer A)] = 8)
        For each (Integer A) from 0 to NumSpawners, do (Set MaxMonsters[(Integer A)] = 7)
        For each (Integer A) from 0 to NumSpawners, do (Set EnableSpawners[(Integer A)] = True)
        Set MonsterSpawners[0] = Gnoll Hut 0050 <gen>
        Set SpawnTypes[0] = Murloc Tiderunner
        Set EnableSpawners[0] = False
        Set MonsterSpawners[1] = Gnoll Hut 2 0046 <gen>
        Set SpawnTypes[1] = Murloc Tiderunner
        Set EnableSpawners[1] = False
        Set MonsterSpawners[2] = High Elven Farm 0053 <gen>
        Set SpawnTypes[2] = Gnoll Poacher
        Set EnableSpawners[2] = False
        Set MonsterSpawners[3] = High Elven Farm 0051 <gen>
        Set SpawnTypes[3] = Gnoll Poacher
        Set EnableSpawners[3] = False
        Set MonsterSpawners[4] = Forest Troll Hut 0041 <gen>
        Set SpawnTypes[4] = Satyr
        Set EnableSpawners[4] = False
        Set MonsterSpawners[5] = Nerubian Ziggurat 0080 <gen>
        Set SpawnTypes[5] = Ghoul
        Set EnableSpawners[5] = False
                -------- Set initial frequencies --------
        For each (Integer A) from 0 to NumSpawners, do (Set InitialFrequencies[(Integer A)] = Frequencies[(Integer A)])
        Trigger - Run Initialise Monster Groups <gen> (ignoring conditions)
        Trigger - Turn on Monster Spawn Sweep <gen>
        Trigger - Turn on Monster Spawn Death <gen>
Numspawners is the total amount of spawningpoints. Maxmonsters is the maximum amount of monsters on one spot simultanioulsy.
This next trigger makes it so that all the triggers won't have to check all the time:
Code:
Enable Spawn Set 1
    Events
        Unit - A unit enters StartMonsterSpawners1 <gen>
    Conditions
        ((Owner of (Entering unit)) is in Playersgroup) Equal to True
    Actions
        Set EnableSpawners[0] = True
        Set EnableSpawners[1] = True
        Set EnableSpawners[2] = True
        Set EnableSpawners[3] = True
For each section, of spawnpoints you can have a region that enables this when a unit enters, or several regions since for events, only one has to be true.

Next Trigger:
Code:
Initialise Monster Groups
    Events
    Conditions
    Actions
        -------- I only trust 'set variable' to initialise an Array type --------
        For each (Integer A) from 0 to NumSpawners, do (Trigger - Run Set Up One Monster Group <gen> (ignoring conditions))
Another trigger, theese tow can be combined however, blizzard thinks that this way is better, don't know why.
Code:
Set Up One Monster Group
    Events
    Conditions
    Actions
        Unit - Create 1 SpawnTypes[(Integer A)] for Player 12 (Brown) at (Position of MonsterSpawners[(Integer A)]) facing Default building facing (270.0) degrees
        Set MonsterGroups[(Integer A)] = (Last created unit group)

What theese two does is that they create the initial monsters. If you preplace all the units, the map can become quite laggy when editing.

The initialize respsawn trigger:
Code:
Monster Spawn Sweep
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 0 to NumSpawners, do (If (((MonsterSpawners[(Integer A)] is alive) Equal to True) and ((Number of units in MonsterGroups[(Integer A)]) Less than MaxMonsters[(Integer A)])) then do (Trigger - Run Spawn One Monster <gen> (ignoring conditions)) else do (Do nothing))
Here's the trigger for respawning:
Code:
Spawn One Monster
    Events
    Conditions
    Actions
        -------- Addition for turning them on and off --------
        If (EnableSpawners[(Integer A)] Equal to False) then do (Skip remaining actions) else do (Do nothing)
        -------- I spawn one monster every time 'frequency' gets to zero --------
        Set Frequencies[(Integer A)] = (Frequencies[(Integer A)] - 1)
        If (Frequencies[(Integer A)] Not equal to 0) then do (Skip remaining actions) else do (Do nothing)
        -------- I restore the frequency --------
        Set Frequencies[(Integer A)] = InitialFrequencies[(Integer A)]
        Unit - Create 1 SpawnTypes[(Integer A)] for Player 12 (Brown) at (Position of MonsterSpawners[(Integer A)]) facing (Random real number between 0.00 and 360.00) degrees
        Unit Group - Add all units of (Last created unit group) to MonsterGroups[(Integer A)]
        -------- We could even play a special effect, here. --------
        Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
This trigger just removes the units that die from the unit group.
Code:
Monster Spawn Death
    Events
        Unit - A unit owned by Player 12 (Brown) Dies
    Conditions
    Actions
        For each (Integer A) from 0 to NumSpawners, do (If (((Dying unit) is in MonsterGroups[(Integer A)]) Equal to True) then do (Unit Group - Remove (Dying unit) from MonsterGroups[(Integer A)]) else do (Do nothing))

That would work fine, note, all thees triggers come from the blizzard rpg Warchasers. It's always a good idea to look in there if you have a problem.
I wont give you variable types and so on as you can just CnP this from Warchasersm i've done enough writing for some time.

Hope i helped you out.
07-25-2004, 10:37 PM#6
North_Blade(DA)
Im here with a different trigger question...i know how to SPAWN units, but i dont know how to make them say, attack move to a certain point after they spawn...im trying to make a game like dota, tides of blood, ect........


HALP!
o_O