Skip to content

Commit

Permalink
updated CHVD and fixed #41
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirk Main committed May 19, 2015
1 parent bb56089 commit 392b2ce
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 80 deletions.
53 changes: 53 additions & 0 deletions CHVD/fn_addonInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[] spawn {
//Wait for mission init, in case there are variables defined some place else
waitUntil {time > 0};

CHVD_scriptRunning = if (isNil "CHVD_scriptRunning") then {false} else {CHVD_scriptRunning};
if (CHVD_scriptRunning) exitWith {systemChat "CHVD script is running. Addon disabled"};

//Define variables, load from profileNamespace
CHVD_allowNoGrass = if (isNil "CHVD_allowNoGrass") then {true} else {CHVD_allowNoGrass};
CHVD_maxView = if (isNil "CHVD_maxView") then {12000} else {CHVD_maxView};
CHVD_maxObj = if (isNil "CHVD_maxObj") then {12000} else {CHVD_maxObj};

CHVD_footSyncObj = profileNamespace getVariable ["CHVD_footSyncObj",false];
CHVD_carSyncObj = profileNamespace getVariable ["CHVD_carSyncObj",false];
CHVD_airSyncObj = profileNamespace getVariable ["CHVD_airSyncObj",false];

CHVD_foot = (profileNamespace getVariable ["CHVD_foot",viewDistance]) min CHVD_maxView;
CHVD_car = (profileNamespace getVariable ["CHVD_car",viewDistance]) min CHVD_maxView;
CHVD_air = (profileNamespace getVariable ["CHVD_air",viewDistance]) min CHVD_maxView;

CHVD_footObj = (profileNamespace getVariable ["CHVD_footObj",viewDistance]) min CHVD_maxObj;
CHVD_carObj = (profileNamespace getVariable ["CHVD_carObj",viewDistance]) min CHVD_maxObj;
CHVD_airObj = (profileNamespace getVariable ["CHVD_airObj",viewDistance]) min CHVD_maxObj;

CHVD_footTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_footTerrain",25]} else {(profileNamespace getVariable ["CHVD_footTerrain",25]) min 48.99 max 3.125};
CHVD_carTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_carTerrain",25]} else {(profileNamespace getVariable ["CHVD_carTerrain",25]) min 48.99 max 3.125};
CHVD_airTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_airTerrain",25]} else {(profileNamespace getVariable ["CHVD_airTerrain",25]) min 48.99 max 3.125};

//Begin initialization
waitUntil {!isNull player};
waitUntil {!isNull findDisplay 46};

_actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};
player addAction [_actionText, CHVD_fnc_openDialog, [], -99, false, true];
player addEventHandler ["Respawn", format ["player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]", _actionText]];

//Detect when to change setting type
[] spawn {
for "_i" from 0 to 1 step 0 do {
[nil, false] call CHVD_fnc_updateSettings;
_currentVehicle = vehicle player;
waitUntil {_currentVehicle != vehicle player};
};
};
[] spawn {
for "_i" from 0 to 1 step 0 do {
waitUntil {UAVControl (getConnectedUAV player) select 1 != ""};
[nil, true] call CHVD_fnc_updateSettings;
waitUntil {UAVControl (getConnectedUAV player) select 1 == ""};
[nil, false] call CHVD_fnc_updateSettings;
};
};
};
9 changes: 4 additions & 5 deletions CHVD/fn_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CHVD_scriptRunning = true;
//Wait for mission init, in case there are variables defined some place else
waitUntil {time > 0};

//Define variables, load from profileNamespace
CHVD_allowNoGrass = if (isNil "CHVD_allowNoGrass") then {true} else {CHVD_allowNoGrass};
CHVD_maxView = if (isNil "CHVD_maxView") then {12000} else {CHVD_maxView};
Expand All @@ -29,9 +29,8 @@
waitUntil {!isNull findDisplay 46};

_actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};
//player addAction [_actionText, CHVD_fnc_openDialog, [], -99, false, true];
//player addaction [_actionText, CHVD_fnc_openDialog, nil,1,false,true,"","(player distance spawnBuilding) < 25"];
//player addEventHandler ["Respawn", format ["player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]", _actionText]];
player addAction [_actionText, CHVD_fnc_openDialog, [], -99, false, true];
player addEventHandler ["Respawn", format ["player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]", _actionText]];

//Detect when to change setting type
[] spawn {
Expand All @@ -40,7 +39,7 @@
_currentVehicle = vehicle player;
waitUntil {_currentVehicle != vehicle player};
};
};
};
[] spawn {
for "_i" from 0 to 1 step 0 do {
waitUntil {UAVControl (getConnectedUAV player) select 1 != ""};
Expand Down
10 changes: 5 additions & 5 deletions CHVD/fn_onSliderChange.sqf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
private ["_sliderPos","_updateType"];
_varType1 = [_this, 0, "", [""]] call BIS_fnc_param;
_slider1 = [_this, 1, controlNull, [0, controlNull]] call BIS_fnc_param;
_slider1 = ctrlIDC ([_this, 1, 0, [0, controlNull]] call BIS_fnc_param);
_sliderPos = [_this, 2, 0, [0]] call BIS_fnc_param;
_text1 = [_this, 3, controlNull, [0, controlNull]] call BIS_fnc_param;
_text1 = [_this, 3, 0, [0, controlNull]] call BIS_fnc_param;
_varType2 = [_this, 4, "", [""]] call BIS_fnc_param;
_slider2 = [_this, 5, controlNull, [0, controlNull]] call BIS_fnc_param;
_text2 = [_this, 6, controlNull, [0, controlNull]] call BIS_fnc_param;
_slider2 = [_this, 5, 0, [0, controlNull]] call BIS_fnc_param;
_text2 = [_this, 6, 0, [0, controlNull]] call BIS_fnc_param;
_syncVar = [_this, 7, "", [""]] call BIS_fnc_param;

if (count _this < 8) then {
Expand All @@ -19,7 +19,7 @@ if (count _this < 8) then {
};

switch (_updateType) do {
case 1: {
case 1: {
sliderSetPosition [_slider1, _sliderPos min CHVD_maxView];
ctrlSetText [_text1, str round (_sliderPos min CHVD_maxView)];
sliderSetRange [_slider2, 0, _sliderPos min CHVD_maxView];
Expand Down
9 changes: 8 additions & 1 deletion EVO/fn_deployMplayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ if (player distance spawnBuilding < 1000) exitWith {
};



_checkBoundingSize = {
_type = _this select 0;
_bbdummy = _type createVehicleLocal [0,0,0];
_boundingBox = (boundingBox _bbdummy) select 1;
deleteVehicle _bbdummy;
_boundingSize = if (_boundingBox select 0 > _boundingBox select 1) then {_boundingBox select 0} else {_boundingBox select 1};
_boundingSize
};


_pos = getPos player;
Expand Down
9 changes: 5 additions & 4 deletions EVO/fn_initTarget.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ if (HCconnected) then {
for "_i" from 1 to paraSquads do {
_null = [_currentTarget] spawn {
_currentTarget = _this select 0;
while { _currentTarget == currentTarget } do {
while { RTonline && _currentTarget == currentTarget } do {
_spawnPos = [getPos server, 10, 500, 10, 0, 2, 0] call BIS_fnc_findSafePos;
_grp = [_spawnPos, EAST, (configFile >> "CfgGroups" >> "EAST" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons")] call BIS_fnc_spawnGroup;
if (HCconnected) then {
Expand Down Expand Up @@ -218,10 +218,11 @@ for "_i" from 1 to paraSquads do {
_heli doMove (getMarkerPos currentTargetMarkerName);
//_wp = _heliGrp addWaypoint [getMarkerPos currentTargetMarkerName, 0];
_heli flyInHeight 150;
waitUntil {(_heli distance (getMarkerPos currentTargetMarkerName)) < 500};
waitUntil {([_heli, currentTarget] call BIS_fnc_distance2D < 200)};
handle = [_heli] spawn EVO_fnc_paradrop;
doStop _heli;
waitUntil {count (assignedCargo _heli) == 0};
doStop _heli;
_heli doMove _spawnPos;
//_wp = _heliGrp addWaypoint [getPos server, 0];
handle = [_heli, _spawnPos] spawn {
Expand All @@ -234,8 +235,8 @@ for "_i" from 1 to paraSquads do {
deleteVehicle _heli;
};
_null = [(leader _grp), currentTargetMarkerName, "NOSMOKE", "DELETE:", 80, "SHOWMARKER"] execVM "scripts\UPSMON.sqf";
//waitUntil {({alive _x} count units _grp) < 3};
sleep 600;
waitUntil {({alive _x} count units _grp) < 3};
sleep 300;
};
};
};
Expand Down
130 changes: 65 additions & 65 deletions briefing.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,139 +6,139 @@ player createDiaryRecord ["OPREP", ["Mission", "Eradicated CSAT prescence on the
player createDiaryRecord ["OPREP", ["Execution", "NATO high command has issued orders to retake the island via a systematic approach. We will be receiving intel from our forward recon teams and leaders will be receiving new orders as we receive them. Infantry movement will be supported by light armor and air cover as we move towards the island."]];
_index = player createDiarySubject ["Gamemode","Gamemode"];
_rankString = "You are awarded field promotions based on your score:";
_rankString = _rankString + format ["\n<img image='img\pvt.paa' width='32' height='32'> %1 points = PRIVATE\n
<img image='img\corp.paa' width='32' height='32'> %2 points = CORPORAL\n
<img image='img\sgt.paa' width='32' height='32'> %3 points = SERGEANT\n
<img image='img\ltn.paa' width='32' height='32'> %4 points = LIEUTENANT\n
<img image='img\cpt.paa' width='32' height='32'> %5 points = CAPTAIN\n
<img image='img\mjr.paa' width='32' height='32'> %6 points = MAJOR\n
<img image='img\col.paa' width='32' height='32'> %7 points = COLONEL\n\n", 0, rank1, rank2, rank3, rank4, rank5, rank6];
_rankString = _rankString + format ["</br><img image='img\pvt.paa' width='32' height='32'> %1 points = PRIVATE</br>
<img image='img\corp.paa' width='32' height='32'> %2 points = CORPORAL</br>
<img image='img\sgt.paa' width='32' height='32'> %3 points = SERGEANT</br>
<img image='img\ltn.paa' width='32' height='32'> %4 points = LIEUTENANT</br>
<img image='img\cpt.paa' width='32' height='32'> %5 points = CAPTAIN</br>
<img image='img\mjr.paa' width='32' height='32'> %6 points = MAJOR</br>
<img image='img\col.paa' width='32' height='32'> %7 points = COLONEL</br></br>", 0, rank1, rank2, rank3, rank4, rank5, rank6];
player createDiaryRecord ["Gamemode", ["Player Ranks", _rankString]];


_assetString = "Each rank unlocks new vehicles for you to utilize:";
_assetString = _assetString + "\n<img image='img\pvt.paa' width='32' height='32'>\n PRIVATE \n\n";
_assetString = _assetString + "</br><img image='img\pvt.paa' width='32' height='32'></br> PRIVATE </br></br>";
{
_displayName = getText(configFile >> "CfgVehicles" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank1vehicles;
_assetString = _assetString + "\n<img image='img\corp.paa' width='32' height='32'>\n CORPORAL \n\n";
_assetString = _assetString + "</br><img image='img\corp.paa' width='32' height='32'></br> CORPORAL </br></br>";
{
_displayName = getText(configFile >> "CfgVehicles" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank2vehicles;
_assetString = _assetString + "\n<img image='img\sgt.paa' width='32' height='32'>\n SERGEANT \n\n";
_assetString = _assetString + "</br><img image='img\sgt.paa' width='32' height='32'></br> SERGEANT </br></br>";
{
_displayName = getText(configFile >> "CfgVehicles" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank3vehicles;
_assetString = _assetString + "\n<img image='img\ltn.paa' width='32' height='32'>\n LIEUTENANT \n\n";
_assetString = _assetString + "</br><img image='img\ltn.paa' width='32' height='32'></br> LIEUTENANT </br></br>";
{
_displayName = getText(configFile >> "CfgVehicles" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank4vehicles;
_assetString = _assetString + "\n<img image='img\cpt.paa' width='32' height='32'>\n CAPTAIN \n\n";
_assetString = _assetString + "</br><img image='img\cpt.paa' width='32' height='32'></br> CAPTAIN </br></br>";
{
_displayName = getText(configFile >> "CfgVehicles" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank5vehicles;
_assetString = _assetString + "\n<img image='img\mjr.paa' width='32' height='32'>\n MAJOR \n\n";
_assetString = _assetString + "</br><img image='img\mjr.paa' width='32' height='32'></br> MAJOR </br></br>";
{
_displayName = getText(configFile >> "CfgVehicles" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank6vehicles;
_assetString = _assetString + "\n<img image='img\col.paa' width='32' height='32'>\n COLONEL \n\n";
_assetString = _assetString + "</br><img image='img\col.paa' width='32' height='32'></br> COLONEL </br></br>";
{
_displayName = getText(configFile >> "CfgVehicles" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank7vehicles;
player createDiaryRecord ["Gamemode", ["Assets", _assetString]];


_assetString = "Each rank unlocks new weapons for you to use:";
_assetString = _assetString + "\n<img image='img\pvt.paa' width='32' height='32'>\n PRIVATE \n\n";
_assetString = _assetString + "</br><img image='img\pvt.paa' width='32' height='32'></br> PRIVATE </br></br>";
{
_displayName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank1weapons;
_assetString = _assetString + "\n<img image='img\corp.paa' width='32' height='32'>\n CORPORAL \n\n";
_assetString = _assetString + "</br><img image='img\corp.paa' width='32' height='32'></br> CORPORAL </br></br>";
{
_displayName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank2weapons;
_assetString = _assetString + "\n<img image='img\sgt.paa' width='32' height='32'>\n SERGEANT \n\n";
_assetString = _assetString + "</br><img image='img\sgt.paa' width='32' height='32'></br> SERGEANT </br></br>";
{
_displayName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank3weapons;
_assetString = _assetString + "\n<img image='img\ltn.paa' width='32' height='32'>\n LIEUTENANT \n\n";
_assetString = _assetString + "</br><img image='img\ltn.paa' width='32' height='32'></br> LIEUTENANT </br></br>";
{
_displayName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank4weapons;
_assetString = _assetString + "\n<img image='img\cpt.paa' width='32' height='32'>\n CAPTAIN \n\n";
_assetString = _assetString + "</br><img image='img\cpt.paa' width='32' height='32'></br> CAPTAIN </br></br>";
{
_displayName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank5weapons;
_assetString = _assetString + "\n<img image='img\mjr.paa' width='32' height='32'>\n MAJOR \n\n";
_assetString = _assetString + "</br><img image='img\mjr.paa' width='32' height='32'></br> MAJOR </br></br>";
{
_displayName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank6weapons;
_assetString = _assetString + "\n<img image='img\col.paa' width='32' height='32'>\n COLONEL \n\n";
_assetString = _assetString + "</br><img image='img\col.paa' width='32' height='32'></br> COLONEL </br></br>";
{
_displayName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_assetString = _assetString + format ["%1 \n", _displayName];
_assetString = _assetString + format ["%1 </br>", _displayName];
} forEach rank7weapons;
player createDiaryRecord ["Gamemode", ["Weapons", _assetString]];




player createDiaryRecord ["Gamemode", ["Hints", "You can Request a HALO drop from the staging base spawn area. It's free until you are a Corporal, after which will cost you 3 points.
\n
\n
</br>
</br>
The Radio Towers can only be destroyed with explosives set by infantry.
\n
\n
</br>
</br>
If you kill an unarmed enemy you will be fined 8 points.
\n
\n
</br>
</br>
You can join or create squads at the spawn area in the staging base, or by pressing 'U' at anytime.
\n
\n
</br>
</br>
As a commander you have many support assets available to you.
\n
\n
</br>
</br>
You can recruit AI squadmates at the staging base spawn area, or in the field via the communication menu.
\n
\n
</br>
</br>
You can choose a side mission for your platoon to take on at the spawn area in the staging base. Only one sidemission is active at a time.
\n
\n
</br>
</br>
If you disconnect and reconnect your score and rank will be retained, and you will be moved to the last location with the loadout you had at the time.
\n
\n
</br>
</br>
You can earn points by transporting friendly players.
\n
\n
</br>
</br>
If you are in command of a vehicle, stop at the airbase, a FARP or a dock to be fully serviced.
\n
\n
</br>
</br>
If you are a medic you can set up a MASH (Mobile Army Surgical Hospital). When players heal (enemy inflicted wounds) you get points. As a medic your priority must be healing.
\n
\n
</br>
</br>
If you are an engineer you can set up a FARP (Forward Arming and Refueling Point) when you are near a repair vehicle. If you fully repair a marked vehicle at your farp you will earn points, As an engineer your priority must be repairing damaged vehicles.
\n
\n
</br>
</br>
You can set your terrain detail (grass), View distance and Air view distance (How far you see in a plane or chopper) in the spawn area at the staging base.
\n
\n
</br>
</br>
Each town contains a radio tower, If you destroy it you will receive 10 points, It also stops any further reinforcements being sent to the town under siege. Careful, there may be some on the way already.
\n
\n
</br>
</br>
When each town falls, remaining troops drop their guns and can be captured and returned to base for 5 points. Never shoot unarmed soldiers as they may be someones prisoner.
\n
\n
</br>
</br>
In each town is an officer, If you capture him and return him to base it is worth 20 points, To capture him you must first identify him (default right click) then choose the option capture. Never shoot the officer, he is always unarmed."]];
2 changes: 2 additions & 0 deletions description.ext
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class CfgFunctions
class basicRespawn {};
class sm_csar {};
class playerNearby {};
/*
class reviveControl {};
class reviveBleedOut {};
class reviveEnabled {};
Expand All @@ -206,6 +207,7 @@ class CfgFunctions
class reviveOnPlayerREspawn {};
class reviveProgress {};
class reviveSetStatus {};
*/
};
};
};
Expand Down

0 comments on commit 392b2ce

Please sign in to comment.