Liven_28 20 Posted January 26, 2019 Can I acces in a config.cpp file to variable stored in an xml / txt / json file. I'm making a mode to tweak z health and I would like to make it easy for server admin to tweak the values without having to unpack the .pbo files. Share this post Link to post Share on other sites
Liven_28 20 Posted January 29, 2019 Is someone have an idea on that? Share this post Link to post Share on other sites
IMT 3190 Posted January 29, 2019 (edited) Enfusion has a JSON parser built-in. So yes, it's possible. Edited January 29, 2019 by IMT Share this post Link to post Share on other sites
Liven_28 20 Posted January 29, 2019 Do you know where can I find doc or examples on this subject. The only things I found concerne .c files not .cpp Share this post Link to post Share on other sites
lbmaster 21 Posted April 24, 2019 You have to look into the following file: DayZServer\dta\scripts\3_Game\tools\JsonfileLoader.c To load a file to an object: // Read from file JsonFileLoader<ref YOUR_CLASS_NAME>.JsonLoadFile( missionFolder + filename + ".json", this ); // Save to file JsonFileLoader<ref YOUR_CLASS_NAME>.JsonSaveFile( missionFolder + filename + ".json", this ); 1 Share this post Link to post Share on other sites
Liven_28 20 Posted April 26, 2019 Thank you for the answer I have already found the solution too But I'm stuck with another problem, I see you give good answer maybe you can help me modded class MissionGameplay { PlayerBase player; override void OnKeyPress( int key ) { super.OnKeyPress( key ); player = g_Game.GetPlayer(); PlayerIdentity identity = player.GetIdentity(); string playerID = identity.GetPlainId(); if (identity.GetPlainId() == "76561198015051115") { Print("TestLiven if ID OK "); } else { Print("TestLiven if ID NOT ok "); } } }; I can get the the "player", the "player identity" but the "PlayerID" is always empty I don't know why Share this post Link to post Share on other sites
lbmaster 21 Posted April 26, 2019 You will Not get the PlainId, because this method is called clientside. Only on the Serverside this would work. You have to request your PlainId via RPC when you connect to the Server and store it somewhere. I don't know if this is actually needed, or if this is done somewhere else anyway, but this is the way I got it working. The other solution would be to put this code on the Serverside if it is not necessary on clientside. LG LBmaster 1 Share this post Link to post Share on other sites
Liven_28 20 Posted April 26, 2019 Ok, I see, thank you very much, I have new things to try now. Last question, you seem have some answers Do you use the debug mode of the workbench scripting tool? I tryed to follow this : https://github.com/maxkunes/Enscript-Workbench-Project-Setup but it didn't work (I reported the issue but sadly no solution find). Or maybe you use another tool? Not being able to use breapoints/step by step execution to see varaibles value make me loose so much time... Share this post Link to post Share on other sites
lbmaster 21 Posted April 26, 2019 I don't use the debug mode of the workbench and I did not even know that this exists ^^. I am using notepad++ and try to make as few errors as possible. Not really fun to do things like this, but as far as I heard there is no real alternative and the Workbench is a bit buggy for me. Share this post Link to post Share on other sites
Liven_28 20 Posted April 26, 2019 ok It seem BI made a new tuto on that subject, I will take a look on it https://community.bistudio.com/wiki/DayZ:Workbench_Script_Debugging Share this post Link to post Share on other sites