Jump to content

Recommended Posts

Hello community! I've had this released on the Steam Workshop after a long development period, and it's about time I introduce it here. I hope communities will enjoy using this!

 

 

 

Hunter'z Persistency Module

 

 

What is it?

It's an "offline" (meaning, an SQL server or similar is NOT required) persistency framework for complex dynamic missions. It's meant as an alternative to existing solutions that use SQL servers. Instead of using a server/database approach, Hunter'z Persistency Module is fully SQF-based and outputs save data to text files in SQF-format. With this module you can avoid having complex infrastructure such as SQL servers and set up a persistent server with ease.

 

What can it do?

As a framework, it's got all the functionality you need to save any object, ammo crate, or vehicle and it's designed to be very easily customised so that you can save custom information such as object or mission variables. The module is focused mostly on realism/logistics scenarios, which means whatever you want to be persistent, you can set it up with ease and it will save every detail without compromise or room for exploits. For example, if you want to set a vehicle to be persistent, all you have to do is call one line of code and its state will be saved with all details down to the number of rounds it has in its guns.

Player units are also persistent by default, which means not only does it save your position or your gear upon logging out, but also how many bullets you have in the magazines inside your backpack, the damage on all your body parts including your full medical state if you use ACE, any map markers you have placed and whatever else comes to your mind.

 

The customisation of the framework is done by using API functions that you call either through scripts in your mission or live through the in-game admin console. These are all described together with setup instructions and further information in the manual that comes with the module. 

 

How does it work?

It uses Killzonekid's debug console dll extension (with his permission of course) to write to a save file on the server machine. Although the save file comes out as pure SQF, due to the limitations of extensions in Arma, large data arrays are split up into smaller ones and parsed back to normal by the module during saving and loading. This means that you might see a lot of text in your save files, but since it's all SQF, you actually have the option of editing the data manually by hand in case of any problems you have in your mission or things you want to change.

 

Saving to file is done automatically, through an auto-save system, for which you can set the save interval. The module is very performance friendly as it only uses resources when conducting a save, which usually takes less than a second. Player persistency is managed through connect/disconnect event handlers by the server, and other than these situations the module will not be using any CPU power!

 

Future work / TODO?

I plan on adding more features to the mod. One thing I will investigate soon is persistency of damage to map objects, such as buildings that are part of the map. No promises though!

 

 

Download link

You can obtain the mod through the Steam Workshop.

https://steamcommunity.com/sharedfiles/filedetails/?id=1207707864

 

 

 

Licensing

The module is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. You are free to share or build upon this work as long as you credit me as the original author. You may not sell this work or any derivatives of it, or financially profit from the use of the mod in any way.

by-nc-sa.png

 

Trivia

Although I've been working on Arma 2/3 for a few years now, this is the first mod that I got ready to be released for public use. I'm hoping to have release versions ready for my other mods, especially the AI mod I've been developing since 3 years, but we'll see... For more info on what I do, feel free to check out my repo:

https://github.com/KHunter-Arma

 

 

  • Like 8
  • Thanks 5

Share this post


Link to post
Share on other sites

This sounds very interesting, I am going to take a look today.

Share this post


Link to post
Share on other sites

can someone made a video tutorial how to setup the presistent mission? i know it's easy but for some reason it's not working for me after a placed a module on the map, added -filepatching, it's still dosen't save my position, my loadout and stuff like that, maybe i did something wrong, that's why i'm asking for video, thanks.

Share this post


Link to post
Share on other sites
16 hours ago, zagr said:

can someone made a video tutorial how to setup the presistent mission? i know it's easy but for some reason it's not working for me after a placed a module on the map, added -filepatching, it's still dosen't save my position, my loadout and stuff like that, maybe i did something wrong, that's why i'm asking for video, thanks.

 

Are you testing in single player, a hosted server or a dedicated server?

 

Did you read the manual about setting things up for the first time in a mission?

Share this post


Link to post
Share on other sites

dedicated server, yes i read manual, maybe i'm just stupid a bit 😄 and did something wrong i dunno, i just saying i prefer the video 😄

Share this post


Link to post
Share on other sites
5 hours ago, zagr said:

dedicated server, yes i read manual, maybe i'm just stupid a bit 😄 and did something wrong i dunno, i just saying i prefer the video 😄

 

ok 😄 Did you configure your "first time launch function" correctly? As mentioned in the manual, unless that's done, persistency won't work at all. That's your likely problem :)

Share this post


Link to post
Share on other sites

Hey!

 

I'm having a little bit of difficulty getting it to work properly. It works, but not quite. Can we talk on Discord or something? Would really appreciate the help!

Share this post


Link to post
Share on other sites
4 hours ago, Synchronized said:

Does anybody have a video tutorial? im dumb with these things

 

Would love that too lol

Share this post


Link to post
Share on other sites
On 1/20/2020 at 5:17 PM, MrCrazyDude115 said:

Hey!

 

I'm having a little bit of difficulty getting it to work properly. It works, but not quite. Can we talk on Discord or something? Would really appreciate the help!

 

Hey mate, I looked into the issue you reported. If you were loading the mod on the server not from the Steam workshop folder and in some other way, like loading it as a "local mod" or using it in your own mod pack, the module would fail to save because it wouldn't be able to find the .dll extension that it needs. I just released an update that prevents that from becoming a problem and from now on you should be able to load the mod from wherever you want. Though I recommend sticking to a Steam Workshop setup to keep up to date with latest changes and fixes! Let me know if it's working for you now.

 

Also I'd have no problem with any of you making a tutorial video when you get it to work. I have no time to do that myself though :)

  • Thanks 1

Share this post


Link to post
Share on other sites

Hello K.Hunter ! 

 

Unfortunately, I can't get your persistency module to work...

 

I'm launching your example mission : Hz_persistency_example.Altis so init.sqf is OK.

I'm having the "Warning Message: Script \Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf not found" error although i have the -filepatching parameter in my dedicated server (launching with TADST).

 

What I tried is to create the Hz_pers_saveFile.sqf in the targeted directory which cause the error to disappear but the persistency still doesnt work..

 

Can i have some help ?

 

Thanks ! 

Share this post


Link to post
Share on other sites
On 1/28/2020 at 3:37 AM, slayer_mop said:

Hello K.Hunter ! 

 

Unfortunately, I can't get your persistency module to work...

 

I'm launching your example mission : Hz_persistency_example.Altis so init.sqf is OK.

I'm having the "Warning Message: Script \Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf not found" error although i have the -filepatching parameter in my dedicated server (launching with TADST).

 

What I tried is to create the Hz_pers_saveFile.sqf in the targeted directory which cause the error to disappear but the persistency still doesnt work..

 

Can i have some help ?

 

Thanks ! 

 

Actually it's normal that you get that message when you don't have a save file in there from before. That message indicates that the module looked for a save file in case you have it, so it can load from it and continue from there. If you're running your mission (or the example mission, in this case) for the first time, you obviously don't have any previous save files, so the module just alerts you that there is no save file to load from and so it will just start off "fresh" with settings drawn out of your first time launch function. It doesn't mean that the module doesn't work! You have to wait until the time you specified and see if the module creates a new save file as described in the manual. If it does that, you got it working 🙂

 

Unfortunately there is no way to suppress that message, so when you run your mission for the first time you will get that message. It will only be on the server's side though, so players won't notice anything. 

  • Like 1

Share this post


Link to post
Share on other sites
23 hours ago, K.Hunter said:

 

Actually it's normal that you get that message when you don't have a save file in there from before. That message indicates that the module looked for a save file in case you have it, so it can load from it and continue from there. If you're running your mission (or the example mission, in this case) for the first time, you obviously don't have any previous save files, so the module just alerts you that there is no save file to load from and so it will just start off "fresh" with settings drawn out of your first time launch function. It doesn't mean that the module doesn't work! You have to wait until the time you specified and see if the module creates a new save file as described in the manual. If it does that, you got it working 🙂

 

Unfortunately there is no way to suppress that message, so when you run your mission for the first time you will get that message. It will only be on the server's side though, so players won't notice anything. 

 

Oooh OK ! 

I didn't understood how the process was really working depsite reading the Readme.

 

It's now crystal clear and works perfectly.

 

Thanks again for your help and for your awesome work.

  • Like 3

Share this post


Link to post
Share on other sites

Any idea if this works with hosted servers?

 

Only asking because my group uses a server hosted off my com to play ravage and starting to get a little tired of the issues I'm having with grad persistence. Nd inidbi2  is a little to complex for me. (I do most of my learning  the hard way)

Share this post


Link to post
Share on other sites
8 hours ago, Dragon_Valliere said:

Any idea if this works with hosted servers?

 

 

Off the top of my head, I can't think of a reason why it shouldn't work on a hosted server. But you're probably going to encounter a bit of an annoyance with the way the module saves. Your game will likely tab out and back in again for a brief second, or you'll at least notice your screen go dark for a second and back on again, when the module conducts a save. This is because it launches a separate console window while it saves and then closes it, and Windows will want to switch to that window when it launches. 

 

This has to do with how the extension is designed and at this point I have no intention of writing a new one from scratch (the current one is written by KillzoneKid, not me, so I can't change it). You can always run a dedicated server off your own computer instead of hosting (though you'll have to run it from a separate Windows user then so you don't encounter the same issue while playing) 😉

Share this post


Link to post
Share on other sites
5 hours ago, K.Hunter said:

Your game will likely tab out and back in again for a brief second, or you'll at least notice your screen go dark for a second and back on again, when the module conducts a save.

 

 

That seems like something I could live with.

 

Thanks for letting me know i plan to try it here in a bit, as of this post.

Share this post


Link to post
Share on other sites

Hey K.Hunter,

 

I'm testing a lot your mod recently for a campaign i'm making.

 

Here's the issues i've found

 

- When a vehicle has two turrets which are the same, for example a 3CB BAF land rover GPMG (UK3CB_BAF_LandRover_WMIK_GPMG_Sand_A), the save will only store one of the turrets, making the second one with no ammo after the load.

- When a player disconnect during the mission (between two saves), and reconnect right after :

  • On the first reconnection : The player will be teleported where he disconnected, medical state is loaded, but the loadout is erased and the default placed unit loadout is loaded (for example, if the playable unit place is a Survivor, loaded loadout will be Survivor's one)
  • On the second and next reconnections : the player is righlty loaded, loadout, medical and position is OK

 

Another thing I have in mind is the possibility to make a save with an ace interaction.

What i'm thinking of is the enable certain players to save the game (creating a new debug_console_* file) whenever they want.

 

What function of your mod should I call on the execute of ace interaction ? Hz_pers_fnc_saveGame.sqf ?

 

 

 

Thanks once again for your awesome work.

 

 

 

 

Share this post


Link to post
Share on other sites

@slayer_mop sorry I've been incredibly busy lately...

 

I'm surprised about the problem with the turrets. I'll take a look and see if I spot anything that can cause that, but I might need to ask you for more info about the configs of the vehicles that display this problem. 

 

The problem with units not loading in properly is also something I haven't come across but at first glance it sounds like an initialisation conflict. You should try to increase the wait time before loading the player's state on joining (there's a parameter for that in the module) or better use the manual load "switch". 

 

Yeah that is the function you would call to do a save. It needs to be called by the server though! I was also thinking about including such functionality in the mod, but I don't have time for that now. 

Share this post


Link to post
Share on other sites

Hey k.Hunter,

 

No problem, i've worked on the problem I encountered, indeed the problem with player reconnection seems to come with the initialisation. I've increased the wait time and players are now rightly loaded.

For the "vehicle with 2 identical turrets" problem, I was not able to correct it.

 

For the last thing that I was asking, i've come across and made what I wanted and a little bit more : 

 

To manually save i've made an Ace self interaction (in initPlayerLocal.sqf) for the logged Admin 

 

//Database
private _action = ["Database", "DataBase", "\A3\ui_f\data\igui\cfg\simpleTasks\letters\D_ca.paa", {}, {serverCommandAvailable "#logout" || !isMultiplayer}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToObject;

_action = ["Sauvegarde", "Sauvegarder", "\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa", {[] remoteExec ["Hz_pers_fnc_saveGame", 2]},{true}] call ace_interact_menu_fnc_createAction; 
[player, 1, ["ACE_SelfActions", "Database"], _action] call ace_interact_menu_fnc_addActionToObject;

 

I also wanted to have ACEX FORTIFY tool's object placed saved so i made this (initPlayerLocal.sqf) 

 

["acex_fortify_objectPlaced", {
	(_this select 2) remoteExec ["Hz_pers_API_addObject", 2];
}] call CBA_fnc_addEventHandler;

 

The problem with saving fortify tool's objects is that you can't "remove" them with the fortify tool after the mission loading. So i created another ace interaction wich is added to the objets in an array "opexObjets" (initPlayerLocal.sqf) 

 

opexObjets = ["Land_CamoNetB_NATO_EP1","Land_Camping_Light_off_F","Land_TentDome_F","Land_Sleeping_bag_F","Land_Campfire_F","Land_CampingTable_white_F","Land_BagFence_Round_F","SatelliteAntenna_01_Sand_F","Land_PortableWeatherStation_01_sand_F","OmniDirectionalAntenna_01_sand_F"];


_action = ["Delete Object", "Démonter l'objet", "\A3\ui_f\data\igui\cfg\simpleTasks\types\box_ca.paa", {(_this select 0) spawn btc_fnc_action_deleteobjetinit;}, {true}] call ace_interact_menu_fnc_createAction;
{[_x, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToClass;} foreach (opexObjets);

 

Hope this will help some players that wanted the same features ! 

 

Thanks again for your work and the many possibilities with it.

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks to Nomad who commented on the workshop page, I realised I introduced a pretty much fatal bug to the mod all the way back at the end of 2019. Any new save campaign that was initialised after December 2019 would be unable to load the save file after the mission was restarted. If anyone tried this mod and gave up because it didn't work, that would have been the reason. Sorry about that, but it was just reported to me after more than 2 years :)  The issue has been fixed now.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×