Custom team colour

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
WYRMY
Posts: 102
Joined: August 11th, 2008, 6:36 am
Location: Australia

Custom team colour

Post by WYRMY »

Hi.
I'm trying to create the custom colour yellow for my campaign. In team-colours.cfg, I have this:

Code: Select all

#define __COLOUR_RANGE _CR_ID _CR_RGB_R _CR_NAME
    [color_range]
        id={_CR_ID}
        rgb={_CR_RGB_R}
        name={_CR_NAME}
    [/color_range]
#enddef

#define COLOUR_YELLOW
    EEE000,FFFFFF,100F00,FFF000#enddef

#define CUSTOM_COLOUR_RANGE
    {__COLOUR_RANGE yellow ({COLOR_YELLOW}) ( _ "Yellow")}
#enddef
And in my scenario code, I have this. (example)

Code: Select all

    [side]
        side=10
        colour={COLOUR_YELLOW}
        no_leader=yes
        team_name=foes
        user_team_name= _ "team_name^Foes"
    [/side]
The actual colour shows up in the units ellipse, but not in the mini-map in the top right corner. Anyone know what I'm doing wrong?
Sangel
Moderator Emeritus
Posts: 2232
Joined: March 26th, 2004, 10:58 pm
Location: New York, New York

Re: Custom team colour

Post by Sangel »

I'm no WML wizard myself, but if you do manage to get a Yellow team colour working, would you mind if I borrowed your code for my campaign? I have a faction for which it seems the most appropriate team colour.
"Pure logic is the ruin of the spirit." - Antoine de Saint-Exupéry
User avatar
WYRMY
Posts: 102
Joined: August 11th, 2008, 6:36 am
Location: Australia

Re: Custom team colour

Post by WYRMY »

Sure. The colour does actually work, just what I meant was that in the mini-map it shows up as red.
yellow.png
yellow.png (159.19 KiB) Viewed 1820 times
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Custom team colour

Post by zookeeper »

Well, are you actually using that [color_range] as a top-level tag? You never tell whether you use your CUSTOM_COLOUR_RANGE macro anywhere or not.
User avatar
WYRMY
Posts: 102
Joined: August 11th, 2008, 6:36 am
Location: Australia

Re: Custom team colour

Post by WYRMY »

Uh, I actually had no idea what I was doing. I just copied it from Invasion from the Unknowns team-colour cfg file. What should I actually do?
Post Reply