#arma3_scripting

1 messages · Page 363 of 1

still forum
#

Who made that script? @tough abyss Does his name contain a Ph?

#

yep.

tough abyss
#

I think it's this one.

little eagle
#

There is a quite popular youtuber that has videos on SQF optimization..
Who?

still forum
#

you improve the compile time.. by like.. a couple microseconds.. You save a couple microseconds on a action that is done once.
If you consider that you will be playing for atleast half an hour.. How much is a couple microseconds of saved time worth?

#

The guy that made the script that @tough abyss just linked

tough abyss
#

^ and makes it unmaintainable.

scarlet spoke
#

*saves a microsecond for compiling but takes hours more to debug

still forum
#

Instead of giving real advice like following the performance guide on BIKI or using cfgFunctions.. He just ignores people that recommend him to do that.

tough abyss
#

Be prepared for eyecancer

still forum
#

He has quite a big outreach.. and is using that to teach people pure garbage

little eagle
#

We should make a page filled with bad advice and pretend it was good advice.

still forum
#

😄

#

that's actually not a bad idea

tough abyss
#

Thats what it looked like before I started re-factoring it.

still forum
#

I don't see much difference..

#

Oh god

#

I didn't scroll down

tough abyss
#

xD

little eagle
#

Why not though? Do you care if people have a bad time with this? Make suggestions that sound clever, but only lead to problems. "Like replace all forEach with count".

tough abyss
#

:S I will also use switch statement

#

I know taboo, but they make stuff readable.

scarlet spoke
#

not that taboo anymore... Got some performance inprovements afaik

still forum
#

switch is basically just a couple if/then's

peak plover
#

hahaha

tough abyss
#

Yeah but nicer to read.

peak plover
#

I should get on some of this spicy fake optimizations

little eagle
#

Also, put things into functions with compileFinal, because that is super secure and can't be overwritten!

tough abyss
#

It's more secure.

#

Not necessarily "impossible to break"

peak plover
#

I've developed a 100% secure way

little eagle
#

Illegible code

tough abyss
#

Obfuscation yeah sure.

peak plover
#

Put your script in a computer that is off the grid, then throw it away once the script is done

#

BOOM, 100% security

still forum
#

I also have a 100% secure way.
uninstall arma

little eagle
#

True, can't argue with that.

tough abyss
#

Yet again with undefined variable.

#

How and why... it's not possible for nearRoads to return nothing while in the mission map?

#

As in first setup?

still forum
#

afaik nearRoads always returns array

#

empty array if there is no road

little eagle
#

One argument of nearRoads could be nil.

tough abyss
#

_randRoadObj = selectRandom _iedRoads;

#

Falls through.

#

Ohhhh.

#

Right

#

I'll try find

little eagle
#

selectRandom []
is nil btw.

still forum
#

getMarkerSize could return empty array. and when you then do a select 0 you get nil

little eagle
#

No error. 😂 🔫

still forum
#

use param with default value instead of select

#

if nearRoads is the problem

little eagle
#

getMarkerSize reports [0,0,0] at worst

still forum
#

if _iedRoads being empty is the problem.. then check it for not being empty using count

#
    for "_i" from 1 to iedNum do {
    if (count _ieds == iedNum*4) exitWith {};

wtf is that?

#

checking the same condition on every iteration?

#

_ieds never changes and iedNum also doesn't

tough abyss
#

Don't look at me.

#

I have no idea.

still forum
#

https://www.youtube.com/watch?v=452DDfsdOWk
If you wanna see. Btw he is also too dumb to even read numbers.. 0.0012ms is apparently 12 milliseconds..
He also recommends to use incredibly small mission names.. because that will magically improve script performance

tough abyss
#

omg

#

My eyes...

#

Concatenating everything on 1 line is such an eyesore.

#

He uses chained expressions isn't that a bad idea?

#

Taking multiple commands and feeding them into each other in 1 statement on 1 line?

little eagle
#

You said popular.

#

212

#

views

#

pff

#

I can get more views farting in a mic.

still forum
#

Too popular..

#

That video should have -5 views

scarlet spoke
#

@little eagle that I want to be proven 😛

halcyon crypt
#

the entire industry has been moving to readable names and some subset of Arma idiots are going backwards? Okaayyyy

still forum
#

He also made Addon Free Arma Radio btw.
I didn't take a look at it's code yet.. And I'm sure I don't want to

tough abyss
#

I think you are right

#

I could quite easily remove this.

#
    if (count _ieds == iedNum*4) exitWith {};
#

It's redundant.

#

Whats you guys opinion on using call compile preprocessFileLineNumbers in place of execVM?

#

This was something noted on Virtual Battlespace 3.0 wiki

scarlet spoke
#

If your using the code more than once then yes

still forum
#

the online difference is call vs spawn

#

@scarlet spoke call compile implies that it's used once

#

you'd have to store the result of compile. instead of calling it directly.

#

Just use cfgFunctions.

scarlet spoke
#

Yeah I know... But it could be that some lines beneath that the exactly same code is written again... Thus used twice but each time recompiled

tough abyss
#

I might for the sake of prototyping use


compileFinal PreProcessFileLineNumbers

and assign it a function name that is compatible with cfgFunctions.hpp so it can be a seamless transistion

#

e.g GG_fnc_something

#

The IED script is fixed anyway

#

the exitWith might have been the culprit...

#

Yep it was....

sick drum
#

[this,"BRIEFING_POINT_TABLE","ASIS"] call BIS_fnc_ambientAnim;
0 = this spawn {waitUntil {behaviour _this == "combat"};

_this call BIS_fnc_ambientAnim__terminate;}

How come this isn't working

teal valley
#

is thier a way to script the new cluster bombs that are dropped to not leave unexploded ordenance on the ground ?

little eagle
#

delete them?

teal valley
#

or have 100% of them explode ..

inland drift
#

the failure rate is in the weapons config iirc

simple solstice
#

@astral tendon if your mission doesn't work on every difficulty you are doing something wrong

inland drift
#

something like 5% for every bomblet

#

higher for the aaf ones

little eagle
#

Question answered ✅

inland drift
#

on a scale of 1 to awful how much would this script not work

    if ("apc1" inArea rearmtrigger1) then {apc1 setVehicleAmmo 1};
        } else {
    if ("apc2" inArea rearmtrigger1) then {apc2 setVehicleAmmo 1};
};```
little eagle
#

Looks pretty bad, but functional. Let me suggest this:

#
if ("apc1" inArea rearmtrigger1) then {
    apc1 setVehicleAmmo 1;
};
if ("apc2" inArea rearmtrigger1) then {
    apc2 setVehicleAmmo 1;
};
inland drift
#

yeah probably shoudl've figured to just break it in two

#

thanks m80

little eagle
#

Oh wait.

#
if (apc1 inArea rearmtrigger1) then {
    apc1 setVehicleAmmo 1;
};

if (apc2 inArea rearmtrigger1) then {
    apc2 setVehicleAmmo 1;
};
#

They have to not be strings.

inland drift
#

aah right

peak plover
#
private _nil = {
    if (_x inArea rearmtrigger1) then {
        _x setVehicleAmmo 1;
    };
    false
} count [apc1,apc2];
inland drift
#

woah

#

working on an addaction for a supply vehicle that will rearm two possible apcs within a certain area of it

peak plover
halcyon crypt
#

@little eagle what's wrong with @peak plover's example (besides using count instead of forEach and calling the var _nil)?

#

or rather, setting a var at all

little eagle
#

"Besides"?

peak plover
#

Using private _anything is faster than not using private. Don't want any random values floating around and _nil is cool name

#

Also count is faster than forEach

halcyon crypt
#

yes like 0.00000000001 ms

#

count doesn't imply side effects while forEach does

#

anyway

#

preferences

peak plover
#

yeah D:

halcyon crypt
#

just wonder why doing a count/forEach over a set of objects is "worse" than doing it with 2 blocks which do exactly the same thing

peak plover
#

even better would be make a function and call it from the addaction

#

And have a variable as a acceptable vehicles

tough abyss
#

why does that need to be fast anyway?

little eagle
#

It doesn't.

#

But this is a game now:

#
0 = {_x setVehicleAmmo 1} count (list rearmtrigger1 arrayIntersect [apc1, apc2]);
tough abyss
#

i mean its in a freakin addaction that might be executed once or twice in a mission for two vehicles

inland drift
#

oh god

peak plover
#

NOOOOO

#

Enhance PERFORMANCE!!!

indigo snow
#

count or apply?

tulip cloud
winter rose
#

there is a difference between SP and MP, see the notes - use switchableUnits instead

#

and if (isMultiplayer) then (…)

simple solstice
#

Is something up with HandleDamage EH?

#

It always returns body for hitSelection

#

and 11 for hitPartIndex

#

No matter if I shoot the init in the leg, arm, head or body..

winter rose
#

did you systemChat to log all the returns?

simple solstice
#

omg

#

i systemChat all the others but not _part 🤦

#

but I can't seem to understand, why the unit shot in the hand, gets damage on other parts. kind of screws up my idea on counting how many bullets the unit took

astral tendon
#

guys, port a mission to MP or SP works in the same way for workshop?

subtle ore
#

There must be something wrong with your unit, or a script is causing conflicts. Tested a handle damage eh and it worked just fine

#

@Katekarin#0291

#

@astral tendon what?

astral tendon
#

you know that option we have to export to SP/MP?

#

works in the same way to the workshop?

subtle ore
#

What?!?! You have a giant steam button for uploading to the workshop

astral tendon
#

yes, does that means my mission will work in SP and MP afther i press that giant steam button?

indigo snow
#

dont rename it

#

whilst exporting

astral tendon
#

whilst exporting?

astral tendon
#

i dont undestand, the AI behave diferent in the multiplayer but in the editor works fine

#

lets say, there is a convoy, the leader turn right but the second guy turn left and the last guy turn backwards and all became a mess

waxen tide
#

@astral tendon AI is legendarily bad, so don't expect consistent behavior. Just because something worked once, does not mean it will always work.

astral tendon
#

in this case, it never works in MP

queen cargo
#

Just thinking...

#

Ai with neural network could be funny

simple solstice
#

@subtle ore vanilla A3.. only CBA loaded.

#

But do you refer to the unit taking multiple hits from one shot, or only showing "body"? Which was resolved by me using systemChat to list all of the handlers

subtle ore
#

@simple solstice which var are you returning that only returns body as a hitpoint?

astral tendon
#

wake up dynamic simulation

#

what is this?

simple solstice
#

@subtle ore it's no longer an issue. the "issue" I'm having RN is that it returns multiple values, even if unit is clearly shot in the head, feet or an hand

#

do I need to filter out very low value damages? so I can count the bullets an unit got shot with

#

or should I use HitPart for counting and saving the bullets taken

subtle ore
#

what does index return? Otherwise i would say yeah

frail zephyr
#

@astral tendon read the Wiki entry.... "There is also an advanced setting that controls if unit can activate (wake-up) dynamically disabled entities. The option is located in unit's Attributes menu >> Object: Special States section."

simple solstice
#

@subtle ore yeah to which one? 😄

frail zephyr
#

It means that unit can cause dynamic sim to be activated for other units; took me 2 seconds to google...

astral tendon
#

that also means is good or bad?

subtle ore
#

Not sure, i will be at my pc soon. Hopefully you find an answer soon @simple solstice

frail zephyr
#

It means nothing... it depends on whether you want that unit to wake up other dynamically simulated units or not.

astral tendon
#

so turning it off makes no diference?

frail zephyr
#

"Controls if the unit can activate dynamically disabled units (default: checked). When unchecked dynamically simulated entities will completely ignore presence of the unit and will remain disabled even if unit is in their activation distance. If checked on player, player will wake-up any entity if in it's activation distance. If checked on non-player unit, the unit will wake-up enemy units (on foot and in vehicles)."

#

Read the wiki

#

It definetely makes a difference; depending on what you want to achieve.

#

It wouldn't be an option if it made no difference

astral tendon
#

what kind of diference?

frail zephyr
#

Dude... read the wiki... I quoted what difference it makes...

#

If you don't understand Dynamic Simulation... read the wiki

#

Something running under Dynamic Sim wont be simulated unless you are close enough

#

Wake Up means that a Non-Player unit can wake up enemies that are close enough and are dynamically simulated

simple solstice
#

@astral tendon pretty much every question you're asking here is answered on the wiki, and people are quoting the wiki over and over for yuo

frail zephyr
#

again, there is no good or bad, its a design choice for your mission

simple solstice
#

everytime I read your questions its already propably answered in the wiki

frail zephyr
#

^

astral tendon
#

because, if i turn this on, the AI will not move

tough abyss
#

trying to put the vehicle respawn module to good use but 80% of the time, the vehicles explode when respawning. Sometimes even cause nearby ( 5 meters away ) to explode too because (by the looks of it) the respawning vehicle gets placed on their position and then moved to its originial position. any code in the execution entry that can prevent this?

frail zephyr
#

Did you read what Dynamic Sim does!? @astral tendon .... I'm done trying to explain it. Read the wiki.

simple solstice
#

@tough abyss this allowDamage false; sleep x; this allowDamage true

#

?

tough abyss
#

use it already, no avail

#

_this select 0 by the way

little eagle
tough abyss
#

for the new vehicle

simple solstice
#

i dont know what were you refering to

#

just used this as an vehicle ;p

tough abyss
#

doesn't allow for abandoned distance to be implemented too, by the looks of it. Is there a different function for that?

#

I know AhoyWorld has a pretty one that that disables its physics during the respawn but I rather not use a 3rd party script in this one

simple solstice
#

but does the vehicle explode

#

when its allowDamage false?

frail zephyr
#

How does abandonded distance work in the module version? I'm sure you could whip something up that replicates it

scenic shard
#

if no player is within the distance they simply respawn it using the selected settings

frail zephyr
#

Yeah that doesn't seem too difficult to implement; might be an approach to take if nothing else works out for ya.

#

I say that now but then there are all the edge cases

scenic shard
#

btw, im playing around with BIS_fnc_UnitCapture but I cant seem to get it to work properly. I have used it fine in the past but now it won't detect when i press ESC to stop recording or F1 to save it to clipboard. It records fine, just won't detect my input =/

tough abyss
#

@simple solstice yea for some reason it still explodes. sqf _this select 0 allowDamage false; sleep 5; _this select 0 allowDamage true;

#

(using the respawn vehicle module)

frail zephyr
#

The only thing I can think of would be that you aren't selecting the right object to not allow damage on? I don't know the respawn module, always do it manually.

tough abyss
#

[<new_veh>,<old_veh>] are the passed arguments for the code

#

(according to the module itself)

scenic shard
#

_this select 0 is correct, used it earlier today fine

#

never had this issue with the module, do they explode at the start of the mission or randomly when respawning?

tough abyss
#

I was testing the respawn, placed an AT mine with zeus near it, detonated it (4 helicopters explode). One respawns completely fine, the other three become stuck in an endless loop of exploding and respawning

scenic shard
#

ok, so you did not move them from the respawn position?

tough abyss
#

nope

astral tendon
#

some times when i turn of and on my PC the mod selection from my arma 3 launcher resets

tough abyss
#

what looks from the fireball is that the respawn module doesn't place it back correctly, more like to the respawn of another vehicle and thus both explode before the module moving the respawned vehicle back to its initial spawn position

scenic shard
#

try to use "delete" instead of "delete with explosion effect" as Wreck setting, if you use that now. otherwise you could add a small delay to the respawn and a on kill eventhandler that removes the old wreck a few sec before the respawn

astral tendon
#

is there a way to save the selection?

tough abyss
#

it's already set with 'delete'

#

@astral tendon it literally says 'presets' with save/load/delete options on the top right.

#

how would this delay be implemented?

#

cause I am using this warFX mod that shows a clear fireball

#

and I can see the fireball moving from the position of another vehicle to the position of the initial position of the respawned vehicle

scenic shard
#

its in the module settings

astral tendon
#

fak, i though that was for the sethings and not the mods

tough abyss
#

oh that

#

it's already on 1800 seconds

scenic shard
#

ah, and the wreck lives for the same time?

tough abyss
#

the problem to me seems that the initial placement of the vehicle after respawn is the same as that of another vehicle and thus both explode

#

wreck lives a bit shorter

scenic shard
#

do you use respawn position modules or "starting position"?

tough abyss
#

starting position

scenic shard
#

odd, should not use another one's position then

tough abyss
#

well either it uses another vehicle's respawn position or the first placement of the vehicle after a respawn collides with the position of a vehicle that happens to be on that position. Both explodes, but the respawned vehicle gets moved to its init position 0.2 seconds after

#

resulting in two fireballs, and one of them switching from one position to another

#

it's literally only the helicopters doing it. I had 6 trucks less than a meter from eachother respawn all at the same time and they were perfectly fine

scenic shard
#

might be an issue with the helis then =/

tough abyss
#

alright thanks!

little eagle
#

BE whitelist?

#

Doesn't it block all SQF command by default or something like that. I never used it much myself.

rotund cypress
#

@vernal rune I have it myself, in my debug console I made, I remoteExec a function with compile in it, it blocks it.

#

I've tried to ask both here, Dwarden, other BIMINIONS, no one has a clue.

rotund cypress
#

How exactly is it blocking it? And what do you do?

#

@vernal rune

cloud thunder
#

@tough abyss are you using one module per vehicle or multiple vehicles linked to one module?

little eagle
#

Dumb parachutes are now teaching me the Lambert W function.

rotund cypress
#

@vernal rune you can suspend in a scheduled environment....

#

Spawn is for creating a new thread, its not a control structure like while or a command like sleep...

#

Obviously you cant

#

But just put a oef and check that instead

#

Much better than a new thread anyways

#

On each frame

queen cargo
#

...

rotund cypress
#

Then check if a conditions is met

queen cargo
#

not that discussion again

#

spawn bad bla

#

onEachFrame better bla

#

you do know that msot shit done in onEachFrame is what ppl mean when bad scripted mission is talked about?

#

because they clutter stuff that is scheduled?

#

onEachFrame has direct relation with framerate

#

continue using it as much as possible

#

maybe someday you archive 2 frames

rotund cypress
#

Not true @queen cargo

#

Its your only options if you are calling it

#

Even better using oef if function is used a lot

queen cargo
#

call != auto-unsuspended

#

as long as you are in a suspended environment, you can sleep

rotund cypress
#

Well it is if you are not calling it from a already scheduled thread

queen cargo
#

it is not

#

that is the whole point @rotund cypress

#

call is doing nothing but pushing a new scope and accessing the code block in there

#
  • putting input vars into _this
rotund cypress
#

Exactly ^, I suggested nothing else

#

@queen cargo

queen cargo
#

ohh ... missed the `not´

#

sry

#

well ... solution is always dead-sass simple

#

spawn

rotund cypress
#

Just call it in a scheduled environment

#

Then you can get a return

cloud thunder
#

^

queen cargo
#

give it a callback @vernal rune

rotund cypress
#

@queen cargo as long as you know what you are doing, there is nothing that says oef will issue bad framerate

#

If you stay under a certain execution time you will be fine

queen cargo
#

@rotund cypress oef will always affect framerate as engine will wait for it to finish execution

rotund cypress
#

’’’If you stay under a certain execution time you will be fine’’’

queen cargo
#

code then looks something like this then:

[<ARGS>, {<continueWithCode>}] call My_fnc_target;
#

’’’If you stay under a certain execution time you still affect framerate’’’

little eagle
#

Please do that, before people keep talking about dumb unrelated shit.

rotund cypress
#

Sounds like a bad way of doing it

#

Let server set the var on client

#

No need to make a function

#

Then you can also use pvar evh

#

Pvar evh

#

Public Variable Eventhandler

#

Eh?

#

Lol?

queen cargo
#

alternative variant:

X39_fnc_continueWith = {
    params ["_args", "_fnc", "_continueWith"];
    if (canSuspend) then
    {
        private _res = _args call _fnc;
        _res call _continueWith;
    }
    else
    {
        _this spawn X39_fnc_continueWith;
    };
};

[[1,2], Some_fnc_add, {hint _this;}] call X39_fnc_continueWith;
rotund cypress
#

RemoteExec has much more overhead than pvar @vernal rune

cloud thunder
#

^ + pvar has priority

queen cargo
#

setVariable

rotund cypress
#

Like what are you ’laughing out loud’ about? @vernal rune I am very curious

#

Thats what you use pvar evh for

#

.....

cloud thunder
#

setvar public has no priority

rotund cypress
#

@vernal rune enlighten me

little eagle
#
0 spawn {
    private _clientVar = random 5;

    {
        // the server
        private _serverVar = random 5;
        [_serverVar, {MyVar_RE = _this}] remoteExec ["call", remoteExecutedOwner];
    } remoteExec ["call", 2];

    waitUntil {!isNil "MyVar_RE"};
    private _serverVar = MyVar_RE;
    MyVar_RE = nil;

    systemChat str [_clientVar, _serverVar];
};

Does this make any sense to anyone?

rotund cypress
#

You can do that

#

And using remoteexec for that over pvar evh would just be stupid

#

instantly

#

That is why you use pvar

little eagle
#

The owner ids are pretty borked for RE, so idk if it works with publicVariableClient all the time.

rotund cypress
#

Never had any problems with it ^

little eagle
#

Try a local hosted save game.

rotund cypress
#

Well then you are ownerid 2

little eagle
#

So... Isn't what I posted more or less what was asked for?

rotund cypress
#

Cause you are also server when local

little eagle
#

Well then you are ownerid 2
Now load the game and you're 3

#

2 MIA

rotund cypress
#

MIA?

little eagle
#

Yep, just what I posted.

rotund cypress
#

2 is server

#

No shit

queen cargo
#

2 is not always server

little eagle
#

Missing in action (MIA) is a casualty classification assigned to combatants, military chaplains, combat medics, and prisoners of war who are reported missing during wartime or ceasefire. They may have been killed, wounded, captured, or deserted.

queen cargo
#

server can actually be anything from 0 to <MAX>

#

once had server at 11

#

was back in beta ... but still ...

little eagle
#

It can't be 1. And it can't be 0 unless you count SP I guess.

queen cargo
#

nothing is reserved for server

#

you just get usually lucky that the server is at 2

little eagle
#

2 is reserved for server
There is no 2 in a loaded local hosted game.

#

The documentation is a lie.

rotund cypress
#

Pointless discussion

little eagle
#

PV 2 would still refer to the server though.

#

Pointless discussion
Yep

#
0 spawn {
    private _clientVar = random 5;

    {
        // the server
        private _serverVar = random 5;
        [_serverVar, {MyVar_RE = _this}] remoteExec ["call", remoteExecutedOwner];
    } remoteExec ["call", 2];

    waitUntil {!isNil "MyVar_RE"};
    private _serverVar = MyVar_RE;
    MyVar_RE = nil;

    systemChat str [_clientVar, _serverVar];
};
rotund cypress
#

Variable

little eagle
#

last line. I just used systemChat, so something happens.

cloud thunder
#

[0,-2] select isDedicated

little eagle
#

No.

rotund cypress
#

-2 ???

little eagle
#

Everyone except 2

rotund cypress
#

Yes but why? @cloud thunder @little eagle

queen cargo
#

@vernal rune THEN USE CONTINUEWITHPATTERN

little eagle
#
0 spawn {
    private _clientVar = random 5;

    {
        // the server
        private _serverVar = random 5;
        [_serverVar, {MyVar_RE = _this}] remoteExec ["call", remoteExecutedOwner];
    } remoteExec ["call", 2];

    waitUntil {!isNil "MyVar_RE"};
    private _serverVar = MyVar_RE;
    MyVar_RE = nil;

    [_clientVar, _serverVar]
};
#

THERE IS YOUR RETURN

#

happy?

queen cargo
#

he wants that MyVar_RE in his current method commy

rotund cypress
#

You cannot get returns from re @vernal rune

#

You must set a var or re back

queen cargo
#

non-suspended environment receive var from suspended

#

impossible

little eagle
#

My function can. Just at least try to understand it...

queen cargo
#

only workaround is a continueWith variant

#

then enlighten us

#

how is it not possible to use any spawn

#

i know

#

you cannot return the future

#

unless you wait for it

#

waiting is only possible in suspended environment

#

there are workarounds, like a continueWith implementation
but you HAVE TO wait

little eagle
#

I have no idea what this is about anymore.

queen cargo
#

arma is not built to allow for that kind of communication

#

use extensions if it is that important for you

#

no

#

you just are not willed to listen

little eagle
#

^

queen cargo
#

either throw all stuff away or start to listen

little eagle
#

What does the server even do that is so important that it can't wait half a second?!

#

That's about how long it takes to send variables around.

queen cargo
#

why the hell you cannot use any continueWith implementation?

#

less @little eagle

little eagle
#

What is this about exactly?

cloud thunder
#

^ therse no realtime

queen cargo
#

what original problem @vernal rune

little eagle
#

Yeah. Even unscheduled scripts take their time.

queen cargo
#

you run a windows ... there is no realtime in windows

little eagle
#

And there is absolutely no chance to have this run in scheduled environment?

#
THIS_fnc_Ducky = {
    {
        // on the server
        private _serverVar = random 5;
        [_serverVar, {MyVar_RE = _this}] remoteExec ["call", remoteExecutedOwner];
    } remoteExec ["call", 2];

    waitUntil {!isNil "MyVar_RE"};
    private _serverVar = MyVar_RE;
    MyVar_RE = nil;

    _serverVar
};

Because this would solve your problem easily.

empty blade
#

Henlo

tough abyss
#

@little eagle He could just use a global array and use pushBack to get a return

#

From remoteExec you can.

empty blade
#

call then within the func []spawn{}

tough abyss
#

remoteExecCall you can't.

little eagle
#

You can't waitUntil from a call
Yes you can.

empty blade
#

Like geek said though I think u can do what he daid

tough abyss
#

He is doing it...

#

remoteExec -> Executed in scheduled environment

#

remoteExecCall -> Executed in non-scheduled.

little eagle
#
0 spawn {
    call {
        sleep 5;
        systemChat "hw";
    };
};
tough abyss
#

^

little eagle
#

There. sleep in call

empty blade
#

.....

queen cargo
#

@vernal rune why you need the result in that particular function?
why you cannot use a continueWith variant

tough abyss
#
0 spawn { //Scheduled // 
   call { //scheduled // {
          sleep 5;
        systemChat "hw";
   };
};
#

use an array.

little eagle
#

But then you cant get a return from the spawn commy

0 spawn {
    _var = call this_fnc_HERE
};

There, everything solved.

queen cargo
#

WHY NOT

empty blade
#

YEa

#

Private?

little eagle
#

You're not cut out for this, Duc0.

queen cargo
#
<somecode>
_res = [] call My_fnc_remote;
<continueWith>
#

look

tough abyss
#

Attacking people who are trying to help doesn't help...

queen cargo
#

now move that <continueWith> into either my, or the one commy posted

#

and you are fine

empty blade
#

👍🏻

queen cargo
#

i wont start using private in code areas that serve as example @empty blade ... i know about that stuff, not like i am a rookie

little eagle
#

It's not attacking if it's the truth.

queen cargo
#

now back to important questions: how the fuck to add product variants to Magento 2.1? (hint: obviously not expecting answer here)

little eagle
#

Apparently.

#

Yes I did, you just don't like it.

queen cargo
#

yet you still have not provided a reason why you cannot use our solutions

empty blade
#

Ye none of you can

#

You can script though

#

😂

queen cargo
#

post your code

#

all of it

#

point to the correct spots

#

and i tell you why you fail to listen @vernal rune

little eagle
#

Is this some elaborate trolling attempt?

queen cargo
#

start to believe in it ...

#

because ppl could steal it?

#

start private convo

#

send me the link

#

and i will check

little eagle
#

<---- there's the door

empty blade
#

he wants to get a return from remoteexec of some code I believe from like re to server to client I think ... I don't care tbh

queen cargo
#

that @little eagle

empty blade
#

@little eagle there is no door sir

queen cargo
#

@vernal rune you cannot explain why, you do not want to share your code with anybody

#

there is no way we can help you

#

if you are stubborn as this

little eagle
#

🍿

queen cargo
#

ok ok ok ...

rotund cypress
#

Oh boy

queen cargo
#

lemme quickly dig through my github

#

because you do not provide reason for whsy

tough abyss
#

Omg.

queen cargo
#

we tell you how you have to code

rotund cypress
#

@vernal rune 🥄 feed

tough abyss
#

My eyes...

queen cargo
#

and you do not fucking listen

little eagle
#

This is amazing.

rotund cypress
#

@vernal rune I think this is not the place for you

little eagle
#

Teach me. lol

queen cargo
#

neither you tell us properly why you cannot apply those things we post

tough abyss
#

burries head in sand has better things to do than listen to trolls

queen cargo
#

pick one

#

ahh

#

that

#

gimme 2 more secs

rotund cypress
#

We have told you multiple ways of returning something @vernal rune

queen cargo
#
0 spawn { //Scheduled // 
   call { //scheduled // {
          sleep 5;
        systemChat "hw";
   };
};```
#
THIS_fnc_Ducky = {
    {
        // on the server
        private _serverVar = random 5;
        [_serverVar, {MyVar_RE = _this}] remoteExec ["call", remoteExecutedOwner];
    } remoteExec ["call", 2];

    waitUntil {!isNil "MyVar_RE"};
    private _serverVar = MyVar_RE;
    MyVar_RE = nil;

    _serverVar
};```
```sqf
X39_fnc_continueWith = {
    params ["_args", "_fnc", "_continueWith"];
    if (canSuspend) then
    {
        private _res = _args call _fnc;
        _res call _continueWith;
    }
    else
    {
        _this spawn X39_fnc_continueWith;
    };
};

[[1,2], Some_fnc_add, {hint _this;}] call X39_fnc_continueWith;```
empty blade
#

Ohh damn he's the creator of that studio app

#

This is juicy !

rotund cypress
#

It is just impossible to get a return over RemoteExec @vernal rune

tough abyss
#

It isn't if it's a global variable.

rotund cypress
#

But you can send stuff over still

queen cargo
#

@vernal rune neither did we
we showed you solutions to your problem

rotund cypress
#

^

little eagle
#

Yes they are

queen cargo
#

you fail to extrapolate how those are not suitable for you and just say "they arent solutions"

rotund cypress
#

@vernal rune why the TEXT IN CAPITAL?

#

A bit rude, no?

queen cargo
#

because he tilts @rotund cypress

empty blade
#

I think there is a lot of missing content over what duc0 wants to achieve over his system ?

rotund cypress
#

Oh my god

#

🍿

empty blade
#

use Atwood rope @vernal rune

queen cargo
#

@lavish ocean please give us relieve

little eagle
#

stream it

rotund cypress
#

^

empty blade
#

Facebook live ?

rotund cypress
#

They would be too quick to ban it.

#

Maybe liveleak?

cloud thunder
#

But how are you supposed to wait until the var has been set
waitUntil {!isNil {_obj getVariable "Some_Var"}};

little eagle
#

^

rotund cypress
#

@vernal rune I suggest saving your typing, cause no one will want to help you anymore...

little eagle
#

Therefore scheduled environment.

queen cargo
#

...
why you cannot use any of those solutions we provided @vernal rune

#

and do not start again with THEY ARE NO SOLUTIONS

rotund cypress
#

Go back to stealing code I guess @vernal rune

cloud thunder
#

I waituntill all the time outside of unsheduled enviroment

little eagle
#

They're good solutions. Or at least good places to start.

empty blade
#

come on guys no need to throw accusations of content stealers

queen cargo
#

^+1

scenic shard
#

hard to imagine someone this rude still getting help, like your dedication 👍

empty blade
#

let's all sit back relax and have popcorn

rotund cypress
#

🍿

queen cargo
#

@scenic shard it is 🍿 time, no dedication

#

already gave you my github link

#

besides some old projects i deleted, all are on there

#

pick any of them

#

simple answer

little eagle
#

x39 is a talentless hack : >

queen cargo
#

@little eagle that was rude 😦

little eagle
#

shots

#

fired

rotund cypress
#

IM sure you can make something better @vernal rune

#

Too bad there is no kappa emoji on here

empty blade
#

the ending to his convo is gonna be fire

#

🔥🔥

rotund cypress
#

Maybe if you would be a bit better coder, you could've made a dialog without any of these tools @vernal rune

tough abyss
#

UI is not are hard as you think it's all event driven.

rotund cypress
#

Sorry, if you would be a coder.

tough abyss
#

And base-class defined tree structure.

queen cargo
#

lemme repeat @vernal rune ... pick one ...
https://github.com/X39/ObjectOrientedScripting (c#)
https://github.com/X39/sqf-vm (c)
https://github.com/X39/ArmA-UI-Editor (c#)
https://github.com/ArmA-Studio/ArmA.Studio (c#)
https://github.com/X39/Project-Alcatraz
https://github.com/X39/XMS2
https://github.com/X39/XInsurgency (auto-gen, use OOS_Insurgency for actual code)
https://github.com/X39/XLib
https://github.com/X39/XMedSys1

take any of theese and leave please @vernal rune
🍿 time is over, you are the worst troll ever

tough abyss
#

Starting in controls[] = { } class declaration.

#

etc.

#

then the other UI elements are embedded in those.

#

The top class name is whatever you define first.

#

UI ressembles OOP. Having base-classes and child classes.

rotund cypress
#

I make most dialogs from code

cloud thunder
#

DucO you've provided no code only pseudo example. even if you wanted to keep your actual code you could rewite code to server as example and maybe get more constrivite applicable answers but it all speculative at this point so its pointless no .

queen cargo
#

config is barely OOP based

rotund cypress
#

I have a hard time believing you can do any code @vernal rune

little eagle
#

Is it over?

rotund cypress
#

Is it at all? @queen cargo

empty blade
#

Code is my sexual partner

rotund cypress
#

No objects, just classes, no? @queen cargo

cloud thunder
#

i hope , can't keep up with the chicken coop banter

tough abyss
#

Well technically if you want to look at it from a programmers perspective, ArmA 3 SQF isn't really "code"

empty blade
#

script

tough abyss
#

It's script, clear difference.

empty blade
#

Scripting you're a scripted

#

scripter *

queen cargo
#

@rotund cypress more or less ... the : is actually just a sort of lookup

#

that then checks until it hits root

tough abyss
#

Python is script, yet python is actual programming language but 🤷

cloud thunder
#

X39 has publicy released some code on various places. I think I used a bit of it in BMR Insurgency... it is good..

little eagle
#

Yes, but you can't compare that to the great Duc0 and his secret super code.

queen cargo
#

😄

rotund cypress
#

@queen cargo : is the operator for specifying a inherit class

#

No?

queen cargo
#

@rotund cypress and what happens in reality? config parser just looks in the upper classes

rotund cypress
#

Of course, but I wouldn't say its any OOP?

queen cargo
#

it is no OOP

#

just some sort of XML

rotund cypress
#

Exactly

#

But you said OOP

queen cargo
#

tbh ... they would be better off with XML

#

was in response to someone

rotund cypress
#

config is barely OOP based in my eyes, barely would point to "a bit" or "parts of"

#

Which in reality is entirely false

#

As there is no instances or any objects at all

#

Just classes

tough abyss
#

@queen cargo I'd agree.

#

But it still tries to ressemble OOP

rotund cypress
#

And ye, these configs are just cheesy

tough abyss
#

There is both child and base classes

queen cargo
#

c++*

tough abyss
#

But beyond that no they don't have anything else.

scenic shard
#

@tough abyss scripting does not require a explicit compilation step, code does. pretty much the only difference afaik

rotund cypress
#

I assume you meant any of your other projects in other languages then 😉 @queen cargo

tough abyss
#

^

rotund cypress
#

Interpreter

queen cargo
#

UI ressembles OOP. Having base-classes and child classes. @tough abyss wrote this and i just responded @rotund cypress
first thought you talked about something else

#

and that was the whole point @vernal rune we all cannot know and work with what you provide us
give is more and we can tell you how to adjust to make it work

little eagle
#

You make me agree with X39!!

queen cargo
#

and me with commy ...

#

and that is no stable state in this channel

#

that is actually a toxic state

little eagle
#

Its a simple concept ok
You'd think.

queen cargo
#

and we told you how that "simple" concept can be solved in SQF

tough abyss
#

Programmers need to communicate...

#

First thing C# book started teaching

#

Programmers are "good communicators"

queen cargo
#

first lecture in my book would be you know nothing, ever

#

so you go one scope higher and apply a continueWith pattern there

#

thats why i posted you a continueWith method at all
so that you can take it, and put it where it is needed

cloud thunder
#

to pseudo again for me.

queen cargo
#

@cloud thunder problem is:

...
[] call {
    ...
    [] call {
        //Our actual problematic scope and reason we talk
        _x = <solution>
        _x
    };
};
...```
rotund cypress
#

@vernal rune: Yeah @X39 You actually have some respectable code Ill give you that, but im still not saying you have a clue what im on about
I am sure you are the one person to be able to judge if someone has "respectable code", with your amount of competence.

cloud thunder
#

but you can do call withinin call. I think i;ve done that..

#

Um really don't want to see it at all anymore.. I told you rewrite it so you could get constructive response ..

queen cargo
#

@vernal rune yes ... we all in this channel just want to steal code
i personally already took @little eagle code snippet and put it somewhere in my code so that i got more lines

rotund cypress
#

When you have the same amount of coding hours as X39 @vernal rune, you can come back and say things...

#

When people are trying to help you, don't give them crap and say they don't have a clue what they're on about, just because you do not like the answer.

queen cargo
#

omfg ...

tough abyss
#

Get the ban hammer ready.

queen cargo
#

where is @open vigil when you need him?

rotund cypress
#

My reading is just fine @vernal rune

#

I didn't quote you.

cloud thunder
#

noone knows what your on about Duc0

queen cargo
#

why we talk to you at all ..

rotund cypress
#

Quotes are with ""

tough abyss
#

My brain is just dieing from this...

rotund cypress
#

Yes, you were saying people do not know anything about your problem...

queen cargo
#

and another happy customer

rotund cypress
#

Another guy who ruined his reputation in the ArmA community, good lock ducko 🍿

queen cargo
rotund cypress
#

^

robust hollow
#

what

queen cargo
#

🤣

little eagle
#

I'm behind 5 proxies.

queen cargo
#

200 here

#

omfg

rotund cypress
#

😂 🍿

#

200 is not enough @queen cargo 450 subnesh maltrillion meshes

queen cargo
#

IP => Intellectual Property
that kind of stuff you do not have

rotund cypress
#

is about right

#

😂 😂 😂

#

that kind of stuff you do not have 🔥 🔥 🔥 🔥

queen cargo
#

Well one would, when i've spent like an hour explaining the same problem and you responding with the same thing still thinking its right when ive said that it isnt
you got solutions that work for what you explained

#

and yet have to explain why

#

and do not start again with CUZ NO WORK

little eagle
#

The posted solutions work just fine.

#

If you say they don't, then it shows that you don't understand them. Nothing more.

queen cargo
#

i know
it is called: artistic freedom

#

Tipp for you @vernal rune
either start providing proper code so that we can explain, as your communication skills suck so bad that i would want them to pay me for letting it suck me off
or stop right here

#

🤦🤦🤦🤦

little eagle
queen cargo
#

maybe we approach this from the wrong side ...

#

see ...

#

we do not have any knowledge of your code

#

whole situation you explained is this

#
...
_res = [] call magic;
...

that is all

#

we showed you how you can solve this

#
...
[_res, magic, {
....
} call continueWith;
#

and you just said THAT SOLUTION IS NOT WORKING

#

and showed of your example again

#

[@vernal rune] call banhammer

cloud thunder
#

must be lifer or want to monitize

queen cargo
#

i offer you this one more time: send me a link to your code or fuck off ... using this as excuse for actual work i get paid for

#

sadly community is not yet doing so (bad community)

#

good

#

in case you did not noticed
i am the last person in this whole channel that was willed to help you

#

you literally lost ALL here

tough abyss
#

xD

queen cargo
#

I'm getting paid sitting here good way to get your SQF based job then lost ....
by ruining reputation in the only community that is actually able to help you

little eagle
#

No one would pay you for that.

#

Don't even have talent.

#

truth

queen cargo
#

i highly doubt you get paid at all at this point as i expect you to be in the age range of 8-14

rotund cypress
#

🍿

queen cargo
#

looks like an interesting server

rotund cypress
#

You have an interesting friend circle ^

#

No one that I would like to hang out with

#

oooh 🔥

#

Keep it down with the personal insults, big man!

queen cargo
#

now i am sure i talk with someone at the age of 13, ty @rotund cypress

little eagle
#

"Arma leaks"? Is this some kind of piracy related stuff?

rotund cypress
#

Yes

little eagle
#

@open vigil

rotund cypress
#

They posted a lot of private missions

cloud thunder
#

sell hacks

queen cargo
#

offline @little eagle

#

already mentioned

#

just like dwarden

#

ahhh wait

tough abyss
#

I have an idea.

#

@queen cargo

#

#block

#

All of us block him

#

ignore him.

queen cargo
#

suggested ages ago

tough abyss
#

He'll PoQ

queen cargo
#

nobody followed

tough abyss
#

Already done

#

Much better.

rotund cypress
#

Somewhere else 👋

queen cargo
#

omfg ... i am still not sure if trolling or if serious

rotund cypress
#

😂

little eagle
#

Love love love this channel.

cloud thunder
#

need battle eye for arma discord

queen cargo
#

we need to get the toxicity grade back to normal level @little eagle ... Macros are crap

little eagle
#

And I'm not even the main attraction today.

rotund cypress
#

Macros are crap
Oh deer

queen cargo
#

cannot continue living in peace with commy2

rotund cypress
#

Then it would end up in an even worse shape I suppose 😂 @cloud thunder

cloud thunder
#

but you guys kissed

rotund cypress
#

Well @queen cargo I keep going back in fourth, liking them or not liking them

queen cargo
#

simple rule in this channel: the moment commy2 and i agree, something is very very wrong

cloud thunder
#

back and forth, was it only a fling?

rotund cypress
#

Its for sure I am trying to stay absolute minimal with macros at least

tough abyss
#

So this is bad?

#
#define NUMBER_OF_IEDS_TO_CREATE 30;    
#

?

queen cargo
#

thats a constant

little eagle
#

Yes. The = is wrong and so is the ;

rotund cypress
#

=?

tough abyss
#

Oops

#

better?

little eagle
#

No

rotund cypress
#

There is no constants in ArmA @queen cargo

little eagle
#

;

rotund cypress
#

Or am I wrong?

little eagle
#

It's called "Arma"

#

Not "ArmA"

tough abyss
#

Don't even need the ; ?

queen cargo
#

no, youre right
but there are also no macros in arma

#

only in the preproc

little eagle
#

Nope, the ; breaks it

rotund cypress
#

#define h 10

tough abyss
#

ah k

rotund cypress
#

Constant in C/C++ ^

queen cargo
#

variable in c/c++

#

or more: syntax error

rotund cypress
#

Sorry, look now @queen cargo

tough abyss
#

No more horrendous names :D

#define NUMBER_OF_IEDS_TO_CREATE 30                                //Number of IEDs on map
#define DETONATE_IED_WITH_WEAPONS true                    //Can the IED be killed with weapons?            
#define DEBUG_MARKERS true                        //Show IED markers on map?                    
queen cargo
#

define in c/c++

#

const int a = 1;
int const a = 1;

tough abyss
#

^

rotund cypress
#

Thats not a real constant ^^

tough abyss
#

I think you can use #define in C

rotund cypress
#

You can

tough abyss
#

Yep.

rotund cypress
#

const int a = 1; is not really a REAL constant

tough abyss
#

ArmA 3's screwed like that.

#

ForEach, (PHP / C#) , #define from C

#

#include from C++ / C

queen cargo
#

that is a constant in ANSI C

tough abyss
#

What a frigging mess.

rotund cypress
#

#define NUMBER 10 would be the real constant AFAIK

#

In C/C++

queen cargo
#

no
that is a define (or macro)

little eagle
#

Shh, someone wants help.

tough abyss
#

What he messaging you?

#

nowi ?

scenic shard
#

So this is bad?
#define NUMBER_OF_IEDS_TO_CREATE 30;

yes, too many IEDs 😦

queen cargo
#

wont work due to the ;

#

#define NUMBER_OF_IEDS_TO_CREATE 30

rotund cypress
#

It's a define, but still a constant @queen cargo

little eagle
#

It was a joke.

tough abyss
#

Crappy function is crappy

#
iedAct = {
            _iedObj = _this select 0;
        if (mineActive _iedObj) then {
            _iedBlast = selectRandom iedBlast;
            createVehicle [_iedBlast,(getPosATL _iedObj),[],0,""];
            createVehicle ["Crater",(getPosATL _iedObj),[],0,""];
            {
                deleteVehicle _x;
            } forEach nearestObjects [ getPosATL _iedObj, iedJunk, 4];
        deleteVehicle _iedObj;

        };
};
#

Re-write it.

queen cargo
#

@rotund cypress after the preproc is done, it gets passed to the actual compiler which then takes the VALUE from the define
real constants need to be language based
not preprocessor based

little eagle
#

30

#

is a constant

rotund cypress
#

Sorry, but I didn't quite understand what you said there @queen cargo

tough abyss
#

is not better than !

#

or || instead of or?

rotund cypress
#

I was not talking about SQF so you know

tough abyss
#

or && instead of and ?

rotund cypress
#

I was talking about C/C++

#

I know in SQF all macros are preproc

tough abyss
#

which is better the symbols?

#

or the word?

queen cargo
#

preprocessor is a separate level of the chain
constants need to be known at compile time
preprocessor will just replace text with whatever you defined

-->

#define foo 2

foo call fnc_bar```
gets
```sqf
2 call fnc_bar```
tough abyss
#

^

rotund cypress
#

Ye exactly

tough abyss
#

It's for convience.

rotund cypress
#

But that is not the case in C/C++, no?

queen cargo
#

it is even more clear in c/c++

rotund cypress
#

I mean in C/C++ they are not preproc

queen cargo
#

they are in there too

rotund cypress
#

Hmm, let me read

queen cargo
#

preprocessor is a separate level of the toolchain

#

you could code c/c++ and sqf too without it completly

#

but it would not make things easier

rotund cypress
#

I see, alright

queen cargo
#

difference gets more clear in languages that do have preprocessors but no way of defining macros
eg. c#

#

you can add defines as flags but to create a constant, you need to use language tools

#

the compiler then still does just what the preproc does too

#

but it is the level in the toolochain that differs

rotund cypress
#

Alright, but all I can say is, that from what I have learnt with C, is that using const does not give you a real real constant

queen cargo
#

how is that not real-real

rotund cypress
#

ye

#

i needa go to bed now, too late

#

was fun, later 💤

queen cargo
#

gn8

tough abyss
#

Why do I get the feeling processing this IED list first would be faster and more efficient.

#

Generates the random IEDs and junk first then places them.

slender halo
#

is copyToClipboard limited ?

queen cargo
#

@slender halo format is

little eagle
#

Ae^(kt)+Bt+C=0
Solve for t.

queen cargo
#

use formatText or +

#

or ... str

slender halo
#

can you explain ?

queen cargo
#

copyToClipboard format[...] is limited to the limit of format

little eagle
#

Every string can only be 1e7 chars long or something like this.

#

With format it's like 8000 chars

slender halo
#

From Arma 3 v1.55.133789 strings are limited to maximum of 9,999,999 (sometimes 10,000,000) characters

little eagle
#

Yep.

slender halo
#

i use + so it should be ok

#

thanks

tough abyss
#
buildList = [];
for "_k" from 1 to NUMBER_OF_IEDS_TO_CREATE do {
        buildList pushBack [(selectRandom iedJunk),(selectRandom iedList),selectRandom(iedBlast)];
};
#

OK?

#

I found out how to massively improve this IED script

#

Nested arrays then using (_x select 0 <-> 2) to pull the data out.

#

@queen cargo ?

queen cargo
#

mhh?

tough abyss
#

Is that better ?

#

The code I placed above?

#

It eliminated multiple calls to selectRandom

#

Pre-compute the results then just feed them into the code using _x select 0 etc/

queen cargo
#

did not saw what it was before
but it is a start

#

or more: it is ok

#

looks good

#

and besides the selectRandom it even is executable in sqf-vm of mine ❤

rose hatch
#

Is there a way to prevent the weight of pylon weapons from affecting helicopter flight performance?
Only thing I can think of is using a negative setCustomWeightRTD value inside of a weapon fired eventHandler i.e. adjust the vehicle weight each time a pylon weapon is fired.

#

But that doesn't sound like it would be kind to performance...

#

Simply setting the weight once won't work because after all weapons are fired the vehicle will weight way less than it should when empty...

cloud thunder
#

pylon weapons don't have weight that affects flight performance.

rose hatch
#

Helicopters do, at least they do with the AFM

#

Load two bombs on a pawnee and it'll barely take off

#

^Not that I plan to load bombs, but rather just disable weapon weight in general because why not

cloud thunder
#

oh maybe helis donn't know for sure but deff not fixed wing and bis announced they probably are not going to make it a thing. Is that with or without AFM Nutter?

rose hatch
#

Pylon weapon weight affects flight performance when using AFM

#

Haven't tested without AFM, but I think it still does...

cloud thunder
#

k makes sence. Your original solution doesn't sound like it would be performance heavy..

hallow spear
#

anyone else work in a store? ```sqf
aph_ChangeDue = {
params ["_changeDue"];
_quarters = 0;
_dimes = 0;
_nickels = 0;
_pennies = 0;

while { _changeDue >= 25 } do 
{
    _quarters = _quarters + 1;
    
    _changeDue = _changeDue - 25;
};

while { _changeDue >= 10 } do 
{
    _dimes = _dimes + 1;
    
    _changeDue = _changeDue - 10;
};

while { _changeDue >= 5 } do 
{
    _nickels = _nickels + 1;
    
    _changeDue = _changeDue - 5;
};

while { _changeDue > 0 } do 
{
    _pennies = _pennies + 1;
    
    _changeDue = _changeDue - 1;
};

[_quarters, _dimes, _nickels, _pennies];

};```

queen cargo
#

uhm .. what?

hallow spear
#

giving correct change, and letting the computer do the thinking

tough abyss
#
buildList = [];
_iedsCreated = [];
for "_k" from 1 to NUMBER_OF_IEDS_TO_CREATE do {
        buildList pushBack [(selectRandom iedJunk),
                                                (selectRandom iedList),
                                                (selectRandom iedMarkers)];
};

private ["_junkType","_iedType","_iedArea",
                 "_iedRoadsPos","_randRoadObj","_iedBomb",
                 "_iedPos",""];

{

    _junkType = _x select 0;
    _iedType = _x select 1;
    _eachMarker = _x select 2;
    _iedArea = (getMarkerSize _eachMarker) select 0;
    _iedRoadsPos = getMarkerPos _eachMarker;
    _iedRoads = _iedRoadsPos nearRoads _iedArea;
    diag_log format ["Nil value found %1",_iedRoads find nil];
    diag_log format ["_iedRoads: %1",_iedRoads];
    randRoadObj = selectRandom _iedRoads;
    diag_log format ["_randRoadObj %1",_randRoadObj];

    _iedBomb = createMine [_iedType,getPosATL (randRoadObj),[],8];
    _iedBomb setPosATL(getPosATL _randRoadObj select 2 + 1);
    _iedBomb setDir(random 359);
    _iedJunkObj = createVehicle [_junkType,getPosATL _iedBomb,[],0,""];
    _iedJunkObj setPosATL(getPosATL _iedBomb select 2 + 1);
    _iedJunkObj enableSimulationGlobal false;

    if ( DEBUG_MARKERS ) then {
            _iedPos = getPosWorld _iedBomb;
            _mkrID = format ["m %1",_iedPos];
            _mkr = createMarker [_mkrID,getPosWorld _iedBomb];
            _mkr setMarkerShape "ICON";
            _mkr setMarkerType"mil_dot";
            _mkr setMarkerBrush"Solid";
            _mkr setMarkerAlpha 1;
            _mkr setMarkerColor"ColorEast";
        };
} forEach buildList;
#

Explain to me why randRoadObj constantly comes back saying variable is undefined?

#

Maybe I should wrap it into a function.

#

Ehhh yeah why not.

#

It would make it more usable.

cloud thunder
#

I'd not make it a function till at all works. Maybe nearroads is returning empty array if it can't find a road so count if nearroad array is > 0 then select road and do rest of code. Why private "" empty string?

tough abyss
#

Found the issue with the code.

#

null

#

a null return from the nearRoads code.

#

How do you check if something is null?

#

if you can do that?

#

@cloud thunder ?

cloud thunder
#

(_obj isEqualTo objNull)

tough abyss
#

Can't use isEqualToType?

#

Seriousl type is object

#

needed boolean...

#

What...

#

Error position: <!_randRoadObj isEqualType objNull)

#

Error !: Type Object, expected Bool

#

Error position: <!_randRoadObj isEqualTo objNull) then {

#

Error !: Type Object, expected Bool

#

Huh?

robust hollow
#

no start (?

tough abyss
#

"_iedRoads: []"
"_randRoadObj <null> \n"

#

It keep dumping null

#

not object null

#

Could it be the array is too big?

#
"_iedRoads: [107566: asf10 100.p3d,107565: asf12.p3d,107563: asf10 100.p3d,107564: asf12.p3d,107562: asf12.p3d,107561: asf12.p3d,107560: asf12.p3d,107568: asf10 100.p3d,107570: asf12.p3d,107569: asf12.p3d,107567: asf10 100.p3d,168636: asf12.p3d,107572: asf12.p3d,166637: asf12.p3d,107571: asf12.p3d,168639: asf10 100.p3d,168638: asf10 100.p3d,168637: asf12.p3d,168736: asf10 100.p3d,168640: asf10 100.p3d,168641: asf10 100.p3d,25447: sil12.p3d,25444: sil12.p3d,457532: sil6konec.p3d,168737: asf10 100.p3d,168738: asf12.p3d,168734: asf6konec.p3d,168720: asf12.p3d,168721: asf12.p3d,168719: asf10 50.p3d,168740: asf6konec.p3d,168742: asf6.p3d,162009: most_bez_lamp.p3d,54068: most_bez_lamp.p3d,168717: asf10 50.p3d,168714: asf10 50.p3d,168715: asf10 50.p3d,168718: asf10 50.p3d,168716: asf10 50.p3d,25811: asf10 75.p3d,25812: asf10 75.p3d,25810: asf10 75.p3d,25813: asf10 75.p3d,25814: asf10 75.p3d,54128: most_bez_lamp.p3d,25816: asf25.p3d,25817: asf25.p3d,26330: asf25.p3d,582935: asf12.p3d,26331: asf25.p3d,582937:
#

Thats a lot of OBJ entries.

#

resize the array?

#

to as many entries are needed?

cloud thunder
#

isEqualToType is not a command. a nullobject isEqualType objNull . _randRoadObj in last post but code is using global var?

tough abyss
#

Oh it got changed.

#
buildList = [];
_iedsCreated = [];
for "_k" from 1 to NUMBER_OF_IEDS_TO_CREATE do {
        buildList pushBack [(selectRandom iedJunk),
                                                (selectRandom iedList),
                                                (selectRandom iedMarkers)];
};

private ["_junkType","_iedType","_iedArea",
                 "_iedRoadsPos","_randRoadObj","_iedBomb",
                 "_iedPos"];

{

    _junkType = _x select 0;
    _iedType = _x select 1;
    _eachMarker = _x select 2;
    /*
    _iedArea = (getMarkerSize _eachMarker) select 0;
    _iedRoadsPos = getMarkerPos _eachMarker;
    _iedRoads = _iedRoadsPos nearRoads _iedArea;
    */
    _iedRoads = [_eachMarker] call findRoads;
    diag_log format ["Nil value found %1",_iedRoads find nil];
    diag_log format ["_iedRoads: %1",_iedRoads];
    _randRoadObj = selectRandom _iedRoads;
    diag_log format ["_randRoadObj %1 \n",_randRoadObj];
    if !(_randRoadObj isEqualTo objNull) then {

    _iedBomb = createMine [_iedType,getPosATL (_randRoadObj),[],8];
    _iedBomb setPosATL(getPosATL _randRoadObj select 2 + 1);
    _iedBomb setDir(random 359);
    _iedJunkObj = createVehicle [_junkType,getPosATL _iedBomb,[],0,""];
    _iedJunkObj setPosATL(getPosATL _iedBomb select 2 + 1);
    _iedJunkObj enableSimulationGlobal false;

    if ( DEBUG_MARKERS ) then {
            _iedPos = getPosWorld _iedBomb;
            _mkrID = format ["m %1",_iedPos];
            _mkr = createMarker [_mkrID,getPosWorld _iedBomb];
            _mkr setMarkerShape "ICON";
            _mkr setMarkerType"mil_dot";
            _mkr setMarkerBrush"Solid";
            _mkr setMarkerAlpha 1;
            _mkr setMarkerColor"ColorEast";
        };
    } else {
        _iedRoads = [_eachMarker] call findRoads;
    };

} forEach buildList;

sleep 5;
{
    CIVILIAN revealMine _x;
    EAST revealMine _x;
} forEach allMines;


diag_log count(buildList);
#

_randRoadObj on the final run fails and returns null

cloud thunder
#

whats findRoads

tough abyss
#
//Get all road positions

params ["_marker"];

_iedArea = (getMarkerSize _marker) select 0;
_iedRoadsPos = getMarkerPos _marker;
_iedRoads = _iedRoadsPos nearRoads _iedArea;
_iedRoads;
#

systemChat to the rescue

#

entries several of them have null

queen cargo
#

the way you build the code, it gets very hard to debug

#

instead of working like you do it right there, try to first get all data and then just process it
eg. create an array [<markername>, <iedarea>, <iedRoads>, ...] and then use that

#

using params you then can put each element into a variable

tough abyss
#

Already have.

#

Yeah I know.

queen cargo
#

that array in the endoutput then is WAY easier to debug

tough abyss
#

This is still a prototype.

queen cargo
#

as you can see at glance then what is the source

tough abyss
#
buildList = [];
_iedsCreated = [];
for "_k" from 1 to NUMBER_OF_IEDS_TO_CREATE do {
        buildList pushBack [(selectRandom iedJunk),
                                                (selectRandom iedList),
                                                (selectRandom iedMarkers)];
};

private ["_junkType","_iedType","_iedArea",
                 "_iedRoadsPos","_randRoadObj","_iedBomb",
                 "_iedPos"];

{

    _junkType = _x select 0;
    _iedType = _x select 1;
    _eachMarker = _x select 2;
    /*
    _iedArea = (getMarkerSize _eachMarker) select 0;
    _iedRoadsPos = getMarkerPos _eachMarker;
    _iedRoads = _iedRoadsPos nearRoads _iedArea;
    */
    _iedRoads = [_eachMarker] call findRoads;
    diag_log format ["Nil value found %1",_iedRoads find nil];
    diag_log format ["_iedRoads: %1",_iedRoads];
    _randRoadObj = selectRandom _iedRoads;
    diag_log format ["_randRoadObj %1 \n",_randRoadObj];
    if !(_randRoadObj isEqualTo objNull) then {

    _iedBomb = createMine [_iedType,getPosATL (_randRoadObj),[],8];
    _iedBomb setPosATL(getPosATL _randRoadObj select 2 + 1);
    _iedBomb setDir(random 359);
    _iedJunkObj = createVehicle [_junkType,getPosATL _iedBomb,[],0,""];
    _iedJunkObj setPosATL(getPosATL _iedBomb select 2 + 1);
    _iedJunkObj enableSimulationGlobal false;

    if ( DEBUG_MARKERS ) then {
            _iedPos = getPosWorld _iedBomb;
            _mkrID = format ["m %1",_iedPos];
            _mkr = createMarker [_mkrID,getPosWorld _iedBomb];
            _mkr setMarkerShape "ICON";
            _mkr setMarkerType"mil_dot";
            _mkr setMarkerBrush"Solid";
            _mkr setMarkerAlpha 1;
            _mkr setMarkerColor"ColorEast";
        };
    } else {
        _iedRoads = [_eachMarker] call findRoads;
    };

} forEach buildList;

sleep 5;
{
    CIVILIAN revealMine _x;
    EAST revealMine _x;
} forEach allMines;


diag_log count(buildList);
#

The only error in the entire thing

#

is 1 variable

#

the returning of the actual road obj.

#

One thing to note

#

this is a community map

#

Sarahani

#

2120

#

is what _iedRoads returns

#

count _iedRoads(2120)

queen cargo
#
buildList = [];
_iedsCreated = [];
for "_i" from 1 to NUMBER_OF_IEDS_TO_CREATE do {
        buildList pushBack [(selectRandom iedJunk), (selectRandom iedList), (selectRandom iedMarkers)];
};

private ["_junkType","_iedType","_iedArea", "_iedRoadsPos","_randRoadObj","_iedBomb", "_iedPos"];

buildList = {
    _x params ["", "", "_eachMarker"];
    private _pos = getMarkerPos _eachMarker;
    _x pushBack _pos;
    private _range = (_pos select 0) max (_pos select 1);
    private _roads = _pos nearRoads _range;
    _x pushBack _roads;
} apply buildList;

{
    _x params ["_junkType", "_iedType", "_eachMarker", "_iedRoadsPos", "_iedArea", "_iedRoads"];
    _randRoadObj = selectRandom _iedRoads;
    if !(_randRoadObj isEqualTo objNull) then {
        _iedBomb = createMine [_iedType, getPosATL (_randRoadObj), [], 8];
        _iedBomb setPosATL(getPosATL _randRoadObj select 2 + 1);
        _iedBomb setDir(random 359);
        _iedJunkObj = createVehicle [_junkType, getPosATL _iedBomb, [], 0, ""];
        _iedJunkObj setPosATL(getPosATL _iedBomb select 2 + 1);
        _iedJunkObj enableSimulationGlobal false;
#ifdef DEBUG_MARKERS
        _iedPos = getPosWorld _iedBomb;
        _mkrID = format ["m %1", _iedPos];
        _mkr = createMarker [_mkrID, getPosWorld _iedBomb];
        _mkr setMarkerShape "ICON";
        _mkr setMarkerType"mil_dot";
        _mkr setMarkerBrush"Solid";
        _mkr setMarkerAlpha 1;
        _mkr setMarkerColor"ColorEast";
#endif
    } else { _iedRoads = [_eachMarker] call findRoads; };
} forEach buildList;
sleep 5;
{ CIVILIAN revealMine _x; EAST revealMine _x; } forEach allMines;
diag_log count(buildList);``` already more easy to check now
#

check the buildList now

#

will give you more relations

cloud thunder
#

lots of code to debug. but yeah for starters these are undefined iedList iedMarkers and still not findroads function there.

queen cargo
#

just overwhelming many commands

#

could be reduced if you only use the create commands
not rly matches minified example tbh 😄

tough abyss
#

ohh

#

Didn't know you could do that with params

#

Thats so much better than _x select 0;

#

Whats the purpose of max ?

queen cargo
#

another mistake you made btw. _iedBomb setPosATL(getPosATL _randRoadObj select 2 + 1);

#

needs to be _iedBomb setPosATL((getPosATL _randRoadObj select 2) + 1);

#

unless you want the 4th element

#

though ... that whole line is crap ...

tough abyss
#

What should I do instead?

queen cargo
#

you already pass the position

#

you tried to move the mine one unit higher?

tough abyss
#

This was that Phronk guys code.

#

I've had to rebuild it from the ground up.

#

Getting very close to scrapping most of it.

queen cargo
#

better do that

tough abyss
#

Doesn't create mine make the IED live anyway?

queen cargo
#

a wonder it is working at all

#

getPosATL _iedBomb select 2 + 1 literaly means getPosATL _iedBomb select (2 + 1)

tough abyss
#
_trig setTriggerStatements [
            "{
                vehicle _x in thisList && speed vehicle _x>4
             } count playableUnits > 0",
            "
            {
                if ((typeOf _x)in iedAmmo) then {
                    [_x] call iedAct;
                };
            } forEach nearestObjects[thisTrigger,[],10];",
            "deleteVehicle thisTrigger"];
         } else {
                _trig setTriggerStatements [
                    "{
                        vehicle _x in thisList && isPlayer vehicle _x && speed vehicle _x > 4
                     } count allUnits > 0",
                    "{
                            if ((typeOf _x)in iedAmmo) then {
                                [_x] call iedAct;
                            };
                     } forEach nearestObjects[thisTrigger,[],10];",
                    "deleteVehicle thisTrigger"];
        };
#

Is what he was using to set them off.

#

As I said doesn't createMine OBJ make it live?

queen cargo
#

depends on the object

tough abyss
#

Trigger isn't necessary.

queen cargo
#

some wont explode on proximity

tough abyss
#
iedList = ["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F"];
#

?

queen cargo
#

idk

#

check it

#

create on below the player

#

and walk around

tough abyss
#

haha

#

Okay...

#

Bomb setDamage 1 ; = IED boom

#

But it won't proximity go off.

queen cargo
#

thats always boom for any of em

#
buildList = [];
for "_i" from 1 to NUMBER_OF_IEDS_TO_CREATE do { buildList pushBack [(selectRandom iedJunk), (selectRandom iedList), (selectRandom iedMarkers)]; };

buildList = {
    _x params ["", "", "_eachMarker"];
    private _pos = getMarkerPos _eachMarker;
    _x pushBack _pos;
    private _range = (_pos select 0) max (_pos select 1);
    private _roads = _pos nearRoads _range;
    _x pushBack _roads;
} apply buildList;

{
    _x params ["_junkType", "_iedType", "_eachMarker", "_iedRoadsPos", "_iedArea", "_iedRoads"];
    _randRoadObj = selectRandom _iedRoads;
    if !(isNull _randRoadObj) then {
        _iedBomb = createMine [_iedType, _pos, [], 8]; _iedBomb setDir random 360;
        _iedJunkObj = createVehicle [_junkType, getPosATL _iedBomb, [], 0, ""];
#ifdef DEBUG_MARKERS
        _mkr = createMarker [format ["m %1", position _iedBomb select [0, 2]], position _iedBomb select [0, 2]];
        _mkr setMarkerShape "ICON"; _mkr setMarkerType "mil_dot"; _mkr setMarkerBrush "Solid"; _mkr setMarkerAlpha 1; _mkr setMarkerColor "ColorEast";
#endif
    } else { _iedRoads = [_eachMarker] call findRoads; };
} forEach buildList;
sleep 5;
{ CIVILIAN revealMine _x; EAST revealMine _x; } forEach allMines;```
#

we get somewhere

#

use that
should work better already

tough abyss
#

So what I need is a way to detect a player.

#

buildList = {
_x params ["", "", "_eachMarker"];
private _pos = getMarkerPos _eachMarker;
_x pushBack _pos;
private _range = (_pos select 0) max (_pos select 1);
private _roads = _pos nearRoads _range;
_x pushBack _roads;
} apply buildList;

#

It's an array and function

#

that won't work?

queen cargo
#

mhh?

robust hollow
#

that should be the other way around

#

[] apply {} not {} apply []

tough abyss
#

{
                     _x params ["", "", "_eachMarker"];
                     private _pos = getMarkerPos _eachMarker;
                     _x pushBack _pos;
                     private _range = (_pos select 0) max (_pos select 1);
                     private _roads = _pos nearRoads _range;
                     _x pushBack _roads;
                 } apply buildList;

queen cargo
#

y 🙈 youre right @robust hollow

tough abyss
#

Yeah he is.

cloud thunder
#

yeah buildlist was code not array

tough abyss
#

Fixing now.

#

BuildList was an array

#

in my initial code.

queen cargo
#

will got my first SQF script somewhere ... it was horrible but the IEDs worked

#

could send it to ya ... but you would not get happy with it

tough abyss
#

Interesting question are recursive arma 3 solutions better or worse than iterative?

queen cargo
#

works just like in any other language

#

better question is: why use recursive?

tame portal
#

You can't run into stack overflows though lol

queen cargo
#

scope overflow 😄

tame portal
#

game just crashes 💥

queen cargo
#

it is what every program would do too

cloud thunder
#

Blow your computer up, ultimate IED script.

tame portal
#

ArmA VR

#

You jump down from 1 meter height and die in reallife

queen cargo
#

real recursion: create ArmA in SQF

cloud thunder
#

lol\

queen cargo
#

@signal peak help__ <STRING>
leaving this here

tame portal
#

Wait how do I tag him

queen cargo
#

@signal peak

tame portal
#

@signal peak Test

queen cargo
#

wont respond though

tame portal
#

Oh

queen cargo
#

Dwarden is responsible for adding him

#

but he did not responded yet

tame portal
#

How does it work atm, you just send that bot private messages?

queen cargo
#

either via my server

#

or ... well ... yes

#

pns

#

mention

#

or code blocks with sqf syntax highlighting in channels starting with sqf

#

in PN he will interpret everything as code

tough abyss
#

Yeah @queen cargo It locked up in non-scheduled...

queen cargo
#

mhh?

tough abyss
#

Locked up arma 3

queen cargo
#

if you never exit

#

yes

#

non-scheduled always affects FPS

#

as i said

#

that also means: you can lock your arma if you do wrong

#

@tame portal i responded (in case you did not read)

tame portal
#

ah yeah i did

tough abyss
#

What did I do wrong in that code?

tame portal
#

@tough abyss Can you post the snippet again

queen cargo
#

you did not posted code @tough abyss

tough abyss
#

The @unique field Bot is blocking me.

#

...

queen cargo
#

clyde bot?

tame portal
#

Oh I think thats more of a Discord bug

tough abyss
#

I take it this code ```SQF
buildList apply {
_x params ["", "", "_eachMarker"];
private _pos = getMarkerPos _eachMarker;
_x pushBack _pos;
private _range = (_pos select 0) max (_pos select 1);
private _roads = _pos nearRoads _range;
_x pushBack _roads;
};

#

Goes inside the get_roads function?

tame portal
#

I don't think you are using apply correctly

tough abyss
#

Blame @queen cargo

queen cargo
#

yes
was my mistake

tame portal
#

Oh nevermind

#

Looks like you're using as kind of a "foreach" loop?