Skip to content

Commit

Permalink
Merge pull request #38 from dklollol/dev
Browse files Browse the repository at this point in the history
Update 3.0.5
  • Loading branch information
_FR_Starfox64 committed Oct 19, 2015
2 parents 660f97e + 24687a8 commit 0f47114
Show file tree
Hide file tree
Showing 56 changed files with 217 additions and 3,971 deletions.
2 changes: 1 addition & 1 deletion core/menu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Olsen Framework is a simple framework designed for ArmA 3. It supports modul
Find out more about the framework on GitHub.<br/>
github.com/dklollol/Olsen-Framework-Arma-3<br/>
<br/>
Current Version: 3.0.4
Current Version: 3.0.5
";

player createDiaryRecord ["FW_Menu", ["Framework Info", _info]];
100 changes: 100 additions & 0 deletions modules/jip/init.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
["JIP Manager", "Handles JIPs in different ways depending on the module's settings.", "Olsen &amp; Starfox64"] call FNC_RegisterModule;

#include "settings.sqf"

if (isServer) then {
[] spawn {

waitUntil {time > FW_JIPDENYTIME};

missionNamespace setVariable ["FW_JIPDenied", true];
publicVariable "FW_JIPDenied";

};
};

if (!isDedicated) then {

if (FW_JIPTYPE == "DENY" && missionNamespace getVariable ["FW_JIPDenied", false]) exitWith {

[] spawn {
sleep 5;
player setDamage 1;

sleep 8;
cutText ["This mission does not support JIP.", "PLAIN DOWN"];
};

};

_target = leader player;

if (player == _target || !(_target call FNC_Alive)) then {

_rank = -1;

{

if (rankId _x > _rank && (_target call FNC_Alive)) then {
_rank = rankId _x;
_target = _x;
};

} forEach ((units group player) - [player]);
};

if ((_target distance player) > FW_JIPDISTANCE) then {

switch (FW_JIPTYPE) do {

case "TELEPORT": {

_teleportAction = player addAction ["Teleport to Squad", "modules\jip\teleportAction.sqf", _target];

[_teleportAction] spawn { //Spawns code running in parallel

_spawnPos = getPosATL player;

while {true} do {

if (player distance _spawnPos > FW_SPAWNDISTANCE) exitWith { //Exitwith ends the loop

player removeAction (_this select 0);
cutText [format ["JIP teleport option lost, you went beyond %1 meters from your spawn location", FW_SPAWNDISTANCE], 'PLAIN DOWN'];

};

sleep (60); //Runs every min

};
};

};

case "TRANSPORT": {

_transportAction = player addAction ["Request Transport", "modules\jip\transportAction.sqf"];

[_transportAction] spawn { //Spawns code running in parallel

_spawnPos = getPosATL player;

while {true} do {

if (player distance _spawnPos > FW_SPAWNDISTANCE) exitWith { //Exitwith ends the loop

player removeAction (_this select 0);
cutText [format ["JIP transport request option lost, you went beyond %1 meters from your spawn location", FW_SPAWNDISTANCE], 'PLAIN DOWN'];

};

sleep (60); //Runs every min

};
};

};

};
};
};
4 changes: 2 additions & 2 deletions modules/jip_teleport/root.sqf → modules/jip/root.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef framework

#include "init.sqf"

#endif
51 changes: 51 additions & 0 deletions modules/jip/settings.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//This module allows people who join in progress to teleport to their squad members.

//JIPDENYTIME
//After how many seconds should a player be considered JIP (this only applies if you are using JIPTYPE "DENY").
FW_JIPDENYTIME = 300;

switch (side player) do {

case west: {
//JIPTYPE
//How should JIPs be handled, options are: DENY: Player is killed and put in spectator. TELEPORT: Player can teleport to his squad. TRANSPORT: Player can send a hint to all group leaders requesting transport.
FW_JIPTYPE = "TELEPORT";

//JIPDISTANCE
//When you spawn, if your squad members are more then JIPDISTANCE away, you get the option to teleport or request transport.
FW_JIPDISTANCE = 50;

//SPAWNDISTANCE
//If you move SPAWNDISTANCE away from your spawn position you loose the option to teleport or request transport.
FW_SPAWNDISTANCE = 200;
};

case east: {
//JIPTYPE
//How should JIPs be handled, options are: DENY: Player is killed and put in spectator. TELEPORT: Player can teleport to his squad. TRANSPORT: Player can send a hint to all group leaders requesting transport.
FW_JIPTYPE = "TRANSPORT";

//JIPDISTANCE
//When you spawn, if your squad members are more then JIPDISTANCE away, you get the option to teleport or request transport.
FW_JIPDISTANCE = 50;

//SPAWNDISTANCE
//If you move SPAWNDISTANCE away from your spawn position you loose the option to teleport or request transport.
FW_SPAWNDISTANCE = 200;
};

case independent: {
//JIPTYPE
//How should JIPs be handled, options are: DENY: Player is killed and put in spectator. TELEPORT: Player can teleport to his squad. TRANSPORT: Player can send a hint to all group leaders requesting transport.
FW_JIPTYPE = "DENY";

//JIPDISTANCE
//When you spawn, if your squad members are more then JIPDISTANCE away, you get the option to teleport or request transport.
FW_JIPDISTANCE = 0;

//SPAWNDISTANCE
//If you move SPAWNDISTANCE away from your spawn position you loose the option to teleport or request transport.
FW_SPAWNDISTANCE = 0;
};

};
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@ _id = _this select 2;
_target = _this select 3;

if (!((_target call FNC_Alive) && (!(_target call FNC_InVehicle) || ((vehicle _target) call FNC_HasEmptyPositions)))) then {

_rank = -1;
_count = 0;

{
if (_x call FNC_Alive) then {

_count = _count + 1;

if ((rankId _x > _rank) && (!(_x call FNC_InVehicle) || ((vehicle _x) call FNC_HasEmptyPositions))) then {

_rank = rankId _x;
_target = _x;

};
};

} forEach ((units group player) - [player]);

if (_rank == -1) then {

_target = objNull;

if (_count == 0) then {

player removeAction _id;
cutText ["No one left in the squad", 'PLAIN DOWN'];

} else {

cutText ["Not possible to JIP teleport to anyone, please try again later", 'PLAIN DOWN'];

};
};
};

if (!isNull(_target)) then {

if (_target call FNC_InVehicle) then {

player moveInAny (vehicle _target);

} else {

player setPos (getPos _target);

};

player removeAction _id;

};
16 changes: 16 additions & 0 deletions modules/jip/transportAction.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
_id = _this select 2;
_targets = [];

{

if ((side player) == (side _x) && (leader _x == _x)) then {

_targets set [count _targets, _x];

};

} forEach playableUnits;

[format ["%1 joined the mission and is requesting transport.", name player], "hint", _targets] call BIS_fnc_MP;

player removeAction _id;
45 changes: 0 additions & 45 deletions modules/jip_teleport/init.sqf

This file was deleted.

9 changes: 0 additions & 9 deletions modules/jip_teleport/settings.sqf

This file was deleted.

2 changes: 1 addition & 1 deletion modules/modules.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//Example:
//#include "start_text\root.sqf"

#include "jip_teleport\root.sqf"
#include "jip\root.sqf"
#include "start_text\root.sqf"
#include "start_with_earplugs\root.sqf"
#include "start_on_safe\root.sqf"
Expand Down
1 change: 1 addition & 0 deletions modules/start_on_radio_channel/settings.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//This module allows you to set the starting channel for a specific unit on a specific radio.

//To use this module use the function [unit, radio, channel] call FNC_SetRadio; in the init field of the unit.
//If you want to change the block of a PRC343 you can simply increment the channel past the limit (16) meaning that channel 17 will correspond to Chan. 1 BLK. 2 and channel 33 to Chan. 1 BLK. 3 etc...

//Example:
//[this, "ACRE_PRC343", 2] call FNC_SetRadio;
Expand Down
19 changes: 0 additions & 19 deletions modules/voiper_spectate/description.hpp

This file was deleted.

Loading

0 comments on commit 0f47114

Please sign in to comment.