• 0

    posted a message on Help with a condition

    @DirtyDevious: Go

    SmokeFX, I just saw your PM (sorry, was AFK for a bit). I set up a quick test with what you described and I agree that it seems that the behavior is lost as soon as the unit dies.

    Unfortunately, there is no way to set up the trigger to activate just before the unit dies. I tried setting a trigger for when a unit's life changes and added a condition that the unit's life = 0.0. I hoped that maybe this would get activated just before the unit "died" and lost its behaviors, but alas, it did not.

    I think the workaround here is what the other posters have described. In my CTF map I have a global Unit array called "FlagCarriers" and the indices in the array correspond to the player numbers (e.g. the unit that is carrying Player 1's flag is at FlagCarriers[1]). Bear in mind that the flag carrier unit will actually be an enemy of whatever Player it is. This way you can know whose flag was being carried by the unit.

    When a unit picks up the flag I set the appropriate entry in the array equal to the unit. When a flag carrier dies I set the corresponding entry to "No Unit". You can use this array in your "Any Unit Dies" trigger to know which flag to reset. Just loop through the array and check to see if the unit that died is in it. If you find a match then you know the player's flag that needs to be reset.

    Does that make any sense? I can elaborate with an example if necessary.

    Posted in: Miscellaneous Development
  • 0

    posted a message on Edit Production Time

    @MadMonkey199: Go

    There's a "Set Unit Color" action, but that will only set the unit's color to one of the pre-defined player colors (Red, Blue, Purple, Teal, etc.).

    There's also a "Color" property for every model, maybe that will work? I haven't tried it myself, but I have a feeling it will get overridden by the color of the owning player.

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