Colour Change

Levdragon

Member
Reaction score
2
Hey,

I was wondering how to make so when you make a unit (Rifleman) it will chose a colour out of blue,green,purple and yellow when you build it.

Also make a 50/50 chance that a it makes footman instead of a rifleman with the colour change too.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
If you mean changing that actual color (example: making the rifleman FULLY red) then you should look under animation - Set Unit Vertex Coloring and modify the fields accordingly.

If you mean to change the color (player color) then look under unit, and maybe you'll find what you are looking for. (Maybe something like "change ownership" or "Change Player Color", something along those lines)

Then if you want the other thing (sorry, all of this post is freehand)
Code:
Trigger
    Events
        Unit - Blah finishes construction
//Whatever the event is for that =P
    Conditions
//Whatever your conditions are
    Actions
        Set IntegerVar = Random Integer beetween 1 and 100
        If IntegerVar > 50 then
            Unit - Replace Blah with <Footman>

If you get the main idea of what I'm trying to convey. lol :D

Just experiment and look around until you find something similar to what I have posted. ;)
 

Levdragon

Member
Reaction score
2
Hmm, I'll test the code soon I don't have time right now but I still need the colour command, I'll say again-When you create a unit it will change team colour to either blue,green,purple or yellow. one of those 4 colours not all the colours. Please help me with this I've tried to complete it but my attemtps are futile.
 

the_ideal

user title
Reaction score
61
Do you know how to write triggers?

Try this:
Code:
Event - a unit finishes construction
Condition - boolean: unit-type of (triggering unit) equal to (whatever your building is)
Action- Change color of (triggering unit) to (the color you want it)
 

Levdragon

Member
Reaction score
2
Thanks I do know how, but I want a randomized colour so it has a chance to change to one of those 4 colours at random not the same one every time, I belive u've midunderstood me.
 

vypur85

Hibernate
Reaction score
803
> blue,green,purple or yellow

Those are Player 1 to 4 right?


Try this:
Code:
Unit - Change color of (Triggering unit) to color of Player(Random number between 1 to 4))

Use color Player index...
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top