#arma3_scripting

1 messages Β· Page 561 of 1

mortal nacelle
#

so displayctrl 1600, displayctrl 1601 etc

unreal scroll
#

@unique sundial "Tried BIS_fnc_fire?" - works in local game, doesn't work for dedicated at all.

unique sundial
#

It is global, it should work in any game. Must be doing something wrong

unreal scroll
#

No, I've tried many things, and only two works for it: fire and action ("useWeapon") - and in the last case it fires the pistol muzzle with the flaregun. But I've got it πŸ™‚ I've tracked the soldiers' behaviour with Zeus, adn the problem was that the enableAI/disableAI, doTarget and dowatch commands are local, so I've changed it to remotexec and it works. Thanks.

lucid junco
#

do someone know if theres offline versions of Bi wiki?

#

i just need to download entire wiki to have it without connection to net

winter rose
#

once upon a time existed the comref, but it goes up to OFP v1. ... 81? 96?

#

@lucid junco maybe you could use an "offline website" like HTTrack to get everything from it, or at least the Main namespace

exotic tinsel
#

how do i deafen or prevent players from hearing voice chat on command channel. only infantry squad leaders can use it, but some how others who cant use it can still hear it. all i can find in the wiki so far is how to disable text and voice usage in the description.ext and on the local player. i have done both. but it doesn't prevent them from hearing it.

winter rose
#

@exotic tinsel isn't it the leader himself speaking (like direct sound)?

exotic tinsel
#

so alpha and bravo squadleaders are speaking in command channel. a non infantry squad like CAS Jets can hear them.

winter rose
#

That's because they are group leaders (being alone in the group)

exotic tinsel
#

right but CAS Jets doesnt need command channel in this instance. how can i make it so the SL of CAS Jets cant hear the infantry squad leaders?

#

they dont want it because too much chatter.

winter rose
#

Either give them a leader, or I think there might be an enableRadioChannel something somewhere

#

@exotic tinsel enableChannel

exotic tinsel
#

yes, that just prevents the user from sending text and voice. not receiving it. i have that implemented so CAS Jets cant use command.

winter rose
#

Then there is no way afaik

exotic tinsel
#

crap. ok thx mate.

winter rose
#

(besides adding an AI leader)

exotic tinsel
#

na wont help. make things worse else where. im just gonna create a custome channel like command and hide command from all and be done with it. yay

winter rose
#

Sounds like the cleanest way!

unreal scroll
#

Stuck at other thing on dedicated... The logic: 1. FiredMan EH on player launches a script that finds one of the enemy soldiers (REMOTE), which fires the flare and 2. Adds to this soldier FiredMan EH, which inside has a code that waits for 5 second (CBA_fnc_waitAndExecute, needs for flare projectile to gain maximum height) and do something, The problem is that the coords of projectile that passes to CBA_fnc_waitAndExecute code part is [0,0,0]. As I understand, the projectile and the code, which gets it coords, have a different locality? But I don't understand what I should do...

warm iris
#

Probably not the room, but its scripting related

Has anyone got any experience with inidbi2 and making the scripts work for it? I've got some issues and support if people know of ways to fix them would be appreciated

tough abyss
#

is there a way to disable load and save arsenal feature in the innit of a virtaul arsenal box?

winter rose
#

your code?

forest ore
#

Only testing in the editor ATM: if a vehicle is created and then publicVariable'd from initServer.sqf like so _veh = "C_Hatchback_01_F" createVehicle [1244,1306,0]; publicVariable "_veh";
shouldn't I be able to for example delete the vehicle with deleteVehicle _veh just from the debug console?

winter rose
#

_veh would be a private variable

#

try naming it TAG_MyVeh @forest ore

forest ore
#

Hello Lou. What's with the TAG?

winter rose
forest ore
#

Could I just use veh instead of _veh
(could have tested that first for sure πŸ‘πŸΌ )

winter rose
#

yes sure

oblique arrow
#

Hm any chance that you peeps can point me into the direction of info on having Intel placed in the editor use the icon with the circle that fills up when taking it?

winter rose
#

oh, long time no see πŸ‘‹
BIS_fnc_holdActionAdd may be what you want @oblique arrow

oblique arrow
#

Oky thank you I'll take a look at that

#

And yeah I've been more active on the TFAR discord than here recently bongocat

winter rose
#

you are forgiven… this time.

oblique arrow
oblique arrow
#

Btw @winter rose BIS_fnc_holdActionAdd does work for what I want

#

Now I just need to figure out how to have the diary entry pop up the same way that it does with BIS_fnc_initIntelObject

oblique arrow
#

Oky I have another question, if I want a trigger to activate when the total number of players is inside the trigger is this the correct code?

(count thisList) = (count allPlayers);
spice axle
#

use == instead of =

winter rose
#

I would say yes (and what Katalam said), if the trigger triggers only on players of course

spice axle
#

with = it will fail

#

@oblique arrow be sure to remove headless clients from this allPlayers list

_allHCs = entities "HeadlessClient_F";
_allHumanPlayerss = allPlayers - _allHCs;
steady terrace
#

found something weird. when attaching 2 objects(concrete blocks in my case), and moving the one the other is attached to (using setpos) doesn't move the other block. does anyone know why?

jade abyss
#

Run attachTo again

#

Β―_(ツ)_/Β―
(had the same thing couple weeks ago)

oblique arrow
#

Thanks, and the server doesnt use HC's so I dont need to do that in this case but thank you for mentioning it BlobComfortable @spice axle and I'll make sure to check that Lou

steady terrace
#

@jade abyss doesn't work sadly

#

got

test2 attachTo [test1];

getPos test1;
test1 setPos [2387.52,13430.1,0.550002];


test2 attachTo [test1];
jade abyss
#

πŸ€”

winter rose
#

attachTo (also) takes a (relative) position as 2nd param

jade abyss
#

optional

#

I mean, he can test with [test1,[0,0,0]];

winter rose
#

(I know)
but just using attachTo won't place it back to where it (relatively) was before setPos

jade abyss
#

attachTo (also) takes a (relative) position as 2nd param
*modelToWorld position

#

Hu? No Lou

unique sundial
#

does anyone know why?
Not everything can be attached and moved

winter rose
#

it's only simulated objects?

jade abyss
#

Island/Map Objects afaik

#

wait no, i think i hid mapobjects with it, couple years ago

steady terrace
#

so.. It's just not a thing for blocks then? 😦

jade abyss
#

Wich "blocks"?

unique sundial
#

Without context this is waste of time. Show the script.

steady terrace
#

@unique sundial this is all I'm doing


getPos test1;
test1 setPos [2387.52,13430.1,0.550002];


test2 attachTo [test1];
#

@jade abyss ConcreteBlock_F

jade abyss
#

getPos test1; <- ?

steady terrace
#

so I could get the current position and put it into setPos (to move it to the side a bit for testing)

jade abyss
#

use the 2nd parameter

winter rose
#

basically: he wants to have a setup of objects that he can move around by moving only one piece.

jade abyss
#

It's the position, relative to the test1* object

#

e.g.

test2 attachTo [test1, [0,5,0]];```
steady terrace
#

so I need to figure out what it's relative to now and put that in the second parameter of attachTo?

#

I thought not putting that in would preserve the relative location, which is what I want

#

and yes, that's correct @winter rose

jade abyss
#

Hu? I am confused:
Just created both blocks, executed

test2 attachTo [test1,[0,5,0]];
player setPos [2382.52,13430.1,0.550002];
test1 setPos [2387.52,13430.1,0.550002];
test2 attachTo [test1,[0,5,0]];```
blocks are not visible oO (Geo/FireGeo still intact)
#

That's something new πŸ€”

steady terrace
#

they don't dissapear for me..

jade abyss
steady terrace
#

I'm doing this on tanoa if that matters

jade abyss
#

just tested with VR-Block too. Same

unique sundial
#

You are inside the block?

jade abyss
#

Nah, even ran outside

#

Position is from standing ON the thing

#

VR-Blocks the same

#

Testing now with something, that worked 2 weeks ago. (setPos, then attachTo)

unique sundial
#

Make a complete repro with created objects

jade abyss
#

Seems to work with attachTo + all params (MemPoint)

#

same result

#

Okay

#

[ 2387, 13430,1.5] <- doesn't work

#

Obj shows up when removing the 1

#

[2387,3430,1.5] <- works

unique sundial
#

It’s a slow update object maybe just not updated yet

steady terrace
#

ehm. I have no idea why.. but now

test2 attachTo [test1];

test1 setPos [2387.52,13435.1,0.550002];

suddenly does move test2 with test1

jade abyss
#

test1 setPos [2387,8447,0.5]; yep
test1 setPos [2387,8448,0.5]; nope

@unique sundial πŸ€” Even on local?

#

It's getting worse oO, one sec

unique sundial
#

You are moving it too far

steady terrace
#

I have no idea what changed.. but this the expected behaviour, so.. discontented yay?

jade abyss
unique sundial
#

VR worldsize is 8192

#

maybe this has something to do with being outside the map

jade abyss
#

seems to be happing to non-physX objects only

exotic tinsel
#

is there a vehicle equivalent to getunitloadout? im trying to find an easy way to export whats in the vehicle inventory in to a crate. im aware of all the getMagazineCargo, getWeaponCargo, etc.. trying to find a simpler way before i put the time in.

jade abyss
#

magazines _veh,
weapons _veh;
etc

#

Best way to go, afaik

exotic tinsel
#

so if i have a backpack in the vehicle inventory and the backpack has stuff. how do i move the back pack to crate. do i latterly have to re add the items to the back pack in the crate??

jade abyss
#

that's a different topic

exotic tinsel
#

so....???

#

diff topic or not, can you help with the topic?

jade abyss
#

dude

#

wait at least more than a minute

exotic tinsel
#

nvm thx for the help

jade abyss
#

okay, deleting the list then Β―_(ツ)_/Β―

tough abyss
#

Any chance BIS_fnc_UnitCapture could get some optimization love?

#

Or rather does anyone know of a light-weight way of forcing AI to do things with doMove and disableAI?

restive leaf
#

Do you have #350?

tough abyss
#

What?

restive leaf
#

jk

cold mica
#

Is there an easy way to check the truth of an array full of booleans?

#

ex: private _myArray = [True, False]
Is there a function or something to check if the list is completely true or false?

dusk sage
#
!(false in _myArray)```
#

@cold mica

cold mica
#

I see. Thank you.

dusk sage
#

πŸ‘

minor lance
#

Heello!

#

Is there any way to set the music volume to a specific level in player options vΓ­a script?

winter rose
#

yes

#

@minor lance 😁

minor lance
#

I'm not talking about fademusic

#

I mean the Options->Sound->Music

winter rose
#

negative, that's player settings

#

you wouldn't want to have your key binds changed by script, would you πŸ‘€

minor lance
#

I have some cinematics in my server and players without music volume dont hear anything

winter rose
#

that's their problem

#

you could, however, use playSound instead of playMusic

minor lance
#

But I couldnt fade it 😦

winter rose
#

fade the music file itself

minor lance
#

I can't

winter rose
#

you could also use an invisible object that "say" the music, then get it away slowly to mimic fading

minor lance
#

The cinematic has music and when the player ends it, y fadeout the music

#

It depends on the player how long does it take to fade

#

The invisible object could do it but having the "Big Opening" today, its not good hahaha

winter rose
#

you have fadeSound, fadeRadio and fadeSpeech

besides that, I don't see any other options!

just tell your players to have music on - it's better than any script πŸ˜›

minor lance
#

I did that

#

but as I know them, they will enter without sound and will not hear the dialog XD

winter rose
#

dialog? it should be playSound then

#

anyway, it's their issue, not yours =)

minor lance
#

Its music with some speech

#

but as I play with fades, I used playmusic

forest ore
#

Getting Error missing ] with invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then { hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>']; };"];
I'm here thinking that I got the quotation marks covered but either I don't and also I can't see what's the issue then

winter rose
#

clearer with ```sqf
invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then {
hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>'];
};"];

#
if (inputAction 'gear' == 1) then {
        hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>'];
        };
#

single quotes everywhere

either use ```sqf
format ["<t color='#f00000ff'>test</t>", %1];
// or
format ['<t color='#f00000ff'>test</t>', %1];

#

@forest ore

#

(well, escaped quotes since you are in a string already)

forest ore
#

What sort of bothers me is the %1 in the end. Is that mandatory when using formatted text (with format)? Does the %1 not need to point anywhere?
Also I was already using single quotes in my example so I can't see where the issue lies

winter rose
#

escaped single quotes

you absolutely don't need format, here

#

@forest ore

#

well, forget about my previous examples with %1 (it would throw an error anyway I think)

SO! From

invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then {
        hint parseText format ['<br/><t color='#f00000ff' size='1.5'>Test text</t>'];
        };"];
``` to ```sqf
invKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (inputAction 'gear' == 1) then {
        hint parseText '<br/><t color=\'#f00000ff\' size='1.5'>Test text</t>';
        };"];
``` @forest ore
ivory lake
#

or stop it with the dang quotes and use {}

#
moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", {hint str _this}];
winter rose
#

ah yes, displayAddEventHandler can take code too πŸ˜…

ivory lake
#

yeah and it was a great day wehn that was implemented

winter rose
#

oooh yeah.

jade abyss
#

even easier/fixable:

myFunc = {hint str _this;};
moduleName_keyDownEHId = findDisplay 46 displayAddEventHandler ["KeyDown", {_this call myFunc;}];```
#

You can adjust the current code, while not needing to delete and readd the EH.

winter rose
#

needs a global var, and global var code is bad practice

#

(potential security issue, unless compileFinal'd)

still forum
#

Actually it's good practice in Eventhandlers Like that

winter rose
#

for testing, yes, not release

jade abyss
#

For final of course not...

#

put that function in CfgFunctions and done

winter rose
#

Sorry @jade abyss , I realised only (way) after I wrote the message

jade abyss
#

πŸ‘

forest ore
#

Looking at Kerc's version I'm unable to get past {hint str _this}
Where did the rest of the stuff go OR more like I'm at a loss where should I put the stuff I had prepared? With "stuff" I mean

        hint parseText '<br/><t color=\'#f00000ff\' size='1.5'>Test text</t>';
        };"```
jade abyss
#

try the example i posted above.

forest ore
#

Dscha, I could build a function out of it..but would also need to make it final someday

jade abyss
#

Yes?

forest ore
#

Was referencing to the discussion about global variables and potential security issues πŸ™‚

winter rose
#

put that function in CfgFunctions and done

jade abyss
#

uhm, functions are basicaly just globalVariables

winter rose
#

non-overridable*

still forum
#

for testing, yes, not release
Yes for release

winter rose
#

wut? what about publicVariable exploit?

jade abyss
#

global, not public

still forum
#

Eventhandlers recompilation bug

jade abyss
#

?

#

I think you two are talking about something different

winter rose
still forum
#

Eventhandlers get recompiled before execution. Thus you want them to be as short as possible.
Which
call globalFunc
Is

jade abyss
#

I believe Dedy is talking about zusing {call}, instead "code"

#

Yeah, we are way past that Ded πŸ˜„

winter rose
#

so we are kinda agreeing then? πŸ˜„

still forum
#

Lou said that's bad practice, it's not.

jade abyss
#

and wrote below that he was wrong forgot compileFinal*

winter rose
#

I said about just a myFunc = { }

still forum
#

Cookies

winter rose
#

CfgFunctions / compileFinal protects it from publicVariable, right?

jade abyss
#

Yes

oblique arrow
#

I have another question bongocat , whats the correct condition to be set in a trigger for it to activate after 5 seconds (from mission start) ? I've looked at https://community.bistudio.com/wiki/BIS_fnc_countdown and that looks like the right thing but I'm not quite sure how to adapt that to a trigger condition

jade abyss
#

CfgFunctions is the same as call compileFinal

still forum
#

CfgFunctions / compileFinal protects it from publicVariable, right?
Not necessarily.. but you don't wanna know that.

winter rose
#

@jade abyss πŸͺ
@still forum πŸͺ
@forest ore πŸͺ
@ me πŸͺ
@oblique arrow πŸͺ (you happened to be here)

oblique arrow
#

I'll take a cookie, cookies are always good

still forum
#

Oh lol. I said cookies. I already forgot

#

You confused me

jade abyss
#

You confused US

winter rose
#

hmm low eyesight, bad memory… πŸ€” careful, Dedmen! πŸ˜„

still forum
#

leaves again

winter rose
#

slowly

unique sundial
#

publishVariable

forest ore
#

@oblique arrow Since I'm (too) here: will there be someone to activate the trigger right after mission start? Can you just use timeout with the trigger (instead of countdown which is the default)

oblique arrow
#

Do you mean a player/AI in the trigger area to activate it? @forest ore

forest ore
#

player or AI or whatever you would like to have really. But what have you then?

crude needle
oblique arrow
#

Ooh neat that looks like what I want, thanks blobheart

harsh vine
#
//I'M JUST TRYING TO MAKE A KILL REWARD FOR ALL PLAYER "MP" SO WHENEVER, A PLAYER GETS A KILLSTREAK OF 2 KILLS HIS LOCATION WILL BE MARKED ON THE MAP...I GOT EVERYTHING WORKING EXPECT FOR THE KILL STREAK WHICH IN IT DOES WORK ON MY "HOSTED PC"  BUT NOT FOR OTHER PLAYERS.

//initserver.sqf
Kills = 0;
addMissionEventHandler ["EntityKilled", {
       
     if (_killed != _instigator && _instigator ==Player  && side group _killed != side group _instigator) then 
     { 
     Kills = Kills + 1;
     
       //player setVariable ["kills", 0];              /////////////////////////////////
       //_new = _newkill + 1;                             IM NOT SURE WHERE TO PUT THESE
       // player setVariable ["kills", _new, true];    ///////////////////////////////// 
       
    if (Kills >= 1) then {[] execVM "killstreak.sqf";};
};


//killstreak.sqf
DELAY = 15;
REFRESH = 5;
_HvT = 1;
_lastHintTime = -DELAY;
_lastMarkerTime = -REFRESH;
_markerTarget = objNull;
_hasMarker = false;
_markerName = "";

private ["_exitloop"];

_exitloop=false;

while {!_exitloop} do
{    
     
     //_isHvT = player getVariable ["kills",0] >= HVT  ///////////////// THIS DOESN'T WORK///////////////////////////
     
    _isHvT = Kills >= _HvT  && alive player;          ///////////////////THIS WORKS FINE///////////// 
    
    if (_isHvT && diag_tickTime - _lastHintTime >= DELAY) then
    {
        hint parseText ([
            "<t color='#FF0000' size='1.5' align='center'>High Value Target</t>",
            
            "<t color='#FFFFFF' shadow='1' shadowColor='#000000' align='center'>You have been <t size='1' color='#FF0000'>spotted</t> for killing too many ai's, now your location has been marked on the map!</t>"
        ] joinString "<br/>");
        
        _lastHintTime = diag_tickTime;
    };
    
};
#

sorry if i interrupted you guys πŸ™

still forum
#

sees private array πŸ˜† walks away

oblique arrow
#

peepoDance after some tinkering stuff works the way I want it to now, thanks peeps

oblique arrow
#

And back with another problem, so I want a Task to complete once all the players have left the trigger area but only if another trigger has fired, but I've tried using

(triggerActivated Trigger1) and ((count thisList) == 0)

and that doesnt work and just fires the trigger att he same time as the first one

unique sundial
#

18:54:48 Mission id: dead5101f5e1c425a3a75468060611def9982f8a
coincidence or a joke from BI programmer?

winter rose
#

The truth is out there πŸ‘€

warm iris
#

Hi, looking to add an action that execs a sqf file, currently I have this

_player addAction ["SaveData", "Save_Profile.sqf"]

Unsure of where to go, not too knowlegeable on addactions and the wiki didnt aide much

plain current
warm iris
#

Thats what I'm thinking, having a look through my script to make sure its not breaking in other places

plain current
#

You getting some error or is it just not appearing?

warm iris
#

Just not appearing

plain current
#

and _player is defined and the correct object?

warm iris
#

_player = a player, no?

plain current
#

player = player

#

player addAction ["SaveData", "Save_Profile.sqf"]

#

_player would be a private variable, eg private _player = player; _player addAction ["SaveData", "Save_Profile.sqf"]

warm iris
#

Ohh, one question I do have, does an addaction not work in initplayerlocal?

plain current
#

It should? lemme test

#

it does work

warm iris
#

cool, I'll give it a slot into my init and I'll see what happens!

#

Woo it works! That's good. How to research if I can make an sqf trigger upon opening inventory

plain current
#
player addEventHandler ["InventoryOpened", {
    params ["_unit", "_container"];
}];
warm iris
#

Oh, coolio, thanks ^^

#

having a look I cant figure out how to get it to exec a sqf like the addaction does πŸ€”

plain current
#

if you have defined cfgfunctions then call the function, if not: [] execVM "filename";

warm iris
#

how do

plain current
#

I can link wiki pages and stuff, but i'm not writing your mission for you. Put the exevm code inside the code brackets for the eventhandler

warm iris
#

After a re-read:

player addEventHandler ["InventoryOpened", {
    params [] execVM "Save_Profile.sqf";
}];
``` works, thanks for helping!
tough abyss
#

Hey fellas! I'm trying to get a zone shrinker script paired with a death zone if leaving the trigger working. I found a few things online, tested them out rigorously with some people who know how to code, but are not familiar with SQF. We haven't been able to get the script to work properly, while one of my other friends has had better results with the same exact code. Even with everything being the exact same we aren't getting the same results. It seems as if the marker is set to the zones position and size properly, and begins to shrink on the map, but the trigger stays the same size and does not scale correctly.

#
_triggerArea = triggerArea zoneTrg;
_triggerPos = getPos zoneTrg;
_trgX = (_triggerArea select 0);
_trgY = (_triggerArea select 1);
_rate = 0.1;
_randomNum = selectRandom [800, 700, 650];

"zoneMarker" setMarkerSize [_trgX, _trgY];
"zoneMarker" setMarkerPos _triggerPos;

for [{_i = _randomNum}, {_i >= 0}, {_i = _i - 1}] do
{
    if (_trgX <= 4 || _trgY <= 4) exitWith{};
    _trgX = _trgX - _rate;
    _trgY = _trgY - _rate;
    zoneTrg setTriggerArea [_trgX, _trgY, 0, false]; // this line is not working
    "zoneMarker" setMarkerSize [_trgX, _trgY];
    sleep 0.1;
};
#

is the shrinkZone script, there's a seperate one to deal damage for players out of the zone, which seems to work fine for me, except that it does not affect the host of the server but my friend debugging with me is affected properly, this is an entirely different problem.

still forum
#

@warm iris without the params...

#

You are doing very weird stuff there without knowing :D

warm iris
#

Why know when you can experiment? :D

still forum
#

(params []) returns a number. Then you pass the number to execVM

tough abyss
#

nobody? if anyone's willing to help/debug feel free to send me a pm

young current
#

have you tested each individual command you use through debug console

#

perhaps you are missing something you define

#

you could also add debug hint messages that type out different parameters you work with to see if any of them is empty or targets wrong thing

tough abyss
#

I'll try that

#

But the odd thing is, the same exact script works for my friend on his computer/server. But the same mission file he used, on my computer has the same problem.

#

when I try to send this through the debug consoloe

    zoneTrg setTriggerArea [_trgX, _trgY, 0, false];

it refuses to work

mortal nacelle
#

Cannot quite wrap my head around param, if you are setting _var = param[0,""]; the default value has to be declared in another function or?

cold pebble
#

No, the default value there is the 2nd element in the param array

mortal nacelle
#

So take for example if I am looking for vehicle classes, how does _class = param[0,""]; find the vehicle class I am requesting for

#

I don't understand

cold pebble
#

Well you need to run the function by call/spawn/execVM or the like, and you’d pass the vehicle class through that

rough dagger
#

Hi all.. I would like to avoid the standard garbage collection for dead units, and instead apply disableSimulation to each unit (on MPKilled). Is this do-able, or is this just a bad idea overall? To clarify, I would have a big cleanup operation after each conflict, but would like to retain dead bodies as the defend mission progresses, and just delete everything after each wave. Cheers..

winter rose
#

doable, yes, bad idea, idk - need performance test
also, disableSim'ed bodies cannot be used as crates, iirc

rough dagger
#

thank you @winter rose .. would I place this instruction in initServer.sqf?

#

also, disableSim'ed bodies cannot be used as crates, iirc I think I heard this also..

winter rose
#

you could do this in initServer, but keep in mind that you would have to wait for the body not to move anymore ; don't disable its simulation on death

rough dagger
#

lol, good tip,. thank you πŸ™‚ that would have been a bit of an immersion breaker haha

slim oyster
#

I am trying to use a cell system to determine terrain types, features, etc. I want to be able to evaluate paths to waypoint, so a virtual line, and see if they intersect these cells. The cells are simply a coordinate system based on a common scale and naming scheme, X_Y, in a cba hash db. Any ideas?

exotic flax
#

I understand what you want, but I don't understand the exact question...
Which part of your code is not working, or not known (yet)?

astral dawn
#

Why CBA hash instead of 2D array @slim oyster

#

?

wary vine
#

@still forum doesn't params return bool ?

unique sundial
#

Yes

still forum
#

@wary vine maybe. Probably. Don't have bikini on phone

slim oyster
#

@astral dawn I throw a bunch more info into that hash than just the coords so I wanted to keep it organized. the BI db or CBA hash seem the best option

astral dawn
#

So what info have you got? x,y, what else?

tough abyss
#

I've added a p3d in my mission and some players get kicked for wrong signature, any ideas how i can fix this?

astral dawn
#

I don't think that you can add models into missions

tough abyss
#

Yes with createSimpleObject

astral dawn
#

Does it work though?

#

Didn't know that, sorry

tough abyss
#

yes its work but some players get kicked

slim oyster
#

@astral dawn pos, terrain type, elevation, building count, roads present/count, etc

#

mix of numbers, strings, arrays

astral dawn
#

I don't get it... so does the string for building count at cell [1235, 5678] look like "1235_5678_buildingCount" ?

slim oyster
#

no, the cba hash key is the cell x_y in string form

#

all data is within that

#
private _nodeData = [Map_GridData, _nodeString] call CBA_fnc_hashGet;
private _terrain = [_nodeData, "terrain"] call CBA_fnc_hashGet;``` etc
#

not all nodes have the same indexes required so hashGets are nice

astral dawn
#

ah wait, you are using CBA hash! I thought you use namespace getVariable. Isn't CBA hash too slow for you?

slim oyster
#

slow part is the string handling right? wouldnt formatting lots to getvariable be worse?

astral dawn
#

For huge map find would have to go through... how many, ~40000 strings in worst case, if your world size is 20km and your grid is 100 meters?

#

Aren't you converting float xpos, floay ypos to string version anyway?

#

Yeah I have just tested...
Init code:

_a = [];
_a resize 40000;
_a = _a apply {str random 1000000};
testArray = _a;

Code performance test code:
testArray find "123123"
600 microseconds, with my 8600k CPU... for your AI planning code you will need to do hash gets lots of time I assume

slim oyster
#

ah sorry, CBA hash doesnt need string for key

#

variable needs to be string obviously

astral dawn
#

so what's your key then? just array [_x, _y]?

slim oyster
#

yes

astral dawn
#

Ok let me see how slow it is...

slim oyster
#

formatting to the X_Y string would only be needed if I was using getvar

#

but yes I see the point at some level of map size the formatting is probably faster since it doesnt require a find/in

astral dawn
#

1.5 milliseconds for [number, number] array

#

getVariable in arma is fast AF (less than a microsecond !!) and would improve your planning speed very much

#

Even at the cost of converting to strings (around a few microseconds I assume)

exotic flax
#

depending on the use case you could also store the data in a sqf file, and only do it dynamically when the terrain is unknown

#

similar to how ACRE has mapped their terrains

slim oyster
#

I am doing this yes, parsing it and storing it in the addon

exotic flax
#

although in that case a plain array would be the fastest

astral dawn
#

That too ☝️ , I don't understand why you don't want to use plain 2D array...

forest ore
#

What am I missing/not understanding with this one:
"EntityKilled" MissionEventHandler works as expected when run directly from initServer.sqf but not when calling that exactly same MissionEH from a function I have declared in cfgFunctions?
So
if (isServer) then {addMissionEventHandler ["EntityKilled", blabla works
but
if (isServer) then {[] call Asm_fnc_entityKilledMissionEH;}; does not work.

exotic flax
#

For example am I working on an improved GPS Navigation system with full support of off-road movement (and can be used by AI as well with some modifications). And I have a very simple array stored in a sqf file for "supported" terrains, but can get data on the fly when needed (or call the function to generate data for new terrains).
This array is as simple as:

// [ x, y ], [ drive, walk, cover, object ]
_data = [
   [123, 456], [0.6, 0.8, 0.1, 0.1],
   [124, 456], [0.5, 0.8, 0.2, 0.3],
   // etc
];
#

@forest ore does the function require parameters?

forest ore
#

Ah, oh, you mean I should do the call with something else than just [] call ?

exotic flax
#

... was reading wrong...

#

so the function, which includes the eventhandler is not working, but it does work directly?

forest ore
#

Correct

slim oyster
#

@exotic flax Are you keeping to #s in your array for speed, then having your functions interpret it as scales for movement preference, determining viabilities of paths, etc?

exotic flax
#

It's to calculate a score where higher means better, depending on the given transportation, action and state.

eg. infantry on foot who need to move from A to B, while in combat mode, will prefer a walkable area with cover.
While a truck who just needs to drive without contact will prefer drivable without objects.

#

@forest ore is the function called at all (and visible in the Functions Viewer)? Because it sounds like the problem is there, since EH's will be set no matter how

forest ore
#

@exotic flax After the I start the mission from the editor I see the function in the Functions Viewer.. soo does that mean that it should be called as well if it's shown in the viewer?

exotic flax
#

it means it exists and can be called

forest ore
#

Ahh, problem solved. I had lost an all important } while doing testing and moving the missionEH (along with accompanying scripts) from initServer.sqf and into the function I created. With the } missing the game did not output any visible error

steady terrace
#

what am I doing wrong here?

block = testblock_3;  // a concrete block
block attachTo [testtruck, [0, -3.5, 0.4]];
vehdir = getDir testtruck; 

block setDir vehdir; 
blockdir = getDir block; 
 
dirdict = [vehdir, blockdir]; 
hint str dirdict;

gives a hint with differing values, even though they should be the same(and of course the directions in game aren't the same either).

this only happens when block is attached to a vehicle, why is that?

winter rose
#

what is testblock_3?

steady terrace
#

woops, typo. fixed

winter rose
#

many different items

steady terrace
#

there

winter rose
#

if you attach an object, a setDir on it is relative to the object it is attached to

steady terrace
#

oh wow

winter rose
#

so setDir 90 would turn the object to the right of the "attached to" object

steady terrace
#

thanks!

#

should I just have figured that out by not being an idiot or can I read it somewhere

winter rose
#

you could also setDir then attachTo

It is written on the attachTo wiki page iirc

steady terrace
#

I went to the wiki pages for all kinds of direction and spend some time on attachTo as well..

#

yes it does.. stupid me

#

ugh I wasted so much time! well, thanks!

winter rose
#

np!

steady terrace
#

πŸ€” I think it'd make more sense to put that note on the setDir page.. or use one of those warning boxes. ah well

(edit: attachTo to setDir)

winter rose
#

yep maybe, I was reviewing that as well

steady terrace
#

(oops, typo. meant the setDir page of course)

winter rose
#

I am editing attachTo , setDir shouldn't really be concerned about this

winter rose
#

attachTo updated @steady terrace

steady terrace
#

awesome! @winter rose

still forum
#

@tough abyss can't fix. We talked about that a couple weeks ago in another channel.

tough abyss
#

@Dedmen what can't be fix?

still forum
#

The signature problem with p3d in mission

tough abyss
#

@still forum Are you sure because i remember a script using a .p3d in mission without kick? (speed camera maverick)

still forum
#

Well you can disable sig verif

tough abyss
#

Yes i've disabled sig check but already got guys with some modified .pboπŸ˜‚

still forum
#

I think BI might look into mission p3ds but can't guarantee anything

tough abyss
#

@still forum it's a new issue since update of sig verif i'm right?

still forum
#

Think so. Either last or second last updoot

tough abyss
#

Ok thanks for your information @still forum.

still forum
#

Actually. I wonder if same happens with music/sounds in mission. That would be worse and would be a bigger incentive to fix it

bold kiln
#

I'm trying to set a variable inside a init file.

#

'''macro_fnc_name(init) = {

//Variable to prevent muiltiple actions added to the menu
bool menuCountRn=false;

...'''

#

any idea why this won't?

still forum
#

What is that "bool"? SQF is not a strongly typed language

bold kiln
#

ahh I see. thanks

cunning crown
bold kiln
#

right but I will need it for the unit that I've created.

I'm just trying to make the custom action I've made only appear once in the action menu, rather than once for every instance of the unit spawn/existing.

I'm trying to make it so the addAction process only runs once. by using a variable controlled if statement

#

== isn't a thing here either.
what would I use in its place?

still forum
#

It is a thing

bold kiln
#

hmm... must be something else

still forum
#

Show your code

#

Can't help with your errors if can't see the errors

bold kiln
#

thanks for wanting to help Dedmen. just one sec...I'll pull it up

#

looks like the error occurs here:

#

...
};
if(_menuCountRn==false)then{
macro_fnc_name(add_enter_action) = {
params [
["_unit",objNull,[player]]
];
...

still forum
#

Uh

#

I assume you are already a programmer?

#

Then you know that bool == false is the same as !bool

bold kiln
#

I'm very new to arma scripting

still forum
#

And you were already told, that's not how you define functions. Functions have no arguments

#

If you are very new, why are you trying to apply things from other languages onto SQF and just hope it works?

#

Look at wiki you were linked above

bold kiln
#

"...why are you trying..." I'm hoping to learn, even if it means I fail.

I didn't define the variable there. It was already defined above at the start of the function. Sorry about the brevity of the code being shown but not all of it is my work.

#

but i'll keep looking at the wiki as if it were holy script

cunning crown
#

If you learning another programming language (like SQF), forget everything about the previous one and start from scratch, it will be easier πŸ˜‰

bold kiln
#

@cunning crown Thanks for the advice. Will do

jade abyss
#

@bold kiln check the last 2 pinned messages in this channel.

restive leaf
#

Actually. I wonder if same happens with music/sounds in mission. That would be worse and would be a bigger incentive to fix it I still use music/sounds from my mission PBO on one of my public servers with no issue @still forum

plain current
#

In dayz there is a network bubble which means only objects x distance from you will be calculated but in arma i believe all objects on the map (or within view/render distance) will be sent to the client, have a look on here: https://community.bistudio.com/wiki/Mission_Optimisation

high marsh
#
_counr = count entities ""

?

versed belfry
#

Hey guys (hope this is the right place):
Does anyone knows how to disable Voice chat and Text chat in the in-game channels but still keep them for marking?

leaden summit
#

If I have an array called _guns and have 3 or 4 classnames in there and then do

{
    _gun = selectRandom _guns;
    [_x, _gun, 6] call BIS_fnc_addWeapon;
    [_x] joinSilent _ambush;
    _x setVariable ['dangerAIEnabled', true]; 

} foreach _badguys;```
Why do all 4 _badGuys get the same weapon? foreach works as a loop doesn't it?
#

Ok well either it was just incredible luck or it needed a sleep in there because I put a 0.2 sleep in and now they have different weapons.

unique sundial
#

that makes no sense, selectRandom doesnt care about your sleep

#

how many guns do you have in _guns?

leaden summit
#

Ok so it was just dumb luck that all 4 guys ended up with the same weapon from a 5 weapon array πŸ˜‚ I can live with that

unique sundial
#

yes that can happen thats why you should run it several times to be sure

#

random means random

leaden summit
#

Yeah I know, just seemed like the odds of them all getting the same weapon was ridiculous. I should have tested more

unique sundial
#

you can make sure that weapon pulled out of array is not given to anyone else

#

shuffle the array then take weapon by index

leaden summit
#

Yeah sweet, thanks for confirming my lack of testing :)
It's not super important, it just didn't make sense to me (due to my own lack of testing)

cosmic lichen
#

What's the best way to detect nearby enemy units? I tried 'findNearestEnemy', but that only returns the enemy unit once it fired.

winter rose
#

^ the enemy the unit knows, yes

cosmic lichen
#

Oh I found the issue.

#

unit disableAI "all" doesn't help with detecting enemy units πŸ˜„

neon snow
#

Hi there, how can I add refract particle effect using script? Code below doesnt work:

_pos = q1 modelToWorld (q1 selectionPosition "exh_leng_pos");  
ps2 = "#particlesource" createVehicleLocal _pos;
ps2 setParticleClass "ExhaustSmokeRefractHeli"; 
ps2 attachTo [q1,[0,0,0], "muzzle_1"];

still forum
#

No particle effects at all?

astral dawn
#

Is it not documented anywhere?
I don't understand how private keyword and general _privateVariable without private keyword behave inside FSM

unique sundial
#

Test?

astral dawn
#

Yes but I am trying to find biki references to be sure

tender fossil
#

Is this correct syntax eg. for retrieving the second parameter of the calling function only?

params ["",["_packet",[],[]]];
#

Or should it just be

params [["_packet",[],[]]];
cunning crown
#

The first one is the correct syntax, you should either remove the 3rd element of the 2nd array or put direct data type in it otherwise it's useless

neon snow
#

@still forum nope, other effects like smoke , explosion work fine, but refract doesnt show at all

still forum
#

Maybe that specific effect is too mild

neon snow
#

Tried all refract effects :/

tender fossil
#

@cunning crown Thanks! πŸ™‚

winter rose
#

@astral dawn FSM _vars can be accessed from all "blocks" as long as they have been defined (e.g in the "start" block) of course

astral dawn
#

Thanks man!

#

private makes it accessible only in current block, right?

winter rose
#

in the whole FSM I think

astral dawn
#

Hmm

#

Well I will test it then

modest temple
#

is there a cleaner way to remove a certain amount of a certain item from a player than just spamming removeitem

still forum
#

GetUnitLoadout, change count setsunitloadout. But thats stoop :D

modest temple
#

oof

slim oyster
#

@astral dawn whole fsm can access private & local vars

astral dawn
#

Even if I define them in some call scope?

#

like...

0 call {
_myvar = 123;
};
#

Can whole fsm access it afterwards?

winter rose
#

no no, scopes are fine

#

don't forget that FSM is unscheduled, don't sleep in a call

astral dawn
#

I have just tested... in scope I can overwrite _myVar which is global for whole FSM if it has been defined before
But can't initialize it there

#

Yeah thx!

unique sundial
#

FSM is scheduled, it was explained on execFSM page until you edited it

winter rose
#

then it should be explained on the FSM page, not execFSM

ah yes, I always mix up between being able to waitUntil and scheduled stuff

#

FSM conditions are unscheduled @astral dawn

astral dawn
#

Well I know that it just executes one state per frame

#

I can't sleep in it

#

I understand

#

Thanks guys

#

But FSM itself is running in the scheduler as I recall

#

Doesn't mean that code itself is scheduled environment

winter rose
#

ask KK, he is way more aware of this than I am

#

@astral dawn from what I read, FSM is scheduled, but suspension is not allowed (canSuspend returns false)
Only FSM conditions are unscheduled.

astral dawn
#

It's scheduled in a sense that it occupies scheduler's time, yeah

winter rose
#

and yes, it is explained on the FSM page @unique sundial

#

I will do another pass on both pages to split things cleaner

tender fossil
#

How do I encapsulate a string created with format with quotation marks? Do I need an escape character?

winter rose
#
private _myString = "I said ""yes!""";
tender fossil
#

So it's just double quotation marks?

winter rose
#

or ```sqf
private _myString = 'I said "yes!"';

tender fossil
#

So

format['"%1 [%2,%3]"',_classname,_procedureName,_uid];
#

?

winter rose
#

that would return "stuff, [stuff, stuff]" yes

tender fossil
#

Nice! Thanks mate πŸ™‚

still forum
#

Or Pass result through str

mortal nacelle
#

What is the command to check if a "classname" is in a predefined array

winter rose
#

in ?

mortal nacelle
#

thanks

mortal nacelle
#

Does it matter in which order you use param or params, aslong as the variable name is the same it is okay, right?

jade abyss
#

?

#
_a = [0,1,2];
_a params["_two","_zero","_one"];
hint str _two; //0
hint str _zero; //1
hint str _one; //2

You mean that?

winter rose
#

@mortal nacelle the order matters in the way @jade abyss mentioned it; but the order itself is not important to their values at all - they are just passed

mortal nacelle
#

Yeah, that is what I ment. Thanks

fleet comet
#

If im hosting a server doing Escape, how do i change the time of day?

winter rose
#

scripting wise, setDate or skipTime @fleet comet

fleet comet
#

@winter rose okay, what if i wanner turn of stamina?

#

is there something i can put in chat?

winter rose
#

enableFatigue?

jade abyss
winter rose
#

β˜οΈβ€¦ πŸ˜‹ πŸ˜‰

slim oyster
#

Have people replicated the map parsing to terrain type for the map in script form? I can't see an exposed function that uses the map config values for trees and rocks and such

unique sundial
#

And don’t forget utils 5 gives you searchable interface to every command in game

still forum
#

Searching biki easier tho? :U

#

Does utils show you dedmen on addWeaponWithAttachments?

winter rose
still forum
#

So no more info than that?

winter rose
#

no more info than that.

unique sundial
#

Searching biki easier tho? :U

Not really, it has missing commands and it is often down plus you need internet. Good for checking commands after you found what you’ve been looking for

winter rose
#

it is often down
wrong. but yes, you need internet

unique sundial
#

I guess you don’t use it often

winter rose
#

almost never!

unique sundial
#

If I had a dollar for each time I wrote to Dwarden about it...

winter rose
#

I don't know, I really only had issues when the wiki was down for long; I think it occured twice this year

it may go down frequently and I don't notice, but it's never down for too long, at least from what I could see

#

(also maybe different timezones too)

unique sundial
#

but it's never down for too long
Maybe I should stop nagging Dwarden then

winter rose
#

hahaha - then maybe you're the reason for it to be up quickly, and in that case thank you

#

I just wanted to jump on the

it is often down
because whenever I go to the wiki, I am not "oooh, it is down again"
maybe thanks to your reactivity, but it is not down "most of the time" for common peeps

cosmic lichen
#

It is down quite often. And it's always down when you really need its information πŸ˜„

winter rose
#

yeah, same as red lights when you are in a hurry πŸ˜‹
well, guess I'm lucky then! πŸ˜„

cosmic lichen
#

True πŸ˜„

lucid junco
#

is there the way how to manage (have control) head movement for AI?

winter rose
#

@lucid junco not exactly head control, but direction watching
what are you trying to achieve?

lucid junco
#

I need to force AI to look specific direction (during the dialog)

winter rose
#

lookAt, glanceAt, doWatch can help then

lucid junco
#

these are not enough πŸ˜„

#

i never saw what actually glanceat do. For me it does literally nothing at all πŸ˜„

winter rose
#

I think it is less "strict" than "look at", as in "from the corner of the eye"

but I can totally be wrong on this one

lucid junco
#

i need something definately more "strict" then lookat πŸ˜„

#

god bless "randomization" of everything πŸ˜•

winter rose
#

doTarget ? πŸ˜„

#

you can also disableAI to prevent the AI to look around too much

lucid junco
#

i think i need custom animation for the cutscene haha

#

πŸ˜„

#

thats what im looking for

winter rose
#

ah well, then scripting cannot help :p

lucid junco
#

yea πŸ˜„ i always end up with this statement lol

#

but thx πŸ˜„

winter rose
#

check the anim viewer in Eden, it may help!

lucid junco
#

yea i already had few long nights with anim viewer hah

winter rose
#

rawr

lucid junco
#

i need mocap

#

or better someone skilled with mocap and skilled porting animations to the arma

winter rose
#

the game has plenty of anims, which are the ones you want specifically?

plain current
#

I just googled if there are any cheap-ish mocaps anywhere near me, cuz i need some custom anims

#

There seems to be a community driven free one in the same building as me

winter rose
#

hah!

tender fossil
#

How does the game store your score on a server internally? (eg. if you disconnect and reconnect)

#

Let's say you have 500 points, and then you disconnect and reconnect. Then I kill an enemy unit and get 1 point. Should I tell the server to update the score to 501 or 1 to have the correct number of points (=501) shown in stats?

#

(Note: Arma 2)

winter rose
#

@tender fossil it depends on the server itself
by default the game doesn't store anything

technically:
the client should not say anything to the server,
the server should know the score and do a "+1". then, the db with your playerUID and the operation should deduce the new score

#

I mean:

  • on player connection: getPlayerDbScore
  • on player score: +1 β†’ saveDb
tough abyss
#
        "B_Mortar_01_support_F",
        "B_Mortar_01_weapon_F",
        "B_Mortar_01_support_grn_F",
        "B_Mortar_01_Weapon_grn_F",
        "I_Mortar_01_support_F",
        "I_Mortar_01_weapon_F",
        "I_E_Mortar_01_support_F",
        "I_E_Mortar_01_weapon_F",
        "O_Mortar_01_support_F",
        "O_Mortar_01_weapon_F",
        "B_Respawn_Sleeping_bag_blue_F",
        "B_Respawn_Sleeping_bag_brown_F",
        "B_Respawn_TentDome_F",
        "B_Patrol_Respawn_bag_F",
        "B_Respawn_Sleeping_bag_F",
        "B_Respawn_TentA_F",
        "C_IDAP_UGV_02_Demining_backpack_F",
        "I_UGV_02_Demining_backpack_F",
        "O_UGV_02_Demining_backpack_F",
        "I_E_UGV_02_Demining_backpack_F",
        "B_UGV_02_Demining_backpack_F",
        "I_UGV_02_Science_backpack_F",
        "O_UGV_02_Science_backpack_F",
        "I_E_UGV_02_Science_backpack_F",
        "B_UGV_02_Science_backpack_F",
        "I_E_Mortar_01_Weapon_F"
        "RHS_Podnos_Bipod_Bag"
        "RHS_Podnos_Gun_Bag"
        "rhs_M252_Bipod_Bag"
        "rhs_M252_Gun_Bag"
    ];
if (BIS_WL_arsenalEnabled == 1) then {
    BIS_fnc_arsenal_data set [3, BIS_WL_factionAppropriateUniforms];
    BIS_fnc_arsenal_data set [5, (BIS_fnc_arsenal_data select 5) - BIS_WL_mortarBackpacks];
    BIS_fnc_arsenal_data set [23, (BIS_fnc_arsenal_data select 23) - ["APERSMineDispenser_Mag"]];
    BIS_WL_arsenalSetupDone = TRUE;
};``` this dosnt work im guessing i need to pull more scripts from the warlord pbo file?
winter rose
#

. . . maybe?

oblique arrow
#

Hey peeps any chance you guys know of a way/could give me a pointer to a way to open the strategic map using an add action / hold action blep ? I took a look at https://community.bistudio.com/wiki/BIS_fnc_StrategicMapOpen but it seems like that'd always create a new strategic map instead of opening the already existing one

winter rose
#

is there a way to reopen a map though

jade abyss
#

@tough abyss ,,,,,, <-- missing in the list

tough abyss
#

@jade abyss thanks for the catch but its still showing up the RHS mortars in arsenal

jade abyss
#

did you start your game with the parameter showScriptErrors?

tough abyss
#

no, how do i do this?

jade abyss
#

check the A3-Launcher

#

There is the Button "Parameters"

tough abyss
#

@jade abyss turned it on but getting an error for something unrelated im aware of already

#

I think i structured the script wrong as i feel its just not being detected at all

jade abyss
#

Fix that, it could be a followup error

#

Check your .rpt's, fix the first error in that list. Restart the it, repeat

#

one by one, not all at once. Some stuff could just be an error, because something broke before.

tough abyss
#

I dont know how to fix that specific error its been there since i Added rhs to the mission and hasnt affected anything. It gived me an error in my a3 wlparseassetlist.sqf file

#
                _bPacksCnt = (count _transportBPacks);
                for [{_i = 0}, {_i < _bPacksCnt}, {_i = _i + 1}] do {
                    _item = getText ((_transportBPacks select _i) >> "backpack");
                    _text = _text + format ["%3%2x %1", getText (BIS_WL_cfgVehs >> _item >> "displayName"), getNumber ((_transportMags select _i) >> "count"), if (_text == "") then {""} else {", "}];
                };```
winter rose
#

```sqf
/* your code */
```

tough abyss
#

"Generic error in expression"

#

@winter rose not catching what your telling me

winter rose
#

you can use ```sqf to colour your code

#

e.g ```sqf
_transportBPacks = (BIS_WL_cfgVehs >> _entryClass >> "TransportBackpacks");
_bPacksCnt = (count _transportBPacks);
for [{_i = 0}, {_i < _bPacksCnt}, {_i = _i + 1}] do {
_item = getText ((_transportBPacks select _i) >> "backpack");
_text = _text + format ["%3%2x %1", getText (BIS_WL_cfgVehs >> _item >> "displayName"), getNumber ((_transportMags select _i) >> "count"), if (_text == "") then {""} else {", "}];
};

tough abyss
#
        "rhs_M252_Bipod_Bag",
#

ah cool! thanks

forest ore
#

sqf Does not work

still forum
#
Does not work
forest ore
#

sqf _this = nope

still forum
#

Tick tick tick sqf line break text line break tick tick tick

#

Not like you are doing
Tick tick tick line break sqf text line break tick tick tick

forest ore
#
Does not work
#

I've never understood how to color the code and at this point I'm too afraid to ask

forest ore
#

I thought it would just magically work with ```sqfSPACEcode πŸ™‚

dreamy kestrel
#

hello, is it possible to determine any NIC information from the hosting machine? i.e. MAC address, etc? from the context of scripts, that is.

austere granite
#

big no

winter rose
#

whyyy would you want to do that πŸ‘€

still forum
#

Cray cray

#

In case u lost your crikey

winter rose
#

hence the big eyes

#

Also, a MAC address is easily falsifiable

dreamy kestrel
#

sure, no worries. I want to cook up a UUID API for some internal tracking of mission array entries.

winter rose
#

playerUID?

exotic flax
#

AKA Steam ID

quasi gyro
#

hey yall im still trying to fix this its been a while since i have looked at it the concept and goal of this code is to take the chords of a location and clear all of the objects within a radius before the objects placed in eden are loaded i have ran it multiple times and have hit a rock should this work for the intended goal it doesnt even clear the objects when ran on a dedicated server

#
private  _locations=[[5789.38,10383.6],[5724.87,10404.2],[5793.5,10421.4],[5759.32,10444.9],[5798.47,10468.9],[6895.849,7453.282],[6895.849,7453.282],[5822.715,10783.907],[5830.870,10187.938],[5845.938,10223.338],[5840.145,10143.083],[5876.150,10186.08],[5878.213,10210.816],[4985.84,11373.3],[4961.61,11323.8],[5755.97,10696.4],[5755.66,10717],[5755.51,10731.1],[5479.933,9977.303],[5469.477,9947.218],[5761.33,10628.7],[5730.21,10625.1],[4676.46,9315.29],[3875.18,9667.09],[5836.25,10830.8],[5938.71,10645.7],[5835.59,10545.3],[5805.89,10579.7],[4634.15,9265.12],[4712.04,9263.93],[4054.704,9105.791],[9877.941,13536.048],[4048.31,8318.89],[4073.25,8294.63],[6921.5,7584.5],[8262.4,11990.3],[8356.62,11957.9],[5935.47,11051.4],[5948.38,10987.6],[5922.09,10983.3],[5922.09,10983.3],[5918.39,10993.2],[5918.39,10993.2],[5763.97,10586],[5756,10567.3]];

private _radi=[50,20,30,50,20,20,20,30,30,30,10,20,8,50,20,20,20,20,5,10,20,20,50,99,15,40,50,20,35,25,100,20,50,50,100,100,50,50,25,10,5,5,45];

if (count _locations != count _radi) exitWith { hint "invalid grid" };

{
    private _location = _x;
    private _radius = (_radi select _forEachIndex);

    {hideObjectGlobal _x} forEach (nearestTerrainObjects [_location,[],_radius]);
} forEach _locations;
#

this is clearmap.sqf

#
[] execVM "Modules\HG\Setup\fn_serverInitialization.sqf";
call compile preprocessFile "Modules\MapEdits\clearmap.sqf";
#

this is initServer.sqf

still forum
#

The language is sqf not c++. And I literally just told someone else how to do Syntax Highlight correctly

quasi gyro
#

my bad i haven't even been here

#

i can fix it

#

i didnt know discord supported sqf

#

fixed my bad

still forum
#

NΓΆ Error messages in rpt? It doesn't exit on the exitwith?

dreamy kestrel
#

not for players, per se. just general mission critical array elements.

#

no worries, we can just aim for random UUID for the time being.

quasi gyro
#

ill have to run again and check for you when i sit back at my pc i apologize i got called into work

warm spade
#

Why am i getting a zero divisor error even tho the if statement shouldn't be execute when the number is lower than 1. Or am i missing something? πŸ€” ```sqf
if (PoliceFrisk_VestChance + PoliceFrisk_PrimaryWeaponChance + PoliceFrisk_SecondaryWeaponChance >=1) then {
_frisk = (PoliceFrisk_VestChance + PoliceFrisk_PrimaryWeaponChance + PoliceFrisk_SecondaryWeaponChance);
systemChat format ["Total: %1%, chance: %2%, (%3/%4)", (_frisk * 100) / _chance, (_chance/_frisk) * 100, _chance, _frisk];
};

spice axle
#

how do you get this chance values?

warm spade
#
_chance = 0;
        if (vest _x != "") then {
          _chance = _chance +PoliceFrisk_VestChance;
        };
        if (primaryWeapon _x != "") then {
          _chance = _chance +PoliceFrisk_PrimaryWeaponChance;
        };
        if (secondaryWeapon  _x != "") then {
          _chance = _chance + PoliceFrisk_SecondaryWeaponChance;
        };
spice axle
#

try systemChat str PoliceFrisk_VestChance

warm spade
#

nvm i found the error, _chance is 0 -.-

spice axle
#

and yes

warm spade
#

thanks

quasi gyro
#

in response to earlier there is nothing referencing the script in the rpt file

#

it seams like its not executing

#

do the two blocks make sense as if they should execute when desired

mystic cedar
#

This is gonna sound stupid but

#

I named variable convoy then said convoy setConvoySeperation 10;

#

When I run i get the error error generic error in expression

exotic flax
#

what is the full script, and what is the exact error message?

mystic cedar
#

Full script is: Convoy setConvoySeperatipn 10;

#

The exact error is when I run the scenario: β€˜call Convoy SetConvoySeperation 10; error generic error in expression

exotic flax
#

so your script is call Convoy SetConvoySeperation 10;, with the extra call in front...

#

and where/how do you run the script? In the init field of the leading vehicle?

#

because in that case you can use this setConvoySeparation 10;

lucid junco
#

possible somehow to switch freelook via command?

spark zenith
#

Anyone experience issues with addMagazineCargo? Seems to cause a CTD whenever you try to swap your weapon in the inventory with another weapon. I removed addMagazineCargo from my script and it worked fine.

#

Can provide a video and crash logs

unique sundial
#

Make a repro @spark zenith

spark zenith
#

will do

spark zenith
#
private ["_unitPrimaryWeap","_unitVestContainer"];
_unit = param [0, objNull, [objNull]];

_unitPrimaryWeap = primaryWeapon _unit;
_unitVestContainer = vestContainer _unit;
if(_unitPrimaryWeap == "arifle_MX_f") then {
    _unitVestContainer addMagazineCargo ["30Rnd_65x39_caseless_mag",6];
    systemChat "Added 6x 30Rnd_65x39_caseless_mag";
};```
#

actual script

#
class cfgPatches
{
    class addMagazineCragoCrash
    {
        name = "addMagazineCragoCrash";
        requiredVersion = 0.1;
    };

};

class cfgVehicles
{
    class EventHandlers;
    class B_Soldier_F;
    class crashTestMX: B_Soldier_F
    {
        displayName = "soldier mx";
        weapons[] = {"arifle_MX_f"};
        magazines[] = {};
        class EventHandlers: EventHandlers
        {
          init = "if (local (_this select 0)) then {[(_this select 0), [], []] call tst_fnc_testCrash;};";
        };
    };
};

class cfgFunctions {
    class tst
    {
        class functions
        {
            class testCrash
            {
                file = "addMagazineCargoCrash\testCrash.sqf";
            };
        };
    };
};```
#

no mods loaded other than the single pbo

still forum
#

@spark zenith is there already a ticket on feedback tracker?

spark zenith
#

no

#

guess I should make one

still forum
#

Yes please, and link here

spark zenith
#

there

tough abyss
#

Hey guys, I'm trying to make a simple script that would place loads of 40mm into a rifle's magazine

#

Would this work?
player select [weapon] select [magazine]

#

player select [primaryWeapon] select [200Rnd_40mm_G_belt]

#

^ I intend to place 200 rounds of 40mm in the primary weapon of a player

#

so this select [primaryWeapon] select [200Rnd_40mm_G_belt]

finite jackal
#

@tough abyss Select is intended for use in arrays, strings and configs, not the player object. primaryWeapon returns the classname of a units primary weapon as a string, you cannot see the magazine of the string without looking in the config. You are using incorrect syntax and you will not be adding 40mm to a vanilla rifle with a simple script

tough abyss
#

How can I do that? I once saw a guy who placed 2x 3rnd 40mm GL into the magazine slot of a revolver, and another guy place lots of flashbangs into the magazine slot of an MG42

#

i asked them once, they just said "simple SQF scripting!"

plain current
#

i don't think they "placed them into the magazine"

#

They probably added a fired eventhandler and then used createVehicle or what ever to create a bullet/shell/missile/etc and then give it the same velocity and direction as the actual bullet

tough abyss
#

You sure? He gave me the revolver and when I picked it up it had the 2x 40mm GL placed in the magazine slot through SQF magic

winter rose
#

cheats*

plain current
#

it still shouldn't transfer over if he picked it up

tough abyss
#

Nah not cheats, he's the admin on his own server with the debug console

worthy willow
#

Was the server modded?

tough abyss
#

Yeah we had a dozen mods

worthy willow
#

Well there you go

#

It was a modded mag

tough abyss
#

No it wasn't

plain current
#

He prolly added like a 40 mm AA mag or something into the gun

tough abyss
#

Vanilla revolver, vanilla 40mm

worthy willow
#

You know can make a copy of the mag

#

And just add more weapon tpyes

#

Or do the same with the gun

tough abyss
#

He just told me it's a few lines of SQF. Apparently he spawned the revolver into his secondary weapon slot with the 40mm inside it already

worthy willow
#

Wow you were right

#

cursorObject addWeaponWithAttachmentsCargo [["hgun_Pistol_Signal_F", "", "acc_flashlight", "", ["3Rnd_HE_Grenade_shell", 3], [], ""], 5]

#

Spawns a gun with HE 40mm

winter rose
#

@still forum what did you bring upon this cursed land

still forum
#

πŸ™ƒ I already found that "bug" but I'd prefer to label it a feature

#

Looking at chat above, it indeed is used as a feature so I'll leave it at that :3 thank me lat... No, thank me right now!

#

Please don't exploit it to do bad, otherwise I'll really have to fix it and take that feature away

dusky pier
#

hello, i'm trying to add a fireworks script to mission, but when start script - nothing is working. drop don't work's for me, i think 😦

exotic flax
#
  1. create a new mission in 3den
  2. save the mission (make sure it's NOT binarized)
  3. code the script in the mission folder
  4. reload the mission in 3den
  5. place an object somewhere on the terrain (in 3den)
  6. add the following line in the init of the object:
// make sure path to file is the same as the file location relative to mission.sqm
nul = [this,120] execvm "ALfireworks\alias_fireworks.sqf";
  1. start the mission
dusky pier
#

ah, still no visual effects 😦

exotic flax
#

try the tutorial video on the workshop page, I'm sure that will help

dusky pier
#

try'ed that code:

#
[] spawn {
_time_life_projectile = 2;
_obj = objectParent player;
  drop [["\A3\data_f\cl_exp",1,0,1],"","Billboard",0.02,_time_life_projectile,[0,0,2],[0,0,200],0,11,8,0,[5],[[1,1,1,1]],  [1],1,0,"ALfireworks\trail_fireworks.sqf","ALfireworks\blow_fireworks.sqf",_obj];
};
#

for test's, but nothing is changed

#

still don't works

exotic flax
#

but that is NOT the code which is given in the description or tutorial...

dusky pier
#

i used tutorial, and is not working for my mission

#

changed all like in tutorial

exotic flax
#

to be fair, that array looks wrong (when comparing it to ParticleArray)

#

I do not have experience with drop or particles, but I would guess your RPT file has some errors explaining what is wrong

winter rose
#

-showScriptsErrors might help as well…

tough abyss
#

Hey guys, I'm trying to set an event handler where, if a person fires the RHSUSAF M32 MGL, the ammo count would be set to 6 (cuz that's the max the MGL could take, in other words I want to have infinite ammo for the MGL). Will this work?

this addEventHandler ["Fired", {
  params ["player", "rhs_weap_m32", "", "", "rhs_mag_M433_HEDP", "rhs_mag_M433_HEDP", "rhs_mag_M433_HEDP"];
    player setAmmo [currentWeapon player, 6];
}];
#

Sorry for asking if this would work or not, I don't have access to arma until a few more weeks

winter rose
#

params takes _underscoredVariables, so no

high marsh
#

I think setVehicleAmmo works on players. Might just want to use the player as a target and the command will just use whatever magazine size it takes.

tough abyss
#

Soooo, this?

this addEventHandler ["Fired", {
  params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
  if (_weapon isEqualTo "rhs_weap_m32" && _magazine isEqualTo "rhs_mag_M433_HEDP") then { _unit setAmmo [currentWeapon _unit, 6] };
}];
winter rose
#

more likely

dusky pier
#
_year = 2019;
systemChat format["Happy new %1 year",(_year + 1)];
craggy bluff
#

I would like to limit the number of UAVs ...
I want about two.

What is the way?

winter rose
#

Don't place 3 UAVs

craggy bluff
#

@winter rose I'm not talking about that simple thing.

We spawn a UAV using the VVS system on the server.

I want to limit this to a maximum of two.

restive leaf
#

So modify the VVS system... or fix its config... It is a script not a mod.

#

It's also not core ARMA... so not really a scripting question

hollow lantern
#

is there a way to pass arguments onto an dialog control created with createDialog ? I have some buttons defined that do actions based on the params given. The action of such button looks this : hpp action = "[_argument1, _argument2] execVM 'itsAebian\CodeLock\actions\setCode.sqf'";

astral dawn
#

@hollow lantern use setVariable on the control

#

Ah wait

#

Well I guess I don't fully understand your question, sorry. But setVariable might be your solution. Not sure. 🍷

hollow lantern
#

The problem is the object where the variable is attached to is not static, it is dynamic (aka multiple objects can exist). So I somehow need a way then to tell the action to fetch that specific one

astral dawn
#

So when you create the object, you can do setVariable on it

#

When the action runs, it will getVariable the data

hollow lantern
#

yes, but that doesn't work in the createDialog

#

I'm not able to get the object

#

createDialog does not support to pass params to him

#

it's a simple sqf createDialog "KI_KeyDialog" command

#

so that dialog has no knowledge of the object

#

unless I could modify the Button via idc and change the action this way but I doubt

worthy willow
#

If you know the Display IDD you can use that

vital surge
#

Does anyone here know how I can add a simple eject anywhere script? For helicopters on a server, not a zeus server or anything, it's just a pvp server

astral dawn
#

@hollow lantern use onLoad event specified in dialog's config to store the dialog's handle into uiNamespace. Get that handle right after you have called createDialog. Then you can find your control by idc.

#

After that you can add any event handler to the buttons

#

CtrlAddEventHandler

worthy willow
#

@vital surge ```sqf
player addAction ["Eject", "player action ['GetOut',objectParent player]",nil,1.5,true,true,"","!isNull(objectParent _this) && _this isEqualTo (currentPilot (objectParent _this))"];

This will only work for the current pilot, so some changes will be needed but will work in most cases.
astral dawn
#

Btw there is also #arma3_gui where you might have much higher chance to get answer

hollow lantern
#

@worthy willow got an example for that? The button idc = 1610

vital surge
#

I'll check it out Jimbo

worthy willow
#

What is the IDD ?

vital surge
#

Wym

worthy willow
#

I was talking to @hollow lantern

hollow lantern
#

how do I find this out? I have defined the button this way:

#
        class buttonEnter: RscButton
        {
            idc = 1610;
            action = "[cursorObject] execVM 'itsAebian\CodeLock\actions\enterPressed.sqf'";

            text = "Enter"; //--- ToDo: Localize;
            x = 0.417535 * safezoneW + safezoneX;
            y = 0.632032 * safezoneH + safezoneY;
            w = 0.0412325 * safezoneW;
            h = 0.0550133 * safezoneH;
            colorText[] = {-1,1,-1,1};
        };```
worthy willow
#

The IDD is right at the top

hollow lantern
#

ah lol

#

idd = 1234;

#

that's before my controls class

worthy willow
#

dialog name?

hollow lantern
#

KI_KeyDialog

worthy willow
#
createDialog "KI_KeyDialog";

private _display = (findDisplay 1234);
private _btn = _display displayCtrl 1610;

_btn setVariable ["object",cursorObject];

_btn ctrlAddEventHandler ["ButtonClick",{
    params ["_control"];
    
    _obj = _control getVariable ["object",objNull];
    if (isNull _obj) exitWith {};



    
}];
#

Could do something like that

hollow lantern
#

so instead of the action in the button I do it like this then?

#

I will check it out, thanks

hollow lantern
#

this actually works lol, genius! Thanks @worthy willow

worthy willow
#

NP

ivory lake
#

with the particular animation I was using it on, it's very noticeble that it's going quickly from 0 - 1 rather than just immediately jumping to 1

#

even mroe so if you use setAccTime and set the game speed into slowmo

tough abyss
#

https://community.bistudio.com/wiki/Arma_3_AI_Skill As a sanity check I want to make sure I'm understanding the sub-skill "general" correctly. The General sub-skill distributes the value it contains to other subskills automagically and does not have any other effect on the AI outside of what it has distributed to other sub-skills?

#

If that is true, what is the weighting of how it distributes the value given?

hollow lantern
#

@worthy willow do you have an idea why the excuted script does not know anything about the passed variable?


_display = (findDisplay 1234);
_btn1610 = _display displayCtrl 1610;

_btn1610 setVariable [str _keyPad, _keyPad];

    _btn1610 ctrlAddEventHandler ["ButtonClick",{
       params ["_control"];
        
        _extracted = _control getVariable ["keyPad", nil];
        if (isNull _extracted) exitWith { systemChat "Error 500 - Internal Server Error"};

    [_extracted] execVM "itsAebian\CodeLock\actions\enterPressed.sqf";
        
    }];

In the enterPressed.sqf I have at the top a simple params ["_keyPad"]; which should hold the name of the object but it seems that the script doesn't like it.

Even after the params a

params["_keyPad"];

if (isNil _keyPad) then { hint "It is nil ;("};``` will return in a ```rpt
_>
11:21:40   Error position: <_keyPad) then { hint "It is nil ;("};

_>
11:21:40   Error Undefined variable in expression: _keypad
11:21:40 File C:\Users\Aebian\Documents\Arma 3\missions\Madley.Enoch\itsAebian\CodeLock\actions\enterPressed.sqf..., line 3
#

the 1st script snippet above is from my openDialog.sqf and the _keyPad variable works there as I do as well a getVariable and have recieved no issues so far

worthy willow
#

_btn1610 setVariable [str _keyPad, _keyPad];

#

needs to be

#

_btn1610 setVariable ["keyPad", _keyPad];

hollow lantern
#

but then the variable will always be accessible as keyPad

#

I want the actual object name as "name"

#

as different objects can run the script and would rewrite the variable. Button ID is static, object-name however is not, so my idea was to make the variable name unique by using the variable name of the object or doing something like (warning, pseudo-code) Key_+_keypad

#

e.g. I used some tablets, I named them CellTab_01 CellTab_02 etc. I could now say (pseudo-code) _btn1610 setVariable [VAR_CellTab_01, _keyPad];

#

if you understand what I mean

worthy willow
#

Why not just make a list?

hollow lantern
#

if I can fill that list dynamically

#

maybe

#

do you may have an example for this approach? I really only need a variable that is unique to the Object like CellTab_01 , CellTab_02 usw. but attached to the button so that I can pass stuff to it

tough abyss
#

I'm trying to figure out why the debug area of my script is borked on Dedicated server but works perfectly on LAN multiplayer.

#

nosAIdebug = [0, 1] select (paramsArray select 1);
nosAIaccNUM = [0.05, 0.10, 0.15, 1] select (paramsArray select 2);

[] spawn {

  while {true} do {
    sleep 5;

    {

    _x setSkill ["aimingAccuracy",nosAIaccNUM];
    _x setSkill ["aimingShake",0.1];
    _x setSkill ["aimingSpeed",1];
    _x setSkill ["commanding",1];
    _x setSkill ["courage",1];
    _x setSkill ["endurance",1];
    _x setSkill ["general",0];
    _x setSkill ["reloadSpeed",1];
    _x setSkill ["spotDistance",1];
    _x setSkill ["spotTime",1];
    _x allowfleeing 0;

              if (nosAIdebug == 1) then {

                allNosUnitsCheck = allUnits;
                randoUnit = allNosUnitsCheck call BIS_fnc_selectRandom;
                aA1 = randoUnit skill "aimingAccuracy";
                aS1 = randoUnit skill "aimingShake";
                aSp1 = randoUnit skill "aimingSpeed";
                sD1 = randoUnit skill "spotDistance";
                sT1 = randoUnit skill "spotTime";

                                              [-2,

                                                       {

                                                        systemChat format [
                                                              "unit: %1\aimingAccuracy: %2\aimingShake: %3
                                                              \aimingSpeed: %4\spotDistance: %5
                                                              \spotTime: %6"

                                                              ,randoUnit,aA1,aS1,aSp1,sD1,sT1];    /*These variables return "any" when run on dedicated server. In the Lan environment they work perfectly*/

                                                      }

                                              ] call CBA_fnc_globalExecute;

                                      };

    } forEach allUnits;

  };
};


#

I am also working within the confines of ArmA II OA latest version.

winter rose
#

paramsArray?

tough abyss
#

I think that's my only option in A2. P:

#

Otherwise I would use the BIS fnc

winter rose
#

ah, yes, indeed

else param1 / param2 :p

tough abyss
#

I think maybe I'm just not understanding either one of two things: CBA_fnc_globalExecute or dedicated server isn't broadcasting the variables even though it knows them.

winter rose
#

I cannot help on CBA though.

#

(for info, what is paramsArray select 0? another setting?)

tough abyss
#

Yes it's just another debug param for another set of scripts defined in description.ext .

winter rose
#

but then you have to wait for the init to be done

tough abyss
#

Oof

#

Okay

winter rose
#
waitUntil { !(isNil "BIS_MPF_InitDone") };
#

oooh, a page to rework

tough abyss
#

That page probably gets accessed once every two or three years. "Insert self deprecating joke"

winter rose
#

well… Arma 2…

:p

tough abyss
#

I think I know what's happening here. Even if I used RE I would have the same problem because the code is executing on me and not actually passing me the information which is why on dedicated I get empty variables. So I guess the best bet would be to run the code on the server only. Then store the return values into a message and then pass the info?

winter rose
#

the systemChat happens on the server yes

tough abyss
#

Outstanding

tough abyss
#

Okay I've taken care of the original issue. The code now runs properly on dedicated. Now my problem is getting correct values.

#
                     allNosUnitsCheck = allUnits;
                     randoUnit = allNosUnitsCheck call BIS_fnc_selectRandom;
                     aA1 = randoUnit skill "aimingAccuracy"; /*aA1 returns 1 no matter what. The variable randoUnit is local to the server. The true aimingAccuracy value is 0.15*/
#

The above gets ran on the player.

#

And bottom line is that I'm not getting the correct value for aimingAccuracy.

#

I do get the correct value if the unit is local to me in a LAN environment.

spice axle
#

use selectRandom instead of call BIS_fnc_selectRandom the function deprecated

tough abyss
#

This is A2

tropic thunder
#

I have a handful of files that I'd like to run as part of player respawn. Should I be #includeing those files, or execVMing those files from onPlayerRespawn?

forest ore
#
forEach could provide somekind of answer to that πŸ€ΈπŸΌβ€β™‚οΈ
hollow lantern
#

@worthy willow do you know if the control event handler knows anything about the var defined outside of the handler? My current approach is this:

_btn1610 setVariable [format ["VAR_%1", _keyPad], _keyPad];

    _btn1610 ctrlAddEventHandler ["ButtonClick",{
       params ["_control"];
        
        _extracted = _control getVariable [format ["VAR_%1", _keyPad], nil];
        if (isNull _extracted) exitWith { systemChat "Error 500 - Internal Server Error"};

    [_extracted] execVM "itsAebian\CodeLock\actions\enterPressed.sqf";
        
    }];``` The var used in setVariable will now be VAR_<keyPad-Name>  so e.g. ``VAR_CellTab_01`` and I now want to fetch that dynamic var in the control handler so that I get the value out of it which is ``CellTab_01``
still forum
#

It doesn't know _keypad

hollow lantern
#

how can I make him aware of it?

#

wiki doesn't tell me anything about that _control param

still forum
#

What you are doing doesn't really make sense at all

#

You are setting Var_keypad to keypad.
When you try to retrieve that variable, you already need to know the value of keypad because that's part of the variable name, retrieving that variable doesn't make any sense as you already know it's value before you retrieve it

hollow lantern
#

@still forum hu? What I'm trying to do is to set the name of KeyPad onto a variable called VAR_<keypad-name> so that I can then fetch it later on in the ctrlAddEventHandler to get that passed value out of it

still forum
#

Your code sets _keypad value onto VAR_<_keypad value>

hollow lantern
#

thats correct

still forum
#

Makes no sense, also you already need to know keypad value to retrieve the variable

#

And if you already have that anyway, then there is no need to get a variable whose value you already have

hollow lantern
#

that's the whole script

tawdry harness
#

Hey, I'm currently trying to get a unit to move into a vehicle that's nearby without affecting their normal course / already set waypoints and without teleporting them. This is what I got

{
  _x moveInAny _vehicle;
}forEach units squad1;
``` However this teleports them into the vehicle and addWaypoint wont work unless someones knows a way. Btw this is run in a while true loop
hollow lantern
#

the buttons however will be called from several objects that differ

still forum
#

Why VAR_%1?
Why not just set the variable "keypad"?

hollow lantern
#

because keypad will then be overridden when another object with the same dialog executes a button

#

with the name of the other keyPad

still forum
#

It's a local variable

#

No it wont

hollow lantern
#

it will as the variable is attached to the button and not to the _keyPad

still forum
#

Stop using format. Just make the variable name "keypad" instead of format with VAR_%1
Just do it

#

I won't be able to explain to you in a way that you understand

hollow lantern
#

so let me get this straight then:

_btn1610 setVariable ["keyPad", _keyPad];```
Will attach a variable to the button 1610 with the name of ``keyPad`` and the value of ``_keyPad``.

When the ``_keyPad`` value is e.g. ``CellTab_01`` then the keyPad variable will have the value of ``CellTab_01 ``
If another object now runs the same dialog and the setVariable will run then the value of ``_keyPad`` is CellTab_02 and hence the variable attached to the button 1610 will be changed from CellTab_01 to CellTab_02 

That's what my assumption is. However I will remove the format and see
still forum
#

You cannot store variables on anything. You store values.
The value you setVariable onto the control doesn't know anything about your local bariable

hollow lantern
#

yes yes I got that. Still the value will be changed any time another object will execute the dialog. as the VALUE of _keyPad is different (it is based on the object name that runs the dialog)

still forum
#

If it closes the old dialog and opens a new one, why would that matter? The old is gone anyway.
If it opens a additional dialog, the dialogs will have different controls, and you set the variable onto the control anyway so...

#

Btw why do you have findDisplay twice with the same I'd?
And why do you name the first _ctrlIndicator. findDisplay doesn't return a ctrl

hollow lantern
#

but I could also store that in a variable I have below, yes

#

just changed it

still forum
#

Ah yes. Inconvenient linebreak there

hollow lantern
#

thanks @still forum works

mystic cedar
#

Where do you find the name of bombs?

#

For IED scripts it says β€œM_MO_82mm_AT_LG” where would I find names for other weapons?

winter rose
#

on the wiki, check CfgMagazines in the search field @mystic cedar

mystic cedar
#

Alright thanks

velvet merlin
#

is there any EH or similar mechanism to detect if an unit joins another group?

unique sundial
#

I knowο»Ώο»Ώο»Ώ it's SQS, but it was easier to writeο»Ώο»Ώ πŸ˜‚ https://forums.bohemia.net/forums/topic/227164-wind-bug-weird/

hollow lantern
#

can't you just work with sqf unit1 in units group unit2

#

I don't think there is an EH for detecting if a unit joins another

spice axle
#

@unique sundial can you use sqs in arms 3? Because his last answer is way funnier if you can’t use it

winter rose
#

SQS is still supported in Arma 3 yes.

#

the answer might be "you can't use # for select in SQS" (but I am not sure of this) it seems to work fine for him

unique sundial
#

You still can but there are questions

astral dawn
#

@velvet merlin I think, no, must poll it periodically

#

Check if current group and previous group are different

finite sail
#

Guys, I'm trying to open the doors of the gendarmerie offroad.. but there doesn't appear to be an animation for it

#

I can hide them, but not open them, i've looked through the parent classes too

slate sapphire
#

Hello did anyone of you, manage to use/create a gear menu that works with the RHS grip accessories, ? I have problem with those, they seems not working properly, instead of bipods works fine...

sonic linden
winter rose
#

Yes, it is said somewhere in the wiki that you should expand the screenshot directory max size

#

Point 1 @sonic linden

sonic linden
#
maxScreenShotFolderSizeMB = 2000;

found it thanks

winter rose
#

Personal advice, if you want to make a 455px pic, don't run the game in 4K

exotic tinsel
#

is it possible to get the behavior of a group instead of a member of the group?

exotic flax
#

if you set the behaviour of the group leader, then the whole group will follow

exotic tinsel
#

yes but i dont want to have to loop through every guy to get the groups behavior. i am trying to get the groups behavior from their group object. is that possible?

#

the irony is to set the groups behavior you have to do it on the group object. but you cant use "behavior" function on the group object.

winter rose
#

@exotic tinsel that would be the leader's one

hollow lantern
#

I have a trigger with sqf ([west, side _x] call BIS_fnc_sideIsFriendly); however the trigger doesn't get activated. When running the same command in the debug console with _x being player it returns true. Any ideas what's wrong here?

still forum
#

where does your _x come from?

hollow lantern
#

as it is a trigger I suppose it fetches _x from the trigger area

#

or is that a false assumption?

still forum
#

your _x is undefined

hollow lantern
#

thisList - list of all objects in trigger area, based on 'Activation' nothing with _x on the wiki, I guess false assumption then

#

hmmm ok

winter rose
#

{ _x } forEach thislist

hollow lantern
#

thx

worthy willow
#

Would anyone be interested in a Discord Webhook callExtension?

winter rose
#

sounds like a good idea

worthy willow
#

It is basically done

jagged hazel
#

Does anyone know a good banking script for Arma. Like those used in Altis Life mod, where the player can buy and sell stuff. I would like to use it in a survival mission

hollow lantern
#

Can someone give me a hint why the following condition works when I test it with my player unit but does not work when AI passes the trigger?

{[west, side _x] call BIS_fnc_sideIsEnemy} forEach thislist && {_x isKindOf "AIR"} count thisList > 0```  The trigger should activate if the object type that passes it is type air (helo or plane) and the side of it is hostile towards WEST
still forum
#

sideIsEnemy only checks the last unit in thisList

#

or rather. it checks all, but ignores the result for every but the last

hollow lantern
#

well the complete helo is manned with opfor units. They are hostile towards WEST and they were sitting in a helo, is the condition still valid then? Would it help if I do a sqf side (driver _x) ? Then only the driver will be checked

winter rose
#

would findIf be better though

hollow lantern
#

ah

#

huh, thisList is an array, according to the wiki findIf needs as 1st param an array and second is what to search for. How would I re-write that? I tried sqf thisList findIf {[west, side _x] call BIS_fnc_sideIsEnemy} && {_x isKindOf "AIR"} count thisList > 0 but got an expression error. The thing I want is that the condition should determine if the "air vehicle" is hostile and return true

still forum
#

findIf returns number

#

you need to check that number, you cannot && a number

winter rose
#

!= -1

tough abyss
#

Anyone can tell me if headless client is unlimited?

winter rose
#

an unlimited amount? technically it's limited to some millions I suppose, IRL you maybe don't want way too many

#

how many do you plan to have?

tough abyss
#

4

hollow lantern
#

@winter rose thanks, works. The final result is sqf thisList findIf {_x isKindOf "AIR" && [west, side _x] call BIS_fnc_sideIsEnemy} !=-1

still frost
#

Would anyone be able to help me with a script?

cunning crown
#

You'd need to ask a question first otherwise we will not be able to do so Β―_(ツ)_/Β―

loud python
#

Does anyone here know how I can get playSound3D to work with a custom sound file in the scenario folder?

still frost
#

Basically I'm creating a Scenario and I have a vehicleChat script in a Trigger but no matter which unit says the line, it's always "Driver"?
I'd have 2 Units called sur1 and sur2 but they both come up as Driver, even tho they'd both be sitting in Passenger seats?

#

My Trigger has, ' vehicle sur1 vehicleChat "I can't imagine how chaotic the cities are."; '

#

And no matter which seat "sur1" is in, it always comes up as Driver?

winter rose
#

@loud python try getMissionPath

#

@still frost driver vehicle sur1

loud python
#

@winter rose Thanks a lot man

#

I had just found a workaround, but it was very ugly πŸ™‚

#

this one is much nicer

still frost
#

@winter rose If i put driver at the front, nothing shows up.

winter rose
#

@still frost what exactly do you want to achieve?

#

Ah, the text displayed on "vehicleChat"

That I don't know.

still frost
#

@winter rose for an example I'll have two triggers one with ' vehicle sur1 vehicleChat "So are we gonna pick him up?" ' and the other ' vehicle sur2 vehicleChat "If he's still alive, yes." ' Now sur1 and sur2 are both in passenger seats but they both come up as "Driver" or "Pilot" in helicopters for some reason?

winter rose
#

don't "vehicle" them, just unit use unit names?

#
sur2 vehicleChat "blah"
```  @still frost
still frost
#

@winter rose I've tried that and it comes up with an error.

winter rose
#

…what would be the error?

still frost
#

Missing ;

winter rose
#

…then add a ;

still frost
#

Even with that, it doesn't work unless I put "vehicle" in it

winter rose
#

that's your full code?

still frost
#

And I'd use this script last year and it would show the appropriate seat, the code must've changed since the last time I used it?

winter rose
#

try 0 = sur1 vehicleChat "blablabla" then

No, there is a mistake most likely on your side here

still frost
#

Probs, my full code is - vehicle unitname vehicleChat "texthere";

#

@winter rose I'll try your 2 codes again the next time I get on ARMA 3.

#

Thanks for your time tho, hopefully it works out.

winter rose
#

ah, I thought you were trying in parallel

#

I just tried in Eden, it doesn't bring up any errors but it doesn't do anything @still frost

vehicle player vehicleChat "blah" works, player vehicleChat "blah" doesn't

still frost
#

@winter rose basically I want it to Display the right seat the Unit is saying the line from instead of it displaying Driver.

winter rose
#

I get that, but I can't get it to work

#

sideChat works

still frost
#

@winter rose I reckon these new updates must've changed something?

winter rose
#

I have absolutely no idea - I didn't use this command since OFP

still frost
#

Yeah, I have no problems with Group, Side or Global chat....Vehicle chat is where my issue is at

winter rose
#

time to kbTell…

exotic flax
#

Note: Object parameter must be a vehicle, not a player.

Note: If you are in a crew seat (i.e. driver, gunner or commander), then it will include that role in the chat name output (Eg: Driver (you_name): "Message").

Uhm... the wiki explains exactly how it works...

#

Lou... Y U NO READ WIKI?

winter rose
#

I am WriteOnly

exotic flax
#

lol

winter rose
#

also, I am on mobile πŸ˜„

#

was*, until I remote controlled my PC

still frost
#

@exotic flax I've been following the wiki all this time and it still displays Driver for everyone

#

Unless I'm doing something wrong? @exotic flax

winter rose
#

you can't have it working how you would want

#

Time to use vehicleRadio @still frost

#

You can use it if you define entries in CfgRadio, even without sound

still frost
#

@winter rose alright, I'll give that a geez. Would you also know how to make the text white? To make it look like it's proximity chat instead of using "globalChat" and it displaying the faction.

#

If not I'll just stick with globalChat

winter rose
#

white = globalChat, else you should create a custom channel

still frost
#

@winter rose wouldn't know how to create a custom channel....I'm just a very basic Scenario creator.

winter rose
#

neither do I, but we can check together on the wiki πŸ™‚

still frost
#

@winter rose Singleplayer

winter rose
#

perfect, so all you need is create→send→done

#

(and also add units that should send/receive to the channel, of course)

still frost
#

@winter rose cheers, I'll see if I'm capable of creating a channel πŸ˜…

winter rose
#

it seems to be no big stress really - we're behind ya :p

hollow gate
#

thanks @opal mulch your a life saver

#

Hi everyone I am having a scripting issue

#

I need help lol

#

anyone here a scripting guru?

young current
#

just write what your problem is and someone might answer if they know how to help

hollow gate
#

target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
sleep 180;

#

thats my current code

#

the issue is I want it so when the player goes through the trigger the targets pop up which they do ,great

#

BUT

#

I need it so that the trigger cannot be activated again for a time so that more than one player can pass through the trigger without setting it off after it has already been activated

#

otherwise the targets keep coming back up

young current
#

I recall triggers can be set to have custom cooldown

#

the sleep at the end of your code is unnecessary

winter rose
#

that or a global variable

hollow gate
#

no cool down

#

count down and time out

#

time out from what i understand is a time required for the trigger toactivate

#

as in a player must stand in it for said seconds

#

before it activates

winter rose
#

in init.sqf: JMCD_targetUp = false

condition: !JMCD_targetUp

onAct: ```sqf
JMCD_targetUp = true; 0 = [] spawn { sleep 180; JMCD_targetUp = false };

hollow gate
#

this might be stupid BUT

#

target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
target1_targetUp = true; 0 = [] spawn { sleep 180; JMCD_targetUp = false };

#

like that?

#

shit wait

#

target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
target1_targetUp = true; 0 = [] spawn { sleep 180; target1_targetUp = false };
target2_targetUp = true; 0 = [] spawn { sleep 180; target2_targetUp = false };
target6_targetUp = true; 0 = [] spawn { sleep 180; target6_targetUp = false };
target5_targetUp = true; 0 = [] spawn { sleep 180; target5_targetUp = false };

#

like this?

winter rose
#

why not use the same var?

hollow gate
#

?

#

sorry

#

I do not understand scripting very well sit

#

sir**

opal mulch
#

he's making a range of popup targets and he wants them to pop back up after a delay

hollow gate
#

and target1 animate ["terc", 0];
target2 animate ["terc", 0];
target6 animate ["terc", 0];
target5 animate ["terc", 0];
target1_targetUp = true; 0 = [] spawn { sleep 180; target1_targetUp = false };
target2_targetUp = true; 0 = [] spawn { sleep 180; target2_targetUp = false };
target6_targetUp = true; 0 = [] spawn { sleep 180; target6_targetUp = false };
target5_targetUp = true; 0 = [] spawn { sleep 180; target5_targetUp = false };
didnt work

#

well kind out

#

of

#

currently

#

they pop up just fine on the trigger

#

BUT

#

I need it so that the targets do not pop up again for a few minutes giving the rest of the group of people time to move in past the trigger

#

without setting off the trigger

winter rose
#

use the global var, and use it as a condition for trigger

hollow gate
#

this is for a MP mission so i cant just use variable names and have certain characters set it off

#

can you give me an example?

winter rose
#

this && JMCD_targetUp

#

(can't right now ; maybe someone else)

hollow gate
#

Condition:
this &&target1_targetup
I believe the issue with that is the targets all start in the down position to begin with

#

otherwise that might work

#

they pop up as you get close

winter rose
#

by themselves?

hollow gate
#

I have a script in the init.sqf that does that for me

winter rose
#

you can script the "cooldown" in it yes

hollow gate
#

thats all i need but im not sure how

#

there is only count down and time out in the triggers options by defauklt

winter rose
#

if you are using scripts, you don't really need triggers

hollow gate
#

the triggers make the targets pop up

#

the script simply makes it so they spwan in the downed position

#

spawn**

winter rose
#

right-click β†’ edit message :p

hollow gate
#

ty

still forum
#

or just arrow up

winter rose
#
  • server-only trigger
  • init.sqf (or initServer.sqf):```sqf
    TAG_trainingStarted = false;
- trigger:
    **condition:**```sqf
this && !TAG_trainingStarted```
    **activation:**```sqf
/* raise all targets */ TAG_trainingStarted = true; 0 = [] spawn { sleep 180; TAG_trainingStarted = false; /* lower all targets */ };```
#

@hollow gate ^

opal mulch
#

he wants all popup targets to have different triggers because it's a range in which you walk through and the targets are popped up when you're close

#

I like how cleanly you write your messages btw

hollow gate
#

it does make it easy to follow πŸ˜„

winter rose
#

thanks, I learnt at school d-:

#

j/k

hollow gate
#

yes I have multiple triggers though

#

so would I need a script in the init for each group of targets then

winter rose
#

something like that

still forum
digital jacinth
#

i would like pt use the statemachine for a few things, however i am lazy and would prefer a graphical editor