• 0

    posted a message on [Triggers] Setting unit's colors by triggers

    I've spent quite a bit of time looking around in the editor aswell as on the forums trying to figure out how to dynamically change the color of units using triggers. I eventually came with the solution and thought I'd share this with everyone who currently has the same problem as I had.

    Problem: Convert the color of a basic bunker to a completely different color using a trigger.

    Change this bunker:

    http://screenshot.xfire.com/s/101068786-4.jpg

    To this bunker:

    http://screenshot.xfire.com/s/101068782-4.jpg

    Although the solution to this is in fact quite simple, it took me a lot of time to find this.

    Here's the solution(In a pick each bunker loop, it's possible to set individual units and the like as with any other trigger):

    To set it to a completely white color;

    Actor - Send actor message (Set Tint Color (100%, 100%, 100%) with HDR 1.0 over 0.0 seconds) to main actor of unit (Picked unit)

    To set it as the color of the player;

    Actor - Send actor message (Set Tint Color (Color((Current player (Owner of (Picked unit)) color))) with HDR 1.0 over 0.0 seconds) to main actor of unit (Picked unit)

    Note how its possible to set other value's of these individual item actors, size, their team color instead of tint color, basically everything you can do in the data editor.

    Edit;

    Setting the actors of AI controlled units currently seem to have no support for this function, however it works fine with player controlled units.

    Edit2: Found out what the problem was with computer controlled units, use "Tint color", instead of "Local tint color" Adjusted the rest of the tutorial to reflect this

    Posted in: Tutorials
  • 0

    posted a message on Fastest way to transfer control of all units to player

    Set the game end statement outside of the pick each loop... behind it, it will then change all the units ownership and then end the game.

    And remove the wait in the loop

    Posted in: Miscellaneous Development
  • 0

    posted a message on Upgrade cost

    I'm working on a spawn-based map, I've gotten nearly everything done in about 8 hours in total, with no previous experience with the map editor. However I'm stuck on one thing;

    I currently have an upgrade button that adds 5 minerals to the cost each time, it starts at 5, then goes to 10,15 etc. What i want is that the cost increase stops at 50, so for 9 time's in a row it gets its cost increased by 5, and then stops increasing. I've been searching for some kind of max mineral cost, but I couldn't find it.

    Does anyone have a solution for this?

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