#arma3_scripting

1 messages · Page 469 of 1

meager heart
#

yes that is official, afaik you will need it when you set respawn templates in description like just respawnTemplates but you have multiple player sides

cosmic lichen
#

That's weird, it's not on the wiki

#

Would you mind documenting that?

meager heart
shadow sapphire
#

So, I need to check the distance of a group from any unit that isn't in their faction that they know about. Anyone know of a good way to do that?

still forum
austere granite
#

wat

shadow sapphire
#

I don’t understand this.

meager heart
#

it's magic

polar folio
#

what would be the most straight forward way to have an AI unit say "Fuck!" using its voice set defined in its identity or where ever?

#

@shadow sapphire how often and how fast do you need the info? could potential cause some hick ups with lots of units

shadow sapphire
#

@polar folio, doesn't need to be often. It just needs to check the distance between a certain group leader and any "unauthorized" unit.

polar folio
#

what's the scenario though? what for? and do you need one positive or do you need the distances for all of them to do stuff with? also what do you have so far?

winter rose
#

@polar folio f-word hasn't been recorded in "needed radio voices" for units afaik

polar folio
#

@winter rose it was just an example. there is some cursing for sure. i need simple reactions. and i was hoping i wouldn't have to extract from configs myself

shadow sapphire
#

@polar folio, I just need the one guy's distance. It's for an AI sniper team, where if players, hostile factions, or civilians get too close, the AI sniper team will dip out. I've actually been picking away at it all morning, and I've gotten super close at this point to what I need. The final think I need is just to stack a variable to mean "any unit." Somewhere. Here is what I've got so far:

//Greek Sniper Team
if (!isServer) exitwith {};
params ["_trigger"];
_trigger spawn {
    _G1 = [(_this getpos [600,(_this getdir (getmarkerpos "Origin")) -60 + round random 120]), INDEPENDENT, ["I_Spotter_F","I_Spotter_F","I_Sniper_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;

    {
        {
//            _x execVM "Gear\AAF.sqf";
        } foreach units _x;
    } foreach [_G1];
    
    _G1 setcombatmode "GREEN";

    Sleep 5;

    _G1 addwaypoint [_this getpos [-400, (getpos leader (_G1) getdir _this)], 0];
    [_G1, 1] setwaypointformation "VEE";
    [_G1, 1] setwaypointspeed "FULL";

    _G1 addwaypoint [_this getpos [-300, (getpos leader (_G1) getdir _this)], 0];
    [_G1, 2] setwaypointspeed "NORMAL";
    
    Waituntil {((leader _G1) distance _this) < 350};

    {
        {
            _x setunitpos "Down";
        } foreach units _x;
    } foreach [_G1];

    Waituntil {((leader _G1) distance Scott) < 250};
    
    _wp = _G1 addwaypoint [(getmarkerpos "Origin"), 0];
    [_G1, 3] setwaypointbehaviour "SAFE";
    [_G1, 3] setwaypointspeed "FULL";
    {
        {
            _x setunitpos "Up";
        } foreach units _x;
    } foreach [_G1];
};
#

Where "Scott" is a named unit in the editor what a waypoint that moves him close enough to get the sniper team to run away.

#

Also, one thing I need to do is replace (getmarkerpos "Origin") with a single variable. I don't quite understand why putting _base = (getmarkerpos "Origin") isn't working, but the reason seems to be two fold as base nor _base work, and throw different errors.

#

@winter rose, @polar folio, how are you guys calling vanilla voice lines at all?

polar folio
#

will the behaviour only be triggerd by players coming close or also other units?

shadow sapphire
#

Any unit that's not in their same faction.

winter rose
#

@shadow sapphire @polar folio check CfgSounds for all "normal" words usable with say, else I think you need to define a sentence to use with kbTell (see wiki Conversations page)

polar folio
#

do you not care, if the sniper team knows about the units?

shadow sapphire
#

@winter rose, word. That's friggin awesome. I was asking around about that and had gotten no answers. That's super useful.

#

@tough abyss, I do, yes. Sorry, I had posted a version on here earlier that included knowsabout, but then I moved on without realizing that I'd taken that down or that it's too far back on the chat.

polar folio
#

@shadow sapphire tbh i'm not sure what would be the best way performance wise. i think, if it's just that one group and also a lot of units to check, if they are close, maybe just do nearX periodically

#

i think nearEntities is cheapest

shadow sapphire
#

@winter rose, where might I find CfgSounds? I'm trying to find all of the default voice lines in the game, like numbers and such.

#

@polar folio, thanks for the guidance. I'll look into it. Could you to me one more favor and explain to me the variable situation?

I want to create a private variable in this script that replaces (getmarkerpos "Origin") with _base. How might I do that? I've tried just adding _base = (getmarkerpos "Origin"), but that didn't work, nor did Base = (getmarkerpos "Origin"). They threw different errors, though, so my problem is two fold, apparently.

polar folio
#

what errors though?

shadow sapphire
#

If I used _base, it says it's undefined, despite being defined. If I use Base, it says it expects something different than what it is. Wait one.

polar folio
#

pretty sure it's undefined, if it says it is 😉

#

you have to be aware of scopes when using global variables

shadow sapphire
#
 7:43:41 Error in expression <pawn {
_G1 = [(_this getpos [600,(_this getdir Base) -60 + round random 120]), I>
 7:43:41   Error position: <getdir Base) -60 + round random 120]), I>
 7:43:41   Error getdir: Type Number, expected Array,Object
 7:43:41 File C:\Users\Donald\Documents\Arma 3 - Other Profiles\Deljay\missions\VRAITesting.VR\GST1.sqf, line 6
#

Yeah, I know it's undefined, the question is why is that variable undefined? I imagine since you said scopes, it essentially just means it's outside of some brackets that it should be inside, maybe?

polar folio
#

just from guessing i'd say using a global variable fixes the first error which then leads to the next one. it's pretty clear about what's wrong

still forum
#

Base use tags for all your global variables.
DEL_Base

#

If I used _base, it says it's undefined, despite being defined Nope. It's undefined. Local variables carry over to lower scopes yes.
But spawn spawns a completly new script instance. That's not a lower scope

winter rose
#

@shadow sapphire these would be CfgWords I believe

#

But then, kbTell

polar folio
#

@winter rose can't find CfgWords in the config viewer. any other ideas? might be some synonym

winter rose
#

CfgSentences maybe, I can't remember right now

shadow sapphire
#

@winter rose. Wow. Bro. That's super legit! Yes! CfgWords, indeed.

#

@still forum, why is it so important to tag global variables?

still forum
#

Because if someone else uses the same name

#

your script goes boom

#

And Base sounds like a variable someone might use

shadow sapphire
#

Okay, noted.

#

That is intended to be a private variable, though.

still forum
#

pass it to spawn via parameters

#

Looking at your script above.

    {
        {
            _x setunitpos "Up";
        } foreach units _x;
    } foreach [_G1];

That forEach is useless as it has only one element. You are literally just doing

_x = _G1;
        {
            _x setunitpos "Up";
        } foreach units _x;
shadow sapphire
#

That's because future versions of the script may have multiple groups.

#

Thank you for looking it over. All input is appreciated!

#

@still forum, it's working perfectly with local variable _base now. Thank you so much. This tremendously furthers my project. It tremendously improves several scripts and prepares them to be plugged into my community's sandbox.

#

The final remaining thing is that I need to change the variable Scott which is a variable name of a specific unit in the editor to be _threat and I need threat to literally be any character that isn't in the same faction as the group. I know there must be a relatively simple way to do that... Working it up now. Something like !EAST or something...

still forum
#

Finding some unit not in the same faction is easy

#

but putting every unit that is not in the faction into a variable that previously only had 1 unit is not

shadow sapphire
#

Well, how do we find some unit not in the faction? That's essentially all I need.

still forum
#

_threat = allUnits select (allUnits findIf {side _x != side _G1})

#

That should do it I think. Finds the first unit that is not on the same side/faction as _G1

shadow sapphire
#

Interesting. When you say first, you mean the nearest at the time, first spawned, first relevant, or what? Excuse my ignorance...

still forum
#

I don't know how that's ordered. I guess first spawned

shadow sapphire
#

This is very cool. Will it work to make my sniper team flea regardless of which faction first approaches them? The sandbox for which this is intended has civilians, blufor, and opfor, so the sniper team must flea regardless of which faction approaches, if that makes sense...

still forum
#
 Waituntil {((leader _G1) distance Scott) < 250};

->

private _leader = leader _G1;
waitUntil {
    //Is there any enemy unit within 250 meters?
    allUnits findIf {side _x != side _leader && _leader distance _x < 250} != -1
};

Here is an example that would check if ANY unit of a different side is within 250m of the groups leader

#

Will it work to make my sniper team flea regardless of which faction first approaches them No. That will only fire if that specific unit that's first in allUnits (Which might also be random) approaches them. But the script I just posted would do what you described

shadow sapphire
#

@still forum, amazing. Many, many thanks to you.

#

What does the != -1 catch do, @still forum?

still forum
#

findIf returns -1 if nothing was found

#

and 0 or bigger if something was found

#

we want to wait till it finds something. Thus != -1 means "wait until not nothing found" aka "wait until found something"

#

could also write >= 0 if you wanted

#

but that's essentially the same

dry zephyr
#

That seems like an expensive check - other things you should think about are how often are you going to run that? Also, it effectively gives the sniper unit X-ray vision through all walls and terrain nearby.

still forum
#

It is an expensive check

#

but scheduled script exits after 3ms anyway

#

Oh yeah. You could also just check through units that the sniper team knows about. So they won't run if they don't know the thread is there

shadow sapphire
#

I see. This is good stuff to know. By why must it be included?

dry zephyr
#

knowsAbout, Dedmen? Is that pretty accurate?

still forum
shadow sapphire
#

Also, yes, we definitely need a check for knowsabout. That was in the prototype version that I had, but I dropped it because I was caught up.

still forum
#

Might aswell use nearTargets then. That'll be much more performant

shadow sapphire
#

Oh! That's super great! This will improve several of my scripts in making.

still forum
#
private _leader = leader _G1;
waitUntil {
    //Get all known units in 250m distance.
    private _potentialThreats = _leader nearTargets 250;
    //Are there enemy units near?
    _potentialThreats findIf {side (_x select 4) != side _leader} != -1
};
dry zephyr
#

I don't know if it works, but there is also findNearestEnemy and nearestEntities

#

Just as interesting commands to check out.

still forum
#

That only returns enemies. He also wants civilians and stuff though.

#

Could use nearEntities but then you'd have to filter for knowsAbout and side.

dry zephyr
#

Why is the sniper retreating from civilians, DEL-J? Preventing discovery?

shadow sapphire
#

Yeah, we have a persistent sandbox, players can question civilians, and civilians will tattle, if criteria are met.

#

But, performance is paramount in this sandbox. There are so many players and so many systems that if we have to drop certain features will have to be nerfed or dropped.

dry zephyr
#

Going back to how often you are going to run it - Dedmen, you say that scheduled scripts drop at 3ms, but if you are spawning it every frame, that's not going to be good, right?

still forum
#

With that running you will probably have 3ms of scheduled scripts every frame.
You can add a sleep into the waitUntil

#

to make it more perf friendly

shadow sapphire
#

I don't really know. I know that our server has GREAT performance consistently, so it's a beast, but I don't know how much it can take, where we can give and take, what effects performance more than what, etc. Completely ignorant on that.

still forum
#

waitUntil checks as often as it can

dry zephyr
#

Well, if you think about it, it's not a decision that the unit needs to be making every frame - that's reserved for things like 'enemy just came around corner and is pulling trigger' - this is something the sniper unit could evaluate as late as every 5 seconds.

still forum
#

you can add a Sleep 5 to check only every 5 seconds for example

shadow sapphire
#

Oh? THAT is good to know. Combining a sleep with one of the other performance saving measures here would probably the best course of action for us.

still forum
#

but make sure to have the sleep at the start of the waitUntil

#

because the last expression in the waitUntil needs to return true/false to exit the loop

shadow sapphire
#
waituntil { Sleep 5;
    allunits findif {side _x != side _leader && _leader distance _x < 250} != -1
};```
#

Something like that?

still forum
#

ye

#

I also tend to leave away the ; on return values. You can leave away the last ; in a piece of code and it won't complain.
But here if you add whatever after the supposed return value. You'll get a compilation error on the script as the ; is missing.
So even if you do it wrong by accident. Keeping that style of no semicolon on return values will show you accidents that might otherwise stay unnoticed

shadow sapphire
#

So maybe nearEntities, knowsabout, sleep are the keys here?

dry zephyr
#

Where would you execute that snippet of code from?

still forum
#

I'd personally go for nearTargets. That already contains the knowsAbout and you don't need to do it seperately

#

And that should also be more performant than nearEntities. Because the unit already has a list of targets and just needs to look into it.
with nearEntities the engine has to look over the whole map for near units. (Not really. Uses a quadtree internally but.. Too hard to explain that)

shadow sapphire
#

@dry zephyr, the execution is still a problem I'm solving. It's one of the next things I am going to explore. I've thought about putting in a check in player bases with a twenty hour cool down and a dice roll, but I'm not quite sold on any particular method at present. Players can build bases and that is where they log in, log out, and store gear that persists through server updates and such.

#

@still forum, That's the one I was looking to find! Yeah, that's what I'll go with, thanks. I was scrolling and couldn't remember the one you'd recommended.

#

Our AI engages at MUCH further range than vanilla AI through a server mod we made, so these distances are testing distances.

dry zephyr
#

Well, if I read the documentation for waitUntil right ("Suspends execution of function or SQF based script until given condition is satisfied. This command will loop and call the code inside {} mostly every frame (depends on complexity of condition and overall engine load) until the code returns true. The execution of the rest of the script therefore will be suspended until waitUntil completes. "), the code snippet even with sleep would keep executing every framish, so you'd still be running the check constantly, just with a five second delay each time.

shadow sapphire
#

"Origin" is also a placeholder. It will be the nearest dynamically placed AI base.

#

That is an interesting insight...

dry zephyr
#

I think what is in the {} of the waitUntil is meant to be a continuous, framish, low expense check. Whereas if you have an expensive check you want run every 5 seconds, you need a different pattern?

still forum
#

the code part of the waitUntil will also suspend after 3ms
I'd also use waitUntil for expensive checks I only need on intervals.
The alternatives are bad for expensive checks

dry zephyr
#

Oh, so you are saying that if you make one call to waitUntil, it will loop almost every frame or as fast as the check completes, but you have a 5 second sleep in the loop, it is going to take 5 seconds to complete the loop each time, spending most of its time sleeping, so you have an effective every five second check?

still forum
#

or as fast as the check completes it only runs once per frame at most.
so you have an effective every five second check yeah

dry zephyr
#

Gotcha. So the key there then is that when DEL-J starts it off, he's basically waiting for that to return true, indicating the units are nearby, at which point his 'get the hell out of here' code for the sniper unit should run.

#

But if he wants the sniper unit to start rechecking, maybe when they are at their new position, he has to call the waitUntil code snippet again.

#

As the checks will stop once it returns.

surreal peak
#

I'm trying to turn players invisible as part of a script. In the .sqf I have: _guy hideObjectGlobal true . It works when I directly edit someone's init box. The whole script here (https://pastebin.com/GxiMjcFK) works on single player but when I try it on multiplayer it does not work.

note: I'm using Achilles to turn the script into a module

still forum
surreal peak
#

crap, how would I achieve this if I am making this into a client side mod?

#

is it possible?

still forum
#

Line 80 is error.

#

That's not how remoteExec works

#

your first hideObjectGlobal already runs on server only. But does your module code run on server at all?

surreal peak
#

no, I turned it into a small mod thingy which is purely client side

#

so i just load it up in my mods list and I have the module

still forum
#

that looks like you copy pasted a bunch of stuff together. Mixing different code styles...
For one. Line 11/12. Why not use the same private style as line 3-5?

surreal peak
#

probably should have mentioned I am a bit of a noob when it comes to sqf and have C/P a few things but most of this is me trying to get it to work in the most basic function

still forum
#
    if (isServer) then {
        _grp = createGroup CIVILIAN;
        _rabbit = _grp createUnit ["rabbit_F", getPos player, [], 5, "CAN_COLLIDE"];
        _rabbit attachTo [_dog,[0,0,0]];
        _rabbit hideObjectGlobal true;
        _rabbit setVariable ["BIS_fnc_animalBehaviour_disable", true];
        _guy hideObjectGlobal true;
    } else {
[[_dog, _guy, player], {
params ["_dog", "_guy", "_player"];
        _grp = createGroup CIVILIAN;
        _rabbit = _grp createUnit ["rabbit_F", getPos _player, [], 5, "CAN_COLLIDE"];
        _rabbit attachTo [_dog,[0,0,0]];
        _rabbit hideObjectGlobal true;
        _rabbit setVariable ["BIS_fnc_animalBehaviour_disable", true];
        _guy hideObjectGlobal true;
}] remoteExec ["spawn", 2];
};
#

this that should work

#

currently you already have the top part

surreal peak
#

is that the whole script for everything or just a portion?

#

eitherway im very thankful!

still forum
#

currently you already have the top part

surreal peak
#

cool

#

thanks

still forum
#

Line 14

shadow sapphire
#

@still forum, apparently I've done something wrong. No errors, everything works as intended, except for the withdrawal. It isn't triggering now, and I'm sure that I've broken it, but I don't know how.

//Greek Sniper Team
if (!isServer) exitwith {};
params ["_trigger"];
_trigger spawn {
    _base = (getmarkerpos "Origin");
    _G1 = [(_this getpos [600,(_this getdir _base) -60 + round random 120]), INDEPENDENT, ["I_Spotter_F","I_Spotter_F","I_Sniper_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
    _leader = leader _G1;
    _threats = _leader nearTargets 250;

    {
//        _x execVM "Gear\AAF.sqf";
    } foreach units _G1;
    
    _G1 setcombatmode "BLUE";

    Sleep 5;

    _G1 addwaypoint [_this getpos [-400, (getpos leader (_G1) getdir _this)], 0];
    [_G1, 1] setwaypointformation "VEE";
    [_G1, 1] setwaypointspeed "FULL";

    _G1 addwaypoint [_this getpos [-300, (getpos leader (_G1) getdir _this)], 0];
    [_G1, 2] setwaypointspeed "NORMAL";
    
    Waituntil {((leader _G1) distance _this) < 350};

    
    {
        _x setunitpos "Down";
    } foreach units _G1;

    waitUntil {
        Sleep 5;
        _threats findif {side (_x select 4) != side _leader} != -1
    };
    
    _wp = _G1 addwaypoint [_base, 0];
    [_G1, 3] setwaypointbehaviour "SAFE";
    [_G1, 3] setwaypointspeed "FULL";

    {
        _x setunitpos "Up";
    } foreach units _G1;
};```
still forum
#

_threats never updates

#

do it like I sent it to you

shadow sapphire
#

Ah, I see. Okay, good to know!

#

Okay, this makes sense. It's creating and dropping that variable every five seconds. Got it.

still forum
#

also please get used to one naming style.
you are mixingcamelCase CamelCase Camelcase alllowercase ALLUPPERCASE all together. Just use camelCase as the BIKI tells you to. Should make the code more readable

surreal peak
#

I think I may just be an idiot but after I changed my script with the thing you sent me, the player turns invisible but everything after line 31 does not work (attaching dog to player). Pastebin here: https://pastebin.com/QFYrcS0X

still forum
#

don't see any error

surreal peak
#

ill send u a gif, give me a minute

still forum
#

so what's not working?

surreal peak
#

the dog should be connected to the player

#

which is what the second half of the code does

still forum
#

how can I see in that gif that it's not working?

surreal peak
#

cause I place the module onto the AI/unit/player

#

and afterwards the dog is not attached to said unit

#

before it would attach but not make invis

still forum
#

okey.. how about

[[_dog, _guy, player], {
params ["_dog", "_guy", "_player"];
        _grp = createGroup CIVILIAN;
        _rabbit = _grp createUnit ["rabbit_F", getPos _player, [], 5, "CAN_COLLIDE"];
        _rabbit attachTo [_dog,[0,0,0]];
        _rabbit hideObjectGlobal true;
        _rabbit setVariable ["BIS_fnc_animalBehaviour_disable", true];
        _guy hideObjectGlobal true;
}] remoteExec ["spawn", 2];

->

    _grp = createGroup CIVILIAN;
    _rabbit = _grp createUnit ["rabbit_F", getPos _player, [], 5, "CAN_COLLIDE"];
    _rabbit attachTo [_dog,[0,0,0]];
    _rabbit setVariable ["BIS_fnc_animalBehaviour_disable", true];
    [[_dog, _rabbit], {
    params ["_dog", "_rabbit"];
        _rabbit hideObjectGlobal true;
        _guy hideObjectGlobal true;
    }] remoteExec ["spawn", 2];
surreal peak
#

its still not attaching to player

still forum
#

¯_(ツ)_/¯

#

can't see any attachTo player in your original code

surreal peak
#

that was most orginal code

still forum
#

Oh..

#

So you removed that code and then wondered why it doesn't work anymore? 🤔

surreal peak
#

I did

#

shit

shadow sapphire
#

@still forum, thanks for the help today!

surreal peak
#

yeah that would explain... Thanks for the help!

steady terrace
#

[]spawn {
  while {true} do { 
    if (player getVariable "earrape") then {
      player switchCamera "INTERNAL";
    }; 
  };
};

has crazy performance drops, ~30 fps down.. what am I doing wrong?

still forum
#

switching the camera even if you don't need to

shadow sapphire
#

Hm. What is the best way to check if a waypoint is complete?

steady terrace
#

@still forum thanks!

meager heart
#

@shadow sapphire

shadow sapphire
#

Ah, man... this is something I've needed for a while. Makes perfect sense. The waypoint statements are limited in their use, but you can just throw up a true when complete, and a wait until that watches that.

#

Thanks, @meager heart.

summer island
#

I have a piece of code that by my understanding should not work but also does exactly what I want it to, so I feel like I've hit a milestone.

summer island
#
if (isNil ([( configfile >> "CfgVehicles" >> _vehClassName >> "AnimationSources" >> _x ), "displayName", nil] call BIS_fnc_returnConfigEntry)) then { ...```
The local and magic variable isn't important, but the way I see it the if statement should be `nil` (and therefore true) if there isn't a "displayName" entry in the relevant vehicle's animation source. Only, it returns true when there **is** a displayName, which is the behavior I want, so...
#

I checked the function's sqf and it works as the header says (returns third parameter, or in my case nil, if there isn't the config entry it's looking for) so... ¯_(ツ)_/¯

nocturne basalt
#

what is more demanding(or recommended course of action). hiding stuff with hide animation, or setObjectTexture ""
?

still forum
nocturne basalt
#

kk

lunar violet
#

It's posible to spawn a bullet with tracer effect by script?

#

I know it's posible to spawn single bullets but, where is defined which bullets are tracers?

halcyon creek
#

Is it possible to make fades executed by a script happen to all players on a mission, for example you can run up to an object and execute a script and it fades to black and then fades back in, however it only does the player who has done the action and not for anyone else, whats the best way around it?

tough abyss
#

Is it possible to get the player's current difficulty settings?

hollow lantern
#

Jesus is it so hard to make an AI fly to a specific coordinate? I tried sqf HawkeyeLead doMove [999.563,7635.84,5.35433]; tried also with move and tried with addWaypoint

#

but the chopper does not move from the deck towards the coordinates

halcyon creek
#

so in the addAction do I put remoteExec there? like this this addAction ["Set up Checkpoint", remoteExec "scripts\setup.sqf"];

#

and @hollow lantern maybe place an empty marker and move it to the marker using getPos

hollow lantern
#

sure I'll try that also

halcyon creek
#

or if its landing you can do it using an invisible Helipad

hollow lantern
#

no, just flying :p

#

so simple stuff haha

halcyon creek
#

I think the AI on helicopters will only fly something like within 100m of the waypoint before going to the next one

hollow lantern
#

well the AI does not have any wp. In fact I will create the first via the script ^^

halcyon creek
#

would be something like this in the script then I believe

#
    _wp1 setWaypointType "Move";  
    _wp1 setWaypointSpeed "FULL"; ```
#

and this on the pilots ini

#

HawkeyeLead = group this;

hollow lantern
#

then I use Hawkeye since that's his group ^^

#

tried that before, maybe I messed something up

halcyon creek
#

I used it recently, naming the group never seemed to work until I actually put it in the ini on the driver in my case then it started to

hollow lantern
#

I have both there but my chopper does not touch off, very weird

#

ah damnit

#

I found the issue

#
 {_x disableAI "PATH"} forEach units group Hawkeye; ```
#

this code I had still in the Pilots init field

#

thanks for the help @halcyon creek

halcyon creek
#

No worries

fringe yoke
tough abyss
#

Thanks.

tough abyss
full swan
#

Hi guys, does anyone know how to use the DESTROY waypoint correctly? It seems it is not working at all.... When attached to object, AI refuses to do anything until in COMBAT and when spatial, it's extremely unpredictable.. I am trying to recreate the mouse behaviour from curator, where by pressing RMB on unit creates a (spatial) DESTROY waypoint for every selected units, but in my case it's not working at all

tough abyss
#

So my server start's a script on each client that connects, the script it starts need to have access to some variables i declared on the server in a cfg, how would i do this?

#

Except from having the vars in the script that gets run (declaring them there)

hollow thistle
#

Where are the server variables declared?

queen cargo
#

anybody here havin c/c++ knowledge and too much spare time? could use some helping hands with sqf-vm

tough abyss
#

That did the trick Veteran 😛 Thanks

tough abyss
#

Is there a way to check how many eventhandlers a player has?

still forum
#

Not really

#

but you can guesstimate by adding a empty eventhandler and deleting it again

#

the handle returned by addEventHandler == the number of total eventhandlers that were added so far

#

doesn't tell you how many of these handlers were already removed though

#

But I wouldn't trust that

tough abyss
#

Why not

hollow thistle
#

should 👀

still forum
#

Because that would break tons of mods.
Mod1 add's EH. -> Handle 1
Mod2 add's EH. -> Handle 2
Mod1 remove's it's EH.
Mod2 tries to remove it's EH. But can't. Because the handle should be decremented and is now 1. But Mod 2 doesn't even know that mod1 exists neither can it know that the handle should be decremented

tough abyss
#

Hmm yeah okay

#

Would love to see a way to check for specific eventhandlers

errant jasper
#

Sigh, they still haven't fixed removeEventHandler? Why they even make it then...

still forum
#

commy says that statement is false. And I think so too. Lots of stuff would be breaking all over the place. It's not though

errant jasper
#

That would make more sense. And didn't addAction also suffer this problem long time ago?

#

*well removeAction

tough abyss
#

If i compileFinal a var that i use publicvariable on. Do i need to compileFinal it before or after making it public?

still forum
#

if you set the variable after making it public

#

aka via the = operat... func.. eh... Character!
You essentially delete the old variable and create a new one with the same name

#

changes that you do after calling publicVariable don't propagate

tough abyss
#

Ok, thanks!

velvet merlin
#

is it possible to make ingame a "make a report" (on github/gitlab/etc) with htmlLoad?

still forum
#

not really. As it doesn't have cookies to login

#

And I'm very sure javascript is also not supported

#

you can however htmlLoad make a Get request on your own server which then generates a report with data passed as parameters

velvet merlin
#

hm wasnt there some way to make stream browser open the url (instead)?

still forum
#

you can just add a link in structured text

#

not sure if that opens steam browser or desktop browser

queen cargo
#

it is possible!

#

but it requires a separate server listening to your request

#

a simple PHP page would be sufficient

still forum
#

still can't login

queen cargo
#

you theoretically could even do that, though it should not be done simply because it would be bad practise
actual reporting would work more or less like this: you got some dummy github account that reports the issues for your user

velvet merlin
#

well you could abuse some "anon" account i guess

still forum
#

with a php script you can also just use your own account. Or a bot account

#

the credentials would be "safe" on the server

queen cargo
#

problem however would be: you will end up with junk the moment somebody abuses the URL

#

so some sort of protection needs to be done to prevent abuse

#

which in the end agian means ... just skip it and send them over to github
it is not worth the hazzle, trust me
i thought about it

still forum
#

just adding a clickable link that opens the webbrowser is much easier.

#

Biggest hurdle to people would then be needing a github account

#

you could also just store issue reports on your server and then manually move them to github to have them as a todo list there

queen cargo
#

either you provide custom login and register service, which again requires webpage access and can be abused too
or you hack around with crap

in the end, all solutions are crap and those who actually will report issues, will also head to your github

halcyon creek
#

Trying to get an addAction to remoteExec a script but cant get it to work, I have the below code on the objected ini field, but I dont believe it works, can anyone tell me where im going wrong?

this addAction ["Set up Checkpoint", remoteExec "scripts\setup.sqf"];

or would it be easier to put it in the first few lines of the script its self?

still forum
#

addAction second parameter is code. aka code wrapped in {} you are giving it the returned value of the remoteExec as argument

halcyon creek
#

could you ELI5? because I dont get what you mean

queen cargo
#
this addAction ["Set up Checkpoint", remoteExec "scripts\setup.sqf"]; //WRONG
this addAction ["Set up Checkpoint", { remoteExec "scripts\setup.sqf" }]; //CORRECT
#

addAction second parameter is code. aka code wrapped in {} you are giving it the returned value of the remoteExec as argument

halcyon creek
#

ahhhhhhh gotcha

#

Thanks guys

queen cargo
#

🙃

velvet merlin
#

actually its a lot simpler:


                class ButtoDev: Button
                {
                    idc = 1038;
                    url = "https://forums.bistudio.com/topic/140837-development-branch-changelog/?view=getlastpost";
                    show = 0;
                };```
#

and there is class RscButtonMenuSteam to open in Steam overlay if active - otherwise standard browser
edit: my bad - only in specific context with hardcoded idc functionality

hollow thistle
#

How would I script detection of incoming artillery round to area.

#

Lets say I have AI caching and I would like to uncache units when player shoots mortar at the them.

digital jacinth
#

Iirc there was a script which did that. It was used to make defense cannons shoot missiles and the like.

#

It was called something something ram

#

it could detector mortars and missiles

velvet merlin
#

or you simulate the damage/effects purely virtually via scripting

worldly locust
#

How would I go about looping through each vehicle a group is inside?

#

They may not be in a vehicle or may be in one or more.

digital hollow
#
{
    if !(vehicle _x isEqualTo _x) then {
        _vicsArray pushBackUnique (vehicle _x);
    }
} forEach units _group;
still forum
#

How would I go about looping through each vehicle a group is inside? Can we get that in proper english?
Each vehicle inside a group? Does vehicle also include units? as units are vehicles too.
Or do you mean loop through each vehicle that has some group inside of it? The all members of a group? Or just some guy in some group? The latter would just be all non-empty vehicles.
Or loop through each vehicle that has a specific group inside it? The whole group? in that case it can only be a single vehicle so why loop? Or any member of that group?

peak plover
#

3cb, huh? I thought u guys were Brits?

#

I think he wants what ampersand posted

digital hollow
#

Likely, but questions could always be clearer.

worldly locust
#

Think it through. What could I mean?

still forum
#

I did

#

and I listed everything

worldly locust
#

Could I be asking about a truck a unit isn't in?

still forum
#

No.. That's also not on my list

#

Let's play the optimization game

private _vicsArray = [];
{
    if (vehicle _x != _x) then {
        _vicsArray pushBackUnique (vehicle _x);
    }
} forEach units _group;
private _unitsInVehicles = units _group select {vehicle _x != _x};
private _groupVehicles = _unitsInVehicles apply {vehicle _x};
_groupVehicles = _groupVehicles arrayIntersect _groupVehicles ;
worldly locust
#

So it's pretty clear what I wanted. Why do you have to always be a complete tool?

still forum
#

No it's not. My list has like.. 6 things on it...

worldly locust
#

Thanks @digital hollow

still forum
#

So it was the last thing on my list then.

digital hollow
#

TIL

_arr = [1,2,3,1,2,3,1,2,3,4,5];
hint str (_arr arrayIntersect _arr); // [1,2,3,4,5]
digital jacinth
#

Question about performance about arrays. I want to combine 2 arrays into one. I do not find anything on the code optimizations page about it. So can I just _array3 = _array1 + _array2 or is there a better way?

still forum
#

that is the way yeah. If you need a new array

#

if you just want to append to an array then.. append

digital jacinth
#

my case is, I need to check on certain situations if my characters primary weapon is in one of the two arrays.

#

appending is a no go as one of the arrays is being changed by the server via publicvariable

still forum
#

wep in firstArray || {wep in secondArray}

digital jacinth
#

okay

tough abyss
#

How would you compileFinal a bool? Cause doing this wont work

#

WhitelistToggle = compileFinal 'true';

still forum
#

that works

#

that's how you compile final a script containing a bool

tough abyss
#

But when i try to use it, it says it's not a bool

still forum
#

correct. It's code

#

not a bool

#

because compile compiles code.

tough abyss
#

So i have to call the var?

hollow thistle
#
if (call WhitelistToggle) then {
    ...
};
tough abyss
#

Thanks 😛

hollow thistle
#

also you should try to tag your global variables to decrease risk that your variables collide with some addon.

#

WhitelistToggle => SOV_WhitelistToggle (or whatever prefix you want)

jaunty musk
#

So I'm not sure if this is a scripting thing or a config thing but I was wanting an empty mag to be placed in the player inventory after it is empty. If possible, any guidance in this would be awesome.

still forum
meager heart
#
player addMagazine ["30Rnd_556x45_STANAG", 0];
#
0 spawn {
    private _currentMag = currentMagazine player;
    waitUntil {player ammo primaryWeapon player == 0}; 
    player removePrimaryWeaponItem currentMagazine player;
    player addMagazine [_currentMag, 0];
};
```also loaded mag will be removed ^
meager heart
#

btw what is the easiest way to force ai stop firing without removing ammo ? 🤔

snow pecan
#

Kill them

meager heart
#

yeah... or kick player who was the target...

winter rose
#

Kill them
😄

meager heart
#

well, he is right 😄

winter rose
#

setCombatMode "BLUE" iirc

obsidian kiln
#

setskill courage at 0.01 and allowfleeing?

#

that would be my try without being too notorious about it, they would still do some peashooting but they would also look like a disarranged mess

meager heart
#

probably just disableAI the easiest and reliable... 🤔

mint kraken
#

Is there anything wrong with this code? According to https://community.bistudio.com/wiki/currentMagazineDetail it isn't. I am getting a 18:51:09 Error in expression <_ammo splitString"([ ]/:)"; (This is the handledamage event)

params [
    ["_unit",objNull,[objNull]],
    ["_part","",[""]],
    ["_damage",0,[0]],
    ["_source",objNull,[objNull]],
    ["_projectile","",[""]],
    ["_index",0,[0]],
    ["_instigator", objNull, [objNull]],
    ["_point","",[""]]
];
disableSerialization;

private "_ammo";
_ammo = "";

if (!isNull _source) then {
    if (_source != _unit) then {
        _ammo = currentMagazineDetail _source;
        _ammo splitString "([ ]/:)";
        _ammo = _ammo select 0;
    };
};
winter rose
#

@mint kraken yes
_ammo is not a string, it is an array (currentMagazineDetail returns an array)

use str currentMagazineDetail _source

unborn ether
#

Any ideas how to interpolate playSound frequency to distance: for example the closer the more sounds generated?

winter rose
#

@unborn ether something like sleep (1/distance)?

digital jacinth
#

beeps faster the closer you are to an anomaly

unborn ether
#

@winter rose yes, but the issue is that sleep will make delays (lol yeah) on the sound, for example 20 meters away will make it happen 20 seconds later (for example). This might be incorrect by the time its sleeping.

#

@digital jacinth ty will take a look

digital jacinth
#

also circumvents the issue you have with walking closer ot the object and the beep "lags behind"

unborn ether
#

I got the idea, I will use a bit different way, but that just gave me the idea.

#

Thanks both.

#

@winter rose @digital jacinth

digital jacinth
#

👍

meager heart
#

maybe "play sound" with playMusic and fadeMusic based on distance 🤔

winter rose
#

or simply add sounds to an array and have another thread use it :)

meager heart
#

aka fake dolby dts 1.[1.1] 👀

digital jacinth
#

Does playsound even support audio files with multiple channels?

#

i have never really tried

elder slate
#

hi all. little question about GUI

all icons in my GUI are black... how to make them look like in BIS arsenal?
my script^

_pic = getText(configFile >> "CfgWeapons" >> _classname >> "picture");
still forum
#

how do you actually set the image

elder slate
#
_list lnbSetPicture [[((lnbSize _list) select 0)-1,0],_pic];
still forum
#

I know someone who definetly knows the answer.. But he got banned because he answered a troll before the troll got banned soooo...

elder slate
#

mb someone has the same listNBoxes with colored icons...

still forum
#

Yeah. He does. He made his own arsenal

#

your code looks correct to me.

#

does your left column item thingy maybe have a background/foreground color that's black?

elder slate
#

it works... the only thing is icons color

still forum
#

OHH

#

now I see.

#

didn't see that on the prntscr website as the background is white

#

yeah. set foreground color on that element

elder slate
still forum
#

the list can have dark background

#

but the actual list item shouldn't have it

elder slate
#

hm... i'll try ti play with colors... thank you

still forum
#

Had something similar once. Someone thought this images weren't displaying but they were just black because he set the color of the UI element that's displaying them to black. Which also caused it to manipulate the images color

meager heart
#

🕵 pm @elder slate

elder slate
#

🕵

lean estuary
#

Is there any way how i can change the direction of my player looking up and down?

unborn ether
#

@digital jacinth ```SQF
0 spawn {
while {true} do {
private _beepDistance = (findDisplay 46) getVariable ['detectorBeepDistance',-1];
if !(_beepDistance isEqualTo -1) then {
playSound "beep_target";
uiSleep ((0.25 * _beepDistance) min 0.25);
};
};
};

Where `detectorBeepDistance` is some relative distance to the desired point
#

To avoid spam that variable has a scripted range limit, so if it goes more than N-meters it just turns -1 to stop beeper.

winter rose
#

@lean estuary not at all, sorry

digital jacinth
#

@unborn ether that loop would still go on even if that detector of yours is disabled. You might want to add some handler which starts and stops the loop. Also wouldn't you still have the problem with the sound to "lag behind" the way you are doing it right now?

#

as in you are 20 meters away, that is a wait time of 5 seconds.

#

you walk or run up to that object and it is 1 meter. which is 0.25 seconds wiating time. But the other wait of 5 seconds is still in progress.

unborn ether
#

@digital jacinth I did eliminate that at the point where my actual purpose is 4 meters max distance, otherwise yes, that should be expanded to handle.

#

It kinda does have "lag" but its too short to mention for my purposes.

#

Also min 0.25 spans it in my max sleep range.

#

So even if you go 50 meters, it still will be minimized to 0.25 seconds.

digital jacinth
#

alright

mint kraken
#

@winter rose It doesn't return an array, it returns a string Return Value: String

still forum
#

@mint kraken

private "_ammo";
_ammo = "";

->

private _ammo = "";
#

@mint kraken what is the full error that you get?
18:51:09 Error in expression <_ammo splitString"([ ]/:)"; is not the full error

mint kraken
#

Well the rest was generic expression

#

Not sure what that ment though

#

But now I think i know what it means

still forum
#

no there is more to that error

#

there is always more

tough abyss
#

How would you check if an array is empty

still forum
#

_array isEqualTo []

#

array is equal to an empty array

tough abyss
#

Thanks

#

Another thing, is there any practical way to check how many controls a certain display has from the vanilla game?

#

Like i know you can get the current controls of a display with allControls

still forum
#

why can't you use allControls on the vanilla display

winter rose
#

@mint kraken true, bad memory. My bad

tough abyss
#

Cause i want to check the current display against what it's supposed to be

winter rose
#

can't test anything right now though, next week =]

still forum
#

I also thought it returns array ^^

tough abyss
#

To check if it's modded or anything like that

still forum
#

@tough abyss Why would it be different? You can check the config entries. But if a mod changed them that won't help you

#

You can just run allControls in vanilla. And then hardcode the expected number of controls

tough abyss
#

Yeah, already doing that 😛 But wondering if there's a "better" way

still forum
#

You can't detect if........ Oh man...

#

I think you can check who last edited a config entry

#

and if that mod is not Arma vanilla. Then a mod probably changed something

tough abyss
#

@lavish ocean what is your opinion on InfiStar, word around the office is that Bohemia Interactive hate them

torpid pike
#

Is there a way people differentiate heading and course on ArmA? I've got heading using directions (the nose of the vehicle in 0-360), is there a way to get the vehicle model itself or the player's camera direction?) Trying to show two different systems at play; one is course, one is heading. Anyone?

still forum
#

cameraViewDirection

#

returns player camera view direction as 3d vector

#

aka you can turn it by pressing ALT and moving camera

torpid pike
#

hmm, that's good to keep in mind; that'll go in the notes. But what if I wanted the general direction of the vehicle? (i think we already have it sadly, just trying to calculate in the vector path of the vehicle on a single direction)

tough abyss
#

Question. Is it possible to actually force move a players view location to something, for example lock them to look at a moving plane, player, tank etc?

still forum
#

you can create a seperate camera and move the players view into it

#

@torpid pike getDir vehicle ?

tough abyss
#

Hmm thanks

torpid pike
#

I think that's what we're using currently for heading

#

bah, oh well lol

#

:p thanks all

lean estuary
#

Is there any way to block a player from accesing his mousewheel? I tried the "MouseZchanged" display evh and tried just putting true; or false; in it which is how the keydown evh works but no succes so far.

tough abyss
#

@tough abyss after a quick benchmark here you go:

0.0013 // count testArray == 0
0.0013 // testArray isEqualTo []
0.0015 // !(testArray params [["_test", []]]); for the lolz
steady egret
#

@lean estuary as far as it goes i know you could remove all the actions they could do but i dont know of a way to truely block it

lean estuary
#

How would i do that then? Im not aware of a way of removing vanilla addactions?

#

And i know that servers like A3PL have suceeded in disabling it so its def possible.

steady egret
#

well as far as i know you could just loop removeallactions on the player or just do it to all the objects nearby

lean estuary
#

Doesn't work on vanilla actions though but i figured it out now

#

is what i needed

#

Thanks anyway

steady egret
#

i tryed

#

anyone know of a way to get all the objects a zeus currently has selected iam working on a script where if the zeus selects objects they can press the user key and line them all up

quaint ivy
#

would it be possible to attach USS Liberty to a dummy ship in order to have it as a drivable ship?

steady egret
#

yes if you select all its parts and kinda debug a few gliches you could

#

using the attachto command with the freedom to a ship with damage dissabled it would work i would think

#

it may glich around as it is about 10 objects for some reason but it should mostly work

mint kraken
#

So I found this notification system and tried to add a title to it so instead of _TextCtrl ctrlSetStructuredText _text; I made a _title part in the params and set the default as "Notification" then used _TextCtrl ctrlSetStructuredText parseText ("t size='0.5'>" + _title + "</t><br/>" + _text); But then I got

20:10:48 Error in expression <eText("t size='0.5'>"+_title+"</t><br/>"+_text);_TextCtrl ctrlSetPosition[(_posX>
20:10:48   Error position: <+_text);_TextCtrl ctrlSetPosition[(_posX>
20:10:48   Error +: Type Text, expected Number,Array,String,Not a Number
20:10:48 File core\functions\fn_notification_system.sqf [RLRP_fnc_notification_system], line 2
20:10:48 Error in expression <eText("t size='0.5'>"+_title+"</t><br/>"+_text);_TextCtrl ctrlSetPosition[(_posX>
20:10:48   Error position: <+_text);_TextCtrl ctrlSetPosition[(_posX>
20:10:48   Error Generic error in expression

Not sure why this is happening

ruby breach
#

_text is Structured Text, needs to be a string

still forum
#

@mint kraken Error +: Type Text, expected Number,Array,String,Not a Number + doesn't work on text

#

where do you get _title from?

mint kraken
#
params [
    ["_text","",[""]],
    ["_type","default",["",[],{}]],
    ["_title","Notification",[""]],
    ["_speed",8,[8]]
];```
full swan
#

can someone tell me how DESTROY waypoint works? Places as spatial it doesn't work at all

mint kraken
#

And I am running [localize "STR_NOTF_CommanderView", "info"] call Mission_fnc_notification_system; which STR_NOTF_CommanderView is Commander/Tactical View Disabled

still forum
#

you are not telling us the full story

#

if that would be were _title came from then you wouldn't have that error

mint kraken
#

-removed- thats the file

#

I set the title to something else if the type is different

ruby breach
#

Lines 106-108

#
if (_text isEqualType "") then {
    _text = parseText _text;
};
mint kraken
#

But the text isnt ""

ruby breach
#
  • doesn't work on Text
mint kraken
#

The text is set to Commander/Tactical View Disabled when I call it

still forum
#

parseText is your problem

#

on line 107 as Gnashes said

#

you cannot use + after you executed parseText on it

mint kraken
#

But, when I call the class I set the text to Commander/Tactical View Disabled?

still forum
#

Yeah.. and?

mint kraken
#

oh I see

#

thought it said isEqualTo thanks ❤ Will try it out

still forum
#

it says isEqualType and that has nothing to do with it

#

delete line 106 till 108

meager heart
#

can someone tell me how DESTROY waypoint works? Places as spatial it doesn't work at all
you will need attach it to your object/vehicle with waypointAttachVehicle < which can/will fail in 9/10 on dedicated, with spawned objects/vehicles... so it kinda works only with "editor placed" objects...
if you doing everything in editor just try attach it with afaik double click over object with waypoint selected (might be wrong)...

#

@full swan

surreal peak
#

I keep getting the error missing ] in this code: ```["Body Bag Maker", "Place in Body Bag", {
private _object = [_logic, false] call Ares_fnc_GetUnitUnderCursor;
private _pos = getPos _object;
private _dir = getDir _object;
_active = true;
if (isNull _object) exitWith { [localize "STR_AMAE_NO_OBJECT_SELECTED"] call Achilles_fnc_showZeusErrorMessage; };
rabbit = _grp createUnit ["rabbit_F", getPos player, [], 5, "CAN_COLLIDE"];
_rabbit attachTo [_object,[0,0,0]];
[_rabbit,true] remoteExec ["hideObject",0,true];

if (isNull _object) exitWith { [localize "STR_AMAE_NO_OBJECT_SELECTED"] call Achilles_fnc_showZeusErrorMessage; };

hintSilent "Turned to Body Bag";
_bodyBag = createVehicle getPos player, ACE_bodyBagObject;    

[_object, true] remoteExec [call ace_medical_fnc_setUnconscious [0,true];

;}] call Ares_fnc_RegisterCustomModule; ``` even though im 100% sure all the brackets are in the correct place

#

this is only a chunk of it cause this is what is giving me errors

#

I also would not be surprised if I did something wrong elsewhere

hollow thistle
#
_bodyBag = createVehicle getPos player, ACE_bodyBagObject;   

this is not correct at all.

surreal peak
#

had a slight feeling

#

ah shit

hollow thistle
#
... //fixed
_bodyBag = createVehicle ["ACE_bodyBagObject", getPos player];    
[[_object, true]] remoteExec ["ace_medical_fnc_setUnconscious", 0, true];
...
surreal peak
#

Thanks!

#

sorry, its cause im new to some of these and I knew I would screw up somewhere

hollow thistle
#

@surreal peak I've edited fixed code (2nd line)

surreal peak
#

Apricated!

#

appreciated*!

civic canyon
#

hi ı change a bank camera positions but not working. I try to copy the position of the object, but it does not work

still forum
#

"bank camera position" ? meaning you want to bank the camera left/right? aka rotate it around it's forward vector?

hollow thistle
#

or maybe he has copied some """Life""" code 🏦 💰

#

🤔

still forum
#

That was my first guess. But I didn't want to say that because it's so stupid

#

Can't think of anyone that would be dumb enough to just take someone elses work and the pretend like it's their own

#

Also we hate such stuff here so much that such people most often just get banned swiftly

civic canyon
#

@still forum ı change bank position

hollow thistle
#

💸

civic canyon
#

and

#

ı try change fedcamdisplay

still forum
#

what is "bank position"?

#

and "fedcamdisplay" ?

gleaming oyster
#

or maybe he has copied some """Life""" code 🏦 💰

hollow thistle
#

Bingo!

still forum
#

Oh life

#

can't help you with that

civic canyon
#

oke

hollow thistle
#

How can I prevent ESC from closing display like it is in Zeus. When you press ESC in zeus it just opens pause menu.

I'm trying to create custom build camera.
Initially I spawn camera via "camcurator" camCreate (eyePos player);
Then later on I'm trying to spawn display to get cursor and it works but can be closed via ESC.

vet_build_display_init = {
    private _display = uiNamespace getVariable ["KPLIB_build_display", displayNull];

    if (!isNull _display) then {
        "KPLIB_build_display" cutText ["", "PLAIN"];
    };

    "KPLIB_build_display" cutRsc ["RscTitleDisplayEmpty", "PLAIN", 0, false];
    private _display = uiNamespace getVariable "RscTitleDisplayEmpty";
    uiNamespace setVariable ["KPLIB_build_display", _display];

    private _vignette = _display displayCtrl 1202;
    _vignette ctrlShow false;

    test_display = _display;
    // ... more code will be here
};

call vet_build_display_init;
still forum
#

put another display over it that just reopens itself on close event? ^^

cosmic lichen
#
_disp displayAddEventHandler
[
   "keyDown",
   {
      if (_this # 1 == 1) then
      {
         true
      };
   }
];```
#

returning true should work, shouldn't it?

hollow thistle
#

I will try this ty.

gleaming oyster
#

Yes

hollow thistle
#

As I intend to create something kinda similar to zeus I fear I will have to dig into BI code anyway.

#

😱

still forum
#

I know someone who already did that 👀

#

But never finished completly and then out of time

hollow thistle
#

Is he still sane? 😄

still forum
#

wut

#

last change 10th april 😮

#

Thought he gave it up last year

hollow thistle
#

Oh nice.

#

I don't intend to go this big.

#

We just want nicer build system for liberation 😆

cosmic lichen
#

damn that mod look sweet

#

Oh well, it crashed arma 😄

hollow thistle
#

xD

#

I've seen it uses intercept somewhere.

#

Isn't it an external dependency?

still forum
#

wut`

#

didn't know that it does

hollow thistle
#

@still forum is happy seeing someone uses his "mod" :PP

still forum
#

wut

#

no..

cosmic lichen
#

What's intercept, never heard of it

still forum
#

That is a copy of the intercept init code on sqf side from like.. over a year ago

#

@cosmic lichen not sure if joke

cosmic lichen
#

no joke =/

still forum
#

In short. A Arma SDK

cosmic lichen
#

Alright

#

Do I need that? ;D

still forum
#

If you love programming in C++ then yeah

cosmic lichen
#

I can't programm C

still forum
#

then no

cosmic lichen
#

😄

hollow thistle
#

But it is FUN 😄

#

Havent touched cpp since high school tho ;<

still forum
#

@hollow thistle do you just search for "intercept" on every arma git repo you encounter? 😄

cosmic lichen
#

If I start learning C then I'll never see the sunlight again, so I don't touch that stuff

still forum
#

but back when he did that intercept was still half broken and unmaintained

#

@cosmic lichen you don't need sunlight. Get yourself a nice cellar.

gleaming oyster
#

wine cellar?

still forum
#

if you like the smell then yeah

#

who doesn't like wine smell... 🍷

#

how do you even do SQF without a bunch of wine

gleaming oyster
#

🤔

hollow thistle
#

I was looking for ui code and found some intercept calls ;P

still forum
#

@cosmic lichen you'll learn c-like language anyway for Arma 4

cosmic lichen
#

Ha, was smoking cig a minute ago, and was thinking exactly the same

hollow thistle
#

🍺 is fine too for some sqf coding.

cosmic lichen
#

how do you even do SQF without a bunch of wine Wiskey

still forum
#

I tend to 🍊 🍹

cosmic lichen
#

orange juice? Nothing wrong with that 😄

still forum
#

The sugar and co2 filled variant

cosmic lichen
#

Gn8

queen cargo
#

i would love to see people use my stuff too 😦

winter rose
#

☝️ wrong on so many levels of desperation!

queen cargo
#

but true 🤷

#

stuff like my arma.studio, sqf-vm, ... all to help the community

#

nobody bothers to help out etc.

winter rose
#

sexual innuendo missed its target

queen cargo
#

solo right now

#

literally all sexual stuff misses out on me right now

winter rose
#

also, I can help I think with your sqf-vm

#

I am still on your Discord Server ^_^

queen cargo
#

feel free to start contributing at any point in time 🙈
workload did not got less, more ... in the opposite direction

summer island
#

SQF VM seems like a dangerous thing for my arma addiction...

queen cargo
#

why would SQF-VM be dangerous for that?

summer island
#

I'll be sripting all the time, even away from home 😆

queen cargo
#

well ... bad news for you, you already can use it
on discord

#

and from home

#

though ... current standalone release version is not really up-to-date as it still is the c variant which is outdated for month right now

gleaming oyster
#

What if, you could simulate the result somehow? Like, let's say it's a cube you're setting the velocity for, and alongside compiling the code "simulates" the result and spits back the velocity after execution

queen cargo
#

will not happen
no actual game is running, but you could write code in a spawn to actually do that

gleaming oyster
#

Hmm. Interesting.

queen cargo
#
_obj spawn {
    while {true} do {
        private _vel = velocity _obj;
        private _pos = position _obj;
        _obj setPosition [(_vel select 0) + (_pos select 0), (_vel select 1) + (_pos select 1), (_vel select 2) + (_pos select 2)];
    }
}``` for example
gleaming oyster
#

Eeeeeee. No params? Lol

queen cargo
#

mhh ?

gleaming oyster
meager heart
#

also use vectors maybe 😀

queen cargo
#

why should i have used params for that code @gleaming oyster ?

#

could not be bothered to lookup the commands right now @meager heart 🙈

gleaming oyster
#

_obj isn't defined

meager heart
#

LOL

queen cargo
#

just was some example code to "emulate" actual game running

meager heart
#

X39 we just trolling a bit sorry dude 😄

gleaming oyster
#

:)

queen cargo
#

🤷

meager heart
#

i mean... like every code posted here should be optimized asap... 😀

queen cargo
#

not even sure tbh if i implemented the vector commands yet in the sqf-vm c++ variant

#

nope, not yet in the c++ version
only in the c variant

meager heart
#

i have... i think that is 0.1.4 version

#

no vectors there

#

but Changelog there 🤔

#

🙈🙉🙊

jaunty shadow
#

So. If I wanted to place a boat inside a vehicle in vehicle Boat Launcher from Encore, what would I need to do?
I'd like to have it start off placed in ViV when the mission starts, instead of having to have players load the boat manually.

Edit: Managed to answer my own question. you can just place a boat on the launcher and it will attach itself. Then you can launch the boat after you crew it.

queen cargo
#

@meager heart 👌
But that released one is still the c version
Cpp variant is a full rewrite which is more accurate of reality but no Release yet Simply because it lacks Features

still forum
#

@queen cargo your code from 00:25.. There is vectorAdd...
I still see many people writing that old crap that was how you did it in Arma 2. But no one should be doing that anymore

queen cargo
#

@still forum there may be vectorAdd in the arma world
but not yet in the c++ version of sqf-vm which is what the example related to

tough abyss
#

Anyone know why

_unit    = _this select 0;

is giving me crap when I try to use it with removeallweapons _unit;?

queen cargo
#

did you checked the value of _this?

still forum
#

maybe because you gave crap to whereever that code is

#

that line tells us literally nothing

tough abyss
#

Iirc it complains about the way _unit is being used I'd have to save / execute it again using _this select 0;. it's being used to empty inventory of a unit, but swapping _unit = player; resolves the error.

#

_this select 0; breaks it

gleaming oyster
#

if you don't pass anything to the script sure, selecting 0 from an empty _this will throw you an error

#
[blahUnit] call compile preProcessFileLineNumbers "blahScript.sqf";
//blahscript.sqf
params[["_unit",objnull,[objnull]]];
removeAllWeapons _unit;
#

Ideally you should be using params instead

tough abyss
#
private ["_unit"];

_unit    = _this select 0;

    removeallweapons _unit;
    removeAllItems _unit;
    removeAllAssignedItems _unit;
    removeUniform _unit;
    removeVest _unit;
    removeBackpack _unit;
    removeHeadgear _unit;
    removeGoggles _unit;

here's a snippet how it's being used, does objnull select any unit?

gleaming oyster
#

No, the first parameter after the string identifying the name of the variable dicatates the default value

#

the array following indicates the allowed types to be passed for that variable

#

and no need to private it beforehand, params will do this automatically

tough abyss
#

ah

gleaming oyster
#
params[["_unit",objNull,[objNull]]];
removeallweapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
tough abyss
#

so doing that using params will make it detect any unit that it's casted on?

#

well executed on?

gleaming oyster
#

No, params filters already passed parameters to the scritp

#

just as I have used above

still forum
#

@tough abyss how are you calling that script exactly. The problem lies there.

gleaming oyster
#

[thisIsYourParamsArrayPassShietToScriptHere] call compile preProcessFileLineNumbers "blahScript.sqf";

#

[thisIsYourParamsArrayPassShietToScriptHere] execVM "blahScript.sqf";

tough abyss
#

execvm on a group of units and or a player on start, I was trying to make it dual purpose so it worked on both ai and players so I didn't need two scripts lol

still forum
#

Show the code snippet of how you are calling it

gleaming oyster
#

[thisISYourParamsArrayPassShietToScriptHere] spawn mud_fnc_blahScript;

tough abyss
#
while {true} do {
//hint"Waypoint updated";
{
    deleteWaypoint [_x, 0];
    _waypoint1 = _x addWaypoint [(_MOVE_TO_Cargo_position),0];
    _waypoint1 setWaypointType "SAD";//SAD MOVE
    _x execvm "scripts\GERORGE FLOROS\randomequipment.sqf"
    _x setCombatMode "RED";
    _x setSpeedMode "FULL";
    _x setBehaviour "CARELESS";
    _x setSkill ["general", 0.1];
    _x setSkill ["reloadSpeed", 0.8];
    _x setSkill ["aimingSpeed", 0.2];
    _x setSkill ["commanding", 0.2];
    _x allowFleeing 0;
        }foreach [_Recon_Teams];
     sleep 50;
    };
};
still forum
#

_x execvm "scripts\GERORGE FLOROS\randomequipment.sqf" There

#

_x is the unit

#

But inside your script you expect [_x]

#

_x != [_x]

#

params will fix that for you automatically too

#

you really shouldn't be using _this select anywhere anymore

#

that's just outdated

tough abyss
#

thankfully sqf wipes messes up for me a tiny bit unlike java

gleaming oyster
#

Params even gives a very detailed description of incorrect parameters.

tough abyss
#

I'll be honest I'm kind of already skirting by with limited sqf knowledge snagging bits from working stuff to get things working lol I seen people using _this select 0; and figured it was good

gleaming oyster
#

Nope

tough abyss
#

So to be clear it will automatically detect _unit if I don't define it in the script?

still forum
#

nothing is done automatically

#

anywhere

#

Arma can't read your thoughts

tough abyss
#

wish it could 😦

still forum
#

Are you talking about params[["_unit",objNull,[objNull]]]; with that?

tough abyss
#

ye will it be wise enough if I replaced my current _unit to know that _x from the other file is the _unit?

still forum
#

replace with what?

#

Don't see any reason to change anything besides that params thing

tough abyss
#

params[["_unit",objNull,[objNull]]]; with my _unit = _unit select 0;

still forum
#

what?

#

that doesn't make sense

#

just use params and you're golden

tough abyss
#

you asked replace what with what, should params[["_unit",objNull,[objNull]]]; be in place of my current busted _units = _this select 0;

still forum
#

yes

#

but not the other way around like you just said ^^

tough abyss
#

and that would make it recognize _x is the intended target?

still forum
#

that would execute your code on whatever unit you pass to the function

gleaming oyster
#

currently tested unit is passed to script -> Params -> _unit is defined from passed parameters

still forum
#

in your case _x execvm "scripts\GERORGE FLOROS\randomequipment.sqf" _x is the parameter. So the unit will be _x

tough abyss
#

neat i'ma go give it a try ty

#

And you said private is basically useless?

#

What would that even be used for?

stray kindle
#

i doubt that dedmen would have said that using private is useless

tough abyss
#

well he said its not needed

gleaming oyster
#

if you're ever going to be using private use it like so:

private _var = "var";
//not 
private["_var"];
_var = "var";
#

Sets a variable to the innermost scope

compact maple
#

in a function, this is not needed, but in a basic script, private is usefull, right ?

stray kindle
#

it's not needed when using params

still forum
#

It's not needed because params already does it

tough abyss
#

ah

gleaming oyster
#

Already said that above

still forum
#

private ["_var"] is dumb and useless
private "_var" is dumb and useless
private _var = value; is how it should be used

#

using private in general makes your script faster and safer

tough abyss
#

i'm assuming the intention of private is to make something specific to a script?

still forum
#

but not if you use the variants that I just called dumb. Because they make your script slower

#

yes.

#

If you'd use the same variable name as a script that called your script. You would overwrite their variable

#

If you use private that doesn't happen

tough abyss
#

makes sense, I may have to go make some things private in other files, I have a few reused things in areas.

still forum
#

But I tend to use it everywhere even if there likely won't be any collisions. Because of those precious microseconds that my script will be faster

tough abyss
#

ty for the advice i won't scrap it but i'll make it work i guess lol

meager heart
#

also function will be better option... i mean execVM in a loop is bad idea 😃

gleaming oyster
#

😬

still forum
#

wow. didn't even notice that.

#

Also didn't notice that }foreach [_Recon_Teams]; is dumb, useless and probably not what he wanted to do

gleaming oyster
#

[[array (grp?)]] eeek.

#

Where did everyone's fascination with execVM come from?

still forum
#

Copy paste from guys who didn't know better back in Arma 2.

gleaming oyster
#

Hmm.

meager heart
#

also probably from YT tutorials "how to do stuff"

gleaming oyster
#

Oh. That for sure will stick

still forum
#

@A3_Stickie#1337 not wanna bother him with mentions ;)
Is working on a new/fresh/up-to-date SQF beginners guide for the Arma blog. When that's done we can just link it to people.
Maybe also add a section about common mistakes ^^

gleaming oyster
#

Definitely.

winter rose
#

would be listed using Life?

still forum
#

I think I can arrange that 😄

winter rose
#

:p

compact maple
#

got a quick question about the private

private _lol = 10;
_lol = _lol + 5;

It is still private on the second line ?

still forum
#

yeah

compact maple
#

okay thanks

still forum
#

you are overwriting the first variable it finds

#

which is the one above

compact maple
#

make sense xD

queen cargo
#
//Variable contianing client-requests
Promise_Requests = [];

//Callback for Promise methods
Promise_Callback = {
    params ["_id", "_sender", "_data"];
    private _request = Promise_Requests select _id;
    if ((_request select 0) == _sender) then {
        Promise_Requests set [_id, 0];
        _data call (_request select 1);
    }
};

Promise_Create = {
    params ["_rcv", "_mthd", "_args", "_cb"];
    private _index = Promise_Requests find 0;
    if (_index == -1) then { _index = Promise_Requests pushBack [_rcv, _cb]; } else { Promise_Requests set [_index, [_rcv, _cb]]; }
    [_args] remoteExec [_mthd, _rcv, false];
};```
#

gimme dem crits

unborn ether
#

Whats that?

peak plover
#

promise 😄

queen cargo
#
[some_random_player, "PromiseCallbackOnClient", "randomarg", { /* executed on server whenever the client is done and send a remoteExec back */ params ["_arg1"]; diag_log _arg1; }] call Promise_Create;```
#

theoretically, there is a client-side missing though ..

#

but that was not required

#

it is just so that you can actually do Request-Response systems in ArmA

unborn ether
#

Just curious what chain are you trying to create: client-client, client-server, client-server-client?

queen cargo
#

does not matters

#

what direction stuff

still forum
#

//Variable contianing client-requests

#

does not matters

queen cargo
#
A -> B
B Processes request
B -> A```
unborn ether
#

client#1-(client#N|server)-client#1

still forum
#
if (_index == -1) then { _index = Promise_Requests pushBack [_rcv, _cb]; } else { Promise_Requests set [_index, [_rcv, _cb]]; }
    [_args] remoteExec [_mthd, _rcv, false];

Why set the index if you don't use it afterwards

queen cargo
#

good question @still forum

unborn ether
#

I would rather do it this way (server variant);

// Server 
DT_fnc_someResponse = {
    params ['_code','_arguments'];
    private _owner = remoteExecutedOwner;

    private _result = _arguments call _code;
    [_result] remoteExec ['DT_fnc_someRequestCallback',_owner];
};
still forum
#

also the index is always 0?

queen cargo
#

the empty stuff is set to 0

unborn ether
#

Client side does what you need. No need to store something somewhere, just make it ping-pong variant

queen cargo
#
Promise_Requests set [_id, 0];```
peak plover
#

request respons what do u mean?

still forum
#

This is basically just async call with callback

#

you tell someone else to execute something. And he tells you when it's done

queen cargo
#

@unborn ether goal is to have a full Promise system in place
the idea being that you can call a clientside method from the server and just be done with it

#

when the client then is finished, execution on server continues

#

but as i said, client-side is yet missing

#

but it was just hacked together in a minute

still forum
#

I've always just done that using CBA events. And then just let the function on the server send a event back

peak plover
#

ohh okay

#

I've had the same issue lol

digital jacinth
#

Same here (tho with publicVarEh because I forgot cba had events). Normally use it for JIPs

queen cargo
#

feel free to test it

still forum
#

//Variable contianing client-requests

queen cargo
#

funny what one can hack together in a matter of minutes just because somebody asked one something

still forum
#

//Mehtod to create a promise

queen cargo
#

typos

still forum
#

_promise select 2 != _stamp when can that happen? Don't see anything that sets that

queen cargo
#

if (_index == -1) then { _index = Promise_Requests pushBack [_args, _cb, _stamp]; } else { Promise_Requests set [_index, [_args, _cb, _stamp]]; }

#

when some index is reused

still forum
#
private "_res";
if...

->

private _res = if...
queen cargo
#

fixed and fixed

still forum
queen cargo
#

yyy
as i said
hacked together
gimme a second

#

now

#

works

#

unless i overlooked something .. got no highlighting editor in university

still forum
#

gist highlights for you

queen cargo
#

only after updating

still forum
queen cargo
#

yup

#

@still forum is a great linter
you should get yourself cloned and in production

still forum
#

Someone should build a web based online linter

queen cargo
#

could be done with eg. sqf-vm

#

though ... problem will always be that undefined variables cannot be errors as it might be intended

still forum
#

in a small code snippet you can see the whole code. And can see if that function is called with a local variable that could carry over

queen cargo
errant jasper
#

What the point of the stamp?

errant jasper
#

Also doesn't remoteExec run functions in a scheduled environment, so you have a race condition between Promise_Callback and the "free list" with _index = Promise_Requests find 0; in _Create.

still forum
#

yes remoteExec runs in scheduled by default

#

@errant jasper no. Not there. Because that part of the code runs unscheduled it makes sure nothing else can run at the same time

errant jasper
#

Ah yeah, my bad. Worst thing to happen here is a new index is used instead, but hardly a problem.

#

Personally, I would ensure all these functions ran in unscheduled. None of them are expensive to run, and you would sleep better.

queen cargo
#

Promise_Callback does not needs to be run in non-scheduled

#

the id is freed AFTER the value is received

#

obviously ...

#

kinda 🤦

#

regardless of that, if it is not free (0) it will never be accessed by normal code

still forum
#

need*

queen cargo
#

anybody willed to test that lil system?

tough abyss
#

yay now we can have js like callback hell in sqf too :)))))

errant jasper
#

Don't we already have that, just worse cause no closures?

#

E.g. event handlers.

queen cargo
#

@tough abyss only if the code works

#

besides ... @still forum do you know if CBA has such a system in place?

#

@errant jasper that is exactly what the code emulates

errant jasper
#

I know, that's my point. We always had "callback hell" in sqf - except worse.

still forum
#

CBA has systems to make it very easy to build such a system on your own

queen cargo
#

but no actual system like that yet?

still forum
#

guess not

queen cargo
#

@errant jasper if you could test the system, i would be able to actually create a PR for CBA

still forum
#

If you want it in CBA. You should use already established CBA event system

errant jasper
#

I mean if you are going to use CBA, then use the built-in events system. If not for the fact you want to pass arguments directly to the on-result-callback it would be like 5 lines total.

#

^what Dedmen says

queen cargo
#

never worked with CBA
not really planning on doing so
the system as designed is as performant as it can ever get

#

proposing that PR, commiting it if i or somebody else says the system works as it is right now

#

if it gets rejected for formal issues, i correct them

#

if for usage issues, i just leave it closed *and ref to the gist

errant jasper
#

@queen cargo about to test. Two typos, Promise_Done needs 'then'. And 'select 0' should have been 'select _index'.

#

It works.

queen cargo
#

ty @errant jasper
no time to finish now though

#

will do tomorrow at home 😛

quartz coyote
#

@still forum Could you explain how "true call {}" and "false call {}" works ?

#

I get that True and False are the arguments of call but how are they caught on the other side ...

hollow thistle
#

in the scope of the script _this will be either true or false in the examples you have provided.

still forum
#

the argument is copied into the _this variable

#

true call {} is the same as

_this = true;
call {}
tough abyss
still forum
#

yes.

tough abyss
#

how would i sort a array of objects by name

still forum
#

_sortedObjects = ((_objects apply {[_x, name _x]}) sort true) apply {_x select 1}

tough abyss
#

however i can't loop through it now

still forum
#

it returns an array of the objects in sorted form

tough abyss
#

{ ...code }forEach _sortedObjects; undefined variable in expression _sortedObjects

still forum
#

show full code

tough abyss
#
        { 
            _sortedObjects = ((allUnits apply {[_x, name _x]}) sort true) apply {_x select 1};
            {
                hint name _x;
                sleep 1;
            }forEach _sortedObjects;
        }
    ];```
still forum
#

oh oops. I swapped it. Should be [name _x, _x]

#

but that should still work..

tough abyss
#

still same error

still forum
#
_sortedObjects = ((allUnits apply {[name _x, _x]}) sort true) apply {_x select 1};
#

I don't see it.. No typos in there

tough abyss
#

not working

#

undefined variable in expression _sortedObjects;

still forum
#

Maybe someone else can see the error.. I'm probably too tired

dusk sage
#

Sort modifies the array, no return @still forum @tough abyss

still forum
#

🤦

#
_sortedObjects = (allUnits apply {[name _x, _x]}) sort true;
_sortedObjects = _sortedObjects apply {_x select 1};
dusk sage
#

😃

still forum
#

No.. still wrong

#
_sortedObjects = allUnits apply {[name _x, _x]};
_sortedObjects = _sortedObjects sort true;
_sortedObjects = _sortedObjects apply {_x select 1};
``` (╯°□°)╯︵ ┻━┻
hollow thistle
#

┬─┬ ノ( ゜-゜ノ)

dusk sage
#

apply returns the array

#

First should be okay

still forum
#

sort modifies the array

#

my 2 liner passes a temporary array to sort

dusk sage
#

True, no ref

still forum
#

which will be deleted after the ;

hollow thistle
#
_sortedObjects sort true; // shouldnt it be enough?
still forum
#

DUH

#

(╯°□°)╯︵ ┻━┻

hollow thistle
#

┬─┬ ノ( ゜-゜ノ)

still forum
#

CRAP

hollow thistle
#

leave MY TABLE ALONE

#

Xd

still forum
#
_sortedObjects = allUnits apply {[name _x, _x]};
_sortedObjects sort true;
_sortedObjects = _sortedObjects apply {_x select 1};
dusk sage
#

:>

still forum
#

leaves the room

dusk sage
#

tfw you fall into the same trap 3 times in a row

#

fool me once

steady egret
#

anyone know a way to make the ai move ontop a waypoint as the ai keep moving near the waypoint my not on top of it
_Area is a VR ground object i have for the purposes of judging how close they get

_WP setWPPos position _Area;
_WP setWaypointCompletionRadius 0.1;
_Group setBehaviour "CARELESS";
_Group setSpeedMode "LIMITED"; ```
side note when i did not force the VR object to a position with setpos the ai moved right to it ie just using create vehicle and leaving it there
meager heart
#
{   
    _x setBehaviour "CARELESS";
    _x setSpeedMode "LIMITED"; 
    _x move (_Area modelToWorld [0,0,0]);
} forEach units _Group;
#

_Area is a VR ground object
kinda strange name for the object...

steady egret
#

my whole code is just a giant mess

#

in order to test it fully i need to write giant chunks at a time and then test each section out so

meager heart
#

😃

steady egret
#

they still refuse to go to it why

#

wait

#

now they just dont move

#

here we go again

#

yeah no thats not working they still want to go around wherever i tell them to go and path in the most open area they find rather than the shorter path which is wide open

modern snow
#

Hi, I have a problem, hope that you can help me.
My code:

addMissionEventHandler ["Draw3D", {
    drawIcon3D [
        "\a3\ui_f\data\map\Markers\System\dummy_ca.paa",
        [1,1,1, (60 - (player distance cursorTarget)) / 50],
        [((getPos cursorTarget) select 0), ((getPos cursorTarget) select 1), 0.5+(1.8/(60/(player distance cursorTarget)))],
        1, 1, 0,
        cursorTarget getvariable "licenseplate",
        1.8,
        (0.037-(0.030*((player distance cursorTarget)/60))),
        "TahomaB"
    ];
}];

Error:

20:51:18 Error in expression <
drawIcon3D [
"\a3\ui_f\data\map\Markers\>
20:51:18   Error position: <drawIcon3D [
"\a3\ui_f\data\map\Markers\>
20:51:18   Error Type Any, expected String

If I change cursorTarget getvariable "licenseplate", to "1250 ADC", It's working...
Do you know whats wrong?

digital hollow
#

Use cursorObject

steady egret
#

also if you look at the world or anything with a valid "licenseplate" it wont work

#
addMissionEventHandler ["Draw3D", {
_Plate = cursorObject getvariable "licenseplate";
if (isNil "_Plate") then {} else {
    drawIcon3D [
        "\a3\ui_f\data\map\Markers\System\dummy_ca.paa",
        [1,1,1, (60 - (player distance cursorObject)) / 50],
        [((getPos cursorObject) select 0), ((getPos cursorObject) select 1), 0.5+(1.8/(60/(player distance cursorObject)))],
        1, 1, 0,
        _Plate
        1.8,
        (0.037-(0.030*((player distance cursorObject)/60))),
        "TahomaB"
    ]};
}];
#

that in theory should work

digital hollow
#

^ you're still missing one =p

meager heart
#

only group leader will be at that point/position and the group members will be according to "formation and formation spread" somewhere around it anyway, CR1M30N

steady egret
#

its only the group leader in the group

#

let me see if i can record

modern snow
#

@digital hollow missing what?

steady egret
#

wont let me post 😦

digital hollow
#

CR1M30N still has a cursorTarget in the code xD

modern snow
#

I have to change all cursorTarget to cursorObject ?

steady egret
#

no i did not =p

digital hollow
#

@kasper Yes. @steady egret >_>

modern snow
#

Still this error:

21:19:49 Error in expression <censeplate";
if (isNil "_Plate") then {
drawIcon3D [
"\a3\ui_f\data\map\Markers\>
21:19:49   Error position: <drawIcon3D [
"\a3\ui_f\data\map\Markers\>
21:19:49   Error Type Any, expected String
#

Code:

addMissionEventHandler ["Draw3D", {
    _Plate = cursorObject getvariable "licenseplate";
    if (isNil "_Plate") then {
        drawIcon3D [
            "\a3\ui_f\data\map\Markers\System\dummy_ca.paa",
            [1,1,1, (60 - (player distance cursorObject)) / 50],
            [((getPos cursorObject) select 0), ((getPos cursorObject) select 1), 0.5+(1.8/(60/(player distance cursorObject)))],
            1, 1, 0,
            _Plate,
            1.8,
            (0.037-(0.030*((player distance cursorObject)/60))),
            "TahomaB"
        ];
    };
}];
digital hollow
#

try str _Plate,

modern snow
#

Thanks guys 😄

peak cliff
steady egret
#

anyone know how to force the ai to move untop a location as i cannot script the ai to move to a specific location i posted it above the script is

                _WP = _Group addWayPoint [_Area modelToWorld [0,0,1],0];
                _WP setWPPos (_Area modelToWorld [0,0,1]);
                _WP setWaypointCompletionRadius 0.01;
                _WP setWaypointLoiterRadius 0;
                player setpos getWPPos _WP;
                _Group setBehaviour "AWARE";
                _Group setSpeedMode "LIMITED";
                _WP setWaypointStatements ["true", "this setVariable ['WSR',1]"];

problem is the ai never move to the wp and the tp is 1-2 m away from where the wp is suppose to be the area is a obj 1 m under the ground and should not be causing path finding errors as its a vr ground entity any help? the move command does basicly the same thing

#

the group is a one man squad

meager heart
#

😀

steady egret
#

let me show you what happens with mine

#

i cant post stuff here ok let me try to post it

meager heart
#

CTRL+V

#

ez

steady egret
#

cant do it with images or video

#

so

meager heart
#

imgur it

steady egret
hollow thistle
#

can we open "pause menu" via script?

steady egret
#

@meager heart when i do your test it works but if i create the waypoint with scripts it does not idk anymore

meager heart
#

¯_(ツ)_/¯

steady egret
#

then i guess its the objs or my game is ruined ok

south condor
#

Are there any default CfgSounds you can call?

#

If not what is a good place to find .ogg sound files?

austere hawk
#

has anyone made a library for quaternions in sqf by chance? I'm feeling lazy 😄

meager heart
steady egret
#

@meager heart found the error know of anyway to make a ai go close to objs as the problem is the ai wants to walk around it and stay 1 m away from it at all times

hollow thistle
#

I was asking cuz recently I was asking how I can stop display from being closed on ESC. And display event handler works but I can't open pause menu with it on (obviously).

steady egret
#

input action and close display

hollow thistle
#

I will have to dig into zeus code I think. My goal is to have floating camera (this i have already working), but also i want to have cursor and ui elements.

meager heart
#

but also i want to have cursor and ui elements.
maybe justcameraEffectEnableHUDand showHUD [<params>]

mint kraken
#

Where can I find the BIS_fnc_holdKey? Checked functions_f.pbo couldnt find it there... I need to modify it so it executes a script when they start holding it

meager heart
mint kraken
#

Thanks!! ❤

meager heart
#

Arma 3\Mark\Addons < that one lol

outer fjord
#

Question, so I know you can script a live feed of various PIPs into screens and such

#

but could you make them freeze in a screenshot format/

#

Like is it possible to make a literal photograph within the game itself?

mint kraken
#

@meager heart Thats the not the one xD I was looking for BIS_fnc_holdKey you found keyHold

ionic orchid
#

@outer fjord I tried that before using RT textures, but the engine always clears the texture to black each render frame, so if you stop rendering the view you only get black

outer fjord
#

damn

meager heart
#

I was looking for BIS_fnc_holdKey you found keyHold
shoots himself in the head

mint kraken
#

I have a feeling it got added in Tac Ops

#

and I dont have it rip

#

Well that was a waste of 1 & 1/2 hours

tough abyss
#

I have creation rights to a mod on the workshop, but the Publisher tool isn't giving me an option to update it.

gleaming oyster
#

@mint kraken You don't need the DLC to use the fnc

compact maple
#

Hello everyone, if i want to use setVariable on a player, and if i want that value to never be modify, should i use compileFinal, or something else ?

tough abyss
#

compileFinal should do just fine

compact maple
#

good tnx

robust hollow
#

pretty sure compileFinal doesnt work on objects.

tough abyss
#

He's compileFinal'ing the variable

digital jacinth
#

It depends if he compile finals a global variable in that players mission name space of a variable on an object iirc. I think it is possible to just overwrite it from another machine as well with going _unit setVariable ["myVar", _newvalue, true];

compact maple
#

it will be

player setVariable [format ["id_pl_%1", getPlayerUID player], _id_pl, true];
mint kraken
#

@gleaming oyster I want to modify it

still forum
#
if (isNil "_Plate") then {} else {
    <code> };

What have I done that you all must punish me like that?

#

@tough abyss Would you maybe someday finally stop cross-posting? #rules

#

@mint kraken you definetly have it.

#

And no it wasn't added in TacOps

mint kraken
#

Well I cant find it...

still forum
#

where are you searching for it?

mint kraken
#

Last night I searched in the functions PBO in Every folder.

still forum
#

Then you would've found it.

#

@meager heart sent you a screenshot showing you where and in which PBO it is

mint kraken
#

Its not the correct one

#

He found keyHold

#

I am looking for holdKey

still forum
#

Oooooh

mint kraken
still forum
#

Ah yeah.

mint kraken
#

Which makes me even more believe it got added in Tac ops...

still forum
#

Correct. functions_f_tacops. It's in there

#

And you have tac ops. Everyone has it

gleaming cedar
#

Guys anyone know how I can do this: If damage is 0,9 then allow damage false on helicopter

#

I want a helicopter to be attacked but not destroyed

mint kraken
#

Everyone has it but those who dont have it as ebo. And as I know you cant open EBO’s

#

But Thanks ❤

still forum
#

Nope

#

everyone has it. As ebo.

mint kraken
#

Oh

#

So you can open EBO?

still forum
#

You could also use the ingame function viewer and just copy paste

mint kraken
#

Ah

#

Ofc

still forum
#

Or like.. You literally just write BIS_fnc_holdKey into the debug console.. And it returns you the code

mint kraken
#

lol

#

Didnt know that

#

Thanks Will try that next time

meager heart
#

so yeah, i was thinking about keyHold not the holdKey, those names... 🤷
it's like after some update pictureColor was changed to colorPicture for the ui configs 😭

#

worldvisualworldworld ©

digital hollow
#

Can Arma into space?

shy musk
#

Why isn't there any reliable method for monitoring the action context menu? inGameUISetEventHandler doesn't monitor several changes in state, such as closeContext, navigateMenu and when the engine automatically changes the selected action because it's no longer returning a true condition.

#

It's quite frustrating that there isn't simply a "selectedAction" command that returns the current selected action ID and object or if the inGameUISetEventHandler events actually monitored the menu properly.

gleaming cedar
#

{_x addEventHandler["Dammaged",{_this spawn{sleep 0.1;heli1 = _this select 0;if (damage heli1 >= 0.9) then{heli1 allowDamage false;};};}];} foreach thislist

#

Why is this not working

still forum
#
{
    _x addEventHandler["Dammaged",{
        _this spawn {
            sleep 0.1;
            heli1 = _this select 0;
            if (damage heli1 >= 0.9) then { heli1 allowDamage false; };
        };
    }];
} foreach thislist
#

if damage is bigger than 0.9 then it's proooobably already dead

gleaming cedar
#

Hmm try

shy musk
#

You probably want to return 0.9 in the EH to prevent it from being destroyed before allowDamage is disabled.

#

allowDamage false is being executed after the damage has been applied. You want to override the damage and then disable future damage.

#

Use "HandleDamage" so you can override it.

gleaming cedar
#

Let me try it

#

What do you think is the best way to do this

shy musk
#

Depends what you're trying to do.

gleaming cedar
#

Helicopter is beeing shot at

#

by missles

#

but I want it to damage it so it crashes

#

but not destory

shy musk
#

HELICOPTER addEventHandler ["HandleDamage",{((_this select 2) min 0.9)}];

#

That will stop the helicopter from being damaged over 0.9.