#arma3_scripting

1 messages ยท Page 328 of 1

little eagle
#
[_unit, "TEST", "TEST1", 0,_playAction,time+300]
#

And see if the error changes

tough abyss
#

@queen cargo do i need to consider anything when playing on BE servers after install? like unhook something?

#

@little eagle ๐Ÿ‘ one sec

queen cargo
#

nope
only do not start ArmA.Studio in MP and you should be fine (nobody is sure if BE already added the DLL to the explicit blacklist for auto whitelisting as it is/was whitelisted)

tough abyss
#

ok thanks!

#

could you remove MP functionallity from the exe to protect users from accidently using it in MP?

queen cargo
#

there is no "functionallity" in there

#

it is the debugger DLL actually that gets auto-loaded by arma

#

BE should reject it

#

you wont get banned though

#

as the DLL wont do anything on its own

#

and should not be loaded by BE anymore

tough abyss
#

@little eagle same error as above

little eagle
#

copy paste it?

tough abyss
#
20:21:31 Error in expression <[B Alpha 1-1:1 (Lappihuan),"TEST","TEST1",0>
20:21:31   Error position: <Alpha 1-1:1 (Lappihuan),"TEST","TEST1",0>
20:21:31   Error Missing ]
little eagle
#

So it's not the same error

#

It's the same line, which means at least we found the faulty line.

tough abyss
#

well yea the TEST thing is new ๐Ÿ˜›

little eagle
#

Can you copy paste WW_fnc_isPlayer too?

tough abyss
#
private "_unit";
_unit = _this getVariable ["bis_fnc_moduleremotecontrol_owner", _this];
(isPlayer _unit);```
little eagle
#

hmm

#

Maybe they did screw up BIS_fnc_addStackedEventHandler

tough abyss
#

i'm gonna look at missionEventHandler stuff and see if that works

little eagle
#

That one won't let you pass arguments

tough abyss
#

fek

little eagle
#
["blah", onEachFrame", {}, [player, "TEST"]] call BIS_fnc_addStackedEventHandler;
#

potential repro for the error?

#

Since you're using a hard coded ID ("WW_pfh_boltAction") for your EachFrame handler, you might as well use a global variable to pass the arguments to the addMissionEventHandler one

#

So not really a problem

tough abyss
#
20:29:34 Error in expression <["blah", onEachFrame", {}, [player, "TEST"]] call BIS_fnc_addStackedEventHand>
20:29:34   Error position: <TEST"]] call BIS_fnc_addStackedEventHand>
20:29:34   Error Missing ]
#

something seems to be weird with pasing arguments into BIS_fnc_addStackedEventHandler

indigo snow
#

well i hope you realized the typo in that bit

#

"onEachFrame"

little eagle
#

Yeah, no error without the typo

tough abyss
#

oh ๐Ÿ˜„

little eagle
#

Maybe just comment out everything inside the EachFrame handler

#

L57-82

tough abyss
#

i do get the error without the typo btw

#

are you on devbranch aswell?

#
20:38:12 Error in expression <[B Alpha 1-1:1 (Lappihuan),"TEST"] call {}>
20:38:12   Error position: <Alpha 1-1:1 (Lappihuan),"TEST"] call {}>
20:38:12   Error Missing ]
little eagle
#

No, stable

tough abyss
#

The data of the whole game were repacked. Please report any related issues (missing textures and icons, pop-up errors, etc.) to the Feedback Tracker. Thanks!

little eagle
#

But that looks like what I was looking for. Basically the same pattern.

tough abyss
#

that was in the last devbranch update

little eagle
#

Well there you go.

#

Just to make sure

#
["blah", "onEachFrame", {systemChat str _this}, [player, "TEST"]] call BIS_fnc_addStackedEventHandler; 

I used this in stable without error

#

If you're on dev and this errors, then it's a bug on dev

#

To confirm you could try again without mods.

tough abyss
#
20:44:43 Error in expression <[B Alpha 1-1:1 (Lappihuan),"TEST"] call {sy>
20:44:43   Error position: <Alpha 1-1:1 (Lappihuan),"TEST"] call {sy>
20:44:43   Error Missing ]
little eagle
#

Yup, same as the initial error

#

They b0rked it

#

And because I'm an asshole: Arma.Studio wouldn't have found this in a million years.

tough abyss
#

just confirmed without any mods, same error as above

#

thanks for the help! @little eagle

little eagle
#

yw

queen cargo
#

ArmA.Studio can look easily in those functions and check the various contents of variables at runtime when you glance it
it would have found it faster then you stupid

little eagle
#

than*

queen cargo
#

commy is the active dude in this chat

tough abyss
pliant stream
#

that's some crazy shit... what is their implementation like this? ```SQF
_init = "";

{
if (count _init > 0) then
{ _init = _init + ","; };
_init = _init + str _x;
} foreach _args;

_eh = compile format ["[%1] call %2", _init, _code];```

little eagle
#

Is that actual code or did you made that yourself?

halcyon crypt
#

judging by the words it's made up

little eagle
#

Because your loop is a convoluted way of writing:

_init = str _args;
#

I wouldn't be surprised if it's something dumb like that.

jade abyss
#

+it makes no real sense, tbh

#

Why not _init = []
then pushback everything? ยฏ_(ใƒ„)_/ยฏ

little eagle
#

It's a string and not an array

#

for starters.

rotund cypress
#

Why not use joinString instead? ๐Ÿค”

#

_args joinString ",";

little eagle
#

Because that only works with an array already made out of strings.

rotund cypress
#

No it works I am pretty sure

jade abyss
#

@little eagle
["[%1] call %2", _init, _code];

little eagle
#
["1",2,text "3"] joinString ""; // "123"
rotund cypress
#

[0, 1, 2, 3] joinString ",";

#

= "0,1,2,3"

little eagle
#

Yeah. But why

#

It's exactly the same as:

str [0, 1, 2, 3]
rotund cypress
#

Because that only works with an array already made out of strings. - Not correct

little eagle
#

See my two comments above

rotund cypress
#

I don't know why, just pointed out that it's inneccessary to count/foreach to add string to string instead of just using joinString ๐Ÿ˜‰

little eagle
#

Or, str in this case

rotund cypress
#

Ye ^^

#

Str is as usual also most likely much faster

little eagle
#

@jade abyss That results in one pair of brackets too much

jade abyss
#

I quoted from the Code above

#

_eh = compile format ["[%1] call %2", _init, _code];```
Removing the [] in that above + doing it with pushback in the array -> Makes more sense to me.
little eagle
#

The whole thing can be reduced to:

_eh = compile format ["%1 call %2", _args, _code];
jade abyss
#

unless you want all _args stringed (hell knows why)

little eagle
#

That was the point of the loop.

#

And it wasn't to achieve anything. It was to explain a specific error on dev branch.

jade abyss
#
{
_init pushback str _x;
}forEach _Args;```
#

ยฏ_(ใƒ„)_/ยฏ

little eagle
#

_init is a string You cannot use pushBack on a string

jade abyss
#

๐Ÿคฆ

#

Commy

#

Why not _init = [] then pushback everything?

little eagle
#

Because that is just as pointless, because the whole code is a one liner as I've shown.

jade abyss
#

Not rly, but okay.

little eagle
#

Yes really

#
_eh = compile format ["%1 call %2", _args, _code];
#

there

jade abyss
#

w/e. it's okay.

little eagle
#

Admission of defeat.

jade abyss
#

Not rly, just not in the mood

little eagle
#

Then I declare victory and demand land and reparations.

jade abyss
#

take it, leaving world anyway
*startingRocket*

little eagle
#

๐ŸŒ ๐Ÿš€ ๐ŸŒ•

jade abyss
#

๐ŸŒ -> ๐ŸŒ‹

vapid frigate
#

that whole block of code could be replaced with [_args] call _code ?

#

don't need to convert it into a string and then compile it

#

err nvm.. thought it was 'call compile'

lean tiger
#

Awwwww cabbage patch kids

#

There isn't a generic CfgNotification that accepts parameterized everything :<

#

Am writing a plugin that I was hoping would simply be (drop into mission folder, add init.sqf reference) and go

#

IntelAdded is the closest, if I'm not mistaken ๐Ÿ˜ฆ

outer scarab
#

Hey. I'm trying to get a random one of three sounds to play in a trigger, but I'm having trouble. Note, I'll be of limited help since the majority of this is donated, borrowed or otherwise cobbled together. Here's my description.ext: class CfgSFX { class Ion { sound0[] = {"\music\ion1.ogg", db-0, 1.0, 1000, 0.2, 0, 15, 30}; sound1[] = {"\music\ion2.ogg", db-0, 1.0, 1000, 0.2, 0, 15, 30}; sound2[] = {"\music\ion3.ogg", db-0, 1.0, 1000, 0.2, 0, 15, 30}; sounds[] = {sound0, sound1, sound2}; empty[] = {"", 0, 0, 0, 0, 0, 0, 0}; }; class stormloop { name = "Ion Storm Loop"; sound[] = {\music\stormloop.ogg, db+4, 1.0}; }; };
and the trigger:

    private _pos = while {true} do {   
        private _pos = [_this] call BIS_fnc_randomPosTrigger;   
           if (count (_pos nearEntities [["Man"],200]) == 0) exitWith {_pos};   
       }; 
       _bolt = createvehicle ["LightningBolt",_pos,[],0,"can collide"]; 
    _bolt setposatl _pos; 
    _bolt setdamage 1; 
    private _light = "#lightpoint" createvehiclelocal _pos; 
    _light setposatl [_pos select 0,_pos select 1,(_pos select 2) + 10]; 
    _light setLightDayLight true; 
    _light setLightBrightness 95; 
    _light setLightAmbient [0.6, 0.6, 0.1]; 
    _light setlightcolor [1, 0.95, 0.3]; 
    sleep 0.1; 
    _light setLightBrightness 0; 
    sleep 0.1; 
    private _class = selectRandom ["lightning1_F","lightning2_F"];     
    _lightning = _class createvehiclelocal [100,100,100]; 
    _lightning setpos _pos;    _duration = random 2; 
    for "_i" from 0 to _duration do { 
        _time = time + 0.1; 
        _light setLightBrightness (100 + random 100);
        [_lightning,"Ion",500] call CBA_fnc_globalSay3d; 
        waituntil {time > _time}; 
    }; 
    deletevehicle _lightning; 
    deletevehicle _light; 
};```
#

Main issue i'm having right now is it doesn't seemto recognise "ion"

#

If I create a trigger to just play the sound, I get something along the lines of "no entry description.ext/sfx/ion1.empty"

vapid frigate
#

ion1 isn't refrenced anywhere there

#

you got something else trying to play ion1? or the error is different than what you said?

outer scarab
#

I was trying something different when I got that error

#

I'll try having it play one of the specific sounds, gimme a sec

vapid frigate
#

i think it should work how you have it

#

(how you pasted it)

outer scarab
#

Just gives me "Sound ion1 not found"

vapid frigate
#

dunno sorry, guess it's saying it can't find the .ogg file

#

i thought that would in yourmission\music\ion1.ogg

outer scarab
#

yeah, that's where I got it

vapid frigate
#

maybe try taking out the \ at the start

outer scarab
#

i'll give it a shot

#

Same again :\

vapid frigate
#

the error is kinda odd.. thought it would say can't find \music\ion1.ogg, not just ion1

#

checked your RPT for any hints?

outer scarab
#

6:25:21 Warning Message: Sound ion1 not found is the only relevant thing as far as I can see

vapid frigate
#

i guess to confirm that is the problem, you could try changing ion1 to somethingelse1

outer scarab
#

No entry '\description.ext/CfgSFX/ion1.empty'.

#

I'll give it a go

vapid frigate
#

i'm not sure about that CBA function, but say3D says it's for CfgSounds

#

not CfgSFX

outer scarab
#

Ooooh

#

that might be it

#

hmm

#

desc.ext

#
{
    class Strike
    {
        sound0[] = {"music\strike1.ogg", db-0, 1.0, 1000, 0.2, 0, 15, 30};
        sound1[] = {"music\strike2.ogg", db-0, 1.0, 1000, 0.2, 0, 15, 30};
        sound2[] = {"music\strike3.ogg", db-0, 1.0, 1000, 0.2, 0, 15, 30};
        sounds[] = {sound0, sound1, sound2};
        empty[] = {"", 0, 0, 0, 0, 0, 0, 0};
    };
};```
vapid frigate
#

not sure if cfgsounds is the same format

outer scarab
#

Yeah, I was wondering the same

vapid frigate
#

doesn't seem to have random options available, so you might need to just make 3 cfgsounds and play a random one in the script

outer scarab
#

Now i'm getting "No entry [...]description.ext/cfgsounds/strike1.title"

#
{
    sounds[] = {};
    class strike1
    {
        name = "strike1";
        // start path to sound file in AddOn with @
        sound[] = {{\music\strike1.ogg};
        titles[] = {0,""};
    };
    class strike2
    {
        name = "strike2";
        // start path to sound file in AddOn with @
        sound[] = {{\music\strike2.ogg};
        titles[] = {0,""};
    };
    class strike3
    {
        name = "strike3";
        // start path to sound file in AddOn with @
        sound[] = {{\music\strike3.ogg};
        titles[] = {0,""};
    };```
vapid frigate
#

yeh not sure why it's looking for that.. could try throwing in title = "";, but it's not in the docs

#

not that that necessarily means anything

#

your brackets are messed up there

#

and missing the numbers in the sound array

#
{
    sounds[] = {};
    class addonsound1
    {
        name = "sound from addon";
        // start path to sound file in AddOn with @
        sound[] = {"@a3\Ui_F_Curator\Data\Sound\CfgSound\visionMode", 0.8, 1, 100};
        titles[] = {0,""};
    };
};```
outer scarab
#

Yeah, I corrected the brackets, don't know what the numbers are on about

vapid frigate
#

filename, volume, pitch, distance

#

so for thunder you can hear 1km away: 1,1,1000

outer scarab
#
{
    sounds[] = {};
    class strike1
    {
        name = "strike1";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike3.ogg, 1, 1, 300};
        titles[] = {0,"Ion Strike"};
    };
    class strike2
    {
        name = "strike2";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike3.ogg, 1, 1, 300};
        titles[] = {0,"Ion Strike 2"};
    };
    class strike3
    {
        name = "strike3";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike3.ogg, 1, 1, 300};
        titles[] = {0,"Ion Strike 3"};
    };```
#

looking good?

vapid frigate
#

yeah, you probably want blank titles though (but shouldn't hurt). that's subtitles

#

missing a quote too

#

after the .oggs

outer scarab
#

still getting the -oh

#

let's try again

#

and same again

vapid frigate
#

the error about strike1.title ?

outer scarab
#
{
    sounds[] = {};
    class strike1
    {
        name = "strike1";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike3.ogg", 1, 1, 300};
        titles[] = {0,"Ion Strike"};
    };
    class strike2
    {
        name = "strike2";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike3.ogg", 1, 1, 300};
        titles[] = {0,"Ion Strike 2"};
    };
    class strike3
    {
        name = "strike3";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike3.ogg", 1, 1, 300};
        titles[] = {0,"Ion Strike 3"};
    };
    class stormloop
    {
              name = "Ion Storm Loop";
              sound[] = {\music\stormloop.ogg, db+4, 1.0};
      };    
};```
#

Yep

vapid frigate
#

i guess try adding it: class strike1 { name = "strike1"; // start path to sound file in AddOn with @ sound[] = {"\music\strike3.ogg", 1, 1, 300}; titles[] = {0,"Ion Strike"}; title = ""; };

#

that's what the error is saying it's expecting

outer scarab
#

Same again

#

oh

vapid frigate
#

it won't be saying No entry [...]description.ext/cfgsounds/strike1.title with that

outer scarab
#

nah, it's still the same, but it's strike1.titles

vapid frigate
#

you definitely saving the right file and stuff? it would come up that error if cfgsounds wasn't in description.ext at all

outer scarab
#
{
    sounds[] = {};
    class strike1
    {
        name = "strike1";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike1.ogg", 1, 1, 300};
        titles[] = {0,"Ion Strike"};
        title = "";
    };
};```
#

filename strike1.ogg

vapid frigate
#

and reloading the mission to make sure it picks it up

outer scarab
#

oh, in the editor?

#

Sure

#

I'll try that lol

#

the trigger as it currently is for posterity nul = thisTrigger spawn { private _pos = while {true} do { private _pos = [_this] call BIS_fnc_randomPosTrigger; if (count (_pos nearEntities [["Man"],200]) == 0) exitWith {_pos}; }; _bolt = createvehicle ["LightningBolt",_pos,[],0,"can collide"]; _bolt setposatl _pos; _bolt setdamage 1; private _light = "#lightpoint" createvehiclelocal _pos; _light setposatl [_pos select 0,_pos select 1,(_pos select 2) + 10]; _light setLightDayLight true; _light setLightBrightness 95; _light setLightAmbient [0.6, 0.6, 0.1]; _light setlightcolor [1, 0.95, 0.3]; sleep 0.1; _light setLightBrightness 0; sleep 0.1; private _class = selectRandom ["lightning1_F","lightning2_F"]; _lightning = _class createvehiclelocal [100,100,100]; _lightning setpos _pos; _duration = random 2; for "_i" from 0 to _duration do { _time = time + 0.1; _light setLightBrightness (100 + random 100); [_lightning,"strike1",500] call CBA_fnc_globalSay3d; waituntil {time > _time}; }; deletevehicle _lightning; deletevehicle _light; };

vapid frigate
#

don't really need to paste all that.. only relevent line is [_lightning,"strike1",500] call CBA_fnc_globalSay3d;

outer scarab
#

Fairs

#

good news and bad news though

#

the error's gone

#

but I don't hear the sound

#

hah

#

Can volume go over 1?

vapid frigate
#

you close enough? (within 300m)

outer scarab
#

Oh yeah, I am

#

I'll up that value just to be sure

vapid frigate
#

yeah pretty sure volume can be greater than 1

outer scarab
#

Yeah, it is occuring at the same time as a loud explosion

#

okay, interesting

#

I upped the volume to 100 cause why not

#

I do hear the sound, but it seems it only plays until _lightning is deleted, which is more or less instant

#

This is where it goes beyond my comprehension

#

So globalSay3d needs the position for the duration of the sound to play it for its entire length

vapid frigate
outer scarab
#

I think it goes without saying I haven't read too far into this

valid dew
#

How do I use a parameter value in my Description.ext?

#

I'm trying to make respawn time a parameter

outer scarab
#

I guess I could create a "null" vehicle with the script, and delete that later that _lightning, but I wouldn't know how to go about that

vapid frigate
#

@outer scarab just create a Logic (or maybe it's Logic_F.. check config viewer)

outer scarab
#

getting a "generic error in expression"

#
    private _pos = while {true} do {   
        private _pos = [_this] call BIS_fnc_randomPosTrigger;   
           if (count (_pos nearEntities [["Man"],200]) == 0) exitWith {_pos};   
       }; 
       _bolt = createvehicle ["LightningBolt",_pos,[],0,"can collide"]; 
    _bolt setposatl _pos; 
    _bolt setdamage 1; 
    _snd = createvehicle ["Logic",_pos]; 
    _snd setposat1 _pos;
    private _light = "#lightpoint" createvehiclelocal _pos; 
    _light setposatl [_pos select 0,_pos select 1,(_pos select 2) + 10]; 
    _light setLightDayLight true; 
    _light setLightBrightness 95; 
    _light setLightAmbient [0.6, 0.6, 0.1]; 
    _light setlightcolor [1, 0.95, 0.3]; 
    sleep 0.1; 
    _light setLightBrightness 0; 
    sleep 0.1; 
    private _class = selectRandom ["lightning1_F","lightning2_F"];     
    _lightning = _class createvehiclelocal [100,100,100]; 
    _lightning setpos _pos;    _duration = random 2; 
    for "_i" from 0 to _duration do { 
        _time = time + 0.1; 
        _light setLightBrightness (100 + random 100);
        [_lightning,"strike1",500] call CBA_fnc_globalSay3d; 
        waituntil {time > _time}; 
    }; 
    deletevehicle _lightning; 
    deletevehicle _light; 
    sleep 5;
    deletevehicle _snd
};```
#

oh, i see it

#

or not

dusk sage
#

Before reading this

#

Can you paste the error?

#

As this is quite long

outer scarab
#

I managed to fix it within the script

#

don't know exactly what I did

#

apparently a missing ; or 2, one of which was at the bottom

#

problem I'm having now is whether " _snd = createvehicle ["Logic",_pos]; " is legit

dusk sage
#

"can collide" is wrong

#

Should have a _

#

That is invalid syntax for createVehicle

outer scarab
#

Yeah, I'm not the one who made this in the first place, I'm just trying to cobble together a way to play a sound

#

It works for all intents and purposes, except that

#

[_lightning,"strike1",500] call CBA_fnc_globalSay3d; works, but the sound stops when _lightning is deleted

dusk sage
#

This here: random 2, seems silly, for your for loop

outer scarab
#

so I'm trying to create a logic to get the position to play the sound from

dusk sage
#

And this: waituntil {time > _time};

#

Could just be replaced with a sleep

outer scarab
#

Yeah, I appreciate pointing out the stuff that's wrong - but like I said, I didn't make the original version of this script

dusk sage
#

I'm not sure what CBA_fnc_globalSay3d is

#

But if it's what I imagine it to be, I doubt you should use it

#

remoteExec with say3D would be better

#

And yes, say3D will cancel when the object is deleted

#

You need to delay that deletion if you want it to continue

outer scarab
#

I'm specifically looking for what I'm doing wrong here: _snd = createvehicle ["Logic",_pos,[],0,"can collide"]; _snd setposatl _pos;

 ```   [_snd,"strike1",500] call CBA_fnc_globalSay3d; ```
};```
dusk sage
#

can collide

#

And I don't think you can create a logic with createVehicle

#

As of Arma2, this command cannot be used to create game logics (source). Use createUnit instead.

outer scarab
#

Ahah

vapid frigate
#

@valid dew you can use missionConfigFile

#

same was as configFile for normal configs

#

so with this in your description.ext:foo = bar; class foobar { bar = foo; }; you could get the first one with missionConfigFile >> 'foo', or for the second, missionConfigFile >> 'foobar' >> 'bar'

#

(with getText before them to get the text if it's a string; or getNumber, getArray, etc)

warm gorge
#

Performance warning: SimpleSerialization::Write 'params' is using type of ',TEXT' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types What does this mean exactly? I cant seem to find where its arising from

outer scarab
#

Okay, I tried something different:

    private _pos = while {true} do {   
        private _pos = [_this] call BIS_fnc_randomPosTrigger;   
           if (count (_pos nearEntities [["Man"],200]) == 0) exitWith {_pos};   
       }; 
       _bolt = createvehicle ["LightningBolt",_pos,[],0,"can_collide"]; 
    _bolt setposatl _pos; 
    _bolt setdamage 1;
    _A = getPosASL _bolt; 
    private _light = "#lightpoint" createvehiclelocal _pos; 
    _light setposatl [_pos select 0,_pos select 1,(_pos select 2) + 10]; 
    _light setLightDayLight true; 
    _light setLightBrightness 95; 
    _light setLightAmbient [0.6, 0.6, 0.1]; 
    _light setlightcolor [1, 0.95, 0.3]; 
    sleep 0.1; 
    _light setLightBrightness 0; 
    sleep 0.1; 
    private _class = selectRandom ["lightning1_F","lightning2_F"];     
    _lightning = _class createvehiclelocal [100,100,100]; 
    _lightning setpos _pos;    _duration = random 2; 
    for "_i" from 0 to _duration do { 
        _time = time + 0.1; 
        _light setLightBrightness (100 + random 100);
        playSound3D ["strike1.ogg", _pos, false, _A, 100, 1, 1000];
        waituntil {time > _time}; 
    }; 
    deletevehicle _lightning; 
    deletevehicle _light;
};```
#

Ooh

#

Nah, doesn't work

#

Tried putting _A = getPosASL _bolt; before _bolt setdamage 1; no dice

dusk sage
#

Can you elaborate more on "doesn't work"?

#

And as before, I'd recommend remoteExec with say3D

outer scarab
#

I think I've figured it out anyway

#

playSound3D ["strike1.ogg", _pos, false, (getPosASL _Lightning), 100, 1, 1000];

#

Buuut now, 8:21:22 Sound: Error: File: strike1.ogg not found !!!

#
{
    sounds[] = {};
    class strike1
    {
        name = "strike1";
        // start path to sound file in AddOn with @
        sound[] = {"\music\strike2.ogg", 100, 1, 3000};
        titles[] = {0,""};
        title = "";
    };```
#

Was working fine when I was using CBA_fnc_globalSay3d

#

All that's changed now is the function I'm using in the trigger

#

also tried playSound3D ["strike1", _pos, false, (getPosASL _Lightning), 100, 1, 1000];

dusk sage
#

And as before, I'd recommend remoteExec with say3D

vapid frigate
#

wasn't your sound in a music folder @outer scarab ?

outer scarab
#

Yeah

#

I just tried music\strike2.ogg

#

since the example on the wiki page gives a full file-path

vapid frigate
#

read the comments on the wiki too

#

basically it's painful with a sound in a mission to use playSound3D

outer scarab
#

This just got 10x more complicated, if you're referring to this comment: You need to get the correct path for custom mission sounds. Use missionConfigFile with BIS_fnc_trimString (to trim off "description.ext"), then add your mission's sound directory and sound file: _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; _soundToPlay = _soundPath + "sounds\some_sound_file.ogg"; playSound3D [_soundToPlay, _sourceObject, false, getPos _sourceObject, 10, 1, 50]; //Volume db+10, volume drops off to 0 at 50 meters from _sourceObject

vapid frigate
#

yeah, exactly

#

hence BoGuu: And as before, I'd recommend remoteExec with say3D

#

you almost had it right before, but you had "can collide" instead of "CAN_COLLIDE"

#

err nvm missed boguus thing about not using createvehicle

outer scarab
#

Well the trouble I had with createvehicle logic is as BoGuu pointed out, you gotta use create - yeah

vapid frigate
#

create a softdrink can instead

outer scarab
#

I kinda gave up on that, then someone recommended I just use playsound3d

#

Hmm, I could

#

Would it have any performance impact? These lightning strikes are probably going to be happening quicker than 1/second

vapid frigate
#

(or use createUnit)

dusk sage
#

a strike every second? ๐Ÿ™„

outer scarab
#

Yeah man

vapid frigate
#

i would guess less overhead than 'createunit', but not certain

outer scarab
#

~ambience~

vapid frigate
#

(make sure you delete it afterwards)

dusk sage
#

I wouldn't advise to spam create lightning and sounds every second

#

Won't it piss people off aswell ๐Ÿคฃ ?

outer scarab
#

That's kinda the idea

#

I mean we tested it before I got to implementing sounds, apparently it wasn't perceptibly worse than any other mission

#

In terms of performance I mean

#

but a soda can is double the objects

#

I don't know, it's worth a try anyhow

little eagle
#

It's always a bad idea to piss your players off.

outer scarab
#

Question: Does playSound3D delay the sound by distance as with others? As far as I can tell, the CBA function doesn't

little eagle
#

Someone said yesterday no

outer scarab
#

Ah, shame

#

what's the classname of the soda can?

little eagle
#

Couldn't you reuse the same dummy object?

outer scarab
#

I.. don't know about that

little eagle
#

I'd use "Building" as dummy object tbqh.

#

It has no model

outer scarab
#

This is pretty much my first attempt at scripting anything

#

That'd probably be better

little eagle
#

And the lightest simulation type

#

The soda can thing was for barriers, because AI reacts to them.

#

iirc

#

No reason to do that for say3D

outer scarab
#

In this instance I'm not using say3D, but CBA's globalSay3d

little eagle
#

But that function is just a wrapper for

remoteExecCall ["say3D"];
outer scarab
#

....oh

little eagle
#

So you're still using the same thing and you don't consider the speed of sounds either.

outer scarab
#

Yeah, I'm guessing getting speed of sound involved if even possible would take me the rest of the day to figure out

little eagle
vapid frigate
#

you'll probly get a random amount of delay anyway just from lag

little eagle
#

Network delay, yeah

outer scarab
#

I mean it'd be nice to have, because the lightning strike also creates an explosion at the point of impact

#

and that does take speed of sound into account

little eagle
#

jokoho is currently doing speed of sound delays for the cookoff stuff in ACE

#

But it's a bit... advanced?

vapid frigate
#

sleep (_obj distance player) / 340.29;

#

it won't be accurate with network lag though

#

you could make the whole script remote exec instead of just the say3d and do everything locally

#

then everything will be in sync on all clients.. but might not happen at the identical time for everyone

outer scarab
#

Well, that's not too much of an issue really

#

but I think we're getting ahead of ourselves, and way ahead of me ๐Ÿ˜›

#

Because, once again, I must've broke something

#

no script error, nothing in the .rpt, no sound

#

Oh, I think I know why actually

#

i have "CAN_COLLIDE" on the Building

#

And the lightning bolt is destroying it I'm guessing

vapid frigate
outer scarab
#

I never asked for this

#

I think I've got it as close to working as I reasonably can

#

tried disabling simulation on _snd, not sure if it helped, but the sound only plays half the time

tough abyss
#

@little eagle look what got added to the devbranch changelog...
Tweaked: The BIS_fnc_addStackedEventHandler, BIS_fnc_removeStackedEventHandler and BIS_fnc_executeStackedEventHandler functions are no longer supported

little eagle
#

are no longer supported

#

lol

tough abyss
#

to lazy to fix? ๐Ÿ˜›

#

is missionEventHandlers really a alternative?

little eagle
#

It cannot pass arguments, so not necessarily.

#

Also some events cannot overwrite input, like clicking on the map when using the mission eventhandler version.

modern sigil
#

Quick question -- rearming an aircraft is easy enough when you're setting the magazineTurret's ammo... but how do we add chaff/flares back to the aircraft? Because they're not part of the PylonLoadout or the [-1] turret path.

modern sigil
#

Right but I need the turret path, and I don't see where I can find the turretPath for the chaff/flares. It's not the usual [-1] for the main pilot, which is where everything else is stored.

#

Does the chaff even use a turret path? I don't even know

little eagle
#

I will try on that A10

tough abyss
#

so they discontinue support of a function and don't provide a alternative ๐Ÿ‘

little eagle
#
cameraOn magazinesTurret [-1]
["1000Rnd_Gatling_30mm_Plane_CAS_01_F","Laserbatteries","120Rnd_CMFlare_Chaff_Magazine","PylonRack_1Rnd_Missile_AA_04_F","PylonRack_7Rnd_Rocket_04_HE_F","PylonRack_3Rnd_Missile_AGM_02_F","PylonMissile_1Rnd_Bomb_04_F","PylonMissile_1Rnd_Bomb_04_F","PylonMissile_1Rnd_Bomb_04_F","PylonMissile_1Rnd_Bomb_04_F","PylonRack_3Rnd_Missile_AGM_02_F","PylonRack_7Rnd_Rocket_04_AP_F","PylonRack_1Rnd_Missile_AA_04_F"]
#

looks like it IS in turret [-1]

#

"120Rnd_CMFlare_Chaff_Magazine"

#

@modern sigil

cameraOn removeMagazinesTurret ["120Rnd_CMFlare_Chaff_Magazine", [-1]];
cameraOn addMagazineTurret ["120Rnd_CMFlare_Chaff_Magazine", [-1]];
#

This works perfectly fine for me

modern sigil
#

Really? [-1] is the turretPath for flares? I need to go back and see what I was doing wrong.

#

Thanks @little eagle. I'll give it a shot and report back in a bit.

little eagle
#

I'm sitting in a "B_Plane_CAS_01_dynamicLoadout_F"

#

Depends on the bird I guess?

indigo snow
#

@modern sigil -1 turret is the driver / pilot of the vehicle

pliant stream
#
_eh = compile format ["(%1) call %2", str _args, _code];``` there i revised my code from earlier... of course the whole the point wasn't some string manip, but rather embedding the context in code as literals, which is obviously horribly broken... the defect report showed the result of `str(<unit>)` being compiled as a literal
little eagle
#

The str is superfluous and so are the parentheses, no?

#

You're not getting off the hook.

#

But yeah, I agree. That could explain the issue

pliant stream
#

superfluous eh? have a go without them then

little eagle
#

I just wonder why they'd change it like that and then remove support for that function entirely one day later.

#

have a go without them then
Example code?

#

Because atm it does nothing

pliant stream
#

fine SQF [/*_args*/ "", /*_code*/ {systemchat str _this}] call setEventHandler

#

do you see the problem?

little eagle
#

No

#

Sorry

pliant stream
#
format ["%1 call %2", _args, _code]```
#

do you see the problem now?

little eagle
#

No, looks fine to me.

vapid frigate
#

depends what _args is

pliant stream
#
" call {systemchat str _this}"```
vapid frigate
#

whether it can be serialized back and forwards as text

pliant stream
#

do you see the problem now?

little eagle
#

Can you give an actual example I can paste into the debug console and have an error when not using str that disappears when using str?

pliant stream
#
format ["%1 call {}", ""] -> " call {}"
format ["%1 call {}", str ""] -> """ call {}"```
little eagle
#

Wait wait wait

#

_args is not a string, but an array

pliant stream
#

surely _args can be anything

little eagle
#

_init is the stringified version of _args

#

No, it cannot

pliant stream
#

yeah, not in the first code i posted, but it can in the second one

little eagle
#

Because we are talking about a specific example code that turns the array _args into a sting called _init

pliant stream
#

the one where you said the str was superfluous

little eagle
#

str is superfluous under the condition that _args is an array as it was in the initial problem

pliant stream
#

sure sure, but my revised code snippet didn't impose such a requirement

little eagle
#

So yes, str is superfluous, but you were talking about a different problem where it no longer is

#

But then you shifted the topic

pliant stream
#

i did also note that the string manip was never the point in the first place

vapid frigate
#

do you really need to convert it to a string and back?

pliant stream
#

no, you must not

vapid frigate
#

can't just store it as _eh = [_args, _code];

pliant stream
#

that was the point

little eagle
#

Your result

"" call {}

makes no sense anyway, because it can no longer explain the issue this was all about

pliant stream
#

converting the callback context into literals is horribly broken, that was the point

little eagle
#

If the argument were a string, then the code would error out differently.

#

sure, but then we're talking about a different error that doesn't exist

vapid frigate
#

it can't work if, for example, _args was an object

pliant stream
#

exactly

little eagle
#

Yes!

pliant stream
#

or if _args was an array...

little eagle
#

And that's the problem this was all about

pliant stream
#

it only works for strings, bools, and scalars

#

i think... maybe something else but i don't think so

little eagle
#

No, it also works for arrays!!!

vapid frigate
#

would work for arrays of those things too

pliant stream
#

it does not!!!!!!!!

#

it loses array references!!!!!!!!!!!!!!!!!!!!!!

little eagle
#

As long as they are made out of other arrays, strings etc

#

Nope

pliant stream
#

completely and utterly broken

little eagle
#

Example:

#
call compile format ["%1 call %2", [0,1], {systemChat str _this}]
#

works fine

pliant stream
#

but it loses the array reference

#

making the context pointless

#

it can no longer modify the original array

vapid frigate
#

yeah it creates a new array when you recompile it

little eagle
#

You're again talking about an issue that did not happen.

#

And whether or not passed arguments to stacked eventhandlers should be passed by reference or not is an open question imo.

#

It shouldn't change suddently ideally for bwc

pliant stream
#

i don't care if someone did it or not, or if it happened or not, i was talking about the fact that converting a callback context to literals is broken, both for types like objects, and also for just simple arrays with scalars, strings, etc...

little eagle
#

But it's not clear what the expected result should be unless specified.

#

Maybe the function already copies the input? Idk

pliant stream
#

and obviously a callback context should be passed by reference... otherwise it's pointless

little eagle
#

How is it pointless when my code works just fine?

pliant stream
#

how do you expect to return from an asynchronous operation without the array reference?

little eagle
#

I disagree that the arrays has to be passed by reference.

pliant stream
#

depends on the application, but in contextual callbacks they definitely should

little eagle
#

Idk what asynchronous operation has to do with this. We are talking about eventhandlers that run unscheduled.

vapid frigate
#

has something changed? i don't understand the problem

#

if you convert into a string then back to code, it's always gonna recreate arrays?

little eagle
#

BIS_fnc_addStackedEventHandler is either broken or discontinued on dev branch

pliant stream
#

yes, that's the problem, it creates a new array

little eagle
#

That is not the problem this is about, mate

vapid frigate
#

you're trying to recreate it?

pliant stream
#

yeah, that may not be the defect that was reported and sparked the whole discussion, but it's still valid

jade abyss
#
yes, that's the problem, it creates a new array```
Erm, and?
little eagle
#

Nope, I am trying to explain the shown error. No idea what untelo is about.

vapid frigate
#

why not just not convert it to a string?

#

there's no need to

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

vapid frigate
#

and that's what's breaking it

little eagle
#

Lecks, we don't know why it's broken, but that would explain the error message.

pliant stream
#

@jade abyss copying the array prevents you from modifying the original (obviously), which prevents you from returning the value of an asynchronous operation

jade abyss
#

uhm, what? oO

little eagle
#

The goal was to create code sufficient to explain why a specific error messgae is shown.

pliant stream
#

do you know how promises and futures work?

#

same principle

little eagle
#

And some people hijacked the conversation to "fix" the code that was never meant to be used

jade abyss
#

some are bored ยฏ_(ใƒ„)_/ยฏ

little eagle
#

And are off topic

pliant stream
#

i thought the topic was scripting

#

i must be in the wrong channel

little eagle
#

The channel topic is scripting. The conversation topic is about scripting. But that does not mean that the conversation topic should be changed to a different one and that it's fine to do so just because it still complies with the channel topic.

#

Obviously there is no point in stringifying an array when you immediately recompile it.

#

But it can explain why an object without object name would error out exactly like what was found in an RPT file that happened on dev branch.

pliant stream
#

yes that was the point, and to back it up i gave two examples of why it's broken, 1) because not all types have literal representations and 2) because array references are lost

little eagle
#

And how does that explain the error on dev branch?

pliant stream
#

the code i posted did explain it, converting the callback context into literals

outer scarab
#

How would I go about finding out how many lightpoints are in my mission, or making sure they're working? I've placed 34 with ```var = [] spawn {light = "#lightpoint" createvehicle getpos L7;
light setlightbrightness 5;
light setlightcolor [0.1,0.8,0.1];
light setlightambient [0,0.8,0];};````
in init.sqf, but for whatever reason none of them are showing up now.

little eagle
#

the code i posted did explain it, converting the callback context into literals
So you don't even know what the error on dev branch is. K thx.

pliant stream
#

it tries to compile SQF [B Alpha 1-1:1 (Lappihuan),"TEST"]

#

which looks like someone tried to convert the context into a literal, but it fails because objects don't have a literal representation

little eagle
#

well, they do when you give them object names in the ediotr "vehicle var names"

#

So that is important when trying to repro the issue.

pliant stream
#

ok, let's say it worked for objects, my point was that even if it worked for objects, the whole idea is still broken for other reasons

little eagle
#

Sure.

#

It's also pointless.

#

Yet my derived one liner code is identical to what was posted as explanation.

#

And the explanation had the same issue.

#

So if my one liner keeps all the issues of the original, it's even better suited as simplification

#

Because as I said, it's literally the same, but as a one liner...

pliant stream
#

i'm not sure what one liner code you're referring to here

little eagle
#

Wait

#

original:

_init = "";

{
    if (count _init > 0) then
        { _init = _init + ","; };
    _init = _init + str _x;
} foreach _args;

_eh = compile format ["[%1] call %2", _init, _code];

simplification:

_eh = compile format ["%1 call %2", _args, _code];
tough abyss
#

i had a quick glance at the functions yesterday late night and they seem to store the arguments and the code in a missionNamespace array but i don't remember if they stringify them or not

little eagle
#

On dev branch?

tough abyss
#

yes

outer scarab
#
var = [] spawn {light = "#lightpoint" createvehicle getpos L7; 
light setlightbrightness 5; 
light setlightcolor [0.1,0.8,0.1];
light setlightambient [0,0.8,0];};
`
in init.sqf, but for whatever reason none of them are showing up now.```
tough abyss
#

i can paste the functions on my lunchbreak

little eagle
#

original and simplification are equivalent, unless you want to deliberately change the _init variable, which would be horrible design.

jade abyss
#

Wich one exactly @tough abyss ?

little eagle
#

BIS_fnc_addStackedEventHandler

tough abyss
#

The BIS_fnc_addStackedEventHandler, BIS_fnc_removeStackedEventHandler and BIS_fnc_executeStackedEventHandler

jade abyss
#

Abd where is that Code from?

#

Cause i can't see it in here

tough abyss
#

exectue is the one that reads from missionNamespace and add is the one that saves it there

pliant stream
#

@little eagle what do you mean by deliberately changing _init?

little eagle
#

Changing the value of a predefined variable _init

jade abyss
#

read from MissionNameSpace

little eagle
#

Assuming the lack of privatewas intentional.

pliant stream
#

_init is magic?

little eagle
#

Nope

pliant stream
#

i just named it that as short for initializer

#

because it was the array initializer without []

little eagle
#

Think of both codes as a black box

pliant stream
#

or are you talking about local var corruption due to lack of local?

#

or private in A3 i guess...

tough abyss
#

@jade abyss could you paste the execute function aswell? ^^

jade abyss
#

@tough abyss The one i pasted is the one, how it seems. But i can't find that Codepart, that is reffered to in here oO

little eagle
#
_init = 0;

ORIGINAL

typeName _init // STRING
_init = 0;

SIMPLIFICATION

typeName _init // NUMBER
#

or are you talking about local var corruption due to lack of local?
No

jade abyss
#

Paste = fn_addStackedEventHandler.sqf

tough abyss
#

BIS_fnc_executeStackedEventHandler

pliant stream
#

ok then i have no clue what you're talking about

tough abyss
#

few files below

jade abyss
#

fn_executeStackedEventHandler.sqf

/*
    Author: Nelson Duarte

    Description:
    Deprecated

    Returns:
    BOOLEAN - FALSE
*/

false;```
#

๐Ÿ˜‚

tough abyss
#

wait wat?

jade abyss
#

lmao

#

Thats it

#

fn_executeStackedEventHandler.sqf

tough abyss
#

that wasn't the case yesterday evening 100%

jade abyss
#

๐Ÿ˜‚

#

I just unpacked it, 5min ago

little eagle
#

ok then i have no clue what you're talking about
How so? The example is easy to understand.

tough abyss
#

and i'm 100% sure they didn't had that deprecated entry in the devbranch changelog...

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

#

No clue what you saw

#

Maybe checked wrong/old Folder?

tough abyss
#

wait, i actually didn't unpack the update so i looked at a older version

#

hmmm

jade abyss
#

lmao

#

Lappi der Lappen ๐Ÿ˜‚

pliant stream
#

@little eagle so you are talking about corrupting _init due to lack of local

#

or... private whatever...

little eagle
#

@outer scarab

allMissionObjects "#lightpoint"
#

That reports an array with all light source objects.

#

Yes. Corrupting, or changing it deliberately and the simplification no longer doing that.

pliant stream
#

well obviously my code was just a silly example and was never intended to be valid for any purpose

little eagle
#

Do you agree that my simplification is equivalent to your original aside from modifying potentially predefined variables in a different way?

outer scarab
#

Hmm, Commy I don't imagine there's a way to count only editor, well, init-placed lightpoints?

pliant stream
#

well no i don't, because it behaves differently when _args is string, but otherwise, yes of course

little eagle
#

I don't think allMissionObjects lists anything else.

pliant stream
#

assuming _args is always array, it's equivalent and much better, of course

little eagle
#

Untelo

#

_args is defined as array by the original

#
} foreach _args;
#

That doesn't work with strings.

pliant stream
#

i just had a brain fart about array to string, but once again the string manip was not important

#

ok i had no clue i might as well have called _args _floop and _code _blargh

jade abyss
#

So again: Where is that codepart from?

that's some crazy shit... what is their implementation like this? ```
```sqf
_init = "";

{
    if (count _init > 0) then
        { _init = _init + ","; };
    _init = _init + str _x;
} foreach _args;

_eh = compile format ["[%1] call %2", _init, _code];```
pliant stream
#

it was just meant to demonstrate turning the callback context into a code literal

jade abyss
#

So it was nonsense you posted/wrote?

little eagle
#

ok i had no clue i might as well have called _args _floop and _code _blargh
Sure, but that doesn't change the fact that forEach makes the variable _floop to be an array if we assume that the code works.

tardy wagon
#

SQF seems weird as hell

pliant stream
#

heh good point

#

i admit defeat

little eagle
#

And I demand reparations

jade abyss
#

@tardy wagon Just forget everything you know about other languages (even your mothertounge)

little eagle
#

jk, it was a fun and pointless discussion

pliant stream
#

@tardy wagon i see you're a connoisseur of the finest of programming languages known to man, thanks be to Bjarne

#

now... to keep the flame war going but with a new topic... how to get the return value when i call remote functions using remoteExec etc?

tough abyss
#

seems like a troll dickmove to drop support of a function and in the same time just break it intentionally by doing a return false;

little eagle
#

now... to keep the flame war going but with a new topic... how to get the return value when i call remote functions using remoteExec etc?
Another remoteExec I guess.

#

Yeah, Lappi. No idea what's going on.

pliant stream
#

but how do i associate it with the original caller?

little eagle
#

clientOwner I guess. Hoping that the code is not meant to work in local hosted MP

pliant stream
#
_blah = [_code, _args] call some_remoteExec_wrapper_that_has_the_ability_to_return_values```
#

how do i derive the return value from _blah

little eagle
#

Untelo that could work in scheduled environment

#

But not in unscheduled

pliant stream
#

well the way i would do it is by returning a future

#

now... how would you implement futures

peak plover
#

What? remotexec that returns a value? Do you want a value from another client?

pliant stream
#

i want to call a function on a remote machine, and get back the value from the function

peak plover
#

ok

#

How about this

pliant stream
#

what the remote machine is or what the function is are irrelevant

#

what is relevant is how to approach returning values from asychronous operations

#

such as a remote call

jade abyss
#

RemoteExec it back?

#

call a func on the Target, that returns the data. Can't think of anything else

peak plover
#

run script_a on machine_1 >> remotexec script_B on remote machine_2 >> script_B remoteExecs script_C on machine_1

little eagle
#
some_remoteExec_wrapper_that_has_the_ability_to_return_values = {
    params ["_code", "_args"];

    My_RE_Return = nil;

    [[_code, _args, 0], {
        params ["_code", "_args"];

        private _return = _args call _code;
        [_return, { My_RE_Return = _this; }] remoteExec ["BIS_fnc_call"];
    }] remoteExec ["BIS_fnc_call"];

    waitUntil {!isNil "My_RE_Return"};

    My_RE_Return
};

Something like this?

jade abyss
#

Or let it change a setVar Pub. no clue

pliant stream
#

well i can think of publicvariables, which is what i actually do because i live in A2 land

peak plover
#

You don't have to use waituntil

#

Just split the original script into 2

little eagle
#

Sure

#

That is what I'd do too, but not exactly what Untelo asked for

pliant stream
#

yes this is all very obvious... what i'm getting at though is that using any more global state than absolutely necessary is very bad

#

which is why, as i said, i would personally implement this using futures and promises

#

now... implementing futures and promises without global state is possible using array references

jade abyss
#
call a func on the Target, that returns the data.```
little eagle
#
some_remoteExec_wrapper_that_has_the_ability_to_return_values = {
    params ["_code", "_args"];

    My_RE_Return = nil;

    [[_code, _args, clientOwner], {
        params ["_code", "_args", "_owner"];

        private _return = _args call _code;
        [_return, { My_RE_Return = _this; }] remoteExec ["BIS_fnc_call", _owner];
    }] remoteExec ["BIS_fnc_call"];

    waitUntil {!isNil "My_RE_Return"};

    My_RE_Return
};

forgot the owner part

pliant stream
#

and this gets us to my point about why callback contexts should never copy arrays

jade abyss
#

BIS_fnc_call? Wouldn't a simple "call" be enough?

little eagle
#

remoteExec ["call"] would execute the code in unscheduled environment

peak plover
#

Ohh yeah, if it's more than 1 targets, then yeah. You would have to do some kind of a wait OR you could save the amount of targets you've sent out to on the original machine and then everytime the return function runs, check if it has got information from all the target machines yet

jade abyss
#

_Vargs RemoteExecCall ["call"]

#

things i did for debug stuff:

[_Veh,{player moveInDriver _this}] remoteExecCall ["call",_Player];```
little eagle
#

remoteExec ["call"] // unscheduled
remoteExecCall ["call"] // unscheduled
remoteExec ["BIS_fnc_call"] // scheduled
remoteExecCall ["BIS_fnc_call"] // unscheduled

peak plover
#

mind blown

little eagle
#

That is how it is.

pliant stream
#

don't get stuck on the implementation details for remoteExec

peak plover
#

Can that be added to the biki?

little eagle
#

Getting stuck on details is what this channel is about

#

It is on the wiki

pliant stream
#

instead let's change the problem from remoteExec to a remote database load via extension on a server

little eagle
outer scarab
#

I'm really stuck on the details

little eagle
#

Scripted function - scheduled environment (suspension is allowed, i.e. spawn, execVM).
Script command - unscheduled environment (suspension is NOT allowed).

outer scarab
#

So much for having the finishing touches of my mission done within an hour or two

#

I've been at this since 4am

little eagle
#

call is a "Script command"

outer scarab
#
var = [] spawn {light = "#lightpoint" createvehicle getpos L34; 
light setlightbrightness 5; 
light setlightcolor [0.1,0.8,0.1];
light setlightambient [0,0.8,0];};
 where L# is a trigger with the corresponding variablename
[11:05 AM] Morbo: All I remember having done between them working and when I noticed they weren't was 1: change the "Lightning" weather condition, and 2 started/reloaded the mission a hundred times messing with a script, that as far as I can tell shouldn't interface(edited)```
little eagle
#

So
remoteExec ["call"] -> unscheduled

jade abyss
#

Commy should start reading.

little eagle
#

Reading what?

jade abyss
#
[_Veh,{player moveInDriver _this}] remoteExecCall ["call",_Player];```
#
remoteExec ["call"] would execute the code in unscheduled environment```
little eagle
#

Yeah. You can replace remoteExecCall with remoteExec here and it makes no diff

jade abyss
#

Are you drunk?

little eagle
#

No

jade abyss
#

So where did you mentioned that it's unscheduled? (fk, i hate that word)

little eagle
#

BIS_fnc_call? Wouldn't a simple "call" be enough?

#

It's not enough, because

#

{hint str canSuspend} remoteExec ["call"];
-> false

#

{hint str canSuspend} remoteExec ["BIS_fnc_call"];
-> true

jade abyss
#

And?

#

Who is talking about suspension?

little eagle
#

That is why it wouldn't be enough to use it. My code uses waitUntil therefore only works in scheduled environment

#

I think it's a good idea to keep that even when continuing on another machine

jade abyss
#

( i wonder why waitUntil anyway, but okay)

little eagle
#

Because that is the only way to do the initial task

vapid frigate
#

to wait for the var to be set

jade abyss
#

Send it back via rec -> Done O.O

little eagle
#
_blah = [_code, _args] call some_remoteExec_wrapper_that_has_the_ability_to_return_values
#

This was the initial task

#

And you have to use waitUntil to get this to work afaik

jade abyss
#

Wich is imho pretty nonsense ยฏ_(ใƒ„)_/ยฏ

#

No need to waste stuff in a waitUntil ยฏ_(ใƒ„)_/ยฏ

little eagle
#

Well, that is kinda how the new remote debug console in CBA works, so it's not "nonsense"

pliant stream
#

you absolutely DO NOT have to use waituntil

little eagle
#

Not waitUntil, but it's a similar idea

pliant stream
#

you can do it without the scheduled environment

jade abyss
#

Doesn't make it better. Split it up to 2 Funcs -> Done.

little eagle
#

you absolutely DO NOT have to use waituntil

Then show me code that would make:

_blah = [_code, _args] call some_remoteExec_wrapper_that_has_the_ability_to_return_values

working without waitUntil

pliant stream
#

ok

little eagle
#

I'm not even disagreeing, Dscha.

#

But that doesn't solve the issue.

pliant stream
#
_future = [_code, _args, _client] call my_remoteExec;
[_future, _code2, _ctx] call my_future_then;```
little eagle
#

untelo, I expected some_remoteExec_wrapper_that_has_the_ability_to_return_values to be something

#

Not to change the question

pliant stream
#

renamed to my_remoteExec in version 2

little eagle
#

Ok, then solve

_blah = [_code, _args] call my_remoteExec;
vapid frigate
#

how does my_future_ten work without waituntil?

little eagle
#

^

pliant stream
#

it attaches a callback to the future

#

which is executed when the future becomes ready

jade abyss
#

wut? no

little eagle
#

The right way to go about this is, that this cannot be solved without waitUntil and THEREFORE it's better to split it into two functions.

vapid frigate
#

so u 'wait until' it becomes ready?

outer scarab
#

Can someone help me here, please?

pliant stream
#

no

outer scarab
#

lol

pliant stream
#

no wait until

#

no sleep

jade abyss
#

Since when does it wait? oO

halcyon crypt
#

you need something that loops until whatever is doing something is done, period

little eagle
#

Yep

jade abyss
#

โ˜ x2

pliant stream
#

when the client receives a response via some mechanism such as remoteExec, it sets the value on the promise, which executes all callbacks attached to the future

#

there is no need for any waituntil or sleep looping etc

#

that would be horrible

vapid frigate
#

show the functions?

jade abyss
#

Is this wishthinking or currently possible?

pliant stream
#

it's absolutely possible

little eagle
#
_blah = [_code, _args] call my_remoteExec;

Just so it doesn't get lost. I claim that this cannot work without my_remoteExec using waitUntil or sleep

jade abyss
#

cause i can't imagine, that it works.

pliant stream
#

i've implemented it already as a single class Task, but redoing it right now to separate into Promise and Future to make things easier

vapid frigate
#

it could if my_future_then uses sleep/waituntil

jade abyss
#

have you done this on a Dedi machine?

vapid frigate
#

but 1 of them has to

jade abyss
#

Yeah, Lecks

pliant stream
#

yes, i've already used it on with dedicated server

#

no one has to sleep

jade abyss
#

func pls.

little eagle
#

โ˜•

jade abyss
#

I rly doubt, that RE(C) returns values. I would be pretty surprised if.

little eagle
#

It doesn't. The JIP version reports a ticket for the JIP stack

pliant stream
#

i'll have to finish this future/promise implementation first

jade abyss
#

REC

Anything - Nil in case of error. String otherwise. If JIP is not requested this is an empty string, if JIP is requested, it is the JIP ID. See the topic Function for more information.```
pliant stream
#

i'll give you the code when it's presentable ok

jade abyss
#

Nah, just a showcase is enough

pliant stream
#

ok give me a minute....

little eagle
#

Poor @outer scarab is ignored ๐Ÿ˜ฆ

jade abyss
#

Haven't you answered him already?

little eagle
#
Morbo - heute um 12:23 Uhr
Can someone help me here, please?
Untelo - heute um 12:23 Uhr
no
Morbo - heute um 12:23 Uhr
lol
jade abyss
pliant stream
#

what no

halcyon crypt
#

he asked his question earlier

simple solstice
#

why ==

#

isEqualTo is faster

jade abyss
#

Check the current topic

simple solstice
#

i know, but it needs correction

jade abyss
#

No shit sherlock

simple solstice
#

lol

little eagle
#

== reports false when both sides are null (except for configNull, because)

#

That could be a reason to use == over isEqualTo

pliant stream
#
local _channel = (if (_topic call my_topic_isQuestion) then { "scripting-questions" } else { "scripting" }) call my_getChannel;
[_channel, (_topic call my_getMessage)] call my_channel_post;```
peak plover
#

But...but it's slightly slightly slower...

little eagle
#

It isn't anymore when you have to add isNull checks.

jade abyss
#

+Now with remoteExec func.

halcyon crypt
#

@outer scarab try to figure out if that bit of code is running at all with hint or diag_log

tough abyss
#

Notepad++ > Find and replace in files > == to isEqualTo > huge fps gain

little eagle
#
_var = if (...

is cancer.

#

Agreed?

peak plover
#

Yes

pliant stream
#

yes

halcyon crypt
#

no ๐Ÿ˜›

vapid frigate
#

no

pliant stream
#

but we don't have ternary op so

little eagle
#

Contrarians.

pliant stream
#

ยฏ_(ใƒ„)_/ยฏ

halcyon crypt
#

poor man's ternary expression

outer scarab
#

Don't worry, I got it sorted @Marcel @little eagle

tough abyss
#

๐Ÿ”ฅ

outer scarab
#

had this too far up in my init // ======================================= // Ambient Sounds //enableEnvironment false; while {true} do { [player, "stormloop",500] call CBA_fnc_globalSay3d; sleep 15; //"0" represents what length the track is, so replace the 0 with your soundtrack's length };

vapid frigate
#

yeah if we could use _var = x ? true : false; i would

outer scarab
#

put it at the bottom, boom

peak plover
#

haha, it never get's past the loop ๐Ÿ˜„

jade abyss
#

I am still waiting for the remoteExec return ยฏ_(ใƒ„)_/ยฏ

pliant stream
#

@vapid frigate: it wouldn't work, it would have to be SQF cond ? { true } : { false }

tough abyss
#

I would give it to you if I had my computer at the moment @jade abyss

vapid frigate
#

yeh probably

jade abyss
#

@tough abyss You working with Untelo?

halcyon crypt
#

anyway, where's that remoteExec function thingy

#

still waiting ๐Ÿ˜

pliant stream
#

no

#

i don't know this guy

tough abyss
#

No. But I've been watching the chat

#

By far most active channel on this server lol

pliant stream
jade abyss
#

No need to

#

This is sqf.

pliant stream
#

and you can implement futures and promises in sqf

little eagle
#
local _channel = (if (_topic call my_topic_isQuestion) then { "scripting-questions" } else { "scripting" }) call my_getChannel;
local _channel = (["scripting", "scripting-questions"] select (_topic call my_topic_isQuestion)) call my_getChannel;

Where is your god now?

pliant stream
#

i think i would make the array static

#

only... the performance implications of having thousands of static arrays for shit like this worries me

simple solstice
#

local is same as private?

pliant stream
#

because global vars are not statically linked

little eagle
#

You do know that else also creates an array?

pliant stream
#

local is private in A2

jade abyss
little eagle
#
{ "scripting-questions" } else { "scripting" }
->
[{ "scripting-questions" }, { "scripting" }]
jade abyss
#

*StillWaitsForRemoteExecExampleForReturnValues*

vapid frigate
#

still prefer the if/then

little eagle
#

So no, there are no performance implications aside from it gets faster

#

Lecks, that is called irrationality, but Ok

pliant stream
#

man i'm implementing this future/promise right now... my old shittier implementation didn't support callbacks

jade abyss
#

I call it CommyNism

pliant stream
#

although it fairly easily could have...

halcyon crypt
#

excuses ๐Ÿ˜›

#

just post the "old" code

little eagle
#

You calling me irrational, Dscha?

jade abyss
#

calling you a CommyNist

pliant stream
little eagle
#

I can already tell that Dscha will like this.

jade abyss
#

I do, i rly do. (sarcasm)

halcyon crypt
#

I see 0 remoteExecs

jade abyss
#

Still searching for RemoteExec

pliant stream
#

that's obviously separate from the future/promise, which is just an abstraction for the result of an asynchronous operation

vapid frigate
#

so to use it

#

you waitUntil Future_IsReady

pliant stream
#

no

little eagle
#

๐Ÿฟ

jade abyss
#

For me, it's just macroGibberish and i still can't see the return of (a) RemoteExec

pliant stream
#
_future = [...] call my_remoteExec;
_handler = { diag_log format ["ctx: %1 args: %2", Delegate_Context, Delegate_Args]; };
Future_Then(_future, Delegate_New(_handler, "hello"))```
#

like i said, future/promise is an abstraction. next i'm writing the remoteExec code

tardy wagon
jade abyss
#

Has nothing to do with Scripting.

tardy wagon
#

vaguely

jade abyss
pliant stream
#

not even close lol

jade abyss
#

next i'm writing the remoteExec code
Haven't you said, it was already working?

halcyon crypt
#

@pliant stream are you currently somewhere in the academic world either as student or something else?

little eagle
#

I'm intrigued

pliant stream
#

@jade abyss it was working, but it didn't use the future/promise that i just wrote. also i've since redone the server backend (implemented in C++) so the SQF side is now incompatible, which is why i have to redo it anyway, and i decided to return futures instead of a future-like RPC object which i was returning previously

#

@halcyon crypt why do you ask?

little eagle
#

I like simple answers to simple questions.

pliant stream
#

you know what's simple to write? waitUntil on a global variable

#

you know what it isn't though? scalable... maintainable...

halcyon crypt
#

^ that's why I asked ๐Ÿ˜

little eagle
#
_blah = [_code, _args] call my_remoteExec;

How fancy can you get solving this ^
?

pliant stream
#

i can get very fancy, and i will

little eagle
#

And I doubt that you're still working on something we would accept as solution to the given question.

pliant stream
#
_requests = [];

for "_i" from 1 to 1000 do
{
    _requests pushBack ([_code, _i] call my_remoteExec);
};```
#

this is a bit harder to do with just global vars and wait until isn't it

jade abyss
#

Mostly because of: remoteExec just doesn't return anything else, then Nil/JIP-ID or empty String

halcyon crypt
#

I still don't see a way around something looping somewhere ๐Ÿค”

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

little eagle
#

There is none.

jade abyss
#

It might work in another Language, but in sqf.... I doubt it.

pliant stream
#

of course remoteExec doesn't return, and it can't, but it's possible to wrap around it an API which can

little eagle
#

Proof it.

jade abyss
#

Wich has some kind of suspension in it

little eagle
#

^

vapid frigate
#

yeah, like commy did earlier

pliant stream
#

no there is still no need for scheduled environment :D

vapid frigate
#

but not without waiting/polling/looping somewhere

pliant stream
#

yes there is suspension, in the same way that coroutines have suspension

#

but there is no need for the scheduled environment

little eagle
#

suspension outside the scheduled environment. ๐Ÿค”

pliant stream
#

do you know what a coroutine is

jade abyss
#

๐Ÿฟ

little eagle
#

do you know what a coroutine is
No.

jade abyss
#

Once again: It might work in another Language, but in sqf.... I doubt it.

pliant stream
#

sqf is turing complete isn't it

little eagle
#

Idk what that means either.

pliant stream
#

ok

#

well soon as i've got my remoteExec code working i'll be sure to showcase it to you

little eagle
#

Did I mention that I like simple answers for simple questions?

jade abyss
#

Just twice yet.

#

btw. when i saw the macroMadness -> Closed instantly.

pliant stream
#

it doesn't need macros, macros are just faster since we don't have a compiler that can inline

jade abyss
#

Don't wanna waste x minutes just to switch around and see what macro does what.

little eagle
#

Q: "How to get this code working?"
A?: "Do you know what 'Turing complete' is?"

halcyon crypt
#

from the Unity docs:
A coroutine is like a function that has the ability to pause execution and return control to Unity but then to continue where it left off on the following frame.
So it's basically just the scheduled environment in Arma ..... ๐Ÿคฆ

pliant stream
#

sort of, but not quite

#

arma scheduled environment uses green threads

little eagle
#

Oh for fucks sake.

pliant stream
#

as for the macros, i just prefer to define public APIs using macros, it could just as well be functions

halcyon crypt
#

as if the underlying threading system matters at all for the implementation

pliant stream
#

like Future_GetValue(_future) -> _future call my_future_getValue

#

same thing

#

just written differently

#

arma sqf scheduler is a threading implementation

jade abyss
#

https://community.bistudio.com/wiki/Code_Optimisation#Make_it_work.


"Excessive cleverness is doing something in a really clever way when actually you could have done it in a much more straightforward but slightly less optimal manner. You've probably seen examples of people who construct amazing chains of macros (in C) or bizarre overloading patterns (in C++) which work fine but which you look at an go "wtf"? EC is a variation of premature-optimisation. It's also an act of hubris - programmers doing things because they want to show how clever they are rather than getting the job done." - sbsmac```
halcyon crypt
#

I meant the implementation of whatever you're trying to proof here

jade abyss
#

My Fav is the "wtf"-part.

tardy wagon
#

brb implemented templated metaprogramming lambda thread schizz foo

jade abyss
#

This is what i see, at about 95% of all Macros i've seen so far.

little eagle
#

I think I'm laughing.

pliant stream
#

alright, then in those terms i shall prove that returning from remoteExec is possible using only one thread

jade abyss
#

without sleep/waituntil/similar stuff.

tardy wagon
#

If you like threads just write some compute shaders

pliant stream
#

namely the main thread

#

where sleeping is impossible

vapid frigate
#

pls do

tardy wagon
#

this helps with sleep

little eagle
#
_blah = [_code, _args] call my_remoteExec;

Reminder ^

halcyon crypt
#

lol

tardy wagon
#

for your insane programming benders

jade abyss
#

Yep. And pls remember: There were > 4 ppl who knows their shit in here, telling you: Not possible.
But if it works -> Kudos.

pliant stream
#

@little eagle i upgraded that to 1000 concurrent remoteExecs

little eagle
#

That was not the question.

vapid frigate
#

1 will do

pliant stream
#

fine

jade abyss
#

(and is bad anyway)

halcyon crypt
#

using PVEHs is cheating btw

vapid frigate
#

you don't need globals

little eagle
#

Well, I don't see how using PVEH could solve the issue that is:

_blah = [_code, _args] call my_remoteExec;
#

So it's not cheating, but unlikely to be the solution.

jade abyss
#

@halcyon crypt It still has to "wait" until the Var is set, wich can be delayed ๐Ÿ˜„

halcyon crypt
#

just making sure ยฏ_(ใƒ„)_/ยฏ

#

๐Ÿ˜›

jade abyss
#

๐Ÿ˜„

little eagle
#

PVEH could be used as alternative to remoteExec, but that doesn't get around the need for suspension and therefore scheduled environment

pliant stream
#

A2 doesn't have remoteExec so i have to emulate it using PVs anyway...

halcyon crypt
#

I know that, what I meant with cheating was that PVEHs still rely on looping/polling/suspending etc behind the scenes

pliant stream
#

But it makes no difference

halcyon crypt
#

if he proves us wrong then I think he deserves a place in the veterans group ๐Ÿ˜›

#

you know, as a price

pliant stream
#

Lol

jade abyss
#

[x] Veto

#

๐Ÿ˜„

vapid frigate
#

or in biminions group

pliant stream
#

Whats the biminions group for btw

vapid frigate
#

employees

jade abyss
#

Slaves

pliant stream
#

Ok i thought so

halcyon crypt
#

if you lose though, you get X39's old group ๐Ÿ˜

jade abyss
#

lmao, thats mean

pliant stream
#

Whats that

jade abyss
#

Don't ask.

pliant stream
#

Ok

halcyon crypt
#

๐Ÿ˜›

little eagle
#

Stop chatting, Untelo and post your code.

jade abyss
#

*CollectingSomePitchforks*

pliant stream
#

I'm walking my dog. I'll continue coding when i get back. Have some patience

little eagle
#

You will NOT get away with this.

vapid frigate
#

you don't need to waitUntil you get back

jade abyss
#

badumm tss

vapid frigate
#

can do it at the same time.. that's the whole point

pliant stream
#

I have attached a continuation to the asynchronous dog walking operation

jade abyss
#

So, a new Thread.

pliant stream
#

No the dog walking executes on the same thread. The continuation gets synchronized to it using a dispatcher.

little eagle
#
_blah = [_code, _args] call my_remoteExec;
queen cargo
#

@pliant stream so you create a proper async system for arma?
How would you realize the "reattach" to the previous scope? Unscheduled could break your neck here when you use a await function

#

At least with the method that would come in my mind right now

pliant stream
#

simple future/promise with continuations

#

of course coroutines would require compiler support

queen cargo
#

But how you want to solve that?

pliant stream
#

similar to C# Task<T> if you're more familiar with that than e.g. C++ std::future, std::promise

#

future/promise, or coroutines?

queen cargo
#

Coroutines

little eagle
#

Still waiting for the code.

pliant stream
#

oh i don't intend to, like i said that would require compiler support

#

in essence parsing something like await ( [...] call my_remoteExec ) and transforming the function into a coroutine

#

stackless coroutines, obviously

#

the locals would have to be extracted into a dynamic coroutine frame

queen cargo
#

So... You did not found the holy grale of sqf?

pliant stream
#

if you mean pretty coroutines, then no. said i said that would require compiler support

queen cargo
#

Y

dusk sage
#

Not sure if I regret reading the last few hours of chat or not

halcyon crypt
#

looking at std::future and std::promise it still needs to suspend/block using std::future::wait. In Arma that would either mean blocking the engine in unscheduled or using some kind of polling in scheduled ๐Ÿ˜›

dusk sage
#

TIL commy says 'mate' when getting triggered That is not the problem this is about, mate

pliant stream
#

you can however do ugly coroutines like i showed above, i.e. SQF Future_Then([...] call my_remoteExec, DelegateNew({ /*continuation*/ }, /*context*/));

little eagle
#

oh i don't intend to
๐Ÿ™„
Was I being bullshited all along?

pliant stream
#

@halcyon crypt look instead at std::experimental::future, or boost::future

#

std::future::then is a C++17 feature

dusk sage
#

Finally too

queen cargo
#

Extremely ugly
Due to macro usage that also should be problematic for anything using newlines or commas

little eagle
#

TIL commy says 'mate' when getting triggered That is not the problem this is about, mate
Yo, mate

pliant stream
#

@little eagle did you misunderstood? in _blah = ... _blah was never the result, it was a future which will at some indeterminate time provide the result

queen cargo
#

Ugly in the sense of: you loose your current scope completely

dusk sage
#

๐Ÿคฃ

pliant stream
#

there's no way around that without stackful coroutines, which would require SQF support and that's obviously not happening

queen cargo
#

Leave him in his little world untelo

little eagle
#

wtf

pliant stream
#

and stackful coroutines aren't desirable anyway

#

actually i guess it wouldn't matter in sqf since it has a variable sized stack afaik

#

ยฏ_(ใƒ„)_/ยฏ

queen cargo
#

Extension could do it

pliant stream
#

yeah, but it would be unstable

#

not unstable in that it would crash necessarily, but it would be broken by binary patches to the game

#

i think if you wanted pretty coroutines, the best way would be to just transform the extended sqf into valid ugly sqf with explicit continuations

#

but that requires tooling that doesn't exist

little eagle
#

So, Untelo, you're not gonna post a solution to:

_blah = [_code, _args] call my_remoteExec;

that does not require scheduled environment?

pliant stream
#

yes, but it's not my fault if you misunderstood what _blah is

little eagle
#

_blah is a local variable

pliant stream
#

yes

#

but it is not the result of (_args call _code) executed on the server

little eagle
#

containing the return value of _code called with _args on a different machine

pliant stream
#

it is a future object that will at some indeterminate point provide the result of (_args call _code) executed on the server

dusk sage
#

The good old, at some point this may, or may not, have completed

pliant stream
#

that one

#

but all boilerplate is abstracted away, making it easier and safer to work with

dusk sage
#

I promise something might happen ๐Ÿ™ƒ

queen cargo
#

You abuse the reference "problem" of arrays?

pliant stream
#

it's not a problem

#

it's a very important feature

little eagle
#

wtf is the point of the "future object" when you still have to suspend your code to read it's value?

queen cargo
#

Still on mobile and did not want to trigger commy2

halcyon crypt
#

I don't agree with your proposed solution to @little eagle's problem

pliant stream
#

@little eagle yes you have to suspend, but not by sleeping or using waitUntil

little eagle
#

Then how

pliant stream
#

you simply return, and then when the value is returned the continuation will execute

little eagle
#

how

vapid frigate
#

don't think you can, but if you could i'm pretty sure the game would freeze

little eagle
#

You can't, which was my point.

pliant stream
#

the client executes an eventhandler when the value is returned via PV or RE, the eventhandler finds the relevant promise and fulfills it, executing the continuation

halcyon crypt
#

NO

#

that's still suspending somewhere

#

PV that is

pliant stream
#

yes it suspends, but it does not sleep or waitUntil

#

there is no polling

#

or any shit like that

vapid frigate
#

how does it suspend then?

pliant stream
#

it's completely event based

little eagle
#
_blah = [_code, _args] call my_remoteExec;

But it does not allow for this ^ then.

halcyon crypt
#

event systems still use polling at some point

pliant stream
#

@little eagle yes it does, but you misunderstand what _blah is

little eagle
#

No, _blah is the return value of _args call _code on a remote machine.

pliant stream
#

it is not. what you describe is impossible without freezing the client for an indeterminate amount of time

#

_blah is a future

queen cargo
#

_blah is a reference to the value that will be returned
It is not yet available but in a future point it will be

little eagle
#

Yes it is:

some_remoteExec_wrapper_that_has_the_ability_to_return_values = {
    params ["_code", "_args"];

    My_RE_Return = nil;

    [[_code, _args, clientOwner], {
        params ["_code", "_args", "_owner"];

        private _return = _args call _code;
        [_return, { My_RE_Return = _this; }] remoteExec ["BIS_fnc_call", _owner];
    }] remoteExec ["BIS_fnc_call"];

    waitUntil {!isNil "My_RE_Return"};

    My_RE_Return
};
#

See?

#

You said this can be done in scheduled / without waitUntil

pliant stream
#

right, now you use waitUntil

little eagle
#

And no you can't.

queen cargo
#

You can get the actual value by using a yield function

little eagle
#

Shut up X39

pliant stream
#

like i said, if you want pretty coroutines you need compiler support

#

it's that simple

#

but you can have ugly coroutines without it

#

like i posted above

little eagle
#

So you can't. Thank you.

#

You don't get to redefine what SQF does.

pliant stream
#
    /*continuation*/
}, /*context*/));```
dusk sage
#

I think we should try bargain for something better than SQF first

pliant stream
#

@little eagle by compiler support i don't mean changing SQF, the SQF "compiler" is essentially f(x) = x

little eagle
#

The question was what some_remoteExec_wrapper_that_has_the_ability_to_return_values should be to get the return value of a function called on another machine with given arguments.

#

I said this can only be done with waitUntil / in scheduled environment

#

And you said it can be done in unscheduled.

#

And you're wrong, because you still have not demonstrated that it can be.