Skip to content

Commit

Permalink
civ traffic again
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisum committed Mar 14, 2016
1 parent 236532a commit 0397b7f
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 102 deletions.
2 changes: 1 addition & 1 deletion Engima/Traffic/Init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENGIMA_TRAFFIC_edgeBottomLeftRoads = [];
ENGIMA_TRAFFIC_edgeRoadsUseful = [];

if (isServer) then {
call compile preprocessFileLineNumbers "Engima\Traffic\Server\Functions.sqf";
call compile preprocessFileLineNumbers "Engima\Traffic\Server\randomCivilian.sqf";
call compile preprocessFileLineNumbers "Engima\Traffic\Server\Functions.sqf";
call compile preprocessFileLineNumbers "Engima\Traffic\ConfigAndStart.sqf";
};
200 changes: 100 additions & 100 deletions Engima/Traffic/Server/randomCivilian.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,114 +3,114 @@
*/

randomCivilian = {
_unit = _this select 0;

_rds_rhs_civilian = [
"rds_schoolteacher",
"rds_doctor",
"rds_uniform_assistant",
"rds_uniform_Worker1",
"rds_uniform_Worker2",
"rds_uniform_Worker3",
"rds_uniform_Worker4",
"rds_uniform_Woodlander1",
"rds_uniform_Woodlander2",
"rds_uniform_Woodlander3",
"rds_uniform_Woodlander4",
"rds_uniform_Villager1",
"rds_uniform_Villager2",
"rds_uniform_Villager3",
"rds_uniform_Villager4",
"rds_uniform_Profiteer1",
"rds_uniform_Profiteer2",
"rds_uniform_Profiteer3",
"rds_uniform_Profiteer4",
"rds_uniform_citizen1",
"rds_uniform_citizen2",
"rds_uniform_citizen3",
"rds_uniform_citizen4"
] call BIS_fnc_selectRandom;

_rhsHeadGear = [
"rds_Villager_cap1",
"rds_Villager_cap2",
"rds_Villager_cap3",
"rds_Villager_cap4",
"rds_worker_cap1",
"rds_worker_cap2",
"rds_worker_cap3",
"rds_worker_cap4",
"rds_Profiteer_cap1",
"rds_Profiteer_cap2",
"rds_Profiteer_cap3",
"rds_Profiteer_cap4",
"rhs_beanie_green",
"rhs_beanie_green"
] call BIS_fnc_selectRandom;

_taliFaces = [
"PersianHead_A3_01",
"PersianHead_A3_02",
"PersianHead_A3_03",
"PersianHead_A3_01",
"PersianHead_A3_02",
"PersianHead_A3_03",
"PersianHead_A3_01",
"PersianHead_A3_02",
"PersianHead_A3_03",
"WhiteHead_08",
"WhiteHead_16",
"GreekHead_A3_01",
"GreekHead_A3_02",
"GreekHead_A3_03",
"GreekHead_A3_04"
] call BIS_fnc_selectRandom;




_stripHim = {
_it = _this select 0;
removeAllWeapons _it;
removeAllItems _it;
removeAllAssignedItems _it;
removeUniform _it;
removeVest _it;
removeBackpack _it;
removeHeadgear _it;
removeGoggles _it;
};

_reclotheHim = {
_guy = _this select 0;
_guy forceAddUniform _rds_rhs_civilian;
if (random 2 > 1) then {
_guy addHeadgear _rhsHeadGear;
_unit = _this select 0;

_rds_rhs_civilian = [
"rds_schoolteacher",
"rds_doctor",
"rds_uniform_assistant",
"rds_uniform_Worker1",
"rds_uniform_Worker2",
"rds_uniform_Worker3",
"rds_uniform_Worker4",
"rds_uniform_Woodlander1",
"rds_uniform_Woodlander2",
"rds_uniform_Woodlander3",
"rds_uniform_Woodlander4",
"rds_uniform_Villager1",
"rds_uniform_Villager2",
"rds_uniform_Villager3",
"rds_uniform_Villager4",
"rds_uniform_Profiteer1",
"rds_uniform_Profiteer2",
"rds_uniform_Profiteer3",
"rds_uniform_Profiteer4",
"rds_uniform_citizen1",
"rds_uniform_citizen2",
"rds_uniform_citizen3",
"rds_uniform_citizen4"
] call BIS_fnc_selectRandom;

_rhsHeadGear = [
"rds_Villager_cap1",
"rds_Villager_cap2",
"rds_Villager_cap3",
"rds_Villager_cap4",
"rds_worker_cap1",
"rds_worker_cap2",
"rds_worker_cap3",
"rds_worker_cap4",
"rds_Profiteer_cap1",
"rds_Profiteer_cap2",
"rds_Profiteer_cap3",
"rds_Profiteer_cap4",
"rhs_beanie_green",
"rhs_beanie_green"
] call BIS_fnc_selectRandom;

_taliFaces = [
"PersianHead_A3_01",
"PersianHead_A3_02",
"PersianHead_A3_03",
"PersianHead_A3_01",
"PersianHead_A3_02",
"PersianHead_A3_03",
"PersianHead_A3_01",
"PersianHead_A3_02",
"PersianHead_A3_03",
"WhiteHead_08",
"WhiteHead_16",
"GreekHead_A3_01",
"GreekHead_A3_02",
"GreekHead_A3_03",
"GreekHead_A3_04"
] call BIS_fnc_selectRandom;




_stripHim = {
_it = _this select 0;
removeAllWeapons _it;
removeAllItems _it;
removeAllAssignedItems _it;
removeUniform _it;
removeVest _it;
removeBackpack _it;
removeHeadgear _it;
removeGoggles _it;
};

[[_guy,_taliFaces], "setCustomFace"] call BIS_fnc_MP;


};
_reclotheHim = {
_guy = _this select 0;
_guy forceAddUniform _rds_rhs_civilian;
if (random 2 > 1) then {
_guy addHeadgear _rhsHeadGear;
};

addFleeingBehaviour = {
(_this select 0) setVariable ["fleeing",false];
[[_guy,_taliFaces], "setCustomFace"] call BIS_fnc_MP;


};

addFleeingBehaviour = {
(_this select 0) setVariable ["fleeing",false];

(_this select 0) addEventHandler ["FiredNear", {
(_this select 0) addEventHandler ["FiredNear", {

if ((_this select 0) getVariable "fleeing" == "true") exitWith {};
if ((_this select 0) getVariable "fleeing" == "true") exitWith {};

_thisUnit = _this select 0;
_thisUnit = _this select 0;

sleep (random 1);
{[_x] execVM "Engima\Traffic\Server\fleeYouFool.sqf";} forEach crew (vehicle _thisUnit);
}];
};
sleep (random 1);
{[_x] execVM "Engima\Traffic\Server\fleeYouFool.sqf";} forEach crew (vehicle _thisUnit);
}];
};

[_unit] call _stripHim;
sleep 0.1;
[_unit] call _reclotheHim;
[_unit] call addFleeingBehaviour;
[_unit] call _stripHim;
sleep 0.1;
[_unit] call _reclotheHim;
// [_unit] call addFleeingBehaviour;



Expand Down
4 changes: 3 additions & 1 deletion init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ if (!isMultiplayer) then { // Editor
/* {_x disableAI "MOVE"} forEach allUnits;*/
};

[] execVM "Engima\Traffic\Init.sqf";
if (CIVILIAN_TRAFFIC == 1) then {
[] execVM "Engima\Traffic\Init.sqf";
};

if (isServer) then {
// allow view distance to be up to 10k
Expand Down

0 comments on commit 0397b7f

Please sign in to comment.