• 0

    posted a message on Is Unit a Building?

    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.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Get owner of unit

    @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.

    Posted in: Triggers
  • 0

    posted a message on Get owner of unit

    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.

    Posted in: Triggers
  • To post a comment, please or register a new account.