#arma3_scripting

1 messages · Page 221 of 1

somber silo
#

Yes put it inside of a for loop and only continue when null

little raptor
#

can you DM me the model so I can check it?

#

is there a more reliable way of sleeping/waiting for the required amount of time for ⁨⁨deleteVehicle⁩⁩ to have cleaned up the local object before spawning again?
when you delete an object it only gets removed from the world. it only gets deleted in the next frame.
if you're sure that's the issue you can teleport it somewhere else before calling delete

short anchor
#

I like that idea - I'll do this instead so as to not have to pass data to/from scheduled and unscheduled contexts

tough abyss
#

I'm working on a medical mod. No matter what I do, I keep getting this error. No images are displayed in game. Anyone know something?

granite sky
#

How are you building the addon?

little raptor
#

did you define a correct pbo prefix?

tough abyss
#

but still same problem idk

granite sky
#

Did you set that prefix in A3 tools?

#

(there is no automation)

little raptor
#

actually nvm no need to send it. the code only returns the object in ⁨⁨⁨drop⁩⁩⁩ if it successfully preloads the model. if your model is too complex it won't get loaded immediately

#

so just use setParticleParams

tough abyss
short anchor
tulip ridge
tulip ridge
#

Oh you just said you were using A3 tools earlier

tough abyss
#

I was working with hemtt and I don't really understand and I moved to a3 but

#

but rn I'll take a look

granite sky
#

A3 tools UI is miserable unless you only have one PBO. You have to set the prefix manually in advanced there. And obviously you need a different prefix for each PBO.

#

A3 tools command line is workable once you have multiple PBOs, but then you need batch scripting to use it.

tulip ridge
#

You only need to set the prefix if you want something other than the folder name

#

For the most basic setup you can just name your folder ⁨Prefix_whatever⁩ and not have to set anything manually

granite sky
#

Is that what it uses by default? It's not documented anywhere as far as I know.

tulip ridge
#

Yeah

granite sky
#

Of course it'll have to be a unique folder name otherwise disasters will ensue.

short anchor
#

I've used A3 Tools in the past but much preferred HEMTT. In fact, I preferred HEMTT so much that it's the reason I first became interested in the Rust programming language

granite sky
#

HEMTT is probably just the easy option if you're using CBA-type specs.

#

But other things can work.

spiral temple
#

Hello! Is there a way to prevent a specific vehicle to get automated service from a service source? I thought it is ⁨allowService⁩ but I realized (after half a year) that this is only valid for service vehicles itself.

granite sky
#

Probably no easy way.

gusty rivet
#

If I wanted to do this, would a script that has players mount an invisible car seat and then assume team lead of a group involving them and the AI horse work for this? Would that allow them to give WASD controls to the horses?

sly cape
granite sky
#

Best dumb idea I can think of is to use a hidden object between the vehicles to block the service actions.

#

might be difficult to implement without... consequences.

spiral temple
#

Hm. Maybe it's worth to open a FT for this. I probably can't be the only person who might needs something like this.

granite sky
#

Ability to disable various vanilla actions is a routine request.

#

Pretty much everyone who ever modded A3 has asked for it at some point :P

spiral temple
#

Yep true. I've created a FT. Thanks!

turbid lodge
#

@thin fox Sorry for ping, how do I implement IND side on your AAS?

winged cobalt
#

no luck with google, there are a few reports saying that they can't do the same thing, is it not possible to have jets provide ground support?

winged cobalt
tidal idol
#

If I'm within a function, and call another function on every element of an array using forEach, do those called functions get executed in-sequence, or are they simultaneous?
In other words, would it be appropriate to directly put a sleep command in the sub-function, or should I encase that within a spawn block?

sly cape
winged cobalt
sly cape
winged cobalt
#

is this even possible? can you have AI aircraft engage targets on ground?

sly cape
winged cobalt
sly cape
winged cobalt
#

If i use loiter, does it mean the plane will not have freedom to engage targets?

sly cape
winged cobalt
#

and any ideas what combat mode and behavior i'm supposed to set it to?

thin fox
turbid lodge
winged cobalt
sly cape
granite sky
#

IME the stock ground combat ability of AI jets is somewhere between useless and nearly useless.

#

you need some elaborate scripting to make them effective.

winged cobalt
sly cape
#

Which event handler(s) should I use (if I even can) to detect when a missile has exploded/been deleted/no longer exists?

granite sky
#

Fired EH gives you the missile and then you can either poll it with isNull/alive or use the projectile deleted EH.

sly cape
granite sky
#

I would assume so but feel free to check.

#

If not then you could hook Explode as well.

queen cargo
#

did i ever noted that writing OOS feels way better then SQF?
i think i did a few times

gusty rivet
#

still trying to fix the AI not firing from an invisible car seat meant to replicate a saddle. They'll shoot from a newly placed car seat, but not one with any scripts acting on it. This is the current script for the trigger, the horse, and the car seat. Hoping someone can help me out

gusty rivet
fair drum
gusty rivet
stark fjord
gusty rivet
#

Yeah I'm just looking to optimize it and make it functional. It works fine but I feel like it can be streamlined a ton to make it work better

modern plank
#

sorry for the jump in the past, did you manage to allow only side channel with SWT Marker?

leaden ibex
#

But if you want to allow side only, sounds to me like it's just gonna be one line added really

modern plank
#

okay, not a big deal.

#

ya, for all, I was expecting the mod to check for disabled channels, but it does not.

#

No function found to disable channels in the mod.

#

So I am looking for "your line".

#

Failed to find any obvious settings, but did not browse entirely the code yet.

leaden ibex
#

I'm not on PC right now

leaden ibex
modern plank
#

Oh you mean I have to repack the mod....

#

If I have to do so, I would take into account the disabled channels instead.

leaden ibex
#

Well, you can just override the function with yours

modern plank
#

true.

lone glade
#

writing SQF is like unlearning C++

queen cargo
#

writing SQF is pretty much as annoying as writing assembly 😃

#

but its less entertaining

pallid palm
#

So iirc, "call can be used if you have no "sleep" in your script": and spawn is used if you do have "sleep" in your script

#

⁨⁨```sqf
[] spawn SFA_fnc_CacheHouse;
//or
[] call SFA_fnc_CacheHouse;

proven charm
#

actually its the scheduled vs non-scheduled that determines if sleep can be used

#

spawn is always scheduled but call will continue in current "mode"

#

like could say that call doesnt change anything

hallow mortar
#

call is "execute this code as if it is in-line with the current script". Doesn't matter if it's scheduled or not. Doesn't matter if sleep is used or not. The current thread will not continue until the called code is complete, and the result of the called code, if any, will be returned to the current thread when it's done.

spawn is "create a new scheduled thread". The current script will not wait for it, and the new thread will be scheduled. If you're currently in an unscheduled thread, and want to use sleep, you'll probably need to spawn a new scheduled thread where sleep is allowed, but if you're already in a scheduled thread, you don't necessarily need to. call may be appropriate if you want the current thread to wait for the other code.

short anchor
#

Continuing on from my helicopter explosion woes from yesterday, even setting the position of the local vehicle wasn't enough to prevent explosions when testing locally (given I am the client and server, so the vehicle is "local" to both and thus colliding with the new object)

I've updated my code again to process all items in the build queue, fetching the position and vector dir/up and pushing those to an array, then marking the object for deletion. Since I'm using CBA anyway and the mission depends on it, I'm using ⁨CBA_fnc_execNextFrame⁩ to run a loop on the array of classnames and positional info before spawning the vehicles.

loud wigeon
#

hello any idea

#

to hide a marker from blufor

#

for example i want to hide maker "alpha"

#

only for blufor side

pallid palm
#

nice @ NikkoJT: thx thats Awsome:

tulip ridge
short anchor
#

The code block would be the other way around to what you've posted. The loop within the delegate passed to execNextFrame

tulip ridge
#

It just sounded like you were doing like how I had written it, so I was just letting you know that CBA's wait functions aren't blocking like scheduled stuff is in case you weren't aware

short anchor
#

Yeah that was my main reason for invoking a subsequent loop in the next frame as I didn't want to spawn this script and then have to add more parameters to the script. I've actually gone a step further and have used execAfterNFrames to be doubly sure the objects no longer exist.

It'll be fine on a dedicated server even without this change whereas I test my changes in the Editor, where the issue remained

modern plank
#

I am facing a weird issue about JIP: when people disconnect/reconnect, I have to teleport them to the spawn where they are supposed to be etc....

#

It works perfectly if I take a new slot. But if I take slot that I already taken... the processing goes crazy. Any idea or similar experience?
I am not using any variable set on the player for the teleport stuff... in all cases, variables are reset each time we connect right?

granite sky
#

You've managed to write a lot of words without describing the problem.

modern plank
#

The issue is the difference of processing if I take a new slot or not when I reconnect on the server. What can explain this? (there is no difference per class or whatever in the processing)

granite sky
#

What's the difference though?

modern plank
#

SetPos doesn't work

#

Diary record text content are doubled

#

Like it has been created before....

#

It is not a new unit.

#

Expected ?

errant jasper
#

I can't remember the setting but there is one what makes it such that AI takes over disconnecting player. So the old player object isn't deleted.
As for the double diary record that sounds like a global/local bug or too my JIP invocations on the queue.

proven charm
modern plank
#

Okay, I have a lot of complex stuff, I replaced remoteExec by remoteExecCall for the TP and it works better

#

like there a lot of unscheduled stuff that slow down the processing

#

just forget.

#

tahnk you guys 😉

fair drum
lyric schoonerBOT
pallid palm
#

lol ```sqf
//you can use
getPosATL or getPosASL or getPosASLW //and others too

silent cargo
#

Im scripting an aerial explosion but it seems the only solution is spawning a mine/explosive and setting its damage to 1.

While its cool and works pretty well, theres unintended ground effect appearing on the floor below even if its 5,000 meters in the air.

#

Are there any other methods of spawning an explosion besides creating a bunch of particles with a script?

granite sky
#

Maybe try blowing up something that's expected to detonate in the air, like a SAM.

silent cargo
#

Ideally I wanted to spawn a rocket or something and make it blow up but I dont think I can set damage to projectile like that, so maybe I need to make a dummy object for the rocket to hit?

#

I tried SAM and cruise missile but they just kept flying away

silent cargo
gusty rivet
pallid palm
#
//you can use 
bomb = "Bo_GBU12_LGB" createVehicle (getPosATL objectName);
#

@sly cape what: what's wrong with this

sly cape
pallid palm
#

i use that and delete the object then

#

after the explotion

gusty rivet
#

Explosion?

#

I'm talkin bout AI riding horses brothaman

hallow mortar
#

replied to the wrong person

gusty rivet
#

lol

pallid palm
#

oh shit

hallow mortar
#

don't ping the other person, it wasn't really helpful for them either

pallid palm
#

oh yeah i C now dam oops

#

sorry about that

sly cape
pallid palm
#

lol yeah lol 🙂

stark fjord
#

Anyone has experience with IFA3 tripods?
For example lafette tripod, when put on the ground, it converts into an object that can attach mg42.
Works fine in single player/self hosted.

Doesn't work on dedicated server.

I've tracked it down that Put/Take EHs dont get added to player, but function that adds them ⁨LIB_Weapons_Static_fnc_static_weapon_init⁩ is called.

Im trying to find out when its called to see if i can remedy this somehow.

silent cargo
pallid palm
#

copy that m8

silent cargo
#

This is the code right now, its just a simple hit event and runs some code to "detonate payload" for a kamikze drone

I will change it to use the missile instead but you can see how I was doing it before

_drone addEventHandler ["Hit", {
    params ["_drone", "_source", "_damage", "_instigator"];

    if (_drone getVariable ["Detonated", false]) exitWith {};
    _drone setVariable ["Detonated", true, true];

    if (isObjectHidden _drone) exitWith {true};

    [_drone, _instigator] spawn {
        params ["_drone", "_instigator"];

        private _ShahedPilot = (UAVControl _drone) select 0;
        private _pos = getPosATL _drone;
        private _alt = _pos # 2;
        private _ammo = createVehicle [
            "SatchelCharge_Remote_Ammo",
            _pos,
            [],
            0,
            "CAN_COLLIDE"
        ];
        _ammo attachTo [_drone, [0, 0, 1]];
        
        /* Delay explosion for cinematic effect if shot above 35 m - [unused atm]
        if (_alt > 35) then {
            sleep 3;
        };
        */
        
        _ammo setShotParents [_drone, _ShahedPilot];
        _ammo setDamage 1;
        { deleteVehicle _x } forEach crew _drone;
        deleteVehicle _drone;
    };

    true
}];
#

I think I will make it killed event instead. Any tips for better optimizing feel free to share

#

Originally this mod just only spawned a gbu bomb if it crashed below 5 meters which I felt needed to be changed since it led to a high fail rate

hallow mortar
snow pecan
#

Don't think so

#

You could use createMarkerLocal and run in on every opfor player's machine

stark fjord
#

Is there a way to figure out which statement EH runs by its ID?

winter rose
#

well, what's your setup actually :p

stark fjord
#

as in?

winter rose
#

you have a number, and you want to know what EH type it is?

stark fjord
#

i know what EH type it is, i either wanna know:

  • From where it was added
  • What it runs
    So i can determine:
  • Is it safe to remove
winter rose
#

ah
I don't think so

stark fjord
#

so god dang nam it

granite sky
#

If it's yours then you can store the ID when you create it.

stark fjord
#

yeah its not mine, thanks anyway, dirty solution was deployed

winter rose
#

uh oh

stark fjord
#

IFA3 would deserve some rewrite love tho

next kraken
#

isnt is possible to have a marker at a certain height somehow?

bleak valley
#

why would you need a marker to have an altitude (because I don't think markers can) ?

next kraken
#

because task system is broken;-( it only shows the 3d task icon over the whole map if a marker is used and i want to make a flight mission, where you have to pass checkpoints in the air. they are not visible in 3d out of 4km and so you cant navigate if you use objects for the task destination

#

i tried some task setting in description.ext with no luck, there you can change the drawDistance of the icons with no effect no more

bleak valley
#

afaik, you can set the destination using coordinates

#

so it's neither a marker or an object

next kraken
#

ohh

#

damn i oversaw that

#

il try it out, thanks for the tipp mate!

bleak valley
#

np
don't know if it will override the 4km limit for 3d task icon tho

next kraken
#

ARGH

#

it worked. im so dumb. no it does not override

#

thanks man

bleak valley
#

just checked, markers have a Z axis (height)
idk if it has any impact

next kraken
#

nope had no impact

pallid palm
#

btw you can move a marker to any height you want: in the editor by: holding alt: and dragging it up or down: or by scripting as well i think

#

even under water

tidal idol
#

Is there a way to put extra parameters into an eventhandler? The circled params are part of HitPart by default - can I just tack these on to the end of the array?

pallid palm
#

for some reason that looks off to me

#

shouldnt the params be inside the EVH:

tidal idol
#

I know those work, I'm reworking an old piece of code I had

errant iron
#

you can't change the arguments that the event handler receives, but you can add a variable on the object and retrieve that once its called, e.g. ```sqf
_projectile setVariable ["MyTag_soundInfo", [_radius, _duration, _sound]];

// in the handler:
_projectile getVariable "MyTag_soundInfo" params ["_radius", "_duration", "_sound"];```

tidal idol
#

ugh that method again. Guess it'll have to do. At least it cleans up plenty

errant iron
#

:)

pallid palm
#

@next kraken hay there's a chopper flight mission: in the Achievements missions part of Arma 3: maybe you can look in there to get some ideas: for what you need

#

where you must fly though way points like way up in the Air

#

they have thease markers up in the Air: looks cool: i forget the name of the mission

pallid palm
#

that is if i'm reading you right

exotic flame
#

What is the formula to calculate artillery elevation to reach a distance ?

granite sky
#

Should be ⁨elevation = 0.5 * asin (9.807 * distance / (initSpeed * charge)^2)

sly cape
granite sky
#

ah right, you can't get the high angle easily by reversing the elev -> range calc.

sly cape
#

Another thing to note is that the base game artillery reticle says the elevation relative to your vehicle, not above the horizon.

timid zealot
#

Yes you can, if you run some code locally for each client, and do "alpha" setMarkerAlphaLocal 0 when the player side is blufor

granite sky
#

How you calculate the initial shot velocity for artillery. initSpeed from the magazine * charge for the fire mode.

#

Usually the longest range fire mode has charge 1, but not always.

exotic flame
#

Oooooh i see now

granite sky
#

ah I think for the high angle (proper one for mortars) you just do ⁨0.5 * (180 - asin (9.807 * range / (initSpeed * charge)^2))

sly cape
#

Indeed (assuming the first was correct)

granite sky
#

works for 500m with the mk6 at least.

exotic flame
exotic flame
short anchor
#

Sorry folks, I have the dreaded question regarding CBA events (PVEH, publicVariableClient/publicVariableServer/publicVariable) vs a custom pub-sub model that uses remoteExecCall to invoke a function which in turn executes each registered event handler for a given event (identical to how CBA does it, but with remoteExecCall instead of PVEH).

I have searched the Discord but many existing discussions (Discord search isn't great so the results have been limited, please feel free to point me at an existing discussion that answers this question if one exists) seem to focus around subjective preference.

Based on the implementation of both approaches, and assuming I'm not specifying code as a parameter, what would the performance benefit be around using remoteExecCall compared to PVEH + publicVariableServer/publicVariableClient?

errant jasper
#
  • I doubt you will see a meaningful performance difference at all (in fact if you do subpar design based on multiple remoteExec where a single event would satisfy you might even be worse).
  • RemoteExec has more control points to restrict or allow execution which may be of interest if you run on public servers that needs to protect against cheaters. With publicvariable all is routed through the same variable.
  • Designwise, compared to events, running multiple remoteExec on commands in sequence may be less efficient, where-as in event based design you tend to naturally have more coarse handlers that take the minimal input to do multiple things. But if you invoke functions with remoteExec that difference disappears. (instead of remoteExec setPos and SetDir, you would usually only have a single event handler that does both)
  • Not sure, but think CBA style events are less robust against bad handlers. Pretty sure they run in an unscheduled loop so a bad handler might take halt processing of remaining events for that frame.
stark fjord
#

Youd compare them to remoteExecCall. RemoteExec spawns scheduled

short anchor
# errant jasper - I doubt you will see a meaningful performance difference at all (in fact if yo...

Very informative, thanks for that.

Regarding the points around remoteExecCall/remoteExec (it's actually the former that I'm using, good point by Marko).

remoteExecCall would be used solely to invoke the function (on a remote machine/server) that then loops around and invokes each handler for a given event. I think it'd be a single use of remoteExecCall since you can specify the targets for various operations such as server, remote or global. Local isn't necessary since any local events would simply invoke the handlers directly on the local machine. Emphasis on "think" because I can't imagine a scenario where I'd repeatedly call remoteExecCall unless I wrote the code with poor optimization.

forest island
#

Im trying to set up a scenario that once a trigger get activated, a couple of groups if enemies appear. Could I not just put “triggerActivated xx” under their presence condition?

short anchor
#

Isn't "Condition of Presence" evaluated only at mission start?

stark fjord
#

If you know how to use layers, you could put units in separate layer and Show/Hide that layer, instead of syncing to units

forest island
short anchor
#

I was going to suggest using a trigger with "On Activated" but Marko's approach is much better

forest island
#

Word. Appreciate it gents.

sly cape
proven charm
#

forceWeaponFire doesnt seem to work with AIs. i tried ```
_thrower addMagazine "HandGrenade_stone";

_thrower forceWeaponFire ["HandGrenade_Stone","HandGrenade_Stone"];

still forum
#

The disclaimer applies to the version you have.
The version you have was built in 2025.

last cave
#

ooooo

granite sky
#

(3+)

proven charm
#

that seem to work. i had same problem with player

granite sky
#

grenade muzzles have a magazineReloadTime of 2.5 seconds in vanilla.

#

You add magazine, and then they have to load it.

proven charm
#

oh ic

#

anyway to make it loaded?

granite sky
#

Nothing obvious. There's no general instantaneous load-magazine-into-muzzle command as far as I know. You can do it with primary and secondary weapons with addPrimaryWeaponItem etc.

#

If you add a weapon to a unit then that normally forces an instant reload. Maybe that works with Throw...

#

similarly setUnitLoadout/getUnitLoadout combo.

proven charm
#

ok maybe i can live with the delay because my script isnt supposed to be instant anyway

granite sky
#

Comments on addWeaponItem suggest it might do it in 2.22

proven charm
#

cool

granite sky
#

I guess that means it doesn't work in 2.20 :P

restive leaf
#

Not in ARMA 2 it wasn't... Not sure its 3D Editor had any name other than 3D Editor 😉

#

Or I guess "The 'Hidden' 3D Editor"

short anchor
#

The good old days. Now I'm feeling nostalgic enough to install Arma 2

hushed turtle
#

There was a 3D editor in A2? What?

short anchor
#

IIRC, it was available through a keybind on the main menu. It was experimental and very buggy

restive leaf
#

CTRL-E in the ARMA 2 main menu

open quail
#

Maybe im blind, but is there a command to interpolate one object to another? Bascially moving object a through the world smoothly to object b?

exotic flame
# sly cape How are you trying it?

I'm using it like this ```fnc_calcFireAngle = {
params ["_x", "_y", "_v"];

private _g = 9.807; 

if (_x <= 0) exitWith {[]}; 

private _v2 = _v * _v; 
private _v4 = _v2 * _v2; 

private _discriminant = _v4 - _g * (_g * _x * _x + 2 * _y * _v2); 

// Pas de solution balistique 
if (_discriminant < 0) exitWith {[]}; 

private _sqrt = sqrt _discriminant; 

private _denom = _g * _x; 

private _angleLow  = (atan ((_v2 - _sqrt) / _denom)) / 2; 
private _angleHigh = (atan ((_v2 + _sqrt) / _denom)) / 2; 

[_angleLow, _angleHigh] 

};```

hushed turtle
#

_x is one of the magic variables and as such shouldn't be used for your own variables

short anchor
#

Same with _y, at least within the context of the newer hashmaps

sly cape
exotic flame
#

well, i'm not getting an error, i'm getting a result but it doesn't match with the ballistic of the M4 Scorcher

sly cape
exotic flame
sly cape
sly cape
sly cape
exotic flame
errant jasper
#

exactly...

sly cape
#

What? Look at my profile 😂

exotic flame
exotic flame
sly cape
sly cape
exotic flame
#

Unfortunately it doesn't work in Arma 3

#

At least not with the M4 Scorcher

sly cape
exotic flame
sly cape
errant jasper
#

I get 50.33 degress for high angle (though I didn't bother start Arma, but in Python)

#

Using Sticky Joes calculation (the same from wikipedia)

#

Your numbers were also halved

exotic flame
#

I didn't try with the mortar, it might work, but M4 scorcher needs a different formula

sly cape
exotic flame
sly cape
exotic flame
#

So my shell falls too far but you say with an angle twice bigger it will fall at the right location ?

exotic flame
#

Well, it doesn't work

sly cape
exotic flame
#

I already tried this formula in the past and i couldn't have it working in any case

#

try it by yourself you'll see

sly cape
exotic flame
#

[4000,0,450*0.3] call fnc_calcFireAngle gives no result which is an aberration

sly cape
exotic flame
sly cape
sly cape
errant jasper
#

153.92m/s for scorcher in vanilla on semi (close) for normal HE

#

measured by

veh addEventHandler ["Fired", { 
 params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
   systemChat format ["SPEED: %1", vectorMagnitude velocity _projectile]; 
}];
#

My bad semi (medium) is 243.101

exotic flame
#

I just made a test with this ```fnc_calcFireAngle = {
params ["_x", "_y", "_v"];

private _g = 9.807;  

if (_x <= 0) exitWith {[]};  

private _v2 = _v * _v;  
private _v4 = _v2 * _v2;  

private _discriminant = _v4 - _g * (_g * _x * _x + 2 * _y * _v2);  

// Pas de solution balistique  
if (_discriminant < 0) exitWith {[]};  

private _sqrt = sqrt _discriminant;  

private _denom = _g * _x;  

private _angleLow  = (atan ((_v2 - _sqrt) / _denom));  
private _angleHigh = (atan ((_v2 + _sqrt) / _denom));  

[_angleLow, _angleHigh]  

};using[4000,0,810*0.3] call fnc_calcFireAngleand the result is[20.8155,69.1845]``` I made a shot and the shell falls at 4.2km which is not bad but a little imprecise

exotic flame
errant jasper
#

Don't know if this matter but ACE has this note in their system: //DEFAULT_AIR_FRICTION == -0.00006. So maybe there is a small difference.

#

Also pretty sure Arma only simulates like 50 steps a second, so it takes a "linear-segmented" curve and not a perfect one.

short anchor
#

Is there a limit on the amount of data (message size) that can be sent via remoteExec/remoteExecCall?

I had a function which was dispatching to the server via remoteExecCall in a loop, but figure it'll actually be better to batch everything up and send it in a single call instead

jade acorn
#

how can I find a string within an array of arrays? Basically I want to check if "@modname" is in the getLoadedModsInfo's results.

stark fjord
#

you could do recursive search function, which if it finds an array, it calls itself again to search within it

jade acorn
#

i think it would be troublesome since the mod might be either a workshop one or local, and some of the values within the array would change

stark fjord
#

tostring the whole deal then?
But waitgetLoadedModsInfo and you know the mod name or?

#

{
if ((_x # 0) == "modname") then ...
} foEach getLoadedModsInfo;

willow hound
#

If you don't care where in getLoadedModsInfo the string is, you should be able to do "@modname" in flatten getLoadedModsInfo.

jade acorn
#

that one works, thank you

#

TIL there's a flatten command...

next kraken
#

is there a way to force AI using lasers when NOT in combat mode but aware or safe?

digital hollow
silent cargo
#

I am using hitPart projectile EH and I cant seem to figure out how to check if _hitEntity is in a vehicle

tulip ridge
#

_isOnFoot = isNull (objectParent _hitEntity)

granite sky
silent cargo
#

Like, if I shoot a tank.. the hitEntity is returning the person driving it

tulip ridge
#

That's how it will look when you turn a vehicle into a string, try doing typeOf

silent cargo
#

[Kim Jong Trump's] Projectile hit: [B Alpha 1-3:2 (On foot.)([])(a3\data_f\penetration\armour_plate_80mm.bisurf)] at [[6389.9,7356.77,6.03933]]"

#
player addEventHandler ["FiredMan", { 
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"]; 
 
    private _weaponName = getText (configFile >> "CfgWeapons" >> _weapon >> "displayName"); 
    [(format ["(Shot Logs 1) %1 fired a %2 (%3) from (%4)", name _unit, _weaponName, _ammo, position _unit])] remoteExec ["diag_log", 2]; 
    if (!isNull _projectile) then { 
        _projectile addEventHandler ["HitPart", { 
            params ["_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_components", "_radius", "_surfaceType", "_instigator"];
            private _vehType = if (isPlayer _hitEntity) then {vehicle _hitEntity} else {"On foot."};
            [(format ["(Shot Logs 2) - [%3's] Projectile hit: [%1 (%6)(%4)(%5)] at [%2]", _hitEntity, _pos, name _instigator, _components, _surfaceType, _vehType])] remoteExec ["diag_log", 2]; 
        }]; 
    }; 
}];``` messy rn cause Im building it but yeah
tulip ridge
short anchor
silent cargo
#

Returns the same

granite sky
tulip ridge
#

You're checking if the thing is a player

Just log the typeOf _hitEntity and see

silent cargo
granite sky
#

We're not allowed to use it again because we took advantage of a hosting service exploit to sneak the parameters in there :D

agile pumice
#

@snow pecan & @timid zealot Either way works

silent cargo
#

I suppose having a log for every shot fired may have an impact on performance, right?

#

Granted it is only applied to players

agile pumice
#

Is this error really giving me shit for using //?

granite sky
#

Log to server or log to client?

silent cargo
tidal idol
#

So I have some BOOLs that are defined via module attributes - this works fine when placed in 3DEN, however, since Zeus spawned modules don't seem to like setting up these attributes, I've implemented a default value that looks up what's in the config. I've done this method before on numbers, but this one's a bool, so I can't seem to figure out a good way to get the data, as there's only getText, getNumber, getArray, etc.

Normally, this debugging hint just says truefalse or falsetrue and works peroperly, but when spawned in Zeus, it doesn't seem to be able to convert them to strings. I've tried double quotes, but that broke syntax. For single-double quotes, I've tried both what's shown and the inversion, and it just doesn't replace the string with teh BOOL equivalent. There any other way I can get a BOOL out of the config and into this code?
yeah ik these are screenshots, jsut very tired

granite sky
#

getText returns a string. You would need to manually convert it to a bool.

#

I guess ⁨call compile⁩ would work, if kinda daft.

tulip ridge
#

Don't use strings for a boolean

exotic flame
tulip ridge
#

I'm trying to think of a decent-ish number of like easy-hard (relatively) ideas to teach people basic scripting stuff.

I've had a couple people ask me over time so I think it'd be nice to have things they can try to make and then have potential solutions. Maybe something akin to leetcode.

I've got a couple in mind for the harder ones, like maybe fired -> hitpart event handlers to do X thing when a person shoots, or maybe learning some basic networking. Has anyone got some relatively basic ish problems they can think of? Ideally something thing harder than just "Display a hint", probably around the 5-30 lines of code range

tender fossil
# tulip ridge I'm trying to think of a decent-ish number of like easy-hard (relatively) ideas ...

That'd be great I think! I would also definitely explain the fundamentals of how SQF works as a script language (like the unary-binary-ternary stuff as the backbone of the language etc. etc.) and in general, answering to "why" something works as it works every time you introduce a new thing/concept/feature to the reader.

Also strong recommendation to https://ghost.org as a platform. It's free to use, quick as lightning and you can add syntax highlighting for SQF too. It runs well on pretty much any cheap VPS. Although if you want to send newsletters to subscribers, I'd consider also their managed hosting since everything just works out of the box and there's no need to go through MailChimp configuration (heard it's quite painful process to get it working properly) or such things

radiant lark
#

Does sendAUMessage really serve any purpose?

stark fjord
#

Uhh, last time i messed with it, it didnt really work. But that was years ago. Also i recall wiki stating it was broken (might be wrong). But now it states no such thing

#

Looking at wiki history, it never said it was broken

#

But i dont see it used anywhere, probably for a reason

pallid palm
#

hello all: so im trying to get my chopper Helo2 to wait:
till all players within 300m are in the chopper
and i want the chopper to check if the players or player isOnFoot or in a Vehicle:
so the chopper waits for them
i'm not sure how to do this
cus when the player is in a vehicle the chopper takes off:
i want to be able to drive up to the chopper with any vehicle:
and jump out and get in the chopper

stark fjord
#

Smthing like ({alive _x} count allPlayers) == ({alive _x} count crew Helo2)

pallid palm
#

hmmmm looks good i'll try it

stark fjord
#

See wiki, it shows all that is returned.

pallid palm
#

copy that

stark fjord
#

Yes, hence alive check

faint burrow
#
((allPlayers - (entities "VirtualMan_F")) findIf {
    (alive _x) and { (_x distance Helo2) < 300 } and { !(_x in Helo2) }
}) < 0
tidal idol
# tulip ridge Don't use strings for a boolean

Thats how module attributes have to be configured though? I referenced BI modules when making mine
And it seems they have something special going on since I had to manually specify a data type of bool.

pallid palm
#

oh cool

#

holy cow @faint burrow that looks Awsome

#

woohoo works Awsome @faint burrow you da man: thx so much

cosmic lichen
tidal idol
#

But wouldnt that make the module attribute not work right otherwise? I dont want to make 3den-placed modules not work right just for this. Ill try that compile thing firat though after work

still forum
#

Will close Eden, go back to mainmenu, and relaunch Eden, and load the said scenario
Why the re-launch? Why not just reload the mission?

See Killzone kid's server switch script. That used some exploits to smuggle a script from a server mission, into the main menu.
That doesn't work anymore for multiplayer, but the same approach might still work for Eden, and get you the ability to exit from Eden, and execute scripts in main menu

warm hedge
#

Well, main blocker is about editing Eden itself. AKA diag_mergeConfigFile, sometimes my changes in Eden does not apply until I relaunch it

#

(And sometimes does apply even if I don't)

still forum
#

The HEMTT author is writing and using it on linux.
Yes afaik it also has syntax highlighting.

#

Yes but its complicated to say how much.
The allocators for variables can only handle 2 or 3gb. And that is per type.
That is alot of values, but not unlimited 😄

#

There is no safezone for ui textures.

#

You can always make your own safezone. Like leave 0.1 space at every edge.

#

That is such a niche usecase, and I have not heard of anyone else having attempted that.
I guess mine gets somewhat close to it, on mission save it does a git commit to a local repository (to keep history and backup of all mission changes)

If you need help with coding you could ask in #arma3_tools (That's where all the "real" programmers hang around :D)

still forum
# stark fjord This strange call, appears on some of my older saves too. And im sure i didnt pu...

Its a leftover from a hotfix that CBA mod used to apply.
It was a workaround for a Since Arma 2 engine bug, where your editor scripts could not have a return value.

That's also where the 0 = [] spawn {... came from.
I fixed that bug years ago, CBA removed their hackfix, but that left the visible call{} wrapper behind in old missions and compositions that were built while CBA mod was loaded.

hushed turtle
still forum
# short anchor Sorry folks, I have the dreaded question regarding CBA events (PVEH, `publicVari...

remoteExec has the benefit that you get remoteExecutedOwner. Meaning you know who sent the message to you.
PVEH doesn't have that.
This also allows you to directly send a reply back.

You can send the sender ID in a PVEH too, it will be slightly less efficient (script value, vs engine native), and you loose the security guarantees because anyone could send whatever.

remoteExec has slightly higher overhead, because the server does safety checks before sending it onwards.
remoteExec will likely use more network traffic for you, mostly because your function name will be longer than a PVEH (where CBA uses "CBAs" as the variable name, very short). Which I don't think matters.

CBA global event does "publicVariable" which has a problem, it will be inserted into the server's JIP queue. Which you won't want for one-time executions. The *Server/*Client direct variants don't do that, but also don't allow you to send something to everyone.

You said pub/sub. So I assume you often want to send something to multiple recipients. There remoteExec would be better, because you can set a list of multiple recipients, and the engine will handle that in a single message.
Where for pubVar you'd need to send multiple messages

still forum
#

I don't remember if I actually optimized it..
Sending one long string should be much better, than sending many values. toJSON might be useful there, though the JSON conversion of course also has overhead, which might not be worth it

#

Mh the string encoding is already well optimized.
Maybe it was the network encryption, or splitting of network messages that was the problem. I don't remember.
I ended up implementing a secondary communications channel for large data via an extension to get around the problem.

still forum
still forum
short anchor
# still forum remoteExec has the benefit that you get remoteExecutedOwner. Meaning you know wh...

That is a great comparison between both approaches, thank you. I thought the same with regards to JIP too as many of my events are one-time occurrences and don't need to be JIP'd

You're correct regarding the pub/sub, though I don't send to a specific list of recipients at this point. It's local (script executed directly), global or server dispatch. My implementation is very basic and designed to be identical to CBA's for the sake of backwards compatibility. I've implemented it purely out of curiosity to play around with some of the newer APIs since my last time with Arma

my_localEvent loops through the registered event handlers which are stored using the newer HashMaps. All other triggers (serverEvent, ownerEvent, targetEvent) simply [<event>, <params>] remoteExecCall["my_localEvent", <target>] to trigger the my_localEvent script.

#

For the sake of completion, this is the localEvent script https://github.com/ColinM9991/KP-Liberation/blob/event-system-remoteexec/Missionframework/events/fn_localEvent.sqf

And this is an example of how remoteExecCall is used https://github.com/ColinM9991/KP-Liberation/blob/event-system-remoteexec/Missionframework/events/fn_serverEvent.sqf

I'm sharing this just because I know when people hear remoteExec and events together, they think remoteExec is used to trigger each event. At least that's my assumption from previous messages I've read about the two approaches

still forum
# tulip ridge I'm trying to think of a decent-ish number of like easy-hard (relatively) ideas ...

Most people who want to script but cannot, are mission makers that want to do something that a simple trigger cannot accomplish.

Stuff like "If this thing explodes, complete a task". Usually solved by a trigger checking alive every 0.5 seconds. Really should be a eventhandler though.

Or a "When player picks up this item"

I think a "remoteExec send a request, and receive a reply back" is a thing that is commonly useful, but basically no-one does it. You need to handle networking and asynchronicity of the result.

errant jasper
#

Yeah the gap from this "small problem can easily be solved", to "this solution to a slightly more complex problem for some reason works in SP but breaks in MP" but actually requires rather deep knowldge of how the game works and JIP state is very tiny.

still forum
#

Its also very hard to teach.
Last mission our mission maker got very upset that his say3D was not audible globally, even though he tested it while playing on the server.
Yeah say3D has local effect, it was only audible on the player using the action.
But then playSound3D, which is basically the same thing, has global effect.

The mission before we had huge lag problems, because a thing was spawned on every players PC, globally, so it was duplicated many times.

You have addAction and holdAction, which only execute locally.
Then you have triggers, which sometimes execute globally.

You can't really teach this besides "read the wiki" for every command you use

old owl
#

Was writing up code for an April Fools and made the near same exact mistake- I learned that day that drinking and committing does not go hand in hand very well 😄

#

Was creating invisible global objects on every client 🥲 haha

errant jasper
#

One thing is knowing how the parts interact, local/global argument vs effect, triggers, initlines, JIP, setVariable with broadcast etc. The second problem then to use them you have to be do reason about distributed concurrent systems which is another hurdle for many.
Many people have no problem learning how to make configs: the config is declarative just tells what the engine has to make happen. But as you as the code you write runs the ground is shifting beneath them. So yeah, learning to use SQF is basically same as learn to program (networked applications).

#

Or more simply: you can tell someone new to SQF that init lines run for all machines and JIP players, and they might understand why they are having their problem. But the leap to truly understand the implications and then the solutions is a much greater hurdle for many,.

crimson lagoon
#

I need help with a scale vehicle representation issue. I'm spawning and scaling down vehicles, and I've configured all the synchronization - it works, but there's a problem:
In single-player, all vehicles scale relative to the bottom of the model:
Example: I spawn on the ground, and after scaling down, the vehicle still stands on the ground, just smaller.
However, in multiplayer, SOME vehicles scale relative to the model's center, which causes them to float in the air.
Example: A vehicle is 2 meters tall, I spawn it on the ground and scale it down, but it floats a meter above the ground.
For the game engine, it's positioned on the ground - all checks pass with height 0, but visually it's floating in the air and I don't know how to fix this.

  • I cannot use simple objects because some vehicles contain visual effects that appear on vehicles with this type of spawn, and in my case this is critical.
still forum
#

"I cannot use simple objects"
Scaling is only supported for simple or attached objects
So yours are attached then? Attach afaik is always center of vehicle

crimson lagoon
#

Yes, I attach it to another object and reduce it, this works, the technique is reduced. But yes, I just noticed that only some mod techniques are scaled at the bottom, while vanilla techniques just float in the air. Is there any way to compensate for this, because for the engine it is still on the ground and returns a height of 0?

still forum
#

What specifically returns a height of 0?

#

getPosWorld? Surely not because that returns center of object

#

Calculate the height manually by yourself.
By getting center position, the land contact points via selectionPosition.
And calculating yourself where the bottom is.

If its floating, then apply it as offset to attachTo to move it down appropriately

crimson lagoon
still forum
#

The muzzle flash. Afaik no

winter rose
#

isn't it hide selection "zasleh"?

still forum
#

Can you hide selections on a simple object tho?
Well animation is supported?

winter rose
#

I believe so yes

pallid palm
#

holy shit that's some nice reading Awsome i love it

radiant lark
#

Is there supposed to be any better gui editor than the thing we have rn? not many controls on there... I wonder if there's any better way to import my design into the game without the hassle of aligning everything and such, activetext isn't even defined idk why

still forum
#

X39 once made a external GUI editor.
But I think it was never really finished

radiant lark
#

I'll take a look at that, thanks

still forum
radiant lark
#

Gotcha, thanks

#

Is CT_SHORTCUTBUTTON coded in such a way that it won't count the transparent parts of the image as the button itself?

#

Imagine having a 200x200px button in a 1024x1024px image, all transparent except the proper 200px area of the button, I guess the area surrounding it wont be clickable right?

#

Thinking of that, it would make rounded buttons very hard to replicate

still forum
#

I don't think I'll make my own native GUI's anymore.
I'll just do it all in html

radiant lark
#

HTML can make you a good code obfuscation too

#

The deal is, only way to send it back is EH I think so it's kinda pointless

#

HTML UIs are soo great but I am scared of scaling it up

#

ppeffect on UI elements would be really great, just saying!

still forum
#

Click in native UI executes script.
Click in Web UI executes script. Whatever

radiant lark
#

Nah I was just saying because virtualized JS is a pain in the ass to analyze

#

Whats really great though is WASM

#

It may have benefits compared to SQF, like math, encryption algos and all that

proven charm
#

you can get all the controls in UI editor, it just needs to be setup properly

#

like you type which control you have in the class field, like MyText : RscText

radiant lark
#

That's facts

#

Just tried it now, thanks

#

But I guess the game doesn't treat it like it were that control

proven charm
#

it should, ive never had problem with that

#

unless RscText is undefined ofcourse 😉

tough abyss
#

No, looks like something wrong w/ 23:51:45 Error in expression < distance civ_shop_licences) < 3 ']);

pallid palm
#

wow that's way above my pay grade 🙂

tough abyss
#

your call is returning an invalid number

pallid palm
#

Hay everyone: i want to take the time to thank everyone who helped me in Scripting: to many to name: im having so much fun in Arma 3: its off the hook Woohoo: love you guys

#

i must be the happyest guy in the world 🙂 thanks again m8's

tough abyss
#

post the addaction

granite sky
tough abyss
#

@agile pumice

granite sky
#

I guess this is the reason :P

#

And yeah, module attribute default values are required/expected to be expressions that return appropriate values, so you shouldn't change the config.

pallid palm
#

lol

drowsy geyser
#

who invented math anyway🤔

pallid palm
#

a math teacher

proven charm
#

idk who but he shouldnt have made it so hard

pallid palm
#

i remember my math teacher she was so beautiful: i didn't learn anything: 🙂

agile pumice
#

EDIT: Error was a few lines above where the condition from a previous action had an error.

drowsy geyser
proven charm
#

ya

delicate swan
#

Is scripting now banned or what?

#

Anyone could explain?

#

I have not touched the game for a year

#

I would like to get back to it

sly cape
delicate swan
#

pub zeus

sly cape
short anchor
winter rose
#

so please, join the Resistance 😉

viral hinge
#

remoteExec [{playSound "Whisper1"; 0 cutRsc ["RscNoise", "PLAIN"]; sleep 5; 0 cutFadeOut 1;}, ALLFATHER];
Can anybody explain to me what exactly I am doing wrong here?
I am trying to make an overlay of noise appear on a specific players screen, their variable name set to "ALLFATHER". Whilst also playing a sound only they can hear.

stark fjord
viral hinge
#

ahhh so
[{playSound "Whisper1";0 cutRsc ["RscNoise", "PLAIN"]; sleep 5; 0 cutFadeOut 2; }] remoteExec ["BIS_fnc_spawn", ALLFATHER, true];

granite sky
#

BIS_fnc_spawn is obsolete and you can just use ⁨call⁩ instead there.

old owl
#

Not sure if you intend your server to be public but if so I wouldn't allow BIS_fnc_spawn, spawn, call or any other command/function that would allow someone to remotely execute arbitrary code. Obviously if you're intending to play with just friends with a password this is irrelevant but here is some more documentation if it interests you catnod

https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec

tough abyss
#

Yep - that's usually how it works with arma errors xD

versed belfry
#

Is there a way to change how an object is seen through thermals via script?

#

Not vehicles but specifically a building, rock, or something placed via editor that is really highlighted when looking through thermals

versed belfry
#

I am trying to remove this "glow" or "heat" so they blend in with the background

proven charm
#

ok ic

versed belfry
#

Baiscally, trying to hide some of those trenches so objects they are not as easily detectable with thermals

proven charm
#

maybe something can be done via config idk

versed belfry
#

Yea if it has to be done via config that'd be rough

proven charm
#

true

proven charm
#

i think the devs made some changes to thermals in profiler branch

still forum
still forum
#

Its based on the textures. You could change the texture I guess.. but that'd be visible.. unless you only do it when the user has thermals enabled.
And dealing with objects that may not let their textures be replaced..

Basically no

versed belfry
# still forum No

Damn, welp I tried :(

Off to options 2, fuck the pilots, they get no thermals xD

still forum
#

You could make the thermals shittier, if that helps

versed belfry
still forum
opal ember
#

Does someone know about a way to force AI not to engage certain types? (like forcing it not to engage Air targets)

I tried using the EnemyDetected EVH and forgetTarget but they still fire at everything

opal ember
#

yeah that could work.

kindred zephyr
#

is there an equivalent to onUserDisconnected/HandleDisconnect for local machines?

Wiki suggests this method but seems a bit exepensive just for the sake of checking if a player disconnects to perform actions on the machines

#

OH

#

wait i missunderstood, dont code while doing other stuff kids

silent cargo
#

What is the predicted impact marking system called?

#

Like when you use targeting cam with a bomb loaded, it shows you the predicted impact point

hallow mortar
#

In real life it's CCIP (Continuously Calculated/Computed Impact Point). The game might call it the same thing.
I think it's part of the engine-controlled HUD and not scripted, though.

#

For bombs there's also CCRP (Continuously Calculated/Computed Release Point) which shows when you should drop the bomb to get it on target, but I don't remember if that's supported in Arma

tulip ridge
#

It is

silent cargo
#

I am wondering if anyone has any ideas where this UI is set up or defined

waxen iris
#

This is kinda niche but im curious if anyone may know how to help. Im not too familiar with arma scripting but I am trying to find the class name for the FPV drones in the "FPV Drone Crocus" mod so I can add them to the list of jammable drones in the "Crows Electronic Warfare" mod. Ive tried adding values that I found in the classname editor but nothing seems to work. Is there a way I can find the specific class name for those drones?

silent cargo
#

but you need to make sure you are listing them in an array format.

#

To get the classnames just plop them down in editor and right click and copy the classes

#

Post your code for the jammer here, or at least the list of drones to jam

silent cargo
waxen iris
silent cargo
#

Do not put a comma after the last one

#

Also post the full array, as you see it. If this is exactly whats there, you dont have quotes around any of your classes. So it will break the code

#

"drone","drone2","drone3"

#

And those are all UAV base classes, unless you are using "typeOf" youre never going to jam any drones because IIRC base classes arent ever used. You need to list the exact class of the specific drone you want jammed

#

Go into the editor, put down every drone you want to jam - and select them all by dragging your mouse over all of them and selecting them, then right click and press "log" and click "copy classes to clipboard"

waxen iris
#

The only ones that wont work are the Crocus drones

silent cargo
#

Ah okay so its a mod with pause menu settings. I didnt know if you made a custom array for it yourself.

#

I will check it out real quick

waxen iris
#

Yeah my bad I probably should've mentioned that lol

silent cargo
#

Its fine. Makes your life easier

silent cargo
#

You have to restart the mission after you put the new drone in the list. Im sure you already tried that though

silent cargo
waxen iris
#

Thank you so much It worked you are a magician! Out of curiosity how come adding the values at the beginning of the list worked but not at the end?

silent cargo
#

With arma 3 scripting, or scripting in general, one small mistake will make the whole thing not work. In this case, this "setting" is a continuation of a script in the mod, and it checks this "settings list" - therefor any typo would cause it to have no effect

waxen iris
#

Thats interesting, ive been trying to learn more about arma scripting because ive been playing it for half a decade and never once touched scripting

#

Thanks a lot for your help

silent cargo
#

Just if you do decide to try and learn, dont use ChatGPT..

pallid palm
#

if you try to learn Arma 3 scripting just think you will never run out of stuff to Do 🙂

#

i love it 🙂

sharp grotto
#

You will, because Arma will break your dreams at one point, because your whole idea will fail because of a simple missing command or bug 🫣 😆

pallid palm
#

my dreams have always worked out cuz of the guys that help me lots 🙂

#

in this channel

reef sedge
#

odd one and more curiosity - i have role selector set up so players dont need zeus to give out - is there a way to public display (in chat) when a player grabs a role and what role they grabbed ??
only ask for the example of a player not medically trained grabbing med perms etc

young mist
#

Anyone know how to make enemies spawn in instead of being a constant presence?
Say I want a group of enemies on a map to only be present when you have activated an objective for example

sly cape
young mist
#

Yeah ive used the dynamic simulation, what I want is to have enemies spawn in only once you have activated an objective or met certain conditions so they are not constantly present on the map

warm hedge
#
  • Hide them and show them using hideObject (hideObjectGlobal)
  • Create them using createUnit etc

I'd prefer first

young mist
#

Could you give me an example of how to do that? Just a sec

#

Like for these forest tanks. Do I create trigger volume they are inside and have a script?

#

I have the trigger volume set up to activate their waypoints for example already set up. Should I use that for their spawn in script?

warm hedge
#
{_x hideObjectGlobal false; _x enableSimulationGlobal true;} forEach units groupWhateverYouWantToUnhide```
young mist
#

Alright let me try this

#

Like this?

sly cape
# young mist Like this?

What are you trying to do? If you're going to use the init, I think you should use the object init and use this instead of _x.

young mist
#

Right so I want the enemy tanks to only appear once the player unit enters the trigger volume.

warm hedge
#

I don't know why you removed forEach

young mist
#

I dont understand the script since ive never used it before

sly cape
young mist
#

So if I put this in the trigger thats activated by the player once they are inside, this script will then spawn in the tanks?

sly cape
young mist
#

Soooo that? If it would be better I can pop into creativity and stream lol might understand better that way.

warm hedge
#

Condition is not where you put it, On Activation it is

young mist
#

TAKITANK1 is the variable name of the tanks group

#

So I assume thats what I put in the script

sly cape
young mist
#

Alrighty

#

Hopefully thats right lol

#

I have 3 groups of tanks. So if I wanted to add all three to this script would it be {_x hideObjectGlobal false; _x enableSimulationGlobal true;} forEach units TAKITANK1, TAKITANK2, TAKITANK3;

sly cape
young mist
#

Okie dokie

#

Let me see if this works and ill get back to yee

#

Hmm still seem to be visible. Will check if I wrote anything wrong

sly cape
young mist
#

Do I have to do that to the units?

sly cape
young mist
#

And dynamicsimulation?

sly cape
young mist
#

Alright just a sec

#

Do I have to do the same for the occupants? Or just the Vehicles?

warm hedge
#

If you want to hide them all, hide them all

sly cape
#

Unless units returns the vehicles, I don't think they're ever being unhidden.

young mist
#

alright

#

{_x hideObjectGlobal false; _x enableSimulationGlobal true;} foreach ((units TAKITANK1) + (units TAKITANK2) + (units TAKITANK3));

#

That look alright to you?

warm hedge
#

If they are group variables, yes

young mist
#

Okie, and ive just disabled simulation on the Vehicles and their occupants

pallid palm
#

using EOS_1_98 or EOS 1.98 would help you see a nice way to learn: how to spawn in Enemy EOS = Enemy Occupation System: Down load here: https://forums.bohemia.net/forums/topic/144150-enemy-occupation-system-eos/ by BangaBob https://www.youtube.com/watch?v=diQ8wT1l8H4

http://forums.bistudio.com/showthread.php?153100-Enemy-occupation-system-(eos)
How to use my occupation script. Made for Arma 3

Thanks for watching please like and subscribe!
My twitter is...
https://twitter.com/#!/H8erMaker

▶ Play video
young mist
#

Whats that?

sly cape
pallid palm
#

now what's wrong @sly cape

young mist
#

Okie

sly cape
pallid palm
#

really hmm i found it in 2 seconds

#

after i learned how to use the EOS system: i of course changed all to it fit my needs

#

it's really a good system and so user friendly: its a good starter system that just uses scripting: and it teaches you alot about spawning in enemy

young mist
#

Gonna give the script a go in a little test room to make this easier.

#

Noice the script works!

#

Thanksssss

#

This should help me optimise my levels a bit more

#

Because oh lordy lord does it need it haha

pallid palm
#

@sly cape link up there for you ok m8: to the DL: and to a video on how to use it

#

i feel this system can teach anyone a lot about spawning in enemy

#

so you don't need 1000 things on the map 🙂

#

but like i said i edited lots of the scripting: to fit my needs: i cut it way down to only the stuff i needed: for my missions 🙂

#

if anyone needs more help on how to use this system i can help with that too

#

BangaBob, is Awsome i think so anyway

young mist
#

I just wanted to have a means to control when my units are visible on the map.

pallid palm
#

sure ok np m8

#

it was more for Stick joe cuz he said he can't find it

young mist
#

Does anyone know how to use the custom text for the endscenario module? Not sure if im missing something to get it working.

#

The writing does not appear on the end scenario screen

pallid palm
#

endscenario module- is typically synced to a trigger

young mist
#

Oh yeah I know how to sync it etc, what im trying to get working is the Custom Type

#

Getting the text I wrote to actualy appear on the end scenario screen

cosmic lichen
#

Custom type is a class of CfgDebriefing iirc.

#

You can define that in the description.ext

young mist
#

Thats in the mission folder right?

cosmic lichen
#

Yes

#

Search for description.ext on the wiki

young mist
#

Thanks

pallid palm
#

i use the Description.ext

// at the bottom of my Description.ext
class CfgDebriefing
{  
    class End1
    {
        title = "MISSION COMPLETE";
        subtitle = "VC Camps Cleared";
        description = "4 VC Flags Captured";
        backgroundPicture = "";
        picture = "";
        pictureColor[] = {0,0,0,0};
    };
    class End2
    {
        title = "MISSION FAILURE";
        subtitle = "USMC K.I.A";
        description = "";
        backgroundPicture = "";
        picture = "";
        pictureColor[] = {0,0,0,0};
    };
};

and in a trigger with no Area: on the map somewhere: well i have 2 triggers really 1 for win and 1 for loose
in the Onactivation i put one of the following you will also need a condition in the triggers

//win mission
["End1"] remoteExec ["BIS_fnc_endMission"];


//fail mission
["End2", false] remoteExec ["BIS_fnc_endMission"];
#

to match End1 and End2

#

you can have as many End-inds as you want

#

in some of my missions i have 4 Diff End-ings End1 End2 End3 End4

winter rose
young mist
#

Its a big British Army mission ive made. Took quite some time lol

hushed turtle
warm hedge
#

What do you think about it? Why would you need it?

hushed turtle
#

So it fires only where unit is local and I could add it everywhere in case of locality change. But I don't need it to fire on everywhere every time though

I guess I could add and remove it from locality changed EH

pearl gulch
#

Hello, do anyone know the id's for displayctrl in inventory? I want to add eventhandler for clicking on a primary weapon but idk whats the id

stark fjord
hushed turtle
#

That's also an option

pearl gulch
#

Nah unfortunately

stark fjord
pearl gulch
#

Because I need subcontrols

#

like 638 for items in the uniform

hushed turtle
stark fjord
#

Give unit bolt action rifle 😄

hushed turtle
# pearl gulch Because I need subcontrols
// Futura ui
#define IDD_FUTURAGEAR            602
// FUTURA GEAR controls
#define IDC_FG_PRIMARY            610
#define IDC_FG_SECONDARY          611
#define IDC_FG_HANDGUN            612

// prefix 620 means slot items
//---
#define IDC_FG_MAP                6211
#define IDC_FG_COMPASS            6212
#define IDC_FG_WATCH              6213
#define IDC_FG_RADIO              6214
#define IDC_FG_GPS                6215

#define IDC_FG_GOGGLES            6216
#define IDC_FG_HMD                6217
#define IDC_FG_BINOC              6238

#define IDC_FG_BACKPACK2          6239
#define IDC_FG_HEADGEAR           6240

// prefix 630 means slot container items(uniform, vest, backpack)
#define IDC_FG_UNIFORM_SLOT       6301
#define IDC_FG_VEST_SLOT          6302
#define IDC_FG_BACKPACK_SLOT      6303
/// containers load
#define IDC_FG_UNIFORM_LOAD       6304
#define IDC_FG_VEST_LOAD          6305
#define IDC_FG_BACKPACK_LOAD      6306
#define IDC_FG_GROUND_LOAD        6307
#define IDC_FG_TOTAL_LOAD         6308
//---
#define IDC_FG_MAGAZINES          618
// primary
#define IDC_FG_PW_MUZZLE          620
#define IDC_FG_PW_OPTICS          621
#define IDC_FG_PW_FLASHLIGHT      622
#define IDC_FG_PW_MAGAZINE        623
// secondary
#define IDC_FG_SW_MUZZLE          624
#define IDC_FG_SW_OPTICS          625
#define IDC_FG_SW_FLASHLIGHT      626
#define IDC_FG_SW_MAGAZINE        627
// handgun
#define IDC_FG_HG_MUZZLE          628
#define IDC_FG_HG_OPTICS          629
#define IDC_FG_HG_FLASHLIGHT      630
#define IDC_FG_HG_MAGAZINE        631

#define IDC_FG_GROUND_ITEMS       632
#define IDC_FG_CHOSEN_CONTAINER   640
#define IDC_FG_PW_UNDERBARREL     641
#define IDC_FG_SW_UNDERBARREL     642
#define IDC_FG_HG_UNDERBARREL     643
#define IDC_FG_PW_MAGAZINE_GL     644
pearl gulch
#

Damn you saved me

#

Thanks ❤️‍🔥

winter rose
hushed turtle
#

How do I know? You're the one editing it kekw Lou

winter rose
#

where should it go? asking for a friend

hushed turtle
#

Dunno. Try to ask dedmen Ded

winter rose
#

@still forum I was told by this person to ping you repeatedly until I obtain an answer! blobcloseenjoy

hushed turtle
#

🤣 🤣 🤣

winter rose
stark fjord
#

Did pete check 138?

winter rose
#

nope, and he can't retire until he does

stark fjord
#

Poor pete

winter rose
#

he left the company 50 years ago, we don't know where he is now

stark fjord
#

But still on payroll until he checks it?

winter rose
#

hah! you don't know our finance department
he's most likely hunted down by our QSRF

#

IDK how can one organise these IDDs in a pretty way; one table per display I guess

stark fjord
#

Nah, just dump list and keep appending. Like it was done by developers

hushed turtle
#

The file I've copied it from has over 3 thousand lines defines, so have fun adding it all on wiki 😅

winter rose
hushed turtle
#

Inventory itself could have been mentioned

still forum
pallid palm
#

Arma 3 its perfect: i'm not sure what he's talking about: i love Arma 3

#

i never had 1 thing go wrong with Arma 3 ever: its the best game in the world

#

but then i don't use any Mods

#

sep for terrains

#

my dreams have always worked out cuz of the guys that help me lots 🙂 in this channel

mortal folio
pallid palm
#

yup 🙂

#

only a few ai will go into rocks it almost never happends

#

there's lots of ai enemy in my missions so if a few have to die by death trigger its ok 🙂

#

if you use findSafePos its all good then 🙂

#

most of the time anyway

winter rose
#

no other games allow AI in rocks so frequently
best game ever!

pallid palm
#

its ok i don't consider that to be bad thing its just a Arma thing 🙂

#

still the best game ever imho

#

other games have other things bad about the game more then Arma 3 🙂

#

and hello Lou: how are you mate

winter rose
#

hi there, well it's Friday

pallid palm
#

woohoo hell yeah

#

my friends will be playing today in a night mission i made with no NVG and only flashlights : the moon will be out and showing bright 🙂

#

i get to be the chopper pilot for the mission: cuz my friends don't fly so much 🙂

#

but ofcorse there's always the Insertion\Extraction chopper can be used 🙂 also

#

super Awsome chopper command i made with the help of the Awsome guys here in discord 🙂

#

Chopper Command is run or by or is exec-ed by the CfgCommunicationMenu: woohoo

sharp grotto
#

Does a Air drones have a additional type than "Air", I tried "UAV","Drone" etc. all non existent.
I want to specify and "Air" would be too generous

tulip ridge
winter rose
#

isUAV = 1; is all we have I believe

tulip ridge
#

You can just filter by unitIsUAV _x && { _x isKindOf "Air" }

tulip ridge
#

~4ms for unitIsUAV vs ~13ms for config lookup (10k interations)

winter rose
#

I could not find the command name though 😄

sharp grotto
#

Thanks guys

private _nearbyUAVs = player nearEntities ["Air", 800] select {unitIsUAV _x};
private _nearbyUAVs = allUnitsUAV select { (_x distance player) < 800 };

Both around 0.0012 ms

winter rose
#

first one may be faster, less air entities around player

#

ah well, basically the same really

tulip ridge
#

Second may scale better, first will include all aircraft and parachutes. Probably will be more of those in 800m than UAVs total

Probably doesn't really matter that much though, so I wouldn't worry about it

winter rose
#

depends on if there are 500 UAVs total or 500 flying things around the player 😄

short anchor
#

The latter sounds like an average session with the group I play with. We're very disorganised

winter rose
#

"where is he flying?"
"…a bit everywhere"
"…especially since that landmine"

sharp grotto
tidal idol
indigo snow
#

ASL - ATL if you want to ignore waves

#

The wiki article on position has a nice explanatory image

lone glade
#

prefer getPosWorld vs getPosATL

#

getPosWorld is more accurate.

indigo snow
#

That includes waves doesnt it? But yea theres a few new ones, look at the picture to see what fits best.

young mist
#

@sly cape @warm hedge Just wanted to say thanks again for the help with that script. Found a lot of FPS, mission pacing, and stability tricks using it.

lone glade
#

nope shouldn't include waves

indigo snow
#

Ah nice

lone glade
#

ASLW is taking waves into account

#

ASL doesn't and is constant across the map

pallid palm
#

hello all can someone show me the default cost: of all stuff like tanks and soldiers and stuff like that: i cant seem to find it

#

it keeps saying like 2.99 for a tank lol 🙂

#

thats not what i want to see lol

granite sky
#

You mean zeus points cost?

stark fjord
#

For example abrams ~24.000.000 usd?

pallid palm
#

yeah like that @stark fjord

#

is there a list to show all default

stark fjord
#

Imean i found this on wikipedia 😛

pallid palm
#

really how

#

i tryed

granite sky
#

He means he looked up the real cost of an Abrams on wikipedia.

#

I have no idea what you're trying to do.

pallid palm
#

oh no no i mean like threat values or cost values i guess

granite sky
#

no guessing is allowed

pallid palm
#

im not sure what i mean i guess lol

#

lol

stark fjord
#

BE sure!

granite sky
#

Then you need to resolve that :P

pallid palm
#

i guess i need the threat values

#

i was thinking cost was threat values:

#

but i mean threat values i need

hallow mortar
#

What do you need this for?

pallid palm
#

ummm i want to try to change the threat value of the players

granite sky
pallid palm
#

ahhh nice

#

oh yeah that looks like what i need thx @granite sky

granite sky
#

setUnitTrait has camo/audible coefficients but I don't think those have any effect except on spotting.

hallow mortar
#

You can't really change it through scripting, it's part of the config.
As John said, you can affect detectability, but that's not exactly the same as threat.

pallid palm
#

i see

#

darn

granite sky
#

Tiny mod time? :P

pallid palm
#

i want to make all players the same threat value as a Tank 🙂

#

oh no mod time lol 🙂

granite sky
#

hmm. Not sure what effect that would actually have.

#

Usually they ignore tanks because they have don't a weapon to kill it with anyway.

pallid palm
#

well i bet the enemy would shoot RPGs at you that way

stark fjord
#

Err no.

hallow mortar
stark fjord
#

If thats your goal mod "LAMBS RPG" does that

#

But afaik it alters Ai fsm

#

Which is something you could do thru mission

pallid palm
#

yeah thats why i would like to make my own

#

i see thx Nikko

#

and others

stark fjord
#

Actually im not sure you can change danger fsm via script

pallid palm
#

must be not cuz every time i tryed it failed 🙂

#

i got the Ai to put the RPG on the shoulder but they did not fire it at me

stark fjord
#

Nono, you would need a custom fsm, but im not sure if you can overwrite the default fsm via script, only via config

pallid palm
#

see i don't want to do it the stupid way where people spawn a fake tank behind you like

#

must not be able to darn

stark fjord
#

lemme check

pallid palm
#

ok cool

stark fjord
#

OK no, youd have to modify aiAmmoUsageFlags of the muntion to be used against infantry. Otherwise AI will refuse to fire (on its own)

pallid palm
#

i remember way back in the OAdemo you could get Ai to fire RPGs at you it was Awsome

stark fjord
#

Scripted force fire would be too much?

pallid palm
#

i even removed all weapons from the Ai and they only have a RPG and they still did not fire at me

stark fjord
#

they wont, ammuniton config tells them, that this round is useless for infantry.

Same way they dont use rifles against tanks

pallid palm
#

yeah i see darn

#

oh well thats 1 dream gone 🙂

#

w8 isnt there RPG foot soldiers ammo

#

like the ammo they use on foot soldiers'

stark fjord
#

did you try fireAtTarget?

otherwise doWatch and forceWeaponFire that will work, abeit janky

pallid palm
#

right i see

#

darn

#

yeah i tryed eveything

#

i tryed like 50 time with all diff ways to get it to happen and nope it failed 🙂

#

i was thinking if i can get a chopper to fire unguilded rockets at me in a moving can maybe i could do this 🙂

#

the chopper part was easy 🙂

#

this however is not working

#

with the RPGs stuff

#

i guess i'll put it on the shelf for some day 🙂

indigo snow
#

What format is your given position in?

pallid palm
#

i wounder if i can get the fsm from OA-Demo 🙂

indigo snow
#

Why spawn a testing object if you already need a position to spawn it in?

pallid palm
#

ah haaa hmmmm 🙂

indigo snow
#

ASLtoATL and their variants

pallid palm
#

very very insteresting 🙂

indigo snow
#

If you already have an ASL just use ASLtoATL

#

And the diff in Z is the depth

#

No need to spawn any unitd

#

You used to have to if you wanted to take waves into account but not anymore

finite bone
#

Detecting if a curator has looked at zeus ping alert using this has been extremely inconsistent. Any workarounds or solutions?

waitUntil {uiSleep 0.05; inputAction "curatorPingView" > 0};
mortal folio
#

i think he wants the actual response (pressing space to the ping)

finite bone
#

Thats when a player has pinged the curator - I am looking for the inverse (what Kharos has stated)

mortal folio
#

why do you have uisleep 0.05 there?

finite bone
#

Safe practice xd

#

Does it really require perframe checks though?

mortal folio
#

not really necessary, but also a more important question - how exactly is it inconsistent? is it just triggering sometimes or what?

mortal folio
#

but it's a cheap check so you shouldn't worry about that for something like this really

finite bone
#

Even without the sleep delay, spamming space does not work either.

#
[] spawn { 
    waitUntil {inputAction "curatorPingView" > 0}; 
    hintSilent "KEY DETECTED"; 
};
mortal folio
#

where exactly are you're running this code? given the nature of this im going to assume you're running a server, a zeus client, and a pinger client - is the code actually being executed on the zeus client?

#

also have you tried a per-frame-handler instead? might be scheduled being scheduled and just missing it

mortal folio
#

i'd just try unscheduled then and see what happens, beyond that im not sure 🤷 someone else might be able to help, the one time i used inputAction i didnt have any issues

finite bone
#
private _handle = [{
    params ["_args", "_handle"];
    _args params ["_wasPressed"];
    private _pressed = inputAction "curatorPingView" > 0;
    if (_pressed && !_wasPressed) then {
        hintSilent "KEY DETECTED";
        [_handle] call CBA_fnc_removePerFrameHandler;
    };
    _args set [0, _pressed];
}, 0, [false]] call CBA_fnc_addPerFrameHandler;

running unscheduled - still no sad

lone glade
#

for '_x' from 0 to 1 step 0 do dafuq

split coral
#

How about "getTerrainHeightASL _testpos"?

eternal ingot
#

does anybody here know how to put voice chat text in the middle of your screen? e.g alpha 1-1,Continue on mission advise over

short anchor
#

I've noticed that 2.22 introduces promises. That is very nice

still forum
#

Just hope it works as designed, not many people testing it yet meowsweats

little eagle
#

step 0
O_O

young mist
#

Is there a script I can use that can make NPCs appear in a zone when a player is in the trigger volume, then disappear when out of the trigger?

#

Got a base with a lot of static ambient NPCS on it, and to save on performance I want them to stop being simulated and vanish when the player is not in the area.

#

I was thinking using that script I was shared before, reversing the logic for a trigger when the player is outside, and another trigger with the inverse logic for when inside the trigger

split coral
#

yeah, odd way to do "while {true}"

young mist
#

Hmmm i think I may have actually figured out something

#

Yes!

little eagle
#

It hurts

young mist
#

Now I can make my NPCS disappear and reappear at will

#

This will save on performance plenty

#

Ill share an example of what I have figured out incase any of you wanna try it

grave belfry
#

Anybody know how to read out whether a unit has been given a stop order either via 1-6 or commandStop / doStop?

hushed turtle
grave belfry
hushed turtle
#

If unit is leader then select him as leader using selectLeader, which for whatever reason removes the command. If not leader, then joinSilent him into his own group

grave belfry
#

Awesome. Many thanks.

primal trench
#

What would cause a function that's called within another function to execute in multiplayer 3den but not when on a dedicated server?
One function is declared in XEH_PreInit using compileFinal preprocessFileLineNumbers as its own sqf.
The function it's being called within is declared in-line within a different .pbo's XEH_PreInit file itself.

#

Due to rpt logging, I can confirm that the former is firing from the editor but not from server

errant jasper
#

Maybe hasInterface or local player.

primal trench
#

Nothing in any of the scripts has those; is including them the solution?

errant jasper
#

No.

primal trench
#

I thought not

grave belfry
#

How do I obtain a unit's "number"? As in, e.g. my squad is "Alpha 1" and unit three is "Alpha 1-3". It will retain its designation even when e.g. one and two involuntarily leave the team by dying. Can't use the index in units group player here...

errant iron
grave belfry
#

Yes, very good. Thanks!

digital hollow
primal trench
#

I can call it manually through the exec function zeus module and it executes normally

digital hollow
#

yes, but that doesn't necessarily mean it exists at the time of being called in the 1st fnc

ruby spoke
#

Is there a way to display an Icon in the same RscTitle as text?

short anchor
# short anchor I've noticed that 2.22 introduces promises. That is very nice

@grave belfry excuse the ping. Tagging as I've seen your reaction here.

A "Promise" enables more efficient asynchronous programming. The BI wiki has a great example of this new functionality under the Script Handle page. https://community.bistudio.com/wiki/Script_Handle

Essentially, in the past you'd have to use waitUntil to progress with a script, that's running in the scheduled environment, once your condition is met.

Now with promises, you can return a script handle and chain a continuation to that to invoke your next piece of code once the script handle is terminated. No more waiting for arbitrary amounts of time and better performance.

grave belfry
short anchor
#

No problem. I need to play around with it but I'm not expecting many surprises to be honest. It'll be identical to Task in C# or Promise in JavaScript.

At the very least, it'll be nice to get rid of the conditional waitUntil elements from scripts where it's no longer necessary

grave belfry
#

...and getting rid of waitUntils with uiSleep 0.1 crammed into them, too.

short anchor
#

Yep, exactly. It was always a fine line between having a script that's reactive enough but that isn't too expensive in performance

stable dune
granite sky
#

Doesn't seem like a common case. Usually if you're using waitUntil you're not waiting for a script to finish. I do have one system where I chain scheduled functions with waitUntil so that the whole thing doesn't fall over if one of them bugs out.

stable dune
#

Okey

short anchor
#

It's not so much that you're waiting for a script to finish. It's that you're waiting for a certain condition to be true before invoking more code. With the promise approach, you can do that by chaining your continuation to the handle returned by your spawned script

errant jasper
#

It nice feature. But like 99% mine is running unscheduled anyway. The only 1% left would be like the rare managing script, or when there isn't an event and I must run a check manually. But for the latter it is only if it is one-off, because otherwise I just emit events.

short anchor
#

There'll be cases where waitUntil is still required but if an event type exists and you could hook into that then it's a good thing to substitute out

granite sky
#

Arbitrary condition is still running some piece of script regularly though?

#

Ah, I guess you can also create arbitrary promise handles that you can terminate from an EH, for example.

short anchor
#

Pretty much. If you have nothing to hook into them waitUntil is still a good bet.

If there's an event though, a promise will be more efficient. No need to block that script anymore

granite sky
#

would have liked waitUntil [condition, timeout] more personally.

#

but that's really syntactic sugar

#

[condition, interval, timeout] I guess.

still forum
still forum
errant jasper
#

Yes I understand, the continuation is unscheduled, it is just very rare I need/have scheduled at all

I assume the waiting scripts are placed completely on hold separate from scripts and does not even have check-readiness overhead?

still forum
#

"Empty handles" are not simulated

#

Say you have a call, that returns the result asynchronously. (For example extensions with callbacks)

You can do

[fnc_callback] call GoFetchSomething; // calls fnc_callback after the fetch is complete

or you can

_promise = call GoFetchSomething; // Returns a promise that completes with the fetch result;

_result = waitUntil _promise; // In scheduled script, can suspend until the result arrives
_promise continueWith { _result = _this }; // Trigger unscheduled "eventhandler" when the result arrives

It's more universal that way.
You can suspend in scheduled.
You can attach multiple continuations (or none).
You can regularly check "did I get the result yet?"

errant jasper
#

Yeah async callback from extension is a good use case. Though I would probably skip the scheduled environment and add the "rest of the script" as continueWith. We can do that right?

still forum
#

My last example just without the waitUntil? yeah

short anchor
#

In that last example, shouldn't the continueWith come before the waitUntil to ensure the continuation is chained at the right point or does that not matter?

still forum
#

If you add a continue to a already completed promise, it executes immediately

#

Last example meant either waitUntil or continueWith, not both together

short anchor
#

Ah, I see what you mean. That's good to know also regarding the execution detail

errant jasper
still forum
#

The original continueWith runs when its completed

#

So.. that would happen first

#

Or what do you mean by original execution?

errant jasper
#
// In unscheduled context
//....
donePromise continueWith { systemChat "A"; };
systemChat "B";

What happens first?

#

Or does the rest never run? Like an exitWith?

#

Edit: installed dev version. The continueWith happens runs first.

short anchor
#

Regarding the extensions with callbacks example, what would that look like specifically? Would it be assigning the continuation through the ExtensionCallback mission event handler?

errant jasper
#

What I would do is call a wrapper that creates an "Empty Promise" and stores that (say in a hashmap or sumfink). It then calls the extension with some unique ID, and returns the promise.
Then when the extension call back into sqf it also passes the ID. The "wrapper layer" then find the promise and resolve it with the value from the extension.

short anchor
#

That's similar to what I was thinking around storing in global state, but I wouldn't say that's any more convenient than simply calling a function within the callback

errant jasper
#

Certainly not more powerful. But it slightly more flexible for the caller in how it is used, or when.

short anchor
#

I'll admit I haven't used the newer extension callback event handler. It's been around a decade since I've done anything with extensions in fact.

Using a continuation within the callback seems like it'd be good for a more niche use case whereas I'd opt for function names with some good validation and error handling in case the function doesn't exist

The downside to that approach however is that you need to remember to update your function names in two places - CfgFunctions and C++

errant jasper
#

Not sure what you mean by if the function doesn't exist? The call to the extension doesn't change compared so synchronous call. In fact you can use the callback without ever making a normal extension call.

short anchor
errant jasper
#

Ah, I see. To be clear they don't have to be "function" names in sqf. Not sure why the args are even named like that. Could just call it like callback("MyExt", "DB_RESULT", "[1234, \"DATA_HERE\"]") and then on the sqf side. Roughly made example:

addMissionEventHandler ["ExtensionCallback", {
  params ["_name", "_function", "_data"];
  if (_name isEqualTo "MyExt") then { [_function, _data] call MyExt_Callback;};
}];
MyExt_Callback = {
   params ["_cmd", "_argsString"];
   private _args = parseSimpleArray _argsString;
   if (_cmd isEqualTo "DB_RESULT") then {
       _args params ["_token", "_data"];
       private _promise = MyExt_CallbackMap deleteAt _token;
       _promise terminate _data;
   };
   //....
};

You only have to test the names once to be sure they are not wrong.

short anchor
#

Light-bulb moment - I see what you mean now

errant jasper
#

Forgot this part: private _args = parseSimpleArray _argsString;.. But that is the general sketch.

#

And of course, we have fromJSONand to toJSON for any non-trivial string serialization.

silent cargo
#

I've created a WIP logging system for a server and I am wondering how easy it would be to integrate it into a database where it sends the log results to a separate file which compiles over time, i/e a total number of kills someone has over the span of a month.

#

Would this be relatively easy?

short anchor
#

Depends really. If you want it going to something like a SQL database then you'd need a database extension. Otherwise you could have a simple file logger extension to pipe contents out to a log as a flat format

silent cargo
#

I just dont recall if arma has a log to file or anything like that

#

Diag log just goes into the RPT for example

short anchor
#

The question I'd ask is what do you plan to use the information for? Will it serve a use etc

short anchor
#

Although, A3Log seems to pipe out to the RPT

silent cargo
silent cargo
sharp grotto
#

it can create logs files for days etc, so you could manually do it after each day.

#

or have some python script doing it automatically by reading from the daily logs.

silent cargo
#

Okay ^

I think I will just use my Discord API to log it to a discord channel

#

I was looking at some arma 3 server site and they compile total score of players over time using that game dig query feature and I wanted to have something similar but with more accurate info.

#

Not sure if anyone has ever seen it before

errant iron
#

not exactly conducive to a real-time feed, but you could try that approach if you don't want to go the custom extension route

silent cargo
#

Is this posted anywhere or you just using on your server for now

errant iron
silent cargo
#

And you are just using server side event handlers to track the kills and activity?

errant iron
#

other stats like players transported are checked with... polling loops... cause i didn't want to go through the effort of broadcasting local EHs like GetIn/GetOut 🙃

silent cargo
#

easier

#

lol

errant jasper
#

Well, not those exact, since those are global.

errant iron
#

wait those fire with global args? i had just assumed they were local since i saw them used as such >.<

errant jasper
#

Not leaving the couch to verify, but BIKI list them as global. For non-local machines they have to be readded on respawn.

errant iron
#

hmm good to know that, ill check in a bit

#

yup, worked on non-local vehicles and units for GetInMan equivalent

austere granite
#

Does anyone know if ctrlDelete is broken? I got controls made with ctrlCreate, saved in an array, then when I run the script again I loop through that array using ctrlDelete to clean up the existing stuff before recreating... but it don't work

#

I tried both saving the controls themself in the array or their IDCs and then deleting them directly or through controlsGroupCtrl and none of them work.

cyan dust
#

Is there a way to reboot unit AI or something? 🤔
Still seeing some drivers straight up refusing to move to a waypoint

granite sky
#

It's a group thing so rejoining/rebuilding the group would do that. I think there are multiple failure modes though. Moving the vehicle fractionally works sometimes.

cyan dust
#

Thanks, I'll try that

granite sky
#

I am assuming that it's an easy waypoint. Otherwise there are other potential issues.

cyan dust
#

Yeah, nothing fancy, just a MOVE wp

granite sky
#

I mean easy to navigate to. No bridges, no clutter etc.

austere granite
#

Nvm fixed it. You need to ctrlEnable false and ctrlShow false first to get it to work apparently

#

As a replacement question: Is there a way to disable control(groups) by default in config?

marble plume
#

I am trying to add a custom image to the screen of a Rugged Tablet, however when I put in the path it just appears entirely white. What's the deal? Does the picture need to be a specific size?

#

nvm, got it

winter rose
exotic flame
#

Is there a way to access the object contained in a CT_OBJECT in order to apply modifications ?

#

Like changing hiddenSelections textures etc...

knotty mantle
#

Hey Guys, is "profielNamespace" remoteexecutable? My problem is: savedLoadout = profileNamespace getVariable ["TEST_Loadout", []]; <- this executed on Server is working; savedLoadout = [profileNamespace, ["TEST_Loadout", []]] remoteExec ["getVariable", 2]; <- this executed local isn´t. I AM on local MP though, but it should still work, shouldn´t it?

errant jasper
#

You can't remoteExec an assignment like that... You run this on a machine:

savedLoadout = [profileNamespace, ["TEST_Loadout", []]] remoteExec ["getVariable", 2];

Part right of = is [profileNamespace, ["TEST_Loadout", []]] remoteExec ["getVariable", 2]; which runs and remoteExecs on the server. But the result of the expression on the client is like "" since you do not use JIP parameters. So what actually happens is more like:

// Sending this "instruction" to server:
profileNamespace getVariable ["TEST_Loadout", []];

// Doing this on the local machine
savedLoadout = "";
knotty mantle
#

Thank you very much. I guess i´ll have to go at this problem with another logic then.

hushed turtle
#

You could remote execute function, which would read profile namespace and send returned variable back by another remote exec

errant jasper
#
  • If it is for a mission use missionProfileNamespace instead.
  • If the data never change (besides mission changed), then just put it in a file and load it directly on the clients.
  • Okay it does change. Well, do all clients need it? Then publicVariable it once, and on changes.
  • Only some clients or one client need that particular data? Well are you sure you need to store it on the server-side then? Store it locally in missionProfileNameSpace.
  • Okay, you really do need to because the server is storing Life-money for the player or something: yeah do the bothersome request-response key-value retrieval.
little eagle
#

ctrlShow false

#

sry, ctrlShow false from the dialogs / displays onLoad event

#

onLoad = "_dlgNaviPadDialog = _this select 0; {(_dlgNaviPadDialog displayCtrl _x) ctrlShow false} forEach [2, 9]; uiNamespace setVariable ['BWA3_dlgNaviPad', _dlgNaviPadDialog];";

austere granite
#

Yeah I was hoping for an actual config. The scripting side i got is already connected to onload which works fine, it's just that there's a lot going on with elements. Probably gotta split it up between purely running the ctrlShow bits first instead of handling everything related to one control first.

knotty mantle
#

Well it is for a campaign. I basically want to save the state of the destroyed POIs, Soldier loadouts defeated groups etc. The only way i found for that is the servers profilenamespace...

little eagle
#

You could set the w,h to 0 and then back to their intended values instead of ctrlShow true

errant jasper
#

Ah yeah then that is your only choice. Or if you mean like a true campaign ™ , then there is saveVar, but I've never used that.

knotty mantle
#

Okay. Thanks for the assistance. Much appreciated

austere granite
#

Hmm yeah that's something I'll have to consider, might want to animate stuff anyway so should be easy to put in there

little eagle
#

There should be no problem with ctrlShow false from the onLoad event though

austere granite
#

Nah there isn't, I just gotta reorganize my functions a bit to make sure they get run in the proper order, so that's the first thing I do.

#

I got 2 panes basically and right now I'm running all the code for the left pane (Which is quite a lot) and then only after that the call to check whether right-side pane should be hidden. Means you get a tiny flash for a second which is annoying as fuck 😄

little eagle
#

For some reason, ui scripting get's always messy when I try it. The navipad was/is horrible before I rewrote it

#

onLoad doesn't cause a flash. It's done in unscheduled environment

austere granite
#

Actually might be right when it cocmes to that. For testing purposes I got a createDialog and the functions that show/hide in a seperate function now instead of using onLoad. onLoad doesn't actually show the dialog before it's functions are run right?

#

It's all unscheduled already though

little eagle
#

onLoad is done in the same moment you do createDialog

tough abyss
#

Hello i have this problem 'B' encountered instead of '}' when i start the game

austere granite
#

Config syntax error probably

tough abyss
#

My line code class CfgVehicleClasses {

class Transports Blindées {        
    displayName = "Transports Blindées";        
};
class Blindées {        
    displayName = "Blindées";        
};
class Aériens {        
    displayName = "Aériens";
};

};

austere granite
#

Can't use space in class name

little eagle
#

Can't use spaces in classnames

austere granite
#
class Transports Blindées {
little eagle
#

also that é

austere granite
#

Replace it by an underscore and getrid of accent aigu

little eagle
#

Better use english for classnames

tough abyss
#

ok thank

austere granite
#

The one thing I always like with UI scripting is a mistake i pretty much always make when i add a curSel related thing somewhere.... the endless loop of calling itself 😄

tough abyss
#

i solve and it's works thank

little eagle
#

yw

versed trail
#

is there any reason that serverTime would get dramatically out of sync in the 5 minutes between scheduled syncs? is it something I should worry about or need to sync manually when planning around it?

short anchor
#

Is the behaviour between Killed, MPKilled and EntityKilled a 1:1 in terms of feature parity? Adding a server-side EH for EntityKilled seems like a nice way to replace all of my individual Killed and MPKilled event handlers where they all call the same function

bronze trellis
#

hey all, for my mission i want to put down a zone and not allow a players be able to leave that zone. is it possible to do that?

fallen locust
#

2 ways
object with no texture like a dome

#

or

#

scripting

granite sky
#

Short answer: No.