Unit-Spawning Objective
Posted: Wed Jul 31, 2019 10:26 am
A while back, TommyCD1 intructed me how to write objectives to spawn units at all player starting point.
1st, extract all files from any .x map
2nd, open game.cfg, for each team, add an objective object's reaper ID
3rd, open objects.cfg, for each team, create an objective object with corresponding ReaperId number
4th, use Notepad++ to create another .cfg file (say objective_start.cfg) and include it in the map's types.cfg
5th, in that objective_start.cfg, create one object type for each objective object belonging to each team, like thus:
However, NO extra unit is spawned. I wonder where I did wrong ?
1st, extract all files from any .x map
2nd, open game.cfg, for each team, add an objective object's reaper ID
Code: Select all
Objectives()
{
ReaperId(1001); // This is the Objective Object's ReaperId, which must be unique
}
Code: Select all
CreateObject("objective_start_team1", 1001)
{
ObjectiveObj()
{
Condition();
}
}
Code: Select all
#include "objective_start.cfg"
Code: Select all
CreateObjectType("objective_start_team1", "Objective")
{
GameObj();
ObjectiveObj()
{
Condition("TRUE"); // This is the condition
Action() // This is the outcome when the condition is met
{
SpawnObjects()
{
Region("team1");
Direction(-90);
Formation("Basic");
AddType("army.unit.vikki");
}
SpawnObjects()
{
Region("team1");
Direction(-90);
Formation("Basic");
AddType("army.unit.riff");
}
SpawnObjects()
{
Region("team1");
Direction(-90);
Formation("Basic");
AddType("army.unit.thick");
}
SpawnObjects()
{
Region("team1");
Direction(-90);
Formation("Basic");
AddType("army.unit.scorch");
}
SpawnObjects()
{
Region("team1");
Direction(-90);
Formation("Basic");
AddType("army.unit.shrap");
}
SpawnObjects()
{
Region("team1");
Direction(-90);
Formation("Basic");
AddType("army.unit.shrap");
}
SpawnObjects()
{
Region("team1");
Direction(-90);
Formation("Basic");
AddType("army.unit.bullseye");
}
}
}
}