Axe Cop Posted December 13, 2013 Report Share Posted December 13, 2013 (edited) My new mod may change the way you play DayZ, simply put this mod enables all players on the server to get the choice of using multiple characters (without having to buy multiple copies of ArmA2:CO :P). I've set up a prototype on my test server with a 3 character selection dialog (see picture below), this may be improved but the base mechanics itself are working great so far. So when you join a server after the loading screen you see a dialog like this: you have to chose one of 3 character slots every time you log into the server, each character slot is completely independent (different humanity and other stats, like different players). the slot count isn't static but I though 3 is a good start, admins can change the character selection dialog to a different number of slots, if you want you can have 100 slots for each player. :D This mod can't be archived with a little script, but I've tried to made the installation as easy as possible. For an overview this is what I've done to get this mod working: Database schema: added one extra column "Slot" to the "character_data" table (the database stays fully compatible to the default HiveExt.dll) Custom HiveExt.dll to add a new method for loading all character data of a player (CHILD:100), also a small change to the current load player method to support multiple characters (CHILD:101). I could have made completely new methods for the login process, but this way only a very few modifications are necessary in the Hive code and the script files, but this also means my modified HiveExt.dll is not compatible with servers who don't have the "Slot" column in the "character_data" table one new script for the server and a small change in the server_playerLogin.sqf (to send the slot id to the hive) for the client files I've changed the player monitor to inject the character selection before the login process (see player_monitor.fsm changes below) To visualize the changes made to the login process, take a look at this state machine diagram of the player_monitor.fsm (changes are highlighted in green): Download latest version for Epoch 1.0.5 and 1.0.5.1: http://dl.bintray.com/vos/dayz/multichar1.3.3.zip Older versions are available here (for other Epoch version since 1.0.3.1). Installation instructions I've tried to make the installation as easy as possible and still do it the proper way and change the files like the Epoch devs would do it. Some steps could be changed and the code simply be put in the init.sqf instead of changing the Epoch files, if you have some experience with ArmA script you can do that but if you follow my instructions it is the best way to do it like this in my opinion. Pre-requirements: a PBO manager and basic knowledge of ArmA script editing. Note: I've added all changed files to the download package, so you can see how they should look like with the changes applied. If you didn't make any custom changes to those files you can also just use them instead of following my instructions to change the files below. run the SQL query to add the "Slot" column to the "Character_DATA" table in your Epoch database:ALTER TABLE `Character_DATA` ADD COLUMN `Slot` TINYINT UNSIGNED NOT NULL DEFAULT 1 AFTER `PlayerUID`; copy the file HiveExt.dll to the @DayZ_Epoch_Server folder (overwrite the Epoch file) Note: the source code of the HiveExt with my changes can be found here. unpack your dayz_server.pbo and copy the file server_playerCharacters.sqf to the compile sub-folder open the file compile\server_playerLogin.sqf, around line 47 replace_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName]; with _key = format["CHILD:101:%1:%2:%3:%4:",_playerID,dayZ_instance,_playerName,_this select 2]; open the file init\server_functions.sqf and add the lineserver_playerCharacters = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerCharacters.sqf"; after the line 9 BIS_Effects_Burn = {}; repack your dayz_server.pbo unpack your mission.pbo (e.g. DayZ_Epoch_11.Chernarus.pbo) if necessary and copy the file RscDisplayCharacterSelect.hpp into the mission folder, open the file description.ext and add this line at the very bottom:#include "RscDisplayCharacterSelect.hpp" unpack your dayz_code.pbo (on your PC @DayZ_Epoch\addons\dayz_code.pbo) and copy the files init\publicEH.sqf and system\player_monitor.sqf to a "custom" folder in your mission folder (if you don't already have custom versions of those files), change the references to those files in your init.sqf to something like "custom\publicEH.sqf" and "custom\player_monitor.sqf" copy my custom file player_monitor.fsm to your "custom" folder (the changes in this file are not easy to reproduce, so it may be best you use my custom file instead of adding the changes yourself) open the file publicEH.sqf and add this line above the line starting with "PVDZE_plr_Login" (around line 54):"PVDZE_plr_Characters" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerCharacters}; open the file player_monitor.sqf and change the path to my custom player_monitor.fsm so that the line looks something like this:_id = [] execFSM "custom\player_monitor.fsm"; repack your mission.pbo if necessary That's it! Yeah I know not the easiest mod to install, but that is DayZ/Epoch.. I Hope I didn't forget anything, but I think that is all. :P Restrictions (since version 1.1) I've added two restrictions to minimize the possibilities for players to abuse quick character switching: character switch timeout - how often a player can switch to another living character (in minutes), the last used slot is always available and the player can also spawn fresh if he has a dead character or never used slot minimum distance to dead bodies of the same player - calculates the distance to previously died characters of the player (in meters), this will prevent the player from "stacking" two or more characters at the same place (like a base) and switch to another character if one dies There are global config variables for changing the default settings for the restrictions: DZE_CharacterSwitchTimeout = 30; // default 30 minutes timeout (0 to disable) DZE_CharacterMinDistance = 1000; // default 1000 meters min distance (0 to disable) You can add those variables to the config section in the init.sqf. Here a screenshot how it may look like with active restrictions: Disabled character slots are displayed with a red disabled button (cannot be pressed) with info text on the button. If one or more restrictions apply there is also be an info text displayed at the bottom of the screen. Note: at the moment there is no automatic timer or anything to count the timeout down, you have to manually press the refresh button to refresh the character data and last login time. Suggestions and ideas welcome. Also for the character selection dialog what do you like to see on there? Edited June 26, 2014 by Axe Cop cring0, Renegade2k6, Munkeskov and 19 others 22 Link to comment Share on other sites More sharing options...
Ghost Posted December 13, 2013 Report Share Posted December 13, 2013 Very interesting I might give it a try Link to comment Share on other sites More sharing options...
williamjbrown Posted December 13, 2013 Report Share Posted December 13, 2013 Very tempting to have a bandit account Hero and admin one... Hmmmmm. I have a couple players who like to play bandit and hero... Link to comment Share on other sites More sharing options...
Axe Cop Posted December 13, 2013 Author Report Share Posted December 13, 2013 Very tempting to have a bandit account Hero and admin one... Hmmmmm. I have a couple players who like to play bandit and hero... Yes that is possible of course, but with an admin character i dont know, since it is still the same player id and GUID you have to check for playerUID and slot-ID :D I think there are many use cases for this, you could have 1 char in your base and one in elekro for PvP or something.. also if you die just use another char :P one problem might be if you have 2+ chars in your base or whatever and you die and can just switch chars, thats why there has to be some sort of countdown timer how often you can switch chars and when? Link to comment Share on other sites More sharing options...
williamjbrown Posted December 13, 2013 Report Share Posted December 13, 2013 Definitely, could assault a base and keep swapping characters which could be in essence TP'ing. Love the concept. Should be a large timer. Maybe 12 hours? This way it can stop people from quickly swapping out. If you die then yes your other character can be used? I'm just throwing idea's at you. Link to comment Share on other sites More sharing options...
MatthewK Posted December 13, 2013 Report Share Posted December 13, 2013 I've set up myself and another admin on my server with an option to go undercover and play along with Bandit AI's during missions, this is to give the players more of a challenge. The AI are just too dumb no matter how high you set them lol. So anyway, I'm wondering could this system be used just by Admins and maybe have one of the accounts immune to logging for deaths and kills ? Say as an undercover Bandit AI , I kill player Z, I'd like this NOT to be logged for viewing at the notice boards etc, and on the other side if someone kills me I'd like it also not to be logged and for my dead body to be treated just like the AIs .. Would be a nice feature :p Link to comment Share on other sites More sharing options...
Axe Cop Posted December 13, 2013 Author Report Share Posted December 13, 2013 I've set up myself and another admin on my server with an option to go undercover and play along with Bandit AI's during missions, this is to give the players more of a challenge. The AI are just too dumb no matter how high you set them lol. So anyway, I'm wondering could this system be used just by Admins and maybe have one of the accounts immune to logging for deaths and kills ? Say as an undercover Bandit AI , I kill player Z, I'd like this NOT to be logged for viewing at the notice boards etc, and on the other side if someone kills me I'd like it also not to be logged and for my dead body to be treated just like the AIs .. Would be a nice feature :P Well possible yes, but maybe not within the scope of this mod haha, you have to change the files where the kill messages are send and add exceptions for your admin characters. And about the timer I have to think about how to do that, should players be able to switch characters when they die? If you get killed in your base and can immediately switch do another char can also be a problem.. I need ideas how and when should players be able to switch character slots? Link to comment Share on other sites More sharing options...
MatthewK Posted December 13, 2013 Report Share Posted December 13, 2013 Well possible yes, but maybe not within the scope of this mod haha, you have to change the files where the kill messages are send and add exceptions for your admin characters. And about the timer I have to think about how to do that, should players be able to switch characters when they die? If you get killed in your base and can immediately switch do another char can also be a problem.. I need ideas how and when should players be able to switch character slots? Personally, if I was running this on my server I would only want players to be able to change character once per server restart. Or at the most once every hour, but certainly not any less. So the short answer is No, I don't think they should be able to switch characters if they die :) Link to comment Share on other sites More sharing options...
Axe Cop Posted December 13, 2013 Author Report Share Posted December 13, 2013 Update: Improved character selection dialog (see picture in the original post). It also shows dead characters now. I think I will release the source files and instructions tomorrow. :) Link to comment Share on other sites More sharing options...
fr1nk Posted December 13, 2013 Report Share Posted December 13, 2013 Very cool! :) Link to comment Share on other sites More sharing options...
OtterNas3 Posted December 13, 2013 Report Share Posted December 13, 2013 Impressive Axe, just impressive! Would like to help testing if you need. Gruß, Otter Link to comment Share on other sites More sharing options...
boyd Posted December 14, 2013 Report Share Posted December 14, 2013 Very nice!! can't wait B) Link to comment Share on other sites More sharing options...
Bags2247 Posted December 14, 2013 Report Share Posted December 14, 2013 Damm Axe Cop, another fine script coming out of that head of yours.... Looks awesome BTW, if you need others testing it mate,I'm sure there are a few of us that are willing Bags edit I'd say that have a limit of one change per hour would be fine.....timed from when you changed last Link to comment Share on other sites More sharing options...
Guest Posted December 14, 2013 Report Share Posted December 14, 2013 that is awesome! id love to help testing it ! Link to comment Share on other sites More sharing options...
Axe Cop Posted December 14, 2013 Author Report Share Posted December 14, 2013 I'd say that have a limit of one change per hour would be fine.....timed from when you changed last yeah problem is that is not saved in the datebase at the moment, could of course be saved but that need additional change of the database and i want to keep it simple first, another way the server could save that temporarily so you can change the slot with every restart or "x" minutes or whatever condition, but onyl saved until server restart. Btw I was not home today, so didnt make much progress, I hope I get the first release finished tomorrow Link to comment Share on other sites More sharing options...
OmigaaaD Posted December 14, 2013 Report Share Posted December 14, 2013 I'm really looking forward to adding this to my servers! looks awesome! Link to comment Share on other sites More sharing options...
BushWookie Posted December 14, 2013 Report Share Posted December 14, 2013 i cannot wait for this but will i have to reset all my players current characters if i install this ? Link to comment Share on other sites More sharing options...
Axe Cop Posted December 14, 2013 Author Report Share Posted December 14, 2013 i cannot wait for this but will i have to reset all my players current characters if i install this ? Definately NO! All current characters will be assigned to the default slot 1! You lose nothing :) Link to comment Share on other sites More sharing options...
TheCapt Posted December 14, 2013 Report Share Posted December 14, 2013 I love this GREAT IDEA!!! Link to comment Share on other sites More sharing options...
Scenic Posted December 15, 2013 Report Share Posted December 15, 2013 Axe cop this is probably the most amazing thing I've seen yet, with a bit of editing to the screen (by myself :D) I will be implementing this to my servers! Renegade2k6 and Bags2247 2 Link to comment Share on other sites More sharing options...
Axe Cop Posted December 16, 2013 Author Report Share Posted December 16, 2013 (edited) Ok sorry guys I was busy today with some other stuff, but I just updated to epoch 1.0.3.1 and everything is working so I will release this mod tomorrow, finally! :D also updated the screenshot in the first post, this is how it looks for now... Edit: the mod is now live on my server, if you want check it out here: 176.57.142.101:2302 (if you have no character in that slot it will just show up empty for now, click on the "spawn" button to choose a slot, there are no restrictions yet so you can switch slots as much as you like by going to the lobby and join back in) Edited December 16, 2013 by Axe Cop MatthewK 1 Link to comment Share on other sites More sharing options...
williamjbrown Posted December 16, 2013 Report Share Posted December 16, 2013 Hey Axe Cop, love your work keep it going! Maybe you can incorporate some kind of skin feature in the login screen player selection menu. Like if you where wearing a ghillie last thats what it would display? Just an idea not important but would help remember your characters a bit more? William Link to comment Share on other sites More sharing options...
Axe Cop Posted December 16, 2013 Author Report Share Posted December 16, 2013 Well if it would be that easy do you think i would just show the guy from the gender selection? :p Problem is epoch has no images of the skins.. Of course you could do screenshots of all skins but then the images need to be placed in the mission file which might be some MB i think :/ Link to comment Share on other sites More sharing options...
williamjbrown Posted December 16, 2013 Report Share Posted December 16, 2013 Yes I did guess it would take a lot of extra work in order for something small no biggy! The facts on the character is very good idea. When will we see this released :D I always check up on your mods. :) Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted December 16, 2013 Report Share Posted December 16, 2013 Very cool concept. I will be watching this topic! Link to comment Share on other sites More sharing options...