Arma 3
Hunter'z Persistency Module
104 kommentarer
Brominum 4. feb. kl. 6:17 
That did happen at the start of the mission as part of the logistics simulation we did. That's good to know though, I'll bear that in mind for next time & change the function. Thank you!
K.Hunter  [ophavsmand] 4. feb. kl. 2:59 
There is currently an issue where if you load a crate in a vehicle with ACE it will duplicate, since I never really added support for that. It’s something I plan on doing (soon(TM)). Did you load those crates in a vehicle?

In any case, you really shouldn’t be using addVehicle for crates. Adding crates has its own function for a reason so you should be using that instead.
Brominum 3. feb. kl. 21:32 
Hi, if you still support this addon, I've been having an issue where crates spawned in Zeus and added to the persistency via Hz_pers_API_addVehicle are duplicating when the server is shut down and the persistency loads again. These crates do not exist in 3den, but they are still somehow duplicating. It only happens once, too. If I go back and remove all the duplicated crates, it's good to go. Any pointers? If you want more involved troubleshooting feel free to add me and I can share the save.
K.Hunter  [ophavsmand] 24. nov. 2024 kl. 3:26 
@Pat Unfortunately that's not a case I ever thought about, and there is no native support for that.
Pat 23. nov. 2024 kl. 16:00 
Is there any option for including AI-teammates? We have a campaign in dev with teamswitch. Would be awsome for that. I tried to save the AI as "Objects". But then the ACE_Medical, rations and such is not restored (I did't check the AI inventory, so I don't know about ammo and other equipment...).
MaMaD_THUG 5. mar. 2024 kl. 11:15 
maow maow meow maow
:m67:
Isaac 23. okt. 2022 kl. 21:31 
Ah cool, fair enough.
K.Hunter  [ophavsmand] 23. okt. 2022 kl. 8:35 
Yes. It's also their gear
Isaac 22. okt. 2022 kl. 22:41 
Is player persistency their characters staying on the map when they disconnect?
K.Hunter  [ophavsmand] 22. okt. 2022 kl. 19:26 
It's written in mind to be run on both the client and the server, but I know at least one person tried to run it only serverside and he said it was working for him, except for player persistency. So it might work out if you don't care about player persistency, but not guarantees on anything ;)
Péter 18. okt. 2022 kl. 8:23 
this is a server side mod ? i mean -servermod=@HUNTERZ_DB or every client need to load that :)
[CPT] Nomad 20. maj 2022 kl. 11:57 
Neat! Are there any performance benefits to deleting them from the map and spawning them dynamically like this, or about the same you think?

Looks like that fixed it, though the trucks respawned without the Ace Arsenal attached to them, not sure how to fix that unfortunately.
K.Hunter  [ophavsmand] 20. maj 2022 kl. 11:32 
Yes, absolutely. Once you have a persistent mission going, you shouldn't have anything editor-placed that gets regenerated by itself with every restart. Ideally everything should be dynamically spawned.
[CPT] Nomad 20. maj 2022 kl. 11:27 
Oh I see why... it's duplicating them on their starting positions causing them to explode... hm... Should I remove them from the base mission and let the save file load it or is there another work around here to prevent them from spawning on the existing vehicles?
[CPT] Nomad 20. maj 2022 kl. 11:24 
That definitely fixed it... It's working now, only problem is it exploded every vehicle on the map :lunar2019crylaughingpig: https://prnt.sc/j5lq9P3_OBKH

Going to try setting the vehicle loading ...faster? See if that prevents it maybe? Vehicles exploded right after the loading completed
K.Hunter  [ophavsmand] 20. maj 2022 kl. 11:02 
Oh no there definitely shouldn't be any spaces there... Not sure why it does that when copying :\
[CPT] Nomad 20. maj 2022 kl. 10:56 
I think I found the issue. When copying car call Hz_pers_API_ addVehicle;
from the readme file it's putting a space between API_ and addVehicle; I think that's causing the issue unless that's intentional
[CPT] Nomad 20. maj 2022 kl. 10:16 
Hm that's how I had it the first time but it didn't seem to load the save file which is why I followed the syntax on the save crate version. Maybe I messed something up I'll try it again. To be clear though the Ammo1 call Hz_pers_API_ addVehicle; needs to be defined inside of the myFirstTimeLaunchFunction right?

The procedure I've been following is:

Set the init line you mentioned
Delete the .sqf
Load into the mission run the [] spawn Hz_pers_fnc_saveGame; command
Shut down the server, run the batch file to create the .sqf
Restart the server
K.Hunter  [ophavsmand] 20. maj 2022 kl. 9:36 
You're not using addVehicle right. It takes a single argument which should point to the vehicle object, as described in the manual. I'm going to do some guesswork here because I can't be sure of how you laid things out, but it should probably be like this instead:


Ammo1 call Hz_pers_API_ addVehicle;
Ammo2 call Hz_pers_API_ addVehicle;
Humvee1 call Hz_pers_API_ addVehicle;

etc. etc.
[CPT] Nomad 20. maj 2022 kl. 9:01 
I tried to follow the demo mission for making the vehicles persistent but this doesn't seem to load the file, I know i messed up somewhere but I just can't figure it out. Does this need to be in the vehicles init instead of like this?

if (isServer) then {

myFirstTimeLaunchFunction = {
["Ammo1",true] call Hz_pers_API_ addVehicle;
["Ammo2",true] call Hz_pers_API_ addVehicle;
["Humvee1",true] call Hz_pers_API_ addVehicle;
["Humvee2",true] call Hz_pers_API_ addVehicle;
["Humvee3",true] call Hz_pers_API_ addVehicle;
["Humvee4",true] call Hz_pers_API_ addVehicle;
["Gaz1",true] call Hz_pers_API_ addVehicle;
["Gaz2",true] call Hz_pers_API_ addVehicle;

};

};
K.Hunter  [ophavsmand] 19. maj 2022 kl. 14:46 
I think what you're lookıing for is the Hz_pers_API_ addVehicle function.
[CPT] Nomad 18. maj 2022 kl. 17:39 
Yeah it was my error. I was using a tree removal script that was taking a long time to process.

Working like a charm though!

Now i just need to figure out how to get the vehicles to save their location. If I understand the readme right I put this in the init:

-----------------------------------------

if (isServer) then {

myFirstTimeLaunchFunction = {

[“isLocked”, false] call Hz_pers_API_ addVehicleVariable;

};

};

or alternatively put

if (isServer) then {

myFirstTimeLaunchFunction = {

Truck1 call Hz_pers_API_ addVehicle;

};

};

-----------------------------------
Is that right?
K.Hunter  [ophavsmand] 18. maj 2022 kl. 16:22 
Glad you got it working! Not sure why it takes that long, if you've kept the load delay settings the way you had when you sent that screenshot. But it shouldn't cause any issues. Thank you actually for helping me discover this serious issue. I don't think I ever would have realised the problem if you hadn't said anything :)
[CPT] Nomad 18. maj 2022 kl. 14:09 
I'm sure this is something in my init causing this or maybe the load order, but the initial mission start takes about 1-2 minutes for it to load the save file, rejoining the server is instant though, not really a big deal since none of my members are on when I restart usually anyway.
[CPT] Nomad 18. maj 2022 kl. 14:05 
👏 ... I forgot I turned that on during debugging it. I think that fixed it!
K.Hunter  [ophavsmand] 18. maj 2022 kl. 12:52 
Are you sure you're using the client manual load switch correctly? I see you've ticked it in the module options, but I don't see it being triggered anywhere in your init.sqf, unless you have it done somewhere else. If you're not sure what I'm talking about, you should read the description for that option and maybe turn it off and use the time-based client load delay instead.
[CPT] Nomad 18. maj 2022 kl. 10:47 
https://mab.to/ejF9sGR93

Here is a link to the most recent debug, also an SQF file save of the same debug, my mission init.sqf and a screenshot of the module just to rule out my own retardation.
[CPT] Nomad 18. maj 2022 kl. 9:53 
Hm... Restarted the server running the Find Save and now it's writing the debug file to the main server, so all good there, but it doesn't seem to be reading the file still from the C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf location when loading back into the mission.
[CPT] Nomad 18. maj 2022 kl. 9:46 
https://prnt.sc/29GDM7Ejbs3y

Hmm... Unsure if I messed something up but I'm receiving the previous error (screen shot) in the editor, the command prompt opens in the editor but when launching in the server it doesn't seem to be opening the command prompt and generating the debug console, however it did generate a debug file on my client side machine when in the editor.
[CPT] Nomad 18. maj 2022 kl. 8:09 
Woot woot. I'll test it out and report back. Thanks for the quick update!
K.Hunter  [ophavsmand] 18. maj 2022 kl. 2:12 
Yep, there definitely was a very serious problem. Apparently I broke the ability to load any save file that was created after the end of 2019... :steamfacepalm: It should be fixed now though!

No wonder why no one was using this... xD

(you should delete all the save files you've got, and then it *should* work fine from there)
[CPT] Nomad 16. maj 2022 kl. 17:13 
Had to delete the Hz_pers_saveFile.sqf to generate a new one but here you go: https://mab.to/LAdjaQNE2
K.Hunter  [ophavsmand] 16. maj 2022 kl. 10:11 
Ok I think you might have actually caught a critical bug that I never had because I added the save file versioning system later on and made my own saves work with it manually. But I want to be sure first that I'm not mistaken so can you upload your current save file somewhere so I can take a look?
[CPT] Nomad 15. maj 2022 kl. 16:52 
I also can't delete the Hz_pers_saveFile.sqf file while the server is up so it's clearly being accessed, just not loading from it? Not sure.
[CPT] Nomad 15. maj 2022 kl. 14:30 
Okay so I changed it back to the default save location on the module and I'm still receiving this message. What's odd is that it also isn't loading the save file at all once its converted into the
Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf but when I remove the save file it continues to save/load current weapon/position as long as I don't restart the mission. When the server restarts with the save location set it starts me at the default mission load in location.

_index = _index + 1;

};

_resultingArray>
Error position: <_resultingArray>
Error Undefined variable in expression: _resultingarray
File x\Hz\Hz_mod_persistency\funcs\Hz_pers_fnc_structArrayElementParser.sqf..., line 58
Error in expression <};

if (Hz_pers_saveVar_saveFileVersion < 191201) then {

["Hz_pers_saveVar_save>
Error position: << 191201) then {

["Hz_pers_saveVar_save>
Error <: Type String, expected Number,Not a Number
File x\Hz\Hz_mod_persistency\funcs\Hz_pers_fnc_updateSaveDataVersion.sqf..., line 16
[CPT] Nomad 15. maj 2022 kl. 13:51 
You are correct, The full root folder is "C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\Hz_cfg\Hz_pers"

The reason I have Arma 3 and Arma 3 Server on the machine is because I was told that in order to run a dedicated server you had to have Arma 3 installed as well. If this isn't the case then that'll certainly free up some space on the HDD.

I'm going to try again with it running as "\Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf" but I remember it not working before. It seems like the addon is searching for it in the Arma 3 folder not the Arma 3 Server folder but I'm probably wrong.
K.Hunter  [ophavsmand] 15. maj 2022 kl. 11:00 
The last thing (about the version update) concerned me when I saw it because that really isn't supposed to happen, but I think it might be because you're not loading the save file from the right place. Why do you even have both an Arma 3 and arma 3 server folder on the same machine?
K.Hunter  [ophavsmand] 15. maj 2022 kl. 11:00 
Ok " \Arma 3 Server\Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf " looks weird to me because it starts with "Arma 3 Server". Where is your arma 3 (or arma 3 server) executable? If it's inside the "Arma 3 Server" folder, then that's your actual root folder, and you're not supposed to include that in the path. It should be like this "\Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf ", unless you have an extra folder called "Arma 3 server" that's WITHIN your root folder.

You can always ignore the following:

_resultingArray>
Error position: <_resultingArray>
Error Undefined variable in expression: _resultingarray
File x\Hz\Hz_mod_persistency\funcs\Hz_pers_fnc_structArrayElementParser.sqf..., line 58
Error in expression <};

This isn't an actual error, the log just like to report it because that function is allowed to return nil values and Arma doesn't like that.
[CPT] Nomad 15. maj 2022 kl. 8:45 
The following code keeps appearing. In the module save location I have it set to \Arma 3 Server\Hz_cfg\Hz_pers\Hz_pers_saveFile.sqf which I believe might be the issue here but I'm not sure how to direct it specifically to the Arma 3 server folder since it wants to default to the Arma 3 folder?

_resultingArray>
Error position: <_resultingArray>
Error Undefined variable in expression: _resultingarray
File x\Hz\Hz_mod_persistency\funcs\Hz_pers_fnc_structArrayElementParser.sqf..., line 58
Error in expression <};

if (Hz_pers_saveVar_saveFileVersion < 191201) then {

["Hz_pers_saveVar_save>
Error position: << 191201) then {

["Hz_pers_saveVar_save>
Error <: Type String, expected Number,Not a Number
File x\Hz\Hz_mod_persistency\funcs\Hz_pers_fnc_updateSaveDataVersion.sqf..., line 16
K.Hunter  [ophavsmand] 15. maj 2022 kl. 2:01 
Did you check your logs? You might have corrupted your save file
[CPT] Nomad 14. maj 2022 kl. 16:22 
Removing the save file from the save file location seems to have restarted the logging of the debug console, presumably because it is defaulting to the FirstTimeLaunchHandler function? Unsure how to proceed here.
[CPT] Nomad 14. maj 2022 kl. 15:48 
Yeah File patching is on. I switched from the 32 bit Server.exe to the 64 bit server .exe that's the only thing that's changed. Here's the full batch file including the save moving/renaming batch file (Shortened the -mod line for space)

@echo off
:start
echo Finding latest save file and copying it into correct folder for game to load...
cd /d "C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server"
FOR /F "delims=|" %%I IN ('DIR "debug_console_x64_*.txt" /B /O:D') DO SET NewestFile=%%I
copy %NewestFile% Hz_pers_saveFile.sqf
mkdir Hz_cfg\Hz_pers
move /Y Hz_pers_saveFile.sqf Hz_cfg\Hz_pers
echo File copied.
pause

start "" "C:\Program Files (x86)\Steam\SteamApps\common\Arma 3 Server\arma3server_x64.exe" -server -config=server.cfg -port=2302 -filepatching -mod=@Hunter
K.Hunter  [ophavsmand] 14. maj 2022 kl. 15:10 
You sure you got filepatching enabled?
[CPT] Nomad 14. maj 2022 kl. 15:08 
Spoke too soon :/ I've set the load save file on the module to \Arma 3 Server\Hz_cfg\Hz_pers and ran the batch file. It successfully moved a previous x64 save to it, renamed it, but now it's not loading the save file and it's no longer bringing up the command prompt creating auto saves (had it set to every 15 seconds). Not sure why it's not making any more auto saves nor reading the save files.
[CPT] Nomad 14. maj 2022 kl. 14:37 
Not sure why but removing the EnableSaving function is what allowed it to start writing the debug file, which is where I got confused in the manual. Got it all squared away, thanks again and apologies for the retardation.
K.Hunter  [ophavsmand] 14. maj 2022 kl. 13:52 
It has nothing to do with the vanilla game saving system. Commands such as "enableSaving" have no effect. For loading from the save, you need to do something else. I'm not sure you've read the manual...
[CPT] Nomad 14. maj 2022 kl. 10:17 
Hm... It seems to save my position / loadout when loading back into the server, but if I issue the #restart command or if the server itself restarts it seems to not reload the save. Am I doing something wrong or is this intended to be per operation only?
[CPT] Nomad 14. maj 2022 kl. 9:20 
Does this addon automatically save the kit on disconnect or is that something you would have to define under onPlayerDisconnect with the [] spawn Hz_pers_fnc_saveGame; command?
[CPT] Nomad 14. maj 2022 kl. 8:59 
WOW that fixed it! A debug actually opened on the server now. Thank you so much!
[CPT] Nomad 14. maj 2022 kl. 8:32 
I'll try that. I had enableSaving [FALSE,FALSE]; in the init.

I waited about 30 minutes the first time around didn't realize it was working off of the in game save