Move some addActions to config UserActions

Should improve client FPS while still allowing conditions and scripts to
be customized.

Some special vehicles like MV22, UH1Y, etc. have UserActions overwritten
in their configs, so please let me know if you find any others that do
not get the option to repair or salvage because UserActions is
overwritten in their config. I think I got them all.

Vanilla commits:

a8c4238c0c

350d73abe1
This commit is contained in:
ebaydayz
2016-11-20 19:47:10 -05:00
parent ef1ad261e2
commit 3aad4b61e9
34 changed files with 320 additions and 259 deletions

View File

@@ -534,10 +534,10 @@ class CfgSurvival {
rawfoodtype = "FoodchickenRaw";
};
class Cock: Hen {};
class DZ_Fin: Default {
class Fin: Default {
rawfoodtype = "FoodDogRaw";
};
class DZ_Pastor: DZ_Fin {};
class Pastor: Fin {};
class Rabbit: Default {
yield = 2;
rawfoodtype = "FoodrabbitRaw";

View File

@@ -1,15 +1,30 @@
class CAAnimalBase;
class animal_DZ: CAAnimalBase
class Animal;
class CAAnimalBase: Animal
{
class Eventhandlers
{
//local = "_z = _this select 0; if ((!isServer and !isNull _z) and {(side _z != civilian)}) exitWith { PVDZ_sec_atp = [ 'wrong side', player ]; publicVariableServer 'PVDZ_sec_atp'; deleteVehicle _z; }; if ((_this select 1) and isServer) exitWith { _z call sched_co_deleteVehicle; };";
local = "_z = _this select 0; if ((_this select 1) and isServer) exitWith { _z call sched_co_deleteVehicle; };";
};
class UserActions
{
class Butcher
{
displayName = $STR_ACTIONS_SELF_04;
displayNameDefault = $STR_ACTIONS_SELF_04;
priority = 3;
radius = 3;
position = "";
showWindow = 1;
onlyForPlayer = 1;
shortcut = "";
condition = "(['Butcher',this] call userActionConditions)";
statement = "this spawn player_butcher;";
};
};
};
class DZ_Pastor : Pastor {
class Pastor: CAAnimalBase {
scope = public;
side = 1;
model = "\ca\animals2\Dogs\Pastor\Pastor";
@@ -30,7 +45,7 @@ class DZ_Pastor : Pastor {
class VariablesString {};
};
class DZ_Fin : Fin {
class Fin: CAAnimalBase {
scope = public;
model = "\ca\animals2\Dogs\Fin\Fin";
displayName = "Fin";
@@ -40,7 +55,7 @@ class DZ_Fin : Fin {
fsmFormation = "";
};
class Cow: animal_DZ
class Cow: CAAnimalBase
{
scope = private;
model = "\ca\animals2\cow\cow";
@@ -96,8 +111,10 @@ class Cow04: Cow01
displayName = "$STR_DN_COW04";
hiddenSelectionsTextures[] = {"ca\animals2\cow\data\cow4_co.PAA"};
};
class Cow_Base_EP1 : Cow {};
class Cow01_EP1 : Cow_Base_EP1 {};
class Goat: animal_DZ
class Goat: CAAnimalBase
{
scope = public;
model = "\ca\animals2\Goat\Goat";
@@ -121,8 +138,11 @@ class Goat: animal_DZ
mat[] = {"ca\animals2\Goat\data\goat.rvmat","ca\animals2\Goat\data\W1_goat.rvmat","ca\animals2\Goat\data\W2_goat.rvmat"};
};
};
class Goat_Base_EP1 : Goat {};
class Goat01_EP1 : Goat_Base_EP1 {};
class Goat02_EP1 : Goat01_EP1 {};
class Rabbit: animal_DZ
class Rabbit: CAAnimalBase
{
scope = public;
side = 3;
@@ -156,7 +176,7 @@ class Rabbit: animal_DZ
};
};
class Sheep: animal_DZ
class Sheep: CAAnimalBase
{
scope = public;
model = "\ca\animals2\Sheep\Sheep";
@@ -181,9 +201,11 @@ class Sheep: animal_DZ
_sound3 = "sheep_03";
};
};
class Sheep_Base_EP1 : Sheep {};
class Sheep01_EP1 : Sheep_Base_EP1 {};
class Sheep02_EP1 : Sheep01_EP1 {};
class WildBoar: animal_DZ
class WildBoar: CAAnimalBase
{
scope = public;
model = "\ca\animals2\WildBoar\WildBoar";
@@ -203,3 +225,5 @@ class WildBoar: animal_DZ
};
};
class Hen : CAAnimalBase {};
class Cock : Hen {};

View File

@@ -5,6 +5,11 @@
//class DefaultEventhandlers;
class Ship : AllVehicles
{
class UserActions
{
class Repair {ACTION_REPAIR; radius = 8;};
class Salvage {ACTION_SALVAGE; radius = 8;};
};
transportMaxMagazines = 2000;
transportMaxWeapons = 200;
transportMaxBackpacks = 40;

View File

@@ -1,3 +1,4 @@
#include "CommonActions.hpp"
class WeaponFireGun; // External class reference
class WeaponCloudsGun; // External class reference
class WeaponFireMGun; // External class reference
@@ -136,6 +137,11 @@ class CfgVehicles {
class ViewOptics;
};
};
class UserActions
{
class Repair {ACTION_REPAIR; radius = 8;};
class Salvage {ACTION_SALVAGE; radius = 8;};
};
};
class Plane: Air
{
@@ -147,6 +153,12 @@ class CfgVehicles {
class HitHull;
};
class AnimationSources;
class UserActions
{
class Repair {ACTION_REPAIR; radius = 8;};
class Salvage {ACTION_SALVAGE; radius = 8;};
class PushPlane {ACTION_PUSH;};
};
};
class Land; // External class reference
class LandVehicle : Land
@@ -179,6 +191,11 @@ class CfgVehicles {
brightness = 0.5;
};
};
class UserActions
{
class Repair {ACTION_REPAIR; radius = 4;};
class Salvage {ACTION_SALVAGE; radius = 4;};
};
};
class Car: LandVehicle {
class HitPoints
@@ -440,9 +457,6 @@ class CfgVehicles {
class Strategic;
class NonStrategic;
// class Land_Fire;
class Animal;
class Pastor;
class Fin;
class BuiltItems;
class Building;
class ReammoBox;
@@ -531,7 +545,7 @@ class CfgVehicles {
#include "Bikes\TT650_Civ.hpp"
#include "Bikes\M1030.hpp"
//Boat
#include "Boat\RHIB.hpp"
#include "Boat\RHIB.hpp" //Must be first boat, includes Ship base class
#include "Boat\PBX.hpp"
#include "Boat\Fishing_Boat.hpp"
#include "Boat\smallboat.hpp"

View File

@@ -0,0 +1,30 @@
#define ACTION_REPAIR displayName = $STR_ACTIONS_REPAIRVEH;\
displayNameDefault = $STR_ACTIONS_REPAIRVEH;\
priority = 0;\
position = "";\
showWindow = 0;\
onlyForPlayer = 1;\
shortcut = "";\
condition = "(['Repair',this] call userActionConditions)";\
statement = "this call player_repairVehicle;"
#define ACTION_SALVAGE displayName = $STR_ACTIONS_SALVAGEVEH;\
displayNameDefault = $STR_ACTIONS_SALVAGEVEH;\
priority = 0;\
position = "";\
showWindow = 0;\
onlyForPlayer = 1;\
shortcut = "";\
condition = "(['Salvage',this] call userActionConditions)";\
statement = "this call player_salvageVehicle;"
#define ACTION_PUSH displayName = $STR_ACTIONS_PUSH;\
displayNameDefault = $STR_ACTIONS_PUSH;\
priority = 0;\
radius = 8;\
position = "";\
showWindow = 0;\
onlyForPlayer = 1;\
shortcut = "";\
condition = "(['PushPlane',this] call userActionConditions)";\
statement = "this call player_pushPlane;"

View File

@@ -105,13 +105,15 @@ class CSJ_GyroP: Plane
};
class push
{
displayName = "push aircraft";
displayName = $STR_ACTIONS_PUSH;
position = "osa leve smerovky";
onlyforplayer = 0;
radius = 2;
condition = "(Count (Crew this)==0) and ((getpos this select 2) <1) and (!isengineon this)";
statement = "this exec ""\CSJ_GyroAC\scripts\CSJ_moveGyro.sqs"" ";
};
class Repair {ACTION_REPAIR; radius = 4;};
class Salvage {ACTION_SALVAGE; radius = 4;};
};
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
@@ -220,7 +222,10 @@ class CSJ_GyroC: Helicopter
dammageFull[] = {};
class Reflectors{};
class AnimationSources: AnimationSources{};
class UserActions{};
class UserActions {
class Repair {ACTION_REPAIR; radius = 4;};
class Salvage {ACTION_SALVAGE; radius = 4;};
};
class DefaultEventhandlers;
class EventHandlers: DefaultEventhandlers
{

View File

@@ -483,7 +483,7 @@ class M240Nest_DZ: USMC_WarfareBMGNest_M240
transportMaxBackpacks = 1;
constructioncount = 10;
removeoutput[] = {{"m240_nest_kit",1}};
class UserActions {delete Repair; delete Salvage;};
};
class Land_covering_hut_EP1;
class CanvasHut_DZ: Land_covering_hut_EP1

View File

@@ -33,4 +33,82 @@ class CH53_DZE : USEC_ch53_E {
init = "MonitorVM = [_this select 0] execvm '\usec_ch53\scripts\ch53_monitor.sqf';MonitorSFXVM = [_this select 0] execvm '\usec_ch53\scripts\ch53_monitorSFX.sqf';";
killed = "_this spawn BIS_Effects_EH_Killed;";
};
class UserActions {
class Repair {ACTION_REPAIR; radius = 8;};
class Salvage {ACTION_SALVAGE; radius = 8;};
class RampOpen {
displayName = "Open Ramp";
position = "ramp action";
showWindow = 0;
radius = 5;
condition = "this animationPhase ""ramp_bottom"" < 0.50;";
statement = "if(((getPos this) select 2) < 2) then {this animate [""ramp_bottom"",1];this animate [""ramp_top"",1];} else {this animate [""ramp_bottom"",0.56];this animate [""ramp_top"",1];};";
onlyforplayer = 0;
};
class RampClose {
displayName = "Close Ramp";
position = "ramp action";
showWindow = 0;
radius = 5;
condition = "this animationPhase ""ramp_bottom"" > 0.50;";
statement = "this animate [""ramp_bottom"",0];this animate [""ramp_top"",0];";
onlyforplayer = 0;
};
class LandingGear_down {
displayName = "Gear Down";
position = "ramp action";
showWindow = 0;
onlyforplayer = 0;
shortcut = "landGear";
radius = 5;
condition = "(this animationPhase ""gear_nose_1"" > 0.9)&&(player == driver this)";
statement = "[this] execvm ""\usec_ch53\scripts\ch53_geardown.sqf""";
};
class LandingGear_up {
displayName = "Gear Up";
position = "ramp action";
showWindow = 0;
onlyforplayer = 0;
shortcut = "landGear";
radius = 5;
condition = "(this animationPhase ""gear_nose_1"" < 0.1)&&(player == driver this)";
statement = "[this] execvm ""\usec_ch53\scripts\ch53_gearup.sqf""";
};
class StropDown {
displayName = "Attach Strop";
position = "ramp action";
showWindow = 0;
onlyforplayer = 0;
radius = 5;
condition = "(this animationPhase ""Strop1_Empty"" == 1)&&((this animationPhase 'cargo' == 1) AND (this animationPhase 'cargo2' == 1))&&(player == driver this)";
statement = "[this,true] execvm ""\usec_ch53\scripts\ch53_strop.sqf""";
};
class StropUp {
displayName = "Detach Strop";
position = "ramp action";
showWindow = 0;
onlyforplayer = 0;
radius = 5;
condition = "(this animationPhase ""Strop1_Empty"" == 0)&&(player == driver this)";
statement = "[this,false] execvm ""\usec_ch53\scripts\ch53_strop.sqf""";
};
class CollectCargo {
displayName = "Collect Cargo";
position = "ramp action";
showWindow = 1;
onlyforplayer = 0;
radius = 5;
condition = "(count(nearestObjects [(this modeltoworld [0,0,-10]), [""USEC_CargoContainer1"",""USEC_CargoContainer2""], 6])>0) and (this animationPhase 'Strop1_Empty' == 0) and (this animationPhase 'cargo' == 1);";
statement = "[this] execvm ""\usec_ch53\scripts\ch53_cargo.sqf"";";
};
class DetachCargo {
displayName = "Detach Cargo";
position = "ramp action";
showWindow = 1;
onlyforplayer = 0;
radius = 5;
condition = "((this animationPhase 'cargo' == 0) OR (this animationPhase 'cargo2' == 0));";
statement = "[this] execvm ""\usec_ch53\scripts\ch53_cargodrop.sqf"";";
};
};
};

View File

@@ -295,6 +295,8 @@ class Mi171Sh_CZ_EP1_DZ: Mi17_base {
};
class UserActions {
class Repair {ACTION_REPAIR; radius = 8;};
class Salvage {ACTION_SALVAGE; radius = 8;};
class HUDoff {
displayName = $STR_AM_HUDON;
displayNameDefault = $STR_AM_HUDON;
@@ -303,8 +305,7 @@ class Mi171Sh_CZ_EP1_DZ: Mi17_base {
onlyForPlayer = 1;
condition = "(player==driver this)and(this animationphase ""HUDAction"" !=0)";
statement = "this animate [""HUDAction"",0];this animate [""HUDaction_Hide"",0]";
};
};
class HUDon {
displayName = $STR_AM_HUDOFF;
displayNameDefault = $STR_AM_HUDOFF;

View File

@@ -88,6 +88,28 @@ class UH1Y_DZ: UH1_Base {
magazines[] = {"2000Rnd_762x51_M134"};
};
};*/
class UserActions {
class Repair {ACTION_REPAIR; radius = 8;};
class Salvage {ACTION_SALVAGE; radius = 8;};
class HUDoff {
displayName = $STR_AM_HUDON;
displayNameDefault = $STR_AM_HUDON;
position = "zamerny";
radius = 1;
onlyForPlayer = 1;
condition = "(player==driver this)and(this animationphase ""HUDAction"" !=1)";
statement = "this animate [""HUDAction"",1];this animate [""HUDAction_1"",1]";
};
class HUDon {
displayName = $STR_AM_HUDOFF;
displayNameDefault = $STR_AM_HUDOFF;
position = "zamerny";
radius = 1;
onlyForPlayer = 1;
condition = "(player==driver this)and(this animationphase ""HUDAction"" !=0)";
statement = "this animate [""HUDAction"",0];this animate [""HUDAction_1"",0]";
};
};
};
class UH1Y_DZE: UH1Y_DZ {
class Turrets : Turrets {

View File

@@ -14,4 +14,10 @@ class MV22_DZ : MV22 {
transportMaxMagazines = 400;
transportmaxbackpacks = 10;
fuelCapacity = 6513;
class UserActions
{
class Repair {ACTION_REPAIR; radius = 8;};
class Salvage {ACTION_SALVAGE; radius = 8;};
class PushPlane {ACTION_PUSH;};
};
};

View File

@@ -1,6 +1,6 @@
class Man;
class CAManBase: Man
class CAManBase: Man //Covers all custom Epoch skins
{
class TalkTopics;
class HitPoints
@@ -8,6 +8,22 @@ class CAManBase: Man
class HitHead;
class HitBody;
};
class UserActions
{
class StudyBody
{
displayName = $STR_ACTION_STUDYBODY;
displayNameDefault = $STR_ACTION_STUDYBODY;
priority = 0;
radius = 3;
position = "";
showWindow = 0;
onlyForPlayer = 1;
shortcut = "";
condition = "(['StudyBody',this] call userActionConditions)";
statement = "this call player_studyBody;";
};
};
};
class Civilian: CAManBase
{

View File

@@ -57,6 +57,23 @@ class zZombie_Base : Zed_Base {
local = "_z = _this select 0; if (!(_this select 1)) exitWith {}; if (isServer) exitWith { _z call sched_co_deleteVehicle; }; [(position _z), _z, true] execFSM '\z\AddOns\dayz_code\system\zombie_agent.fsm';";
};
class UserActions
{
class Butcher
{
displayName = $STR_EPOCH_ACTIONS_GUTZOM;
displayNameDefault = $STR_EPOCH_ACTIONS_GUTZOM;
priority = 0;
radius = 3;
position = "";
showWindow = 1;
onlyForPlayer = 1;
shortcut = "";
condition = "(['Butcher',this] call userActionConditions)";
statement = "this spawn player_butcher;";
};
};
class HitPoints {
class HitHead {
armor = 0.1;