-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from gruppe-adler/vehicles
Vehicles
- Loading branch information
Showing
14 changed files
with
152 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "..\..\component.hpp" | ||
|
||
params ["_grp"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,60 @@ | ||
#include "..\..\component.hpp" | ||
|
||
grad_civs_mainLoop = [{ | ||
if (!isServer) exitWith {}; | ||
|
||
private _mainLoop = { | ||
params ["_args", "_handle"]; | ||
|
||
if (call GRAD_CIVS_EXITON) exitWith { [_handle] call CBA_fnc_removePerFrameHandler; }; | ||
if (call GRAD_CIVS_EXITON) exitWith {[_handle] call CBA_fnc_removePerFrameHandler}; | ||
|
||
_playerPositions = [] call grad_civs_fnc_getPlayerPositions; | ||
|
||
if (GRAD_CIVS_ONFOOTCOUNT < GRAD_CIVS_MAXCOUNT) then { | ||
[_playerPositions] call grad_civs_fnc_addNewCivilian; | ||
if (GRAD_CIVS_ENABLEDONFOOT) then { | ||
if (GRAD_CIVS_ONFOOTCOUNT < GRAD_CIVS_MAXCIVSONFOOT) then { | ||
_pos = [ | ||
_playerPositions, | ||
GRAD_CIVS_SPAWNDISTANCEONFOOTMIN, | ||
GRAD_CIVS_SPAWNDISTANCEONFOOTMAX, | ||
GRAD_CIVS_ONFOOTUNITS | ||
] call grad_civs_fnc_findSpawnPosition; | ||
|
||
if (_pos isEqualTo [0,0,0]) exitWith {}; | ||
|
||
_unit = [_pos] call grad_civs_fnc_spawnCivilian; | ||
|
||
GRAD_CIVS_ONFOOTCOUNT = GRAD_CIVS_ONFOOTCOUNT + 1; | ||
GRAD_CIVS_ONFOOTUNITS pushBack _unit; | ||
if (GRAD_CIVS_DEBUGMODE) then {publicVariable "GRAD_CIVS_ONFOOTUNITS"; publicVariable "GRAD_CIVS_ONFOOTCOUNT"}; | ||
|
||
[_unit,_pos,400 - (random 300),[3,6],[0,2,10],true] call grad_civs_fnc_taskPatrol; | ||
}; | ||
[_playerPositions,"onfoot"] call grad_civs_fnc_cleanup; | ||
}; | ||
|
||
if (GRAD_CIVS_ENABLEDINVEHICLES) then { | ||
if (GRAD_CIVS_INVEHICLESCOUNT < GRAD_CIVS_MAXCIVSINVEHICLES) then { | ||
_pos = [ | ||
_playerPositions, | ||
GRAD_CIVS_SPAWNDISTANCEINVEHICLESMIN, | ||
GRAD_CIVS_SPAWNDISTANCEINVEHICLESMAX, | ||
GRAD_CIVS_INVEHICLESUNITS | ||
] call grad_civs_fnc_findSpawnPosition; | ||
|
||
if (_pos isEqualTo [0,0,0]) exitWith {}; | ||
|
||
_veh = [_pos,selectRandom GRAD_CIVS_VEHICLES] call grad_civs_fnc_spawnVehicle; | ||
_unit = [_pos] call grad_civs_fnc_spawnCivilian; | ||
_unit assignAsDriver _veh; | ||
_unit moveinAny _veh; | ||
(group _unit) setSpeedMode "NORMAL"; | ||
[_unit,_pos,2500,3,[0,0,0],false,true] call grad_civs_fnc_taskPatrol; | ||
|
||
GRAD_CIVS_INVEHICLESCOUNT = GRAD_CIVS_INVEHICLESCOUNT + 1; | ||
GRAD_CIVS_INVEHICLESUNITS pushBack _unit; | ||
if (GRAD_CIVS_DEBUGMODE) then {publicVariable "GRAD_CIVS_INVEHICLESUNITS"; publicVariable "GRAD_CIVS_INVEHICLESCOUNT"}; | ||
}; | ||
[_playerPositions,"invehicles"] call grad_civs_fnc_cleanup; | ||
}; | ||
[_playerPositions,"onfoot"] call grad_civs_fnc_cleanup; | ||
}; | ||
|
||
},10,[]] call CBA_fnc_addPerFrameHandler; | ||
grad_civs_mainLoop = [_mainLoop,10,[]] call CBA_fnc_addPerFrameHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "..\..\component.hpp" | ||
|
||
params ["_pos"]; | ||
|
||
INFO_1("POS: %1",_pos); | ||
|
||
private _group = createGroup [civilian, true]; | ||
private _unit = _group createUnit ["C_man_1", _pos, [], 0, "NONE"]; | ||
|
||
_unit disableAI "FSM"; | ||
_unit setBehaviour "CARELESS"; | ||
|
||
[_unit] call grad_civs_fnc_dressAndBehave; | ||
_unit enableDynamicSimulation true; | ||
|
||
[_unit] call GRAD_CIVS_ONSPAWN; | ||
|
||
_unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "..\..\component.hpp" | ||
|
||
params ["_pos","_type"]; | ||
|
||
private _veh = _type createVehicle _pos; | ||
|
||
clearBackpackCargo _veh; | ||
clearWeaponCargoGlobal _veh; | ||
clearItemCargoGlobal _veh; | ||
clearMagazineCargoGlobal _veh; | ||
|
||
_veh |