Jump to content
Sign in to follow this  
bigshotking

Spawning "Compositions"

Recommended Posts

This is the link that bring you directly to where I"m getting the class name of the Compositions.

http://www.armatechsquad.com/ArmA2Class151656165165341654165165165165f/A2/Objects/compositions/

I'm using this code to spawn the compositions:

_comp5 = "firing_range_targets11" createVehicle (getMarkerPos "m6_10");
_comp5 = setDirection 200;

Any ideas whats wrong?

Share this post


Link to post
Share on other sites

There is already a thread on this here.

But here you go:

_newObjs = [getmarkerpos "m6_10",200, "firing_range_targets11"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

Share this post


Link to post
Share on other sites

One more quick question, how can I delete this "Compositions" that I have spawned in?

Thanks in advance

-Bigshot

Share this post


Link to post
Share on other sites
_newObjs = [getmarkerpos "m6_10",200, "firing_range_targets11"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

Or instead or compiling script every time, you can use BIS_fnc_objectMapper function which does the same.

Share this post


Link to post
Share on other sites

So then if I want to delete the comp then would this work?

delete _newobjs;

Share this post


Link to post
Share on other sites

You have to delete the objects that make up _newobjs..... Try this....

{deleteVehicle _x} foreach _newobjs;

Share this post


Link to post
Share on other sites

im having major deja vu on this one, but this is also one way of getting rid of an entire composition, well, more of a workaround, but in Arma thats just another way :)

_before = nearestObjects [getmarkerpos "m6_10", [], 100];  // collect all objects in 100 meter radius before comp spawn.
// spawn your composition here.
_after = nearestObjects [getmarkerpos "m6_10", [], 100];  // collect all objects in 100 meter radius after comp spawn.
_compObjects = _after - _before; // fix the list with only comp components, (remove all pre comp list from after comp list)

// when you want to delete the composition:
{deleteVehicle _x} foreach _compObjects;

Share this post


Link to post
Share on other sites

It can be a good idea to put the objectMapper function within the mission itself. That way you can do modifications to it, like treat vehicles specially or fill ammo crates with custom content.

Share this post


Link to post
Share on other sites

"ca\modules\dyno\data\scripts\objectMapper.sqf"

What pbo is that script in?

I can unpbo it and modify the script so that I can put custom content in there.

Share this post


Link to post
Share on other sites

OK, I've noticed this in almost ALL of the Compositions...

This:

http://i409.photobucket.com/albums/pp177/bigshotking/ArmA2OA2011-07-3023-41-56-75.png

In the screen shot that is the error I get almost all the time, only a few of these compositions work.

After Un-Pboing the Modules file, I moved the correct folders to my mission folder. After going through a few of the sqf files I noticed this line missing from almost all of the compositions:

scriptName "DynO\data\scripts\compositions\bunkerMedium03.sqf";

That line was missing in all of the one's that were not working. I added it to the composition I'm trying to fix, yet I still get the error.

This is the script of the actual composition I'm trying to spawn (I added the "scriptname" line to it):

 scriptName "DynO\data\scripts\compositions\heli_park_ru1.sqf";
private ["_objs"];
_objs =
[
["HeliH",[1.09937,0.118408,-3.8147e-006],0,1,0],
["Land_coneLight",[-7.7998,-3.14648,0],261.372,1,0],
["Land_coneLight",[-6.0022,8.78149,-2.09808e-005],354.742,1,0],
["Land_coneLight",[6.3396,9.1394,1.14441e-005],17.8059,1,0],
["Fort_RazorWire",[-8.45801,-9.64697,0],254.96,1,0],
["Misc_cargo_cont_net1",[10.6997,10.5442,-1.90735e-006],339.694,1,0],
["Fort_RazorWire",[-3.56421,-16.7551,0],226.208,1,0],
["Fort_Crate_wood",[15.4314,5.97729,-1.90735e-006],192.031,1,0],
["Land_Barrel_water",[17.0234,2.88281,-9.53674e-006],116.478,1,0],
["Fort_Crate_wood",[16.7314,4.62988,3.8147e-006],214.7,1,0],
["Land_Barrel_water",[17.4822,3.61426,-2.28882e-005],109.532,1,0],
["Fort_Crate_wood",[16.875,6.0791,0],261.884,1,0],
["Land_Barrel_water",[17.729,2.89478,-1.90735e-006],98.0662,1,0],
["Fort_Crate_wood",[16.4595,7.28662,-1.90735e-006],169.75,1,0],
["Land_Barrel_empty",[17.886,2.22827,-3.8147e-006],13.6275,1,0],
["Land_Barrel_water",[18.2434,1.15308,5.72205e-006],105.811,1,0],
["Misc_cargo_cont_net2",[13.2908,13.8301,-0.0124054],110.769,1,0],
["Fort_RazorWire",[1.32471,-18.5627,0],358.709,1,0],
["RUBasicAmmunitionBox",[-18.7202,4.46948,3.8147e-006],236.973,1,0],
["Fort_RazorWire",[12.0999,-15.3577,0],145.063,1,0],
["Land_HBarrier_large",[19.2285,4.10107,7.62939e-006],260.108,1,0],
["Misc_cargo_cont_net3",[11.1116,17.271,-0.00634384],307.264,1,0],
["Land_fort_bagfence_long",[-19.8206,5.06396,-7.62939e-006],66.3481,1,0],
["Land_CamoNet_EAST",[13.4585,16.5337,-0.00155449],39.6884,1,0],
["Land_fort_bagfence_long",[-19.6875,7.96948,-3.8147e-006],118.945,1,0],
["Fort_RazorWire",[16.3042,-12.5032,0],328.977,1,0],
["Land_HBarrier_large",[21.3354,-4.4104,0],76.4689,1,0],
["Land_fort_bagfence_long",[9.06714,24.5249,0.00118828],173.746,1,0],
["Land_fort_bagfence_corner",[12.4226,24.7542,0.0281296],161.558,1,0]
];

_objs

This is the script that is calling on the composition:

_comp1 = [getmarkerpos "m11_6",0, "heli_park_ru1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

Also this is from the config file that relates to the composition that I'm trying to spawn:

 class HeliParking1_RU
{
 displayName = "$STR_DYNO_VEHICLEPARKING";
 side = 0;
 faction = "RU";
 objectScript = "ca\modules\dyno\data\scripts\compositions\heli_park_ru1.sqf";
 tags[] = {"helicopter","parking","east","ru"};
};

Is there something wrong here? Or am I not allowed to spawn almost any of these compositions?

Thanks in advance

-Bigshot

Edited by bigshotking
fix

Share this post


Link to post
Share on other sites

I don't know, I don't use that method, but rather pretty much like Gaia describes (except on a local copy of that function). The class you refer to I don't think we need to worry too much about, as it's more related to dynamic spawning based on tags, and a bit more complex than "I know what I want".

I'm guessing you actually do use CO and not only OA? OA alone probably will fail if trying to spawn russian stuff.

Share this post


Link to post
Share on other sites

Yes I am using CO, is there another way to spawn these compositions that don't want to work?

-Bigshot

Share this post


Link to post
Share on other sites

btw, here is what i did to collect all the current installed compositions in .rpt

place script in init.sqf and place yourself in center of a map(only if you want to see them), then wait for hint and check .rpt file for all glorious info.

PS: uncomment the _newComp line and place yourself in the lower left corner of the desert map and you can (hold ALT + click)teleport around viewing all different compositions, youll see markers on map with what they are.

// init.sqf

private["_posX", "_posY", "_i", "_cfg", "_count", "_cfgiName", "_markerName", "_cfgiTags"];

sleep 1;

_posX = (getPos player) select 0;
_posY = ((getPos player) select 1) + 50;

// Read Config File
_cfg =(configFile >> "CfgObjectCompositions");
_count = count _cfg;

hintSilent "Starting Composition Generation...";
_myCnt = 0;
for [{_i = 0}, {_i < _count}, {_i = _i + 1}] do
{
_cfgiName = configName (_cfg select _i);
_cfgiTags = getArray ((_cfg select _i) >> "tags");

// Create Marker
_markerName = createMarker["mrk" + _cfgiName, [_posX + (_i%8)*400, _posY + floor(_i/8)*90 + (_i%2)*45]];
_markerName setMarkerShape "ICON";
_markerName setMarkerType "FOB";
_markerName setMarkerText _cfgiName;

// Marker Color
if ("west" in _cfgiTags) then { _markerName setMarkerColor "ColorBlue"; };
if ("east" in _cfgiTags) then { _markerName setMarkerColor "ColorRed"; };
if ("resistance" in _cfgiTags) then { _markerName setMarkerColor "ColorYellow"; };

// Create Composition
//_newComp = [(getMarkerPos _markerName), (markerDir _markerName), _cfgiName] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
_myCnt = _myCnt + 1;
diag_log format["%1------%2------%3",_myCnt,_cfgiName,_cfgiTags];

};

hintSilent "..done!";

// Teleport with ALT + LMB
onMapSingleClick "
if ((local player) and _alt) then
{
(vehicle player) setPos _pos;
}";

Edited by Demonized
edit, i meant place yourself in lower left corner, not middle.

Share this post


Link to post
Share on other sites

This is the script that is calling on the composition:

_comp1 = [getmarkerpos "m11_6",0, "[b][color="Red"]heli_park_ru1[/color][/b]"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

Also this is from the config file that relates to the composition that I'm trying to spawn:

 class [b][color="red"]HeliParking1_RU[/color][/b] {
 displayName = "$STR_DYNO_VEHICLEPARKING";
 side = 0;
 faction = "RU";
 objectScript = "ca\modules\dyno\data\scripts\compositions\heli_park_ru1.sqf";
 tags[] = {"helicopter","parking","east","ru"};
};

Is there something wrong here? Or am I not allowed to spawn almost any of these compositions?

Thanks in advance

-Bigshot

I think the BOLDED line are where I think that is wrong... you must call the class name of the composition, not the scriptfile creating the composition

Share this post


Link to post
Share on other sites

Mr_Centipede is totally correct, from my cfgCompositions list i get this:

"46------[b]HeliParking1_RU[/b]------["helicopter","parking","east","ru"]"

the bolded part is what to use with spawning.

Share this post


Link to post
Share on other sites

Will try that out right now...

EDIT: Still not working

Edited by bigshotking

Share this post


Link to post
Share on other sites

this line works as is:

newComp = [(getPos player), (getDir player), "HeliParking1_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));  

tested.

Share this post


Link to post
Share on other sites

"1------SmallBase------["small","base","west","usmc"]"
"2------CityBase01------["medium","base","west","usmc"]"
"3------CityBase02------["medium","base","west","usmc"]"
"4------CityBase04------["medium","base","west","usmc"]"
"5------BunkerMedium01------["medium","bunker","west","usmc"]"
"6------BunkerMedium02------["medium","bunker","west","usmc"]"
"7------BunkerMedium03------["medium","bunker","west","usmc"]"
"8------BunkerMedium04------["medium","bunker","west","usmc"]"
"9------BunkerMedium05------["medium","bunker","west","usmc"]"
"10------BunkerMedium06------["medium","bunker","west","usmc"]"
"11------BunkerMedium07------["medium","bunker","west","usmc"]"
"12------BunkerMedium08------["medium","bunker","west","usmc"]"
"13------BunkerMedium09------["medium","bunker","west","usmc"]"
"14------BunkerMedium10------["medium","bunker","west","usmc"]"
"15------GuardPost_US------["small","guardpost","west","usmc"]"
"16------GuardPost2_US------["small","guardpost","west","usmc"]"
"17------GuardPost3_US------["small","guardpost","west","usmc"]"
"18------GuardPost4_US------["small","guardpost","west","usmc"]"
"19------GuardPost5_US------["small","guardpost","west","usmc"]"
"20------GuardPost6_US------["small","guardpost","west","usmc"]"
"21------GuardPost7_US------["small","guardpost","west","usmc"]"
"22------GuardPost8_US------["small","guardpost","west","usmc"]"
"23------SmallNest_US------["small","guardpost","west","usmc"]"
"24------VehicleShelter_US------["double","shelter","west","usmc"]"
Landcontact missing in FoldChair_with_Cargo:ca\misc2\table\chair_cargo.p3d
"25------FuelDepot_US------["large","fuel","west","usmc"]"
"26------CheckPoint1_US------["medium","checkpoint","west","usmc"]"
"27------AntiAir1_US------["anti-air","west","usmc"]"
"28------Firebase1_US------["firebase","artillery","west","usmc"]"
"29------FuelDump1_US------["fuel","west","usmc"]"
"30------RadarSite1_US------["radar","west","usmc"]"
"31------VehicleParking1_US------["vehicle","parking","west","usmc"]"
"32------HeliParking1_US------["helicopter","parking","west","usmc"]"
"33------AirplaneParking1_US------["airplane","parking","west","usmc"]"
"34------WeaponsStore1_US------["weapons","store","west","usmc"]"
"35------Camp1_US------["camp","tent","small","west","usmc"]"
"36------Camp2_US------["camp","tent","medium","west","usmc"]"
"37------Camp3_US------["camp","tent","medium","west","usmc"]"
"38------MediumTentCamp_RU------["medium","camp","tent","east","ru"]"
"39------MediumTentCamp2_RU------["medium","camp","tent","east","ru"]"
"40------MediumTentCamp3_RU------["medium","camp","tent","east","ru"]"
"41------AntiAir1_RU------["anti-air","east","ru"]"
"42------Firebase1_RU------["firebase","artillery","east","ru"]"
"43------FuelDump1_RU------["fuel","east","ru"]"
"44------RadarSite1_RU------["radar","east","ru"]"
"45------VehicleParking1_RU------["vehicle","parking","east","ru"]"
"46------HeliParking1_RU------["helicopter","parking","east","ru"]"
"47------AirplaneParking1_RU------["airplane","parking","east","ru"]"
"48------WeaponsStore1_RU------["weapons","store","east","ru"]"
"49------Camp1_RU------["camp","tent","medium","east","ru"]"
"50------Camp2_RU------["camp","tent","medium","east","ru"]"
"51------GuardPost_CDF------["small","guardpost","west","cdf"]"
"52------VehicleShelter_CDF------["medium","shelter","west","cdf"]"
"53------TankDitch_CDF------["medium","tankditch","west","cdf"]"
"54------TankDitch2_CDF------["medium","tankditch","west","cdf"]"
"55------CityBase03------["medium","base","west","cdf"]"
"56------BunkerSmall01------["small","bunker","west","cdf"]"
Cannot create non-ai vehicle WarfareBMGNest_PK_Ins,
"57------MediumTentCamp_napa------["medium","camp","tent","east","napa"]"
"58------SmallTentCamp_napa------["small","camp","tent","resistance","napa"]"
"59------SmallTentCamp2_napa------["small","camp","tent","resistance","napa"]"
"60------Camp1_INS------["camp","tent","small","east","ins"]"
"61------Camp2_INS------["camp","tent","small","east","ins"]"
"62------FiringRange1------["armory","firing range","west","us_army"]"
"63------FiringRange2------["armory","firing range","west","us_army"]"
"64------FiringRange3------["armory","firing range","west","us_army"]"
"65------FiringRange4------["armory","firing range","west","us_army"]"
"66------FiringRange5------["armory","firing range","west","us_army"]"
"67------FiringRange6------["armory","firing range","west","us_army"]"
"68------FiringRange7------["armory","firing range","west","us_army"]"
"69------FiringRange8------["armory","firing range","west","us_army"]"
"70------FiringRange9------["armory","firing range","west","us_army"]"
"71------FiringRange10------["armory","firing range","west","us_army"]"
"72------FiringRange11------["armory","firing range","west","us_army"]"
"73------FiringRange_Wreck1------["armory","firing range","wreck","west","us_army"]"
"74------FiringRange_Wreck2------["armory","firing range","wreck","west","us_army"]"
"75------FiringRange_Wreck3------["armory","firing range","wreck","west","us_army"]"
"76------FiringRange_Wreck4------["armory","firing range","wreck","east","tk_army"]"
"77------FiringRange_Wreck5------["armory","firing range","wreck","east","tk_army"]"
"78------FiringRange_Wreck6------["armory","firing range","wreck","west","us_army"]"
"79------FiringRange_Wreck7------["armory","firing range","wreck","west","us_army"]"
"80------FiringRange_Water1------["armory","firing range","water","west","us_army"]"
"81------FiringRange_Water2------["armory","firing range","water","west","us_army"]"
"82------SmallBase_EP1------["small","base","west","us_army"]"
"83------CityBase01_EP1------["medium","base","west","us_army"]"
"84------CityBase02_EP1------["medium","base","west","us_army"]"
"85------CityBase04_EP1------["medium","base","west","us_army"]"
"86------BunkerMedium01_EP1------["medium","bunker","west","us_army"]"
"87------BunkerMedium02_EP1------["medium","bunker","west","us_army"]"
"88------BunkerMedium03_EP1------["medium","bunker","west","us_army"]"
"89------BunkerMedium04_EP1------["medium","bunker","west","us_army"]"
"90------BunkerMedium05_EP1------["medium","bunker","west","us_army"]"
"91------BunkerMedium06_EP1------["medium","bunker","west","us_army"]"
"92------BunkerMedium07_EP1------["medium","bunker","west","us_army"]"
"93------BunkerMedium08_EP1------["medium","bunker","west","us_army"]"
"94------BunkerMedium09_EP1------["medium","bunker","west","us_army"]"
"95------BunkerMedium10_EP1------["medium","bunker","west","us_army"]"
"96------GuardPost_US_EP1------["small","guardpost","west","us_army"]"
"97------GuardPost2_US_EP1------["small","guardpost","west","us_army"]"
"98------GuardPost3_US_EP1------["small","guardpost","west","us_army"]"
"99------GuardPost4_US_EP1------["small","guardpost","west","us_army"]"
"100------GuardPost5_US_EP1------["small","guardpost","west","us_army"]"
"101------GuardPost6_US_EP1------["small","guardpost","west","us_army"]"
"102------GuardPost7_US_EP1------["small","guardpost","west","us_army"]"
"103------GuardPost8_US_EP1------["small","guardpost","west","us_army"]"
"104------SmallNest_US_EP1------["small","guardpost","west","us_army"]"
"105------VehicleShelter_US_EP1------["double","shelter","west","us_army"]"
Cannot create non-ai vehicle WireFence,
"106------FuelDepot_US_EP1------["large","fuel","west","us_army"]"
Error in expression <factor[0.3, 1]) min (rpm factor[1, 0.3])>
 Error position: <>
 Error Missing )
Error: Sound volume expression: 2*(1-camPos)*engineOn*((rpm factor[0.3, 1]) min (rpm factor[1, 0.3])
"107------CheckPoint1_US_EP1------["medium","checkpoint","west","us_army"]"
Error in expression <factor[0.3, 1]) min (rpm factor[1, 0.3])>
 Error position: <>
 Error Missing )
Error: Sound volume expression: 2*(1-camPos)*engineOn*((rpm factor[0.3, 1]) min (rpm factor[1, 0.3])
"108------AntiAir1_US_EP1------["anti-air","west","us_army"]"
"109------Firebase1_US_EP1------["firebase","artillery","west","us_army"]"
"110------FuelDump1_US_EP1------["fuel","west","us_army"]"
Error in expression <factor[0.3, 1]) min (rpm factor[1, 0.3])>
 Error position: <>
 Error Missing )
Error: Sound volume expression: 2*(1-camPos)*engineOn*((rpm factor[0.3, 1]) min (rpm factor[1, 0.3])
"111------RadarSite1_US_EP1------["radar","west","us_army"]"
"112------VehicleParking1_US_EP1------["vehicle","parking","west","us_army"]"
"113------HeliParking1_US_EP1------["helicopter","parking","west","us_army"]"
"114------AirplaneParking1_US_EP1------["airplane","parking","west","us_army"]"
Error in expression <factor[0.3, 1]) min (rpm factor[1, 0.3])>
 Error position: <>
 Error Missing )
Error: Sound volume expression: 2*(1-camPos)*engineOn*((rpm factor[0.3, 1]) min (rpm factor[1, 0.3])
"115------WeaponsStore1_US_EP1------["weapons","store","west","us_army"]"
"116------Camp1_US_EP1------["camp","tent","small","west","us_army"]"
"117------Camp2_US_EP1------["camp","tent","medium","west","us_army"]"
"118------Camp3_US_EP1------["camp","tent","medium","west","us_army"]"
"119------MediumTentCamp_TK_EP1------["medium","camp","tent","east","tk_army"]"
"120------MediumTentCamp2_TK_EP1------["medium","camp","tent","east","tk_army"]"
"121------MediumTentCamp3_TK_EP1------["medium","camp","tent","east","tk_army"]"
"122------AntiAir1_TK_EP1------["anti-air","east","tk_army"]"
"123------Firebase1_TK_EP1------["firebase","artillery","east","tk_army"]"
"124------FuelDump1_TK_EP1------["fuel","east","tk_army"]"
"125------RadarSite1_TK_EP1------["radar","east","tk_army"]"
"126------VehicleParking1_TK_EP1------["vehicle","parking","east","tk_army"]"
"127------HeliParking1_TK_EP1------["helicopter","parking","east","tk_army"]"
"128------AirplaneParking1_TK_EP1------["airplane","parking","east","tk_army"]"
"129------WeaponsStore1_TK_EP1------["weapons","store","east","tk_army"]"
"130------Camp1_TK_EP1------["camp","tent","medium","east","tk_army"]"
"131------Camp2_TK_EP1------["camp","tent","medium","east","tk_army"]"
"132------GuardPost_CZ_EP1------["small","guardpost","west","cz"]"
"133------VehicleShelter_CZ_EP1------["medium","shelter","west","cz"]"
"134------TankDitch_CZ_EP1------["medium","tankditch","west","cz"]"
"135------TankDitch2_CZ_EP1------["medium","tankditch","west","cz"]"
"136------CityBase03_CZ_EP1------["medium","base","west","cz"]"
"137------BunkerSmall01_CZ_EP1------["small","bunker","west","cz"]"
"138------MediumTentCamp_GUE_EP1------["medium","camp","tent","east","tk_local"]"
"139------SmallTentCamp_GUE_EP1------["small","camp","tent","resistance","tk_local"]"
"140------SmallTentCamp2_GUE_EP1------["small","camp","tent","resistance","tk_local"]"
"141------Camp1_TKM_EP1------["camp","tent","small","east","tk_militia"]"
"142------Camp2_TKM_EP1------["camp","tent","small","east","tk_militia"]"
"143------MPA_infoKiosk1------["armory","information","kiosk"]"
"144------MPA_infoKiosk2------["armory","information","kiosk"]"
"145------MPA_infoKiosk3------["armory","information","kiosk"]"

Well thats what I got!

Everything spawned in correctly... Including the Helipark1_RU...

@Demonized

Can I change that line to spawn it on a marker?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×