| 07-28-2004, 07:50 PM | #1 |
I Can Not Figure It Out I Think I Have Most Of It Can Some Just Lay It Out To Me? :( |
| 07-28-2004, 07:53 PM | #2 |
sry i didnt mean to doouble post i didnt relize it posted the first time cuz i was still in the new thread screen |
| 07-28-2004, 08:18 PM | #3 |
Say you have an area that spawns goblins create a region over the area and create this trigger: Code:
Event: Every 60 seconds (or however long you want respawn interval) Condition: (Number of units in (units in (*Your Region))) Equal to 0 Action: Create 6 Goblins for Neutral Hostile |
| 07-28-2004, 08:52 PM | #4 | |
Quote:
but if i cant figure this wat out i will do it that way... |
| 07-28-2004, 11:46 PM | #5 |
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>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] = TrueNext 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))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))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.mdlCode:
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-29-2004, 01:35 AM | #6 |
THX MAN UMM 1 question is this like dynamic spawning? |
| 07-29-2004, 01:59 PM | #7 |
What do you mean by Dynamic? If theres 10 monsters, no more monsters will spawn, if that's whay you mean. |
| 07-29-2004, 07:02 PM | #8 | |
Quote:
i mean like i want the guys to be there the whole time not if i enter a location they start spawning i want em to spawn always like dark lineage u know wat that is? |
| 07-29-2004, 10:01 PM | #9 |
For a great example, proabably the base for the responses here, look at the Warchasers mpoa that came in the scneario folder of the original ROC, i still use roc, not tft, so it may not have been shipped with tft..but if it was, then look throuhg the triggers in it: a great way to learn most low lever and mid level triggering solutions -Fellow mapper/triggerer -Horus |
