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.
Ah, that clarifies it. That's the sort of thing that I just have to get used to coming from other programming languages where you can call a method/function from anywhere instead of this silliness where you can't do it as an Action for some reason. I was having the same problems with Position of unit, but that answers it. Thanks.
A unit triggers an event. I want to get which player owns the triggering unit. I know you can do a conditional "Owner of unit" == player# which would execute the actions for the proper player, but I'd have to copy/paste this N times for an N-player game. Is there a more elegant way to do it?
Basically, I'd imagine something like:
for i=1 to <number of players>,
if "Owner of unit" == i,
int ownerID == i;
endif,
endfor
works, but I'm not really familiar with galaxy editor syntax/conventions.
0
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.
0
@nevjmac: Go
Ah, that clarifies it. That's the sort of thing that I just have to get used to coming from other programming languages where you can call a method/function from anywhere instead of this silliness where you can't do it as an Action for some reason. I was having the same problems with Position of unit, but that answers it. Thanks.
0
A unit triggers an event. I want to get which player owns the triggering unit. I know you can do a conditional "Owner of unit" == player# which would execute the actions for the proper player, but I'd have to copy/paste this N times for an N-player game. Is there a more elegant way to do it?
Basically, I'd imagine something like:
for i=1 to <number of players>, if "Owner of unit" == i, int ownerID == i; endif, endfor
works, but I'm not really familiar with galaxy editor syntax/conventions.
Thanks for any help.