Page MenuHomeFeedback Tracker

HashmapObject - using flag "unscheduled" causes all code 'methods' in the hashmapobject to not execute
Feedback, NormalPublic

Description

Adding "unscheduled" as a flag causes a 'call' to return <null> or Any on any code block defined within a key.

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
Scripting
Steps To Reproduce

Control Test - run within both scheduled and unscheduled environment

_def = [ ["#type","Test"], ["HintTest", { hint "Test"; MyVar = 1; }] ];
_obj = createHashmapObject [_def];
_obj call ["HintTest"]; // works fine - hints "Test" and MyVar is set to 1

Unscheduled Test - run within both scheduled and unscheduled environment

_def = [ ["#type","Test"], ["#flags",["unscheduled"]], ["HintTest", { hint "Test"; MyVar = 1;}] ];
_obj = createHashmapObject [_def];
_obj call ["HintTest"]; // returns <null> - MyVar never gets assigned
Additional Information

It behaves as if the code block doesn't exist or isn't assigned to the key (i.e. it is Nil) but when checking with 'values _obj' the code block is clearly there. It is just not executed.

Event Timeline

dedmen added a subscriber: dedmen.Oct 26 2023, 11:24 AM
_def = [ ["#type","Test"], ["#flags",["unscheduled"]], ["HintTest", { hint "Test"; MyVar = 1;}] ];
_obj = createHashmapObject [_def];
_obj call ["HintTest"]; // returns <null> - MyVar never gets assigned

Can't reproduce

Both unscheduled and scheduled, works fine for me

dedmen changed the task status from New to Need More Info.Oct 26 2023, 11:25 AM
crashdome added a comment.EditedOct 26 2023, 5:15 PM

Ok, something weird is definitely happening. Because now the code IS executing but still not returning anything. I haven't done a reboot or anything. Just restarted Arma 3 (which I had restarted several times when I discovered my issue). I have no proof of yesterday when it wouldn't set MyVar nor return anything... I wish I had taken screenshots. But here is proof today that I cannot return a value which was half my issue yesterday.

Note: I altered the code a bit to return something instead of hint

_def = [ ["#type","Test"], ["#flags",["unscheduled"]], ["Test", {  MyVar = 1; "Test"}] ];
_obj = createHashmapObject [_def];
[_obj call ["HintTest"]]

Images : no flag, with flag, and with flag but in game rather than editor



So in this case, MyVar IS being set but I do not get "test" returned.

I am going to do a full reboot on this machine and reply if issue changes or if I get same results.

crashdome added a comment.EditedOct 26 2023, 5:28 PM

Full reboot same issue with return results. Even though it seems the MyVar assignment seems to be working now.

The only thing I can think is I did flip between prof and stable branch a few times yesterday but, that was long before I started using "unscheduled" flag and discovered the issue.

Here is RPT if it helps:

dedmen added a comment.EditedNov 3 2023, 1:15 PM

Found it. There was a missing return line in the unscheduled execution.
Because the scheduled execution actually returns nil intentionally, but the unscheduled should've exited earlier

Btw your test script

_def = [ ["#type","Test"], ["#flags",["unscheduled"]], ["Test", {  MyVar = 1; "Test"}] ];
_obj = createHashmapObject [_def];
[_obj call ["HintTest"]]

cannot work because the method is named "Test", and you call "HintTest"

dedmen changed the task status from Need More Info to Feedback.Nov 3 2023, 1:19 PM

Fixed next dev branch