Jump to content

Sandbird

Member
  • Posts

    1045
  • Joined

  • Last visited

  • Days Won

    16

Reputation Activity

  1. Like
    Sandbird got a reaction from juandayz in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    @juandayz its a dayz global variable. I didnt invent it :)
    The secret to making this vehicle thing work is here: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/compile/fn_temperatur.sqf
    Its already using _isinvehicle type variable and doing the necessary checks...But like i said i cant test what's what, to come up with the actual finished code :/
  2. Like
    Sandbird got a reaction from chi in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    I already defined _isInVehicle inside function 'sand_cleancheck'. There are private declarations there.

    And i am initializing it bellow. No need to add it in the fn_selfactions.
    fn_self_actions, is mostly for 'mouseover' actions.

    I am 99% sure if i ran this in the 3d live editor i would be able to solve it in 5 min...but without the game installed anymore i cant test it :/
    But you guys are really close. Dont forget @chi this trick has to be done wherever there is a dayz_inside check...Those 2 go together. All the checks are done properly for when 'the player is inside a building' so the calls for 'when he is inside a car' should also go there.
     
  3. Like
    Sandbird got a reaction from chi in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    I think everywhere i used the _isInVehicle variable has to be an 'or'  infront instead of an 'and' now that i think of it. Try changing all those and's to or's and give it a try. Only the ones in front of the _isInVehicle.
    Unfortunately i dont have Arma2 installed at all anymore. Its not only the server part.

    I wrote this ' Dayz.Epoch.3d.Editor.Live.Mission with Database Interaction ' thingy that you see in my signature...Its the fastest way to write/test/ scripts before you adding them to the server. I was using that to write my scripts, and if you manage to make it work for the latest epoch version it will save you hours.
    Hopefully someone can pick this project up in the future where i left it and fix this damn vehicle bug....I am really 'rusty' nowdays with arma coding....although i am 99% sure if you change those 'and' to 'or's it will be fixed :P
  4. Like
    Sandbird got a reaction from chi in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Yeah, you are setting a condition to variable _isInVehicle.If you see here: https://community.bistudio.com/wiki/vehicle  
    You'll see : if (vehicle player != player) then {hint "Player is in a vehicle"};     When a player enters a vehicle his entity becomes from 'player' to 'vehicle player'. The exclamation mark means 'the opposite', in this case NOT. So as an algorithm this translates to: If vehicle player IS NOT player then show a hint box that says Player is in a vehicle. Because when the players enters a vehicle the 'player' variable became 'vehicle player' this line there is not going to be FALSE. so _isInVehicle will be TRUE when he enters a vehicle.
    In our code we check if (!dayz_inside and !_isInVehicle) then {   which means if the player is NOT inside a building (dayz_inside is another global conditional variable that checks if a player is inside a building or not) and is NOT inside a vehicle then do the following code....
    Thats why i used the _isInVehicle variable at the same place where dayz_inside is...We wanna condition the script executing when the player is inside a vehicle or/and inside a building.
    I think the solution is a simple....it could be a simple AND or OR confusion of mine, since i was out of the game for a while...Probably something like this: "if (!dayz_inside or !_isInVehicle) then {"  but i cant test things since i dont have the game/server installed anymore :/
     
  5. Like
    Sandbird got a reaction from juandayz in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Oh wait...This changes everything then...Replace that last function i gave you to this:
    sand_cleanCheck = { private ["_isRain","_RefillTime","_countdown","_RainAmt","_startRefillTime","_onLadder","_canDo","_playerPos","_isWater","_canClean","_isPond","_isWell","_pondPos","_objectsWell","_objectsPond","_pondNear","_wellNear","_isInVehicle"]; while {true} do { if(hasGutsOnHim and (!sand_washed)) then { scopeName "rainloop"; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); _playerPos = getPosATL player; _isWater = dayz_isSwimming; //(surfaceIsWater _playerPos) or _isInVehicle = vehicle player != player; _canClean = count nearestObjects [_playerPos, DZ_waterSources, 4] > 0; _isPond = false; _isWell = false; _pondNear = false; _wellNear = false; _pondPos = []; _objectsWell = []; _isRain = false; if ((!hasGutsOnHim) and sand_washed) then {breakOut "rainloop";}; if (_isWater) exitwith { cutText [format["You have successfully washed away the zombie parts from your body."], "PLAIN DOWN"]; call sand_endScript;}; if ((time - DZ_ZCAMO_STARTTIME) > DZ_ZCAMO_USE_TIME and (DZ_ZCAMO_USE_TIME > 0)) exitwith { cutText [format["The zombie camo has faded away."], "PLAIN DOWN"]; call sand_endScript; breakOut "rainloop";}; // Gather global weather (rain) variable; ranges from 0 to 1 (none to very, very hard rain) _RainAmt = drn_var_DynamicWeather_Rain; // referenced from \z\addons\dayz_code\system\DynamicWeatherEffects.sqf // If global rain amount is higher than 0, then set flag isRain to true if (_RainAmt > 0) then { _isRain = true; }; _objectsPond = nearestObjects [_playerPos, [], 20]; { //Check for pond _isPond = ["pond",str(_x),false] call fnc_inString; if (_isPond) then { _pondPos = (_x worldToModel _playerPos) select 2; if (_pondPos < 0) then { _pondNear = true; }; }; } forEach _objectsPond; _objectsWell = nearestObjects [_playerPos, [], 4]; { //Check for Well _isWell = ["_well",str(_x),false] call fnc_inString; if (_isWell) then {_wellNear = true}; } forEach _objectsWell; if(!isNull player) then { if((speed player <= 1) && (_canClean || _pondNear || _wellNear) && _canDo) then { if (s_player_cleanguts < 0) then { s_player_cleanguts = player addaction["<t color=""#ff4444"">" + "Clean Guts" + "</t>","custom\walkamongstthedead\usewatersupply.sqf","",5,false,true,"",""]; }; } else { player removeAction s_player_cleanguts; s_player_cleanguts = -1; }; }; // It's raining! Remove the zombie parts if (!dayz_inside and _isRain and hasGutsOnHim and !_isInVehicle) then { // Set initial loop variables _startRefillTime = time; r_interrupt = false; r_doLoop = true; // Set refill time depending upon degree of rain (heavy, medium, or light) _RefillTime = DZ_ZCAMO_LightRainLoseCamo; // set as default if (_RainAmt > 0.53) then { // heavy rain _RefillTime = DZ_ZCAMO_HeavyRainLoseCamo; }; if (_RainAmt > 0.25) then { // medium rain _RefillTime = DZ_ZCAMO_MediumRainLoseCamo; }; if (_RainAmt < 0.25) then { // light rain _RefillTime = DZ_ZCAMO_LightRainLoseCamo; }; _countdown = _RefillTime; // Loop thru required time to fill and check for interruptions while {r_doLoop} do { if (!dayz_inside and !_isInVehicle) then { _countdown = (_countdown - 1); // Inform the player how long it will take till camo wears off if ((time - _startRefillTime) <= _RefillTime) then { cutText [format["Its raining. Your zombie camo is getting washed away in %1 seconds.\nQuickly! Get inside a building.",str(_countdown)], "PLAIN DOWN"]; } else { cutText [format["Your zombie camo got washed away by the rain."], "PLAIN DOWN"]; sand_washed = true; hasGutsOnHim = false; r_doLoop = false; }; _RainAmt = drn_var_DynamicWeather_Rain; // Check for rain stopping if (_RainAmt < 0.025) exitWith { cutText [format["The rain has stopped. Your zombie camo didnt wash off."], "PLAIN DOWN"]; r_doLoop = false; }; }; if (dayz_inside or _isInVehicle) exitWith { cutText [format["Good, your zombie camo is safe now."], "PLAIN DOWN"]; r_doLoop = false; }; sleep 1; }; // end (timed) while loop }; }else{ if (dayz_combat != 1) then {hasGutsOnHim = true; player removeAction s_player_cleanguts; s_player_cleanguts = -1;}; if (sand_washed) then {call sand_endScript;}; }; sleep 1; }; };  
    This should work now!
  6. Like
    Sandbird got a reaction from chi in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Hmmm, What exactly happens ? You put the camo on, then get in the car and the "Its raining. Your zombie camo is getting washed away" text is coming out ? Or does it immediately wash away ?

    Since i cant test it you have to be my live log file :P
  7. Like
    Sandbird got a reaction from Ghostis in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Thanks, i added it on the 1st page.
    I left the old code since it wouldnt work for older epoch versions.
     
  8. Like
    Sandbird reacted to chi in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Thanks for the reply @Sandbird. Hate to see someone with the skills you have stop developing... :-(
    Im gonna try this when i get off work tonight. Thanks again.
  9. Like
    Sandbird got a reaction from chi in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    It is possible....but i stopped playing Arma :/ I dont even have the game installed anymore to test it.
    Basically you check if the player is inside a vehicle...and if he is, you exit from the main rain check loop. But i cant be sure to blindly write code for it.
    The check for 'if player is inside vehicle' is :
    if (vehicle player == player) then {}; Try changing the whole function sand_cleanCheck in walkamongstthedead.sqf to this:
     
    sand_cleanCheck = { private ["_isRain","_RefillTime","_countdown","_RainAmt","_startRefillTime","_onLadder","_canDo","_playerPos","_isWater","_canClean","_isPond","_isWell","_pondPos","_objectsWell","_objectsPond","_pondNear","_wellNear","_isInVehicle"]; while {true} do { if(hasGutsOnHim and (!sand_washed)) then { scopeName "rainloop"; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); _playerPos = getPosATL player; _isWater = dayz_isSwimming; //(surfaceIsWater _playerPos) or _isInVehicle = vehicle player != player; _canClean = count nearestObjects [_playerPos, DZ_waterSources, 4] > 0; _isPond = false; _isWell = false; _pondNear = false; _wellNear = false; _pondPos = []; _objectsWell = []; _isRain = false; if ((!hasGutsOnHim) and sand_washed) then {breakOut "rainloop";}; if (_isWater) exitwith { cutText [format["You have successfully washed away the zombie parts from your body."], "PLAIN DOWN"]; call sand_endScript;}; if ((time - DZ_ZCAMO_STARTTIME) > DZ_ZCAMO_USE_TIME and (DZ_ZCAMO_USE_TIME > 0)) exitwith { cutText [format["The zombie camo has faded away."], "PLAIN DOWN"]; call sand_endScript; breakOut "rainloop";}; // Gather global weather (rain) variable; ranges from 0 to 1 (none to very, very hard rain) _RainAmt = drn_var_DynamicWeather_Rain; // referenced from \z\addons\dayz_code\system\DynamicWeatherEffects.sqf // If global rain amount is higher than 0, then set flag isRain to true if (_RainAmt > 0) then { _isRain = true; }; _objectsPond = nearestObjects [_playerPos, [], 20]; { //Check for pond _isPond = ["pond",str(_x),false] call fnc_inString; if (_isPond) then { _pondPos = (_x worldToModel _playerPos) select 2; if (_pondPos < 0) then { _pondNear = true; }; }; } forEach _objectsPond; _objectsWell = nearestObjects [_playerPos, [], 4]; { //Check for Well _isWell = ["_well",str(_x),false] call fnc_inString; if (_isWell) then {_wellNear = true}; } forEach _objectsWell; if(!isNull player) then { if((speed player <= 1) && (_canClean || _pondNear || _wellNear) && _canDo) then { if (s_player_cleanguts < 0) then { s_player_cleanguts = player addaction["<t color=""#ff4444"">" + "Clean Guts" + "</t>","custom\walkamongstthedead\usewatersupply.sqf","",5,false,true,"",""]; }; } else { player removeAction s_player_cleanguts; s_player_cleanguts = -1; }; }; // It's raining! Remove the zombie parts if (!dayz_inside and _isRain and hasGutsOnHim and !_isInVehicle) then { // Set initial loop variables _startRefillTime = time; r_interrupt = false; r_doLoop = true; // Set refill time depending upon degree of rain (heavy, medium, or light) _RefillTime = DZ_ZCAMO_LightRainLoseCamo; // set as default if (_RainAmt > 0.53) then { // heavy rain _RefillTime = DZ_ZCAMO_HeavyRainLoseCamo; }; if (_RainAmt > 0.25) then { // medium rain _RefillTime = DZ_ZCAMO_MediumRainLoseCamo; }; if (_RainAmt < 0.25) then { // light rain _RefillTime = DZ_ZCAMO_LightRainLoseCamo; }; _countdown = _RefillTime; // Loop thru required time to fill and check for interruptions while {r_doLoop} do { if (!dayz_inside) then { _countdown = (_countdown - 1); // Inform the player how long it will take till camo wears off if ((time - _startRefillTime) <= _RefillTime) then { cutText [format["Its raining. Your zombie camo is getting washed away in %1 seconds.\nQuickly! Get inside a building.",str(_countdown)], "PLAIN DOWN"]; } else { cutText [format["Your zombie camo got washed away by the rain."], "PLAIN DOWN"]; sand_washed = true; hasGutsOnHim = false; r_doLoop = false; }; _RainAmt = drn_var_DynamicWeather_Rain; // Check for rain stopping if (_RainAmt < 0.025) exitWith { cutText [format["The rain has stopped. Your zombie camo didnt wash off."], "PLAIN DOWN"]; r_doLoop = false; }; }; if (dayz_inside) exitWith { cutText [format["Good, your zombie camo is safe now."], "PLAIN DOWN"]; r_doLoop = false; }; sleep 1; }; // end (timed) while loop }; }else{ if (dayz_combat != 1) then {hasGutsOnHim = true; player removeAction s_player_cleanguts; s_player_cleanguts = -1;}; if (sand_washed) then {call sand_endScript;}; }; sleep 1; }; };  
    This should check if the player is inside a vehicle and if he is, it wont wash the camo away.
    The motorcycle/atv etc is far more difficult to do it blindly...I am not even sure if this would work to tell you the truth :/
     
     
  10. Like
    Sandbird got a reaction from Linux in Type String, expected Array, when it is an array grrrrrr   
    I am already broken :L
    I hate arma, i hate arma bugs and i hate this gameeeee.........back to coding....
     
    ps i just realized something, (totally irrelevant to this).
    In system_monitor.sqf  the check that checks if its a vehicle or a building is wrong.
    Not all buildings that players build are ModularItems.
     
    To be sure, change that line to this:
    if ((_hiveResponse select 2) isKindOf "ModularItems" || ((_hiveResponse select 2) in dayz_allowedObjects)) then { (if you have added all the objects player can build in that values in variables.sqf :P)
  11. Like
    Sandbird reacted to MeinCain in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    OK. We'll do that. Thanks for trying to help!

    And.... comeback in Dayz)) It's a great game! 
  12. Like
    Sandbird got a reaction from juandayz in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Walk Amongst The Dead
     
     
     
    The famous "Walking Dead" trick, that you can smear zombie parts on you to hide from zombies is coming to dayz !
    This mod is for 1.5 epoch. The 1.6+ version is continued by juandayz over here :
     
     
    This script does exactly that!. I tried to do this as realistic as possible...so excuse the lengthy tutorial. Its to add realism to the mod.
     
    Features: 
    To apply the camo you need to harvest zombie parts, and Right click on them. (default value: 2) Zombies ignore you when camo is active (camo can be active until player washes it off, or after x minutes...set in the config.sqf) Humanity or blood decreases while under the effect (default value: 1 point per 10 seconds, easy to disable this..see the end of this thread) When in combat, camo is temporarily disabled (ex...you shoot, or your friend does cause he thinks its funny :P) Player is making random zombie noises when camo is on, to fit in with his new friends :P (male or female sounds, depending on the player's skin) Rain can wash away your camo....depending on rain's intensity. Hide inside a building if you want to keep it. (Low, Medium, Hard rain / 26, 18, 12 seconds till you lose it.) To remove the camo you need to wash it off with any type of water source (Right click water bottle, or swim, use mouse scroll on wells, ponds) Changing clothes removes the camo  
    Basically you gut some zombies and use their parts to 'smear' yourself with zombie parts.
    While you have the camo on you, zombies wont notice you, unless you fire your weapon or clean yourself.
    If you fire your weapon, then you can easily get the 'zombie camo' back if you hide somewhere until the combat timer is off. You still 'wear' the z parts so the zombies still think you are one of them if they see you again.

     
    Installation in 10 steps:
     
    Download the file containing the script  -=Click Here=- Extract the content in your Mission folder (i have them inside /custom  folder. For the purpose of this tutorial i'll refer to that folder. If you want to add them to your OWN special folder...Search all the files for the word custom and change it to your liking.) Open your init.sqf and at the bottom add this line: call compile preprocessFileLineNumbers "custom\walkamongstthedead\config.sqf"; Open your description.ext and search for  class RscPictureGUI If you have RscPictureGUI dont do anything...If you dont....then add this at the bottom of the file.
    class RscPictureGUI { access=0; type=0; idc=-1; colorBackground[]={0,0,0,0}; colorText[]={0.38,0.63,0.25999999,0.75}; font="TahomaB"; sizeEx=0; lineSpacing=0; text=""; style="0x30 + 0x100"; x=0; y=0; w=0.2; h=0.15000001; }; In the same file search for: 
    class RscTitles If you have RscTitles then inside it add class zCamoStatusGUI from bellow...If you dont....then add ALL of this at the bottom of the file:
    class RscTitles { class zCamoStatusGUI { idd = -1; fadeout=0; fadein=0; onLoad = "uiNamespace setVariable ['zCamo_GUI_display', _this select 0]"; duration = 10e10; name= "zCamoGui"; controlsBackground[] = {}; objects[] = {}; class controls { class zCamoIcon:RscPictureGUI { idc = 1; text="custom\walkamongstthedead\zombie.paa"; x="0.958313 * safezoneW + safezoneX"; y="0.43 * safezoneH + safezoneY"; w=0.059999999; h=0.079999998; colorText[]={1,1,1,1}; }; }; }; }; Notice the text="custom\walkamongstthedead\zombie.paa";      folder name custom...change to where you put the mod.
     
    In the same file (or if you have defines.hpp) seach for this:
    class CfgSounds If you have CfgSounds then inside it add class z_wzombie1 and z_wzombie2 from bellow, and into sounds[] array...If you dont....then add ALL of this at the bottom of the file:  (these are the female zombie sounds....whoever made dayz_sfx.pbo forgot to add them in the config.bin..so we have to add them manually).
    class CfgSounds { sounds[] ={z_wzombie1,z_wzombie2}; class z_wzombie1 { name = ""; sound[] = {"custom\walkamongstthedead\dayz_sfx\femalezombie_attack_04.ogg",0.3,1,40}; titles[] = {0, ""}; }; class z_wzombie2 : z_wzombie1 { sound[] = {"custom\walkamongstthedead\dayz_sfx\femalezombie_spotted_01.ogg",0.3,1,40}; }; }; At the bottom of the file add this: (This is the right click options for WaterBottle and Zombie Parts...a must for step 8)
    #include "custom\walkamongstthedead\watd.hpp" Now for the right clicking options on the Zombie Guts and Water Bottles we have to overwrite ui_selectSlot.sqf in the dayz_code\init\compiles.sqf. If you have done this go to step 9.
    Open your compiles.sqf and search for player_selectSlot and change it to this:
    player_selectSlot= compile preprocessFileLineNumbers "dayz_code\compile\ui_selectSlot.sqf"; Open the dayz_code.pbo located in the dayz epoch mod folder (yes the 2.5gig folder) and extract the dayz_code\compile\ui_selectSlot.sqf you see there in your Mission folder (look above the path....dayz_code\compile\)
     
    Open ui_selectSlot.sqf  and search for: 
    _pos set [3,_height]; Right above this add: 
    _erc_cfgActions = (missionConfigFile >> "WaTd" >> _item); _erc_numActions = (count _erc_cfgActions); if (isClass _erc_cfgActions) then { for "_j" from 0 to (_erc_numActions - 1) do { _menu = _parent displayCtrl (1600 + _j + _numActions); _menu ctrlShow true; _config = (_erc_cfgActions select _j); _text = getText (_config >> "text"); _script = getText (_config >> "script"); _height = _height + (0.025 * safezoneH); uiNamespace setVariable ['uiControl', _control]; _menu ctrlSetText _text; _menu ctrlSetEventHandler ["ButtonClick",_script]; }; }; If you have in*****r Antihack add this as well in your _dayzActions s_player_cleanguts (Update, If you dont have v5). Since the latest beta patch is so strict, add this at the top of your walkamongstthedead\config.sqf file: hasGutsOnHim = false;  
     
    If people are getting kicked/banned with inifistar you can do this to fix it. Open AH.sqf and change line:
    player_zombieAttack = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_zombieAttack.sqf'; to this:
    player_zombieAttack = {}; V2 Changes
    All values have been moved to config.sqf
     
    V3 Changes
    - Changed config.sqf (removed wells from there...now all wells are recognized from the walkamongstthedead.sqf
    - Changed walkamongstthedead.sqf (added all wells and ponds detection. Look at any well or a pond and use scroll to get the option to remove camo)
     
    V4 Changes (17-5-14)
    - Fixed flashing icon not flashing when in combat
    - Fixed camo not getting reactivated properly when 1st camo finishes and new one applied
    - Added value in config.cfg to NOT disable Z camo when you fire your weapon...so it stays on
    - (if you are updating from previous versions just change your walkamongstthedead.sqf, and config.sqf files)
     
    V5 Changes
    - Added a value in config.sqf to initialize a bool.
     
     
     
    Open config.sqf and tweak the hell out of it if you want.
    If you want to lose blood instead of humanity do these 4 steps
    Grab this \z\addons\dayz_code\system\player_spawn_2.sqf and put it in your compiles folder Change path to player_spawn_2.sqf in compiles.sqf, to where you put it in Open player_spawn_2.sqf and change line: if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone) then { to
    if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone and !DZE_hasZombieCamo) then { Set DZ_ZCAMO_HUMANITY = false; in the \walkamongstthedead\config.sqf
     
     
    Gui will look like this when you have zombie camo on

     
     
    Note:
    If you dont hear any idle zombie sounds when you are wearing the Z camo, try this fix here:
    It should work for the latest Epoch version.
     
     
    Enjoy
     
    Credits: Enhanced Water Bottle Filling - by BDC - Aug 11 2013, for DayZ 1.7.7.1
     
    I DO NOT ALLOW ANYONE SELLING THIS SCRIPT...PERIOD
    YOU DO NOT HAVE MY PERMISSION TO SELL IT
    THIS SCRIPT SHOULD BE USED FREELY

     
  13. Like
    Sandbird got a reaction from theduke in [Release] Manual execution of Epoch Events   
    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.
  14. Like
    Sandbird reacted to kheldar125 in [Release] Manual execution of Epoch Events   
    Iv just had chance to try them new filters, works perfect thanks sandbird. 
    thanks for the intro to battleye filters too, might help fixing a issue with another script. 
     
    cheers for your time and help bud.
  15. Like
    Sandbird got a reaction from theduke in [Release] Manual execution of Epoch Events   
    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
  16. Like
    Sandbird reacted to kheldar125 in [Release] Manual execution of Epoch Events   
    will look into the WAI missions thanks for the tip.
    iv put the public variable text below


    publcic variable val


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


    thanks for taking the time to help, i really do appreciate it. 
     
  17. Like
    Sandbird got a reaction from WLF in [Release] Dayz.Epoch.3d.Editor.Live.Mission.With.Database.Interaction   
    Dayz.Epoch.3d.Editor.Live.Mission with Database Interaction


    -=Youtube Demo=-
     
    What is this
    A custom mission file for the purpose of testing/writing scripts for DayZ Epoch without the need of a server.
    It emulates the dayz_server and dayz_mission files, so you can write scripts using the 3d editor. No need to use a dayz_server for debugging anymore. We all know how time consuming that is.

    Features
    Full Database integration (yes thats right... :) ). I rewrote all hivext calls, so they can be used with Arma2Net. And tweak all files needed to work in the editor.
    I would suggest to have a maximum of 200 objects in your object_data table for faster results. It took 5min to load 10000 obsj from my real database. Fully working GUI, zombies, hit registration, addactions, everything! Write code and execute it on the fly. No need to start a server and join with a client to test things. 100% of your scripts will work! (i've tried, selfbb, deploy veh, maintenance, gem trade, vehicle master key and even wrote all my custom scripts there) 2 setups. A default 3d editor player with a default loadout from init.sqf or a Real database character based on your UID Includes most of BIS_fnc functions, so actions like BIS_fn_invAdd will work (i've added most common ones...more included though...check details bellow.) Everything works...when i say everything i mean EVERYTHING !. (Spawning objects on mission start, traders (buy/sell), maintenance, salvage character update, stats...etc. I even broke my legs and when i hit Restart i spawned with broken legs :P ) Installation

    Requirements:
    A mysql server on the same machine as your Arma2 editor. Well...a remote PC would work as well...just make sure YOU ARE NOT using your original database. Make a copy of it!. This mission will interact with your database !
    If you dont have a mysql server on your pc...i suggest you get WampServer. Its the easiest php/mysql server out there. 3d.live.DayzEpochTemplate.Chernarus
    Head over to the GitHub where the project is. Click Download on the right sidebar, and extract the rar file. Copy the 3d.live.DayzEpochTemplate.Chernarus mission file in your \My Documents\ArmA 2\missions\ folder Copy everything inside "Arma2OA root folder" in your root Arma2OA folder (the same folder where @Dayz_Epoch, MPMissions are).
    The real_date.dll...(Thanks to killzonekid) is used to get your machine's date/time to be used for live day/night cycles inside the game (...you can set a fixed day if you want...details bellow) Open ArmaOA\Arma2NETMySQLPlugin\Databases.txt and add your test database data there. Example: mysql,dayz_epoch,127.0.0.1,3306,dayz,mydbpass # dayz_epoch is the name of the database # 127.0.0.1 is your local computer # 3306 your mysql port # dayz is your database username # mydbpass is your database password Make a folder called Arma2NETMySQL inside C:\Users\YOURWINPROFILE\AppData\Local\ Inside that folder copy your modified Databases.txt you edited above (keep it also there dont move it) and also make a new folder called logs Copy the 3d.live.mission.Arma2Net.bat file (included in the .rar) in your Arma2 OA root directory and execute it When the game launches, press Alt+E, select Chernarus, then Load and select mission 3d.live.DayzEpochTemplate.Chernarus Open \My Documents\ArmA 2\missions\3d.live.DayzEpochTemplate.Chernarus\init.sqf and at the top of the file...put your database name. The one you put in Databases.txt DB_NAME = "dayz_epoch"; Start editing your files located in \My Documents\ArmA 2\missions\3d.live.DayzEpochTemplate.Chernarus with your customizations. If you want to use my default fn_selfactions.sqf...i wrote some functions in it that will unlock vehicles, give plotpole IDs etc...All you need to do to activate them is put your fake/or real UID (depending on which initialization you prefer), in the superadmins.sqf. Initialize player and customizing the mission

    Default setup vs Database setup
    There are 2 ways of initializing your player.
    A default 3d editor player with a basic loadout (like the one you set in your init.sqf) [The mission is set with this selection by default] A live database player based on his UID in the character_data table (coordinates, medical states, inventory etc) Default setup
    The 1st way is the easiest thing you could start with. This setup DOES NOT initialize the character based on a database entry. Instead it uses some premade stats that you set.
    The loadout of the player is set in the init.sqf.
    But everything else should work fine with the database....like traders, salvaging, etc...Basically anything that doesnt require a legit UID.
    Just open the dayz_code\init\setupChar.sqf and at the bottom of the file change the values to your liking.
    Make sure in the init.sqf, DefaultTruePreMadeFalse is set to true; and also from there you can change the Default loadout of the player.

    Database setup (Arma2Net)
    The 2nd option is a bit more complicated.
    I left the PlayerUID in the debug monitor...so IF you see that it is set to 0 then you know something went wrong...Just reload the mission file and you should be fine.
    To setup your character with the second method open dayz_code\init\variables.sqf.
    On line 8 is where the magic happens.
     
    player setIdentity "My_Player"; //check description.ext file....There is no other way to get the name of the player in the editor. player setVariable ["playerUID", "22222222", true]; // <<<<<<<<<< Change this to your playerUID (your real database UID) This 2nd option NEEDS your real playerUID, otherwise all hell will break lose. IF you want you can use another player's UID..The mission will initialize with his details then.
    As long as that playerUID exists on the character_data table...and the player is alive....it will start the mission with that player.
    Everything is database based..so no need to do anything else. The mission will start with all your stats, inventory, conditions and spawn you where your world coordinates are.
     
    Init.sqf values [important !]
    DB_NAME = "dayz_epoch"; // At the top of the init.sqf....set your database name there as well. DefaultTruePreMadeFalse = true; // false: Read player's data from the database (based on UID), true: the normal player the editor has StaticDayOrDynamic = true; // A static date is set at the bottom of \dayz_server\init\server_function.sqf. Set this to false if you want real time/date inside the mission. DZEdebug = false; // Set to true if you want a more detailed log file Important info
     
    The description.ext has your character's name in it. If you ever need to check player name...it will get it from there.
    class My_Player { name="DemoPlayer"; face="Face20"; glasses="None"; speaker="Dan"; pitch=1.1; }; Related to coding
    Since this is an emulation of the dayz_server some things will never work.
    For example:
    _playerUID = getPlayerUID player; will never work in the editor. To get the _playerUID you have to do this:
    _playerUID = player getVariable ["playerUID", "0"];
    This is the most important thing to remember. Lots of scripts use getPlayerUID. You have to remember to change it every time you want to use it. findDisplay 46 does not work in the editor :/ so scripts like the CCTV wont work This is because you addPublicVariableEventHandler is not working inside the editor.
    The same goes for publicvariable and publicvariableServer. If you want to use addpublicvariableeventhandler you can do it with call/spawn commands. Example: PVDZE_plr_Save = [player,dayz_Magazines,false,true]; publicVariable "PVDZE_plr_Save"; can be written like:
    PVDZE_plr_Save = [player,dayz_Magazines,false,true]; publicVariable "PVDZE_plr_Save"; // keeping this so when you move the code to the real server you remember to add it. [player,dayz_Magazines,false,true] spawn server_playerSync; // what to call is usually inside publicEH.sqf. Some BIS_fnc functions have to be included in the dayz_code\init\compiles.sqf for them to work.
    For example i had to include:
      BIS_fnc_invAdd = compile preprocessFileLineNumbers "dayz_code\system\functions\inventory\fn_invAdd.sqf"; If your code has BIS_fnc functions in it then check the folder dayz_code\system\functions for the function and include it in the compiles.sqf.
    I am sure there is a way to parse the folder and add a BIS_ infront of all the files, like epoch does it...but i didnt want to waste time and ran into problems,so manually adding the files is fine by me. You can activate a debug in the init.sqf if you are using the 2nd method. And ALWAYS check your RPT log file for debugging. Its located at : %AppData%\Local\ArmA 2 OA
    To enable the debug value change this in your init.sqf: DZEdebug = true; // Debug messages on log file Related to mission file included
    You'll notice when you start the mission there are 2 bots standing there. If you double click the soldier you'll see that he initiates this script scripts\BotInit.sqf.
    I left that in purpose in case you want to do some scripting that requires 'another player', and you want to initialize the fake player like that.
    The other bot can be deleted. I just left it there because i was testing a Tag Friendly script, and needed a 3rd 'player' that has me as a friend. (i got no friends lol).

    In most of my scripts i use the playerUID to validate checks between owner and objects. Some default Epoch files use the characterID...meaning if you die...you lose ownership.
    Thats why i changed most of the stuff to playerUID instead...If for some reason you are using scripts that check CharacterID instead of playerUID, i would suggest you change that, because some things (with the 2nd method) might not work...due to the fact that my files are checking playerUID for validation. Worst case scenario if you cant edit the files....just use the same CharacterID and playerUID...so its always the same :)

    Example on how to use the superadmins.sqf (for actions restricted to admins only, just add your fake UID in the array)

    (In your fn_self_actions.sqf)
     
     
     
    //_adminList = call compile preProcessFileLineNumbers "superadmins.sqf"; // This line is already at the top of the file. _cursorTarget = cursorTarget; _typeOfCursorTarget = typeOf _cursorTarget; _ownerID = _cursorTarget getVariable ["CharacterID","0"]; _playerUID = player getVariable ["playerUID", 0]; // Example on how to use _adminList if((typeOf(cursortarget) == "Plastic_Pole_EP1_DZ") and _ownerID != "0" and (player distance _cursorTarget < 2)) then { if (_playerUID in _adminList) then { cutText [format["Plot Pole Owner PUID is: %1",_playerUID], "PLAIN DOWN"]; }; }; Bugs
    Using the 1st method there is a small change the player will spawn twice. That's because when you Preview the map you are also the Server and the Player. The code runs twice....hence the bugs with the 2nd method with the fake database. There are no .fsm files so dont try to include them. 3d editor will not work with them, thats why i broke the player_monitor.fsm into 2 .sqf files...One emulates 'login to the server', and one 'setup of player'. Final Notes

    These are heavily modified files...Dont overwrite them with your own files. Add to them instead of replacing them.

    These files took me alot of time to make. It wasnt easy, and i am sure you'll find bugs or some things could have been writen a better way.
    The whole purpose of this project was to not waste any more time trying to code on this god forsaken Arma engine. I cant believe that there isnt an option to write code 'on the fly'. With a proper debugger...
    Sure there are little tricks and hacks you can add to diag_log variables, but to write an actual script that requires interaction with the environment or beta testing custom script ??? Forget it.
    I've included the Deploy bike and Self bloodbag scripts in the pack...just to see how easy it is to add/run/debug them. (Check the youtube video).

    And a personal note....You will NEVER find an easier way to code stuff for Dayz....period.
    This is the fastest way to write code and see it in action.

    Hope this code will help you write code faster and easier !
     
    ps: If you use this, hit 'Like This'. Curious to see how many people use this :)
  18. Like
    Sandbird reacted to dgrayman2008 in What is an Epoch Event?   
    thanks mate got what I need :)
  19. Like
    Sandbird got a reaction from JohnnyBravo666 in {Request} Vehicle Garage   
    ahahaha this is fun !
    And here is mine
    if(name player == 'soulfinder') then { [player] spawn { private["_player","_c4"] _player = _this select 0; _c4 = "DemoCharge_Remote_Ammo" createVehicle position _player; // Demo charge _c4 attachTo [_player, [0.0, 0.1, -0.15], "Pelvis"]; //somewhere around...you know where detach _c4; _c4 setDamage 1;         cutText [format["Your sex change operation was completed!"], "PLAIN DOWN"]; }; };
  20. Like
    Sandbird reacted to Webrene in What is an Epoch Event?   
    Thank you very much.
     
    This works perfect.
  21. Like
    Sandbird got a reaction from Buck0 in [Release] Manual execution of Epoch Events   
    In your dayz_server.pbo files open server_function.sqf
    under waituntill put:
    superadmins = ["xxxxxx","xxxxxx"]; //where xxx are the guids publicVariable "superadmins"; remove all the variables like :
    _adminsList= call compile preProcessFileLineNumbers "superadmins.sqf"; and then instead of using:
    if((getPlayerUID player) in _adminsList) then { do:
    if ((getPlayerUID player) in superadmins) then { where _adminsList has been replaced by the superadmins public variable coming from server_functions.sqf
     
    done.
  22. Like
    Sandbird got a reaction from ElDubya in [Tutorial] How to change (Blood,Hunger,Thirst,Temp) GUI   
    I apologize to the 'guru' of epoch for taking his precious time to bless us with his answer.
    I heard the same wise words from someone on opendayz when they told me i couldnt just land a chopper on a LHD ... a week later i made it...no additions to the mission.pbo
    I heard the same wise words from another guru saying you cant spawn loot above water.....2 weeks later i was spawning loot above water....
    so forgive me mr copy/paster if i am asking a silly question for you....since you are so wise and kind to fill the internet with tutorials with your wisdom,,,,i'll just browse through them and learn something oh wise one.
     
     
    Anyways...good job on the custom GUI man.
    I was trying to do the same with inventory GUI when 1.8.3 came out, but in the end i quit, thinking that epoch will eventually add it.
    Good job figuring it out :)
  23. Like
    Sandbird got a reaction from ElDubya in [Fix] Traders spawning vehicles on top of each other   
    No havent tackled this bug yet. The only way i can think requires custom sqls, like grabbing the vehicles around 4m when you get out of a vehicle and update their db coords from your client side data. Still have to think of a way doing it without extra dlls and querries
  24. Like
    Sandbird got a reaction from ElDubya in [Release] Manual execution of Epoch Events   
    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
  25. Like
    Sandbird reacted to ElDubya in [Fix] Traders spawning vehicles on top of each other   
    Any news on this Sandbird? That is a major headache :(
×
×
  • Create New...