Something like this should work. I'm not entirely sure that the number 7 in the Attributes array is the index for "Structure". You will have to test it.
Variable-SetIsStructure=(Integer((ValueofUnits"UnitNameRawData""Attributes[7]"forplayer1)))General-If(Conditions)thendo(Actions)elsedo(Actions)IfIsStructure==1Then------- Yes, it's a structure! :DElse------- No, it's not a structure! :(
as i can see her you use a local integer variable called IsStructure
and then you convert something to integer (real to integer?!)
and the you use a function i also don't know x.x
but it seems like you set the integer to the count of units that has the condition:
Value of Units "UnitNameRawData" "Attributes[7]" for player 1
and then if it is 1 its a structure and else it's not.....
may you can attach the map (i use the german editor so it's hard to find the german version of it)
bump. I have this exact same question, and I can't find this function "UnitNameRawData" that Kafoso described or anything similar to it. The closest thing I can find that distinguishes something as a structure versus a military unit is "Unit type of unit", but that only has "destructible" and I believe that only applies to miscellania in the background that blows up when you touch it, not destructible structures.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
as i said on the title i search the condition if a unit is a building or not. it seems very easy but i can't find it x.x
thx
Yes a building is a unit but with a flag "structure".
I think it is "unit classification check" that you're looking for.
as raw data it's UnitTypeTestFlag i think and i allready looked into it but only found things like: Cloaked, Hero, Destructable, Missile, Worker....
(i used search also!)
bump
plz say it as raw data or attach a simple map with the condition so i can cnp it :)
@HellGateSc2: Go
Something like this should work. I'm not entirely sure that the number 7 in the Attributes array is the index for "Structure". You will have to test it.
@Kafoso: Go
as i can see her you use a local integer variable called IsStructure and then you convert something to integer (real to integer?!) and the you use a function i also don't know x.x
but it seems like you set the integer to the count of units that has the condition: Value of Units "UnitNameRawData" "Attributes[7]" for player 1
and then if it is 1 its a structure and else it's not..... may you can attach the map (i use the german editor so it's hard to find the german version of it)
bump. I have this exact same question, and I can't find this function "UnitNameRawData" that Kafoso described or anything similar to it. The closest thing I can find that distinguishes something as a structure versus a military unit is "Unit type of unit", but that only has "destructible" and I believe that only applies to miscellania in the background that blows up when you touch it, not destructible structures.