Jump to content

Sandbird

Member
  • Posts

    1045
  • Joined

  • Last visited

  • Days Won

    16

Reputation Activity

  1. Thanks
    Sandbird got a reaction from DIO in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Dayz.Epoch.1.0.62 - 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 would suggest to have a maximum of 100 objects in your object_data table for faster results.
    Took 5 min to load 10000 objs from my real database, so also make sure you dont go crazy with the MaxVehicleLimit, MaxDynamicDebris values in the init.sqf 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! (dynamic weather, default loadouts, custom scripts etc) 2 setups. A default 3d editor player with a default loadout 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, character update, events, stats...etc) New Features!
    All .FSM files have been converted to .SQF meaning the mission acts as a full fledged server / client merge. New character creation has been ignored though, so the server expects that the client that is about to connect exists in the database. The server will start, wait for a 'fake client connection to happen' (you pressing the Preview button), and then it will load your character from the database, spawn Hive objects and create new based on your MaxVehicleLimit values etc, then initialize the events and finally spawn the character to his worldspace location. Use AdminTools to spawn any Perm, Temp vehicle you want, including buildings, crates etc. Building objects is working as expected with a little AddAction trick. Unfortunately the primary display (eg: findDisplay 46) isnt working inside the editor. That means that building stuff or placing objects is very hard to do since we can't 'capture' keystrokes.
    Further details below after the Installation instructions. Arma2Net is not allowed by Battleye anymore, so i am using extDB3 now. 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 don't have a mysql server on your pc...i suggest you get WampServer. It's the easiest php/mysql server out there.
    Installation
    Head over to the GitHub where the project is. Click Download on the right sidebar, and extract the rar file. Copy the 3d.live1062.DayzEpochTemplate.Chernarus mission file in your \My Documents\ArmA 2\missions\ folder If your active Arma profile is not the default one, then you probably should extract it in the \My Documents\ArmA 2 Other Profiles 2\missions\ folder, otherwise you won't be able to find the mission inside the editor. Copy everything inside "Arma2OA root folder" in your root Arma2OA folder (the same folder where @DayZ_Epoch_Server, 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). The tbbmalloc - tbbmalloc_x64.dll files are provided by extDB3. They shouldnt interfere with your normal game, but they are needed for the mission to be able to connect to your MySQL server. (Make a backup of your original ones if you want, just be safe.) EATbaseExporter is used by the AdminTools, and allows you to export bases to an .sqf format so you can import them afterwards to your server. Now edit -=START HIVE MISSION=-.bat which was placed in your Arma2 folder, and fix the paths to their proper values. If you are using DZLauncher then the @Dayz_Epoch folder is probably where i placed it myself.  Battleye needs to be disabled inside the editor otherwise the extDB3 addon will not work. The .bat is taking care of that. It will disable Battleye after 7 seconds. Depending on your machine, if you see that the time isn't sufficient, raise that value a little bit. A sample Database has been provided with me as a character and a basic loadout. You can of course use your own database, just remember to delete most of your Object_Data table vehicles. The more vehicles you have there, the longer it will take for the dayz_server to spawn them. If you just want to write a script independent of cars etc...why wait 5 minutes for the server to spawn 10000 vehicles :) Open "ArmaOA\@extDB\extdb3-conf.ini" and add your test database data there. I named the test SQL DB dayz_cherno [dayz_cherno] IP = localhost Port = 3306 Username = dayz Password = mypass123 Database = dayz_cherno # dayz_cherno is the name of the database (change it in both values) # localhost is your mysql server (could be an IP value as well) # 3306 your mysql port # dayz is your database username # mypass123 is your database password  
    When the game launches, press Alt+E, select Chernarus, then Load mission 3d.live1062.DayzEpochTemplate.Chernarus
    Open \My Documents\ArmA 2\missions\3d.live1062.DayzEpochTemplate.Chernarus\init.sqf
    Go to line 61 and start editing the values there. DB_NAME is the name of your database (same as the extdb3 config file).
    Add your PlayerUID value (same as the DB one) in line 72. (That the player you want to load from the database)
    Depending which map you want to use, you have to change the dayZ_instance variable and also the MarkerP values (line 62) based on your mission.sqm file. Its for the Hive to spawn random vehicles, roadblocks and mines at proper locations based on the map. Just read the comments there for how to get the values. Its really simple. Just copy paste stuff from your mission.sqm file.
    Default setup vs Database setup
    There are 2 ways of initializing your player.
    A live database player based on his UID in the character_data table (coordinates, medical states, inventory etc) A default 3d editor player with a basic loadout. (Ignores Hive Loadouts and initial vehicle spawns) Default setup (extDB3)
    [DefaultTruePreMadeFalse = true;] This option is now the default one, because it's so much easier to set up, plus a lot of things have changed in the 1062 Epoch version. I couldn't totally separate the server files from the client files, so in the end a Database is necessary for the Mission files to work properly. To setup your character with this method, leave DefaultTruePreMadeFalse to true;  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. Premade Character Setup
    [DefaultTruePreMadeFalse = false;] This setup DOES NOT initialize the character based on a database entry, or does any HIVE related queries on mission start. (like load objects etc). Instead it uses some premade stats that you set, and only uses the Database on updates (buy vehicles etc) The loadout of the player is set in the init.sqf in line 77  
    player setVariable ["CharacterID", "1", true]; // Set here the characterID of the player. It can be anything...just leave it 1 if you want. player setVariable ["playerUID", "111111", true]; // Set here the playerUID of the player you want to have. player setVariable["Z_globalVariable", 100000]; player setVariable["Z_BankVariable", 100000]; player setVariable["Z_MoneyVariable", 100000]; player setVariable["humanity", 11000]; player setVariable["humanKills", 10]; player setVariable["banditKills", 20]; player setVariable["zombieKills", 30]; player setVariable ["friendlies", ["222222","333333"], true]; //Both DZE_Friends and this must be set for friendlies to work properly DZE_Friends = ["222222","333333"]; Everything else should work fine with the database....like traders, salvaging, etc...Unfortunately since the 1062 ver had many differences from the 1051 one, i couldn't really make this Profile option a standalone one, without any Database interaction. So in order for you to minimize any errors in the log file, i would suggest you load my sample db file provided, and also change those CharacterID and PlayerUID values in PLAYER_Data and CHARACTER_Data tables to the ones you set up here, just in case.... The Premade character setup is for people that want to fast debug a script they are making and don't want to wait for the Hive to load all map objects and authenticate the player first. Further Details to change (in both Profile Cases)
    The description.ext, mission.sqf, mission.biedi files have your character's name in them. Just search for the word Sandbird in all of them and change it according to the PlayerName value you have in your Player_DATA table for your PlayerUID value.
    Example taken from description.ext. DONT change the actual My_Player text. The mission file needs that string to read what you typed in the name field.
    class My_Player { name="Sandbird"; face="Face20"; glasses="None"; speaker="Male01EN"; pitch=1.1; };  
    Important info
    Init.sqf values
    DefaultTruePreMadeFalse = true; // True: Read player's data from the database (based on UID), False: 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 Enable Keyboard actions (menu option) // (findDisplay 46) wont work inside the editor. That means that building stuff or placing objects is very hard to do since we cant 'capture' keystrokes. I kinda fixed this with a trick. In order to build something first you have to initiate the building action (holding the object in your hands) and then scroll with your mouse wheel and select Enable Keyboard actions. This will create a layer on your screen capturing your keystrokes thus allowing you to change orientations etc. Pressing ESC twice after and it will close the fake display and return to normal play mode. You will have to do this every time you want to build something. Related to coding
    Since the Editor has some limitations because its not a real 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.  Of course the player value is just an example here. If you were inside a loop and it had (getPlayerUID _x) then you have to rewrite it like this: (_x getVariable["PlayerUID",0]) findDisplay 46 does not work in the editor. If you are using/making a script that uses Display 46 try using my Enable Keyboard action. It might work in your case. publicvariableServercommands don't exist in the editor. There is no server to accept the command. If you want to use addpublicvariableeventhandler you can do it with call/spawn commands. You can find the handlers usually in the PublicEH.sqf.
    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]; publicVariableServer "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. In this case search for PVDZE_plr_Save in the PublicEH file and check the call it makes in the end. You could also change the publicVariableServer to publicVariable. That should work inside the editor. But keep in mind these changes wont work on the live server, since one command broadcasts something to the server while the other just to the client running it. I would suggest you keep the original value and do the PublicEH call instead, marking it down with some debug comments next to it, so when you are done and want to transfer the files to your live server you just remove the call and everything should work as expected.
    Don't forget to change the paths when you are adding addons to test/modify them. For example, notice the differences here:  player_switchModel = compile preprocessFileLineNumbers "dayz_code\compile\player_switchModel.sqf"; player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf"; The first line will look up for player_switchModel.sqf inside the editor mission files, while the 2nd one will go to the @Dayz_Epoch map file and get the .sqf file. Same thing applies for the dayz_server files (server_functions.sqf). Once you are done with your script and you have added new compile lines, you need to fix them back to their proper values before you upload them to your live server.
      If you are missing any BIS_fnc functions then check the folder dayz_code\system\functions and see if it's available there to include it in the compiles.sqf. Set DZEdebug = true;  in the init.sqf. And ALWAYS check your RPT log file for debugging. Its located at : %AppData%\Local\ArmA 2 OA folder. 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've included a simple Fireworks script i made a while back only this time i used some better effects taken from aliascartoons work. Just add a 'SMAW_HEDP' into your inventory and right click on it to test it out. Here is how the old script used to look like Fireworks. Also you'll find a little 'hat script' in the files, just right click a 'IRStrobe' item to add a hat to your player. Both script were written inside the editor using the mission file above...just a small example to show you how easy it is to write code there. The @extDB folder contains a folder called debug_files. These .dlls (when replaced the ones provided) activate a more detailed log file (found under arma 2 operation arrowhead\logs folder). It will show ALL MySQL queries going in/out of the database. Very useful if you are running any custom SQL queries and the RTP log file isn't enough.
    Final Notes
    These are heavily modified files...Dont overwrite them with your own files. Add to them instead of replacing them.
    If you are writing scripts that dont require the server to restart, then you can just go to 2D editor and press Preview again after you make the changes. No need to hit Restart. As long as you are doing changes that doesnt affect the Hive loading you can basically run things on the fly. For example in the init.sqf at the bottom i added a Add BankMonkey example. That command just loads the custom\money.sqf and shows a simple extDB3 example on how to select/update a DB table. Since this command doesnt require the server to restart, you can just hit Preview, test things out, and if you want to make changes, go back to 2D Editor, edit your changes in the money.sqf file and hit Preview again. No need to hit Restart and wait for the dayz_server functions to do their thing again.
    The whole purpose of this project was to not waste any more time trying to code on this god forsaken Arma engine.
    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 !
    ### Credits
    This mission file would not be possible without the help of these addons/people

    DayzEpochTeam | http://epochmod.com
    killzonekid | http://killzonekid.com
    extDB3 | https://bitbucket.org/torndeco/extdb3/wiki/Home
    ebayShopper | https://github.com/ebayShopper/TestKit
    JasonTM (for the latest beta AdminTools)| https://epochmod.com/forum/topic/44863-release-epoch-admin-tools-v-1107-test-branch/
  2. Haha
    Sandbird reacted to Helion4 in Error in carge_trucks?   
    That's nice, thanks for sharing...

    Did you read that error?
    Your custom added, event1.sqf, has an undefined variable that needs fixing.
  3. Like
    Sandbird got a reaction from Schalldampfer in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    [Update]
    - fixed server_playersync.sqf to save coin value to db
    - testkit fixes
  4. Like
    Sandbird got a reaction from theduke in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Dayz.Epoch.1.0.62 - 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 would suggest to have a maximum of 100 objects in your object_data table for faster results.
    Took 5 min to load 10000 objs from my real database, so also make sure you dont go crazy with the MaxVehicleLimit, MaxDynamicDebris values in the init.sqf 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! (dynamic weather, default loadouts, custom scripts etc) 2 setups. A default 3d editor player with a default loadout 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, character update, events, stats...etc) New Features!
    All .FSM files have been converted to .SQF meaning the mission acts as a full fledged server / client merge. New character creation has been ignored though, so the server expects that the client that is about to connect exists in the database. The server will start, wait for a 'fake client connection to happen' (you pressing the Preview button), and then it will load your character from the database, spawn Hive objects and create new based on your MaxVehicleLimit values etc, then initialize the events and finally spawn the character to his worldspace location. Use AdminTools to spawn any Perm, Temp vehicle you want, including buildings, crates etc. Building objects is working as expected with a little AddAction trick. Unfortunately the primary display (eg: findDisplay 46) isnt working inside the editor. That means that building stuff or placing objects is very hard to do since we can't 'capture' keystrokes.
    Further details below after the Installation instructions. Arma2Net is not allowed by Battleye anymore, so i am using extDB3 now. 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 don't have a mysql server on your pc...i suggest you get WampServer. It's the easiest php/mysql server out there.
    Installation
    Head over to the GitHub where the project is. Click Download on the right sidebar, and extract the rar file. Copy the 3d.live1062.DayzEpochTemplate.Chernarus mission file in your \My Documents\ArmA 2\missions\ folder If your active Arma profile is not the default one, then you probably should extract it in the \My Documents\ArmA 2 Other Profiles 2\missions\ folder, otherwise you won't be able to find the mission inside the editor. Copy everything inside "Arma2OA root folder" in your root Arma2OA folder (the same folder where @DayZ_Epoch_Server, 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). The tbbmalloc - tbbmalloc_x64.dll files are provided by extDB3. They shouldnt interfere with your normal game, but they are needed for the mission to be able to connect to your MySQL server. (Make a backup of your original ones if you want, just be safe.) EATbaseExporter is used by the AdminTools, and allows you to export bases to an .sqf format so you can import them afterwards to your server. Now edit -=START HIVE MISSION=-.bat which was placed in your Arma2 folder, and fix the paths to their proper values. If you are using DZLauncher then the @Dayz_Epoch folder is probably where i placed it myself.  Battleye needs to be disabled inside the editor otherwise the extDB3 addon will not work. The .bat is taking care of that. It will disable Battleye after 7 seconds. Depending on your machine, if you see that the time isn't sufficient, raise that value a little bit. A sample Database has been provided with me as a character and a basic loadout. You can of course use your own database, just remember to delete most of your Object_Data table vehicles. The more vehicles you have there, the longer it will take for the dayz_server to spawn them. If you just want to write a script independent of cars etc...why wait 5 minutes for the server to spawn 10000 vehicles :) Open "ArmaOA\@extDB\extdb3-conf.ini" and add your test database data there. I named the test SQL DB dayz_cherno [dayz_cherno] IP = localhost Port = 3306 Username = dayz Password = mypass123 Database = dayz_cherno # dayz_cherno is the name of the database (change it in both values) # localhost is your mysql server (could be an IP value as well) # 3306 your mysql port # dayz is your database username # mypass123 is your database password  
    When the game launches, press Alt+E, select Chernarus, then Load mission 3d.live1062.DayzEpochTemplate.Chernarus
    Open \My Documents\ArmA 2\missions\3d.live1062.DayzEpochTemplate.Chernarus\init.sqf
    Go to line 61 and start editing the values there. DB_NAME is the name of your database (same as the extdb3 config file).
    Add your PlayerUID value (same as the DB one) in line 72. (That the player you want to load from the database)
    Depending which map you want to use, you have to change the dayZ_instance variable and also the MarkerP values (line 62) based on your mission.sqm file. Its for the Hive to spawn random vehicles, roadblocks and mines at proper locations based on the map. Just read the comments there for how to get the values. Its really simple. Just copy paste stuff from your mission.sqm file.
    Default setup vs Database setup
    There are 2 ways of initializing your player.
    A live database player based on his UID in the character_data table (coordinates, medical states, inventory etc) A default 3d editor player with a basic loadout. (Ignores Hive Loadouts and initial vehicle spawns) Default setup (extDB3)
    [DefaultTruePreMadeFalse = true;] This option is now the default one, because it's so much easier to set up, plus a lot of things have changed in the 1062 Epoch version. I couldn't totally separate the server files from the client files, so in the end a Database is necessary for the Mission files to work properly. To setup your character with this method, leave DefaultTruePreMadeFalse to true;  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. Premade Character Setup
    [DefaultTruePreMadeFalse = false;] This setup DOES NOT initialize the character based on a database entry, or does any HIVE related queries on mission start. (like load objects etc). Instead it uses some premade stats that you set, and only uses the Database on updates (buy vehicles etc) The loadout of the player is set in the init.sqf in line 77  
    player setVariable ["CharacterID", "1", true]; // Set here the characterID of the player. It can be anything...just leave it 1 if you want. player setVariable ["playerUID", "111111", true]; // Set here the playerUID of the player you want to have. player setVariable["Z_globalVariable", 100000]; player setVariable["Z_BankVariable", 100000]; player setVariable["Z_MoneyVariable", 100000]; player setVariable["humanity", 11000]; player setVariable["humanKills", 10]; player setVariable["banditKills", 20]; player setVariable["zombieKills", 30]; player setVariable ["friendlies", ["222222","333333"], true]; //Both DZE_Friends and this must be set for friendlies to work properly DZE_Friends = ["222222","333333"]; Everything else should work fine with the database....like traders, salvaging, etc...Unfortunately since the 1062 ver had many differences from the 1051 one, i couldn't really make this Profile option a standalone one, without any Database interaction. So in order for you to minimize any errors in the log file, i would suggest you load my sample db file provided, and also change those CharacterID and PlayerUID values in PLAYER_Data and CHARACTER_Data tables to the ones you set up here, just in case.... The Premade character setup is for people that want to fast debug a script they are making and don't want to wait for the Hive to load all map objects and authenticate the player first. Further Details to change (in both Profile Cases)
    The description.ext, mission.sqf, mission.biedi files have your character's name in them. Just search for the word Sandbird in all of them and change it according to the PlayerName value you have in your Player_DATA table for your PlayerUID value.
    Example taken from description.ext. DONT change the actual My_Player text. The mission file needs that string to read what you typed in the name field.
    class My_Player { name="Sandbird"; face="Face20"; glasses="None"; speaker="Male01EN"; pitch=1.1; };  
    Important info
    Init.sqf values
    DefaultTruePreMadeFalse = true; // True: Read player's data from the database (based on UID), False: 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 Enable Keyboard actions (menu option) // (findDisplay 46) wont work inside the editor. That means that building stuff or placing objects is very hard to do since we cant 'capture' keystrokes. I kinda fixed this with a trick. In order to build something first you have to initiate the building action (holding the object in your hands) and then scroll with your mouse wheel and select Enable Keyboard actions. This will create a layer on your screen capturing your keystrokes thus allowing you to change orientations etc. Pressing ESC twice after and it will close the fake display and return to normal play mode. You will have to do this every time you want to build something. Related to coding
    Since the Editor has some limitations because its not a real 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.  Of course the player value is just an example here. If you were inside a loop and it had (getPlayerUID _x) then you have to rewrite it like this: (_x getVariable["PlayerUID",0]) findDisplay 46 does not work in the editor. If you are using/making a script that uses Display 46 try using my Enable Keyboard action. It might work in your case. publicvariableServercommands don't exist in the editor. There is no server to accept the command. If you want to use addpublicvariableeventhandler you can do it with call/spawn commands. You can find the handlers usually in the PublicEH.sqf.
    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]; publicVariableServer "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. In this case search for PVDZE_plr_Save in the PublicEH file and check the call it makes in the end. You could also change the publicVariableServer to publicVariable. That should work inside the editor. But keep in mind these changes wont work on the live server, since one command broadcasts something to the server while the other just to the client running it. I would suggest you keep the original value and do the PublicEH call instead, marking it down with some debug comments next to it, so when you are done and want to transfer the files to your live server you just remove the call and everything should work as expected.
    Don't forget to change the paths when you are adding addons to test/modify them. For example, notice the differences here:  player_switchModel = compile preprocessFileLineNumbers "dayz_code\compile\player_switchModel.sqf"; player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf"; The first line will look up for player_switchModel.sqf inside the editor mission files, while the 2nd one will go to the @Dayz_Epoch map file and get the .sqf file. Same thing applies for the dayz_server files (server_functions.sqf). Once you are done with your script and you have added new compile lines, you need to fix them back to their proper values before you upload them to your live server.
      If you are missing any BIS_fnc functions then check the folder dayz_code\system\functions and see if it's available there to include it in the compiles.sqf. Set DZEdebug = true;  in the init.sqf. And ALWAYS check your RPT log file for debugging. Its located at : %AppData%\Local\ArmA 2 OA folder. 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've included a simple Fireworks script i made a while back only this time i used some better effects taken from aliascartoons work. Just add a 'SMAW_HEDP' into your inventory and right click on it to test it out. Here is how the old script used to look like Fireworks. Also you'll find a little 'hat script' in the files, just right click a 'IRStrobe' item to add a hat to your player. Both script were written inside the editor using the mission file above...just a small example to show you how easy it is to write code there. The @extDB folder contains a folder called debug_files. These .dlls (when replaced the ones provided) activate a more detailed log file (found under arma 2 operation arrowhead\logs folder). It will show ALL MySQL queries going in/out of the database. Very useful if you are running any custom SQL queries and the RTP log file isn't enough.
    Final Notes
    These are heavily modified files...Dont overwrite them with your own files. Add to them instead of replacing them.
    If you are writing scripts that dont require the server to restart, then you can just go to 2D editor and press Preview again after you make the changes. No need to hit Restart. As long as you are doing changes that doesnt affect the Hive loading you can basically run things on the fly. For example in the init.sqf at the bottom i added a Add BankMonkey example. That command just loads the custom\money.sqf and shows a simple extDB3 example on how to select/update a DB table. Since this command doesnt require the server to restart, you can just hit Preview, test things out, and if you want to make changes, go back to 2D Editor, edit your changes in the money.sqf file and hit Preview again. No need to hit Restart and wait for the dayz_server functions to do their thing again.
    The whole purpose of this project was to not waste any more time trying to code on this god forsaken Arma engine.
    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 !
    ### Credits
    This mission file would not be possible without the help of these addons/people

    DayzEpochTeam | http://epochmod.com
    killzonekid | http://killzonekid.com
    extDB3 | https://bitbucket.org/torndeco/extdb3/wiki/Home
    ebayShopper | https://github.com/ebayShopper/TestKit
    JasonTM (for the latest beta AdminTools)| https://epochmod.com/forum/topic/44863-release-epoch-admin-tools-v-1107-test-branch/
  5. Like
    Sandbird got a reaction from Schalldampfer in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Dayz.Epoch.1.0.62 - 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 would suggest to have a maximum of 100 objects in your object_data table for faster results.
    Took 5 min to load 10000 objs from my real database, so also make sure you dont go crazy with the MaxVehicleLimit, MaxDynamicDebris values in the init.sqf 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! (dynamic weather, default loadouts, custom scripts etc) 2 setups. A default 3d editor player with a default loadout 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, character update, events, stats...etc) New Features!
    All .FSM files have been converted to .SQF meaning the mission acts as a full fledged server / client merge. New character creation has been ignored though, so the server expects that the client that is about to connect exists in the database. The server will start, wait for a 'fake client connection to happen' (you pressing the Preview button), and then it will load your character from the database, spawn Hive objects and create new based on your MaxVehicleLimit values etc, then initialize the events and finally spawn the character to his worldspace location. Use AdminTools to spawn any Perm, Temp vehicle you want, including buildings, crates etc. Building objects is working as expected with a little AddAction trick. Unfortunately the primary display (eg: findDisplay 46) isnt working inside the editor. That means that building stuff or placing objects is very hard to do since we can't 'capture' keystrokes.
    Further details below after the Installation instructions. Arma2Net is not allowed by Battleye anymore, so i am using extDB3 now. 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 don't have a mysql server on your pc...i suggest you get WampServer. It's the easiest php/mysql server out there.
    Installation
    Head over to the GitHub where the project is. Click Download on the right sidebar, and extract the rar file. Copy the 3d.live1062.DayzEpochTemplate.Chernarus mission file in your \My Documents\ArmA 2\missions\ folder If your active Arma profile is not the default one, then you probably should extract it in the \My Documents\ArmA 2 Other Profiles 2\missions\ folder, otherwise you won't be able to find the mission inside the editor. Copy everything inside "Arma2OA root folder" in your root Arma2OA folder (the same folder where @DayZ_Epoch_Server, 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). The tbbmalloc - tbbmalloc_x64.dll files are provided by extDB3. They shouldnt interfere with your normal game, but they are needed for the mission to be able to connect to your MySQL server. (Make a backup of your original ones if you want, just be safe.) EATbaseExporter is used by the AdminTools, and allows you to export bases to an .sqf format so you can import them afterwards to your server. Now edit -=START HIVE MISSION=-.bat which was placed in your Arma2 folder, and fix the paths to their proper values. If you are using DZLauncher then the @Dayz_Epoch folder is probably where i placed it myself.  Battleye needs to be disabled inside the editor otherwise the extDB3 addon will not work. The .bat is taking care of that. It will disable Battleye after 7 seconds. Depending on your machine, if you see that the time isn't sufficient, raise that value a little bit. A sample Database has been provided with me as a character and a basic loadout. You can of course use your own database, just remember to delete most of your Object_Data table vehicles. The more vehicles you have there, the longer it will take for the dayz_server to spawn them. If you just want to write a script independent of cars etc...why wait 5 minutes for the server to spawn 10000 vehicles :) Open "ArmaOA\@extDB\extdb3-conf.ini" and add your test database data there. I named the test SQL DB dayz_cherno [dayz_cherno] IP = localhost Port = 3306 Username = dayz Password = mypass123 Database = dayz_cherno # dayz_cherno is the name of the database (change it in both values) # localhost is your mysql server (could be an IP value as well) # 3306 your mysql port # dayz is your database username # mypass123 is your database password  
    When the game launches, press Alt+E, select Chernarus, then Load mission 3d.live1062.DayzEpochTemplate.Chernarus
    Open \My Documents\ArmA 2\missions\3d.live1062.DayzEpochTemplate.Chernarus\init.sqf
    Go to line 61 and start editing the values there. DB_NAME is the name of your database (same as the extdb3 config file).
    Add your PlayerUID value (same as the DB one) in line 72. (That the player you want to load from the database)
    Depending which map you want to use, you have to change the dayZ_instance variable and also the MarkerP values (line 62) based on your mission.sqm file. Its for the Hive to spawn random vehicles, roadblocks and mines at proper locations based on the map. Just read the comments there for how to get the values. Its really simple. Just copy paste stuff from your mission.sqm file.
    Default setup vs Database setup
    There are 2 ways of initializing your player.
    A live database player based on his UID in the character_data table (coordinates, medical states, inventory etc) A default 3d editor player with a basic loadout. (Ignores Hive Loadouts and initial vehicle spawns) Default setup (extDB3)
    [DefaultTruePreMadeFalse = true;] This option is now the default one, because it's so much easier to set up, plus a lot of things have changed in the 1062 Epoch version. I couldn't totally separate the server files from the client files, so in the end a Database is necessary for the Mission files to work properly. To setup your character with this method, leave DefaultTruePreMadeFalse to true;  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. Premade Character Setup
    [DefaultTruePreMadeFalse = false;] This setup DOES NOT initialize the character based on a database entry, or does any HIVE related queries on mission start. (like load objects etc). Instead it uses some premade stats that you set, and only uses the Database on updates (buy vehicles etc) The loadout of the player is set in the init.sqf in line 77  
    player setVariable ["CharacterID", "1", true]; // Set here the characterID of the player. It can be anything...just leave it 1 if you want. player setVariable ["playerUID", "111111", true]; // Set here the playerUID of the player you want to have. player setVariable["Z_globalVariable", 100000]; player setVariable["Z_BankVariable", 100000]; player setVariable["Z_MoneyVariable", 100000]; player setVariable["humanity", 11000]; player setVariable["humanKills", 10]; player setVariable["banditKills", 20]; player setVariable["zombieKills", 30]; player setVariable ["friendlies", ["222222","333333"], true]; //Both DZE_Friends and this must be set for friendlies to work properly DZE_Friends = ["222222","333333"]; Everything else should work fine with the database....like traders, salvaging, etc...Unfortunately since the 1062 ver had many differences from the 1051 one, i couldn't really make this Profile option a standalone one, without any Database interaction. So in order for you to minimize any errors in the log file, i would suggest you load my sample db file provided, and also change those CharacterID and PlayerUID values in PLAYER_Data and CHARACTER_Data tables to the ones you set up here, just in case.... The Premade character setup is for people that want to fast debug a script they are making and don't want to wait for the Hive to load all map objects and authenticate the player first. Further Details to change (in both Profile Cases)
    The description.ext, mission.sqf, mission.biedi files have your character's name in them. Just search for the word Sandbird in all of them and change it according to the PlayerName value you have in your Player_DATA table for your PlayerUID value.
    Example taken from description.ext. DONT change the actual My_Player text. The mission file needs that string to read what you typed in the name field.
    class My_Player { name="Sandbird"; face="Face20"; glasses="None"; speaker="Male01EN"; pitch=1.1; };  
    Important info
    Init.sqf values
    DefaultTruePreMadeFalse = true; // True: Read player's data from the database (based on UID), False: 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 Enable Keyboard actions (menu option) // (findDisplay 46) wont work inside the editor. That means that building stuff or placing objects is very hard to do since we cant 'capture' keystrokes. I kinda fixed this with a trick. In order to build something first you have to initiate the building action (holding the object in your hands) and then scroll with your mouse wheel and select Enable Keyboard actions. This will create a layer on your screen capturing your keystrokes thus allowing you to change orientations etc. Pressing ESC twice after and it will close the fake display and return to normal play mode. You will have to do this every time you want to build something. Related to coding
    Since the Editor has some limitations because its not a real 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.  Of course the player value is just an example here. If you were inside a loop and it had (getPlayerUID _x) then you have to rewrite it like this: (_x getVariable["PlayerUID",0]) findDisplay 46 does not work in the editor. If you are using/making a script that uses Display 46 try using my Enable Keyboard action. It might work in your case. publicvariableServercommands don't exist in the editor. There is no server to accept the command. If you want to use addpublicvariableeventhandler you can do it with call/spawn commands. You can find the handlers usually in the PublicEH.sqf.
    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]; publicVariableServer "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. In this case search for PVDZE_plr_Save in the PublicEH file and check the call it makes in the end. You could also change the publicVariableServer to publicVariable. That should work inside the editor. But keep in mind these changes wont work on the live server, since one command broadcasts something to the server while the other just to the client running it. I would suggest you keep the original value and do the PublicEH call instead, marking it down with some debug comments next to it, so when you are done and want to transfer the files to your live server you just remove the call and everything should work as expected.
    Don't forget to change the paths when you are adding addons to test/modify them. For example, notice the differences here:  player_switchModel = compile preprocessFileLineNumbers "dayz_code\compile\player_switchModel.sqf"; player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf"; The first line will look up for player_switchModel.sqf inside the editor mission files, while the 2nd one will go to the @Dayz_Epoch map file and get the .sqf file. Same thing applies for the dayz_server files (server_functions.sqf). Once you are done with your script and you have added new compile lines, you need to fix them back to their proper values before you upload them to your live server.
      If you are missing any BIS_fnc functions then check the folder dayz_code\system\functions and see if it's available there to include it in the compiles.sqf. Set DZEdebug = true;  in the init.sqf. And ALWAYS check your RPT log file for debugging. Its located at : %AppData%\Local\ArmA 2 OA folder. 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've included a simple Fireworks script i made a while back only this time i used some better effects taken from aliascartoons work. Just add a 'SMAW_HEDP' into your inventory and right click on it to test it out. Here is how the old script used to look like Fireworks. Also you'll find a little 'hat script' in the files, just right click a 'IRStrobe' item to add a hat to your player. Both script were written inside the editor using the mission file above...just a small example to show you how easy it is to write code there. The @extDB folder contains a folder called debug_files. These .dlls (when replaced the ones provided) activate a more detailed log file (found under arma 2 operation arrowhead\logs folder). It will show ALL MySQL queries going in/out of the database. Very useful if you are running any custom SQL queries and the RTP log file isn't enough.
    Final Notes
    These are heavily modified files...Dont overwrite them with your own files. Add to them instead of replacing them.
    If you are writing scripts that dont require the server to restart, then you can just go to 2D editor and press Preview again after you make the changes. No need to hit Restart. As long as you are doing changes that doesnt affect the Hive loading you can basically run things on the fly. For example in the init.sqf at the bottom i added a Add BankMonkey example. That command just loads the custom\money.sqf and shows a simple extDB3 example on how to select/update a DB table. Since this command doesnt require the server to restart, you can just hit Preview, test things out, and if you want to make changes, go back to 2D Editor, edit your changes in the money.sqf file and hit Preview again. No need to hit Restart and wait for the dayz_server functions to do their thing again.
    The whole purpose of this project was to not waste any more time trying to code on this god forsaken Arma engine.
    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 !
    ### Credits
    This mission file would not be possible without the help of these addons/people

    DayzEpochTeam | http://epochmod.com
    killzonekid | http://killzonekid.com
    extDB3 | https://bitbucket.org/torndeco/extdb3/wiki/Home
    ebayShopper | https://github.com/ebayShopper/TestKit
    JasonTM (for the latest beta AdminTools)| https://epochmod.com/forum/topic/44863-release-epoch-admin-tools-v-1107-test-branch/
  6. Like
    Sandbird got a reaction from Schalldampfer in [Release] Dayz.Epoch.3d.Editor.Live.Mission.With.Database.Interaction   
    ...soon to be updated :)
  7. Like
    Sandbird got a reaction from JasonTM in ...Something's Cooking!   
  8. Thanks
    Sandbird got a reaction from JasonTM in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Dayz.Epoch.1.0.62 - 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 would suggest to have a maximum of 100 objects in your object_data table for faster results.
    Took 5 min to load 10000 objs from my real database, so also make sure you dont go crazy with the MaxVehicleLimit, MaxDynamicDebris values in the init.sqf 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! (dynamic weather, default loadouts, custom scripts etc) 2 setups. A default 3d editor player with a default loadout 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, character update, events, stats...etc) New Features!
    All .FSM files have been converted to .SQF meaning the mission acts as a full fledged server / client merge. New character creation has been ignored though, so the server expects that the client that is about to connect exists in the database. The server will start, wait for a 'fake client connection to happen' (you pressing the Preview button), and then it will load your character from the database, spawn Hive objects and create new based on your MaxVehicleLimit values etc, then initialize the events and finally spawn the character to his worldspace location. Use AdminTools to spawn any Perm, Temp vehicle you want, including buildings, crates etc. Building objects is working as expected with a little AddAction trick. Unfortunately the primary display (eg: findDisplay 46) isnt working inside the editor. That means that building stuff or placing objects is very hard to do since we can't 'capture' keystrokes.
    Further details below after the Installation instructions. Arma2Net is not allowed by Battleye anymore, so i am using extDB3 now. 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 don't have a mysql server on your pc...i suggest you get WampServer. It's the easiest php/mysql server out there.
    Installation
    Head over to the GitHub where the project is. Click Download on the right sidebar, and extract the rar file. Copy the 3d.live1062.DayzEpochTemplate.Chernarus mission file in your \My Documents\ArmA 2\missions\ folder If your active Arma profile is not the default one, then you probably should extract it in the \My Documents\ArmA 2 Other Profiles 2\missions\ folder, otherwise you won't be able to find the mission inside the editor. Copy everything inside "Arma2OA root folder" in your root Arma2OA folder (the same folder where @DayZ_Epoch_Server, 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). The tbbmalloc - tbbmalloc_x64.dll files are provided by extDB3. They shouldnt interfere with your normal game, but they are needed for the mission to be able to connect to your MySQL server. (Make a backup of your original ones if you want, just be safe.) EATbaseExporter is used by the AdminTools, and allows you to export bases to an .sqf format so you can import them afterwards to your server. Now edit -=START HIVE MISSION=-.bat which was placed in your Arma2 folder, and fix the paths to their proper values. If you are using DZLauncher then the @Dayz_Epoch folder is probably where i placed it myself.  Battleye needs to be disabled inside the editor otherwise the extDB3 addon will not work. The .bat is taking care of that. It will disable Battleye after 7 seconds. Depending on your machine, if you see that the time isn't sufficient, raise that value a little bit. A sample Database has been provided with me as a character and a basic loadout. You can of course use your own database, just remember to delete most of your Object_Data table vehicles. The more vehicles you have there, the longer it will take for the dayz_server to spawn them. If you just want to write a script independent of cars etc...why wait 5 minutes for the server to spawn 10000 vehicles :) Open "ArmaOA\@extDB\extdb3-conf.ini" and add your test database data there. I named the test SQL DB dayz_cherno [dayz_cherno] IP = localhost Port = 3306 Username = dayz Password = mypass123 Database = dayz_cherno # dayz_cherno is the name of the database (change it in both values) # localhost is your mysql server (could be an IP value as well) # 3306 your mysql port # dayz is your database username # mypass123 is your database password  
    When the game launches, press Alt+E, select Chernarus, then Load mission 3d.live1062.DayzEpochTemplate.Chernarus
    Open \My Documents\ArmA 2\missions\3d.live1062.DayzEpochTemplate.Chernarus\init.sqf
    Go to line 61 and start editing the values there. DB_NAME is the name of your database (same as the extdb3 config file).
    Add your PlayerUID value (same as the DB one) in line 72. (That the player you want to load from the database)
    Depending which map you want to use, you have to change the dayZ_instance variable and also the MarkerP values (line 62) based on your mission.sqm file. Its for the Hive to spawn random vehicles, roadblocks and mines at proper locations based on the map. Just read the comments there for how to get the values. Its really simple. Just copy paste stuff from your mission.sqm file.
    Default setup vs Database setup
    There are 2 ways of initializing your player.
    A live database player based on his UID in the character_data table (coordinates, medical states, inventory etc) A default 3d editor player with a basic loadout. (Ignores Hive Loadouts and initial vehicle spawns) Default setup (extDB3)
    [DefaultTruePreMadeFalse = true;] This option is now the default one, because it's so much easier to set up, plus a lot of things have changed in the 1062 Epoch version. I couldn't totally separate the server files from the client files, so in the end a Database is necessary for the Mission files to work properly. To setup your character with this method, leave DefaultTruePreMadeFalse to true;  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. Premade Character Setup
    [DefaultTruePreMadeFalse = false;] This setup DOES NOT initialize the character based on a database entry, or does any HIVE related queries on mission start. (like load objects etc). Instead it uses some premade stats that you set, and only uses the Database on updates (buy vehicles etc) The loadout of the player is set in the init.sqf in line 77  
    player setVariable ["CharacterID", "1", true]; // Set here the characterID of the player. It can be anything...just leave it 1 if you want. player setVariable ["playerUID", "111111", true]; // Set here the playerUID of the player you want to have. player setVariable["Z_globalVariable", 100000]; player setVariable["Z_BankVariable", 100000]; player setVariable["Z_MoneyVariable", 100000]; player setVariable["humanity", 11000]; player setVariable["humanKills", 10]; player setVariable["banditKills", 20]; player setVariable["zombieKills", 30]; player setVariable ["friendlies", ["222222","333333"], true]; //Both DZE_Friends and this must be set for friendlies to work properly DZE_Friends = ["222222","333333"]; Everything else should work fine with the database....like traders, salvaging, etc...Unfortunately since the 1062 ver had many differences from the 1051 one, i couldn't really make this Profile option a standalone one, without any Database interaction. So in order for you to minimize any errors in the log file, i would suggest you load my sample db file provided, and also change those CharacterID and PlayerUID values in PLAYER_Data and CHARACTER_Data tables to the ones you set up here, just in case.... The Premade character setup is for people that want to fast debug a script they are making and don't want to wait for the Hive to load all map objects and authenticate the player first. Further Details to change (in both Profile Cases)
    The description.ext, mission.sqf, mission.biedi files have your character's name in them. Just search for the word Sandbird in all of them and change it according to the PlayerName value you have in your Player_DATA table for your PlayerUID value.
    Example taken from description.ext. DONT change the actual My_Player text. The mission file needs that string to read what you typed in the name field.
    class My_Player { name="Sandbird"; face="Face20"; glasses="None"; speaker="Male01EN"; pitch=1.1; };  
    Important info
    Init.sqf values
    DefaultTruePreMadeFalse = true; // True: Read player's data from the database (based on UID), False: 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 Enable Keyboard actions (menu option) // (findDisplay 46) wont work inside the editor. That means that building stuff or placing objects is very hard to do since we cant 'capture' keystrokes. I kinda fixed this with a trick. In order to build something first you have to initiate the building action (holding the object in your hands) and then scroll with your mouse wheel and select Enable Keyboard actions. This will create a layer on your screen capturing your keystrokes thus allowing you to change orientations etc. Pressing ESC twice after and it will close the fake display and return to normal play mode. You will have to do this every time you want to build something. Related to coding
    Since the Editor has some limitations because its not a real 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.  Of course the player value is just an example here. If you were inside a loop and it had (getPlayerUID _x) then you have to rewrite it like this: (_x getVariable["PlayerUID",0]) findDisplay 46 does not work in the editor. If you are using/making a script that uses Display 46 try using my Enable Keyboard action. It might work in your case. publicvariableServercommands don't exist in the editor. There is no server to accept the command. If you want to use addpublicvariableeventhandler you can do it with call/spawn commands. You can find the handlers usually in the PublicEH.sqf.
    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]; publicVariableServer "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. In this case search for PVDZE_plr_Save in the PublicEH file and check the call it makes in the end. You could also change the publicVariableServer to publicVariable. That should work inside the editor. But keep in mind these changes wont work on the live server, since one command broadcasts something to the server while the other just to the client running it. I would suggest you keep the original value and do the PublicEH call instead, marking it down with some debug comments next to it, so when you are done and want to transfer the files to your live server you just remove the call and everything should work as expected.
    Don't forget to change the paths when you are adding addons to test/modify them. For example, notice the differences here:  player_switchModel = compile preprocessFileLineNumbers "dayz_code\compile\player_switchModel.sqf"; player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf"; The first line will look up for player_switchModel.sqf inside the editor mission files, while the 2nd one will go to the @Dayz_Epoch map file and get the .sqf file. Same thing applies for the dayz_server files (server_functions.sqf). Once you are done with your script and you have added new compile lines, you need to fix them back to their proper values before you upload them to your live server.
      If you are missing any BIS_fnc functions then check the folder dayz_code\system\functions and see if it's available there to include it in the compiles.sqf. Set DZEdebug = true;  in the init.sqf. And ALWAYS check your RPT log file for debugging. Its located at : %AppData%\Local\ArmA 2 OA folder. 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've included a simple Fireworks script i made a while back only this time i used some better effects taken from aliascartoons work. Just add a 'SMAW_HEDP' into your inventory and right click on it to test it out. Here is how the old script used to look like Fireworks. Also you'll find a little 'hat script' in the files, just right click a 'IRStrobe' item to add a hat to your player. Both script were written inside the editor using the mission file above...just a small example to show you how easy it is to write code there. The @extDB folder contains a folder called debug_files. These .dlls (when replaced the ones provided) activate a more detailed log file (found under arma 2 operation arrowhead\logs folder). It will show ALL MySQL queries going in/out of the database. Very useful if you are running any custom SQL queries and the RTP log file isn't enough.
    Final Notes
    These are heavily modified files...Dont overwrite them with your own files. Add to them instead of replacing them.
    If you are writing scripts that dont require the server to restart, then you can just go to 2D editor and press Preview again after you make the changes. No need to hit Restart. As long as you are doing changes that doesnt affect the Hive loading you can basically run things on the fly. For example in the init.sqf at the bottom i added a Add BankMonkey example. That command just loads the custom\money.sqf and shows a simple extDB3 example on how to select/update a DB table. Since this command doesnt require the server to restart, you can just hit Preview, test things out, and if you want to make changes, go back to 2D Editor, edit your changes in the money.sqf file and hit Preview again. No need to hit Restart and wait for the dayz_server functions to do their thing again.
    The whole purpose of this project was to not waste any more time trying to code on this god forsaken Arma engine.
    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 !
    ### Credits
    This mission file would not be possible without the help of these addons/people

    DayzEpochTeam | http://epochmod.com
    killzonekid | http://killzonekid.com
    extDB3 | https://bitbucket.org/torndeco/extdb3/wiki/Home
    ebayShopper | https://github.com/ebayShopper/TestKit
    JasonTM (for the latest beta AdminTools)| https://epochmod.com/forum/topic/44863-release-epoch-admin-tools-v-1107-test-branch/
  9. Thanks
    Sandbird got a reaction from Mig in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    extDB3 is a real b...h to work with. It uses premade SQL queries instead of allowing you to easily create your own queries inside .sqf files. I've played around with an asyncCall script (dayz_server\extDB\custom\asyncCall.sqf) trying to allow the use of my hive calls (ie: search for server_hiveReadWrite) but its not working well with VARCHAR types in the database. I had to use some very shameful ways to fix values coming from the database (varchar values) that were coming back inside quotes (ie: "[blah, blah]"   when it should come back as [blah, blah]).
    You can see my trickery inside \dayz_server\compile\server_publishVehicle2.sqf  line 46. I am manually removing the quotes and convert the string back to a proper arma array.
    If anyone knows how to properly tell extDB3 to return these values as arrays and not strings feel free to share it cause every time i see that ugly code i am pulling my hair :P
    The same goes for the server_monitor.sqf which spawns Hive Objects. I guess the biggest reason why it takes so long to spawn a lot of vehicles on from the db is because of this. Thats why i only leave like 30-50 vehicles in my db. It's pointless loading a full db with player bases etc.
    Edit: Oh also in the server_monitor.sqf i separate the player buildings from the epoch vehicles etc into 2 arrays. (_BuildingQueue + _objectQueue). So first i am spawning all the buildings and then all the vehicles...This way if a car is on the 2nd floor of a building it wont randomly spawn on the ground and then 2 floors spawn on top of that. Just something to keep in mind...i dont know if 10.6.2 is taking care of that bug some other way...i had that on my 10.5.1 server so i thought to keep using it since it's bug free. The separation is happening in line 80. If its a building it adds it into the Buildings array, otherwise in the vehicles array...and further down in line 344 it starts spawning first the Buildings and then the Vehicles.
    if ((_response select 2) isKindOf "ModularItems") then {  
  10. Like
    Sandbird reacted to ViktorReznov in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    I have been waiting for so long for this!
  11. Like
    Sandbird got a reaction from Mig in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Dayz.Epoch.1.0.62 - 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 would suggest to have a maximum of 100 objects in your object_data table for faster results.
    Took 5 min to load 10000 objs from my real database, so also make sure you dont go crazy with the MaxVehicleLimit, MaxDynamicDebris values in the init.sqf 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! (dynamic weather, default loadouts, custom scripts etc) 2 setups. A default 3d editor player with a default loadout 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, character update, events, stats...etc) New Features!
    All .FSM files have been converted to .SQF meaning the mission acts as a full fledged server / client merge. New character creation has been ignored though, so the server expects that the client that is about to connect exists in the database. The server will start, wait for a 'fake client connection to happen' (you pressing the Preview button), and then it will load your character from the database, spawn Hive objects and create new based on your MaxVehicleLimit values etc, then initialize the events and finally spawn the character to his worldspace location. Use AdminTools to spawn any Perm, Temp vehicle you want, including buildings, crates etc. Building objects is working as expected with a little AddAction trick. Unfortunately the primary display (eg: findDisplay 46) isnt working inside the editor. That means that building stuff or placing objects is very hard to do since we can't 'capture' keystrokes.
    Further details below after the Installation instructions. Arma2Net is not allowed by Battleye anymore, so i am using extDB3 now. 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 don't have a mysql server on your pc...i suggest you get WampServer. It's the easiest php/mysql server out there.
    Installation
    Head over to the GitHub where the project is. Click Download on the right sidebar, and extract the rar file. Copy the 3d.live1062.DayzEpochTemplate.Chernarus mission file in your \My Documents\ArmA 2\missions\ folder If your active Arma profile is not the default one, then you probably should extract it in the \My Documents\ArmA 2 Other Profiles 2\missions\ folder, otherwise you won't be able to find the mission inside the editor. Copy everything inside "Arma2OA root folder" in your root Arma2OA folder (the same folder where @DayZ_Epoch_Server, 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). The tbbmalloc - tbbmalloc_x64.dll files are provided by extDB3. They shouldnt interfere with your normal game, but they are needed for the mission to be able to connect to your MySQL server. (Make a backup of your original ones if you want, just be safe.) EATbaseExporter is used by the AdminTools, and allows you to export bases to an .sqf format so you can import them afterwards to your server. Now edit -=START HIVE MISSION=-.bat which was placed in your Arma2 folder, and fix the paths to their proper values. If you are using DZLauncher then the @Dayz_Epoch folder is probably where i placed it myself.  Battleye needs to be disabled inside the editor otherwise the extDB3 addon will not work. The .bat is taking care of that. It will disable Battleye after 7 seconds. Depending on your machine, if you see that the time isn't sufficient, raise that value a little bit. A sample Database has been provided with me as a character and a basic loadout. You can of course use your own database, just remember to delete most of your Object_Data table vehicles. The more vehicles you have there, the longer it will take for the dayz_server to spawn them. If you just want to write a script independent of cars etc...why wait 5 minutes for the server to spawn 10000 vehicles :) Open "ArmaOA\@extDB\extdb3-conf.ini" and add your test database data there. I named the test SQL DB dayz_cherno [dayz_cherno] IP = localhost Port = 3306 Username = dayz Password = mypass123 Database = dayz_cherno # dayz_cherno is the name of the database (change it in both values) # localhost is your mysql server (could be an IP value as well) # 3306 your mysql port # dayz is your database username # mypass123 is your database password  
    When the game launches, press Alt+E, select Chernarus, then Load mission 3d.live1062.DayzEpochTemplate.Chernarus
    Open \My Documents\ArmA 2\missions\3d.live1062.DayzEpochTemplate.Chernarus\init.sqf
    Go to line 61 and start editing the values there. DB_NAME is the name of your database (same as the extdb3 config file).
    Add your PlayerUID value (same as the DB one) in line 72. (That the player you want to load from the database)
    Depending which map you want to use, you have to change the dayZ_instance variable and also the MarkerP values (line 62) based on your mission.sqm file. Its for the Hive to spawn random vehicles, roadblocks and mines at proper locations based on the map. Just read the comments there for how to get the values. Its really simple. Just copy paste stuff from your mission.sqm file.
    Default setup vs Database setup
    There are 2 ways of initializing your player.
    A live database player based on his UID in the character_data table (coordinates, medical states, inventory etc) A default 3d editor player with a basic loadout. (Ignores Hive Loadouts and initial vehicle spawns) Default setup (extDB3)
    [DefaultTruePreMadeFalse = true;] This option is now the default one, because it's so much easier to set up, plus a lot of things have changed in the 1062 Epoch version. I couldn't totally separate the server files from the client files, so in the end a Database is necessary for the Mission files to work properly. To setup your character with this method, leave DefaultTruePreMadeFalse to true;  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. Premade Character Setup
    [DefaultTruePreMadeFalse = false;] This setup DOES NOT initialize the character based on a database entry, or does any HIVE related queries on mission start. (like load objects etc). Instead it uses some premade stats that you set, and only uses the Database on updates (buy vehicles etc) The loadout of the player is set in the init.sqf in line 77  
    player setVariable ["CharacterID", "1", true]; // Set here the characterID of the player. It can be anything...just leave it 1 if you want. player setVariable ["playerUID", "111111", true]; // Set here the playerUID of the player you want to have. player setVariable["Z_globalVariable", 100000]; player setVariable["Z_BankVariable", 100000]; player setVariable["Z_MoneyVariable", 100000]; player setVariable["humanity", 11000]; player setVariable["humanKills", 10]; player setVariable["banditKills", 20]; player setVariable["zombieKills", 30]; player setVariable ["friendlies", ["222222","333333"], true]; //Both DZE_Friends and this must be set for friendlies to work properly DZE_Friends = ["222222","333333"]; Everything else should work fine with the database....like traders, salvaging, etc...Unfortunately since the 1062 ver had many differences from the 1051 one, i couldn't really make this Profile option a standalone one, without any Database interaction. So in order for you to minimize any errors in the log file, i would suggest you load my sample db file provided, and also change those CharacterID and PlayerUID values in PLAYER_Data and CHARACTER_Data tables to the ones you set up here, just in case.... The Premade character setup is for people that want to fast debug a script they are making and don't want to wait for the Hive to load all map objects and authenticate the player first. Further Details to change (in both Profile Cases)
    The description.ext, mission.sqf, mission.biedi files have your character's name in them. Just search for the word Sandbird in all of them and change it according to the PlayerName value you have in your Player_DATA table for your PlayerUID value.
    Example taken from description.ext. DONT change the actual My_Player text. The mission file needs that string to read what you typed in the name field.
    class My_Player { name="Sandbird"; face="Face20"; glasses="None"; speaker="Male01EN"; pitch=1.1; };  
    Important info
    Init.sqf values
    DefaultTruePreMadeFalse = true; // True: Read player's data from the database (based on UID), False: 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 Enable Keyboard actions (menu option) // (findDisplay 46) wont work inside the editor. That means that building stuff or placing objects is very hard to do since we cant 'capture' keystrokes. I kinda fixed this with a trick. In order to build something first you have to initiate the building action (holding the object in your hands) and then scroll with your mouse wheel and select Enable Keyboard actions. This will create a layer on your screen capturing your keystrokes thus allowing you to change orientations etc. Pressing ESC twice after and it will close the fake display and return to normal play mode. You will have to do this every time you want to build something. Related to coding
    Since the Editor has some limitations because its not a real 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.  Of course the player value is just an example here. If you were inside a loop and it had (getPlayerUID _x) then you have to rewrite it like this: (_x getVariable["PlayerUID",0]) findDisplay 46 does not work in the editor. If you are using/making a script that uses Display 46 try using my Enable Keyboard action. It might work in your case. publicvariableServercommands don't exist in the editor. There is no server to accept the command. If you want to use addpublicvariableeventhandler you can do it with call/spawn commands. You can find the handlers usually in the PublicEH.sqf.
    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]; publicVariableServer "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. In this case search for PVDZE_plr_Save in the PublicEH file and check the call it makes in the end. You could also change the publicVariableServer to publicVariable. That should work inside the editor. But keep in mind these changes wont work on the live server, since one command broadcasts something to the server while the other just to the client running it. I would suggest you keep the original value and do the PublicEH call instead, marking it down with some debug comments next to it, so when you are done and want to transfer the files to your live server you just remove the call and everything should work as expected.
    Don't forget to change the paths when you are adding addons to test/modify them. For example, notice the differences here:  player_switchModel = compile preprocessFileLineNumbers "dayz_code\compile\player_switchModel.sqf"; player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf"; The first line will look up for player_switchModel.sqf inside the editor mission files, while the 2nd one will go to the @Dayz_Epoch map file and get the .sqf file. Same thing applies for the dayz_server files (server_functions.sqf). Once you are done with your script and you have added new compile lines, you need to fix them back to their proper values before you upload them to your live server.
      If you are missing any BIS_fnc functions then check the folder dayz_code\system\functions and see if it's available there to include it in the compiles.sqf. Set DZEdebug = true;  in the init.sqf. And ALWAYS check your RPT log file for debugging. Its located at : %AppData%\Local\ArmA 2 OA folder. 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've included a simple Fireworks script i made a while back only this time i used some better effects taken from aliascartoons work. Just add a 'SMAW_HEDP' into your inventory and right click on it to test it out. Here is how the old script used to look like Fireworks. Also you'll find a little 'hat script' in the files, just right click a 'IRStrobe' item to add a hat to your player. Both script were written inside the editor using the mission file above...just a small example to show you how easy it is to write code there. The @extDB folder contains a folder called debug_files. These .dlls (when replaced the ones provided) activate a more detailed log file (found under arma 2 operation arrowhead\logs folder). It will show ALL MySQL queries going in/out of the database. Very useful if you are running any custom SQL queries and the RTP log file isn't enough.
    Final Notes
    These are heavily modified files...Dont overwrite them with your own files. Add to them instead of replacing them.
    If you are writing scripts that dont require the server to restart, then you can just go to 2D editor and press Preview again after you make the changes. No need to hit Restart. As long as you are doing changes that doesnt affect the Hive loading you can basically run things on the fly. For example in the init.sqf at the bottom i added a Add BankMonkey example. That command just loads the custom\money.sqf and shows a simple extDB3 example on how to select/update a DB table. Since this command doesnt require the server to restart, you can just hit Preview, test things out, and if you want to make changes, go back to 2D Editor, edit your changes in the money.sqf file and hit Preview again. No need to hit Restart and wait for the dayz_server functions to do their thing again.
    The whole purpose of this project was to not waste any more time trying to code on this god forsaken Arma engine.
    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 !
    ### Credits
    This mission file would not be possible without the help of these addons/people

    DayzEpochTeam | http://epochmod.com
    killzonekid | http://killzonekid.com
    extDB3 | https://bitbucket.org/torndeco/extdb3/wiki/Home
    ebayShopper | https://github.com/ebayShopper/TestKit
    JasonTM (for the latest beta AdminTools)| https://epochmod.com/forum/topic/44863-release-epoch-admin-tools-v-1107-test-branch/
  12. Like
    Sandbird reacted to Airwaves Man in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Damn dude thats what I was waiting for a long long time. Thank you so much.
  13. Like
    Sandbird reacted to Mig in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Thanks Sandbird 
     
  14. Thanks
    Sandbird got a reaction from Airwaves Man in [Release] Dayz.Epoch.1062.3d.Editor.Live.Mission.With.Database.Interaction   
    Dayz.Epoch.1.0.62 - 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 would suggest to have a maximum of 100 objects in your object_data table for faster results.
    Took 5 min to load 10000 objs from my real database, so also make sure you dont go crazy with the MaxVehicleLimit, MaxDynamicDebris values in the init.sqf 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! (dynamic weather, default loadouts, custom scripts etc) 2 setups. A default 3d editor player with a default loadout 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, character update, events, stats...etc) New Features!
    All .FSM files have been converted to .SQF meaning the mission acts as a full fledged server / client merge. New character creation has been ignored though, so the server expects that the client that is about to connect exists in the database. The server will start, wait for a 'fake client connection to happen' (you pressing the Preview button), and then it will load your character from the database, spawn Hive objects and create new based on your MaxVehicleLimit values etc, then initialize the events and finally spawn the character to his worldspace location. Use AdminTools to spawn any Perm, Temp vehicle you want, including buildings, crates etc. Building objects is working as expected with a little AddAction trick. Unfortunately the primary display (eg: findDisplay 46) isnt working inside the editor. That means that building stuff or placing objects is very hard to do since we can't 'capture' keystrokes.
    Further details below after the Installation instructions. Arma2Net is not allowed by Battleye anymore, so i am using extDB3 now. 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 don't have a mysql server on your pc...i suggest you get WampServer. It's the easiest php/mysql server out there.
    Installation
    Head over to the GitHub where the project is. Click Download on the right sidebar, and extract the rar file. Copy the 3d.live1062.DayzEpochTemplate.Chernarus mission file in your \My Documents\ArmA 2\missions\ folder If your active Arma profile is not the default one, then you probably should extract it in the \My Documents\ArmA 2 Other Profiles 2\missions\ folder, otherwise you won't be able to find the mission inside the editor. Copy everything inside "Arma2OA root folder" in your root Arma2OA folder (the same folder where @DayZ_Epoch_Server, 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). The tbbmalloc - tbbmalloc_x64.dll files are provided by extDB3. They shouldnt interfere with your normal game, but they are needed for the mission to be able to connect to your MySQL server. (Make a backup of your original ones if you want, just be safe.) EATbaseExporter is used by the AdminTools, and allows you to export bases to an .sqf format so you can import them afterwards to your server. Now edit -=START HIVE MISSION=-.bat which was placed in your Arma2 folder, and fix the paths to their proper values. If you are using DZLauncher then the @Dayz_Epoch folder is probably where i placed it myself.  Battleye needs to be disabled inside the editor otherwise the extDB3 addon will not work. The .bat is taking care of that. It will disable Battleye after 7 seconds. Depending on your machine, if you see that the time isn't sufficient, raise that value a little bit. A sample Database has been provided with me as a character and a basic loadout. You can of course use your own database, just remember to delete most of your Object_Data table vehicles. The more vehicles you have there, the longer it will take for the dayz_server to spawn them. If you just want to write a script independent of cars etc...why wait 5 minutes for the server to spawn 10000 vehicles :) Open "ArmaOA\@extDB\extdb3-conf.ini" and add your test database data there. I named the test SQL DB dayz_cherno [dayz_cherno] IP = localhost Port = 3306 Username = dayz Password = mypass123 Database = dayz_cherno # dayz_cherno is the name of the database (change it in both values) # localhost is your mysql server (could be an IP value as well) # 3306 your mysql port # dayz is your database username # mypass123 is your database password  
    When the game launches, press Alt+E, select Chernarus, then Load mission 3d.live1062.DayzEpochTemplate.Chernarus
    Open \My Documents\ArmA 2\missions\3d.live1062.DayzEpochTemplate.Chernarus\init.sqf
    Go to line 61 and start editing the values there. DB_NAME is the name of your database (same as the extdb3 config file).
    Add your PlayerUID value (same as the DB one) in line 72. (That the player you want to load from the database)
    Depending which map you want to use, you have to change the dayZ_instance variable and also the MarkerP values (line 62) based on your mission.sqm file. Its for the Hive to spawn random vehicles, roadblocks and mines at proper locations based on the map. Just read the comments there for how to get the values. Its really simple. Just copy paste stuff from your mission.sqm file.
    Default setup vs Database setup
    There are 2 ways of initializing your player.
    A live database player based on his UID in the character_data table (coordinates, medical states, inventory etc) A default 3d editor player with a basic loadout. (Ignores Hive Loadouts and initial vehicle spawns) Default setup (extDB3)
    [DefaultTruePreMadeFalse = true;] This option is now the default one, because it's so much easier to set up, plus a lot of things have changed in the 1062 Epoch version. I couldn't totally separate the server files from the client files, so in the end a Database is necessary for the Mission files to work properly. To setup your character with this method, leave DefaultTruePreMadeFalse to true;  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. Premade Character Setup
    [DefaultTruePreMadeFalse = false;] This setup DOES NOT initialize the character based on a database entry, or does any HIVE related queries on mission start. (like load objects etc). Instead it uses some premade stats that you set, and only uses the Database on updates (buy vehicles etc) The loadout of the player is set in the init.sqf in line 77  
    player setVariable ["CharacterID", "1", true]; // Set here the characterID of the player. It can be anything...just leave it 1 if you want. player setVariable ["playerUID", "111111", true]; // Set here the playerUID of the player you want to have. player setVariable["Z_globalVariable", 100000]; player setVariable["Z_BankVariable", 100000]; player setVariable["Z_MoneyVariable", 100000]; player setVariable["humanity", 11000]; player setVariable["humanKills", 10]; player setVariable["banditKills", 20]; player setVariable["zombieKills", 30]; player setVariable ["friendlies", ["222222","333333"], true]; //Both DZE_Friends and this must be set for friendlies to work properly DZE_Friends = ["222222","333333"]; Everything else should work fine with the database....like traders, salvaging, etc...Unfortunately since the 1062 ver had many differences from the 1051 one, i couldn't really make this Profile option a standalone one, without any Database interaction. So in order for you to minimize any errors in the log file, i would suggest you load my sample db file provided, and also change those CharacterID and PlayerUID values in PLAYER_Data and CHARACTER_Data tables to the ones you set up here, just in case.... The Premade character setup is for people that want to fast debug a script they are making and don't want to wait for the Hive to load all map objects and authenticate the player first. Further Details to change (in both Profile Cases)
    The description.ext, mission.sqf, mission.biedi files have your character's name in them. Just search for the word Sandbird in all of them and change it according to the PlayerName value you have in your Player_DATA table for your PlayerUID value.
    Example taken from description.ext. DONT change the actual My_Player text. The mission file needs that string to read what you typed in the name field.
    class My_Player { name="Sandbird"; face="Face20"; glasses="None"; speaker="Male01EN"; pitch=1.1; };  
    Important info
    Init.sqf values
    DefaultTruePreMadeFalse = true; // True: Read player's data from the database (based on UID), False: 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 Enable Keyboard actions (menu option) // (findDisplay 46) wont work inside the editor. That means that building stuff or placing objects is very hard to do since we cant 'capture' keystrokes. I kinda fixed this with a trick. In order to build something first you have to initiate the building action (holding the object in your hands) and then scroll with your mouse wheel and select Enable Keyboard actions. This will create a layer on your screen capturing your keystrokes thus allowing you to change orientations etc. Pressing ESC twice after and it will close the fake display and return to normal play mode. You will have to do this every time you want to build something. Related to coding
    Since the Editor has some limitations because its not a real 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.  Of course the player value is just an example here. If you were inside a loop and it had (getPlayerUID _x) then you have to rewrite it like this: (_x getVariable["PlayerUID",0]) findDisplay 46 does not work in the editor. If you are using/making a script that uses Display 46 try using my Enable Keyboard action. It might work in your case. publicvariableServercommands don't exist in the editor. There is no server to accept the command. If you want to use addpublicvariableeventhandler you can do it with call/spawn commands. You can find the handlers usually in the PublicEH.sqf.
    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]; publicVariableServer "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. In this case search for PVDZE_plr_Save in the PublicEH file and check the call it makes in the end. You could also change the publicVariableServer to publicVariable. That should work inside the editor. But keep in mind these changes wont work on the live server, since one command broadcasts something to the server while the other just to the client running it. I would suggest you keep the original value and do the PublicEH call instead, marking it down with some debug comments next to it, so when you are done and want to transfer the files to your live server you just remove the call and everything should work as expected.
    Don't forget to change the paths when you are adding addons to test/modify them. For example, notice the differences here:  player_switchModel = compile preprocessFileLineNumbers "dayz_code\compile\player_switchModel.sqf"; player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf"; The first line will look up for player_switchModel.sqf inside the editor mission files, while the 2nd one will go to the @Dayz_Epoch map file and get the .sqf file. Same thing applies for the dayz_server files (server_functions.sqf). Once you are done with your script and you have added new compile lines, you need to fix them back to their proper values before you upload them to your live server.
      If you are missing any BIS_fnc functions then check the folder dayz_code\system\functions and see if it's available there to include it in the compiles.sqf. Set DZEdebug = true;  in the init.sqf. And ALWAYS check your RPT log file for debugging. Its located at : %AppData%\Local\ArmA 2 OA folder. 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've included a simple Fireworks script i made a while back only this time i used some better effects taken from aliascartoons work. Just add a 'SMAW_HEDP' into your inventory and right click on it to test it out. Here is how the old script used to look like Fireworks. Also you'll find a little 'hat script' in the files, just right click a 'IRStrobe' item to add a hat to your player. Both script were written inside the editor using the mission file above...just a small example to show you how easy it is to write code there. The @extDB folder contains a folder called debug_files. These .dlls (when replaced the ones provided) activate a more detailed log file (found under arma 2 operation arrowhead\logs folder). It will show ALL MySQL queries going in/out of the database. Very useful if you are running any custom SQL queries and the RTP log file isn't enough.
    Final Notes
    These are heavily modified files...Dont overwrite them with your own files. Add to them instead of replacing them.
    If you are writing scripts that dont require the server to restart, then you can just go to 2D editor and press Preview again after you make the changes. No need to hit Restart. As long as you are doing changes that doesnt affect the Hive loading you can basically run things on the fly. For example in the init.sqf at the bottom i added a Add BankMonkey example. That command just loads the custom\money.sqf and shows a simple extDB3 example on how to select/update a DB table. Since this command doesnt require the server to restart, you can just hit Preview, test things out, and if you want to make changes, go back to 2D Editor, edit your changes in the money.sqf file and hit Preview again. No need to hit Restart and wait for the dayz_server functions to do their thing again.
    The whole purpose of this project was to not waste any more time trying to code on this god forsaken Arma engine.
    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 !
    ### Credits
    This mission file would not be possible without the help of these addons/people

    DayzEpochTeam | http://epochmod.com
    killzonekid | http://killzonekid.com
    extDB3 | https://bitbucket.org/torndeco/extdb3/wiki/Home
    ebayShopper | https://github.com/ebayShopper/TestKit
    JasonTM (for the latest beta AdminTools)| https://epochmod.com/forum/topic/44863-release-epoch-admin-tools-v-1107-test-branch/
  15. Like
    Sandbird got a reaction from sjd6795 in ...Something's Cooking!   
  16. Like
    Sandbird got a reaction from seelenapparat in ...Something's Cooking!   
  17. Thanks
    Sandbird got a reaction from Zoranth in [UPDATE 1.6.+] Walk Amongst The Dead   
    Awesome! You got it working in 1.6 ! :)
    ahaha nice. Enjoy guys :) I'll add a link to the original thread that the mod is continued here.
    Thanks juandayz for creds and continuing this addon :)
  18. Like
    Sandbird reacted to juandayz in THE Z-IMS   
    HELLO. THIS IS THE SECOND VERSION TO TEST. ITS FULLY WORKING JUST RIGHT NOW. BUT NEEDS SOME TESTS IN REAL SERVERS. SO I GONNA POST  HERE TO EVERYONE WHO WANNA USE THIS MOD IN HES SERVER AND WANNA SHARE HERE ABOUT HIS EXPERIENSE (cause lag, rpt errors, etc).
    https://ibb.co/jkBAo5
    *WHAT ITS THIS: 
    *Players need piss: ( every time you drink thers a chance to need pee. Get a tree to make pee)
    *Players need poop: ( every time you eat thers a chance to need poop. Get a tree to make pee) (use toilet paper and waterbottles to get a better clean)
    *Players need fix tooths: ( every time you drink or eat thers a chance to get a broken/rotten tooth) (use a knife, string and nails to fix your tooth) (use antibacterial wipe and antibiotics to get a better fix)
    *Players need sex:  (every time players spawns thers a chance to need sex) (sex alone, sex with death animals, dead zeds, others players). (get a tent to masturbate if u don like zeds,humans or animals)
    *Woman characters can be pregnant: (pregnancy gonna made loose blood)
    *Womans need abort her child: (you will need the sames items to fix tooth to made your abort)
    *Randoms Heart attacks on players: (get epinephrine to stop the heart attack)
     
    Tnks to @iben (take a look on this guy i think he gonna be the next zupa here) for find some errors and fix them. Tnks to @Hooty ,  @S4M  @Kimarik for tests and ideas They was very helpfull. Tnks to @oldmatechoc for helpme with icon positions. And Tnks to @Sandbird this idea becomes to me when i was updating his walk amongst dead mod, So this mod have a strong base on his code.
     
    DOWNLOAD: http://www.mediafire.com/file/o9eb7h99202zv5s/zims.rar
     
    UNINSTALL THE FIRST TEST REALIZE  (only if u already install it) TO GET THE LAST VERSION.
     
     
    *INSTALL THE LAST VERSION
     
    YOU GONNA NEED A CUSTOM VARIABLE.sqf and CUSTOM COMPILES.sqf and CUSTOM FN_SELFACTIONS.sqf   (i guess you alredy have one or know how to do it.)
    1-Open your init.sqf and at VERY BOTTOM PASTE:
    2-Open your description.ext  
     
    3-Custom Compiles.sqf
    4-In your variables.sqf (custom)
    5-Changing your custom PublicEH.sqf
    6-In your custom fn_selfactions.sqf
    7- Paste the zims folder into mpmissions\yourinstance\scripts\
  19. 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

     
  20. Like
    Sandbird reacted to juandayz in [UPDATE 1.6.+] Walk Amongst The Dead   
    my respects BIG LEGEND! your old post was added in main post.
  21. Like
    Sandbird got a reaction from juandayz in [UPDATE 1.6.+] Walk Amongst The Dead   
    Awesome! You got it working in 1.6 ! :)
    ahaha nice. Enjoy guys :) I'll add a link to the original thread that the mod is continued here.
    Thanks juandayz for creds and continuing this addon :)
  22. Like
    Sandbird got a reaction from Airwaves Man in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Thanks for this Schalldampfer! 
    Can someone verify this ?   So i can add it to the 1st page ?
    Yeah i know about the sounds :P  Who do you think told the the epoch team about the bug in the config.bin  hehe.
  23. 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 :)
  24. Like
    Sandbird got a reaction from Richie in [Release] Walk Amongst The Dead - (Hide from zombies like "The Walking Dead")   
    Hi Viktor
    Although i am not playing dayz anymore, i can spot some things still in the log to help out :)

    Error Undefined variable in expression: dayz_combat
    I guess dayzepoch stopped using dayz_combat to see if the player is in combat mode. You have to find the new global variable that represents this status and MASS REPLACE in all of my script files.

    Error in expression <ty = (player getVariable["humanity",0]) + _change;
    hmmmm, i guess hummanity is also not set on the player anymore. Probably you should SET the hummanity on the player before you get in this line of code.

    File z\addons\dayz_code\compile\player_humanityChange.sqf, line 5
    As you can see from this error, its obvious that hummanity has changed somehow. A good start would be to open that .sqf file (it is in the addons map files) and see what changed.

    Warning Message: Resource title zCamoStatusGUI not found
    You probably messed up the copy/paste in the RscTitles place, and it cant find the zCamoStatusGUI variable

    Error Undefined variable in expression: _displayz
    Same thing....dayzepoch removed or changed _displayz varable when it comes to the GUI interface...you'll have to find the new variable
    Hope that helps :)
  25. Like
    Sandbird got a reaction from theduke in [Release] Manual execution of Epoch Events   
    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 :)
     
×
×
  • Create New...