Member
Last active 8 years ago
while {_run} do { sleep (20 + (random 20));
So, I do it. Ok, thx!
Hellow! I find some vehicle respawn script and edit it for ALiVE intergration. All discription in comment. Please, check it on perfomance. Each vehicle has instance of this script:
[_value, _key, _x createVehicle (_key findEmptyPosition [5, 50, _x])] execVM "respawn_vehicle.sqf";
Each instance has loop on observe OPCOM_instances. I think, for do this (for respawn vehicle) need one vehicle manager and callback function (notify resiver), not loop through OPCOM_instances, or not? or it's script is normal?
/* ================================================================================================================== Simple Vehicle Respawn Script v1.81 for Arma 3 by Tophe of [OOPS] Origin by fLaf [ARMATOP] ALiVE integration Options: There are some optional settings. The format for these are: veh = [faction, ALiVE_opcom_objective_center, object, Delay, Deserted timer, Respawns, Effect, Dynamic] execVM "vehicle.sqf" Vehicle respawn is working only into ALiVE opcom objective (town, military base, custum placement). If <"faction" option> has "reserve" tacom state in objective with center in <"ALiVE_opcom_objective_center" option>, then respawn is on - else respawn is off and instance of this script is ending. You can use global variable "override_factions" for debug. For example: enter in debuger override_factions = ["OPF_F"]; // factions array for support multifaction opcom and all respawn point while emulute recapturing by this faction. Default respawn delay is 60 seconds, to set a custom respawn delay time, put that in the init as well. Like this: veh = [this, 15] execVM "vehicle.sqf" Default respawn time when vehicle is deserted, but not destroyed is 120 seconds. To set a custom timer for this first set respawn delay, then the deserted vehicle timer. (0 = disabled) Like this: veh = [this, 15, 10] execVM "vehicle.sqf" By default the number of respawns is infinite. To set a limit first set preceding values then the number of respawns you want (0 = infinite). Like this: veh = [this, 15, 10, 5] execVM "vehicle.sqf" Set this value to TRUE to add a special explosion effect to the wreck when respawning. Default value is FALSE, which will simply have the wreck disappear. Like this: veh = [this, 15, 10, 5, TRUE] execVM "vehicle.sqf" By default the vehicle will respawn to the point where it first was when the mission started (static). This can be changed to dynamic. Then the vehicle will respawn to the position where it was destroyed. First set all preceding values then set TRUE for dynamic or FALSE for static. Like this: veh = [this, 15, 10, 5, TRUE, TRUE] execVM "vehicle.sqf" If you you want to set the INIT field of the respawned vehicle, first set all other values, then set init commands. Those must be inside quotations. Like this: veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf" Default values of all settings are: veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf" Contact & Bugreport: [email protected] ALiVE integration: [email protected] ================================================================================================================== */ private ["_hasname","_delay","_deserted","_respawns","_noend","_dead","_nodelay","_timeout","_position","_dir","_effect","_rounds","_run","_unit","_explode","_dynamic","_unitinit","_haveinit","_unitname","_type", "_factions", "_objective_center"]; if (!isServer) exitWith {}; // Define variables _factions = _this select 0; _objective_center = _this select 1; _unit = _this select 2; _delay = if (count _this > 3) then {_this select 3} else {60}; _deserted = if (count _this > 4) then {_this select 4} else {120}; _respawns = if (count _this > 5) then {_this select 5} else {0}; _explode = if (count _this > 6) then {_this select 6} else {false}; _dynamic = if (count _this > 7) then {_this select 7} else {false}; _unitinit = if (count _this > 8) then {_this select 8} else {}; _haveinit = if (count _this > 8) then {true} else {false}; _hasname = false; _unitname = vehicleVarName _unit; if (isNil _unitname) then {_hasname = false;} else {_hasname = true;}; _noend = true; _run = true; _rounds = 0; if (_delay < 0) then {_delay = 0}; if (_deserted < 0) then {_deserted = 0}; if (_respawns <= 0) then {_respawns= 0; _noend = true;}; if (_respawns > 0) then {_noend = false}; _dir = getDir _unit; _position = getPosASL _unit; _type = typeOf _unit; _dead = false; _nodelay = false; // Start monitoring the vehicle while {_run} do { sleep (20 + (random 20)); if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; // Check if the vehicle is deserted. if (_deserted > 0) then { _nearPlayers = false; { if ((_x distance _unit) < 500) exitWith { _nearPlayers = true; }; } forEach playableUnits; if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8) and !_nearPlayers) then { _timeout = time + _deserted; sleep 0.1; waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; if ({alive _x} count crew _unit > 0) then {_dead = false}; if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; if !(alive _unit) then {_dead = true; _nodelay = false}; }; }; // Check ALiVE objective _run = false; { private ["_opcom_factions", "_opcom_objectives", "_opcom_objective_center", "_tacom_state"]; _opcom_factions = [_x, "factions"] call ALiVE_fnc_hashGet; if (!isNil "override_factions") then {_opcom_factions = override_factions;}; if ( _factions in [_opcom_factions] ) then { _opcom_objectives = [_x, "objectives"] call ALiVE_fnc_hashGet; { _opcom_objective_center = [_x, "center"] call ALiVE_fnc_hashGet; if ( vectorMagnitude (_objective_center vectorDiff _opcom_objective_center) < 1 ) then { _tacom_state = [_x, "tacom_state"] call ALiVE_fnc_hashGet; if (!isNil "_tacom_state" && {_tacom_state == "reserve"}) then { _run = true; }; }; } foreach _opcom_objectives; }; } foreach OPCOM_instances; if (!_run) then { if ( vectorMagnitude (_position vectorDiff (getPosASL _unit)) < 1 ) then { _unit setDamage 1; }; }; // Respawn vehicle if (_dead and _run) then { if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; if (_explode) then {_effect = "M_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;}; sleep 0.1; deleteVehicle _unit; sleep 2; _unit = _type createVehicle _position; _unit setPosASL [_position select 0,_position select 1,(_position select 2) + 0.2]; _unit setDir _dir; if (["B_UAV", _type] call BIS_fnc_inString) then { createVehicleCrew _unit; }; if (["B_UGV", _type] call BIS_fnc_inString) then { createVehicleCrew _unit; }; if (["O_UAV", _type] call BIS_fnc_inString) then { createVehicleCrew _unit; }; if (["O_UGV", _type] call BIS_fnc_inString) then { createVehicleCrew _unit; }; if(_unitname != "") then { _unit setVehicleVarName (format ["%1",_unitname]); PublicVariable (format ["%1",_unitname]); }; _dead = false; // Check respawn amount if !(_noend) then {_rounds = _rounds + 1}; if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; }; };
How can I get this colors? At now I use two state for coloring my map:
{ // caf_ag_afr_p // BLU_G_F if ("BLU_G_F" in ([_x,"factions"] call ALiVE_fnc_hashGet)) then { _objectives = [_x,"objectives",[]] call ALiVE_fnc_hashGet; { name_ = [_x,"objectiveID"] call ALiVE_fnc_hashGet; pos_ = [_x,"center"] call ALiVE_fnc_hashGet; size_ = [_x,"size"] call ALiVE_fnc_hashGet; type_ = [_x,"type"] call ALiVE_fnc_hashGet; makrek_name_major_ = "marker_" + name_ + "_major"; makrek_name_rspam_ = "respawn_west_" + name_; opcom_state_ = [_x, "opcom_state"] call ALiVE_fnc_hashGet; tacom_state_ = [_x, "tacom_state"] call ALiVE_fnc_hashGet; if (isNil "tacom_state_") then { tacom_state_ = "none"; }; } foreach _objectives; }; } foreach OPCOM_instances;
I need on my map only 4 state:
CIV magenta
OPF_F red
BLU_F blue
Active battle yellow
Only 4 states! How can I do this?
I make workshop page for CAF Aggressors.
http://steamcommunity.com/workshop/filedetails/?id=664276003
Whill be nice, if someone help me fix some bug of this mod.. who can do this? Need fix some error message like "file not found \data\rpg7_rockets_co.paa" as first.
Also, as I can undestend, aliance tacom not swatch status objective if player do somthing. For example, I (one solder) go to enemy town, I go alone. I kill few enemy, but my opcom/tacom not react on this action.
So, it's screenshot from OPF_F opcom. As you can see, in to green objectives has a red forces, and anothe green objectives has blue forces. What green color mean??
Also, what mean anothe colors, yellow, white..? And status on "captured" and "occupied"?
thx u!
I write script for remake markers (every 60 seconds) on top of opcom objectives. All fine! But..
I have two factions:
{ if ("BLU_G_F" in ([_x,"factions"] call ALiVE_fnc_hashGet)) then {}; } foreach OPCOM_instances; { if ("OPF_F" in ([_x,"factions"] call ALiVE_fnc_hashGet)) then {}; } foreach OPCOM_instances;
I have opcom states :
opcom_state_ = [_x, "opcom_state"] call ALiVE_fnc_hashGet; if ("attack" != opcom_state_ && "attacking" != opcom_state_ && "defend" != opcom_state_ && "defending" != opcom_state_ && "reserve" != opcom_state_ && "reserving" != opcom_state_ && "idle" != opcom_state_ && "unassigned" != opcom_state_) then { diag_log format["Unknown opcom_state: %1", opcom_state_]; }
I have tacom states:
tacom_state_ = [_x, "tacom_state"] call ALiVE_fnc_hashGet; if ("recon" != tacom_state_ && "capture" != tacom_state_ && "defend" != tacom_state_ && "reserve" != tacom_state_) then { diag_log format["Unknown tacom_state: %1", tacom_state_]; }
On one objectives it's was different states for each factions.
And I want just 4 state on my map: BLU_F, OPF_F, BLU_F && OPF_F (active battle) and not BLU_F && not OPF_F (empty or CIV objective).
How can I do that? What meen each state of opcom/tacom?
I did it..
_logic = [MYMP, 0, objNull, [objNull]] call BIS_fnc_param; qwe = [_logic, "objectives", nil] call ALiVE_fnc_MP; { diag_log format ["##ZZ## %1 %2", [_x, "center"] call ALIVE_fnc_hashGet, [_x, "size"] call ALIVE_fnc_hashGet] } foreach qwe;
I don't want use a C2ISTAR module, but information from "Command Action -> Intel" important for player in my mission. How can I show all Military placements on General Map (on 'M' key)? Also, I need setup triggers on all Military placements. For example, if Military placement is "ocupated" by OPF_F, I want respawn vehicle in this area of this side, respawn vehical of OPF_F side. If MP ocupated by BLU_F, need vehicle respawn of BLU_F. How can I do that?