Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

hogmason

Member
  • Content Count

    405
  • Joined

  • Last visited

  • Medals

Everything posted by hogmason

  1. ok so i done that and still it did not spawn i even tried removing the custom antenna and just using the original bis camp script that i modified my one from and still it did not spawn it must be to do with how i am trying to spawn it.
  2. taliban_camp.sqf private ["_objs"]; _objs = [ ["Land_A_tent",[-2.33594,1.51538,0.0048542],48.5307,1,0], ["Land_Fire",[-3.51001,-2.67993,-0.000789642],17.7859,1,0], ["Land_A_tent",[-6.37085,1.0791,0.00257874],298.934,1,0], ["Land_A_tent",[-7.28345,-1.84814,0.00243378],276.064,1,0], ["Land_CamoNet_EAST",[-8.08618,-0.0556641,0.00974464],280.621,1,0], ["Land_Antenna",[-6.35962,-4.99707,0.00752831],235.023,1,0,this addeventhandler ["killed", { Target1_active = 0;publicvariable "Target1_active"; [sgt,nil,rgroupChat,"This Camp can no longer communicate with other insurgents"] call RE;}]] ]; _objs the only reason i need the antenns to have a variable is so when it is destroyed i can end that task. I think its correct i also tried this ["Land_Antenna",[-6.35962,-4.99707,0.00752831],235.023,1,0,[color="#FF0000"]"[/color]this addeventhandler ["killed", { Target1_active = 0;publicvariable "Target1_active"; [sgt,nil,rgroupChat,"ThisCamp can no longer communicate with other insurgents"] call RE;}][color="#FF0000"];"[/color]] but it diddnt work keep getting missing ] error
  3. yeah just found them lol but i do as the instructions here " http://community.bistudio.com/wiki/Dynamic_Object_Compositions " say and i get no positions in my rpt ---------- Post added at 21:57 ---------- Previous post was at 21:50 ---------- on my map i have a unit placed in the middle of the camp i want to make a composition in his init i have null = [getpos this,200] execVM "objectGrabber.sqf";
  4. I have searched everywhere and found no working links so ill ask here does any 1 have a download link or can share the code in here for the objectGrabber & objectMapper scripts I need to make some custom compositions cheers guys
  5. hi guys im after some help in improving my spawn positions script at the moment i am using this _gamelogic = center; _towns = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _RandomTownPosition = position (_towns select (floor (random (count _towns)))); _camp1_marker = createMarker ["camp1",_RandomTownPosition]; the problem is it spawn sexactly where it is meant to on the name but how can i add some random distances from this namew and random direction using this _dis = random 80; _ang = random 360; _dx = sin(_ang)*_dis; _dy = cos(_ang)*_dis; _pos = [((getpos ????) select 0) + _dx, ((getpos ????) select 1) + _dy, 0]; // or this /////////// _dist = random 300; _dir = random 360; _pos = [((getPos ????) select 0) + (sin _dir) * _dist, ((getPos ????) select 1) + (cos _dir) * _dist, 0]; so in short use the select location class with some random direction and dis from the selected location class ---------- Post added at 21:39 ---------- Previous post was at 21:17 ---------- or even more ideal would be to use this _dist = random 300; _dir = random 360; _pos = [((getPos center) select 0) + (sin _dir) * _dist, ((getPos center) select 1) + (cos _dir) * _dist, 0]; but have it check to not spawn in water or buildings also with the distance have a minimum of 300 and a max of 1000 is that possible
  6. hogmason

    better spawn pos

    lol yeah its driving me made mate. ---------- Post added at 22:42 ---------- Previous post was at 22:40 ---------- ill try that cuel cheers mate. ---------- Post added at 22:50 ---------- Previous post was at 22:42 ---------- that actually works better then the find best places but i did notice that every now and then even no i set the dis to 2000 that they do spawn f the map like at 5000 ---------- Post added at 23:02 ---------- Previous post was at 22:50 ---------- nevermind that was my fualt lol that works great cuel thanks mate. ---------- Post added at 23:22 ---------- Previous post was at 23:02 ---------- cuel how would i also tell it to check for rocks i.e big bloody rocks lol like how you have "House" i searched the command ---- nearestObjects----- but found nothing regarding the House
  7. hogmason

    better spawn pos

    ok so i got it working with this _pos = center; _radius = random 2000; _exp = "(1 + meadow) * (1 - sea) * (1 - houses)"; _prec = 10; _bestplace = selectBestPlaces [_pos,_radius,_exp,_prec,1]; _spot = _bestplace select 0; _spot2 = _spot select 0; _camp1_marker = createMarker ["camp1",_spot2]; _camp1_marker setMarkerType "mil_dot"; but now i wonder how can i put in direction random and minimum radius ---------- Post added at 22:28 ---------- Previous post was at 22:26 ---------- cheers marker, im using hells kitchen so only the name places work oh and there is 2 flat areas lol ;( but that function looks pretty danm good and handy to keep
  8. hogmason

    better spawn pos

    yeah i have used that script in the past there was a reason i diddnt want to use it this time just cant remember what lol ill get back to that answer ---------- Post added at 22:08 ---------- Previous post was at 22:03 ---------- thats right im spawning camps and shk is awsome but it still allows spawning on buildings ---------- Post added at 22:09 ---------- Previous post was at 22:08 ---------- so say i was to go your way with fnc_randomPos = { private ["_marker", "_pos", "_dist", "_dir"]; _marker = _this; _pos = getMarkerPos _marker; _dist = random 300; _dir = random 360; _pos = [(_pos select 0) + (sin _dir) * _dist, (_pos select 1) + (cos _dir) * _dist, 0]; _marker setMarkerPos _pos; }; how can i add to check for water and buildings
  9. ok so bit of a tricky one just wondering if some one knows how i go about getting a script to run only when the enemy East AI can see a player. The reason attempting to do a artillery script that will drop artillery on a players position when in contact with the enemy. I know there is arty scripts out there but they all require artillery battery's on the map. I have the artillery working just need to figure out how to call the script on a players position
  10. ok so i am spawning dynamic patrols and am trying to create some dynamic waypoints out of randomly spawned markers placed in an array but i am failing this is what i have got markers and waypoints are in red waituntil {!isnil "bis_fnc_init"}; sleep 10; _veh_patrol_grp = createGroup east; _veh_patrol_center = createCenter east; [color="#FF0000"] _MARKER_array = []; for "_i" from 0 to 50 do { _gamelogic = center; _towns1 = nearestLocations [getPosATL _gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _RandomPosition3 = position (_towns1 select (floor (random (count _towns1)))); _marker = createmarkerLocal [format ["mrk%1",random 999999], _RandomPosition3]; _MARKER_array set[(count _MARKER_array), _marker]; };[/color] for "_i" from 0 to 20 do { _veh_patrol_type = ["T72_TK_EP1","T55_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","BRDM2_ATGM_TK_EP1","M113_TK_EP1","UAZ_AGS30_TK_EP1","LandRover_MG_TK_EP1","UAZ_AGS30_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_SPG9_TK_EP1"] call BIS_fnc_selectRandom; _veh_patrol_gamelogic = center; _veh_patrol_towns = nearestLocations [getPosATL _veh_patrol_gamelogic, ["Hill","ViewPoint","StrongpointArea"], 25000]; // or "NameVillage","NameCity","NameCityCapital" _veh_patrol_RandomPosition = position (_veh_patrol_towns select (floor (random (count _veh_patrol_towns)))); _spawn = [(_veh_patrol_RandomPosition), random 290, _veh_patrol_type, _veh_patrol_grp] call BIS_fnc_spawnVehicle; //_veh_patrol_vehicle = createVehicle [_veh_patrol_type, _veh_patrol_RandomPosition, [], 0, "NONE"]; _veh_patrol_vehicle = (_spawn select 0); //_veh_patrol_vehicle setDir random 290; //_spawned = (_spawn select 1); //_veh_patrol_vehicle setVehicleInit "[""killed"",{null = this execVM 'common\newAA.sqf';}]"; //processInitCommands; [color="#FF0000"] _selectwp = (_MARKER_array select _i); _wp = _veh_patrol_grp addWaypoint [(getmarkerpos _selectwp), 0]; [_veh_patrol_grp,_i] setWaypointType "MOVE"; [_veh_patrol_grp,_i] setWaypointCompletionRadius 30; [_veh_patrol_grp,_i] setwaypointCombatMode "BLUE"; [_veh_patrol_grp,_i] setWaypointFormation "FILE"; [_veh_patrol_grp,_i] setWaypointBehaviour "SAFE"; _selectwp = (_MARKER_array select _i); _wp2 = _veh_patrol_grp addWaypoint [(getmarkerpos _selectwp), 1]; [_veh_patrol_grp,_i] setWaypointType "CYCLE"; [_veh_patrol_grp,_i] setWaypointCompletionRadius 30; [_veh_patrol_grp,_i] setwaypointCombatMode "BLUE"; [_veh_patrol_grp,_i] setWaypointFormation "FILE"; [_veh_patrol_grp,_i] setWaypointBehaviour "SAFE";[/color] _cargoNum = _veh_patrol_vehicle emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = _veh_patrol_RandomPosition; _locGr = _pos findEmptyPosition [10, 100]; sleep .2; if (_locGr select 0 > 0)then { _cargo = [_locGr, East, _cargoNum,[],[],[],[],[_fillSlots,.5]] call BIS_fnc_spawnGroup; sleep .2; {_x moveInCargo _veh_patrol_vehicle;} forEach units _cargo; }; }; if (HOG_debug) then { [sgt,nil,rgroupChat,"Spawning IED + Debug ON."] call RE; sleep 0.2; _handle = [_veh_patrol_vehicle,"ptl","ColorOrange","mil_dot"] spawn TOD_debug_mkrs_fnc; }; sleep 0.5; };
  11. sadly panther that is great but it spawns to many units / vehicles per spawn so every time it runs throught the spawn loop i get way to many units / vehicles spawned is there a way to set it to only spawn 1 vehicle per group with only all the cargo positions filled. The only reason this is important is i wanted to populate the map with patrols and only spawning 1 vehicle with the cargo seats filled allows me to have a bigger spread of patrols around the map. Hope that makes sense ;) but tell you what it was a great idea and i really appreciated the help ;)
  12. thanks man im looking throught it now
  13. panther, AWSOME cant wait mate thank you very much. oooohhhhhh the anticipation ;) p.s hope her team wins
  14. im the best just starting, but i think the secound code needs to be wrapped in if isserver then { }; so only the dedi runs the script and not every player. surely that would be cousing issues also i think as you are spawning weapons on players you might need the waituntil {!isnil "bis_fnc_init"}; like i said i am not sure im only just starting to get a grasp on things, but thats where i would start. something like private ["_unit","_distance","_mag","_wep"]; [color="#FF0000"]waituntil {!isnil "bis_fnc_init"}; if isserver then {[/color] _unit = _this select 0; _distance = _this select 1; _mag = ""; _wep = ""; _targetsArray = nearestObjects [_unit, ["Man"], _distance]; { if ((side _x == CIVILIAN)and( alive _x)) then { _weaponType = ceil (random 3); switch (_weaponType) do { case 1: { _mag = "6Rnd_45ACP"; _wep = "revolver_EP1";}; // Revolver case 2: { _mag = "30Rnd_9x19_UZI"; _wep = "UZI_EP1";}; // UZI case 3: { _mag = "8Rnd_9x18_Makarov"; _wep = "Makarov";}; // Makarov }; [_x] JoinSilent Striker; _x setskill 0.6; _x reveal _unit; _x addMagazine _mag; _x addMagazine _mag; _x addWeapon _wep; _x selectWeapon _wep; _x doTarget _unit; _x SetBehaviour "Careless"; _x SetUnitPos "Up"; _x SetSpeedMode "Full"; _x SetCombatMode "Red"; _x doFire _unit; }; } forEach _targetsArray; [color="#FF0000"]};[/color]
  15. yeah thats what im thinking Mikie ;)
  16. think i might just add it to the units as they spawn cheers guys
  17. thanks mate this is all of it apart from the below codes i also have a gamelogic in the center of the map named center and obviously functions module init.sqf execVM "HOG_scripts\HOG_patrols\HOG_patrols_init.sqf"; HOG_patrols_init.sqf // this spawns them //create the vehicles ///////////////////// waituntil {!isnil "bis_fnc_init"}; if isserver then { sleep 10; _veh_patrol_grp = createGroup east; _veh_patrol_center = createCenter east; for "_i" from 0 to 30 do { _veh_patrol_type = ["T72_TK_EP1","T55_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","BRDM2_ATGM_TK_EP1","M113_TK_EP1","UAZ_AGS30_TK_EP1","LandRover_MG_TK_EP1","UAZ_AGS30_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_SPG9_TK_EP1"] call BIS_fnc_selectRandom; _veh_patrol_gamelogic = center; _veh_patrol_towns = nearestLocations [getPosATL _veh_patrol_gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _pos1 = position (_veh_patrol_towns select (floor (random (count _veh_patrol_towns)))); _veh_patrol_RandomPosition1 = [_pos1 select 0,_pos1 select 1,0]; _nRoads = _veh_patrol_RandomPosition1 nearRoads 50; _rng = 50; while {((count _nRoads) == 0)} do { _rng = _rng * 2; _nRoads = _veh_patrol_RandomPosition1 nearRoads _rng; }; _veh_patrol_RandomPosition = position (_nRoads select (floor (random (count _veh_patrol_RandomPosition1)))); //_spawn = [(_veh_patrol_RandomPosition), random 290, _veh_patrol_type, _veh_patrol_grp] call BIS_fnc_spawnVehicle; _spawn = [(_veh_patrol_RandomPosition), random 290, _veh_patrol_type, EAST] call BIS_fnc_spawnVehicle; _veh_ptrl_grp = (_spawn select 2); _veh_patrol_vehicle = (_spawn select 0); [_veh_ptrl_grp, position center, 3000] execVM "HOG_scripts\HOG_patrols\BIN_taskPatrol.sqf"; _veh_patrol_vehicle setVehicleInit "[""killed"",{null = this execVM 'HOG_scripts\HOG_patrols\respawn.sqf';}]"; processInitCommands; _cargoNum = _veh_patrol_vehicle emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = _veh_patrol_RandomPosition; _locGr = _pos findEmptyPosition [10, 100]; sleep .2; if (_locGr select 0 > 0)then { _cargo = [_locGr, East, _cargoNum,[],[],[],[],[_fillSlots,.5]] call BIS_fnc_spawnGroup; sleep .2; {_x moveInCargo _veh_patrol_vehicle;} forEach units _cargo; }; }; if (HOG_debug) then { [sgt,nil,rgroupChat,"Spawning IED + Debug ON."] call RE; sleep 0.2; _handle = [_veh_patrol_vehicle,"ptl","ColorOrange","mil_dot"] spawn TOD_debug_mkrs_fnc; }; sleep 0.5; }; }; respawn.sqf // Respawn Enemy Patrols ///////////////////////// waituntil {!isnil "bis_fnc_init"}; if (isServer) then { _side = east; _convoycenter = createCenter _side; _convoygrp = createGroup _side; for "_i" from 1 to 1 do { // Create Waypoints /////////////////////// _selectwp = (MARKER_array select _i); _wp = _convoygrp addWaypoint [(getmarkerpos _selectwp), 0]; [_convoygrp,_i] setWaypointType "MOVE"; [_convoygrp,_i] setWaypointCompletionRadius 30; [_convoygrp,_i] setwaypointCombatMode "BLUE"; [_convoygrp,_i] setWaypointFormation "FILE"; [_convoygrp,_i] setWaypointBehaviour "SAFE"; // Create Vehicle /////////////////////// _position = "HeliHEmpty" createVehicle (getMarkerPos _selectwp); _random = floor(random 14); _spawn = getMarkerPos "E_Patrol"; _group = floor(random 16); switch (_group) do { case 0: {_vehicle = ["T72_TK_EP1"];}; case 1: {_vehicle = ["T55_TK_EP1"];}; case 2: {_vehicle = ["V3S_TK_EP1"];}; case 3: {_vehicle = ["UAZ_AGS30_TK_EP1"];}; case 4: {_vehicle = ["ZSU_TK_EP1"];}; case 5: {_vehicle = ["LandRover_MG_TK_EP1"];}; case 6: {_vehicle = ["UAZ_AGS30_TK_EP1"];}; case 7: {_vehicle = ["BRDM2_ATGM_TK_EP1"];}; case 8: {_vehicle = ["LandRover_SPG9_TK_EP1"];}; case 9: {_vehicle = ["Ural_ZU23_TK_EP1"];}; case 10: {_vehicle = ["M113_TK_EP1"];}; case 11: {_vehicle = ["BRDM2_ATGM_TK_EP1"];}; case 12: {_vehicle = ["V3S_TK_EP1"];}; case 13: {_vehicle = ["V3S_TK_EP1"];}; case 14: {_vehicle = ["V3S_TK_EP1"];}; case 15: {_vehicle = ["V3S_Open_TK_EP1"];}; }; _patrol = [(getpos _position), (getdir _position), _vehicle, _convoygrp] call BIS_fnc_spawnVehicle; _patrol addEventHandler ["killed", {execVM ????????}]; // Fill Vehicle Cargo ////////////////////// _cargoNum = _patrol emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = getpos _position; _locGr = _pos findEmptyPosition [10, 100]; sleep .2; if (_locGr select 0 > 0)then { _cargo = [_locGr, _side , _cargoNum,[],[],[],[],[_fillSlots,.5], _dir] call BIS_fnc_spawnGroup; sleep .2; {_x moveInCargo _patrol;} forEach units _cargo; }; }; }; }; BIN_taskpatrol.sqf /* ======================================================================================================================= Script: BIN_taskPatrol.sqf v1.3 Author(s): Binesi Partly based on original code by BIS Description: Creates a continually randomized patrol path which circles and intersects a given position. Parameter(s): _this select 0: the group to which to assign the waypoints (Group) _this select 1: the position on which to base the patrol (Array) _this select 2: the maximum distance between waypoints (Number) _this select 3: (optional) debug markers on or off (Number) _this select 4: (optional) blacklist of areas (Array) Returns: Boolean - success flag Example(s): null = [group this,(getPos this),250] execVM "BIN_taskPatrol.sqf" null = [group this,(getPos this),250,1] execVM "BIN_taskPatrol.sqf" // Same with debug markers ----------------------------------------------------------------------------------------------------------------------- Notes: Wolffy.au If anyone is interested, I've made some additions to Binesi's BIN_taskPatrol script. Random initial patrol direction - I noticed every patrol started off in the same direction, so I've randomised it. Fixed the 2D position / findSafePos errors Added building positions as possible patrol locations using Random Building Position Script v1.0 by Tophe of Östgöta Ops Added check that BIS Functions has been initialized ArmaIIholic -- added JTD direction normalization function -- changed numbers for waypoints to match previous waypoints -- randomized initial direction - Wolffy.au added only the offset -- fixed error with building position format -- randomized initial direction -- Wolffy.au added only the offset which had to be reduced to 180 - however this script is making full circle from wherever it starts ======================================================================================================================= */ if (isServer) then { waitUntil {!isNil "bis_fnc_init"}; _grp = _this select 0; _pos = _this select 1; _max_dist = _this select 2; _debug = if ((count _this) > 3) then {_this select 3} else {0}; _blacklist = if ((count _this) > 4) then {_blacklist = _this select 4} else {[]}; _mode = ["YELLOW", "RED"] call BIS_fnc_selectRandom; _formation = ["STAG COLUMN", "COLUMN"] call BIS_fnc_selectRandom; _grp setBehaviour "SAFE"; _grp setSpeedMode "NORMAL"; _grp setCombatMode _mode; _grp setFormation _formation; _center_x = (_pos) select 0; _center_y = (_pos) select 1; _center_z = (_pos) select 2; if(isNil "_center_z")then{_center_z = 0;}; _wp_count = 4 + (floor random 3) + (floor (_max_dist / 100 )); _angle = (360 / (_wp_count -1)); _newangle = 0; _wp_array = []; _slack = _max_dist / 5.5; if ( _slack < 20 ) then { _slack = 20 }; _setdir = round (random 1); _angle_offset = random 180; while {count _wp_array < _wp_count} do { private ["_x1","_y1","_wp_pos", "_prepos","_bldgpos","_bldgs","_a","_b"]; _newangle = (count _wp_array * _angle) + _angle_offset; if ((_newangle > 360) || (_newangle < 0)) then { _newangle = abs (abs (_newangle) - 360); }; if (_setdir == 1) then { _newangle = -_newangle; if ((_newangle > 360) || (_newangle < 0)) then { _newangle = abs (abs (_newangle) - 360); }; }; _x1 = _center_x - (sin _newangle * _max_dist); _y1 = _center_y - (cos _newangle * _max_dist); _prepos = [_x1, _y1, _center_z]; if ( isNil "_center_z" ) then { _prepos = [_x1, _y1]; }; _wp_pos = [_prepos, 0, _slack, 6, 0, 50 * (pi / 180), 0, _blacklist,[_prepos]] call BIS_fnc_findSafePos; _a = 0 + (_wp_pos select 0); _b = 0 + (_wp_pos select 1); ////////////////////////////////////////////////////////////////// // The following code is an extract from Random Building Position Script v1.0 by Tophe of Östgöta Ops ////////////////////////////////////////////////////////////////// _bldgpos = []; _bldgs = nearestObjects [[_a,_b,0], ["Building"], 50]; { private["_i","_y"]; _i = 0; _y = _x buildingPos _i; while {format["%1", _y] != "[0,0,0]"} do { _bldgpos = _bldgpos + [_y]; _i = _i + 1; _y = _x buildingPos _i; }; } forEach _bldgs; if(count _bldgpos != 0) then {_wp_pos = _bldgpos call BIS_fnc_selectRandom;}; _wp_array = _wp_array + [_wp_pos]; sleep 0.5; }; sleep 1; _j = count (waypoints _grp); for "_i" from 1 to (_wp_count - 1) do { private ["_wp","_cur_pos","_marker","_marker_name"]; _cur_pos = (_wp_array select _i); // Create waypoints based on array of positions /* The index i is changed so it matches previous waypoints - j+i */ _wp = _grp addWaypoint [_cur_pos, 0]; _wp setWaypointType "MOVE"; _wp setWaypointCompletionRadius (5 + _slack); [_grp,_j+i] setWaypointTimeout [0, 2, 16]; // When completing waypoint have 33% chance to choose a random next wp [_grp,_j+i] setWaypointStatements ["true", "if ((random 3) > 2) then { group this setCurrentWaypoint [(group this), (floor (random (count (waypoints (group this)))))];};"]; if (_debug > 0) then { _marker_name = str(_wp_array select _i); _marker = createMarker[_marker_name,[_cur_pos select 0,_cur_pos select 1]]; _marker setMarkerShape "ICON"; _marker_name setMarkerType "DOT"; }; sleep 0.5; }; // End back near start point and then pick a new random point _wp1 = _grp addWaypoint [_pos, 0]; _wp1 setWaypointType "SAD"; _wp1 setWaypointCompletionRadius (random (_max_dist)); [_grp,(count waypoints _grp)] setWaypointStatements ["true", "group this setCurrentWaypoint [(group this), (round (random 2) + 1)];"]; // Cycle in case we reach the end _wp2 = _grp addWaypoint [_pos, 0]; _wp2 setWaypointType "CYCLE"; _wp2 setWaypointCompletionRadius 100; true }; ---------- Post added at 16:24 ---------- Previous post was at 16:00 ---------- you will also notice i havent updated the respawn.sqf i just // that out untill i get the main script done first
  18. respawn just creates another 1 vehicle. Cheers mate just tried all that and still get the error and now none of them move got me beat its ashame to its the last thing i need fixed to finnish my mission :(
  19. i have now panther however i added it and now only a few of the patrols seem to be moving i added this in red waituntil {!isnil "bis_fnc_init"}; sleep 10; _veh_patrol_grp = createGroup east; _veh_patrol_center = createCenter east; for "_i" from 0 to 30 do { _veh_patrol_type = ["T72_TK_EP1","T55_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_Open_TK_EP1","V3S_TK_EP1","BRDM2_ATGM_TK_EP1","M113_TK_EP1","UAZ_AGS30_TK_EP1","LandRover_MG_TK_EP1","UAZ_AGS30_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_SPG9_TK_EP1"] call BIS_fnc_selectRandom; _veh_patrol_gamelogic = center; _veh_patrol_towns = nearestLocations [getPosATL _veh_patrol_gamelogic, ["NameVillage","NameCity","NameCityCapital"], 25000]; _pos1 = position (_veh_patrol_towns select (floor (random (count _veh_patrol_towns)))); _veh_patrol_RandomPosition1 = [_pos1 select 0,_pos1 select 1,0]; _nRoads = _veh_patrol_RandomPosition1 nearRoads 50; _rng = 50; while {((count _nRoads) == 0)} do { _rng = _rng * 2; _nRoads = _veh_patrol_RandomPosition1 nearRoads _rng; }; _veh_patrol_RandomPosition = position (_nRoads select (floor (random (count _veh_patrol_RandomPosition1)))); _spawn = [(_veh_patrol_RandomPosition), random 290, _veh_patrol_type, _veh_patrol_grp] call BIS_fnc_spawnVehicle; _veh_patrol_vehicle = (_spawn select 0); [color="#FF0000"] [_veh_patrol_grp,(getPos _veh_patrol_gamelogic),3000] execVM "HOG_scripts\HOG_patrols\BIN_taskPatrol.sqf"; [/color] _veh_patrol_vehicle setDir random 290; _veh_patrol_vehicle setVehicleInit "[""killed"",{null = this execVM 'HOG_scripts\HOG_patrols\respawn.sqf';}]"; processInitCommands; _cargoNum = _veh_patrol_vehicle emptyPositions "cargo"; if (_cargoNum > 0) then { _fillSlots = round (random _cargoNum); _pos = _veh_patrol_RandomPosition; _locGr = _pos findEmptyPosition [10, 100]; sleep .2; if (_locGr select 0 > 0)then { _cargo = [_locGr, East, _cargoNum,[],[],[],[],[_fillSlots,.5]] call BIS_fnc_spawnGroup; sleep .2; {_x moveInCargo _veh_patrol_vehicle;} forEach units _cargo; }; }; if (HOG_debug) then { [sgt,nil,rgroupChat,"Spawning IED + Debug ON."] call RE; sleep 0.2; _handle = [_veh_patrol_vehicle,"ptl","ColorOrange","mil_dot"] spawn TOD_debug_mkrs_fnc; }; sleep 0.5; }; i also seem to get these strange errors now in my rpt Error in expression <0]; } else { _veh = _type createVehicle _pos; }; _veh setDir _azi; _veh setP> Error position: <_pos; }; _veh setDir _azi; _veh setP> Error Undefined variable in expression: _pos File ca\modules\functions\spawning\fn_spawnVehicle.sqf, line 70 Error in expression <"]; if (!_dummy) then { _type = typeOf _vehicle; } else { if (_dummyType != "> Error position: <_vehicle; } else { if (_dummyType != "> Error Undefined variable in expression: _vehicle File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 60 Error in expression <0) must be a Side!"; ""}; if ((typeName _entry) != (typeName configFile)) exitWi> Error position: <_entry) != (typeName configFile)) exitWi> Error Undefined variable in expression: _entry File ca\modules\functions\spawning\fn_selectCrew.sqf, line 26 Error in expression < == "")) then { _crewType = [side _grp, _entry] call BIS_fnc_selectCrew; }; if> Error position: <_entry] call BIS_fnc_selectCrew; }; if> Error Undefined variable in expression: _entry File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 79 Error in expression <entry = _this select 0; if ((typeName _entry) != (typeName configFile)) exitWi> Error position: <_entry) != (typeName configFile)) exitWi> Error Undefined variable in expression: _entry File ca\modules\functions\spawning\fn_returnVehicleTurrets.sqf, line 23 Error in expression <(!_dummy) then { if (!(isNull (driver _vehicle))) then {(driver _vehicle) setR> Error position: <_vehicle))) then {(driver _vehicle) setR> Error Undefined variable in expression: _vehicle File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 144 Error in expression <pe = _this select 4; }; if ((typeName _vehicle) != (typeName objNull)) exitWit> Error position: <_vehicle) != (typeName objNull)) exitWit> Error Undefined variable in expression: _vehicle File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 51 Error in expression <rp; _newGrp = false; }; if ((typeName _pos) != (typeName [])) exitWith {debugL> Error position: <_pos) != (typeName [])) exitWith {debugL> Error Undefined variable in expression: _pos File ca\modules\functions\spawning\fn_spawnVehicle.sqf, line 47 Error in expression <trol_RandomPosition = position (_nRoads select (floor (random (count _veh_patrol> Error position: <select (floor (random (count _veh_patrol> Error Zero divisor File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\TOUR_OF_DUTY_v1.Takistan\HOG_scripts\HOG_patrols\HOG_patrols_init.sqf, line 24 Error in expression <."] call RE; sleep 0.2; _handle = [_veh_patrol_vehicle,"ptl","ColorOrange",> Error position: <_veh_patrol_vehicle,"ptl","ColorOrange",> Error Undefined variable in expression: _veh_patrol_vehicle File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\TOUR_OF_DUTY_v1.Takistan\HOG_scripts\HOG_patrols\HOG_patrols_init.sqf, line 54 Error in expression < if (HOG_debug) then { _DEBUGmarker = createMarker [_mkrName,getPosATL _HOGdeb> Error position: <createMarker [_mkrName,getPosATL _HOGdeb> Error 0 elements provided, 3 expected File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\TOUR_OF_DUTY_v1.Takistan\HOG_scripts\HOG_debug\HOGdebug.sqf, line 12 Error in expression <0]; } else { _veh = _type createVehicle _pos; }; _veh setDir _azi; _veh setP> Error position: <_pos; }; _veh setDir _azi; _veh setP> Error Undefined variable in expression: _pos File ca\modules\functions\spawning\fn_spawnVehicle.sqf, line 70 Error in expression <"]; if (!_dummy) then { _type = typeOf _vehicle; } else { if (_dummyType != "> Error position: <_vehicle; } else { if (_dummyType != "> Error Undefined variable in expression: _vehicle File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 60 Error in expression <0) must be a Side!"; ""}; if ((typeName _entry) != (typeName configFile)) exitWi> Error position: <_entry) != (typeName configFile)) exitWi> Error Undefined variable in expression: _entry File ca\modules\functions\spawning\fn_selectCrew.sqf, line 26 Error in expression < == "")) then { _crewType = [side _grp, _entry] call BIS_fnc_selectCrew; }; if> Error position: <_entry] call BIS_fnc_selectCrew; }; if> Error Undefined variable in expression: _entry File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 79 Error in expression <entry = _this select 0; if ((typeName _entry) != (typeName configFile)) exitWi> Error position: <_entry) != (typeName configFile)) exitWi> Error Undefined variable in expression: _entry File ca\modules\functions\spawning\fn_returnVehicleTurrets.sqf, line 23 Error in expression <(!_dummy) then { if (!(isNull (driver _vehicle))) then {(driver _vehicle) setR> Error position: <_vehicle))) then {(driver _vehicle) setR> Error Undefined variable in expression: _vehicle File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 144 Error in expression <pe = _this select 4; }; if ((typeName _vehicle) != (typeName objNull)) exitWit> Error position: <_vehicle) != (typeName objNull)) exitWit> Error Undefined variable in expression: _vehicle File ca\modules\functions\spawning\fn_spawnCrew.sqf, line 51 Error in expression <rp; _newGrp = false; }; if ((typeName _pos) != (typeName [])) exitWith {debugL> Error position: <_pos) != (typeName [])) exitWith {debugL> Error Undefined variable in expression: _pos File ca\modules\functions\spawning\fn_spawnVehicle.sqf, line 47 Error in expression <trol_RandomPosition = position (_nRoads select (floor (random (count _veh_patrol> Error position: <select (floor (random (count _veh_patrol> Error Zero divisor File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\TOUR_OF_DUTY_v1.Takistan\HOG_scripts\HOG_patrols\HOG_patrols_init.sqf, line 24 Error in expression <."] call RE; sleep 0.2; _handle = [_veh_patrol_vehicle,"ptl","ColorOrange",> Error position: <_veh_patrol_vehicle,"ptl","ColorOrange",> Error Undefined variable in expression: _veh_patrol_vehicle File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\TOUR_OF_DUTY_v1.Takistan\HOG_scripts\HOG_patrols\HOG_patrols_init.sqf, line 54 Error in expression < if (HOG_debug) then { _DEBUGmarker = createMarker [_mkrName,getPosATL _HOGdeb> Error position: <createMarker [_mkrName,getPosATL _HOGdeb> Error 0 elements provided, 3 expected File C:\Users\natho\Documents\ArmA 2 Other Profiles\=Mason=\missions\TOUR_OF_DUTY_v1.Takistan\HOG_scripts\HOG_debug\HOGdebug.sqf, line 12 now the last few errors are not correct as i have those debug markers on everything else for a while now no issues.
  20. na my idea was to just dynamically create 2 waypoints that the patrols will travel to and from. so each patrol will travell between there own seperate waypoints untill killed. i used 50 so i could be sure they all get different ones and spread around the map.
  21. HOG Debug v1.0 This is a little nifty script that i made with the help from the community members on the Bis Forums, This little script will create a marker on any dynamically spawned unit / vehicle / object and will follow its target and give its direction. These markers are easily customised to the users need. Once the markers target is killed the marker will be deleted. USAGE. in your description.ext class Params { class HOGdebug { title = "Debug Y/N:"; values[] = {0,1}; texts[] = {"No","Yes"}; default = 0; }; }; Place in your init.sqf if(isNil "paramsArray") then{paramsArray = [1];}; // this is for in the editor if((paramsArray select 2) == 1) then {Hog_Debug = true;}; // this is for a server if((paramsArray select 2) == 0) then {Hog_Debug = false;}; // this is for a server HOG_debug_mkrs_fnc = compile (preprocessFileLineNumbers "HOG_Debug.sqf"); Now to use the debug on any unit / vehicle / object just add the below code to the bottom of your script if (HOG_debug) then { [sgt,nil,rgroupChat,"YOUR TEXT HERE + Debug ON."] call RE; //<<<<========change the sgt to your players name so you can recieve hints in the group comms channel sleep 0.2; [object,"txt","Color","type"] spawn TOD_debug_mkrs_fnc; //<<<<======== this is explained below }; Now the [object,"txt","Color","type"] part is object = this is the unit / object /whatever you need the marker to spawn on txt = this is the marker text that will be seen on the map Colour = the colour you need the marker to be type = the type of marker to create. now this is the code just create a sqf file named HOG_Debug.sqf and place //HOGdebug Script by =Mason= //creates moving markers on all units that call this script. _HOGdebugUNITS = _this select 0; _HOGdebugTEXT = _this select 1; _HOGdebugCOLOUR = _this select 2; _HOGdebugTYPE = _this select 3; _mkrName = Format ["mkr_%1",_HOGdebugUNITS]; if (HOG_debug) then { _DEBUGmarker = createMarker [_mkrName,getPos _HOGdebugUNITS]; _DEBUGmarker setMarkerType _HOGdebugTYPE; _DEBUGmarker setMarkerColor _HOGdebugCOLOUR; _DEBUGmarker setMarkerText _HOGdebugTEXT; _DEBUGmarker setMarkerDir (direction _HOGdebugUNITS); while {alive _HOGdebugUNITS} do { _DEBUGmarker setMarkerPos getPosATL _HOGdebugUNITS; _DEBUGmarker setMarkerDir (direction _HOGdebugUNITS); sleep 0.5; }; deleteMarker _DEBUGmarker; }; thanks to all who helped me out. ;) Now i hope this will help others.
  22. man i thought it was going to be that easy but when i tried i failed had it in the wrong pos lol cheers mate.
  23. hi i have made my self a little debug script to help me in editing dynamic things this works great however i have no idea how to delete the markers once the attached unit / object is no longer alive. the debug script is called by if (HOG_debug) then { [sgt,nil,rgroupChat,"Spawning IED + Debug ON."] call RE; sleep 0.2; _handle = [_ied,"IED","ColorGreen","mil_dot"] spawn TOD_debug_mkrs_fnc; }; and this is the code _HOGdebugUNITS = _this select 0; _HOGdebugTEXT = _this select 1; _HOGdebugCOLOUR = _this select 2; _HOGdebugTYPE = _this select 3; _mkrName = Format ["mkr_%1",_HOGdebugUNITS]; if (HOG_debug) then { _DEBUGmarker = createMarker [_mkrName,getPos _HOGdebugUNITS]; _DEBUGmarker setMarkerType _HOGdebugTYPE; _DEBUGmarker setMarkerColor _HOGdebugCOLOUR; _DEBUGmarker setMarkerText _HOGdebugTEXT; _DEBUGmarker setMarkerDir (direction _HOGdebugUNITS); while {alive _HOGdebugUNITS} do { _DEBUGmarker setMarkerPos getPosATL _HOGdebugUNITS; _DEBUGmarker setMarkerDir (direction _HOGdebugUNITS); sleep 0.5; }; }; so how can i delete these markers
×