#arma3_scripting
1 messages · Page 729 of 1
FSM Editor can compile to standard SQF
ah right, with a different template, you're right
then it does state machine on IFs/Switches or smth like that 
it can, the editor just provides a useful abstraction and the engine's fsm evaluator expedites execution
i could see it being useful to compile it to SQF if you wanted to have event based transitions instead of polling though
these days since A3 SQF has those associative containers you would probably use one of those for a transition table instead of if/switch
when processing event E for current state S, look up transition T for key (S, E) in the transition table. if the key exists perform the transition
can I not use createVehicle with "Logic"?
as in, "Logic" createVehicle position player
you can, but it may be wrong depending on what you want to do with it
logics need group iirc
so createUnit
seems like that was the problem, thanks 😄
i tried them, they don't seem to fire reliably :/
You could try a distance check. If a vehicle is within 0.01 metres, and moving, and the person isn't in the vehicle, there has probably been a collision. Still some risk of false positives but probably less than the other method.
Not sure if it works like that, I guess it doesn't.
But I don't think I tried.
I know in my looting script (which I made this for) I just went for "looted a weapon" message, because I couldn't detect which body the weapon belonged to
yeah it doesn't
I thought you meant it was gonna work with that as well 
is there a config flag in cfgAmmo that's responsible for whether it explodes when you setDamage 1 it?
I suspect that is controlled by the simulation type
hmm broadly what explodes, grenades?
and then shells don't?
well i guess that's just a cfg crawl
thanks
In Wasteland, How do I add Backpacks to spawn on vehicles?
Hi, I'm trying to get a vehicle by a variable name, however I have the name as a string and don't want to hard code it how can I get an object/vehicle by it's name I've tried missionNamespace getVariable _name, but this didn't seem to work.
Anyone know a script for like cinematic camera? I want to put a camera over a vehicle or object and have it pan for briefing.
it should work, where do you assign it?
I assign it in editor
yeah, so it should work fine, try checking if _name is the varname you want, e.g. systemChat str [_name]
alright
@copper raven Sorry for the @, so with some investigating I found out that getVariable is working fine. My issue is getting the name of the vehicle the player is currently in currently trying to do it via this```sqf
_vic = vehicle _player;
if(_vic != _player) then {
_name = (_vic call BIS_fnc_getName) + "_1";
};
It is replying just "_1"
It worked thank you very much
Why not have a on death eh for the unit and use setVar on the weapon to mark the weapons owner
- Units drop their weapons when they die; at the time of checking with the EH, the weapon may no longer be in the unit's possession, so the original problem remains - but this problem is eclipsed by:
- Weapons aren't unique objects and don't really support things like setVariable; you'd have to setVariable on the container it resides in once dropped, but then the original problem remains.
Maybe on a check damage eh check to see if the unit will die and if they do so delete the weapon and create another inside it’s own container
anyone using the github action arma-actions/sqfc@latest ?
Is this the right channel to ask about my music scrip problems?
#arma3_config I’d say bc it’s mostly cfgMusic for putting music into the game
okeay
That really depends on whether the problem is with the config, or with a script that simply references the configured music.
Well i would assume its the script but my ARMA editing experience is mediocre at best so it could be anything.
well heres my problem, everytime i try getting this thing to work i get an error message telling me "Sound Russi not found". (please excuses these very childish names)
The "Pog" sounds so far is all good but it doesnt play when i try to activat it via addaction
my script goes as follows
{
sounds[] = {pog,music};
class 01
{
name = "pog";
sound[] = {"music\pog.ogg", db+10, 1.0};
titles[] = {0,""};
};
class 02
{
name = "russi";
sound[] = {"music\russi.ogg", db+10, 1.0};
titles[] = {0,""};
};
};```
The pog sound used to work before i tried to squeeze the russi sound in there.
so!
1/ that's not a script, that's a config 😉
2/ you are defining Musics (CfgMusic) so use playMusic
3/ the name to be set is class 02 → class Russi
see https://community.bistudio.com/wiki/Description.ext#CfgMusic
class CfgMusic
{
tracks[] = {};
class pog
{
name = "My Music - pog";
sound[] = {"music\pog.ogg", db+10, 1.0};
};
class russi
{
name = "My Music - russi (this is only a display name";
sound[] = { "music\russi.ogg", db+10, 1.0 };
};
};
@torn wing
As well as what Lou said, don't forget to restart the Editor after adding new sound/music files to a mission that you currently have open in the Editor.
ayy thx, ill try it out
just saving/loading should do 🙂
Unfortunately i still get the error and as expected it doesnt work
What do you have as CfgMusic now, and what's the script you're using to call it?
I copy pasted that... and my Scripts to call it are as follows:
c1 addAction [ "For Russia" , { ///variable name c1
c1 say3D [ "pog", 300, 1];
} ];```
Well say3D uses CfgSounds, not CfgMusic, so there's your problem
nice
this where the script kiddies are?
....Do you have a real question or are you just here to dispense random disparaging remarks?
i would assume the later
Oke ive backtracked a little and i got it kinda working, it looks like this now. Last question how do i get the other sound in there as well, everytime I try it it spits out an error message.
{
sounds[] = {};
class russi
{
name = "russi";
sound[] = {"\sounds\russi.ogg", 300, 1};
titles[] = {0,""};
};
};
...What does the error message say?
description.ext, line 16:'/CfgSounds.':{' encountered instead of '='
As i am hot garbage with this kind of stuff it looks like that
{
sounds[] = {};
class russi
{
name = "russi";
sound[] = {"\sounds\russi.ogg", 300, 1};
titles[] = {0,""};
};
{
name = "pog";
sound[] = {"\sounds\pog.ogg", 300, 1};
titles[] = {0,""};
};
};```
You're missing a class pog
So I'm sure this a question that's probably been asked to death but is there a way to disable random eyewear from appearing as a blanket thing across the board? Or is the only way to do so to make my own faction and then do it through that?
I read on the forums that there's a way to remove all glasses as units spawn in but I haven't been able to get it to work so I'm guessing that method doesn't work whatsoever
Youre the best! Thx for the help guys!
It should indeed be possible to use removeGoggles for that, but it may get a little complicated.
How are the units that you want to remove goggles from spawned? Are they placed in the Editor, spawned via script or spawned by Zeus?
They're spawned through a script, I'm particularly trying to remove goggles in a Random Infantry Skirmish mission right now, but I am looking for solutions across the board so I can do this with all of the missions that I play
How does the script create the units? Does it use BIS_fnc_spawnGroup or does it use createUnit directly?
So, I'm trying to figure out these Multiplayer Server Commands. I'm testing it with a friend on an MP mission (not dedicated server) by using chat only for now. Does anyone know why banning won't work?
https://community.bistudio.com/wiki/Multiplayer_Server_Commands
#kick name //works
#kick "name" //works
#exec kick name // does not work
#exec ban "name" //does not work
#exec ban name //does not work
#ban name //does not work
#ban "name" //does not work
Does #exec ban UID work?
no
Both #exec ban "123" and #exec ban 123?
Unfortunately the documentation for server configuration and administration is a bit lackluster and has not been maintained as much as other topics 
Have you asked in #server_admins?
Some of these commands probably don't work because it's not a DS
Possible, but i'd love to know which ones do
There seems to be nothing on the wiki about this
I would posit that you can simply try all of them, and if it doesn't work, now you know
Maybe I'm doing something else wrong and i don't have access to a dedicated server as of now to rule that out
So , I got a script for making a helicopter fly to you, pick you up and take you to a "base" on green smoke. It works perfectly well for me, but I gave it to someone and it's not working for them, even though they have put it all in correctly.
Does anyone know why this could be?
Any one know the return of alive _object if its been deleted vs killed?
Many reasons, though without looking through the script its difficult to pinpoint the issue
It's false for both cases. Deleted objects become objNull and alive objNull is always false.
this is the script
_shooter = _this Select 0;
_ammotype = _this Select 4;
//hint format["%1",_ammotype];
sleep 2;
switch (_ammotype) do
{
case "SmokeShellGreen":
{
Hint "Helicopter Inbound";
_wp0 = group Heli1 addWaypoint [ getpos player, 50];
_wp0 setWaypointType "MOVE";
_wp0 setWaypointStatements ["true", "Heli1 land 'land'"];
waituntil {{_x in Heli1}count units blue == {alive _x} count units blue};
_wp1 = group Heli1 addWaypoint [getpos base, 50];
_wp1 setWaypointType "MOVE";
_wp2 = group Heli1 addWaypoint [getpos base, 50];
_wp2 setWaypointType "TR UNLOAD";
_wp2 setWaypointStatements ["true", "Heli1 land 'land';"];
};
case "1Rnd_SmokeGreen_Grenade_shell":
{
Hint "Helicopter Inbound";
};
case "FlareGreen_F":
{
Hint "Helicopter Inbound";
};
case "3Rnd_SmokeGreen_Grenade_shell":
{
Hint "Helicopter Inbound";
};
case "UGL_FlareGreen_F":
{
Hint "Helicopter Inbound";
};
case "3Rnd_UGL_FlareGreen_F":
{
Hint "Helicopter Inbound";
};
};
It's coming up at line 18 which is an issue for them
so the "waituntil {{_x in Heli1}count units blue == {alive _x} count units blue};"
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
altho it's so long you might wanna use sqfbin.com
//this addEventHandler ["fired",{_this execvm "detect_smoke.sqf"}]
_shooter = _this Select 0;
_ammotype = _this Select 4;
//hint format["%1",_ammotype];
sleep 2;
switch (_ammotype) do
{
case "SmokeShellGreen":
{
Hint "Helicopter Inbound";
_wp0 = group Heli1 addWaypoint [ getpos player, 50];
_wp0 setWaypointType "MOVE";
_wp0 setWaypointStatements ["true", "Heli1 land 'land'"];
waituntil {{_x in Heli1}count units blue == {alive _x} count units blue};
_wp1 = group Heli1 addWaypoint [getpos base, 50];
_wp1 setWaypointType "MOVE";
_wp2 = group Heli1 addWaypoint [getpos base, 50];
_wp2 setWaypointType "TR UNLOAD";
_wp2 setWaypointStatements ["true", "Heli1 land 'land';"];
};
case "1Rnd_SmokeGreen_Grenade_shell":
{
Hint "Helicopter Inbound";
};
case "FlareGreen_F":
{
Hint "Helicopter Inbound";
};
case "3Rnd_SmokeGreen_Grenade_shell":
{
Hint "Helicopter Inbound";
};
case "UGL_FlareGreen_F":
{
Hint "Helicopter Inbound";
};
case "3Rnd_UGL_FlareGreen_F":
{
Hint "Helicopter Inbound";
};
}; ```
apologies
how did they set it up?
Made a text document, renamed it and changed it to a .sqf and then pasted the code in
There's another section that needs to go in the players init box but the game was flagging the file as broken
you mean script not found?
if so, tell them to enable file extensions in Explorer
the script was found, the game was flagging line 18 as broken
give me the exact error
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files
To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
just curious since i havent seen it, is blue referencing blufor units?
or it a group variable name
if so they didn't run the script scheduled
var name
it should be a group
waituntil {{_x in Heli1}count units blue == {alive _x} count units blue}
this is several times faster:
waituntil {units blue findIf {alive _x && !(_x in heli)} < 0}
ok, I've asked them to get the RPT log
sorry for the wait
they're gonna have a look for it now
trying to get the owner of laser targets
_laser = nearestObjects [vehicle player, ["laserTarget"], 2000, true];
_shotParents = getShotParents _laser;
hintsilent str _shotParents;
someone suggested getshotparents but that dosent seem to work
that's wrong
_laser is an array
_laser #0 = nearestObjects [vehicle player, ["laserTarget"], 2000, true];
_shotParents = getShotParents _laser;
hintsilent str _shotParents;
?
still wrong
_laser = nearestObjects [vehicle player, ["laserTarget"], 2000, true];
{
_x params ["_laserV"];
_shotParents = getShotParents _laserV;
hintsilent str _shotParents;
} foreach _laser;
```?
still dosent work with lasers
what do you get?
[]
That dosent seem to work any other suggestions?
so the laser has a name of
[17c2c9e6080# 285: lasertgt.p3d]
sorry for the wait https://sqfbin.com/ahudahedafutepuzolug
That file is incomplete
Also I don't need the whole file
Just the error
Just search for error in the file
the only thing i could think of is to check all units to see if they have a laser using lasertarget
damn ok. they're offline again so I'll get it to you when I can, sorry for the messing you about
How hard to check player nickname by a list on joining and to kick player if he is a list? I meant nickname exactly. Not UID. I want to prohibit joining server for users with Windows default usernames like Admin, User of something like that...
if (_unit configFile isEqualTo (configfile >> "CfgVehicles" >> "B_Helipilot_F")) then {
How do I write this if statement which intend do compare the configFile of a unit against a preset unit class? (configfile >> "CfgVehicles" >> "B_Helipilot_F")
typeOf _unit == "blablabla_classname_f"
It worked! Thanks a lot! 🙂
How can I put those icon-like picture thingies in a hint?
disregard this, i sometimes forget google exists
however, here's a question i could not find the answer to on google (or idk how to)
how can i make text bold and add bulleting to it in a hintC?
look here https://community.bistudio.com/wiki/Structured_Text and use parseText
does anyone know how to make a script execute every 15 seconds or so?
and if so would it be compatible with the EU 0A-0D and USA 02 zeus servers?
USA 04 also has scripting enabled. And you would just have a scheduled process with sleep 15. Not sure if sleep is allowed on public zeus, you'd have to try it out
Another question... how can I get the zeroingIndex in currentZeroing?
According to the BIKI, this is what the command returns:
Array in format:
0: Number - Distance
1: Number - zeroingIndex
0 ≙ 50 m
1 ≙ 100 m
2 ≙ 150 m
...
However, I only get theDistance?
_wepZeroing = currentZeroing player;
//some irrelevant code
player setWeaponZeroing [(primaryWeapon player), (currentMuzzle player), _wepZeroing];
This sets the zeroing to 2400m when it's supposed to set it to 400m.
object setWeaponZeroing [weaponClass, muzzleClass, zeroingIndex];
And zeroingIndex over here, only wants the index, so when it gets a value of 400 over there I assume it sets the zeroing to the max possible value in game.
tl;dr - how do i get the index of the array and not the distance
object currentZeroing [weaponclass, muzzleclass]
no i mentioned those 5 servers because the rest only allow specific executables to stop server crashes but the ones i mentioned allow every executable
isnt it the same 
i would say so, but currentZeroing object just seems pretty ambiguous
also im new to scripting, would this work for refilling a vehicles ammo every 15 seconds then?
sleep 15 _vehicle setVehicleAmmo 1;
you'll need to put it in a loop
how would one do that?
thanks for the help
make sure you execute it where the vehicle is local
lol i saw that bt, was wondering if parentheses were allowed now
yeah lol, i forgot arma wants them curly brackets there
makes no sense that if get parentheses but not while
@willow oyster edited this, make sure to change the () to {} at the while
just tested, doesnt seem to work
is it because i replaced _vehicle with the variable name of the vehicle?
shouldnt be
Where are you running it?
did you execute it where the vehicle is local
u didnt straight up put condition where it says condition, right?
im putting it in the init of the vehicle and yes i did put condition there because i have no fucking idea what im doing
That's not gonna work
init is unscheduled
as for the condition part
condition is for when u want the while to trigger
i suck at explaining
but in other words
im trying to make compositions for pub zeus
[] spawn {
while {true} do {
sleep 15;
_vehicle setVehicleAmmo 1;
};
};
i am dumbass
while {alive player} do {
sleep 15;
_vehicle setVehicleAmmo 1;
};
this will only go through the loop while the player is alive
the example above mine will trigger every time since the condition is always true
like i said, i suck at explaining
Yup, need the spawn thingy to make the sleep work though
you can also make the vehicle have infinite ammo using event handlers, which seems like what you are trying to do
yeah, was just making clear on what to put at the condition part cause he straight up put condition there
yeah but im trying to make it happen every 15 seconds so players cant just make missile swarms
even if it would be funny as hell
ok. the issue with the code above is locality
once another player gets in the vehicle, the code will no longer work, because the vehicle will be local to the player. Therefore setVehicleAmmo will need to be ran from the player's client. Im like 99% sure
https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality this is a quick read of what im talking about
[this] spawn {
_vic = _this#0;
while {!isNull _vic} do {
sleep 15;
[_vic,1] remoteExec ["setVehicleAmmo",_vic];
};
};
try that
ok that works
i just made a few corrections, but that code should be final
where did you get this info?
fucking around alot
and also dwardens list in pins of #zeus_discussion
those pins include USA 04
oh shit time to add that to the favorites list
finally, i have all the zeus script servers
but i will probably never use any of the EU ones except 0B
for me it really just depends on player count. I dont care about ping so ill join any scripting server with people already in it. You see some interesting stuff
EU 0A is locked on recruit and EU 0C and EU 0D are locked on vet
oh
also the EU ones are testing servers so dont be surprised if someone has a non-zeus mode running on it
unlawful if you wanna do some shit imma be on USA 02
probably not tonight, pretty busy when im not checking discord. Youll probably see me around at some point though, my steam is the same is my discord
I know there's an event handler for respawn but does it also trigger "killed" if you do hit respawn?
Not really sure what you're asking. "Killed" should only trigger when the unit's health reaches 0
But if you hit respawn your unit dies
He's asking whether or not the "Killed" EH triggers when you respawn.
Since you apparently die when you do it or w.e
Do you know why a createdVehicle reference is different on a dedicated server? _unit = createVehicle ["ACE_Box_Ammo",[_xx,_y,_z]]; clearItemCargo _unit; clearMagazineCargo _unit; clearWeaponCargo _unit; works locally but on a dedicated server it doesn't. The box still has items inside.
idk about clearItemCargo but clearMagazineCargo and clearWeaponCargo have local effect. Use the global variants instead. clearItemCargoGlobal clearMagazineCargoGlobal and clearWeaponCargoGlobal
it does make sense if you read the wiki. while takes code. if takes boolean.
and the reason is probably to make something like do-while loop
if get parentheses
ifdoesn't need parenthesis. the condition might if it has lower precedence thanif
and the reason is probably to make something like do-while loop
The reason is that the condition needs to be checked more than once
yes true
now what is the reason why while does not have its own grammar? 😛
waste of time
perhaps if you're not interested in making the language optimisable anyway
I don't understand that relation?
question. when nailing the player to an object like a tank via attachTo .. is there any way to preserve the ability to look around? currently my view is frozen to the front.
it's not precisely necessary for while to have its own grammar, but if you are going to build a control flow graph it's much easier if loops are a first class member of the language
you might be able to look around (hold ALT) but not turn
nah, can't even look around with alt
I doubt that, as attachedObjects simulation is somewhat converted to whatever they are attached to, which I believe is the result of limitation to camera(pretty much the same effect on disabled simulation). And I doubt it would be possible to preserve the ability at all unless attachTo itself gets an upgrade which I believe would be a dream at this point. I guess your only way would be setPos spamming in onEachFrame or shifting to some invisible player instance or usage of camera of "an object like a tank" if suitable.
It would be cool if there was a placeable "turret" that was just an invisible FFV seat for attaching to things. That would open up a lot of possibilities without needing new mechanics. Sadly unlikely to happen though.
create an invisible vehicle with the seat and attach that to the visible vehicle
Error Type Number,Not a Number, expected Number
anyone knows what that means?
happens in a mission on a dedicated server, for just one player
you have a NaN somewhere
_unit setHitIndex [_hitPart select 1, _damage]>
12:06:49 Error position: <setHitIndex [_hitPart select 1, _damage]>
12:06:49 Error Type Number,Not a Number, expected Number
12:06:49 File mpmissions__cur_mp.Altis\AIS\Damage\fn_handleDamage.sqf..., line 187
12:06:49 Error in expression <};_damage = _damage min 0.89;
is it _damage or _hitpart select 1?
im v rusty in arma sqf, wrote a lot in arma2 times , n only maybe thousand lines in arma3 but thats also like 5 years ago
hm can HandleDamage restun a NaN ?
not my mission, but i been told that the loaded mods of the affected player are the issue and not the mission, the error happens on the server tho, and we all have the same mods + hashes
imma go read line for line
if _hitPart select 1 is not well defined, this is the issue
e.g _hitPart being an empty array 👀
maybe the mission could do a better script check
does indexing out of bounds not give zero divisor in A3?
is it _hitpart select with the NaN result?
only after n+1
i just checked a few lines above it
it doesnt fail already at
_damage = (_hitPart select 2) + (_new_damage * AIS_DAMAGE_TOLLERANCE_FACTOR);
see KK's note here
https://community.bistudio.com/wiki/select#Notes
yes, select N does not give any error though
lemme check license of direct action, maybe i can post the sqf
then check _damage value idk 😬
Please do not modify and / or re-upload this mission without permission in any form on Steam or elsewhere.
nah
how does arma3 behave with special case floating points in arithmatic
NaN +2 valid?
nan * 2 valid?
why not
is there a IsNaN ?
or can i do if damage == NaN ?
dont find more about NaN than https://community.bistudio.com/wiki/NaN
you said you couldn't modify the scripts?
the ideal way is to prevent a NaN value
https://community.bistudio.com/wiki/finite
But in case you dont want ideal way.
for now i would just check if damag is nan then set it to 1 at the end
and add logs to add which line in changes from a finite number to nan
thanks
vurtual's seat mod does this https://steamcommunity.com/sharedfiles/filedetails/?id=1381327410
[pHolder_wp_grpCharlie_1,pHolder_wp_grpCharlie_2,pHolder_wp_grpCharlie_0]
why is ARRAY sort true leading 0 to be the last one here?
or is sorting of entities based on something else?
wut? This looks an array of objects
it does not care about what is the var name of the objects when sorting them.
so order of placement in editor/creation via sqf?
or address
I would not expect any sensible sort order when sorting array of objects.
String, Number or Array - otherwise, use BIS_fnc_sortBy and sort by vehicleVarName 😉
ty
is it possible to script set RTD states (like collective, rpm) by script while in standard flight model?
no
Such is life
Does anyone know why the zeroing is not being set properly?
_wepZeroing = player currentZeroing [(primaryWeapon player), (currentMuzzle player)];
player removeWeapon (primaryWeapon player);
if (332350 in (getDLCs 1)) then {
player addMagazine "10Rnd_338_Mag";
player addWeapon "srifle_DMR_02_camo_F";
player addWeaponItem ["srifle_DMR_02_camo_F", "optic_LRPS"];
player addWeaponItem ["srifle_DMR_02_camo_F", "bipod_01_F_blk"];
player addWeaponItem ["srifle_DMR_02_camo_F", "muzzle_snds_338_black"];
} else {
player addMagazine "20Rnd_762x51_Mag";
player addWeapon "srifle_EBR_F";
player addWeaponItem ["srifle_EBR_F", "optic_LRPS"];
player addWeaponItem ["srifle_EBR_F", "muzzle_snds_B"];
player addWeaponItem ["srifle_EBR_F", "bipod_01_F_snd"];
};
player setWeaponZeroing [(primaryWeapon player), (currentMuzzle player), (_wepZeroing select 1)];
player selectWeapon (primaryWeapon player);
And by not being set properly, I mean not being set at all.
It works if I do it separately, but not in the example above.
because you're using currentMuzzle
both are wrong
setWeaponZeroing requires it
get the correct muzzle
sure, but it's not current
the current muzzle 
isnt the current muzle the one i need 
no
the muzzle you intend to set zeroing for
Can I parseText inside a hintC? Cause I can't seem to get it working (works the same way on a hint).
the second syntax supposedly supports structured text:
why it is not work? I run this command at dedicate server
InitServer.sqf
_name = "test";
serverCommand format ["#kick %1",_name];
what are you trying to do?
kick player
why are you doing it in initServer?
If you execute it in initServer.sqf, it will be run immediately as soon as the mission gets past the slotting screen. If the player isn't connected at that time, it won't do anything. It also won't do anything if there isn't a player named "test".
You can use remoteExec to tell the server to do things, whether it's directly executing the command, or just running a script that contains the command.
And how about that?
if ( !isNil "A3UA_blacklisted_names" ) then { addMissionEventHandler [ "PlayerConnected", { params [ "_id", "_uid", "_name", "_jip", "_owner", "_idstr" ]; if ( _name in A3UA_blacklisted_names ) then
hint format [ "Prohibited nickname %1!! Change your nickname and join again.", _name ]; serverCommand format [ "#kick %1",_name ];
diag_log format [ "Player %1 was kicked out of server. NickName %1 in Prohibited list.", _name ];
};
}];
};
This script also doesn't kick the player but posted a diag message about player was kicked.
Is that EH being added on the server? If it's only added on a client it won't work.
Have you tried using _idstr to kick? There could be something weird about the name that's breaking it.
Also try changing it to
serverCommand (format [ ... ])``` to ensure everything is done in the proper order.
Thanks, will try. This running only on a server side
No, doesn't works too...
@fair drum I don’t really know where to start. Like if I have a trigger set to activate when a player walks in, and for the script to know which player. I’ve also tried to do this with addAction, but don’t know what to do. :/ someone in the past told me to use _caller but that didn’t do anything
Also try changing it to
serverCommand (format [ ... ])
they're both unary commands, and format executes first
_caller doesn't exist by itself
you should fetch it from addAction args
As I can see from logs and from the game - hint and serverCommand aren't works
Which arg is it, and would it also work for a trigger?
I’ll take a look thank you 🙏
in that order iirc
He's particularly telling you look at what params does
I'm at work so I can't help until later.
Ok
@little raptor so in the sqf with the addaction I can use _caller if I define it in params of addaction?
yes
Thanks!
Alright so I'm using this below to make peoples screens go black: ```sqf
titleText["","PLAIN",-1,true,true];
Note: I've only tested on my own currently in player hosted MP
using remoteExec
how does this method know who's screen to make go black.
it affects whichever clients you execute this for
Is it somehow possible to get rid of the bulleting/dots/whatever in hintC (alternative syntax)?
maybe you should create your own GUI... 
thats way to much work for one hint
actually it's very easy if you know what to do
instead of spending hours figuring out what to do when vanilla GUI doesn't behave
I've never done it so idk if ill know what to do
i'll give it a try i guess
Another question, can you have an advanced hint pop up in a scenario (not a campaign or whatever)?
If yes, where do I define it? The description.ext?
yes
neat
response to your question is included in the article you've linked.
missionConfigFile is description.ext
@meager epoch yeah literally:
(so mission/campaign specific hints are possible).
i thought it means a hint for like the whole campaign or certain missions within it 
BIS_fnc_guiMessage is far superior to hintC.
How can i change position of chat by script?
why is the sound not playing? i play it via playSound, but nothing happens (btw, if it helps anything... the title shows up in triggers, though it cant be played from there as well)
class CfgSounds {
sounds[] = {};
class ss_paperTaking {
name = "Taking Paper";
sound[] = {"sounds\s_paper.ogg", 1, 1};
titles[] = {};
};
class ss_laptopTyping {
name = "Laptop Typing";
sound[] = {"sounds\s_laptop.ogg", 1, 1};
titles[] = {};
};
};
also, the path is correct and so are the names and stuff
Are you sure volume is not too low?
What would the best way to detect when a player equips their binoculars? Is there an event handler I can use or would I need to use a loop checking the equiped weapon?
I've also got CBA running if that helps
i just set it to 10 in the cfg, nothing changed
Im just saying it cos there has been cases where people ask why it doesnt work and end up noticing their volume is too low. 😁 Also maybe because you didnt use something like db+10 etc, might be a reason why it is low, although I dont know if it causes it to be higher or lower as well.
the examples on the biki have no db and stuff, but ill give it a shot
You are saying you receive no error upon attempting to play the file, like "File not found" etc so only this case comes to my mind.
yeah, no error shows up
the title of the sound pops up in triggers
however playing it from there or via playSound does nothing
and the volume on my pc is set pretty high so i dont miss it by accident
i almost had a heart attack when i accidentally shot
yeah but arma settings is important too which was my point.
Apart from that, when you created the sound, are you sure you followed the requirements in creating the sound file?
equip as in selects them?
Yeah
you could check if the key is pressed
update, if i playSound it alone it says that the file cant be found
but the path is correct
just to be sure, this is how u play a sound right
playSound "ss_laptop";
?
you dont have s_laptop
You need to use
ss_paperTaking or ss_laptopTyping
wait nvm im retarded
one sec
yeah, says NOID <no shape>
for playSound "ss_laptopTyping";
and the other one
When you created these sounds, did you follow the requirements indicated as in link?
#arma3_audio message
oh
i have no idea, prob not tho
didnt know those requirements exist
thanks, ill retry now
Although the return value shouldnt be affected by this
but I dont know what it is supposed to return in this case either.

If that doesnt solve, I can only suggest you to visit #arma3_audio unless there is something wrong in config, which I cannot really see(It wouldnt appear in trigger's sound list anyway if it had been wrong apart from file destination). And you are saying you do not receive file not found error (which should appear only on 1st attempt per mission, you are not missing it somehow by any chance, do you?
)
i dont think i am 
Did you try adding db+10 on it ? 
Disclaimer: I cannot be held responsible for any sort of temporary or permanent ear damage or other sort of damages after test. 
ye, nothing
Could I have some help please
yes
Basically I’m trying to use unit capture to make a helicopter fly and I keep getting an error saying flying.sqf not found
Playing "Alarm" gives the same result so there is no issue with return value apparently.

It just says script flying.sqf not found
is ur path correct?
My path ?
ur path to the flying.sqf
Ye I’m pretty sure
how do u exec the flying.sqf
What should it be
you tell me 
@meager epoch I just believe, the requirements I mentioned is your issue at this point, dont really see any other thing here for it not to work
yeah, i'll play with it
at the end of the day, ill just slap that to cfgMusic and be done with it 
You would probably hit the same wall if that is the case.
i already have cfgmusic and its working
Do you know anything about my issue ?
It is not really welcomed to randomly ping people in here as people who knows anything will surely help you if they can.
No, I am afraid I have no idea how even unit capturing has any relation with a random flying.sqf file.
I just assume you use something non-vanilla and that is out of my bounds.
wdym non-vanilla
There is an advanced unit capture out there somewhere which people tend to use instead of vanilla unit capture.
oh, didnt know theres another way of doing that
Well, I would just write my own anyways if I ever needed such thing so yeah I never tend to look for such things either.
Hi everyone!
How can I add a Virtual Garage in a specific place (such a heli pad) by script? I'm trying to use BIS_fnc_garage but always spawn vehicles about me 😦
@crude vigil i defined them in cfgMusic and it now works 
Hi sorry for the delay, this is the screenshot
https://media.discordapp.net/attachments/913624883622191144/915363536975310889/20211130160445_1.jpg?width=1202&height=676
anyone know the issue with this piece of code?
{
_x addMagazineTurret ["8Rnd_82mm_Mo_guided", [0]];
_x addMagazineTurret ["8Rnd_82mm_Mo_LG", [0]];
_x addMagazineTurret ["8Rnd_82mm_Mo_LG", [0]];
_x addWeaponTurret ["mortar_82mm",[0]];
} forEach (entities "I_G_Mortar_01_F" select {_x weaponsturret [0] == []});
Error -> {_x weaponsturret [0] |#|== []}
as already asked: how are you executing flying.sqf? execVM?
Yes
can you paste the code that you are using?
try placing entities "foo" in brackets
Do you mean the code from my sqf file or within the editor
in the editor, the part with the execVM
Ok
you mean instead of "I_G_Mortar_01_F" to replace by "foo"?
no
what is foo lol
((entities "I_G_Mortar_01_F") select {_x weaponsturret [0] == []});
"metasyntatic variable" - regards, wikipedia
entities has higher precedence than select, so should be fine. try isEqualTo instead of ==
@digital torrent
slink engineOn true; execVM "flying";
execVM "flying.sqf";
I’ll try that
Nope still saying the same thing
Where is the sqf file supposed to be
next to your mission.sqm
yep this works thanks @distant oyster and @bitter jewel
This is a good read: https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting#Script_Files
hello I have a problem on my server with the bags everyone can search them I would like to know if anyone has already had this problem?
well the error already tells you what's wrong
God that loooks very confusing.
Can I just check that I have my sqf file in the right place
C:\Users\chbon\OneDrive\Documents\Arma 3\missions\UNIT%20CAPTURE%20TESTING.Altis
This is the route
yeah. if the mission.sqm is in that directory and your flying.sqf then execVM "flying.sqf" should work
you sure you have the right mission loaded in editor?
server with the bags?
but they have put it in correctly, no spaces or caps
Positive
can you run the following command and check the returns?
[fileExists "flying.sqf", fileExists "flying.sqf.txt"]
Where am I running that sorry ?
Debug Console
I noticed 😄
😂
yes anyone can search the backpacks of other players
aaa
WhAt do I do after I’ve wrote it into the debug console
What do I press to get the result
Sorry about this mate I’m lacking in lots of knowledge
It says false false
you get buttons to run it on local (your machine), server (the machine processing the mission), and global (everyone). If you're just testing on your computer by yourself local should do it
Ok thanks mate
though if you're just checking if the file exists you would probably get a return no matter what
Well it’s says False false . I’m no genius but I’m pretty sure that means it’s not there
yeah.
Or at least it’s not seeing it
is it stored in the mission folder
Ye
can you screenshot the contents of hte folder
I'm home. figure it out?
oh you cant send a screenshot here
Hi, is there a way to get addMissionEventHandler "Map" to trigger when the map is closed instead of opened?
addMissionEventHandler ["Map", {
params ["_mapIsOpened", "_mapIsForced"];
check if _mapIsOpened is false. it says on the wiki page that it fires for both open and closed
addMissionEventHandler "Map" should work on both opening and closing.
if (!_mapIsOpened OR !_mapIsForced) then {
I do not know how to check for negative params.
Did I write it wrong?
if both are false, what does the condition eval to?
Have you enabled file extensions in Explorer?
Ye
I’m speaking to someone about it at the minute so I should be alright now thanks for all your help guys
I did for addaction but not for triggers? I’m basically trying to make a death area so if someone falls (I have ace) they will immediately die instead of getting knocked out
@fair drum
SQF variables are not case sensitive so caps or no caps doesn't matter
So they actually put the variable name into some helicopter object?
yes, as the variable for the helicopter
Trigger:
Activation - Any Player
Activation Type - Present
Repeatable - True
Server Only - False
Condition - this
Activation - player setDamage 1
oh you want to check if they go unconscious with ace first?
you can
Wait whaaaa
maybe you reassign it or something 
Whatever the reason that's what you should investigate
Find every place where you reference that var and make sure they're correct
well... evaluated independently
so player exists on the machine, and the trigger is evaluated on said machine, so it will always grab the current player in that trigger area, independent of other players
I see
Ok, thanks for you help. Have a good day
@fair drum can I send you a dm of what I’m working on I think you’d like it
i can check stuff if you want
Found a way to use
if (shownMap) then {
as a trigger for the negative.(disabling a function for me the player). I wanted a map function to be disabled for me but playable AI's.
you were fine with what you posted, i just wanted you to think
use the EH
What is the opposite of hideObject? If an object is already hidden and I try to unhide it?
hide object has true and false values, its the opposite of itself
do you mean a getter?
So it can be used as a command and for a Boolean value? Like
hideObject this; And
this hideObject true;
please look at the second syntax on the wiki
Ok
For some reason what I posted didn't seem to work in practice.
addMissionEventHandler ["Map", {
params ["_mapIsOpened", "_mapIsForced"];
if !(_mapIsOpened) then {
systemChat "Map Closed";
};
}];
Ah, I probably wrote it wrong. Thanx for the help 🙂
Hey friends, having an issue with cursorTarget and cursorObject, essentially when a player looks at an object it creates a moduled mission for all playable units. Both work locally testing in editor, but on the dedicated server won't trigger, I've tried revealing the targets also. I assume it's something to do with locality of the object and that of players, using autoinit on server so players are jip.
Any Ideas?
post your code so far. sounds like a locality problem
Just using a trigger condition
cursorObject == Task_3F_Tower;
I can tell it's a locality issue just unsure how to resolve it I've never used "cursor" before
is your trigger set to server only?
nah
where is task_3f_tower defined. object attributes?
and also, let me see the activation code as well
Task_3F_Tower = (getPos this nearestObject 1715971);
game logic module
the activation is just the trigger condition, I assumed it would work locally for each client but only trigger once on the server
is this tower something you placed down in the editor or something you spawned scripted in?
it's a map object by default, I just gave it a variable when making the mission
I do also have tasks that use units I have placed down with variables, same trigger condition different variables
you should nearTerrainObjects if its an un-editable map terrain object. its hard to tell when I can't see your whole setup though. are you running a ton of mods in a way that would make it a pain to just send the mission to me?
also, on the dedicated server, can you verify that the object variable is being stored? both locally and on the server?
or is it returning objNull
We do not need such old fashioned solutions anymore, praise the editTerrainObject module.
Probably that is how he does.
that module, in my messing with it, does not like to do locality right so I stopped using it long ago. i'll have to recheck it if it still has problems
No real unit mods, just qol sound and movement mods, but the mission should open with just 3den enhanced
Not sure how to verify if it is being stored, I assumed if there was a problem it would show in rpt
if its not dependent mods, send the whole mission file and ill take a look
this spawn {
while {true} do {
waituntil {(inputAction "defaultAction" > 0)&&(currentweapon _this == "Binocular")&&(cameraview == "GUNNER")};
pphandle = ppEffectCreate ["ColorCorrections",1501];
pphandle ppEffectEnable true;
pphandle ppEffectAdjust [0.9,0.8,0,[0, 0, 0, 0],[1, 0.75, 1, 1], [0.299, 0.587, 0.114, 0],[-1, -1, 0, 0, 0, 0, 0]];
pphandle ppEffectCommit 0;
sleep 0.05;
screenshot "";
sleep 0.05;
ppEffectDestroy pphandle;
};
};
I've got this script and someone mentioned to me that it's very inefficient and it'd be better to do in a Framehandler. How would I go about doing that?
what is _this referring to
a player? an AI?
Good night, I'm starting this part of the script and I have a doubt that for you it will be silly, there is an animation in arma3 and I would like to put a shortcut key to use it, is it possible? thank you guys
Player, sorry was downstairs making pasta
you using CBA?
Yeah
standby
something like this:
private _function = {
if (
(inputAction "defaultAction" > 0)
&&
(currentWeapon player == "binocular")
&&
(cameraView == "GUNNER")
) then {
private _pphandle = ppEffectCreate ["ColorCorrections",1501];
_pphandle ppEffectEnable true;
_pphandle ppEffectAdjust [0.9,0.8,0,[0, 0, 0, 0],[1, 0.75, 1, 1], [0.299, 0.587, 0.114, 0],[-1, -1, 0, 0, 0, 0, 0]];
_pphandle ppEffectCommit 0;
private _pic_destroy = {
params ["_effect"];
screenshot "";
ppEffectDestroy _effect;
};
[_pic_destroy, _pphandle, 0.05] call CBA_fnc_waitAndExecute;
};
};
BINOC_PIC = [_function, 0, []] call CBA_fnc_addPerFrameHandler
currently though, you have to be careful how long you hold the button down tho
as i have accidentally created a ton of screenshot in my docs folder haha
yes, look at inputAction
Ok, thanks. How do I call it?
put it in init.sqf
Takes a screenshot but the post processing isn't applied
When I was testing my old version I needed a wait after the screenshot before I disabled the post processing
hmmm it works for me, the PP is just a grey shutter effect right?
Yeah, it shows in game but it doesn't apply to the screenshot
Yup
inb4 you're capturing it with screenshot command?
mk well let me stack another delay in there lol
Yeah, I wanna make a camera thingy for recce missions
Oh yeah, it's mentioned in the original post
Thank you very much
i wonder. can you give an empty function to waitandexecute and just have the delay argument to stall? probably could
lets try it
I don't really know how CBA's stuff works
let me get some food before the think tank
Seems like we should just be able to do waitfnc screenshot
and then waitfnc ppdestroy
try this?
private _function = {
if (
(inputAction "defaultAction" > 0)
&&
(currentWeapon player == "binocular")
&&
(cameraView == "GUNNER")
) then {
private _pphandle = ppEffectCreate ["ColorCorrections",1501];
_pphandle ppEffectEnable true;
_pphandle ppEffectAdjust [0.9,0.8,0,[0, 0, 0, 0],[1, 0.75, 1, 1], [0.299, 0.587, 0.114, 0],[-1, -1, 0, 0, 0, 0, 0]];
_pphandle ppEffectCommit 0;
[{screenshot ""}, nil, 0.05] call CBA_fnc_waitAndExecute;
[{ppEffectDestroy _this}, _pphandle, 0.10] call CBA_fnc_waitAndExecute;
};
};
BINOC_PIC = [_function, nil, nil] call CBA_fnc_addPerFrameHandler
it def seems iffy, its like 50% for me
i think our timing is way too fast cause i think the screen shot command is pretty slow
How much more efficient is it really going to be doing it the way with CBA stuff?
I'd stick with keeping it scheduled for now with the loop
CBA is way better than vanilla eachFrame method though
and instead of using waituntil, just do loops. try not to use waituntils
I'll try turning the times way up and slowing bringing them back then
private _function = {
if (
(inputAction "defaultAction" > 0)
&&
(currentWeapon player == "binocular")
&&
(cameraView == "GUNNER")
) then {
private _pphandle = ppEffectCreate ["ColorCorrections",1501];
_pphandle ppEffectEnable true;
_pphandle ppEffectAdjust [0.9,0.8,0,[0, 0, 0, 0],[1, 0.75, 1, 1], [0.299, 0.587, 0.114, 0],[-1, -1, 0, 0, 0, 0, 0]];
_pphandle ppEffectCommit 0;
[{screenshot ""}, nil, 5] call CBA_fnc_waitAndExecute;
[{ppEffectDestroy _this}, _pphandle, 5] call CBA_fnc_waitAndExecute;
};
};
BINOC_PIC = [_function, nil, nil] call CBA_fnc_addPerFrameHandler
I tried turning up the delay to 5s but it still wouldn't actually apply pp
It also did not wait 5s after taking the screenshot before the pp turned off
Nvm, seem to have it working now
It does like taking 2 screenshots though
@fair drum Thanks a bunch for all the help.
Anybody know why this: sqf systemChat (name (vehicle player));
It's replying the players name regardless of if they are in a vehicle or not
What are you expecting? A vehicle never has a human name
Have you read the doc?
Well that line above is sending my players name not the name of the vehicle I am in
I'm expecting the vehicles name
That's not how. Use
getText (configFile >> "CfgVehicles" >> typeOf vehicle player >> "displayName")```
How to set a waypoint completion timer in script?
I am looking for help with writing a function that would querry the mass of all magazines in a plane and sum them up. It would then alters the plane's mass via setMass in a slow loop (ammunition is expended as a time goes). I guess I know what "fileConfig", "magazine", "getNumber" or "pushBack" do separately. I am lacking horribly to combine them together in one efficient function that does what I need it to do. Is here anyone willing to help with this?
how's the pay?
You can get A-1H flying more realistic, it's already released on SW for FREE and took me month to the shape it's currently at. I was hoped it's enough, no?
you might someone. software consulting isn't usually free though
…this channel is for free Arma scripting assistance
emphasis on 'assistance'. if it is to have it done, see #creators_recruiting of course.
Is the plane using pylons?
Yes it does
I started with something like this and was wondering if it's the right direction:
_plane = _this select 0;
_magsArray = magazines _plane;
_wpnWeight = {getNumber (configFile >> "CfgMagazines" >> _x)} forEach _magsArray;
_total = 0;
_sumMass = {_total = _total + _x} forEach _wpnWeight;
almost
_wpnWeight = {getNumber (configFile >> "CfgMagazines" >> _x)} forEach _magsArray;
// should be (IF the entry exists)
_wpnWeight = _magsArray apply { getNumber (configFile >> "CfgMagazines" >> _x >> "mass") };
but maybe vehicle ammo is not weighted, as there is no "storage" or endurance for vehicles
Hm, I just realized that pylons are probably connected with this command:
vehicle magazinesTurret [turretPath, includeEmpty]
OK, I refined the beginning of this script like this (made a change suggested by @winter rose too, thanks):
_plane = _this select 0;
_magsArray = _plane magazinesTurret [[-1],false];
_wpnWeight = _magsArray apply { getNumber (configFile >> "CfgMagazines" >> _x >> "mass") };
_total = 0;
_sumMass = {_total = _total + _x} forEach _wpnWeight;
How about that, now?
And, well, vehicle magazines are weighted. They have class "mass=xxx;" as it's checked against pylon's weight limits. It's a thing brought to us with Jets DLC's dynamic loadout, AFAIK.
OK, I checked in game, sitting in the plane loaded with weapons. I used this piece of code in console:
_plane = vehicle player;
while {true} do
{
_magsArray = _plane magazinesTurret [[-1],false];
_wpnWeight = _magsArray apply { getNumber (configFile >> "CfgMagazines" >> _x >> "mass") };
_total = 0;
_sumMass = {_total = _total + _x} forEach _wpnWeight;
hint format ["WeaponMass, %1", _sumMass];
};
Hint says "Weapon, <null>". Why?
because your _sumMass is a forEach 🤨
use _total, no?
Thanks, checking
It works now, thanks Lou!
Now the fun thing begins 🙂 How to check the fill of magazine that contains multiple munition, like Hydra pods that has 19 rockets and not all are shot at once? This function going to run in a slow loop, I don't need it to be fast or check the mass on every shot via EH. However, maybe it seems more feasible to use fire EH?
yeah, you are right. It might save some hastle indeed. I will try that, thanks.
Hello, I'm trying to automatically kick people with prohibited names, but when testing it nothing happens at all. Testing this on non dedicated server
addMissionEventHandler ["OnUserConnected",
{
params ["_networkId", "_clientStateNumber", "_clientState"];
_name = "BadWord";
_userInfo = getUserInfo _networkID;
if (_userInfo select 3 == _name) then
{
serverCommand format ["#kick %1",_userInfo select 3];
};
}
];
I tried checking serverCommandExecutable but it returns false. Does serverCommand only work on dedicated server?
hint str serverCommandExecutable "kick";
by server you mean dedicated server? or does mission host count as server?
eh.
The password variant is for dedicated server (not selfhosted), and doesn't need UI context
the passwordless variant you can run as logged in admin, but it needs UI context
I wonder if a with uiNamespace would do 😀
no
good, actually
Thanks!
hello everyone, i am hosting game on ARGO(ARMA3 variant), can i bind a key for client player, eg F3 to Action Menu, so that if they don't need to bind the key themself, as Action menu is hidden by default in ARGO
I googled a bit, is this the right direction?
https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
Thx so much.
no, that doesn't exist in Argo
Action menu do exist it argo, but one needs to edit argoprofile file manually to bind to a key
thx, i will check this out
I have a question, i want to disable the option to ”temporary zoom in” in the server, how do i do that?
holding right mouse?
i think if you press once left click it stays zoomed and if im not mistaken when ur on the ground you can hold + on numpad and it stays zoomed in?
i suspect there is no good way to disable that
😦
https://forums.bohemia.net/forums/topic/207298-help-disable-zoom/ try this? idk how to help, im from argo and im waiting answer on my question lol
There is in ”veteran” difficulty you cant zoom in
But i have custom script
Where do i place that script?
theres a script here
try initPlayerLocal.sqf
but idk how to use this lol
hint str difficulty; so this is how u get the difficulity
found it
check this
cant find the option to disable zoom in
Does anyone have any intel on the locality of RopeAttach and RopeBreak event handlers? I'm guessing they fire where the object they're added to is local, but I'd rather that wasn't a guess
I asked some time ago but didn't get a reply, so asking again: is it correct that we don't have any working linters for SQF atm?
I know we have this, but I don't know of anything else really
https://community.bistudio.com/wiki/Category:Community_Tools#Code_Edition
Hmm... Yeah, these all seem to be abandoned I think
why do you ask?
do you want one?
or you want to make one? 
There's enough horror in coding SQF
, so I definitely don't want to make one
I'd like to create something small (maybe), but I'd love to have a working linter for that
I wanted to make one, but I neither know C# nor JS/TS so... 
are those the languages of linters?
Oh boy, if Arma supported C#... One can only wish 😄
I mean for VSCode extension making
afaik it's only possible with those
Do you need both or just another one?
I think VSCode extensions are mostly written in JS/TS (not sure which)
C# is possible too but you need another extension for that iirc
TS
Any info regarding that? I'm just curious 😄
¯_(ツ)_/¯
that's all I know 
what the correct way to take away a specific ammo from a plane? i want my CAS plane to only have rockets, no 30mm gun
remove the weapon? 
its a builtin spinal one
take your pick I guess... 
builtin weapons can be removed too
sorry I thought you were talking about arma extensions 🙄
uh im too dumb to spawn a cba target thats not just an empty vehicle.
if i use "createVehicle" it spawns an empty (yellow) target "vehicle", opposed to the editor blue-unit of the same type, if i use "createUnit" nothing spawns at all
add crew
all vehicles are empty
what crew do i use here?
createVehicleCrew
that makes sense, will try thanks
hm the plane refuses to engage any of the ivisible targets, but atleast the hind attacks them
so a 50% win today 😛
Hello, is possible to modify ( code of ui event handlers on default arma inventory dialog )?
I mean - get code from event handler, which already exists?
Crazy question? There is any way to draw lines in map and 3D screen in "bold" for better visualization? Sometimes the lines are really hard to see.
Just asking.
I tried that: draw many lines above each other with a small random offset. But this is super FPS heavy.
If it's a straight line, you can use a long filled rectangle
Thanks!
no
better post this in #arma3_feedback_tracker
will do
How difficult is it to script boats
Depends what you mean by "scripting a boat"
we all float down here
Basically making the boats drive
I have made a script that gives a squad a random waypoint within a radius, but once they get there i want them to wait 3-5 min and then it gives the squad another random waypoint in the radius.
How would i script it to give them another one over and over infinitly?
While (alive patrolLeaderName) do {
WaitUntil {sleep 1; unitReady patrolLeaderName};
If (!alive patrolLeaderName) exitWith {}
Else {
_sleepTimer = [180,300] call bis_fnc_RandomInt;
Sleep _sleepTimer;
**your patrol script here**
};
};
Realized you asked for looping, and that kinda makes the other if !alive redundant, but w/e.
(if exitWith else doesn't exist)
But what if it did? 🤔
how does one make a satchel charge attached to a zamak explode when someone gets in the zamak, i need to make a car bomb for non-IRA op reasons
it will be uh useful to have something like this
nvm
i found out that the blast radius can infact "destroy" the satchel charge
By AI?
If so, that's very easy. just look at waypoint commands, or doMove command
It would make no sense... 
What follows after exitWith is a kind of else already
Your while is wrong too
So it is; what I get for writing on a phone and not double checking >_<
Though, tbf, I make that mistake all the time even when I'm on the computer ._.
it does
just replace } else { with }; call {
imagine if bohemia had invented return
Can i use that```sqf
#include "\a3\ui_f\hpp\definecommongrids.inc";
i suspect no. A3 has no command to preprocess strings either does it?
also get that semicolon out of there
I get this in RPT 5:54:39 Error in expression <#include "\a3\ui_f\hpp\definecommongrids> 5:54:39 Error position: <#include "\a3\ui_f\hpp\definecommongrids> 5:54:39 Error Invalid Number in Expression
yeah, that's not valid SQF
Thanks!
there was a discussion about it:
#arma3_feedback_tracker message
but in the end I guess it wasn't seen as worth it
yes, but imagine if the original author of SQF had invented return, or even better the concept of using an existing script language
like F#
I heard good things from Beef apparently, I should ask my ex-colleague again about it
I just took a look at its syntax and it's even worse than python 
well I guess that's a new record
never thought I'd see anything worse than python 😅
you haven't met perl i suppose?
no 
What's wrong with Python though? Just curious
No, like for me to drive
for one thing, indents are used as scopes/blocks... 
no multiline comment support
some inconsistencies in syntax
Do you mean applying scripts to existing boats, or adding boats to the game?
Adding boats to game
then it has nothing to do with scripting
if you mean you want to create a new boat model
that'd be related to #arma3_model and #arma3_config
Then how do I make the boat work
to make a boat work, you first need a boat
that's not #arma3_scripting
I imagine itd start with a working model, then inheriting the configs for an existing boat and tweaking to fit, yeah?
can you control an AI's use of NVG?
kinda
force them to use NVG during the day?
... why?
just curious
iirc no, that's not possible
what can you control?
you can make them take it off at night
i see. fair enough
yeah not possible
can you select the default respawn position (option) for the respawn menu?
Is there a way to run unscheduled code from a scheduled context?
yes
see isNil
you know what's even better than an unscheduled section in a scheduled context? not entering a scheduled context at all 🙂
this man is on a preaching mission 👀
scheduled is just a disaster
// scheduled
if (!isNull _object) then
{
};
do you know what this condition asks?
absolutely no idea
it asks
was
_objectrecently not null?
right. there is no observable difference
And this is completly fine for most, basic mission making needs.
it's fine if you don't really care, yeah
it's sloppy though
sloppy design to make it so easy to create such incorrect code
What's the alternative? Having only unscheduled and having mission makers murder performance as most of them are not programmers?
I probably killed the performance and I'm not a programmer and I´m not speak english, but would appreciate very much help to understand, where am i going wrong?
if (!alive obj1) then {["task1","SUCCEEDED"] call BIS_fnc_taskSetState}
nowhere
it obviously depends where you run that code…
Can hashmap values contain other hashmaps?
Unscheduled for mods, scheduled for missions
the documentation says it, iirc values can be anything - only keys have type restrictions
90% of my missions have a while {true} which is fine in the context of a mission
gniii
😁
let's say "acceptable" to have a while true eventually 😀
Everything is {true}, isNil _permitted
Is this a fine way to call a function or is there a more elegant way?
_this call (missionNamespace getVariable 'KER_fnc_waypoints');
I am calling about 3 - 4 in initPlayerLocal.sqf
Is there documentation on what enters scheduled contexts
I assume that mission event handlers don't at least, otherwise eachframe wouldn't work
oh okay
that's actually not so bad
surprised that the init<blah> scripts are scheduled but basically "avoid spawn" seems to be the only thing
yep
wouldn't ```sqf
_this call KER_fnc_waypoints;
welp I have a knack for hilariously cursed code apparently.
I was trying to set up a little dungeons and dragons table for a side room as a goof, and was toying with how to get the minifigs to stay mini.
Forgot what 'each frame' really means.
addmissioneventhandler ["EachFrame",{cursorobject setObjectScale .03;}];
That will work perfectly when used in initPlayerLocal.sqf the way they describe their usage.
The only time it may have an issue is if the currentNamespace isn't missionNamespace. This could occur via a few different methods, one of which is using the with command to change the current namespace.
yeah, ik. Did I really sound that unsure? 
i wanted to ask if there a way to make it so that
if (item in inventory)
allow action
kind of commands?
https://community.bistudio.com/wiki/items
This to get items in inventory
Hey so i'm just doing some standard stuff with the spawn ai module and this seems to be the way to go and I've got it working.
https://forums.bohemia.net/forums/topic/221101-how-to-set-factions-for-the-bis-spawn-ai-module/?do=findComment&comment=3332303
However the way this is done makes me think maybe I could customize the units spawned instead of just picking from vanilla ones.
Like how CfgRespawnInventory works (https://community.bistudio.com/wiki/Description.ext).
on the wiki it has an example of referencing either an existing unit or making a loadout yourself.
So is it possible to instead of using vehicle I could replace that with some sort of loadout code? or still call the vehicle but then override it's loadout?
class unit0 {
vehicle = "rhsusf_army_ocp_squadleader"; //Class name of unit/vehicle
side = 1; //index of unit side being [ east, west, independent, civilian ]
rank = "SERGEANT"; //rank name from CfgRanks
position[] = { 0, 0, 0 }; //offset position unit spawns from spawn point
};
if([player, "UMI_Land_Portable_HDD_F"] call BIS_fnc_hasItem) then {
call{[data_1, "blue", "orange", "red"] call BIS_fnc_DataTerminalColor;
[[this, ["Activate Terminal", "terminal\terminalOpen.sqf"]], "addAction", true] call BIS_fnc_MP;}
} else {
};```
I was playing around with it, but I am sort stuck here
the Activate Terminal works when not used this way, when I tried to see if the item was correct, it was using a simple hint "works" trigger, now I just need it all together in a data terminal
any help?
It cannot become non-null after it's already been null (on a local variable like you're testing). So that's irrelevant
Yes sure. But not as key
Why are you using getVariable? You are already in missionNamespace..
Just
call KER_fnc_waypoints
But it can become null at any point, which is why the condition is useless for asking whether the object can be used.
It's analogous to the futility of asking whether a mutex is locked.
Ah I read your message as inverse
Why can you not name an object "commander"?
It's reserved for the command: https://community.bistudio.com/wiki/commander
All your variables should have a unique prefix, otherwise your scripts may break at any time
- where are you running that?
- don't use
BIS_fnc_MP - why do you wrap that in a
call? there's no need
- why an empty
else
- use ```sqf for syntax highlighting
the empty else, was a mistake (I was jut trying bunch of things to see if it will work or not, it wasn't originally there)
will do for next time
-
data Terminal Init, because i wanted it for it to be
Player Approaches Data terminal, if they have x object, they can interact with the data terminal.
After they activate it, after a minute passes, it makes a noise and closes itself -
BIS_fnc_MP bad, got it, any reason as to why if i may ask?
-
i am pretty sure there are easier ways to set the data terminal up, but I did the best I could do with my limited knowledge so its probably 80% jank
data Terminal Init, because i wanted it for it to be
there's no guarantee that player is assigned yet. it could be null
plus what if the player picks up the item later?
- BIS_fnc_MP bad, got it, any reason as to why if i may ask?
useremoteExec
BIS_fnc_MP is probably a wrapper for remoteExec rn, but there's no point in using it anymore
it's just there for backward compat
also if you're putting that in object init (or any other init field in Eden), there's no need for remoteExec at all
you'd be duplicating the action for everyone if you do that
I took your suggestions and
now i got this
if([player, "UMI_Land_Portable_HDD_F"] call BIS_fnc_hasItem) then {
[data_1, "blue", "orange", "red"] call BIS_fnc_DataTerminalColor;
data_1 addAction ["Activate Terminal", "terminal\terminalOpen.sqf"];
};
====
data_1, "blue", "orange", "red"] call BIS_fnc_DataTerminalColor;
data_1 addAction ["Activate Terminal", "terminal\terminalOpen.sqf"];
works fine, but I am still not sure how i could make it so that it will only allow someone to interact with it if they have a certain item
trying to use "soldierOne action ["Eject", vehicle soldierOne];" pulled frim here https://community.bistudio.com/wiki/Arma_3:_Actions#Ejectfrom but can't seem to get it working.
Players will walk into C130, I've set a trigger to set them as unconscious which is fine but I want to then kick them out at a given trigger have their parachute open. Any help appreciated.
addAction sports a "condition" argument; set the BIS_fnc_hasItem call in it
data_1 addAction ["Activate Terminal", "terminal\terminalOpen.sqf", [player, "UMI_Land_Portable_HDD_F"] call BIS_fnc_hasItem];
I tried that, but it just works even if I don't have the item
you don't "just place the code", see the doc
https://community.bistudio.com/wiki/addAction @frail vault
[data_1, "blue", "orange", "red"] call BIS_fnc_DataTerminalColor;
data_1 addAction ["Activate Terminal", "terminal\terminalOpen.sqf", nill, 1.5, true, true, "", {[player, "UMI_Land_Portable_HDD_F"] call BIS_fnc_hasItem}, 50, false, "", ""];
am i missing anything?
1/ nil, not nill
2/ condition: String, not Code 😉
so```sqf
"[_this, 'UMI_Land_Portable_HDD_F'] call BIS_fnc_hasItem"
ah!
and you can drop the rest of the arguments after that - though you might want to set the action radius to something smaller than 50…?
oh i am just testing it, to see if it works xD
I just took example 5, put everything in it to see if it works
it works, thank you so much!
now time to figure out the other things i set out to do haha
Have you tested for locality? iirc eject and others are effected locally
I know it´s of topic but i need some help. I´m trying to make a small script that changes the Weapon firing mode from a players weapon. therefore I want to use: player selectWeapon ["arifle_MX_GL_ACO_F", "arifle_MX_GL_ACO_F", "FullAuto"]; -> this is whats on BI wiki (https://community.bistudio.com/wiki/selectWeapon). But as soon as i try to use it I get an error that the function expects a string instead of an Array. Even if I copy the Bi example that error occurs.
Does someone know why i always get that error or even could help my how to solve that problem?
found that some minutes ago as well. that explains the error but is the a workarround besides the one from Killzone_Kid
got in the dev branche and found out that the feature i was going for with my code is natively supported with 2.07 so it´s not really relevant anymore, unless there are still bugs with reloading
thanks anyway for your help 🙂
I have a hashmap where some of the values might contain the same data for multiple keys. Is there any way to reduce data duplication by having multiple keys refer to the same value, or having values redirect to another value?
An ideal example might be if a key consisting of an array ["key1","key2"] would be returned by both get "key1" and get "key2"
no
That's unfortunate
yes? 
y no?
I didn't understand the question
do you want to map multiple keys to one data?
unless I misunderstood
any way to reduce data duplication
having values redirect to another value
that's not possible (but for array data as they are pointers)
technically values in SQF are never copied (unless you use a command that gives you a copy), so you never "duplicate" them anyway
Yes, or any equivalent where different get inputs can return the same value without me having to have a bunch of values that are identical but have different keys
different get inputs can return the same value
without me having to have a bunch of values that are identical but have different keys
you're confusing me
those two are mutually exclusive
key1 →
key2 → value
key3 →
that's possible
Like how switch cases can have multiple cases result in the same selection without duplicating stuff
If that's possible, I would love to know how
how about a practical example? I really don't know what you mean. unless it's what Lou posted, which as I said is possible
i think you might just need to reorganize the hashmap. there is probably a better way to structure it to get what you want so that it never contained duplicates in the first place
you want a: map<K, int> and b: array<V> and then b[a[k]]
if that's the question, you don't even need that
My hashmap contains properties related to types of vehicles. Like this:
[toLower "US85_M923c", // Main key
(createHashmapFromArray [ // Value is another hashmap but that's not important here
["effectiveTowMass",5000],
["limitTowMass",10000],
["towHook",[0,-3.3,-1.2]],
["towPointFront1",[-0.4,4.4,-0.8]],
["towPointFront2",[0.42,4.4,-0.8]],
["towPointRear1",[0,-3.3,-1.2]],
["towPointRear2",[0,-3.3,-1.2]],
["typeLockOverride",false]
])
],```
As you can see, the key is the classname of the vehicle. These properties can be the same for several different classes of vehicle, e.g. they would be the same for both the Mediterranean and Pacific variants of a NATO vehicle, but I would still need to look them up by the classname. So I could simply have an element for every classname, and accept that many of them are going to contain the same value, but it would be more convenient if I could have e.g. `"US85_M923c"` and `"US85_M923o"` return the same value without that duplication.
you're not duplicating anything
hashmaps are references
_hm = createHashmap;
_keyVal1 = ["key1", _hm];
_keyVal2 = ["key2", _hm];
_hm2 = createHashmapFromArray [_keyVal1, _keyVal2];
(_hm2 get "key1") set ["blabla", -1];
(_hm2 get "key2") get "blabla"; //gives -1
basically every value in SQF is a reference
I mean, I am currently duplicating things, because at the moment I have 2 entries next to each other that both look like the example, except one has "US85_m923c" as the key and the other has "US85_M923o". So there is duplication in the file and that's what I'm talking about.
It seems like the solution might be to reorganise when the values are created. That might have implications for how easy it is to expand the hashmap (ideally, very easy) but I'll have to think about it.
I am currently duplicating things
well if you create them like that yes, you are
I only create the hashmap (_hm) once
and use it by multiple keys
so yeah, you need to organize your data
Yes, that seems to be the solution to the duplication problem. The trouble is that it raises a user-friendliness problem. Ideally, an entry could be added to this hashmap by only adding the entry itself (a single block as in the example). Reorganising would mean you have to create the entry in one place (in the file), then go and put it into the hashmap in a separate place. I suppose solving the duplication outweighs that, but it is annoying in a different way.
no, not necessarily
_hm = createHashmap;
_keyVal1 = ["key1", _hm];
_hm2 = createHashmapFromArray [_keyVal1];
_hm2 set ["key2", _hm2 get "key1"]; //reference to hm in key1
same result as before
(_hm2 get "key1") set ["blabla", -1];
(_hm2 get "key2") get "blabla"; //gives -1
Okay, I think I got it figured out. Have to make sure nothing gets added to the hashmap before the value it's supposed to inherit from, but hopefully a big warning comment will prevent that
is there no default respawn position select command?
respawn positions are handled by functions, not commands
oh yeah i meant functions 🙂
look into the respawn framework, i'm sure you can find it, or something that would let you select a position
ive been looking through the functions but havent yet found it
Have you taken a look in https://community.bistudio.com/wiki/Arma_3:_Respawn ?
yes
look in the functions viewer, you should be able to find the code that sets the position
Ok I will search from there
_allplayers = allPlayers apply {[_x distance2D position thisTrigger,_x]};
_allplayers sort true;
hint format ['%1',_allplayers];
i have a problem with this code giving "scalar" instead of the distance. can somebody tell my whats wrong?
thisTrigger is undefined i guess
i need some help with some coding if anyone could lend me a hand
ive coded these doors i bult to open but when i put it on my server it wont open
i understand that i might have coded it to client and not server but i dont know how to do such
ok you ar right. i dont get why. if i try to get the Trigger position with getPos thisTrigger then i get an empty arry. but the troops that are spawned on the Triggers position work as intended
call{this addAction ["Open Vehicle Doors", {trg419 = true; trg3 = true; gate1 hideObjectGlobal true; gate2 hideObjectGlobal true; gate3 hideObjectGlobal true; gate4 hideObjectGlobal true; gate5 hideObjectGlobal true; gate6 hideObjectGlobal true; gate7 hideObjectGlobal true; gate8 hideObjectGlobal true; gate9 hideObjectGlobal true; gate10 hideObjectGlobal true; gate11 hideObjectGlobal true; gate12 hideObjectGlobal true;}, [], 6, false, false, "", "", 6];};
call{this addAction ["Close Vehicle Doors", {trg4 = true; gate1 hideObjectGlobal false; gate2 hideObjectGlobal false; gate3 hideObjectGlobal false; gate4 hideObjectGlobal false; gate5 hideObjectGlobal false; gate6 hideObjectGlobal false; gate7 hideObjectGlobal false; gate8 hideObjectGlobal false; gate9 hideObjectGlobal false; gate10 hideObjectGlobal false; gate11 hideObjectGlobal false; gate12 hideObjectGlobal false;}, [], 6, false, false, "", "", 6];};
This is my code
That works in eden but not when I put it on my server
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Format it like this
please 🙂
Do what
What about _x distance2D thisTrigger?
The code in your message, please format it as described by the @wicked roost.
also returns scalar
The aim of my code is to determin which is the closest player to the trigger. if anyone got an better idea or a solution than i would be very thankful
whats wrong with scalar? just round to integer if you need that but scalar is just a decimal number
all numbers in sqf are floats
no but it wont sort by that number
it does
and it shoub be a number uder 1000
as sharp told you and you confirmed, your variable is not defined. what do you expect? fix your code
thisTrigger is defined in the Condition field of a trigger
I know
is there a way to set the texture of a 3d UI item (for instance a hatchback rendered as model on the UI)?
yeah but how 😦 this code all runs in an trigger and if i try to getPos or position it always returns an empty array
I ran your exact code in the onCondition of a trigger and it works soooo
getPos and position never return empty arrays 
or do you mean the code?
I geuss the hint shows an empty array?
yeah
where do you run that code?
i´m going to post the full code
the whole code can not be send.... don´t know why and i´m not able to upload the whole scrip could send via dm
use sqfbin.com
