Jump to content

[Release] Manual execution of Epoch Events


Sandbird

Recommended Posts

you can use a global variable with true and false.
true when you activate the script. false when deactivated via another script.
In my case: racetrackstart.sqf and racetrackdone.sqf. called via the manuel epoch events.
I build this all from your racetrack mission. thx for that :)

my racetrackstart.sqf
 

Race = true;
call admin_race_track;
diag_log("Race Track Event enabled!");

in racetrack.sqf I build all the items from an array.
 

private ["_racetrack","_obj"];

_racetrack = [  ["Bleacher_EP1"],[14575.73,13754.462,5.2452087e-006],[-70.531067],
                ["Bleacher_EP1"],[14577.364,13759.157,8.5353851],[-71.189697],
                ["Bleacher_EP1"],[14578.976,13763.691,-4.8160553],[-69.875786]
                ...,
                ...       
            ];

{
 _obj = createVehicle [_racetrack select 0, _racetrack select 1], [], 0, "CAN_COLLIDE"];
 _obj setDir _racetrack select 2;
 _obj setPos _racetrack select 1;
} forEach _racetrack;

diag_log("Building Race Track!");

    waitUntil {
        !(Race)
    };

        if !(Race) then {
            deleteVehicle _obj;
            diag_log("Deleting Race Track!");
            } forEach _racetrack;[code]
            

in racetrackdone.sqf:

    Race = false;
    diag_log("Race Track Event disabled!");

Im pretty sure, this can be done easier, as Im a noob in learning arma language.

Link to comment
Share on other sites

Yeah ony with global variables you can do this. Have to also set the variables to nil after you delete the objects.

For the jpg sign you have to put the file in the same subfolder both in client and server files

ex: dayz_server/custom/sign.jpg

Missionfile/custom/sign.jpg

So both instances recognize the path accordingly

Link to comment
Share on other sites

  • 11 months later...

hey guys, iv almost got this working but for some reason I'm still getting kicked for the public variable restriction #3

30.01.2016 17:25:54: Kheldar125 (62.64.142.243:2304) ef450a47feb6b1285e7900c97d279615 - #3 "PVDZE_spawnEvent" = ["battle"]
30.01.2016 17:26:26: Kheldar125 (62.64.142.243:2304) ef450a47feb6b1285e7900c97d279615 - #5 "PVAH_AdminReq" = [1234,<NULL-object>,"**player_UID**"]

any idea what could be causing this? iv done the fix in the main instructions but to no avail. 

any help would be appreciated 

 

cheers

 

 

Link to comment
Share on other sites

21 minutes ago, kheldar125 said:

hey guys, iv almost got this working but for some reason I'm still getting kicked for the public variable restriction #3

30.01.2016 17:25:54: Kheldar125 (62.64.142.243:2304) ef450a47feb6b1285e7900c97d279615 - #3 "PVDZE_spawnEvent" = ["battle"]
30.01.2016 17:26:26: Kheldar125 (62.64.142.243:2304) ef450a47feb6b1285e7900c97d279615 - #5 "PVAH_AdminReq" = [1234,<NULL-object>,"**player_UID**"]

any idea what could be causing this? iv done the fix in the main instructions but to no avail. 

any help would be appreciated 

 

cheers

I think the BIS files have changed alot since i wrote this. If your publicvariable.txt looks like this: https://github.com/vbawol/DayZ-Epoch/blob/master/Server%20Files/Battleye/publicvariable.txt

Then you need to edit the line that starts with: 5 "" !"PVDZE_" . You just add that extra variable in the end, like this:

//new
5 "" !"PVDZE_" !"norrn" !"usec" !="remExField" !="remExFP" !="drn_AskServerDynamicWeatherEventArgs" !="BIS_effects_gepv" !="PVDZ_Server_Simulation" !="PVDZE_spawnEvent"
5 "remExFP" !="\"remExFP\" = \[,,\"per\",\"execVM\",\"ca\\Modules\\Functions\\init.sqf\"\]" !"\[,,\"per\",\"execVM\",\"ca\\Modules\\Functions\\init.sqf\"\]"

The 5 in the front means kick....So kick any user that sends a variable, but dont kick him if the variable is PVDZE_spawnEvent. If you change that 5 to 1 then it will only log instead of kick.

Link to comment
Share on other sites

Have just tried adding it to the end of the first line in the file but its still kicking me :/ god I hate battleye sometimes. 

also and idea if it would it be possible to manually start WAI missions using this system, iv made a few custom missions for server events. 

 

still quite new to scripting so I appreciate the help.

Link to comment
Share on other sites

9 minutes ago, kheldar125 said:

Have just tried adding it to the end of the first line in the file but its still kicking me :/ god I hate battleye sometimes. 

also and idea if it would it be possible to manually start WAI missions using this system, iv made a few custom missions for server events.

still quite new to scripting so I appreciate the help.

hmmm no idea about the WAI missions....i've stopped playing dayz so i cant really help you there...dont even have the client installed anymore...BUT...i think its possible...If you check how the server loads the missions then you can create an .sqf file in the server that does just that...start a mission the same way it does, and then use this to execute it the file.

If you are still getting kicked, then try setting that line to 1 instead of 5 first of all and try again..see if you get kicked then. If you dont, then at least you know you are in the right place..If you are still getting kicked then you probably need to add that exception in another place as well.

It would be nice to have your publicvariable and publicvariableval files to check....and also your Dropdown menu part. Maybe i can figure it out blindly...since i cant execute it and test it.

Link to comment
Share on other sites

will look into the WAI missions thanks for the tip.

iv put the public variable text below

 

//new
5 "" !"PVDZE_" !"norrn" !"usec" !="remExField" !="remExFP" !="drn_AskServerDynamicWeatherEventArgs" !="norrinRAlie" !="BIS_effects_gepv" !="dayzPlayerLogin" !="dayzPlayerLogin2" !"PVAHR_" !="PVAH_AdminReq" !="PVAH_WriteLogReq" !="currentInvites" !="PVDZE_queryGarageVehicle" !="PVDZE_storeVehicle" !="PVDZE_spawnVehicle" !="currentInvites" !"cad_pvar_s" !="axeLampObjects" !="dayzHeliEvac" !="HCrequest_spawnRCV" !="HCsignalRCV" !="HCsignal" !="HClist" !="HCdo_spawn" !="HCrequest_spawn" !="clothesTaken" !="owner_B1" !="owner_B2" !="owner_B3" !="owner_H1" !="owner_H2" !="owner_H3" !="owner_SG" !="owner_LG" !="owner_KING" !="owner_SH" !="OriginsLockUnlock" !="Detain" !="PVDZ_ply_Arrst" !="donn_heli_monitor" !="PVDZE_spawnEvent" 
5 "norrn" !="norrnRACarUp" !="norrnRAPicUp" !="norrnRaDrag" !="norrnR180" !="norrnRalie" !="norrnRLact" !="norrnRALW" !="norrnRDead"
5 "usec" !="usecMorphine" !="usecBandage" !="usecBleed" 
5 "PVDZE_" !"PVDZE_player" !="PVDZE_send" !="PVDZE_log_lockUnlock" !="PVDZE_Server_Simulation" !="PVDZE_veh_Update" !="PVDZE_plr_GutBody" !="PVDZE_plr_GutBodyZ" !="PVDZE_veh_Lock" !="PVDZE_plr_DeathB" !="PVDZE_maintainArea" !="PVDZE_obj_Publish" !="PVDZE_obj_Swap" !="PVDZE_plr_Save" !="PVDZE_obj_Delete" !="PVDZE_obj_Trade" !="PVDZE_veh_Publish2" !="PVDZE_zed_Spawn" !="PVDZE_plr_Died" !="PVDZE_plr_TradeMenu" !="PVDZE_veh_Upgrade" !="PVDZE_atp" !="PVDZE_plr_Login" !="PVDZE_plr_Login2" !="PVDZE_plr_LoginRecord" !="PVDZE_plr_DeathBResult" !="PVDZE_veh_SFix" !="PVDZE_plr_Hit" !="PVDZE_plr_HitV" !="PVDZE_veh_SFuel" !="PVDZE_plr_HideBody" !="PVDZE_plr_Morph" !="PVDZE_veh_Publish" !="PVDZE_plr_Characters" !="PVDZE_lockVault" !="PVDZE_obj_setlocalVars" !="PVDZE_obj_getlocalVars" !="PVDZE_EvacChopperFieldsUpdate" !="PVDZE_bank_Save" !="PVDZE_account_Doublecheck" !="PVDZE_veh_Colour"
5 "PVAHR_" !"PVAHR_0_"
1 "PVAH"
5 "remExFP" !="\"remExFP\" = \[,,\"per\",\"execVM\",\"ca\\Modules\\Functions\\init.sqf\"\]" !"\[,,\"per\",\"execVM\",\"ca\\Modules\\Functions\\init.sqf\"\]"
5="player"
5="server"
5 "fnc_plyrHit"
5 "AntiHack"
1 "Delete"

publcic variable val

 

//new
5 "fnc_plyrHit"
5 "<NULL - team member>"
5 "preprocessFile"
5 "preprocessFileLineNumbers"
5 "setVehicleInit"
5 "processInitCommands"
5 "HangenderRE"
5 "vilegaming"
5 "v\.i\.l\.e"
5 "Lystic"
5 "Rustler"
5 "BattleFieldClearance"
5 "BIS_MPF_logic"
5 "BIS_MPF_dummygroup"
5 "compile"
5 "loadFile"
1 "call"
5 "mission"
1 "spawn"
5 "format"
5 "parse"
5 "terminate"
5 "eventhandler"
5 "hintC"
5 "hintS"
5 "loading"
5 "\"call\""
5 "call compile"
5 "toString"
5 "toArray"
5 "ctrlset"
5 "rsay"
5 "rland"
5 "rsetDir"
5 "_YakB"
5 "local_sefFuel"
5 "getVariable"
5 "hiveupdateresu"
5 "isServer"
5 "isDedicated"
5 "cutText"
5 "publicVariable"
5 "code"
5 "onPlayer"
5 "select"
5 "while"
5 "count"
5 "markerText"
5 "BIS_fnc"
5 "_bis"
5 "markerType"
5 "teamtype"
5 "composeText"
5 "teamName"
5 "execVM"
5 "fn_swapVars\.sqf"
5 "processInitCommands"
5 "promptRName\.sqf"
5 "rpcCodeVarName"
5 "rpcDirectCall"
5 "broadcastRpcCallAll"
5 "broadcastRpcCallIfLocal"
5 "norrnRACarUp"
5 "norrnRAPicUp"
5 "markerBrush"
5 "hideObject"
5 "deleteCollection"
5 "forceEnd"
5 "createAgent"
5 "deleteVehicle"
5 "deleteTeam"
5 "getPlayerUID"
5 "getVariable"
5 "addAction"
5 "AddM"
5 "AddP"
5 "AddS"
5 "AddV"
5 "AddW"
5 "setAcc"
5 "setAtt"
5 "setC"
5 "setD"
5 "setF" !="SetFuel"
5 "setG"
5 "setH"
5 "setM"
5 "setObj"
5 "setOver"
5 "setP"
5 "setR"
5 "setS"
5 "setT"
5 "setUnit"
5 "setV"
5 "setW"
5 "execFSM"
5 "clearM"
5 "clearV"
5 "clearW"
5 "createD"
5 "createG"
5 "createM"
5 "createS"
5 "createT"
5 "createU"
5 "createV"
5 "debugLog"
5 "debugFSM"
5 "deleteM"
5 "kbTell"
5 "kbReact"
5 "fadeSound"
5 "fadeMusic"
5 "showC"
5 "skipTime"
5 "taskHint"
5 "titleCut"
5 "titleText" !",\"titleText\","
5 "getM"
5 "getFSMvariable"
5 "getG"
5 "moveIn"
5 "synchronizeO"
5 "synchronizeT"
5 "synchronizeW"
5 "triggerA"
5 "triggerS"
5 "triggerT"
5 "MarkerColor"
5 "MarkerDir"
5 "MarkerPos"
5 "MarkerSize"
5 "onEachFrame"
5 "hasInterface"
5 "onMapS"
5 "OnGroup"
5 "onDouble"
5 "onPreload"
5 "onTeamS"
5 "onShowNew"
5 "setUnconscious"
5 " exec "
5 " set "
5 " str "
5 "exec\("
5 "set\("
5 "str\("
5 "exec\["
5 "set\["
5 "str\["
5 "exec\{"
5 "set\{"
5 "str\{"
5 "exec'"
5 "set'"
5 "str'"
5 "exec\""
5 "set\""
5 "str\""
5 "\)exec"
5 "\)set"
5 "\)str"
5 "\]exec"
5 "\]set"
5 "\]str"
5 "\}exec"
5 "\}set"
5 "\}str"
5 "'exec"
5 "'set"
5 "'str"
5 "str    "
5 "    \nstr"
5 "\nstr"
5 "str\n"
5 "str\n    "
5 ",str"
5 "str,"
5 "str "
5 "set    "
5 "    \nset"
5 "\nset"
5 "set\n"
5 "set\n    "
5 ",set"
5 "set,"
5 "set "
5 "exec    "
5 "exec\n"
5 "exec\n    "
5 ",exec"
5 "exec,"
5 "exec "
5 "isNil"
5 "object_setFixServer"
5 "allowConnection"
5 "check_publishobject"
5 "dayz_disco"
5 "dayz_hiveVersionNo"
5 "dayz_objectUID"
5 "dayz_objectUID2"
5 "dayz_players"
5 "dayz_serverObjectMonitor"
5 "dayz_versionNo"
5 "dayz_zombifiedTowns"
5 "dayzPlayerLogin"
5 "dayzPlayerLogin2"
5 "isSinglePlayer"
5 "needUpdate_objects"
5 "server_characterSync"
5 "server_getDiff"
5 "server_getDiff2"
5 "server_hiveReadWrite"
5 "server_hiveWrite"
5 "server_onPlayerDisconnect"
5 "server_spawnCrashSite"
5 "server_updateNearbyObjects"
5 "vehicle_handleInteract"
5 "vehicle_handleServerKilled"
5 "allunits"
5 "preprocess"
5 "runinitscript"
5 "createdialog"
5 "modify"
5 "BIS_Alice_fnc_CivilianHit"
5 "BIS_Alice_mainscope"
5 "BIS_fnc_getFactions"
5 "allowConnection"
5 "check_publishobject"
5 "dayz_disco"
5 "dayz_hiveVersionNo"
5 "dayz_objectUID"
5 "dayz_objectUID2"
5 "dayz_players"
5 "dayz_serverObjectMonitor"
5 "dayz_versionNo"
5 "dayz_zombifiedTowns"
5 "dayzPlayerLogin"
5 "dayzPlayerLogin2"
5 "isSinglePlayer"
5 "needUpdate_objects"
5 "server_characterSync"
5 "server_getDiff"
5 "server_getDiff2"
5 "server_hiveReadWrite"
5 "server_hiveWrite"
5 "server_onPlayerDisconnect"
5 "server_spawnCrashSite"
5 "server_updateNearbyObjects"
5 "vehicle_handleInteract"
5 "vehicle_handleServerKilled"
5 "allunits"
5 "preprocess"
5 "runinitscript"
5 "createdialog"
5 "actionmonitor"
5 "bis_"
5 "building_spawnloot"
5 "building_spawnzombies"
5 "camp_spawnzombies"
1 "dog_"
5 "drn_"
5 "eh_localcleanup"
5 "fnc_"
5 "fn_nicespot"
5 "gear_ui_init"
5 "horde_epeen_determine_humanity_fnc"
5 "horde_epeen_fnc_fill_page"
5 "infectedcamps"
5 "local_eventkill"
5 "local_gutobject"
5 "local_setfuel"
5 "local_zombiedamage"
5 "object_"
5 "player_alertzombies"
5 "player_animalcheck"
5 "player_checkstealth"
5 "player_combatroll"
5 "player_countmagazines"
5 "player_crossbowbolt"
5 "player_death"
5 "player_fired"
5 "player_firemonitor"
5 "player_gearset"
5 "player_gearsync"
5 "player_guicontrolflash"
5 "player_humanitychange"
5 "player_humanitymorph"
5 "player_medbandage"
5 "player_medepi"
5 "player_medmorphine"
5 "player_medpainkiller"
5 "player_medtransfuse"
5 "player_music"
5 "player_packtent"
5 "player_projectilenear"
5 "player_spawn_1"
5 "player_spawn_2"
5 "player_spawncheck"
5 "player_summedical"
5 "player_switchmodel"
5 "player_temp_calculation"
5 "player_throwobject"
5 "player_updategui"
5 "player_weaponfirednear"
5 "player_zombieattack"
5 "player_zombiecheck"
5 "r_player_removeactions2"
5 "PVDZ_"
5 "PVAH_"
5 "PVAHR_"
5 "PV_"
5 "remExField"
5 "remExFP"
5 "drn_AskServerDynamicWeatherEventArgs"
5 "BIS_effects_gepv"
5 "server_"
5 "stream_locationcheck"
5 "stream_locationdel"
5 "stream_locationfill"
5 "ui_changedisplay"
5 "ui_initdisplay"
5 "vehicle_gethitpoints"
5 "world_isday"
5 "world_sunrise"
5 "world_surfacenoise"
5 "zombie_"
5 "createUnit"
5 "createGroup"
5 "BattleFieldClearance"
5 "HighCommandSubordinate"
5 "FirstAidSystem"
5 "AlternativeInjurySimulation"
5 "FORM"

and the drop down menu (using the super admins public variable method)

if ((getPlayerUID player) in superadmins) then {
    adminmenu =
    [
        ["",true],
            ["carepackage", [2], "", -5, [["expression", '["carepackage"] call SNDB_CALL']], "1", "1"],
            ["flby", [3], "", -5, [["expression", '["flyby"] call SNDB_CALL']], "1", "1"],
            ["battle", [4], "", -5, [["expression", '["battle"] call SNDB_CALL']], "1", "1"],
            ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]        
    ];
};
showCommandingMenu "#USER:adminmenu";

SNDB_CALL =
{    
    DO_THIS = {
        PVDZE_spawnEvent = [_this select 0];
        publicVariableServer "PVDZE_spawnEvent";    
    };
    call DO_THIS;
};

thanks for taking the time to help, i really do appreciate it. 

 

Link to comment
Share on other sites

Uhh, i see it now...See the beginning of line 4 in publicvariable.txt ? Says, kick everyone (the 5 in front) that sends anything that starts with "PVDZE_"  (which is our case)...so you need to add the exception there as well...So the file should be:

5 "" !"PVDZE_" !"norrn" !"usec" !="remExField" !="remExFP" !="drn_AskServerDynamicWeatherEventArgs" !="norrinRAlie" !="BIS_effects_gepv" !="dayzPlayerLogin" !="dayzPlayerLogin2" !"PVAHR_" !="PVAH_AdminReq" !="PVAH_WriteLogReq" !="currentInvites" !="PVDZE_queryGarageVehicle" !="PVDZE_storeVehicle" !="PVDZE_spawnVehicle" !="currentInvites" !"cad_pvar_s" !="axeLampObjects" !="dayzHeliEvac" !="HCrequest_spawnRCV" !="HCsignalRCV" !="HCsignal" !="HClist" !="HCdo_spawn" !="HCrequest_spawn" !="clothesTaken" !="owner_B1" !="owner_B2" !="owner_B3" !="owner_H1" !="owner_H2" !="owner_H3" !="owner_SG" !="owner_LG" !="owner_KING" !="owner_SH" !="OriginsLockUnlock" !="Detain" !="PVDZ_ply_Arrst" !="donn_heli_monitor" !="PVDZE_spawnEvent" 
5 "norrn" !="norrnRACarUp" !="norrnRAPicUp" !="norrnRaDrag" !="norrnR180" !="norrnRalie" !="norrnRLact" !="norrnRALW" !="norrnRDead"
5 "usec" !="usecMorphine" !="usecBandage" !="usecBleed" 
5 "PVDZE_" !"PVDZE_player" !="PVDZE_send" !="PVDZE_log_lockUnlock" !="PVDZE_Server_Simulation" !="PVDZE_veh_Update" !="PVDZE_plr_GutBody" !="PVDZE_plr_GutBodyZ" !="PVDZE_veh_Lock" !="PVDZE_plr_DeathB" !="PVDZE_maintainArea" !="PVDZE_obj_Publish" !="PVDZE_obj_Swap" !="PVDZE_plr_Save" !="PVDZE_obj_Delete" !="PVDZE_obj_Trade" !="PVDZE_veh_Publish2" !="PVDZE_zed_Spawn" !="PVDZE_plr_Died" !="PVDZE_plr_TradeMenu" !="PVDZE_veh_Upgrade" !="PVDZE_atp" !="PVDZE_plr_Login" !="PVDZE_plr_Login2" !="PVDZE_plr_LoginRecord" !="PVDZE_plr_DeathBResult" !="PVDZE_veh_SFix" !="PVDZE_plr_Hit" !="PVDZE_plr_HitV" !="PVDZE_veh_SFuel" !="PVDZE_plr_HideBody" !="PVDZE_plr_Morph" !="PVDZE_veh_Publish" !="PVDZE_plr_Characters" !="PVDZE_lockVault" !="PVDZE_obj_setlocalVars" !="PVDZE_obj_getlocalVars" !="PVDZE_EvacChopperFieldsUpdate" !="PVDZE_bank_Save" !="PVDZE_account_Doublecheck" !="PVDZE_veh_Colour" !="PVDZE_spawnEvent"
5 "PVAHR_" !"PVAHR_0_"
1 "PVAH"
5 "remExFP" !="\"remExFP\" = \[,,\"per\",\"execVM\",\"ca\\Modules\\Functions\\init.sqf\"\]" !"\[,,\"per\",\"execVM\",\"ca\\Modules\\Functions\\init.sqf\"\]"
5="player"
5="server"
5 "fnc_plyrHit"
5 "AntiHack"
1 "Delete" 

This should work.

When you see the kick messages in the logs, the #{number} usually means the kick happened on the next line. So if you see #3 "PVDZE_spawnEvent" = ["battle"] that means something on line 4 triggered the kick.
In your log files you also had : #5 "PVAH_AdminReq" = [1234,<NULL-object>,"**player_UID**"]  If you see on line 6 of the publicvariable.txt it starts with 1 "PVAH"  which also triggered that log entry. Because it is set to 1...it will just log the entry instead of kicking the user doing that action..

 

Link to comment
Share on other sites

I was just getting ready to post the fix for him LOL you beat me to it

On a side note i have a question, im sure its possible, but i cant seem to figure it out.

I have this installed and it works great love it, thanks for this.

I'm trying to make Donnavans fugitive event spawnable by admin. I made a GUI that chooses the players that are online, admin selects those players and moves them to the other box, and starts the event with only the selected players.

The issue im having is putting the GUI in this admin event menu.  

How can i call the GUI that is in the mission, but make a file in the "modules" folder that will call it.  Because this script uses that folder to look into to spawn the events.

here is a pic of the GUI (created in arma 3, but i have it working in arma 2), and im sure it would be used for many other events that not all players want to participate in.

634C653D8DC4DD2F6C9B3B95BFBF8110D56DA307

Link to comment
Share on other sites

Yeah, for me this was the most challenging thing in arma, until figured out how to do it.
I am a bit rusty, since i havent written any code for arma for almost 2 years now, but (i think) it goes like this:

You see in step2 where i make a addPublicVariableEventHandler variable called PVDZE_spawnEvent ? That line is read only from the server. The server 'matches' that variable with:

server_adminspawnEvent = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_adminspawnEvent.sqf";

so it knows to execute the server_adminspawnEvent.sql when that variable is called by anyone. That file is executed on the server, by the server. You need the opposite. You need the server to command all clients to execute a custom thing.

So you need to add another variable in publicEH.sqf file and probably at the very top, so both server and clients read this when the map loads ( i could be mistaken here...cant remember for sure...maybe you can try adding it only for the clients later on when you get it to work...to see if it will work then....To add it for the clients only the variable has to be inside the "if (!isDedicated) then {"  section). Lets call our variable like this:
 

"PVDZE_launch_event"    addPublicVariableEventHandler {(_this select 1) call my_GUI_interface};

So now in the server files, inside the /modules/blah//blah whatever file you are calling in there from your menu....you need to send the PVDZE_launch_event variable to all the clients....so their GUIs will show.

publicVariable PVDZE_launch_event;

When that gets called it will execute the my_GUI_interface function (or whatever name you gave it) that will load the GUI on the client.

I could be wrong with all this...like i said i havent coded for a long time...but if i am understanding correctly what you are trying to do. the above method should work.
A great source for these type of things is KK's blog. Read all his tutorials...They are a great source of advanced coding tips for stuff like that. http://killzonekid.com/arma-scripting-tutorials-variables-part-3/
and also you could download the Epoch Admin Tools and see how they are calling GUIs or sending parameters and values from one script to another.

Back in the day, i used my Dayz.Epoch.3d.Editor.Live.Mission.With.Database.Interaction to code everything for arma. I got no idea how is Epoch nowdays and what has changed since then...but if you can manage to adapt it (it was made for 1.0.4.2) and learn to use it...you' be able to code and debug stuff really fast. Arma language is the worst piece of ...... i've ever seen. Its not a 'forgiving' language...If you make a mistake it will bite you in the ..... costing both time and sanity to fix it :P

Link to comment
Share on other sites

many thanks for the reply.  and yes changing one thing to test and reloading the test server each time is time consuming.  I always wondered if there was a way to live edit stuff like i can in the GUI, without reloading the game lol

I will take your advice and try to fix this.  Thanks again

Link to comment
Share on other sites

Just now, theduke said:

many thanks for the reply.  and yes changing one thing to test and reloading the test server each time is time consuming.  I always wondered if there was a way to live edit stuff like i can in the GUI, without reloading the game lol

I will take your advice and try to fix this.  Thanks again

Yeah, the 3d.editor thingy is a live sandbox thing. Its both client and server running at the same time inside the editor. If you make an extra copy of arma2 on another HD and run the 1.0.4.2 version there, you could play around with it in the editor. 99% of the code should still be the same nowdays. So you could write your scripts there, then copy paste them on your real epoch files and test them. (although converting the whole thing to the latest epoch version shouldn't be too difficult. I basically grabbed some files from the epoch mod, and just bypassed some variables seperating server from client files and functions). If you use an advanced text editor like Ultraedit or Notepad++ and compare the files you'll see there aren't so many changes done.

Link to comment
Share on other sites

  • 8 months later...
On 1/31/2016 at 2:07 PM, Sandbird said:

 

I know this has nothing to do with this thread, but i seen long time ago that you had a garage opener script. I have been trying for a while, and for the life of me i cant seem to figure it out.

Basically i thought all i would have to do is create an action while in vehicle, check nearest locked doors and use the door management script.

this is what i have, and it doesnt work lol

Spoiler

_nearDoorsLocked = nearestObjects [player, DZE_DoorsLocked, 15];

if (_inVehicle && (driver _vehicle == player)) then {
if(_nearDoorsLocked) then {
    if (s_player_manageDoor2 < 0) then {
                                 remote_garage = _vehicle;
        s_player_manageDoor2 = remote_garage addAction ["<t color='#FB7111'>Open Door</t>", "doorManagement\initDoorManagement.sqf",[_cursorTarget], 0, false, true, "",""];
    };
} else {
        remote_garage removeAction s_player_manageDoor2;
        s_player_manageDoor2 = -1;
};
};

 


Any pointers would be great

Link to comment
Share on other sites

6 hours ago, theduke said:

I know this has nothing to do with this thread, but i seen long time ago that you had a garage opener script. I have been trying for a while, and for the life of me i cant seem to figure it out.

Basically i thought all i would have to do is create an action while in vehicle, check nearest locked doors and use the door management script.

this is what i have, and it doesnt work lol

Any pointers would be great

 

Hi, although i have no means of testing this script...i think you can figure things out if i give you the script i wrote back then. It is a bit complex, but i'll try to explain it.

1) The user must have a Radio in his inventory to act as the remote radio to command the door to open
2) In the script there is the option to also use and Infostand_2_EP1 to enter a keycode for the door to open...ignore that..its far too advanced to explain that here. There is also an option to remotely enter a code for the door to open...ignore that as well because that uses a GUI to show the dials to press etc.You just need the basic door unlock script.
3) Line 27 is where you check what door classes are around the player...thats where you have to put your Door class (i was using "CinderWallDoorLocked_DZ","Land_DZE_GarageWoodDoorLocked")
4) Line 77 is where i command the door to open...I'll post that script as well...You probably want to do 'your thing' there with the addon you mentioned.
5) The reason you see a lot of 'player_currentVehicle removeAction'  actions is because due to lag, sometimes menu options would get stuck on the player...This way i am taking precautions to always remove the menu from the player.

Overall i think you'll find what you're looking for here.

The whole script:
http://pastebin.com/wDfzNutE

My vehicle_remoteunlockdoor.sqf
http://pastebin.com/PFCxiFQY

I think the reason your script isnt working is because in your first line you are checking nearby object against the 'player'...and not the 'vehicle player'. If the player is inside a vehicle...there is no player anymore..he has become 'vehicle player'. (well unless something has changed since i stopped coding for arma :P). If you fix that to vehicle player it will probably work.

Also i am not sure what driver _vehicle is. Is this a new variable ? or maybe i forgot that it ever existed...It seems that it checks if the player is the driver of the vehicle...but i dont remember this variable...if you are sure its working properly then ofc use it.

Hope this helps :)

EDIT:
Sorry...i forgot to mention how you execute the first script...You could hijack the fn_selfActions to continuously check if for something....or you can do this:
In your init.sqf :
 

[] spawn {
    waitUntil {!isNil "dayz_animalCheck"};
    _nil = [] execVM "custom\special.sqf";
};

Then inside custom\special.sqf put this code:
http://pastebin.com/2KK6BXWD

(again...i have some variables leftover from other scripts that control gates with codes...its easy to figure them out...just dont use those.)
Also i am checking whether the player is around certain objects before i 'fire' the script  (line 15,16). You should put your door classes that you want to command there as well.
In line 33 I am calling the 1st script i gave your here...I put it in custom\vehicle_remote.sqf

All the above are a bit too much....but inside these scripts is the answer you are looking for and add some. Hope it gives you an idea how to fix your code, or incorporate more stuff to it :)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...