Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V097S6 - Respawn refactor #499

Merged
merged 24 commits into from
Sep 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8a41f24
Move respawn to separate module
veteran29 Sep 11, 2018
d8e1ea4
Allow for boats as mobile respawn vehicles
veteran29 Sep 11, 2018
f497460
Support for multiple mobile respawn objects
veteran29 Sep 12, 2018
9a60828
Fix build_markArea radius argument
veteran29 Sep 13, 2018
29d4bff
Start respawn refactor, move respawn into CfgRespawnTemplates
veteran29 Sep 13, 2018
cbc84ca
Move respawn action handling to event
veteran29 Sep 13, 2018
b64c91b
Fix core_getMobSpawns
veteran29 Sep 14, 2018
39d1d7f
Implement respawning on selected position
veteran29 Sep 14, 2018
b9221c4
Remove accidental "allowFunctionsRecompile"
veteran29 Sep 14, 2018
d2dbbd2
Periodic respawns fetching, update map pos on respawn selection
veteran29 Sep 14, 2018
e5944ae
Add common_getPos, split core/functions.hpp into multiple files
veteran29 Sep 15, 2018
7909f59
Rename respawn_displayUpdateMap
veteran29 Sep 15, 2018
cef8502
Rename respawn_displayUpdateList
veteran29 Sep 15, 2018
0486477
Fix common_getPos crashing the game
veteran29 Sep 15, 2018
6ae2b4a
Fix loudout handling, rename functions and variables, remove logging
veteran29 Sep 15, 2018
6583a28
Reveal player to nearby units on respawn
veteran29 Sep 20, 2018
9bf592f
Fix onKilled waitUntil
veteran29 Sep 20, 2018
9b258c2
Remove respawn marker
veteran29 Sep 22, 2018
4a9693d
Move CfgRespawnTemplates under respawn settings
veteran29 Sep 22, 2018
954d083
Fix respawn sometimes not working properly when BIS revive was used.
veteran29 Sep 22, 2018
632561a
Decrease reveal value and range
veteran29 Sep 22, 2018
5242114
Add camera view for selected respawn position
veteran29 Sep 23, 2018
f5884fb
Emit event on player redeploy
veteran29 Sep 23, 2018
a1b5730
Search for empty area on redeploy
veteran29 Sep 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 68 additions & 77 deletions Missionbasefiles/kp_liberation.Altis/mission.sqm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Missionframework/KPLIB_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class KPLIB {
#include "modules\00_init\functions.hpp"
#include "modules\01_core\functions.hpp"
#include "modules\02_build\functions.hpp"
#include "modules\02_respawn\functions.hpp"
#include "modules\99_adm\functions.hpp"
#include "modules\99_plm\functions.hpp"
};
1 change: 1 addition & 0 deletions Missionframework/KPLIB_ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
#include "modules\00_init\ui.hpp"
#include "modules\01_core\ui.hpp"
#include "modules\02_build\ui.hpp"
#include "modules\02_respawn\ui.hpp"
#include "modules\99_adm\ui.hpp"
#include "modules\99_plm\ui.hpp"
15 changes: 13 additions & 2 deletions Missionframework/description.ext
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,20 @@ class Header {
maxPlayers = 37;
};

respawn = 3;
respawndelay = 5;
respawnButton = 1;
respawnDialog = 0;
respawnTemplates[] = {"KPLIB_respawn"};

class CfgRespawnTemplates
{
class KPLIB_respawn
{
onPlayerKilled = "KPLIB_fnc_respawn_onKilled";
onPlayerRespawn = "KPLIB_fnc_respawn_onRespawn";
respawnOnStart = 1;
};
};

disabledAI = true;
enableDebugConsole = 1;
allowFunctionsLog = 0;
Expand Down Expand Up @@ -58,3 +68,4 @@ class CfgDebriefing {
};

#include "KPLIB_ui.hpp"

40 changes: 40 additions & 0 deletions Missionframework/modules/01_core/fnc/common/fn_common_getPos.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
KPLIB_fnc_common_getPos

File: fn_common_getPos.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-09-12
Last Update: 2018-09-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html

Description:
Returns position of given marker, object or array.
In case array is given it is returned directly. For objects pos ATL is returned.

Parameter(s):
0: STRING/OBJECT/ARRAY - Position

Returns:
ARRAY - Position
*/
params [["_item", nil, ["",objNull,[],0], 3]];

// Get position depending of type of respawn item
switch (typeName _item) do {
case "STRING": {
getMarkerPos _item;
};

case "OBJECT": {
getPosATL _item;
};

// If someone forgots to wrap position array into an array.
case "SCALAR": {
+_this;
};

case "ARRAY": {
+_item;
};
};
28 changes: 28 additions & 0 deletions Missionframework/modules/01_core/fnc/common/functions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
KP LIBERATION CORE FUNCTIONS

File: functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-09-15
Last Update: 2018-09-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html

Description:
Defines for all common utility functions
*/

class common {
file = "modules\01_core\fnc\common";

// Clears vehicle cargo
class common_clearVehicleCargo;

// Generate positions in circle
class common_getCirclePositions {};

// getPos wrapper for ATL positions
class common_getPos {};

// Spawning of a vehicle at given position with given direction
class common_spawnVehicle {};
};
10 changes: 6 additions & 4 deletions Missionframework/modules/01_core/fnc/fn_core_getMobSpawns.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: fn_core_getMobSpawns.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-30
Last Update: 2018-01-05
Last Update: 2018-09-13
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html

Description:
Expand All @@ -18,10 +18,12 @@
*/

private _return = vehicles select {
(typeOf _x == KPLIB_preset_respawnTruck || typeOf _x == KPLIB_preset_potato) &&
private _pos = getPos _x;

(_x getVariable ["KPLIB_respawn", false]) &&
((_x distance KPLIB_eden_startbase) > 500) &&
!surfaceIsWater (getPos _x) &&
((getPos _x) select 2) < 5 &&
( (surfaceIsWater _pos && _x isKindOf "Ship") || (!surfaceIsWater _pos && !(_x isKindOf "Ship")) ) &&
(_pos select 2) < 5 &&
alive _x &&
speed _x < 5
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: fn_core_handleVehicleSpawn.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-09-10
Last Update: 2018-09-10
Last Update: 2018-09-13
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html

Description:
Expand All @@ -28,11 +28,14 @@ switch(typeOf _vehicle) do {
] remoteExecCall ["addAction", 0, true];
};

case KPLIB_preset_respawnTruck;
case KPLIB_preset_potato: {
// Set vehicle as mobile respawn
_vehicle setVariable ["KPLIB_respawn", true, true];
// Add redeploy action globaly and for JIP
[
_vehicle,
[localize "STR_ACTION_REDEPLOY", {[] spawn KPLIB_fnc_core_redeploy}, nil, -801, false, true, "", "_this == vehicle _this", 10]
[localize "STR_ACTION_REDEPLOY", {["KPLIB_respawn_requested", _this] call CBA_fnc_localEvent}, nil, -801, false, true, "", "_this == vehicle _this", 10]
] remoteExecCall ["addAction", 0, true];
};
};
3 changes: 1 addition & 2 deletions Missionframework/modules/01_core/fnc/fn_core_initModule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
File: fn_core_initModule.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-08-31
Last Update: 2018-08-31
Last Update: 2018-09-11
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html

Description:
This module provides the very basic functions and mechanics for the general gameplay of the mission.
Tasks of this module are:
* Provide basic functions.
* Manage respawn / redeploy dialog.
* Show respawn, spawn and intro cinematics.
* Spawning of Little Birds and Rubber Dinghies.
* Spawning and respawn handling of Potato 01.
Expand Down
204 changes: 0 additions & 204 deletions Missionframework/modules/01_core/fnc/fn_core_redeploy.sqf

This file was deleted.

Loading