spirit6
Jun 23 2009, 08:35
Hey guys,
I am busy with a small mission generator. Nothing truely major but i am stuck in one area.
At the moment i can put the group name from the existing vehicle configs in a piece of software. Basicly you give a group name from the config as a parameter. The code down under can , based on infantry group names in the config, reproduce that group.
The downside is i cannot create the mixed and armor like groups as the vehicles need their crew / commanders.
here is the code for CfgGroupsCreator.sqf
=============================
#define CONFIG (configFile >> "CfgGroups" >> _this select 0 >> _this select 1 >> _this select 2 >> _this select 3)
private ["_position", "_sides", "_unitCfg", "_class", "_side", "_rank", "_formationPosition", "_group", "_unit"];
_position = _this select 4;
_sides = [east, west, resistance, civilian];
_group = grpNull;
// Enumurate the CfgGroups Config, selected side, faction and type
for "_i" from 0 to ((count CONFIG) - 1) do
{
_unitCfg = CONFIG select _i;
if (isClass(_unitCfg)) then
{
_class = getText(_unitCfg >> "vehicle");
_side = _sides select getNumber(_unitCfg >> "side");
_rank = getText(_unitCfg >> "rank");
_formationPosition = getArray(_unitCfg >> "position"); // TODO: modify _position x,y,z with _formationPosition x,y,z to get specific spawn positions
if (isNull _group) then { _group = createGroup _side };
player globalChat "TEST1" + str(_side);
_group createUnit [_class, _position, [], 0, "NONE"];
};
};
_group
Now this code needs to be expanded so that it basicly spits out a group on if that is mixed or armor, airforce dont matter. Can anybody give me/ help me with the code to simple spawn that stuff?
I know that the create unit part needs to be something like " get from config animation" if is man then create unit else search the wheeled/tracked etc.
So for exmaple i want the mech infantry gorup spawned, now this script should simple get that group name and figure it all out.
Who can help? I tried to look at code from DAC and RTE but i gues i am to noobish to get that done. Simple recreate a group should not be rocket science i think.
================
As i look through the forum the bis_functions in arma 2 seem to contain spawn scripts. Maybe that can be the help and the need to develop is out dated?
I am busy with a small mission generator. Nothing truely major but i am stuck in one area.
At the moment i can put the group name from the existing vehicle configs in a piece of software. Basicly you give a group name from the config as a parameter. The code down under can , based on infantry group names in the config, reproduce that group.
The downside is i cannot create the mixed and armor like groups as the vehicles need their crew / commanders.
here is the code for CfgGroupsCreator.sqf
=============================
#define CONFIG (configFile >> "CfgGroups" >> _this select 0 >> _this select 1 >> _this select 2 >> _this select 3)
private ["_position", "_sides", "_unitCfg", "_class", "_side", "_rank", "_formationPosition", "_group", "_unit"];
_position = _this select 4;
_sides = [east, west, resistance, civilian];
_group = grpNull;
// Enumurate the CfgGroups Config, selected side, faction and type
for "_i" from 0 to ((count CONFIG) - 1) do
{
_unitCfg = CONFIG select _i;
if (isClass(_unitCfg)) then
{
_class = getText(_unitCfg >> "vehicle");
_side = _sides select getNumber(_unitCfg >> "side");
_rank = getText(_unitCfg >> "rank");
_formationPosition = getArray(_unitCfg >> "position"); // TODO: modify _position x,y,z with _formationPosition x,y,z to get specific spawn positions
if (isNull _group) then { _group = createGroup _side };
player globalChat "TEST1" + str(_side);
_group createUnit [_class, _position, [], 0, "NONE"];
};
};
_group
Now this code needs to be expanded so that it basicly spits out a group on if that is mixed or armor, airforce dont matter. Can anybody give me/ help me with the code to simple spawn that stuff?
I know that the create unit part needs to be something like " get from config animation" if is man then create unit else search the wheeled/tracked etc.
So for exmaple i want the mech infantry gorup spawned, now this script should simple get that group name and figure it all out.
Who can help? I tried to look at code from DAC and RTE but i gues i am to noobish to get that done. Simple recreate a group should not be rocket science i think.
================
As i look through the forum the bis_functions in arma 2 seem to contain spawn scripts. Maybe that can be the help and the need to develop is out dated?