HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggers - creating a unit for owner of a unit in a region

07-30-2002, 08:25 PM#1
Guest
Basically... when a player has a Wisp in a certain region, I want that player to have a certain unit created for them every 5 seconds in another region.

Here's what I have:

Events:
Time - Every 5.00 seconds of game time

Conditions:
(Number of units in (Units in UpLeftA <gen> matching ((Unit-type of (Matching unit)) Equal to Wisp))) Equal to 1

Actions:
Here's where I don't know what to put... I need a way to reference the owner of the wisp that is in the location.

I know I can just do a different trigger for each player but I know there's gotta be an easier way than that.

Any help is appreciated.. thx!
07-30-2002, 08:27 PM#2
Guest
Quote:
Originally posted by xSERPENTORx
Basically... when a player has a Wisp in a certain region, I want that player to have a certain unit created for them every 5 seconds in another region.

Here's what I have:

Events:
Time - Every 5.00 seconds of game time

Conditions:
(Number of units in (Units in UpLeftA <gen> matching ((Unit-type of (Matching unit)) Equal to Wisp))) Equal to 1

Actions:
Here's where I don't know what to put... I need a way to reference the owner of the wisp that is in the location.

I know I can just do a different trigger for each player but I know there's gotta be an easier way than that.

Any help is appreciated.. thx!

Change Unit-type of (Matching Unit) Equal To Wisp to just Unit-Type of (Wisp)

That may do it
07-30-2002, 08:30 PM#3
Guest
Quote:
Originally posted by Madacc


Change Unit-type of (Matching Unit) Equal To Wisp to just Unit-Type of (Wisp)

That may do it

No... Referencing the type of unit works fine. I just need a way to reference the OWNER of that unit.
07-30-2002, 08:31 PM#4
Guest
Quote:
Originally posted by xSERPENTORx


No... Referencing the type of unit works fine. I just need a way to reference the OWNER of that unit.

Do a player owned unit event.. and do Unit-Type (Wisp) owned by Player 1 (red)
07-30-2002, 08:51 PM#5
Guest
Quote:
Originally posted by Madacc


Do a player owned unit event.. and do Unit-Type (Wisp) owned by Player 1 (red)

I need it to execute every 5 seconds so I need the event to pe time period - Every 5 seconds.

Also... I'm trying to make the trigger not specific to the player.. that way I don't have to make a seperate trigger for each player.
07-30-2002, 11:40 PM#6
Guest
Unit Group - Pick all units in UpLeftA <gen> matching ((Unit-type of (Matching unit)) Equal to Wisp and do Unit - create 1 [unit] for owner of picked unit at.....

This will work well because you're only allowing 1 unit to be in the region at a time through your condition. If there could be more than 1 wisp, then you'd have to do a lot more checks to see who owns which unit.

One problem with the timer method is that it would mean that units start to appear for the first time on an inconsistant basis. the first one could appear anywhere from .01 to 4.99 seconds upon entry. You could turn this trigger on and off when needed, but that could be more difficult depending on what your game is going to be like.
07-31-2002, 06:08 AM#7
Guest
Quote:
Originally posted by DrunkOM
Unit Group - Pick all units in UpLeftA <gen> matching ((Unit-type of (Matching unit)) Equal to Wisp and do Unit - create 1 [unit] for owner of picked unit at.....

This will work well because you're only allowing 1 unit to be in the region at a time through your condition. If there could be more than 1 wisp, then you'd have to do a lot more checks to see who owns which unit.

One problem with the timer method is that it would mean that units start to appear for the first time on an inconsistant basis. the first one could appear anywhere from .01 to 4.99 seconds upon entry. You could turn this trigger on and off when needed, but that could be more difficult depending on what your game is going to be like.

Events:
Time - Every 5.00 seconds of game time.

Conditions:
None

Actions:
Unit Group - Pick every unit in (Units in UpLeftA <gen>
matching ((Unit-type of (Picked unit)) Equal to Wisp)) and do (Unit
- Create 1 Footman for (Owner of (Picked unit)) at (Center of
UpLeftspawn <gen>) facing (Center of (Playable map area))))

Why doesn't this work?
07-31-2002, 09:40 AM#8
Guest
Because even though 2 different people told you what to do on two different forums, you can't follow what they told you to do.

((Unit-type of (Matching unit)) Equal to Wisp))

you're in the process of picking the unit, there isn't a picked unit yet.
07-31-2002, 09:45 AM#9
Guest
I misread it... sorry