#arma3_scripting
1 messages · Page 606 of 1
if(_unit inArea _trigger) then {hint "wew";};
iirc. at least. it does work for markers too. check out the biki docu for inArea, its very versatile
nah mine shoulda worked as well, same thing after all
yeah inAreaArray grabs all units, inArea tests a single unit.
you could filter your inAreaArray with select {_side _x == opfor} too
thats problematic. the discord rules clearly state that unnecessary violence isnt liked here.
clearly a war crime
Working on packing a mod and need help with the code
My question is when I pack the mod does the directory for pulling images stay the same?
Pretty much in that PBO is the image its suppose to use
drawIcon3D ["addons\SeenIcon_ca.paa",
or would it need to be
drawIcon3D ["addons\pboname\SeenIcon_ca.paa",
think now i have something fancy with which i am not even sure about how to test:
// Scope without any _this
params ["_foo"];
lets say you have examplePboPrefix set as your pbo prefix, then you would address those as examplePboPrefix\SeenIcon_ca.paa
So if the pbo name is ZeusFOW it would then be
drawIcon3D ["addons\ZeusFOW\SeenIcon_ca.paa",
no, just drawIcon3D ["\ZeusFOW\SeenIcon_ca.paa",
ok thanks
you need the first \ too, dont forget that
ok thank you when you said I needed the prefix I thought I needed $name
in addon builder under advanced settings or something like that you should have an "addon prefix" or sth like that
you have to put the ZeusFOW there
ok thanks
And good advice on making mods; don't use Addon Builder, but Mikero's Tools. It will make your life so much easier.
or armake2 if you feel confident using the command line
IMO addon builder is fine for super easy things
Up to the point when you have wasted half an hour trying to understand why arma can't resolve path xD
@queen cargo params*, no? param takes a number as first argument
believe is sadly not enough for me as you know 🙈
perhaps, but I am still going to bed 😛
need everything from potential errors down to error messages applied 😄
never wanted to stop you 😉
i will continue integrating old SQF-VM into new SQF-VM
armawork over smb?
can sqfvm do more than linting/syntax checking? thats the extent i know how to use it @queen cargo
Sqf-vm is a full implementation of the sqf Script language with limited Support for operators available
Aka: it is able to execute Code without arma even installed @waxen tendon
hi everyone, I am kinda confused on something. I need to have action menu come back after a player spawns in or respawns. it works on single player but I am not certain how to make this work.
if (isMultiplayer) then
{
if(isMusicActive == 1) then
{
isMusicActive = 0;
player removeAction musicAction;
musicAction = player addAction ["music on", "bf_Adapt\musicController.sqf"];
1 fadeMusic 0;
hint "Music disabled. 1";
}
else
{
if(isMusicActive == 0) then
{
isMusicActive = 1;
player removeAction musicAction;
musicAction = player addAction ["music off", "bf_Adapt\musicController.sqf"];
1 fadeMusic Volume;
hint "Music Enabled. 2";
};
};
}
else
{
if(isMusicActive == 1) then
{
isMusicActive = 0;
player removeAction musicAction;
musicAction = player addAction ["music on", "bf_Adapt\musicController.sqf"];
1 fadeMusic 0;
hint "Music disabled. 1";
}
else
{
if(isMusicActive == 0) then
{
isMusicActive = 1;
player removeAction musicAction;
musicAction = player addAction ["music off", "bf_Adapt\musicController.sqf"];
1 fadeMusic Volume;
hint "Music Enabled. 2";
};
};
};```
i remember something about using a onplayerrespawn.sqf but this is in a mod
@ me if someone knows a possible solution
On the wiki: https://community.bistudio.com/wiki/UAVControl
It mentions:
A) Since Arma 3 v1.95.146028 this command returns both driver and gunner units if the UAV is controlled by 2 players. Here is the list of all expected outputs:
B) [player1, "DRIVER", player2, "GUNNER"] - player1 is controlling the UAV and is the pilot, player2 is controlling UAV and is the gunner
But for the life of me i can't figure out how to even get 2 players connected without one failing or booting the other off.
Will the "EntityRespawned" mission event handler only ever get fired for players? Or can other entities (ai people and vehicles) be respawned?
I found the respawnVehicle function so presumably vehicles can also fire the "EntityRespawned" MEH. Are players and vehicles the only two cases I need to consider here?
@robust hollow @warm hedge - Just wanted to thank you guys for the discussion a few nights ago. I successfully got the development environment setup. There is an extension for visual studio code that was really beneficial (i thought it was super broken at first - turns out I needed our conco to connect the dots). Plan on doing a youtube video on it eventually or some sort of writeup since I couldnt find anything along those lines. If you guys are ever interested in seeing how the (read my) live dev environment works, let me know. Thanks again!
@orchid stone What extension do you use?
@thorny ferry I believe respawned AI will trigger it too - test it to be sure
A quick question about multiplayer optimisation, how does missionNamespace setVariable ["something", "value", true]; compare to using publicVariable "something". Is the network load comparable or is one better than the other?
(additionally, I don't know if setVariable would trigger a pV EH)
@wet shadow publicVariable usage can trigger a publicVariableEventHandler on other machines
But usually, publicVariable is considered obsolete in the spirit
@cosmic lichen - Arma Dev. Judging by your name, it might be yours lol
Not mine 😄
🤔
Ah OK, well 3 of the 4 letters matched the author's email hah. https://marketplace.visualstudio.com/items?itemName=ole1986.arma-dev
1* letter no?
ole1986
R3vo
Email*
can't find it
Maybe I'm misremembering his email. At work now, just in between the part where I do my bit. Either way, super cool extension
Works very well 👌
true dat - I think I have an issue where variable names are not suggested, only commands/functions
yes
I need an extension which can finally suggestion previously created variables
also it's missing tons of commands =/
let's make our own VS extension!
YAA
(…just for autocomplete)
I am fine with it
ah well, we can do that - combined with Grez' wiki, we would be unstoppable!!1!
https://www.youtube.com/watch?v=8js3H3zhhdc (Unstoppable) Had to do this 😄
Unreal Tournament 1999 unstoppable
M-M-M-MOOONSTER KILLLL intensifies
(because we didn't know how to at the time, that's the only reason and you know it)
hello everyone, want to ask if there is a command. That the AI at VCOM AI stops no matter what happens. The reason is to build a shooting range but not with falling targets but with the AI. But it should stop and show no reaction.
Maybe
Also, this is a good extension https://marketplace.visualstudio.com/items?itemName=Armitxes.sqf
@hybrid pier Check out https://community.bistudio.com/wiki/disableAI
Btw @winter rose Where is our custom command for discord.
!biki <command>
!biki <function>
ask this Discord's Boss - I would gladly do it
I am not allowed to ping him. I have to forward it to a moderator
I use that extension too. Its beautiful
Yeah, but suffers the same issues. No auto complete and not a complete command/function library
Ya :/
@cosmic lichen have entered that and unfortunately the ki still moves and opens the fire.
this disableAI "MOVE","TARGET","AUTOTARGET","ANIM","TEAMSWITCH","FSM","WEAPONAIM","AIMINGERROR","SUPPRESSION","CHECKVISIBLE","COVER","AUTOCOMBAT","PATH","MINEDETECTION","LIGHTS","RADIOPROTOCOL";
this disableAI "all";
the problem is Vcom AI since it is an extra script and works extra
I mean "string1, "string2" syntax won't work
@hybrid pier check the page for examples
okay, have to look anyway after the AI is killed, it should be deleted and a new one come on the same place.
@winter rose can you help me?
sure, what is your problem?
I have the problem of implementing a script. following goal. I build a shooting range from AI targets, these should disappear at TOT after about 5 seconds and reappear in the same position.
TOT?
all countries have ninjas, only yours are bad enough to be known about 😄
i can not send a sqf
```sqf
your code
```
// gets formatted
@hybrid pier anyway: when you create a new unit, re-apply disableAI.
yes, of course, can you rewrite the script instead of vehicles, enter inf and adjust something?
no?
You meant get in then disableAI?
@hybrid pier if you want a "stupid AI" unit that doesn't move, create a unit with createVehicle
won't move at all
Or createAgent
(they move a bit more)
But agent is stupid enough?
they can lie down if shot at, IIRC
@winter rose I place the ki on the shooting range and give her the command "this disableAI" ALL ";". then nothing happens. now the dead should be respawned via a script at the same position. automatically.
So it is with the SQF file that I have sent you, for vehicles.
yes
can you help me with that? to write and implement something like that? I'm not that good in there.
use the same script, it should work
what ai skills are different in an agent?
in my understanding agent = AI that works towards its goaol
FSMs are waaay simpler iirc
"agents" are "dumb AI" (e.g snakes, rabbits, etc)
what is the agents goal? (and its dreams and hopes?)
ah so very passive AI
are they local as well then if i create a civ agent?
created globally, but maybe locally computed
@hybrid pier have you tried your script? you don't need to change anything as that would use createVehicle
i have a radical question? can i redefine the conversation system words by creating them as normal sounds with their paths in the description.ext and then use them with the playSound?
no I have not since the AI is not a vehicle or not?
if you mean "declaring the ogg file path in CfgSounds", then yes it would work @spark turret
you can create the AI as a vehicle to make it more stupid.
yeah thats what i meant
hmmmmmmmmmmmmmmmmmmmmm
@hybrid pier if you want a "stupid AI" unit that doesn't move, create a unit with
createVehicle
or just do _unti disableAI "all"; that also does the trick
it wont even be able to turn or target anything.
basically it just stands there
i feel like its a ton of work to declare all the paths for the existing words but i wouldnt have to use the absolutely ******** conversationsystem which has got to be the most********* thing ive seen so far
because playSound is sooo easier to use
yeah bc i dont have to create like 3 files for one sound
@spark turret yes the AI doesn't move anymore and is a stupid AI. only we want the AI to respawn after the TOT and to be in the same position again. The goal is a shooting range
thats pretty cruel
there are acutal shooting targets as objetcs
they fall over when hit and stand back up
it works * - * many many thanks 🙂
i remeber i made a shooting range script for CQB like 2 years ago
it was awful and i didnt know anything about MP scripting
but it kinda worked and was far more advanced than anything vanilla has.
What is the alternative method to say3D which doesn't play from any object but is just there wherever you are?
playSound3D
note that it takes an absolute filepath that requires getMissionPath usage
The wiki says it is positional audio.
or just use playSound if you only want the sound to play, without any 3D source positioning
@slate cypress
playSound it is!
Is it possible to make the sound fade out after a trigger?
nope; make it a CfgMusic and play it with playMusic maybe?
What's the difference between Music and Sound?
the "channel"
you could e.g fadeMusic without impacting game sounds
Also there's only one Music in a moment
Ah I see. I'll give playMusic a try actually.
Does name in CfgMusic get shown when playMusic is used?
Similarly to how say3D has a subtitle displaying text
due to it being defined in CfgSounds
nope, just display name for e.g trigger activation, in the editor
Isn't it called through the class name though?
it is
I mean, name = "my super music" will be displayed in the trigger options, in the interface's combobox
@slate cypress
but sounds don't always have spoken text, so no need for subtitles 🤷♂️

Are units spawned with createUnit given dynamic simulation by default?
[<target>, "H_HelmetO_ViperSP_ghex_F", "fasle"] call BIS_fnc_removeVirtualItemCargo;
Is there a way to make <target> just refer to the object the code is in instead of having to set up variables all the time?
if you spawn the code from theunits init then yes
this execVM "yourDopeScript.sqf"; will give the script your unit as the "_this" variable
-> _unit = _this
@agile pumice I don't think so, but don't know for sure
I'm about to do some testing to find out
please tell back so I can update the wiki
it just needs to be the object on where the virtual item(s) need to be removed from, so it can be this in a init field, it can be variable_name_of_container or even _somethingFancy when using in a script
if you hover over the init field, it will display a tooltip that actually says that
oh... and the 3rd parameter needs to be a boolean, so true or false, not a string (which is spelled wrong too)
well thats kind of weird. I ran this code
bob = group player createUnit ["B_RangeMaster_F", position player, [], 0, "FORM"];
bob enableDynamicSimulation true;```
and then watched ``dynamicSimulationEnabled bob`` and its false?
dynamicSimulationSystemEnabled is true
Description:Enables or disables Arma_3_Dynamic_Simulation for given non AI object
Syntax
does "enablesimulation = false" stop targets from animating with animate if the command is executed on a remote client?
no, that cant be it
some targets are behaving in a really weird manner
Limitations
- No line of sight detection; designer needs to make sure player cannot see transition between enabled/disabled states.
- No support for moving entities; entities will stop moving when disabled.
- No backward compatibility with other older systems like are the scripted Sites or FPS Manager
Enables / disables simulation for the given entity. This command will affect entity simulation only locally. For a global and JIP enabled alternative see enableSimulationGlobalMultiplayer:This command only works locally and must be run on all machines to have global affect
enableSimulation will "freeze" the unit, including animations, eye blinking, etc ; you cannot switchMove or playMove.
@spark turret
From the https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation page:
Characters Infantry units (default: 500m). Set to a reasonable distance, player should not see disabled infantry units.
If AI units weren't dynamically simulated, what does this refer to? Though it is true that AI units don't have an Enable Dynamic Simulation attribute box to check.
the problem is that the targets animate when running the command in singleplayer
but NOT when running the command in multiplayer locally
in both cases simulation is disabled
Dynamic Simulations is to "disable" AI completely (aka freeze them) until activated again. Which is perfect for larger missions with a lot of AI which don't need to run on their own, but will simulate movement and stuff in the background.
Hm interesting nica. So you disable the simulation on a unit in SP and it still animates?
And in mp it doesnt?
@ebon citrus enableSimulation is local and only useful for SP, use enableSimulationGlobal (and run from server!) for MP
and in the end; animations are sometimes borked in Arma, especially when it comes to local vs global
@exotic flax is local but useful in MP
No?
Anyways, inconsistent behaviour. I'll figure something else out
as the wiki says:
This command only works locally and must be run on all machines to have global affect.
so either useremoteExecfor everything, or useenableSimulationGlobal
Hey, I am looking for a script that automaticly delets some Items every so second. Any idea
For general garbage collection you can simply enable that in the mission settings
@exotic flax or run it in local init
Well, scripts, especially when running every second, will slow down your mission massively.
yeah i know, timing i will test but i need a script that allows me this?
well, get the items you want to remove, loop over them and use deleteVehicle to remove them
Dieter what do you want to do?
@frigid geyser ^
a way to delete Items like GPS or Radio thats beeing dropped by the AI so the players cant pick that up
It's probably easier to remove those items from the AI before they die than afterwards, since they will be in a container instead of actually being dropped
Yeah, but with probably over 200 Units placed in Editor and Zeus thats not possible, you know..
Hey Folks,
Hans is actually asking for me 😉. We are working on the same mission .... he already investigated and someone gave him this thing. But we dont get it to work.
We placed it in the initPlayerLocal.sqf
The sleep-time will be extended to something like 60 seconds
player setVariable ["glKO2PreJxe3J1FzbJPaKhg8zeCYugFt",str getUnitLoadout player];
while {true} do {
if!((player getVariable["glKO2PreJxe3J1FzbJPaKhg8zeCYugFt",[]]) isEqualTo (str getUnitLoadout player)) then {
private _itemArray = ["itemAndroid","itemGPS","itemMicroDAGR","itemcTab","B_UavTerminal","TFAR_anprc148jem","TFAR_anprc152","TFAR_anprc154","TFAR_fadak","TFAR_pnr1000a","itemRadio","TFAR_rf7800str","VQI_Sentinel"];
{
if(_x in items player) then {
player removeItem _x;
};
} forEach _itemArray;
player setVariable ["glKO2PreJxe3J1FzbJPaKhg8zeCYugFt",str getUnitLoadout player];
diag_log "UPDATED";
};
sleep 0.5;
};
ah did not work. 1 sec. gonna edit.
edit done 🙂
@frigid geyser On mission init, loop over all AI and remove their stuff 🤷♂️
That script will remove it from players only, not AI 😉
that totaly fine
when they pick something up it will be deleted. that's ok for us
but it does not work ^^
and we cant find out why (well .... we are new to scripting ....)
It will only work once since it will check for that variable, which is set after first time
so the first line must be integrated into the loop?
no, just remove the setVariable and getVariable stuff
heheh ok. thats funny, because that was exactly the part that i never understood 😄
thanks ❤️ . I will give it a try.
@winter rose Can AI be respawned though? I only saw stuff for configuring player and vehicle respawns on the respawning wiki page. I'll assume they can but it'd be nice to know for sure.
yes
Ok thanks!
hmmm .... does still not do anything. Looks like this now
while {true} do {
private _itemArray = ["itemAndroid","itemGPS","itemMicroDAGR","itemcTab","B_UavTerminal","TFAR_anprc148jem","TFAR_anprc152","TFAR_anprc154","TFAR_fadak","TFAR_pnr1000a","itemRadio","TFAR_rf7800str","VQI_Sentinel"];
{
if(_x in items player) then {
player removeItem _x;
};
} forEach _itemArray;
diag_log "UPDATED";
sleep 0.5;
};
If line 2-3 looks strange ... thats discord
your tfar classnames won't work
TFAR will replace the radio, with a different classname
do note that some items are slotted and not in the inventory, in which case unassignItem should be used (will remove it when it doesn't fit in the inventory)
hmm ok.
tbh I just quit trying for today. But nevertheless thanks for the hints. I will try this tomorrow. Thanks Dedmen for the TFAR hint and Grezvany for everything else. You already helped a lot!
Are the radios a certain class type, maybe that could be used
they do inherit from a default class, but other mods might add custom radios which still work with TFAR
I recall seeing something similar but can't recall the function name.... does anyone know if there is a function to attachTo or find closest attachment point from location?
Tbh I wonder if there is no command/script that just flushes the radio and the uav slot.... For me that would have the same effect.
How can I make AIs attack empty vehicles?
you could maybe set a unit inside and hide it, or set an invisible AI of an enemy side as driver
@quartz pebble
Thought on this. But such a vehicle would implicitly reveal to players something is wrong with it. I.e. if a player can't take a specific seat because an invisible AI is there.
well, you said an empty vehicle 🙃
what do you want to do?
Long story short: we have a PvE mission. Sometimes we get players, who manage to drive service trucks to AO, leave them there and start a tank rally at AO, getting repaired whenever needed.
I thought on making AIs at AO attack those empty repair trucks.
you can make it so that an invisible AI is set as driver/passenger, until there is another player/unit nearby
"nearby" is a key word here. "In russian" that means "keep a dedicated mechanism which would track any of the players near any of the trucks" 🙂
yes
or perhaps use commands like doSuppressiveFire or fireAtTarget
but you cannot do a vehicle addRating -10e10 iirc
Yeah, I know 🙂 Was thinking either on attaching a laser target, but that would anger only enemy aircrafts.
Or attaching an invisible AI. But that also requires tricks as the attached AI has to be "outside" enough so enemies see it, and "inside" enough so enemies shoot vehicle and not "air" near the vehicle.
or just spawn a bomb on the truck if alone for more than 1 min 😄
DoSuppresiveFire is a pretty useless command
Its been 2 years since i last fiddeled with it but i found zero working ai commands that actually force decenz suppresivr fire.
I recommend using Lambs danger ai, they do a very decent job on it
But i do believe that fireAtTarget makes ai shoot things it wouldnt normally shoot
If you want to destroy lefz behind trucks, how about giving them dynamic simulation. Once their sim gets disabled, thats the sign they were left behind. Just delete them or destroy them now
@quartz pebble
On the wiki: https://community.bistudio.com/wiki/UAVControl
It mentions:
A) Since Arma 3 v1.95.146028 this command returns both driver and gunner units if the UAV is controlled by 2 players.
B) [player1, "DRIVER", player2, "GUNNER"] - player1 is controlling the UAV and is the pilot, player2 is controlling UAV and is the gunner```
Does anyone have any idea how this is even accomplished? (2 player manned UAV's)
Is it possible to disable createVehicleLocal via CfgDisabledCommands, but still whitelist certain parameters? I need to disable it to help counter the script kids but I also need it for some of my own scripts...
nope, afaik
rip
BattlEye doesn't help?
I mean I can use scripts.txt but that can be bypassed since its client sided
Ip ban + publicly humiliate anyone doing it?
Have it write to the console and if you didnt call it, have the police move out
I mean I can use scripts.txt but that can be bypassed since its client sided
@autumn swift scripts.txt is server side... so no client can access that.
And you can give targets to who can execute a script inCfgDisabledCommands(server, client and/or HC), so it is possible to allow it to be called by the server and not the client.
@autumn swift scripts.txt is server side... so no client can access that.
And you can give targets to who can execute a script inCfgDisabledCommands(server, client and/or HC), so it is possible to allow it to be called by the server and not the client.
@exotic flax I was under the impression that is it possible for sophisticated cheats to bypass scripts.txt since IIRC it is ultimately the client that monitors the script filters and reports it to the server. Also I know about the target, but the problem is that I want to disable it for the client, but I still want the ability to execute certain whitelisted createVehicleLocal parameters on the client itself.
Whitelists only work for commands, not for parameters (except for parameter types).
Depending on the use-case you could also try createSimpleObject (does almost the same as createVehicleLocal, just without simulation)
Hey Folks,
I thought about my question from yesterday evening ...(https://discordapp.com/channels/105462288051380224/105462984087728128/735589830423216322)
... and was wondering if there is no easy way to just remove everything from the radio- and the uav-slot. Checkd the BI-Wiki and found tonns of remove commands (f.i. removeBackback) but notjhing for these two slots.
am I blind or does it not exist? ^^
do note that some items are slotted and not in the inventory, in which case
unassignItemshould be used (will remove it when it doesn't fit in the inventory)
AHHHHHHH NOW I (think) I UNDERSTOOD what you where pointing at
aaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
thanks
Is there a way in ace that I can disable the joining of groups through the interaction menu when there's more than x people in the target group already?
@stone totem unlinkItem to delete it immediately
afaik not, at least I can't find any variable which sets a limit
😮 it works!
(i hope
need to test a bit
ok ... so it takes the UAVs and CTABs out. But of cause Dedmen was right and the does kill the TFAR Radios (only on gamestart)
@still forum so i think i understood the problem you described yesterday (i think ...) but I have no clue how to get around that.
Is there an easy way to just delete the tfar-radio from the radio slot?
(sidenode: Some of the players will have LR-Radios which should stay)
while {true} do {
private _itemArray = ["itemAndroid","itemGPS","itemMicroDAGR","itemcTab","B_UavTerminal","TFAR_anprc148jem","TFAR_anprc152","TFAR_anprc154","TFAR_fadak","TFAR_pnr1000a","itemRadio","TFAR_rf7800str","VQI_Sentinel"];
{
player unlinkItem _x;
if(_x in items player) then {
player removeItem _x;
};
} forEach _itemArray;
diag_log "UPDATED";
sleep 0.5;
};
this is where i am atm
brb
_items = [player] call CBA_fnc_uniqueUnitItems; // If player has lots of items, this is faster and more efficient than simple items player;
{
if (_x call TFAR_fnc_isRadio || {_x call TFAR_fnc_isPrototypeRadio}) then {
player removeItem _x;
}
} forEach _items;
removes all TFAR radios
maybe needs unlinkItem too
wont that also delete the LR-Radios?
nvm
asked in the wrong forum
_wp = setWaypointType "SAD";
_wp2 = terrorist2 addWaypoint [position player, 0];
_wp2 = setWaypointType "SAD";
_wp3 = terrorist3 addWaypoint [position player, 0];
_wp3 = setWaypointType "SAD";```
I get "missing ; " when its executed
_wp = setWaypointType "SAD";```This is illegal. Instead:
```sqf
_wp setWaypointType "SAD";```
Hi
Is eject _x; not a valid command anymore?
Anyone have a method of finding a number anywhere in a string?
Since parseNumber only returns the number if it is at the start of the string.
Is eject _x; not a valid command anymore?
what is_x?
@exotic flax https://www.youtube.com/watch?v=pcqDtXS4BAM from the description, it's dropship crew
crew dropship1;
the error is "missing ;"
so _x is a unit
yes
and eject does not exist
so what's the correct one if not eject?
_soldier action ["Eject", vehicle _soldier];
so _x action ["Eject", vehicle _x]; ?
yup
letsee
Hmm can't seem to get it working, vehicle is just a generic name, right?
ie it's not supposed to be dropship1?
Okay it works ":D"
Okay it seems to be that the dropship doesn't follow the waypoints, they never trigger
I managed to make it trigger once
and apparently setVelocity is never overriden by the ai pilot?
Don't forget to set the aircraft AI to Careless so it doesn't get distracted
Also, action doesn't...always work on AI
Yeah I've set it careless
@still forum again thanks for your help but I think I need you again 😦
this is what I got now and it unlinks the radios and the GPS-Stuff which is exactly what i need .... but unfortunatelly it also breaks the LR-Radio functionality. Ingame it feels as if he would constantly delete and reassign a LR-Radio.
private _itemArray = ["itemAndroid","itemGPS","itemMicroDAGR","itemcTab","B_UavTerminal","itemRadio","VQI_Sentinel"];
{
player unlinkItem _x;
} forEach _itemArray;
_items = [player] call CBA_fnc_uniqueUnitItems; // If player has lots of items, this is faster and more efficient than simple items player;
{
if (_x call TFAR_fnc_isRadio || {_x call TFAR_fnc_isPrototypeRadio}) then {
player unlinkItem _x;
}
} forEach _items;
sleep 0.5;
};```
Tbh I could not completaly figure out what this line does.
`if (_x call TFAR_fnc_isRadio || {_x call TFAR_fnc_isPrototypeRadio}) then {`
In special (think thats propably a basic) I could not find what the pipes do. Is it like && ?
_items shouldn't contain the backpack itself I think, and also shouldn't remove it
Is it like && ?
yes, its "or"
ah ok. could not find it in the wiki. thanks 🙂
do .... now I clicked at "or" and there it is. doh!
oh lol, its not listed on wiki
&& is
its probably because || chars aren't allowed on wiki page titles
yes probably.^^
@still forum do you have a method of finding a number anywhere in a string?
Since parseNumber only returns the number if it is at the start of the string.
not a trivial way
findIf until you find the first number char, and then try parseNumber from that offset
you can convert string to array with toarray then select characters which correspond to 0..9 characters
then back toString and parse it
but it depends on what your strings are, if they have many numbers then it won't work
are they formatted in any specific way or not?
maybe you could give examples of strings
It's used for a universal door opening script, so mostly it's something like door_1
And simply need to get the number from the string
does it always have _ before number?
hmm
do you need this specific number or you just need to map door name -> any unique number? 😄
Currently doing it like so
params [["_door","",[""]]];
private _doorNumb = 0;
private _doors = getNumber(configFile >> "CfgVehicles" >> (typeOf _building) >> "numberOfDoors");
for "_i" from 1 to _doors do {
if (_door find (str _i) > 0) exitWith {_doorNumb = _i};
};
if second way suits you then you can implement a super fast lookup with namespace/hashmap
but why do you need this number? what for exactly?
like... how is this number being used later?
Using it in a findIf where I search for a UserActions config name
My method works fine, just wondered if there was a faster way of doing it
tehre isnt "easy" way to get the current door you want to open
anyway, you can calculate whatever you need to calculate, then cache it with a namespace
however, there are some other methods you can try like cursorobjectparams or just get the "nearest building" and "nearest" door
since you have a string, that string is the key, the result is whatever you needed to calculate
so...
check cache: if entry is missing, calculate it, add to cache
if entry is there, return value from cache
your cache key can be (typeof _building) + _door 
//somewhere in init:
gDoorIdCache = [false] call CBA_fnc_createNamespace;
// function code:
params [["_door","",[""]]];
private _key = (typeof _building) + _door;
private _valueFromCache = gDoorIdCache getVariable _key;
if (!isNil "_valueFromCache") exitWith {
_valueFromCache;
};
private _doorNumb = 0;
private _doors = getNumber(configFile >> "CfgVehicles" >> (typeOf _building) >> "numberOfDoors");
for "_i" from 1 to _doors do {
if (_door find (str _i) > 0) exitWith {_doorNumb = _i};
};
gDoorIdCache setVariable [_key, _doorNumb];
_doorNumb;
Since SQF is so damn slow with anything beyond 1+2+3, it's always good to cache anything where you want performance gain
(if you really think that you want it of course)
Hi , anyone know how to add whitelist to a Arma3 server ?
I want only people who have passed an exam to enter my server
so... you want to kick them by UID?
yes
And password does not suit you?
You could check client's UID in this event handler
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#PlayerConnected
But how to kick the client out... I don't remember.
I want to make that if you enter without the Whitelist it kick you off the server and you get a message like this "You are not Whitlisted . Please contact to an Administrator "
This is the message
@candid cape i beleve this forum post can help you out https://forums.bohemia.net/forums/topic/174726-player-slot-specific-whitelisting-for-trained-members-and-admins/
It could help me but , there is an other method to kick people before accessing to the server
anyone know this method ?
Hi! I am using setFace in a MP mission. It DOES work (specific faces load in MP), but I still get an error message, "Error Undefined variable in expression: _unit"
if (isServer) then {[_unit, "AsianHead_A3_02"] remoteExec ["setFace", 0, _unit]};
above is my .SQF and I have setFace in units init... just not sure what is causing that error message
Hi guys i have a question. So basicly i have applied lodaout of a plane with setPylonLoadout but i have a problem. So basicly when i applied a lodaout to a plane everything is fine exept the contorl of the bombs has the pilot and not the gunner is there anyway to change that or how would i aproach that ?
_unit is not defined. I incorrectly thought that it represented the players.
nope
if it is in an init field, use this to refer to the unit itself
@winter rose thank you very much
Hi I want to make a script that select ramdom 3 variables
The script is this :
selectrandom {_var1 , _var2, _var3};
_var1 = hint "hello";
_var2 = hint "Bye";
_var3 = hint "good afternoon";
Anyone can help me pls
@candid cape you should define vars before putting them in an array.
also, an array is defined with [], not {}
and hint returns Nothing, so you should randomise the string of text only
e.g```sqf
hint selectRandom ["hello", "bye", "good afternoon"];
If you need to support in your mission multiple factions (e.g. players can play east/west/indep) and multiple worlds, what would be your approach to organize the codebase?
Multiple worlds?
@quartz pebble multiple worlds: create the mission for VR , have a config file with all the parameters for the different terrains (like... spawn locations, loadout presets) . let whatever CI system you're using build the PBO & copy with different file names according to the supported terrains. idk.
also depends on what you want. pre-fabricated PBOs each with a fixed setting, or everything dynamic with players selecting their faction when they've already joined the game
Multiple worlds?
Read: multiple maps/islands
@jaunty zephyr so it all comes to build scripts which do the magic? 🙂
yes. if you want magic things, you've gotta do magic.
i'd probably build the scenario for one island and one faction first, then look into which things need to get parametrized to make it dynamic.
Is there a way to detect bullet impact using event handlers? Specifically bullets hitting anything (other entites, the ground, buildings, etc.). I only care about the first impact. I am currently doing it by spawning a tracking script when units shoot but I really wanna stay away from the scheduler if I can.
What I ultimately want to get is the firing time and position and the impact time and position. Getting the firing info is simple using a "Fired" event handler, but getting the impact info seems to not be possible without spawning a tracking script for the projectile.
is there a local version of bis_fnc_arsenal_data ?
trying to make multiple arsenals that only have specific item types in them
also i'm trying to get this to work
this addAction
["Full Heal",{[this, player,1,call ace_medical_treatment_fnc_fullHeal];}];```
it's just a VR selector in a spawn room that will heal you if you somehow hurt yourself
@torpid quartz Try:
this addAction ["Full Heal", { [player, player] call ace_medical_treatment_fnc_fullHeal; }];
Hey guys,
Could you do me a favor and look at this?
Somehow it tells me that the logic in the if-clause expacts a bool and tells me that it is no bool.
Can't see the failure o_o
if (({_x call TFAR_fnc_isRadio} || {_x call TFAR_fnc_isPrototypeRadio}) && (_x != unitBackpack player) ) then {
player unlinkItem _x;
}
Your first {} needs to be a ()
The first condition must always be a normal condition/bool with additional conditions being in the {} and resulting in booleans
Yes you can also put the unitbackpack check in { } for lazy evaluation
ok. now just cause I try to understand:
Where is the difference between () {} and [] in this language?
Hi, for the Balaclava (Low Profile Goggles) when you retrieve it's modlist using configSourceModList it will return the classname of the Contact DLC even though this goggle is part of the base game?
Example: configSourceModList (configFile >> "CfgGlasses" >> "G_Balaclava_lowprofile") RETURNS -> ["enoch"]
"enoch" is the "base game extension",
"contact" would have been the DLC @autumn swift 🙂
Yeah, some config entries have this issue (if you look in the Virtual Garage, some vehicles have the wrong icon too), that's what I'm using to get the correct mod:
private _config = configFile >> "CfgGlasses" >> "G_Balaclava_lowprofile";
private _addons = configSourceAddonList _config; // Get all addons that modify this class
private _addon = if (_addons isEqualTo []) then { "" } else { _addons#0 }; // Select the addon that initiated the class
private _mod = configSourceMod (configFile >> "CfgPatches" >> _addon); // Get where the addon is from
_mod
Should work but I haven't really tested it so ¯_(ツ)_/¯
it works .... juuhuuuu. "my" first script :D
thanks to everyone that helped the last days :)
It still has a bug but i can live with that.
// 24-07-2020 - Malcolm Heidenbrandt
// --------------------
// This Script deletes Androids, CTABs, UAV-Remotes and TFAR-Radios as soon as players try to use them.
// Script is planned for a 1985 Mission where all these items are not available.
//
// Thanks to Dedmen, PIZZADOX, Grezvany13 and Lou Montana from the ArmA3 Discord for their help!
// Bugs: Does not remove CTAB and stuff from the Backpack. Only when things are mounted.
while {true} do {
private _itemArray = ["itemAndroid","itemGPS","itemMicroDAGR","itemcTab","B_UavTerminal","itemRadio","VQI_Sentinel"];
{
player unlinkItem _x;
if(_x in items player) then {
player removeItem _x;
};
} forEach _itemArray;
_items = [player] call CBA_fnc_uniqueUnitItems;
{
if (_x call TFAR_fnc_isRadio || {_x call TFAR_fnc_isPrototypeRadio}) then {
player unlinkItem _x;
}
} forEach _items;
sleep 5;
};
@cunning crown seems to work so far, thanks for the solution
@stone totem instead of using a loop you can use a cba player event for loadout (which is triggered when the player's inventory is changed) and search through the unique items then
so thats basically just a functioncall that I put in the ini?
and for that i ignore the whole "while" thing?
Yes you would call your function from within the loadout eventhandler and you would get rid of the while loop
If you need to support in your mission multiple factions (e.g. players can play east/west/indep) and multiple worlds, what would be your approach to organize the codebase?
@quartz pebble
Check our setup
https://github.com/Sparker95/Vindicta?files=1
Devsetup.ps1 and scripts in tools/builder do the automation
Mission code is in src directory which is symlinked to missionname.mapname folders
@astral dawn Much reminds the approach we use 👍
I'm curious how do you use SQF-VM? Do you check with it how your scripts work?
Yes lots of code has automated tests
Even if it's not tested, it's compiled, which can catch lots of things before arma is started
Does allowDamage false on a vehicle also shield its crew from damage?
Only within armor protection ; crew still gets damaged @jolly bone
Great, thank you 👍
Isnt that mentionied in the biki?
Maybe im confusing it with a 3den enhanced tooltip
It's in the vanilla tooltip for the "allow damage" checkbox in the editor. But not on the wiki.
Allow or prevent an object being damaged (or injured, or killed).
It doesn't say anything about crew/cargo, since it only applies to the object itself.
And if it's possible to shoot through the object (like windows), it won't get damaged but still go through it and therefor damage anything inside/behind it.
IMHO no need to mention that on the wiki (perhaps as a note though)
Does anyone know if the addonFiles command work on the dev branch?
well yeah, it's there
Alright
Yeah but same with the connectToServer and that doesnt work
also, from https://community.bistudio.com/wiki/connectToServer
- only works on the Main Menu.
- must be executed from UI context, such as onButtonDown or similar events (see User Interface Event Handlers).
Might have tested it before the 17th then
ah yep, sometimes we have insiders' information to fill the #community_wiki before command's actual release yes
Alright ty
"sorry" for the confusion! 🙃
haha nw
see https://community.bistudio.com/wiki/addonFiles
Oh God, it's happening!
pathExists would be nice to have too... although...... it's already in Intercept
"paaPath" in addonFiles ["a3\3den", ".paa"]?
there is also https://community.bistudio.com/wiki/allAddonsInfo @astral dawn 😉
🎁
yeah that might be even better for debug 👍
@astral dawn is there some wiki or something for the intercept functions?
I am not entirely sure if pathExists is added by Intercept or by Arma Debug Engine...
Intercept is not about specific new SQF functions anyway
To somone who is really new to scripting and have only figured out how to make a simple teleport script. how can I make a teleport script work for only east?
how do you make this code?
Is it possible to make unit play and capture work on dedi?
I think so
How
unitPlay definitely works on a server. You'd simply spawn it in the same way as in any other circumstance, although for safety probably best to make sure it only runs on the server
not sure if unitCapture works on a server. If it does, it'll most likely work the same as usual for whichever client it's local to. But...why would you need to run it on a server?
soo.. does anyone know if sqf has a line length limit?
not sure.
getAttackTargetis fantastic btw
@slim oyster how so
You can have state machines based on a unit's enemy target
switching to another weapon
adjusting stance based on getting enemy target pos and calc'ing from there
it's just a way of getting the unit's target directly instead of the older more intensive and less reliable methods we used before
@fast wave you add a check for the units side. If the side is east => opfor, you teleport
[ missionNamespace, "arsenalClosed", {
//code
}] call BIS_fnc_addScriptedEventHandler;```
If I want that to run on every player do I have to put that in initplayerlocal or is initserver enough?
soo.. does anyone know if sqf has a line length limit?
Yes, and the length depends on "where" @tough abyss
does anyone know of a way to create a timer , that is non reliant on FPS? or is sleep the only way to do that?
What exactly is your goal?
the goal is i want to display a count down , before recording the time it takes to complete the objective. Also i want to accurately record the time
yeah i have found that if you are running at less than 20 , it starts to bugout (but i might be wrong)
I have just always been curious
its not like you can actually do much that would need uber accuracy like physix stuff
diag_tickTime - _previousDiagTickTime @gilded rover
Otherwise there is a countdown function I wrote somewhere on the wiki, under a training chronometer BIS function
thanks bud , i will go have a look 
Is it possible to disable the command from the command menu to get out?
Well, the problem I'm having is that on a public server the SL of a group is giving that command to another player to try and steal said players vehicle. And I can't exactly lock the vehicle because it's a transport heli
you can lock it when he is inside?
but then no player can get in the back of the heli
wait, what are you trying to do 
There's a group of pilots, they fly a heli each. Sometimes the squadleader wants to fly a heli one of the other pilots is flying. He then orders them, through the command menu, to get out, allowing him to steal the vehicle. These pilots are flying other people around from base to the objective
I want to disable the ability for group leaders to use the command menu to order other people out
nope, no can do.
make them AI that are not in his group and script their behaviour
Mmh, I guess I'll just tell them to make their own group if they don't want that to happen
or make a script that kills the SL if he drives these choppahs 😄
if (vehicle _leader == _forbiddenChopper) then {Hint "get out of me cah!"; pseudoCode kick leader from vehicle; pseudocode order _pilot getInThatCopper;};
@wispy cave
I don't know which pilot is flying which chopper when, they can all fly all of them, they just can steal them from eachother
so the pilots are AI or players?
players
are the pilots designated slots?
yes
and the leader is not a pilot?
no he's a pilot as well
oh
hm you could set up an uber complicated sign in/sign out system
where if you want to fly a helo, you have to apply at a flight control guy and if the helo is taken, you cant get in/get kicked out as soon as you enter it
but its probably not worth the hassle
nah, they can create their own group already so they'll just have to do that then
you could make them have their own group each in the editor
much pseudo
have a non-thief player be the leader
getInMan EH?
Make a complain addaction for the pilots and have a max counter until the leader is kicked :)
can I use or in a case? case ((a) || (b)): { for example
or and || are the same thing
yes
Yeah Ik
Based on the information you provided, yes you can
thanks 😄
https://pastebin.com/tgvMeWfq this works in the debug console
but when i run it via execVM in a script, it throws an error message because of the " "
anyone smarter than me knows a workaround for this?
i want to remove the " " from the actionKeysNames string
why would you…!!
want to show it in text not with "x" but [x]
nvm, my mistake - I mistook actionKeyNames for actionKeysNamesArray, which you should use
yeh, but i took this directly from BI scripts :p
evolve out of this shell!
I used it not later than a week ago
private _keys = actionKeysNamesArray ["ShowMap", 1];
if (_keys isEqualTo []) exitWith { /* no key to open the map */ };
private _key = _keys select 0;
hint format ["Press %1 to open the map", _key];
@west grove ↑ this should work
yeah, it does indeed.
weird, i used actionKeysNamesArray before in an old script and couldnt get it to work there either
guess i'm just a dum-dum
btw... prolly not the best solution, but
_key = str compile _keyWithQuotes;
should also work(?)
that even adds {} around it :p
also still some """" but doesn't matter. let's not waste more time with it :>
if you use CBA you can also use CBA_fnc_replace or CBA_fnc_trim
_str = [_strWithQuotes, '"', ''] call CBA_fnc_replace;
_str = [_strWithQuotes, '"'] call CBA_fnc_trim;
@west grove
// (...)
private _key = _keys select 0;
private _keyNoQuote = _key select [1, count _key - 2];
and no CBA dependency :p
if you don't use CBA as a dependency you're doing something wrong...
i hate how everything has CBA dependency :p
for missions it's usually overkill, but for modding it's a must IMHO
on the other hand... most of it should be in vanilla 🤷♂️
yyyup
ok, now i realize that i have another issue. the idea was to open the map screen and focus in a specific task / have the interface with that task open (not necessarily as assigned)
i could swear i did something like this already before
.. years ago
ugh, working with findDisplay is a pain
Is this something we can expect for the future update?
"#lightspot" createVehicleLocal getPosATL player :3
what would you use it for?
color picker?
Stealth! 😄
Surveillance spotlights - "a Hind D? Colonel, what's a Russian gunship doing here?"
is the daylight flare…? :3
No, I pushed that to next update, because these F'ing annoying people make me just hate that garbage. I know why the other programmers stay away from discord...
Would it be possible to get the light "amount" for the player also? 🙂
That is what the video shows @grim coyote
annoying people?
Yeah some people dont like that dedmen is hiding the arma 4 release date from us
I watched a yt video on how arma 4 will drop 2020 and the creator provided zero proof lol
aaah no, my bad
I thought the video showed new lightpoints, not "getAmbientLight"
Sorry Ded, didn't want to be one of those 🙃
They are reflector objects that we apparently have in internal.. We should really release that
I think they exist already? Floodlight, right ?
How performance intensitve is adding scripted lights?
Or in Contact?
Actually does arma do baked lights?
@spark turret it does lightpoints
?
Ah i thought its a rendering technique
Whats the maximum brightness and range
A nuclear bomb orb 👀
Been there done that 😄
does anyone have an idea on how to disable thirdperson regardless of how the players difficulty level is set (Singleplayer)
A loop detecting cameraView https://community.bistudio.com/wiki/cameraView
and setting switchCamera https://community.bistudio.com/wiki/switchCamera
This is so hacky😄 we should have disableThirdPersonView [onFoot,inVehicle] similar to ```
disableUserInput
This is so hacky😄 we should have
disableThirdPersonView [onFoot,inVehicle]similar to ```
disableUserInput
@cosmic lichen
i second this xD
@slim oyster thanks , I will have a look
I may open a ticket for it. Who knows.
Difference between using playMusic on global and server?
won't it end up with the same result?
global will mean all clients play it, server will mean server will play it which essentially means all clients will play it too
server won’t play it at all
unless the server is client then only that client will play it
A loop detecting
cameraViewhttps://community.bistudio.com/wiki/cameraView
and settingswitchCamerahttps://community.bistudio.com/wiki/switchCamera
@slim oyster
i had something similar "switching off" the ability to aim with machine guns if not prone. it felt like a bug, the players really thought arma was broken bc the loop cant be fast enough for the player to not notice it, bc performance.
its a less than ideal solution
i support to a"disableUserInput" alike.
global will mean all clients play it, server will mean server will play it which essentially means all clients will play it too
That's not how local commands work. Only some things apply to all clients if run on the server. playMusic is not one of them - the music will only play on the machine where the command was executed.
If you were to remoteExec playMusic on the server (using default parameters) then it would play on all clients. That's because the remoteExec is being executed on the server, and what remoteExec does is tell other machines to execute the command locally to themselves.
Is there a way to eject the player from the ladder he/she is climbing on? player action ["Eject",vehicle player]; applies to vehicles only
It should be something like dropladder (if it exists), check the biki action page? @autumn swift
@winter rose actually yeah I just noticed it as well in the wiki unit action ["ladderOff", targetObject]
However according to wiki targetObject must be a reference to the ladder which im not sure how to obtain ( targetObject is an object with a ladder)
objectParent player returns null when player is on a ladder. EDIT: so targetObject is the building that contains the ladder, for now I have the crude workaround of selecting the nearest building objects (which should contain thet arget building) and peform the ladderOff action on each of them
i just remember another issue i had a while ago --- i have a keyframe timeline in a mission file which i export as sqf. that sqf i am then loading in another mission file... but now i can't start the timeline anymore... anyone got any ideas?
as far as i can tell the objects are correctly created. it's just that nothing happens when running [x] call BIS_fnc_timeline_play
Is there a script command to cycle/select throwables? Or do I have to ensure that the first throwable I add to a unit is the one I want them to have selected?
@sly mortar what are you trying to achieve?
Throw a specific nade or select a specific nade?
I think selectWeapon can select throwables
Just to select the throwable type. I tried selectWeapon with "HandGrenade" and "HandGrenadeMuzzle" and it didn't seem to work.
remoteexec doesnt have to be called from the server
it can be called from anywhere, targeting anything
I know it doesn't have to be and I didn't say it did
I was making an example of how a local command could be made to apply to all clients when run on the server
could be made to apply to all clients when run on the server
local commands being executed on server doesn't mean they apply to all clients
they'll still be local. local to the server
yes, that was exactly what I said in the initial conversation, and the point I was originally making
I used playMusic in a mission today. Everyone could here it apart from me. I was Zeus however the server was a dedicated server. playMusic was executed only on the server. Can anyone explain why I couldn’t hear it as the Zeus if I am still a client?
- what was the exact command you used?
- are you sure other players could hear it?
By what means did you execute it? through the debug console?
Was there any other code in the trigger?
It might be worth checking if that attribute really was checked, because playMusic is a local command that does nothing if you run it only on the server, and the behaviour you described lines up, mostly, with the trigger running everywhere.
The attribute was 100% checked.
The attribute “server only” was checked.
@slate cypress this is your issue.
that doesn't sound right if other players could hear it. server only being checked would certainly be the issue if no one could hear it
How come I couldn’t hear it then but others could?
Surely if it is evaluated on the server, it is replicated to all clients.
It seemed to have replicated to all the players but not the Zeus.
Surely if it is evaluated on the server, it is replicated to all clients.
No, this isn't how locality works in Arma. Evaluated only on the server means only the server will execute the code. If something only happens on the server.......it only happens on the server.
but clearly the code is somehow being propagated to other clients. Which is not the documented, or previously observed, behaviour for this command.
Could it be because I didn’t actually go through the trigger?
No. The server simply detects "a player has entered the trigger" and consequently executes the on-activation code. It doesn't (/isn't supposed to) automatically send it to the specific people who entered the trigger.
Did you use any mods while creating the mission? (other than purely content mods like CUP or RHS)
Yeah that is what I thought but it didn’t actually work that way in-game
3den Enhanced?
Zeus Enhanced
Pretty much just those if you ignore the content mods
I don't know what 3den Enhanced might do in this context. It could be trying to be clever and automatically send the command to everyone.
ace too but I don’t think it has anything to do with that
In any case, the solution to your original problem (not everyone hearing music) is as Lou said to make the trigger not server-only, or to leave it server-only and convert the command into a remoteExec.
Ok thanks
What about connecting a trigger to a respawn point?
Should it be global or server only?
There’s no condition - it is just when any player steps inside the trigger.
A respawn point should be made as a “checkpoint” whenever any player steps into the trigger so that if they die, they can respawn close to the action.
So if Player1 steps into the trigger, it will activate the respawn point for all players
There’s no condition - it is just when any player steps inside the trigger.
that is what I wanted to know 🙂
Ohh
make it server-side
I thought you meant inside the condition box sorry
If I make it global, will it break?
Or will it just spam respawn points for everyone
Modules (and respawn points) are managed server-side if I am not mistaken. So make the trigger server-side only
Thanks
@slate cypress something just occurred to me. Do check your game sound settings. playMusic respects the volume of the Music channel. If you have music turned down...that would be why you were the only one who couldn't hear it.
nobody can say anything about the keyframe animation stuff? :x
old man is doing something before starting them, but i have no idea what
maybe recalculate the curve?
it seems none of the timeline related functions are working with keyframes spawned in this way
maybe something needs to be defined which doesn't happen when importing from .sqf
here is a repro mission if anyone cares: https://drive.google.com/file/d/19noPCeybPgkjfHIZPNVCYScbfJKG_0v3/view?usp=sharing
play repro_timeline, then run [BIS_Rautake_Timeline02] call BIS_fnc_timeline_play; to see that nothing is happening
@spark turret @west grove @slim oyster https://feedback.bistudio.com/T152928 I created a ticket about the third person view thing. Feel free to provide suggestions
Or are extremely iffy to get working even remotely
Revo, isnt that coming in next patch?
As a parameter or difficulty profile or something?
keyframes work pretty well.
nowadays i'm using them with pretty much anything that flies
much better than trying for hours to get a good flightpath recording done.
also you can edit it easily at any time while a recorded path must be redone completely
@cosmic lichen
stopgap measure until next patch:
["1stPerLimit", "onEachFrame", {
if (cameraOn == player && cameraView == "External") then
{
player switchCamera "Internal";
};
}] call BIS_fnc_addStackedEventHandler;```
only thing that remotely shows is the blink when you try to switch between viewpoints/cameramodes
performance impact is minimal, as far as i see.
reported 0.0015ms
but i guess that's as low as the engine can run the command with its profiler
also not tied to framerate, as it is run on each frame, so low framerates dont impact function
what about using ```sqf
condition1 && {condition2}
elaborate
just another way to make it quicker if cameraOn is not equal to player
ah, yeah
but it pretty much already runs as fast as the engine can run it
but true
actually no
condition1 && {condition2} takes exactly 0.0004ms longer
according to the profiler
ok
the logic is already so simple that i don't see much room in improvement without making it more complex, but that's just me
all in all, i doubt 0.0015ms will impact your performance much at all
ok, I just tested it and the blinking is annoying. That's the main reason I would like to see a better way of doing it
Just feels like the game is broken.
add a hint that says 3rd person is disabled in infantry-mode
🤷♂️
the blinking is aprt of arma 3
how about trying to disable the key input(s) for camera change
but infact, the system is NEVER switching to 3rd person
how about trying to disable the key input(s) for camera change
Is that possible?
you would have to run it every frame
since you want it to work in vehicles
or add an EH for getting in vehicle
and or you need a displayEH
'
and if youre not spamming the enter key 24/7, you wont mind the blinking
infact, i personally like the blink
why every frame? You just have a display EH for the key handle
it shows the user that something is happening
check status of vehicle
and not jsut their keybinds being wrong
have an EH for exiting vehicle to force back into internal camera
true
sec
@cosmic lichen
(findDisplay 46) displayAddEventHandler ["KeyDown", {
if ((_this select 1) in actionKeys "personView") then {
if (cameraOn == player) then
{
true
};
};
}];```
something like this
remember that it may be overridden by other displayEHs
not the most elegant solution, but ignoring keybinds never is
pick your poison 🤷♂️
if someone comes up with another solution, feel free to share
takes considerably longer to run, although not run every frame
Result:
0.108263 ms
Cycles:
9246/10000
Code:
if ((_this select 1) in actionKeys "personView") then {
if (cameraOn == player) then
{
true
};
};```
_this is not defined

Result:
0.0024 ms
Cycles:
10000/10000
Code:
if ((156) in actionKeys "personView") then {
if (cameraOn == player) then
{
true
};
};```
there
more reasonable result
so in the hands of those who know it's running on the background, yeah, it works
but if something else is using the displayEH attached to that action, it might override this
in conclusion, use the first solution to stay on the safer side and the second solution to remove the blink
use both solutions to be secure and remove the blink
both CAN be used at the same time
the first solution will just catch what is left through by the second
Hey guys, quick question (bit of a newbie when it comes to anything scripting or modding)
so i have created a script, that i normally use through the debug consoles local exec function
however recently it's gotten to be to much a chore and i have tried to compile it all into a better
version of the same script so it runs at the start of every mission, regardless of if its workshop/BI
i have packed .pbo file and im 100% sure im doing everything right, then again, im a huge noob with this stuff.
Is there any chance i can get someone to look over the file and see where/if i am going wrong?
i am willing to pay for your time, i dont expect the service of an experienced modder for nothing
if intersted PM me please.
Thanks in advance guys,
Spartan.
no payment taken, i can look at it ONLY for free
i dont wish, i demand
ill send you a link 1 sec 🙂
👌
@scenic onyx are you aware of the different init.sqf files and that you can call custom scripts with param execVM "yourscript.sqf"?
What does the script do and how is it executed?
@spark turret dont even ask
Yeah we pmd
He wants the script to execute post init which he has done correctly
Oh, youre the one who advised him on the init

I cant really help bc idk how to do addons
For the record, you dont use it for what he wants
Yeah i thought he just wanted to do a mission
I wish
I feel like it would be easier to make in a mission script and just add a line into the init.sqf if you make a new mission
Do you have experience with creating addons?
https://forums.bohemia.net/forums/topic/118877-how-do-you-make-a-script-into-a-mod/
I found that tutorial
Was wondering if thats the way to go
I dont need a tutorial
I need a tutorial on how to get someone to use mikero's tools
When they refuse to
Oh lol
Well i need a tutorial and was wondering if yiu can confirm what my link says
Does anyone know a good and easy way to create a "loadout selector"? Something like an arsenal where people can select "rifleman, eod, ftl, etc".
And if possible something that even non-scripters can place?
Tbh I am searching quite a while for something like this, but never found anything that made me completely happy.
Well the respawn allows you to select from a list of loadouts
Ace features default loadouts you can create which the players can then choose
Or you could do some custom stuff with getUnitLoadout and setUnitloadout. Basically create a puppet Ai where yiu adjust the loadout and clone it onto a player
Its the ace arsenal Malcolm and does not require any Scripting
Think I will have a look at ace first 😆 thanks
Ah you are talking about the default loadouts in ace?
Yes
Hmmm. And there is a way to configure the game so that people will get into the arsenal automatically in respawn?
... On respawn
Im quite sure you can have the player open the arsenal by script
if you wish to open a full ACE Arsenal on yourself or open ACE Arsenal via a custom action you can use ace_arsenal_fnc_openBox.
ace_arsenal_fnc_openBox
* 0: Box <OBJECT> * 1: Unit to open ACE Arsenal on <OBJECT> * 2: Ignore virtual items and fill ACE Arsenal <BOOL> (optional)
Examples:
[_box, player] call ace_arsenal_fnc_openBox
[player, player, true] call ace_arsenal_fnc_openBox
Ok. Thanks for the push into that direction. From here I gonna experiment myself.
That's the best way to learn things 👍
Is it a SP mission?
Mp
Then you will have to execute the ace command on the players machine.
Maybe initPlayerLocal is a good place for that
Ok. Thanks again. Will have breakfast now and will experiment later. 🙂
Sure thing
@hallow mortar I don’t think I have ever touched sound... but I’ll double check.
lets hope that works. it says For waypoints attached to a house, and you cannot attach them anymore. unless attachTo or waypointAttachVehicle works between waypoints and terrain objects?
I'll give it a try
ah, waypointAttachObject takes an id :)
can arma do addition of arrays? vector3 mainly
im to lazy to add every entry and recreate the array.
and a function for random vector3?
[random [-1,0,1],random [-1,0,1],random [-1,0,1]]```?
hm yeah that will do
doesn't exist, I did [-1 + random 2, -1 + random 2, -1 + random 2]
not ideal, but "close enough"
why -1 + random
Will -1 ~ +1
BI puts multiple things into one line too
"4" objstatus "done"; 0 = [] execVM "task4donecomms.sqf"
yes - POLPOX is correct, my solution is more "old school/quick & dirty" @spark turret
_hotelBuilding = [0,0,0] nearestObject 577391;
_bpos202 = AGLToASL(_hotelBuilding buildingPos 202);
[group tat2, 1] setWaypointPosition [_bpos202, -1];
but it doesn't work. he just goes to the ground level, center of the building.
AGLtoATL no?
https://community.bistudio.com/wiki/setWaypointPosition
says it needs ASL
and AGLtoATL doesn't exist 😄
does this only need to work for one building or multiple? @barren spire
it's just one building.
I mean I guess I could set the waypoints manually...
maybe I'm going to be talking heretic speak but if its only one you could just hardcore the coordinate, no?
yeah, gonna try that
maybe I'm going to be talking heretic speak but if its only one you could just hardcore the coordinate, no?
hisssssssss 🐍
if Bi can 0 = [] execVM he can hardcore a coordinate 
its a building pos. buildings usually dont move
nor setDir in MP 😄
I wonder if you can attachTo a building that comes with the map to a vehicle spawned in the editor
nope, technically you cannot setPos/setDir/attach terrain buildings
…this is why we can't have nice things!
in OFP you could setFuelCargo 0 all fuel stations… but then had to unload/reload the terrain to get them back to full (or script it back)

building pos seems to be relative to the building!
I hardcoded the waypoints and now they're in the ocean xD
also the 0 = [] execVM was done by me, BI only had [] execVM, but 3DEN didn't agree with that. "Returned Script Handle, expected Nothing"

weee 😄
i got a mission where you have to overwatch and defend a convoi from the air
but i have to much enemy AI and set it to dynamic sim, but the plane as the dymanci sim activator is less than ideal. could i make the convoi truck an activator?
that way only enemies near the convoi are active which is exactly what i want
deleted and re-created the waypoints... I don't think the AI likes those balconies... but I've seen it work before :/
it's also weird that the z-coordinate of the waypoints is like 7404... since when do we measure in centimeters, or wth is going on?
yeah, even in ASL it seems clearly wrong!
if I selectPlayer the waypoint is in the right spot, just the AI doesn't like it
works now
Do variables get discarded once an .sqf has run?
not the global ones
I need to make a dictionary which doesn't get discarded until the mission ends for the purpose of loadout saving.
only thing that remotely shows is the blink when you try to switch between viewpoints/cameramodes
@ebon citrus
onDraw eventhandler might be better there, might be able to get rid of the blink.
Also prefer to directly use the engine handler, instead of the scripted stacked handler, that would just add overhead.
does anyone know how to set the insignia in the right shoulder? In this link https://community.bistudio.com/wiki/File:A3_insignia_infantry.jpg, thanks
Thats a clan insignia.
squad.xml or Arma 3 units
that file can be placed in the mission directory?
Not trying to bother anyone but where do you guys reckon I should start about making a vehicle spawn/customisation garage in the editor
an ingame garage?
Alright, thanks a lot
@still forum do you mean onEachFrame?
Same as the stackedEH scripted stuff you posted.
But it doesn't have a script wrapper around it, thus less overhead
Can't see any
it was before missionEH introduction
So pretty much superseded?
stackedEH scripted stuff is old backwards compat leftovers, from before we had addMissionEH
Is there a teleport method you can use which teleports a given group into a given vehicle?
moveInAny
gib that command I just saw 👀
Yeah. In my case, I have only have passenger seats available in the vehicle which the players can fill. 😄
getMarkerPos transportTo errors saying undefined variable transportto
transportTo is the variable name for an empty marker I have placed in Editor.
markers have no variables
they have names
the name is a string, in quotes
getMarkerPos "transportTo"
someone got a classname for spawning in flares?
@spark turret
https://community.bistudio.com/wiki/Arma_3_CfgMagazines
and search for F_
okay so it seems the flares do work but not
"Flare_82mm_AMOS_White"
which is the mortar flare
maybe someone smarter than me can check that
yeah
reveal indeed…?
is there an object that's always local to the server? 🤔
trying to use CBA_fnc_targetEvent on a bunch of clients and sometimes I want to throw the server into the mix
yes there is CBA_fnc_serverEvent
no it cant, it wants object(s) :(
┬─┬ ノ( ゜-゜ノ)
quoth CBA:
["_targets", objNull, [objNull, grpNull, []]]
it seems modules / game logic are server-local, but dont want to create these just for me saving three lines of not-very-elegant code. CBA_fnc_serverEvent it is -.-
all editor placed objects are server local, unless they get moved over.
Like players get moved, AI's might with HC
yes. - different question: is there a game command for "player is in the esc menu", or do I need to find the respective control and check for that
there is one......
Well there is one for isPaused, but you can also check the display
isPaused doesnt work in MP :/
then check for the display
Hmm
I'm trying to make a flash drive intel
I've tried this/intel1 addAction["Take flash drive", {hint "Intel extracted";}]; but nothing pops up
actions are local. therefor the above code has to be executed on every client
So how should I go about it?
put it in the init of your flashdrive or any other editor placed object
okay. then thats likely not the problem. iirc there is also a condition parameter, and i dont see taht in you code
and "intel1" is the correct variable name?
That's exactly what I have in the init
and yeah it's named intel1
I tried it with "this", too
maybe cuz its an item and it will be placed into a weapon holder
The object itself is Land_USB_Dongle_01_F


