I'm feeling really stupid right now, but I'm trying to make it so if a unit enters a region that contains a certain type of structure, then it spawns some units. My issue is that I can only figure out how to do it with 1 specific structure. How do you reference a type of unit in the trigger editor?
Without knowing more about what exactly you're trying to do, I don't know for sure which piece of code will be most helpful. There are others that you can reference unit types in as well.
Thanks, I actually ended up using both. It's just a crude proof of concept that, when a unit enters an area, checks how many wolf dens are in the area and spawns the appropriate number of wolves (for the owner of the wolf dens).
Events
Unit - Any Unit Enters Region 003
Local Variables
Player Number = 0 <Integer>
Wolf1 = 0 <Integer>
Conditions
(Unit type of (Triggering unit)) == Marine
Actions
Variable - Set Player Number = 0
General - While (Conditions) are true, do (Actions)
Conditions
Player Number <= 12
Actions
Variable - Set Wolf1 = (Number of Living units in (Wolf Cave units in (Triggering region) owned by player Player Number matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
Unit - Create (Wolf1 * 3) Wolf1 - Wolf for player Player Number at (Center of (Triggering region)) facing (Position of (Triggering unit)) (No Options)
Variable - Set Player Number = (Player Number + 1)
Edit: I really need to learn how to use the formatting that this forum uses....
I'm feeling really stupid right now, but I'm trying to make it so if a unit enters a region that contains a certain type of structure, then it spawns some units. My issue is that I can only figure out how to do it with 1 specific structure. How do you reference a type of unit in the trigger editor?
@HamsterBoo: Go
Search for the tag "Unit Type of Unit" in your condition and you will find something like this:
Edit:
After re-reading your post, you might be looking for something like this instead? I still left my original post above if its still helpful.
Without knowing more about what exactly you're trying to do, I don't know for sure which piece of code will be most helpful. There are others that you can reference unit types in as well.
Thanks, I actually ended up using both. It's just a crude proof of concept that, when a unit enters an area, checks how many wolf dens are in the area and spawns the appropriate number of wolves (for the owner of the wolf dens).
Events
Unit - Any Unit Enters Region 003
Local Variables
Player Number = 0 <Integer>
Wolf1 = 0 <Integer>
Conditions
(Unit type of (Triggering unit)) == Marine
Actions
Variable - Set Player Number = 0
General - While (Conditions) are true, do (Actions)
Conditions
Player Number <= 12
Actions
Variable - Set Wolf1 = (Number of Living units in (Wolf Cave units in (Triggering region) owned by player Player Number matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
Unit - Create (Wolf1 * 3) Wolf1 - Wolf for player Player Number at (Center of (Triggering region)) facing (Position of (Triggering unit)) (No Options)
Variable - Set Player Number = (Player Number + 1)
Edit: I really need to learn how to use the formatting that this forum uses....