HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger question

12-06-2003, 12:17 AM#1
No Shelter
Edit: Okay solved my first question. heres another though

My map can have a max of 5 units, and theres a location for each, how would i make a unit be attatched to a location, but when he dies, another unit of a different type to be automatically attatched to the same location?

Heres an example.

Unit 1 is with location 1, unit 1 dies, so the summoner summons another unit, how would i make unit 2 be attatched to the same location? It might be a completly different unit type also.
12-06-2003, 01:01 AM#2
Eriond
I'm not exactly sure what you mean... so if I give the wrong adive, just clarify, k :D

Ok, from what I understand it, all you need are simple unit variables. Make a unit array variable and add the summoned or created unit to the Unit Array, using whichever region it's summoned in for the array number. That should get you what you need.

Here's an example:
Region is the unit group variable

Events - A Unit Dies

Conditions - None

Actions -
If //Unit Comparaison\\ (Dying Unit) is Region[1]
Then:
Create 1 (Your Unit Here) at Region 1
Set Region[1] to Last Created Unit
Else: Do Nothing

Do the same for the 4 other regions with another if then else function, like so.

If //Unit Comparaison\\ (Dying Unit) is Region[2]
Then:
Create 1 (Your Unit Here) at Region 2
Set Region[2] to Last Created Unit
Else: Do Nothing

There you have it... Now it's 'attached' to that region.
12-06-2003, 01:01 AM#3
Ligature
Let me see if I've got this straight -

these units are stuck in one place - with no movement speed? - and you want them, when summoned, no matter where the caster is, to end up being summoned at one of 5 particular points, but there can only be 5 of the units total, and only 1 at each point. ??

If that's the deal,

Just have a trigger that runs on event - unit enters the playable map area and condition - unit-type is equal to your unit type (you can put all your different unit-types into an OR operator). Make the trigger check each region in a region array you set up to see if there's one of these units already there. If all 5 spots are filled, hide and kill the entering unit. If one or more spots are empty, pick a random empty spot and move instantly the entering unit to the random spot.
12-06-2003, 01:33 AM#4
No Shelter
Okay Eriond that helped me some, but the unit doesn't automatically summon back, the caster must use a spell, and no the unit doesn't just stand there immobile.