Hi! I'd like to write a function that given a Unit Type would return true if that type of unit can shoot at airborne units; false, otherwise. Any ideas?
Hmm I'm not sure of every option here but you could try creating a unit of that unit type somewhere off the map, check its weapon filter, then remove it RIGHT after.
Another solution could be using Catalog field values or w/e... you could check the weapon field of the given unit type... then use that weapon field to check the weapon catalog (the field of target filters..?)
That's how I was going to do it initially but I wanted to see whether there were any better ways to do this since it does feel a bit "hacky."
With regards to the catalog functions, how can I know the number of values in an array? I could look into the Unit Type's Weapons field but some units have one weapon and some have two.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi! I'd like to write a function that given a Unit Type would return true if that type of unit can shoot at airborne units; false, otherwise. Any ideas?
Unit types can't shoot anything. What you need to check is the weapon held by the unit.
There is condition for this. In Unit -> Weapon Target Check
Yeah, but Weapon Target Check takes a Unit. I only have a Unit Type and I need to determine whether units of that type can shoot up.
@Klishu: Go
Hmm I'm not sure of every option here but you could try creating a unit of that unit type somewhere off the map, check its weapon filter, then remove it RIGHT after.
Another solution could be using Catalog field values or w/e... you could check the weapon field of the given unit type... then use that weapon field to check the weapon catalog (the field of target filters..?)
try this then
@Nerfpl: Go
That's how I was going to do it initially but I wanted to see whether there were any better ways to do this since it does feel a bit "hacky."
With regards to the catalog functions, how can I know the number of values in an array? I could look into the Unit Type's Weapons field but some units have one weapon and some have two.