Jump to content

Jigsor

Member
  • Content Count

    628
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Jigsor

  1. I have not seen this discussed. Maybe its a game limitation? Can waypoints that use getMarkerPos dynamically get the new marker position when the markers have moved? Senario: Marker script generates 4 markers when objective initialization and again when objective complete. Marker 1 "aomarker" located in the center. marker 2 "spawnaire". Spawn location for east aircraft. marker 3 "spawnairw". Spawn location for west aircraft. marker 4 "cyclewpmrk". Used as cycle waypiont for east and west. Marker 1 is centrally located. Markers 2-4 are equal distance around "aomarker". Marker 4 is placed randomly within specified radius and markes 2 and 3 are placed equal distance from marker 4 and each other. It looks like a peace sign. Aircraft should spawn at respective markers and move to AO makers then move to cycle marker. When objective completes, the marker script deletes current markers and recreates them at the new objective. Question is how to make waypoint markers update to their newly moved marker positions. Do I have to delete and recreate waypoints when markers have moved? The waypoints use getMarkerPos and I've added eventhandlers for markers. Maybe possible with a game logic? I don't know how to implement it if it is. Functions module is already placed on map. I've tried countless combinations and all return nearly the same result. Here are the 2 scripts handling this. The first is the marker script. It depends on a seperate random number generator script used to filter completed objectives and assign new ones by yet another script. This one works beautifully. Thanks to Killzonekid's suggestion. The second is the createvehicle and set waypoint script. The second is a combination of a GITS EVO air patrol script to create vehicle and manage cleanup. The waypoint management is a function converted from JW Customs USPS WP script though both parts are highly modified. No shame, credit given.... As much as I love killing AI, I would hate kill them on objective complete and spwan them at the new AO. Its a plauseable solution, but it would be nicer to have them move to next AO. RandomOAMarker.sqf //RandomOAMarker.sqf by Jigsor //[] execVM "Scripts\Tasks\RandomOAMarker.sqf"; //called from clienttasks.sqf if (!isServer) exitWith {}; private ["_invhelipad","_current_rnd","_posHpad","_posHpadAO1","_posHpadAO2","_posHpadAO3","_posHpadAO4","_currentmarker","_wpcyclemark","_spwnaire","_spwnairepos","_spwnairedir","_spwnairw","_spwnairwpos","_spwnairwdir"]; "RND_number" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "oa1invhelipad" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "oa2invhelipad" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "oa3invhelipad" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "oa4invhelipad" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; waituntil {(RND_number) >1}; sleep 1; if (!isNil "oa1invhelipad") then {deleteVehicle oa1invhelipad;}; if (!isNil "oa2invhelipad") then {deleteVehicle oa2invhelipad;}; if (!isNil "oa3invhelipad") then {deleteVehicle oa3invhelipad;}; if (!isNil "oa4invhelipad") then {deleteVehicle oa4invhelipad;}; if (!isNil "oa5invhelipad") then {deleteVehicle oa5invhelipad;}; if (!isNil "oamarker") then {deleteMarker "oamarker";}; if (RND_number == 2) then { _invhelipad = createVehicle ["HeliHEmpty", getMarkerPos "task1mkr", [], 0, "CAN_COLLIDE"]; _VarOAName="oa1invhelipad"; _invhelipad SetVehicleVarName _VarOAName; _invhelipad Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarOAName]; sleep 0.1; }; if (RND_number == 3) then { _invhelipad = createVehicle ["HeliHEmpty", getMarkerPos "task3mkr", [], 0, "CAN_COLLIDE"]; _VarOAName="oa2invhelipad"; _invhelipad SetVehicleVarName _VarOAName; _invhelipad Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarOAName]; sleep 0.1; }; if (RND_number == 4) then { _invhelipad = createVehicle ["HeliHEmpty", getMarkerPos "movingtrain", [], 0, "CAN_COLLIDE"]; _VarOAName="oa3invhelipad"; _invhelipad SetVehicleVarName _VarOAName; _invhelipad Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarOAName]; sleep 0.1; }; if (RND_number == 5) then { _invhelipad = createVehicle ["HeliHEmpty", getMarkerPos "task7mkr", [], 0, "CAN_COLLIDE"]; _VarOAName="oa4invhelipad"; _invhelipad SetVehicleVarName _VarOAName; _invhelipad Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarOAName]; sleep 0.1; }; _current_rnd = RND_number; _posHpad = [ getPos _invhelipad select 0, (getPos _invhelipad select 1)]; _posHpadAO1 = [ getMarkerPos "task1mkr" select 0, (getMarkerPos "task1mkr" select 1)]; _posHpadAO2 = [ getMarkerPos "task3mkr" select 0, (getMarkerPos "task3mkr" select 1)]; _posHpadAO3 = [ getMarkerPos "movingtrain" select 0, (getMarkerPos "movingtrain" select 1)]; _posHpadAO4 = [ getMarkerPos "task7mkr" select 0, (getMarkerPos "task7mkr" select 1)]; if (_current_rnd == 2) then { if (_posHpad distance _posHpadAO1 == 0) then { _invhelipad setPos getMarkerPos "task1mkr"; } else { _current_rnd = nil; }; }; if (_current_rnd == 3) then { if (_posHpad distance _posHpadAO2 == 0) then { _invhelipad setPos getMarkerPos "task3mkr"; } else { _current_rnd = nil; }; }; if (_current_rnd == 4) then { if (_posHpad distance _posHpadAO3 == 0) then { _invhelipad setPos getMarkerPos "movingtrain"; } else { _current_rnd = nil; }; }; if (_current_rnd == 5) then { if (_posHpad distance _posHpadAO4 == 0) then { _invhelipad setPos getMarkerPos "task7mkr"; } else { _current_rnd = nil; }; }; diag_log text format ["posAO1: %1", _posHpadAO1]; diag_log text format ["posAO2: %1", _posHpadAO2]; diag_log text format ["posAO3: %1", _posHpadAO3]; diag_log text format ["posAO4: %1", _posHpadAO4]; diag_log text format ["pos: %1", _posHpad]; while {isNil "_current_rnd"} do { if (_current_rnd == 2) then {if (_posHpad distance _posHpadAO1 == 0) then {_invhelipad setPos getMarkerPos "task1mkr"};}; if (_current_rnd == 3) then {if (_posHpad distance _posHpadAO2 == 0) then {_invhelipad setPos getMarkerPos "task3mkr"};}; if (_current_rnd == 4) then {if (_posHpad distance _posHpadAO3 == 0) then {_invhelipad setPos getMarkerPos "movingtrain"};}; if (_current_rnd == 5) then {if (_posHpad distance _posHpadAO4 == 0) then {_invhelipad setPos getMarkerPos "task7mkr"};}; sleep 0.1; diag_log text format [""]; switch (_current_rnd) do { // debug: diag_log used to compare server's broadcasting random task number to currentAO marker. case 1: {diag_log text format ["CurrentAOMarker: %1", _current_rnd]; }; case 2: {diag_log text format ["CurrentAOMarker: %1", _current_rnd]; }; case 3: {diag_log text format ["CurrentAOMarker: %1", _current_rnd]; }; case 4: {diag_log text format ["CurrentAOMarker: %1", _current_rnd]; }; sleep 0.1; }; }; sleep 0.2; if (!isNil "oamarker") then {deleteMarker "oamarker";}; _currentmarker = createMarker ["oamarker", getPos _invhelipad]; _currentmarker setMarkerShape "ELLIPSE"; "oamarker" setMarkerSize [1, 1]; "oamarker" setMarkerShape "ICON"; "oamarker" setMarkerType "DOT"; "oamarker" setMarkerColor "ColorRed"; "oamarker" setMarkerText "AO"; "oamarker" setMarkerPos (getPos _invhelipad); publicVariable "oamarker"; publicVariable "_invhelipad"; diag_log text format ["currentmarker: %1", _invhelipad]; if (!isNil "cyclewpmrk") then {deleteMarker "cyclewpmrk";}; _wpcyclemark = createMarker ["cyclewpmrk", getPos _invhelipad]; _wpcyclemark setMarkerShape "ELLIPSE"; "cyclewpmrk" setMarkerSize [1, 1]; "cyclewpmrk" setMarkerShape "ICON"; "cyclewpmrk" setMarkerType "DOT";//set marker type to "DOT" for debug. Set "Empty" for invisible "cyclewpmrk" setMarkerColor "ColorRed"; "cyclewpmrk" setMarkerText "WPcycle"; "cyclewpmrk" setMarkerPos [(getMarkerPos "oamarker" select 0) + (300 * sin floor(random 360)), (getMarkerPos "oamarker" select 1) + (300 * cos floor(random 360)), 0];//cycle waypoint distance is 1400 meters from AO marker publicVariable "cyclewpmrk"; sleep 0.1; if (!isNil "spawnaire") then {deleteMarker "spawnaire";}; _spwnaire = createMarker ["spawnaire", getPos _invhelipad]; _spwnaire setMarkerShape "ELLIPSE"; _spwnairepos = getMarkerPos "cyclewpmrk"; _spwnairedir = [_spwnairepos, _invhelipad] call BIS_fnc_dirTo; "spawnaire" setMarkerSize [1, 1]; "spawnaire" setMarkerShape "ICON"; "spawnaire" setMarkerType "DOT";//set marker type to "DOT" for debug. Set "Empty" for invisible "spawnaire" setMarkerColor "ColorRed"; "spawnaire" setMarkerText "SpawnAirEst"; "spawnaire" setMarkerPos [(getMarkerPos "oamarker" select 0) + (1450 * sin (_spwnairedir -300)), (getMarkerPos "oamarker" select 1) + (1450 * cos (_spwnairedir -300)), 0];//East Air spawn point distance is 1400 meters from AO marker publicVariable "spawnaire"; sleep 0.1; if (!isNil "spawnairw") then {deleteMarker "spawnairw";}; _spwnairw = createMarker ["spawnairw", getPos _invhelipad]; _spwnairw setMarkerShape "ELLIPSE"; "spawnairw" setMarkerSize [1, 1]; "spawnairw" setMarkerShape "ICON"; "spawnairw" setMarkerType "DOT";//set marker type to "DOT" for debug. Set "Empty" for invisible "spawnairw" setMarkerColor "ColorRed"; "spawnairw" setMarkerText "SpawnAirWst"; "spawnairw" setMarkerPos [(getMarkerPos "oamarker" select 0) + (1450 * sin (_spwnairedir -60)), (getMarkerPos "oamarker" select 1) + (1450 * cos (_spwnairedir -60)), 0];//East Air spawn point distance is 1400 meters from AO marker publicVariable "spawnairw"; sleep 0.1; sleep 10; if (!isNil "_current_rnd") exitWith {}; 1airpate.sqf //1airpate.sqf //Taken from GITS Evolution and Ultra Simple Patrol Script v1.4 by JW Custom // Original Authors Killjoy Eggbeast, GITS, JW Custom. //Modified/Adapted by Jigsor. //Makes side east aircraft and sets waypoints. //starts in serverinit.sqf with _handle = [] execVM "Scripts\airpatinit.sqf"; if (!isServer) exitWith {}; private ["_wp","_ranPos","_patrolMarker","_patrolRadius","_spawnRadius","_spawnMarker","_pilotBehaviour","_existChance","_pilotSpeed","_pilotFormation","_numGrp","_flyInHeight","_wpfnc","_grp","_killpilots","_varisleep","_qna","_qnb","_qnc","_aiairpatres"]; "tsk0init" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "oamarker" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "cyclewpmrk" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "spawnaire" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; /* "spawnairw" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "_invhelipad" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; */ waituntil {tsk0init == 1}; sleep 16;//wait for initial marker creation of "oamarker","cyclewpmrk" and "spawnaire" _qna=false; _qnb=false; _qnc=false; _aiairpatres=(paramsArray select 7); switch (_aiairpatres) do { case 0:{_qna=true}; case 1:{_qnb=true}; case 2:{_qnc=true}; }; if (_qna) then {_varisleep = 30;}; if (_qnb) then {_varisleep = 60;}; if (_qnb) then {_varisleep = 90;}; /* Ultra Simple Patrol Script v1.4 by JW Custom. Convertion to funciton and modified by Jigsor ----------------------------------------------------------------------------------------------------------- argument 0: The unit/group leader we are dealing with argument 1: The radius size where to randomly place the unit/group within argument 2: The marker representing the radius center of where unit/group will be randomly placed within argument 3: The marker representing the center of the unit/group patrol argument 4: The radius size where unit/group will patrol within argument 5: The behaviour of the unit/group argument 6: Chance of unit/group existing in percentage. If set to 100 the unit/group will always exist. argument 7: Movement speed of the unit/group. argument 8: Group formation. argument 9: Wait time in seconds before moving on to next waypoint. Set to 0 and theres no wait time. argument 10: Altitude of unit/group. Unless unit/group are a air vehicle this should be set to 0. argument 11: The marker representing Cycle waypoint. */ _wpfnc = { private ["_wphandle","_spawnRadius","_spawnMarker","_patrolMarker","_patrolRadius","_pilotBehaviour","_existChance","_pilotSpeed","_pilotFormation","_pilotWaittime","_flyInHeight","_chance","_wp","_wp1","_iniPos","_realpos","_oldpos","_cyclemrkr","_pilot"]; //_wphandle = [_pilot, 300, "spawnaire", "oamarker", 1000, "COMBAT", 100, "FULL", "VEE", 4, 300, "cyclewpmrk"]; _wphandle = [_pilot, 300, "spawnaire", "oamarker", 1000, "SAFE", 100, "FULL", "VEE", 4, 300, "cyclewpmrk"]; _pilot = _wphandle select 0; _spawnRadius = _wphandle select 1; _spawnMarker = _wphandle select 2; _patrolMarker = _wphandle select 3; _patrolRadius = _wphandle select 4; _pilotBehaviour = _wphandle select 5; _existChance = _wphandle select 6; _pilotSpeed = _wphandle select 7; _pilotFormation = _wphandle select 8; _pilotWaittime = _wphandle select 9; _flyInHeight = _wphandle select 10; _cyclemrkr = _wphandle select 11; _grp = group _pilot; _chance = ceil(random 100); if (_chance > _existChance) then { {deleteVehicle vehicle _x; deleteVehicle _x; sleep 0.1;} forEach units _grp; }; _wp = _grp addWaypoint [getMarkerPos _spawnMarker, 1]; _wp setWaypointBehaviour _pilotBehaviour; _wp setWaypointSpeed _pilotSpeed; _wp setWaypointFormation _pilotFormation; _wp setWaypointType "MOVE"; _wp setWaypointCombatMode "RED"; [_grp, 1] setWaypointPosition [getMarkerPos _spawnMarker, _spawnRadius]; _iniPos = getWPPos [_grp,1]; //_spwnairpos = getMarkerPos "spawnaire"; //_airdest = getMarkerPos "oamarker"; //_spwnairdir = [_spwnairpos, airdest] call BIS_fnc_dirTo; //vehicle _x setpos [(_iniPos select 0) + (50 * sin (_spwnairdir)), (_iniPos select 1) + (50 * cos (_spwnairdir)), _flyInHeight]; vehicle _x setpos [(_iniPos select 0) + random 50, (_iniPos select 1) + random 50, _flyInHeight]; _wp1 = _grp addWaypoint [getMarkerPos _patrolMarker, _spawnRadius]; _wp1 setWaypointType "MOVE"; [_grp, 2] setWaypointPosition [getMarkerPos _patrolMarker, _spawnRadius]; _wp2 = _grp addWaypoint [getMarkerpos "cyclewpmrk", 100]; _wp2 setWaypointType "CYCLE"; [_grp, 3] setWaypointPosition [getMarkerPos _cyclemrkr, _patrolRadius]; }; //_wp1 setWaypointStatements ["true", "diag_log ['GroupLeader: ',this]; diag_log ['Units: ',thislist]"]; /* while {(getPos _pilot) distance ([0,0,0]) <150} do { (_pilot) setdammage 1; sleep _pilotWaittime; }; */ _killpilots = { _chop = _this select 0; _crew = _this select 1; waitUntil {count units _chop == 0 or not canmove _chop}; sleep 1.0; {_x setdammage 1} foreach _crew; }; private ["_rf","_startsb","_poscreate","_rndx","_rndy","_kpos","_allunits","_maxu","_upos","_dcounta","_d","_max","_heli","_spawne","_killh1","_pilot"]; for [{_loop=0}, {_loop<1}, {_loop=_loop}] do { diag_log text format ["AirpatroleEast1ON: %1", RND_number]; _rf = 15 + (random 15); sleep _rf; _poscreate = getmarkerpos "spawnaire"; _pilot = createGroup (east); _rndx = random 600; _rndy = random 600; _kpos = [(_poscreate select 0)-300 +_rndx,(_poscreate select 1)-300+_rndy,500]; _allunits = jig_east_AIpilot; _maxu = (count _allunits)-1; _upos = getmarkerpos "centerp"; _dcounta = 0; _d = 0; while {_d <= _dcounta} do { (_allunits select round random _maxu) createUnit [_upos, _pilot];Sleep jig_tvt_globalsleep; _d = _d+1; }; jig_air_pate1 = ["I44_Plane_G_Bf109E4_WL"]; _allvecs = jig_air_pate1; _max = (count _allvecs)-1; _heli = createVehicle [_allvecs select (round random _max), _kpos, [], 50, "FLY"]; Sleep jig_tvt_globalsleep; sleep 0.1; _heli setpos [getpos _heli select 0, getpos _heli select 1, 400]; _heli setdir (random 100); _heli engineon true; (units _pilot select 0) assignAsDriver _heli; (units _pilot select 0) moveInDriver _heli; _pilot setCombatMode "RED"; _x addEventHandler ["killed", {handle = [_this select 0] execVM "Scripts\bury.sqf"}]; _heli addEventHandler ["killed", {handle = [_this select 0] execVM "Scripts\bury.sqf"}]; _spawne = [_heli] spawn {[_this select 0] call BIS_EVO_idelSVEC}; _killh1 = [_heli,crew _heli] spawn {[_this select 0,_this select 1] call _killpilots}; sleep 1.0; call _wpfnc; sleep 10; waitUntil {(not (alive _heli)) or (isNull (driver _heli))}; if (alive _heli) then {_heli setdammage 1}; sleep _varisleep; if (alive (units _pilot select 0)) then {(units _pilot select 0) setdammage 1}; }; Any input appreciated.
  2. Got it working with this new version of the air patrol script. If marker moves to new position the air patrol will move to it. Next problem is if air patrol encounters an enemy base with enemy AI while in route. The patrol will stay there until they get shot down. I need to incorporate a scripted switch trigger maybe to waypoint function in order to force them to next waypoint. Any any ideah if and how its possible? //airpate1.sqf //makesu.sqf from GITS Evolution //makesu.sqf Original Authors Kiljoy //makesu.sqf Modified by Eggbeast, GITS //Ultra Simple Patrol Script v1.4 by JW Custom //Merged/Modified by Jigsor. //Makes side east aircraft and sets waypoints. //starts in airpatinit.sqf with _spawnaire1 = [] execVM "Scripts\airpate1.sqf"; if (!isServer) exitWith {}; private ["_patrolMarker","_patrolRadius","_spawnRadius","_spawnMarker","_pilotBehaviour","_existChance","_pilotSpeed","_pilotFormation","_numGrp","_flyInHeight","_wpfnc","_grp","_qna","_qnb","_qnc","_qnd","_qne","_varisleep","_aiairpatres","_chop","_crew","_killpilots"]; "tsk0init" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "oamarker" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "cyclewpmrk" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "spawnaire" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; /* "spawnairw" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; "_invhelipad" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; */ waituntil {tsk0init == 1}; sleep 16;//wait for initial marker creation of "oamarker","cyclewpmrk" and "spawnaire" //Air Respawn Fequency Param _qna=false; _qnb=false; _qnc=false; _qnd=false; _qne=false; _aiairpatres=(paramsArray select 7); switch (_aiairpatres) do { case 0:{_qna=true}; case 1:{_qnb=true}; case 2:{_qnc=true}; case 3:{_qnd=true}; case 4:{_qne=true}; }; if (_qna) then {_varisleep = 30;}; if (_qnb) then {_varisleep = 75;}; if (_qnc) then {_varisleep = 120;}; if (_qnd) then {_varisleep = 165;}; if (_qne) then {_varisleep = 210;}; /* Ultra Simple Patrol Script v1.4 by JW Custom. Convertion to funciton and modified by Jigsor ----------------------------------------------------------------------------------------------------------- argument 0: The unit/group leader we are dealing with argument 1: The radius size where to randomly place the unit/group within argument 2: The marker representing the radius center of where unit/group will be randomly placed within argument 3: The marker representing the center of the unit/group patrol argument 4: The radius size where unit/group will patrol within argument 5: The behaviour of the unit/group argument 6: Chance of unit/group existing in percentage. If set to 100 the unit/group will always exist. argument 7: Movement speed of the unit/group. argument 8: Group formation. argument 9: Wait time in seconds before moving on to next waypoint. Set to 0 and theres no wait time. argument 10: Altitude of unit/group. Unless unit/group are a air vehicle this should be set to 0. argument 11: The marker representing Cycle waypoint. */ _wpfnc = { private ["_wphandle","_spawnRadius","_spawnMarker","_patrolMarker","_patrolRadius","_pilotBehaviour","_existChance","_pilotSpeed","_pilotFormation","_pilotWaittime","_flyInHeight","_chance","_wp","_wp1","_wp2","_wp3","_realpos","_cyclemrkr","_pilot","_airdest","_poscreate","_spwnairdir"]; _wphandle = [_pilot, 300, "spawnaire", "oamarker", 1000, "SAFE", 100, "FULL", "VEE", 4, 300, "cyclewpmrk"]; _pilot = _wphandle select 0; _spawnRadius = _wphandle select 1; _spawnMarker = _wphandle select 2; _patrolMarker = _wphandle select 3; _patrolRadius = _wphandle select 4; _pilotBehaviour = _wphandle select 5; _existChance = _wphandle select 6; _pilotSpeed = _wphandle select 7; _pilotFormation = _wphandle select 8; _pilotWaittime = _wphandle select 9; _flyInHeight = _wphandle select 10; _cyclemrkr = _wphandle select 11; _grp = group _pilot; _airdest = getMarkerPos "oamarker"; _poscreate = getmarkerpos "spawnaire"; _chance = ceil(random 100); if (_chance > _existChance) then { {deleteVehicle vehicle _x; deleteVehicle _x; sleep 0.1;} forEach units _grp; }; _wp = _grp addWaypoint [getMarkerPos _patrolMarker, 1]; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointSpeed "FULL"; _wp setWaypointFormation "VEE"; _wp setWaypointType "MOVE"; _wp setWaypointCombatMode "Yellow"; [_grp, 1] setWaypointPosition [getMarkerPos "spawnaire", 300]; _spwnairdir = [_poscreate, _airdest] call BIS_fnc_dirTo; vehicle _x setpos [(_spwnairpos select 0) + (sin (_spwnairdir -180)), (_spwnairpos select 1) + (cos (_spwnairdir -180)), 300]; //vehicle _x setVelocity [(vectorDir this select 0)*100,(vectorDir this select 1)*100,(vectorDir this select 2)*100]; sleep 2; while {{alive _x} count units _grp > 0} do { waitUntil{ ((getPos leader _grp) distance (getMarkerPos ["spawnaire"]) < (_flyInHeight * 3) - _flyInHeight) }; sleep _pilotWaittime; _wp1 = _grp addWaypoint [getMarkerPos "spawnaire", 25]; [_grp, 1] setWaypointBehaviour "COMBAT"; [_grp, 1] setWaypointSpeed "FULL"; [_grp, 1] setWaypointFormation "VEE"; [_grp, 1] setWaypointType "MOVE"; [_grp, 1] setWaypointPosition [getMarkerPos "spawnaire", 300]; [_grp, 1] setWaypointCompletionRadius 300; [_grp, 1] setWaypointCombatMode "Yellow"; [_grp, 1] setWaypointStatements ["true", ""]; sleep 2; _wp2 = _grp addWaypoint [getMarkerPos "oamarker", 25]; [_grp, 2] setWaypointBehaviour "COMBAT"; [_grp, 2] setWaypointSpeed "FULL"; [_grp, 2] setWaypointFormation "VEE"; [_grp, 2] setWaypointType "MOVE"; [_grp, 2] setWaypointPosition [getMarkerPos "oamarker", 25]; [_grp, 2] setWaypointCompletionRadius 300; [_grp, 2] setWaypointCombatMode "Yellow"; [_grp, 2] setWaypointStatements ["true", ""]; sleep 2; _wp3 = _grp addWaypoint [getMarkerpos "cyclewpmrk", 25]; [_grp, 3] setWaypointBehaviour "COMBAT"; [_grp, 3] setWaypointSpeed "FULL"; [_grp, 3] setWaypointFormation "VEE"; [_grp, 3] setWaypointType "Cycle"; [_grp, 3] setWaypointPosition [getMarkerPos "cyclewpmrk", 25]; [_grp, 3] setWaypointCompletionRadius 2825; [_grp, 3] setWaypointCombatMode "Yellow"; [_grp, 3] setWaypointStatements ["true", ""]; sleep 2; }; }; _killpilots = { _chop = _this select 0; _crew = _this select 1; waitUntil {count units _chop == 0 or not canmove _chop}; sleep 1.0; {_x setdammage 1} foreach _crew; }; private ["_airdest","_poscreate","_spwnairdir","_rndx","_rndy","_kpos","_allunits","_maxu","_upos","_dcounta","_d","_max","_allvecs","_heli","_heli1","_heli2","_spawne","_killh1","_pilot"]; for [{_loop=0}, {_loop<1}, {_loop=_loop}] do { // diag_log text format ["AirpatroleEast1ON: %1", RND_number]; sleep _varisleep; _airdest = getMarkerPos "oamarker"; _poscreate = getmarkerpos "spawnaire"; _pilot = createGroup (east); _rndx = random 600; _rndy = random 600; _kpos = [(_poscreate select 0)-300 +_rndx,(_poscreate select 1)-300+_rndy,500]; _allunits = jig_east_AIpilot; _maxu = (count _allunits)-1; _upos = getmarkerpos "centerp"; _dcounta = 2; _d = 0; while {_d <= _dcounta} do { (_allunits select round random _maxu) createUnit [_upos, _pilot];Sleep jig_tvt_globalsleep; _d = _d+1; }; jig_air_patrolee1 = ["I44_Plane_G_Bf109E4_WL","I44_Plane_G_Bf109F2_WL","I44_Plane_G_Bf109G6_WL"]; _allvecs = jig_air_patrolee1; _max = (count _allvecs)-1; _heli = createVehicle [_allvecs select (round random _max), _kpos, [], 50, "FLY"]; Sleep jig_tvt_globalsleep; sleep 0.1; _spwnairdir = [_poscreate, _airdest] call BIS_fnc_dirTo; _heli setpos [(_poscreate select 0) + (sin (_spwnairdir -180)), (_poscreate select 1) + (cos (_spwnairdir -180)), 300]; _heli engineon true; (units _pilot select 0) assignAsDriver _heli; (units _pilot select 0) moveInDriver _heli; //adding _heli1 = createVehicle [_allvecs select (round random _max), _kpos, [], 50, "FLY"]; Sleep jig_tvt_globalsleep; sleep 0.1; _spwnairdir = [_poscreate, _airdest] call BIS_fnc_dirTo; _heli1 setpos [(_poscreate select 0) + (sin (_spwnairdir -180)), (_poscreate select 1) + (cos (_spwnairdir -180)), 300]; _heli1 engineon true; (units _pilot select 1) assignAsDriver _heli1; (units _pilot select 1) moveInDriver _heli1; //adding _heli2 = createVehicle [_allvecs select (round random _max), _kpos, [], 50, "FLY"]; Sleep jig_tvt_globalsleep; sleep 0.1; _spwnairdir = [_poscreate, _airdest] call BIS_fnc_dirTo; _heli2 setpos [(_poscreate select 0) + (sin (_spwnairdir -180)), (_poscreate select 1) + (cos (_spwnairdir -180)), 300]; _heli2 engineon true; (units _pilot select 2) assignAsDriver _heli2; (units _pilot select 2) moveInDriver _heli2; _pilot setFormation "VEE"; _pilot setCombatMode "RED"; {_x addEventHandler ["killed", {handle = [_this select 0] execVM "Scripts\bury.sqf"}]} forEach (units _pilot); _heli addEventHandler ["killed", {handle = [_this select 0] execVM "Scripts\bury.sqf"}]; _spawne = [_heli] spawn {[_this select 0] call BIS_EVO_idelSVEC}; _killh1 = [_heli,crew _heli] spawn {[_this select 0,_this select 1] call _killpilots}; //adding _heli1 addEventHandler ["killed", {handle = [_this select 0] execVM "Scripts\bury.sqf"}]; _spawne = [_heli1] spawn {[_this select 0] call BIS_EVO_idelSVEC}; _killh1 = [_heli1,crew _heli1] spawn {[_this select 0,_this select 1] call _killpilots}; //adding _heli2 addEventHandler ["killed", {handle = [_this select 0] execVM "Scripts\bury.sqf"}]; _spawne = [_heli2] spawn {[_this select 0] call BIS_EVO_idelSVEC}; _killh1 = [_heli2,crew _heli2] spawn {[_this select 0,_this select 1] call _killpilots}; sleep 1; call _wpfnc; sleep 1; // waitUntil {(not (alive _heli) or not(alive _heli1) or not(alive _heli2)) or (isNull (driver _heli) or isNull (driver _heli1) or isNull (driver _heli2))}; waitUntil {(not (alive _heli) AND not (alive _heli1) AND not (alive _heli2)) or (isNull (driver _heli) AND isNull (driver _heli1) AND isNull (driver _heli2))}; if (alive _heli) then {_heli setdammage 1}; if (alive _heli1) then {_heli1 setdammage 1}; if (alive _heli2) then {_heli2 setdammage 1}; sleep 15; if (alive (units _pilot select 0)) then {(units _pilot select 0) setdammage 1}; if (alive (units _pilot select 1)) then {(units _pilot select 1) setdammage 1}; if (alive (units _pilot select 2)) then {(units _pilot select 2) setdammage 1}; }; Anybody?
  3. SGT_SAVAGE Great Mod and the changes to v2_5 are very nice. We had previous version running on the server about a month ago and was very surprised that Evo Sea v4 ran continuous for about 3 and a half weeks with no hiccups and a very clean rpt. With v2_5 the rpt is slamed with messages and causes many red chains and desync when over 5 players on at the same time. uns_traps\punji_2_a.p3d: No geometry and no visual shape uns_traps\tripwire2a.p3d: No geometry and no visual shape uns_traps\tripwire1b.p3d: No geometry and no visual shape uns_traps\punji_2_a.p3d: No geometry and no visual shape uns_traps\tripwire2b.p3d: No geometry and no visual shape uns_traps\tripwire2a.p3d: No geometry and no visual shape uns_traps\tripwire1a.p3d: No geometry and no visual shape uns_traps\m49_flare_trip.p3d: No geometry and no visual shape uns_traps\tripwire1a.p3d: No geometry and no visual shape uns_traps\m49_flare_trip.p3d: No geometry and no visual shape Anything I can do about this? Keep up the great work. Its good to see available in 6 updater as many players won't use mods unless its on 6. Thanks again.
  4. Jigsor

    Revive Script

    Looking through [R3F] Revive v2.0 I cannot locate the above statements in your error. Maybe it is being generated by some script other than R3F revive like a script that goes off when player is killed. It may be using its own timer and then runs execVM "R3F_revive\reapparaitre_camp.sqf". As far as i know R3F revive uses RespawnDelay = parameter from description.ext. So try to trace the if (_minute == 0 and _second == 0) then statement maybe. A free program like Multifind will allow you to search for key words of phrases within all docments in a mission folder. The Any thing could mean that script is not getting the variable it need to complete or the variable is not in a proper format.
  5. Jigsor

    Revive Script

    The whole script suit is about 120 files total and would take some experimentation. But it probably could get it done. In revive_init.sqf there are arrays you can implement. // UNITS THAT CAN REVIVE/UNITS THAT CAN BE REVIVED _can_revive = "soldierWB"; //array no.18 _can_be_revived = "soldierWB"; //array no.20
  6. Thanks Joe, but that is a bit different than what I'm trying to do I beleive. Your box is placed at a predetermined unique marker already placed on map, not the same marker recreated at new location and placed by script.Also my waypoints cycle as it should for an air patrol. Once your waypoint ie: [razor, 3] setWaypointPosition [position box1, 0] is reached, You Ai will finish waypoint. You have not updated your waypoint in this example. I see no loop here. I think my problem is with loop and not being able to update cycle loop. I've seen your method used countless times with uniquely named markers placed on the map then a script chooses one of those markers by count or random. Some of my objectives use isFlatEmpty command for random placement of an object and marker so those coordinates are not determined until the script finds a suitable location. Trying to keep this universally dynamic in the sense of scripts generating markers and waypoints based on markers not placed in map but unforeseen places.
  7. Jigsor

    Revive Script

    Norrin Revive has all those features with adjustable parameters. Of couse its not a client side script if thats what your looking for. It has to be incorporated into the mission. Can I still get that 20?
  8. I've seen this happen when you change the mission name within mission editor. Maybe this is the problem. After you edit the mission do not change the name from editor. Just save it. Else it will only create a mission.sqm If you want to change the mission name, rename the mission folder from within windows explorer after you have shut the game down.
  9. I have not seen this discussed before, but maybe it has and I just can't find it. I have multiple scripts by various authors myself included that use _loop. One defines _ loop in for statement as _loop2=0 another script defines _loop as _loop=1. And the same scripts also define _loop as _loop=_loop within themselves. I thinks I understand how the _loop works as I have observed looped scripts running with verbose feedback. This has crossed my mind before, but I never had any trouble with it. I don't believe I am having trouble with it at this point, but I Used Killzone_Kid's Simple Private Variable extractor and it privatized my _loops and does not recognize it as a Special Variable such _this. Is it good practice to make private _loop?
  10. If it is not a special variable as confirmed by you, then maybe I should privatize it as many of my current and future scripts will and do use it within their own scope and no reguard of global scope. Especially when it is possible that 2 scripts or more could be running at the same time using the same variable. I could print all the scripts using in in here, but it would be a wall of text several pages. Is it really necessary. I'm asking if it is generally good practice when used in multiple scripts. Nice web page by the way.. very helpfull.
  11. So I'm trying to compare values in position arrays. I'd like to set a variable to nil if 2 position arrays are not equal. Maybe setting a variable to nil in this case here is not possible? I'm thinking it is. An if nil will be used for a while loop until 2 matching arrays are found after the following code: Maybe I'm just using improper sytax for the not equal to? _marker = object1; _current_rnd = random_number; _pos = [ getPos _marker select 0, (getPos _marker select 1)]; _posAO1 = [ getMarkerPos "task1mkr" select 0, (getMarkerPos "task1mkr" select 1)]; _posAO2 = [ getMarkerPos "task3mkr" select 0, (getMarkerPos "task3mkr" select 1)]; _posAO3 = [ getMarkerPos "movingtrain" select 0, (getMarkerPos "movingtrain" select 1)]; _posAO4 = [ getMarkerPos "task7mkr" select 0, (getMarkerPos "task7mkr" select 1)]; if (_current_rnd == 2) then {if (_pos != _posAO1) then {isnil _current_rnd};}; if (_current_rnd == 3) then {if (_pos != _posAO2) then {isnil _current_rnd};}; if (_current_rnd == 4) then {if (_pos != _posAO3) then {isnil _current_rnd};}; if (_current_rnd == 5) then {if (_pos != _posAO4) then {isnil _current_rnd};}; if (_current_rnd == 4) then {if (_pos != _posAO3) then {isnil _current_rnd};}; RPT returns Error in expression <; if (_current_rnd == 3) then {if (_pos != _posAO2) then {isnil _current_rnd};};> Error position: <!= _posAO2) then {isnil _current_rnd};};> Error !=: Type Array, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location
  12. Thanks guys, I've got a working script now. This bit now looks like this statement. if (_current_rnd == 3) then { if (_pos distance _posAO2 == 0) then { _invhelipad setPos getMarkerPos "task3mkr"; } else { _current_rnd = nil; }; }; isNil isNo good for this sort of thing.
  13. Array index starts at 0. http://forums.bistudio.com/showthread.php?100559-Beginners-guide-Arrays .rpt which is error log is located at "C:\Users\UserName\AppData\Local\ArmA 2 OA" to print to .rpt To print to .rpt example: diag_log text format ["Items: %1", _items]; Items could be any thing. _items is a real variable. print in chat: if (side player == west) then { player sideChat "You have 20 minutes to Deffensive Objective"; player globalChat "You have 20 minutes to Complete your Objective"; }; hint command can print on screen upper right. if (local player) then { hint "Custom message"; }; Some useful links: http://forums.bistudio.com/showthread.php?74092-Mr-Murray-Editor-Guide/page2 http://forums.bistudio.com/showthread.php?78089-Mission-Editing-and-Scripting-Information-Links-only-NO-Discussion forEach looks good. The mission file.pbo must be depboed and will make a folder. That folder has all the scripts in text files.sqf It goes here in order to make accessible by game editor. "C:\Users\UserName\Documents\ArmA 2 Other Profiles\Jigsor=BMR=\MPMissions" You'll need a tool to unpack the pbo such as: http://www.armaholic.com/page.php?id...=PBO%2BMANAGER You C++ interpretations are at least interesting if not functional.
  14. Thanks Killzone_Kid I'll try that. Need to rethink whole script now. Doesn't make sence that server can check if variable a is undefined with isNil and return true or false, but you can't declare a variable as isNil It would make my while loop much easier to write.
  15. You code looks alot like C++ The Arma language is based on C++ but relies on a lot of predefined constants so some syntax is different.. Best to get familiar with another game besides DayZ. Learn what it does before looking at the scripts. Then crack it open and start looking up the commands. I think Domination may have used a lot of code closer to C++ Very strange coding in Domination. There are Tons of very good scripters in here and lots of people willing to help if you have a half decent or challenging question. func = { _loc = ["5","string_b"]; _locb = _this select 1 if ((count _loc) > 0 and _locb != "") then { hint "no string found"; }; sleep _loc this select 0; publicVariable "_loc"; }; call func; Me thinks.. Also Check out this time script although its not sqf but fsm. http://forums.bistudio.com/showthread.php?137061-MP-Fast-time-FSM-JIP-Compatible
  16. Don't know about ExtractPBO, but here's a thread for another tool that does the job. http://forums.bistudio.com/showthread.php?148306-Anyone-gotten-Eliteness-to-work-on-Windows-7
  17. I got a PM asking to explain how I got these settings in my config so I'll try again. I reread my post and realized I had a mixup with labled bit and byte. All the numbers are the same and config is still good but, it had a bad description. Fixed now. 204,800 64 bit packets equals 100Mbps 204,800 x 64 = 13107200 bits. 13107200 bit = 100 Megabit. Thats throuput per second (100Mbps) So each packet in this case is 1 bit. 13107200 bit divided by 256 (MaxSizeGuaranteed) = 51200 total packets sized at 256 bits each. MaxSizeGuaranteed = 256 (used in config) 51200 total packets sized at 256 bits each = 100Mbps throuput. Well my connection is not 100 Mbps. That would cost thousands of $. My server is 10Mbps up and 10 Mbps down. (symetrical) When dealing with a server, Your really more concerned with up speed cuz its sending a lot more than receiving. Send=up Receive=down. 51200 divided by 10 = 5120 possible packets sized at 256 bits. (Nice round whole number.) Computers like whole numbers :) 13107200 divided by 10 = 1310720 1310720 1 bit packets with 10 Mbps up connection is possible. 1310720 bits = 10485760 bytes. MaxBandwidth = 10485760 (used in config) Can use up to this much bandwidth MinBandwidth = 5242880 (used in config) I've dedicated at half of the total available bandwith to 1 game. Can run 2 games with sames settings and not go over 10Mbps. MaxSizeNonguaranteed = 64 (used in config)Value setting should be a multiple of MaxSizeGuaranteed. 32 will work very good in simple PVP like CTF or DM. 128 works to but 64 gives best for this game type. I should note that my service providers bandwidth monitoring interface confirms the expected bandwidth usage. The in game monitor nor the Server command #monitor, do not reflect true bandwidth consumption in my experience. I can't even get an accurate reading from System Monitor in Ubuntu. I Don't know the name of the software my colo center is using for their web inteface, but it good. I've never had an overage charge.....
  18. Jigsor

    MP COOP GITS EVOLUTION - main thread

    Maybe something along the lines of this: class Item50 { position[]={1969.9734,5.6999998,5732.7661}; a=200; b=200; activationBy="EAST"; repeating=1; timeoutMin=20; timeoutMid=20; timeoutMax=20; interruptable=1; age="UNKNOWN"; name="EnemyDetected"; expActiv="alarmOn = true; hint ""enemy detected"""; class Effects { }; }; class Item51 { position[]={1969.8131,5.6999998,5732.0991}; a=0; b=0; repeating=1; timeoutMin=20; timeoutMid=20; timeoutMax=20; interruptable=1; age="UNKNOWN"; name="alarm"; expCond="alarmOn"; expActiv="hint ""enemy in area"""; class Effects { soundDet="AlarmSfx"; track="Track07_ActionDark"; }; I tried including variations of your original condition, but could not meet a true condition for activation such as: ( (("Man" countType thislist) >0) and (alive mast) and (alarmOn) ) ( (("Man" countType thislist) >0) and (alive mast) and alarmOn ) damage ID5514 >= 1 and alarmOn damage ID144021 < 1 and alarmOn damage ID144021 > 5 and alarmOn getdamage is not allowed in condition but maybe in scripted version? Not sure what mast is referring to. No Clear reference in Mission. Maybe Communication Tower built into island ID144021? I did get the alarm to sound with first example. Though was not on dedi, but I could not get your original version to sound on local host. The first method works in another mission I built on dedi but activation calls a script to play sound and doesn't use trigger effects. Nam Unsung Evo is awesome. I just wish the enemy had NV during that era because in game they don't engage at night unless you trip on them. A param to enable disable NV for each side could be cool....
  19. Jigsor

    MP COOP GITS EVOLUTION - main thread

    Thanks EB, I went ahead and applied the delete.sqf change to the A2 version we are currently running and although I wasn't running a client benchmark and don't exactly know how to run a benchmark on the server, one client reported frame increase over the day before. Hard to say if it really improved however, it did not break anything. As for the marker/task update, A sure work around I've always used if trigger 0,0,2 doesn't work is to get fully into the game, and then go back to lobby and join again. Repeatable 100% of the time. So when #1 is already in game and #2 joins, #1 or server PVs task state, but #2 is not calling the Variable untill it gets PVed again me thinks. Not really a problem, but can be confusing for new Evo players.
  20. Jigsor

    MP COOP GITS EVOLUTION - main thread

    Hi EB, I've noticed you made a change to delete.sqf from A2 to A3 Evo. I don't quite understand what this bit means *. or if it is a typo, but the latest version from A2 Tavi has this as well as previous A2 missions. Is this a change that helped improve performance in A3? This script is called many times and from many other scripts I belive its to keep group numbers below 144 limitation in A2 and A3. Should the script be changed to the A3 versioned edit and applied to the A2 missions? Just wondering if this could help improve performance in A2 versions as we are still enjoying them especially with all the mods available to A2. Maybe related the the fire bug caused by wrecked choppers? Great work on A3 evo. A2 version: // used to cleanly delete units and their groups. _grp = _this select 0; _time = 2.0 + (random 2.5); _allunits = units _grp; _count = count _allunits; _Vehicles = []; sleep _time; _i=0; //hint format["vecs:%1 %2 %3 %4",_count,_allunits]; while {_i < _count} do { _unit = (_allunits select _i); _vec = vehicle _unit; if (not (_vec isKindOf "Man") and not (_vec in _Vehicles)) then {_Vehicles = _Vehicles+[_vec]}; _i=_i+1; }; { _vec = _x; {_x setpos position _vec} forEach crew _vec; } forEach _Vehicles; {deletevehicle _x} forEach units _grp; {if(count crew _x > 0) then {debuglog format["ALERT!! vec has passengers %1", TypeOf _x]};deletevehicle _x} forEach _Vehicles; deleteGroup _grp; /* while {_count >= 0} do { _man = (units _grp select _count); _unit = vehicle _man; if (not (_unit isKindOf "Man") and not (isNull _unit)) then { {_x action ["Eject",_unit]} forEach crew _unit; }; sleep _time; deletevehicle _unit; _count = _count-1; }; *. deleteGroup _grp; A3 version: // used to cleanly delete units and their groups. _grp = _this select 0; _time = 2.0 + (random 2.5); _allunits = units _grp; _count = count _allunits; _Vehicles = []; sleep _time; _i=0; //hint format["vecs:%1 %2 %3 %4",_count,_allunits]; while {_i < _count} do { _unit = (_allunits select _i); _vec = vehicle _unit; if (not (_vec isKindOf "Man") and not (_vec in _Vehicles)) then {_Vehicles = _Vehicles+[_vec]}; _i=_i+1; }; { _vec = _x; {_x setpos position _vec} forEach crew _vec; } forEach _Vehicles; {deletevehicle _x} forEach units _grp; {if(count crew _x > 0) then {debuglog format["ALERT!! vec has passengers %1", TypeOf _x]};deletevehicle _x} forEach _Vehicles; deleteGroup _grp; /* while {_count >= 0} do { _man = (units _grp select _count); _unit = vehicle _man; if (not (_unit isKindOf "Man") and not (isNull _unit)) then { {_x action ["Eject",_unit]} forEach crew _unit; }; sleep _time; deletevehicle _unit; _count = _count-1; }; deleteGroup _grp; */ Reguards.
  21. Very impressive. Best F18 mod I have come across. Will be using these as the goto jet for Anti Air Could be used for goto jet for almost anything. The pluses are: 1. The afterburner functions and looks great. 2. Works well with Nimitz and towing/rearming tractor. 3. Loadout changing is easily done without need of Mando missle 4. Single seater version included which allows locking AT and AA without requiring a body in the gunner seat. Two seater is also included if you want that feature. 5. Keeps true to the agility and maneuverability of an F18. 6. Plays well with GLT misslebox. 6. Plays well with all our other mods and we run a ton of them though We don't use ACE mod 7. Reskinable and comes with template. 8. No hidden sub scroll aircraft actions makes for quick control access. 9. Canopy automatically shuts when pressing thrust. 10 Many weapons holders for multiple Gas tanks or launchers. 11. Example loadout scripts supplied. Looks like you thought of everything John Spartan. The example scripts for changing loadout seam to be a mix of sqf and sqm so I made my own sqf using the supplied scipts as examples only. Works a dream with no errors or rpt spam. Only issue I found is the folding wings do not work. Its starts the fold, but does not finish and returns to unfolded. Its not a big deal though. Great work on this mod. Highly recommended. Your mod has been running on our MP server now for 3 days. Can't really say enough about it. Contract awarded! Edit: A player reported folding wings are working but engine must be off.
  22. Jigsor

    MP COOP GITS EVOLUTION - main thread

    Have not tried the new Evo yet but I can report some similar general observations hosting other A3 games. PVP with no AI runs the best.Least chains ala Blitzkrieg( 750kb in size). PVP with 20 + ai Runs ok as long as they are not several players connecting and disconnecting. A locked server in this instance runs considerably well ala Urban Conquest which are only 1.5 mb in size. Stock Coop games generate several chains when players connect/ disconnect. I hope the planned server executable handles the net code a lot better then using current work around or else large scale/AI battles will not be as grand as Arma 2.
  23. Jigsor

    [HELP] Script for exchange air

    Wow, I can see this going the way of CPR with tweak scripting an additional animation... but would you really want to see that?
  24. TonyGrunt, you are a scholar and a gentleman for solving this issue. Old habits die hard. Eliteness is back!
  25. How are you calling the script?
×