Jump to content
Sign in to follow this  
hogmason

help with spawning distance

Recommended Posts

i use this script


[b]	_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos "taskarea") select 0) + _dx, ((getmarkerpos "taskarea") select 1) + _dy, 0];[/b]
_armourgrp1 = [getmarkerpos "taskarea", east,["T72_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp1) select 0, "taskarea","spawned","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";

to create manned armor all works fine but they all spawn on top of each other cuasing major destruction and tanks flying in the air lol

my question is how can i get them to spawn in say a diamater of 190 from the center of the taskarea marker.

taskarea marker is created by


_Taskarea = createmarker ["taskarea",getpos _task1];
_Taskarea setmarkershape "ELLIPSE";
_Taskarea setmarkersize [190,190];
//"taskarea" setMarkerAlpha 0;  /// unmark to not show

the whole script just in case it helps


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////                                                           ////////////////////////////////////                                                            
///////////////////////  Scud Mission Script For Operation HOG SOCOMD Command     /////////////////////////////////////
//////////////////////                                                           //////////////////////////////////////                                                              
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if isserver then {

sleep 10; 

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                   //
//                      ----------      Setup target    ----------                                                   //
//                                                                                                                   //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_task1=task1;
_name = "MAZ_543_SCUD_TK_EP1" createVehicle getpos _task1;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                   //
//                 ----------      Only Allow Satchel To Destroy Target      ----------                              //
//                                                                                                                   //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_name setVehicleInit "_name addEventHandler [""HandleDamage"",{(_this select 4) == ""PipeBomb""}]" ;format ["%1 = this; this setVehicleVarName ""%1""",_unitname];
processInitCommands;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                   //
//                          ----------      Setup Markers       ----------                                           //
//                                                                                                                   //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_Taskarea = createmarker ["taskarea",getpos _task1];
_Taskarea setmarkershape "ELLIPSE";
_Taskarea setmarkersize [190,190];
//"taskarea" setMarkerAlpha 0;  /// unmark to not show
sleep .5;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                   //
//                           ----------      Spawn Enemy       ----------                                            //
//                                                                                                                   //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//if ((paramsarray select 19) == 1) then { 

_upsgrp1 = [1,getmarkerpos "taskarea",1,["taskarea","spawned","random","fortify","nomove","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getmarkerpos "taskarea",1,["taskarea","spawned","random","fortify","nomove","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getmarkerpos "taskarea",1,["taskarea","spawned","random","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getmarkerpos "taskarea",1,["taskarea","spawned","random","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getmarkerpos "taskarea",1,["taskarea","spawned","random","fortify","nomove","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
sleep .2;
_upsgrp1 = [1,getmarkerpos "taskarea",1,["taskarea","spawned","random","delete:",120]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos "taskarea") select 0) + _dx, ((getmarkerpos "taskarea") select 1) + _dy, 0];
_armourgrp1 = [getmarkerpos "taskarea", east,["T72_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp1) select 0, "taskarea","spawned","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos "taskarea") select 0) + _dx, ((getmarkerpos "taskarea") select 1) + _dy, 0];
_armourgrp2 = [getmarkerpos "taskarea", east,["T34_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp2) select 0, "taskarea","spawned","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos "taskarea") select 0) + _dx, ((getmarkerpos "taskarea") select 1) + _dy, 0];
_armourgrp3 = [getmarkerpos "taskarea", east,["T72_TK_EP1", "LandRover_MG_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp3) select 0, "taskarea","spawned","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos "taskarea") select 0) + _dx, ((getmarkerpos "taskarea") select 1) + _dy, 0];
_armourgrp4 = [getmarkerpos "taskarea", east,["T34_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp4) select 0, "taskarea","spawned","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";
_dis = 180;
_ang = random 360;
_dx = sin(_ang)*_dis;
_dy = cos(_ang)*_dis;
       _positionToSpawnIn = [((getmarkerpos "taskarea") select 0) + _dx, ((getmarkerpos "taskarea") select 1) + _dy, 0];
_armourgrp5 = [getmarkerpos "taskarea", east,["T72_TK_EP1", "LandRover_MG_TK_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[(units _armourgrp5) select 0, "taskarea","spawned","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf";


//};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                   //
//                      ----------      Wait for Target To Be Destroyed       ----------                             //
//                                                                                                                   //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

waitUntil{!alive _name }; 



["task1","succeeded"] call SHK_Taskmaster_upd;
[] call SHK_addTask;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                   //
//                                ----------      Clean Up       ----------                                          //
//                                                                                                                   //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

deletemarker "taskarea";



};


Share this post


Link to post
Share on other sites

Specify more relative positions with greater spacing? You only have 2 listed and 3m might not be enough space?

Edited by PELHAM

Share this post


Link to post
Share on other sites

thanks pelham, that code was given to me so im just working it out ;),

dont spouse you would fill me in on what the bold part below means im asuming the 190,190 are the distances from the taskarea marker. what are the -3

_armourgrp1 = [getmarkerpos "taskarea", east,["T72_TK_EP1", "BRDM2_ATGM_TK_EP1"],[[-3,-3], [190,190]]] call BIS_fnc_spawnGroup;

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  

×