Member
Last active 6 years ago
One last try with code #2, here are the logs:
1st mission
13:28:22 ALIVE_SYS_DATA START PLUGIN: ["StartALiVE","OK","Performance Monitor: Disabled"] 13:28:22 DATA: Attempting to load ALiVE web services config. 13:28:23 ALiVE-0 CONNECTED TO CLOUD SERVICE AND PERFDATA IS ALLOWED 13:28:23 DATA: Loading data dictionary dictionary_2RGTIncursori_alive_store_test_2. 13:28:23 ALiVE Extension (ALiVEPlugIn) Error: ['{"error":"not_found","reason":"missing"} '] CMD: SendJSON ['GET','sys_data/dictionary_2RGTIncursori_alive_store_test_2_1',''] 13:28:23 DATA: Loading mission compositions data. 13:28:24 DATA: Starting AAR system. 13:28:24 DATA: Waiting for global DISABLED variable... 13:28:24 DATA: SYS DATA enabled: true 13:28:24 DATA: Starting stats system. 13:28:24 "Operation: alive_store_test_2" 13:28:24 Adding ACE Stats EHs to player <NULL-object> 13:28:24 ALiVE [m_0|30] Module ALiVE_sys_data INIT COMPLETE TIME: 1.98 13:28:24 TEST: done waiting for alive data 13:28:24 TEST: get value 13:28:24 TEST: got NO value 13:28:24 TEST: data ["#CBA_HASH#",["one","time"],[1,0],<NULL-object>] stored, SAVE & EXIT as admin 13:28:24 ALiVE SYS_DATA - ASYNC WRITE LOOP STARTING
2nd mission
13:30:53 ALiVE Extension (ALiVEPlugIn) Error: ['StartALiVE','ERROR','ALiVE already initialized'] CMD: StartALiVE ['true'] 13:30:53 ALIVE_SYS_DATA START PLUGIN: SYS_DATA_ERROR 13:30:53 DATA: Attempting to load ALiVE web services config. 13:30:53 ALiVE-0 CONNECTED TO CLOUD SERVICE AND PERFDATA IS ALLOWED 13:30:53 DATA: Loading data dictionary dictionary_2RGTIncursori_alive_store_test_2. 13:30:54 ALiVE Extension (ALiVEPlugIn) Error: ['{"error":"not_found","reason":"missing"} '] CMD: SendJSON ['GET','sys_data/dictionary_2RGTIncursori_alive_store_test_2_1',''] 13:30:54 DATA: Loading mission compositions data. 13:30:54 DATA: Starting AAR system. 13:30:54 DATA: Waiting for global DISABLED variable... 13:30:54 DATA: SYS DATA enabled: true 13:30:54 DATA: Starting stats system. 13:30:54 "Operation: alive_store_test_2" 13:30:54 Adding ACE Stats EHs to player <NULL-object> 13:30:54 ALiVE [m_0|30] Module ALiVE_sys_data INIT COMPLETE TIME: 1.603 13:30:54 TEST: done waiting for alive data 13:30:54 TEST: get value 13:30:54 TEST: got NO value 13:30:54 TEST: data ["#CBA_HASH#",["one","time"],[1,0],<NULL-object>] stored, SAVE & EXIT as admin 13:30:54 ALiVE SYS_DATA - ASYNC WRITE LOOP STARTING
=> NO VALUE FOUND.
=> CANNOT SAVE ANYMORE until I restart the server.
Full logs here .
From this moment on, SERVER SAVE & EXIT (ADMIN ONLY)
stopped working completely. I've tried 3 times and restarted the server.
Seeing that "not_found" error in the JSON reply, I thought I'd give changing my mission name a try (at this point I'm not sure what else to do...).
I tried this code:
if (isServer) then { diag_log text "TEST: initializing"; waitUntil { ["ALiVE_sys_data"] call ALiVE_fnc_isModuleInitialised }; diag_log text "TEST: done waiting for alive data"; private _aliveKey = "MyTestKey"; private _aliveHash = [[["one", 1], ["time", time]], objNull] call CBA_fnc_hashCreate; diag_log text "TEST: get value"; private _savedValue = objNull; try { _savedValue = [_aliveKey] call ALiVE_fnc_getData; } catch {}; if !(_savedValue isEqualTo objNull) then { diag_log text format["TEST: got value %1", _savedValue]; } else { diag_log text "TEST: got NO value"; }; [_aliveKey, _aliveHash] call ALiVE_fnc_setData; diag_log text format ["TEST: data %1 stored, SAVE & EXIT as admin", _aliveHash]; };
Started mission, clicked on SERVER SAVE & EXIT (ADMIN ONLY)
. This time it worked again.
Restarted mission, logs are:
13:16:49 TEST: done waiting for alive data 13:16:49 TEST: get value 13:16:49 Error in expression <ashGet; } else { _result = "ERROR"; }; _result;> 13:16:49 Error position: <_result;> 13:16:49 Error Undefined variable in expression: _result 13:16:49 File \x\alive\addons\sys_data\fnc_getData.sqf [ALiVE_fnc_getData], line 1782 13:16:49 TEST: data ["#CBA_HASH#",["one","time"],[1,0],<NULL-object>] stored, SAVE & EXIT as admin
=> ERROR.
Again, clicking on SERVER SAVE & EXIT (ADMIN ONLY)
does NOT exit the mission. Nothing comes up, nothing happens. I have to click on SERVER EXIT (ADMIN ONLY)
, that works.
=> CANNOT SAVE ANYMORE.
So I tried this:
if (isServer) then { diag_log text "TEST: initializing"; waitUntil { ["ALiVE_sys_data"] call ALiVE_fnc_isModuleInitialised }; diag_log text "TEST: done waiting for alive data"; private _aliveKey = "MyTestKey"; private _aliveHash = [[["one", 1], ["time", time]], objNull] call CBA_fnc_hashCreate; diag_log text "TEST: get value"; private _savedValue = objNull; if (!isNil { [_aliveKey] call ALiVE_fnc_getData }) then { _savedValue = [_aliveKey] call ALiVE_fnc_getData; }; if !(_savedValue isEqualTo objNull) then { diag_log text format["TEST: got value %1", _savedValue]; } else { diag_log text "TEST: got NO value"; }; [_aliveKey, _aliveHash] call ALiVE_fnc_setData; diag_log text format ["TEST: data %1 stored, SAVE & EXIT as admin", _aliveHash]; };
Started mission, clicked on SERVER SAVE & EXIT (ADMIN ONLY)
.
Restarted mission, logs are:
12:54:05 ALiVE [m_0|30] Module ALiVE_sys_data INIT COMPLETE TIME: 1.92599 12:54:05 TEST: done waiting for alive data 12:54:05 TEST: get value 12:54:05 TEST: got NO value 12:54:05 TEST: data ["#CBA_HASH#",["one","time"],[1,0],<NULL-object>] stored, SAVE & EXIT as admin 12:54:05 ALiVE SYS_DATA - ASYNC WRITE LOOP STARTING ... 12:55:45 ALiVE Extension (ALiVEPlugIn) Error: ['{"error":"not_found","reason":"missing"} '] CMD: SendJSON ['GET','sys_spotrep/2RGTIncursori_alive_store_test','']
=> NO VALUE FOUND.
Now, clicking on SERVER SAVE & EXIT (ADMIN ONLY)
does NOT exit the mission. Nothing comes up, nothing happens. I have to click on SERVER EXIT (ADMIN ONLY)
, that works.
=> CANNOT SAVE ANYMORE.
Full log: https://pastebin.com/ZsFG5C5W
Hi,
I've tried for the past 3 days but I'm unable to get / set anything from the cloud in and addon that I'm building. Therefore I've started an empty mission with only ALiVE Required, ALiVE Data and this in init.sqf
:
if (isServer) then { diag_log text "TEST: initializing"; waitUntil { ["ALiVE_sys_data"] call ALiVE_fnc_isModuleInitialised }; diag_log text "TEST: done waiting for alive data"; private _aliveKey = "MyTestKey"; private _aliveHash = [[["one", 1], ["time", time]], objNull] call CBA_fnc_hashCreate; diag_log text "TEST: get value"; private _savedValue = [_aliveKey] call ALiVE_fnc_getData; if !(isNil _savedValue) then { diag_log text format["TEST: got value %1", _savedValue]; } else { diag_log text "TEST: got NO value"; }; [_aliveKey, _aliveHash] call ALiVE_fnc_setData; diag_log text format ["TEST: data %1 stored, SAVE & EXIT as admin", _aliveHash]; };
Started mission, clicked on SERVER SAVE & EXIT (ADMIN ONLY)
.
Restarted mission, logs are:
12:28:32 TEST: done waiting for alive data 12:28:32 TEST: get value 12:28:32 Error in expression <ashGet; } else { _result = "ERROR"; }; _result;> 12:28:32 Error position: <_result;> 12:28:32 Error Undefined variable in expression: _result 12:28:32 File \x\alive\addons\sys_data\fnc_getData.sqf [ALiVE_fnc_getData], line 1782 12:28:32 TEST: data ["#CBA_HASH#",["one","time"],[1,0],<NULL-object>] stored, SAVE & EXIT as admin 12:28:32 Error in expression <ey] call ALiVE_fnc_getData; if !(isNil _savedValue) then { diag_log text format> 12:28:32 Error position: <_savedValue) then { diag_log text format> 12:28:32 Error Undefined variable in expression: _savedvalue 12:28:32 File mpmissions\__cur_mp.Altis\init.sqf, line 15 12:28:32 ALiVE SYS_DATA - ASYNC WRITE LOOP STARTING
=> ERROR
I can click on SERVER SAVE & EXIT (ADMIN ONLY)
but when I restart, same thing.
Thank you @incontinenetia I'm already doing all of that... will have to go back to empty missions. and see the basics of this stuff.
Yes, but since my data changes all the time and there is no event I can attach to I have to keep on saving it.
The issue I have though is that getData does not return anything (code linked above). What may be going wrong? As per my previous post everything works with ProfileNameSpaceSave.
I've successfully coded persistence, however it only works on local. Please help me out here to finish this up once and hopefully for all. :)
I allow both local and cloud persistence. I read the setting from the ALiVE Data Module.
For local, I use ALiVE_fnc_ProfileNameSpaceLoad
and ALiVE_fnc_ProfileNameSpaceSave
. This works, both on a local machine and on a dedicated server. For cloud storage I use ALiVE_fnc_getData
and ALiVE_fnc_setData
. This does not work. No errors, it's just that ALiVE_fnc_getData
does not find any data.
Code to save data can be found here , to load data here .
Besides the way that the CBA HASH is loaded, all the rest of the code is exactly the same.
Any ideas?
Second question: Do ALiVE_fnc_ProfileNameSpaceSave
and ALiVE_fnc_setData
save the date instantly or only SET the hash on ALiVE, and this data will be persisted ONLY WHEN ALiVE saves it? In other words, do I need to save only once (when?) or keep on saving my CBA HASH at a regular interval?
Thank you,
_SCAR.
Thanks to the both of you for your responses, I really appreciate it.
Profiling your workers would be fine. You could continue the "build" process with "invisible" AI because the player won't be there to see it. Then they spawn in and carry on their build anims when a player comes into range.
The building process heavily relies on the positioning of workers. They need to be close to the construction area AND alive for it to proceed. I get these info with getPos
and alive
.
On top of this, I also have a series of event callbacks when they are killed, attached with addEventHandler
. They also have actions added to them, and a series of custom variables (not sure if those would be kept once they are virtualized and then respawned?).
Unless I'm mistaken, I cannot use any of these when they are profiled, unfortunately...
This is why I was hoping for a mechanism to make ALiVE "consider" my workers as players, so that if they are in range, they'd spawn.
I want to thank you for your work and support. I am a big ALiVE fan. It's a huge work that you have done, and thank you for making it available for the community.
After 3 days of diving into it, I just want to say that from a modder's perspective it is not immediate to integrate with ALiVE. Please take this as constructive criticism.
The things that I wanted to do since the beginning are:
1. Have my custom spawned AI be attacked by ALiVE-controlled opposing forces. After 3 days my understanding is that this is not possible. I could profile them (still unclear on how to do so) but that would make them virtualized by ALiVE and it would conflict with my construction system that handles them already. Hence, if there are no players around my custom AI, they will never be attacked by the virtualized units (which is a little ironic given that players around these AI would be there in the first place with the purpose of defending them). I don't know if there's a way to programmatically spawn virtualized units once they get close to my custom AI, so that they get attacked. If there is, please let me know.
2. Ensure that they are persisted. My understanding is that, being spawned and not placed in the editor, they will be not. Naively I thought that the persistency system of ALiVE would take care of looping allGroups / vehicles and save them and their position, but it looks like this is not how this works. Please correct me if I'm wrong, but it looks that if I want to save my custom spawned AI and objects I'll have to deal with that on my own.
I'm missing simpler ways to integrate, even though I do understand the complexity of ALiVE and that this is nobody's daily work. :)
For instance, maybe an oversight on my part but I haven't seen any ALiVE generated events (using CBA) a developer can attach to (for instance to have a callback when a game is saved through ALiVE).
Some functions are inconsistent (for instance ALiVE_fnc_ProfileNameSpaceLoad
returns false for a non-existant variable, while ALiVE_fnc_getData
returns nil ), which makes it time consuming to go through exceptions handling. In some others, it is unclear what certain values do, for instance the priority in the "addObjective" function of ALiVE_fnc_OPCOM
: is 200 a high or a low value?
The script snippets are all great starting points, but all seem to have been added in an aftersight (many of which come from forums) rather than being a native part of ALiVE's architecture.
Again, please take this as constructive criticism from a grateful fan of your work. I really want to make my module 100% ALiVE compliant, my understanding at this point though is that I will probably have to do most things independently and try to patch them together with ALiVE logic, hoping nothing will break in the future.
Any comments / pointers are obviously welcome, in case you'd want to come back to me.
All the best,
_SCAR.