Color Groups

From CoDWWModWiki

Jump to: navigation, search

Overview

Color groups is a coded AI travel system.

A colorCode is a color( red, blue, yellow, cyan, green, purple or orange ) and a #. When a trigger and AI and node are color grouped in Radiant, they get a unique color and #. When when a color coded trigger is hit, that colorCode is "fired" and any AI that are in colorCoded mode get their goalnode set.

AI can be forced to a color generically. For example if an AI is forced to the color "red" and a trigger fires off "red15", the AI will go to that node even if the AI doesn't have script_color_allies( or axis ) "red15". This is mainly for friendlies.

Implementation

Script Groups GUI with the AI Control Panel and steps to set color codes.
Script Groups GUI with the AI Control Panel and steps to set color codes.

Spawner

Select your Spawnerand press Shift + G (by default) to open the Script Groups GUI. On the top is the AI Control Panel. Select the Allies or Axis button depending on what the Spawner is, and select a color, and click Add.

Your Spawners now has a color group assigned, the Key Value Pair should look something like (may vary depending on the color you chose, R being Red):

"script_forceColor" "r"

AI

You can set the script_forceColor on the fly in your script. An example would be:

myGuy = getEnt( "sarge", "targetname" );
myGuy.script_forceColor = "b"; // Set them to Blue color group


Trigger & Nodes

To set the colorCode for a trigger and its corresponding nodes, you simply make a trigger_multiple and lay down a line of action nodes.

Select the trigger and nodes and press Shift + G (by default) to open the Script Groups GUI.

Select whether you want Allies or Axis, and which color group to be fired off and directed to the nodes. Once you have both options set, click Add.

When you now hit the trigger in-game, any AI with the corresponding colorCode(s) on the trigger will go to the corresponding nodes in the color group.

Image:Note.pngNote: You can essentially have two groups fire off from the same trigger. The Value for script_color_allies would look something like "r0 b0" for red and blue 0 colorCodes. You can also have both allies and axis fired off from the same trigger.
Personal tools