Assuming you are using the event "Unit enters region", you will need to use the function "Triggering unit" to get the unit that entered the region. There is also a function to get the Unit Type of Unit, which will fetch the id of the unit type, so "Marine" "Marauder" etc.
So the code would look like the following:
if (UnitType(TriggeringUnit) == "Marine) then...
If you need to compare to a predefined list, I would suggest learning some basic search algorithms. The most brute force is to loop through a list/array, and check each one. This works for small lists (anything under 20 would be fine), but if the list is longer, there are faster methods.
Hi, i need to make a comparison between a unit place on a specific region and a a list of units on data (F7)
like this:
if (any units place on "REGION 1" == (unit type"marine" or unit id "marine" or unit "marine") than make action..
I cant found any possibility to add command for make the name of unit type/id/or other: marine on condition.. pls help. THX
Assuming you are using the event "Unit enters region", you will need to use the function "Triggering unit" to get the unit that entered the region. There is also a function to get the Unit Type of Unit, which will fetch the id of the unit type, so "Marine" "Marauder" etc.
So the code would look like the following:
if (UnitType(TriggeringUnit) == "Marine) then...
If you need to compare to a predefined list, I would suggest learning some basic search algorithms. The most brute force is to loop through a list/array, and check each one. This works for small lists (anything under 20 would be fine), but if the list is longer, there are faster methods.
@ArcaneDurandel: Go
havent Unit type... have only:
yes i do it thx
My problem is that: I dont know the correct name of all function... if some one give me a link for learn it im happy.. bye