#arma3_scripting
1 messages · Page 109 of 1
My buddy said I should ask here about about making a mission work. I want to make a multiplayer mission where players need a "key" to open prison doors. If a player has a object('ACE_key_lockpick' in this case) than I want "player setVariable ["copLevel",1,true];" to apply to them. I do not know how to implement this thorough scripts, event handlers, or such. Thanks for any assistance.
I could still go for some help with this-
well, it's scripting after all
yea, scripting to place the stuff, then export it to TB later x3
inb4 there's a way to place the poles and TB does the wire creation
But yea, idk what's up. I also was never the best with geometry, so-
Perhaps one of the terrain builders has a solution for this already?
I'd give it a try.
I tried it, and couldn't find anything.
it looks like it's an issue with up/down?
angle isn't quite right-
Since terrain can slope up/down, the poles can easily be too far apart for the lines to reach. you should probably do just line pieces to line pieces then generate poles at the nodes.
that is an idea- then I could use this for the endings, since this does get me close, just not perfect
although, the too far part should be fixed by dividing the distance by 50, then plugging that into object scale.
but they way the powerline objects are set up, if you scale up, the lines get higher (i think?)
it's not the scale rn, it's the fact the angles aren't right 😅
wait...
I- I needa worry about roll??
... I needa worry about roll
I assume you mean the pitch angle? I think you'd need at least 2 iterations.
from end point, add line length toward goal (flat), find terrain height then pole height, find line length along that pole-height-vector.
at that point you can hope that the pole has enough leeway to accommodate the slope difference or do another check.
nah, I leave out pitch and roll, only have yaw change, then I manually change pitch via the eden widget, local of the object, roll it's 0 and it's aligned
How can i play the sound of an plane engine?
I'm using the C130 static for the players to jump out of the rear but its awfully quiet.
the config of the plane i want to borrow the sound from just has
soundEngine[] = {"",1,1};,
Plane and plane_base_f classes as well.
only real alternative i find is this
soundEngineOnExt[] = {"A3\Sounds_F_Exp\vehicles\air\Plane_Civil_01\BTT_engine_start_ext",1,0.8,600};
is there a sensible way to create this sound source?
i am inclined to just attach a normal plane above the static of the plane and have that simulate the sound ...
how is eden rotating it?
Arma 2 had the c130 sound for this scenario.Maybe try CUP.
with the widget, how is it rotating-
grr- ok, I guess I'ma have to use cables instead 😅
cables then poles, I mean. Instead of pole, then cables generated between them
_plane say3d "VTOL_01_int_engine_rotor"
do i need to loop this?
Depends if you want it to keep playing, I'm just saying this sound probably fits
is there a way to figure out the duration of that sound?
you could probably find the actual file and play it which would display its length
not wrong
funnily enough, i was about to just attach that vtol above the c130 ^^
Does anybody have any recommended SQF editing programs? I’ve written a gear script and shit won’t work and I can’t find the error
vs code, with sqf extension
Yeah - explosive > 0.7 (or was it 0.6... its on the wiki anyway) ignore penetration values (caliber) EXCEPT for foliage
is there any way to have only one player executing a script locally on a dedicated server ? i
Well yeah? You can execute scripts on whatever machine you want.
its a bit comlicated i guess, im working with the animal as agents and there´s no way but executing it locally on one machine
this is what i have:
// spawn goat
_goat = createAgent ["Goat_random_F", getPosATL goat_pos_1, [], 5, "NONE"];
// following loop
[_goat ] spawn {
params ["_goat"];
while {true} do
{
sleep 3;_goat moveTo getPosATL goat_pos_1;
};
};
the only way it works, (no more anyimals then one is shown, is ingame via execute local
i tried that
too
"scripts\animals.sqf" remoteExec ["execVM","zeus"];
what does the "execute locally button exactly do ? (code wise)
sorry where can i find formating this right for the discord forums here, ?/ code?
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
The expression can be executed in the unscheduled environment using the following buttons:
Local - execute on player's computer using remoteExec to call the given code.
Global - execute on all computers using remoteExec to call the given code. Only enabled in MP.
Server - execute only on the server using remoteExec to call the given code. Only enabled in MP.
Performance Test - See: diag_codePerformance
Local is something like { //code in box goes here } remoteExecCall ["call", clientOwner];
but I don't feel like this is going to answer your question.
You'd need to specify what your code entry point is, and how you're identifying the client that you want to run on.
Is there a way that a player could clip their grenades and smokes to their rig/belt/backpack? Similar to how DayZ does it
Local createSimpleObject on each client and set position each frame, depending on player's inventory
Thought its a newer thing but apparently not (tested in 1.10)
Also these old dark green Altis forests 😢
SOUL vs SOULLESS
jk ofc, but I like old trees better
Even map was less pale 🤔
Probably altered for Tanoa or something, which is barely played compared to Altis
which is which? 
says in the bottom right watermark
oh neato
cant you attachto with body movement tho?
lineIntersectsSurfaces 
Not serious of course, would be very janky in a best case scenario
Does anyone have a solid multiplayer method of determining if a unit is killed by explosives?
A sure fire way would be to store the object name of the last damage taken on the client's computer and upon death, you use the last taken value and check if it is an explosive class name or not.
Is there a way to get the default vehicle/unit name "B Alpha 2-3:4" when it has a variable name assigned, other than piecing it together throug side groupid and group unit order?
MPHit and MPKilled event handlers could be used.
not afaik, why?
I need to show which remote pylon the player is selecting. Not a problem!
MPHit can't be relied on to be triggered upon death
Ya, have had problems with that before as well. What about just the regular "Hit" event handler.
Same thing, just read it.
Hello guys,
can someone tell me how to read the positions of all playableUnits on the map? I want to put a marker over each playableUnits.
HandleDamage is very unstable as well
get the postition of playableUnits, could do it in a forEach loop, example:
{
createMarker ["Marker1", position _x];
} forEach playableUnits;
There is an Explosion event handler. "Triggered when a vehicle or unit is damaged by a nearby explosion."
Okay thanks, but how can I set the markerType? When I try to do this nothing is shown on the map.
someone in here was doing the same thing a day or two ago, i can't remember what they came up with
Only returns the object the event handler is assigned to and the damage inflicted though.
it would need to have a variable, so like this:
_marker = createMarker ["Marker1", position _x];
_marker setMarkerType "Warning";
or whatever type you wan instead of warning
You need to give each marker a unique name or it won't work
okay I have already tried this but somehow only one marker is created
there's a command to check hit damage on individual body parts isn't there? i think he decided that's the best course of action
e.g.
private _marker = createMarker [format ["UnitMarker%1",netId _x], position _x];
_marker setMarkerType "Warning";
This format is based on the unit's unique network ID, which means you can reconstruct it later if you want to update the markers again
Because of what nikko said
If its for all playable units, wont the network id of the playable units that are AI still just be the server? In which case it would be the same?
Object network IDs aren't the same as machine network IDs
ah kk
HitPart is an event handler for it. If you want a loop for checking damage to parts you can use getHit
player getHit "head"; for example
getAllHitPointsDamage player;
//[
// ["HitFace","HitNeck","HitHead","HitPelvis","HitAbdomen","HitDiaphragm","HitChest","HitBody","HitArms","HitHands","HitLegs"],
// ["","neck","head","pelvis","spine1","spine2","spine3","body","","hands","legs"],
// [0,0.0939002,0.0319932,0.0858595,0.174491,1,1,0.168495,1,0.5,0.195907]
//]
It's ok thanks for the info, I've used hitPart before for target practice feedback and didn't realize it returns objNull in case of an explosive. I should be able to use that since manually adding the classnames isn't an option as it will break modded explosives support.
As far as I know there is no set function for the class of explosive versus the class of standard ammunition. Even then, what is an explosive round classified as? Bullet or explosive?
Not sure, that's a solid question. Looking at hitPart I don't think it will work for me as I would need to retrieve the persons UID who triggered the EH. It's not crucial but would've been a nice little addition to the mod.
I'll post back if I get a reliable working method
Is there any way to broadcast curatorCamera over a network to players? I'm trying to attach a zeus object directly to the zeus camera and everything works well but unfortunately it isn't propagating across the network so other players dont see the object moving.
Here is the (rudimentary) code I have so far:
godcam_victim = _this#0;
onEachFrame {
godcam_victim attachTo [curatorCamera, [0,3,-2.2]];
if (!alive godcam_victim) exitWith
{
detach godcam_victim;
onEachFrame {};
};
};
};
[_this] call godcam_fnc;```
cameras are local so no
instead you have to broadcast its movement
how can i put a square bracket inside a string?
ah thats what i feared
is there an efficient way to do that at all or is pretty much just gonna be a case of spamming getpos?
RemoteExec setWind[x,y,forced]
When trying to remote execute the setWind command, i am greeted with the following error.
9:33:45 Error when remotely executing 'setwind' - wrong number of arguments (3) passed, must be either 0, 1 or 2
9:33:45 Error in expression < _xWindEnd);
eventhough the syntax describes 3 parameters?
https://community.bistudio.com/wiki/setWind
Is this a bug or am i doing something wrong?
from what I see you're attaching another object to a local object, so if the other object is global it should broadcast its movement. you can try adding a dummy setPosWorld to force the game to see the updates I guess
godcam_fnc = {
godcam_victim = _this#0;
godcam_victim attachTo [curatorCamera, [0,3,-2.2]];
onEachFrame {
if (!alive godcam_victim) exitWith
{
detach godcam_victim;
onEachFrame {};
};
godcam_victim setPosWorld getPosWorld godcam_victim;
};
};
[_this] call godcam_fnc;
btw you were attaching the object every frame. that could be why it wasn't broadcasting anything
I was because whenever I tried attaching just once it didnt follow movement
well you shouldn't attach something every frame...
ya ofc i was purely just trying to get it to work lol
also I don't think you can attach stuff to cams? 
[[x, y, forced]] remoteExec ["setWind"] or something like that 🤷♂️
you can
it works well locally just not in mp
ill try that when i get a chance to test tho thanks
of course - lmao, i need more coffee 😄
eh, remoteExec needs some brainbending even when fully awake
you could also try this:
godcam_fnc = {
godcam_victim = _this select 0;
onEachFrame {
if (!alive godcam_victim) exitWith
{
detach godcam_victim;
onEachFrame {};
};
if (isNull attachedTo godcam_victim) then {godcam_victim attachTo [curatorCamera, [0,3,-2.2]};
godcam_victim setPosWorld getPosWorld godcam_victim; // probably not needed
};
};
[_this] call godcam_fnc;
will see
as of rn what I know is that it works completely in local guy stays attached and all perfectly, only issue is propagating that movement to other clients so im hopeful the setposworld solution is what i need
...when that string is inside an array
Is there a limit on setLightFlareMaxDistance? Seems like it is shown only in few hundred meters
I set it to 3000
Seems like light flare is not rendering in specific condition. Even when the LOS is not blocked.
However light of flare grenade/mortar shell is visible in long range...
How do I set my light flare visible in long range?
How can I change the following code so that it does not check if the player is alive but conscious? At the moment the function is executed even if the unit is unconscious.
if(alive p1) then {
_playerMarker1 = createMarker ["marker1", _playerPosition1];
_playerMarker1 setMarkerType "hd_objective"; //Marker typ
};
inb4 “unconscious” but in ACE
Does the condition then look like this?
lifeState p1 == UNCONSCIOUS
I use ACE, is this another unconscious state?
Okay, do you know how I can check if the unit is conscious when I use ace?
okay thanks
How would I get the status of 3den widget cordinate space?
global vs local transformations
ahh action, right. Ok thanks ^^
Can you not pass a value to a switch's case statement?
Hm, I was getting undefined errors when trying to reference variables
Post code
private _value = floor random 5;
switch (_value) do
{
case 1: { hint "one"; };
case 2: { hint "two"; };
default { hint "zero, three or four" };
};
Ah, it wasn't the normal cases (i.e. case x...), it was the default case
params ["_vehicle", "_role", "_unit"];
if !(isMultiplayer) exitWith {};
if !(_unit call CWR_fnc_isPlayer) exitWith {};
switch (_role) do
{
case "driver";
case "gunner": { (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 1, true]; };
default { (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 0, true]; };
};
_vehicle and _unit are undefined in the default case
What is the value of _vehicle and _unit if default case gets executed?
use params with default values
Are they undefined in the default cause, or is the default case happening because they're undefined?
They're definitely defined, it's just specifically only erroring out in the default case
Default Case is missing )
Copy/paste error
k
If I'm remembering right, I had this same kind of thing happen before but the values were passed through params/_this rather than being already defined
Add a diag_log for vehicle and unit
Yeah they're definitely defined, gives the proper vehicle, role, and unit
Well, the code works for me.
The variables only seem to be defined for me if I re-do the params in the default case, so like default { params[...]; ... }
[vehicle player, "commander", player] spawn
{
params ["_vehicle", "_role", "_unit"];
switch (_role) do
{
case "driver";
case "gunner": { (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 1, true]; };
default { systemChat str [_vehicle, _role, _unit]; (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 0, true]; systemChat str _role;};
};
};
Works fine.
inb4 CWR_fnc_isPlayer undefines _vehicle/_unit :3
I would be somewhat impressed, given that it just returns a boolean on whether a unit is a player and/or a remote controlled unit
If it uses variables named _unit and _vehicle and fails to private them, it would overwrite the ones from the upper scope
yeah. Had the same thought. These are the worst mistakes
It'd just be _unit if anything, but I had taken out the multiplayer/player checks for testing and was still getting an undefined error
Are you testing in SP or MP?
SP and lan MP
I mention this because netID (allegedly) doesn't work in SP
It just returns ""
The testing I did in SP was just using some diag_logs, not the "actual code"
I want to make it where:
Player 1 walks into trigger
- timer starts
Player 1 walks into second trigger - time it took is displayed with scroll wheel option on an object.
How would i go about doing this?
Hi. Trying to make script spawning group with random number of units (6-15) and randomly equipped (using dzn_gear loadout customization script).
As i think, i need to make multi-dimensional array there unit class and loadout will be.I don't really know how to do it correctly, I provide my attempt to write this script below:
_Alpha = createGroup resistance;
private _pos = [getpos UPS_heli, 0, 6500, 0, 0, 0, 0] call BIS_fnc_findSafePos;
_peh = _Alpha createUnit ["I_officer_F", _pos, [], 0, "FORM"];
[_peh, "UPS_marker"] execVM "ups.sqf";
[_peh, "kit_AAF_officer"] spawn dzn_fnc_gear_assignKit;
_RandomUnits = [
["UK3CB_AAF_I_MG","kit_AAF_Machinegunner"],
["I_Soldier_M_F","kit_AAF_Spotter"],
["I_Soldier_AT_F","kit_AAF_Carl_Gustav"],
["I_Soldier_GL_F","kit_AAF_grenadier"],
["I_Soldier_LAT_F","kit_AAF_light_at"],
["I_soldier_F","kit_AAF_RIFLEMAN"],
["I_Soldier_AR_F","kit_AAF_AR"],
["I_engineer_F","kit_AAF_ENGINEER"],
["I_medic_F","kit_AAF_MEDIC"],
["I_Soldier_exp_F","kit_AAF_Exp"]
];
_RandomUnit = [_RandomUnits] call BIS_fnc_selectRandom;
for "_i" from 1 to (6 + floor random (15 - 6 + 1)) do {
_peh2 = _Alpha createUnit [_RandomUnit, getpos _peh, [], 0, "FORM"];
};
Of course it is wrong right now, may be someone can help with it....
you createUnit with the array selected in _randomUnits
_peh2 = _Alpha createUnit [_RandomUnits, getpos _peh, [], 0, "FORM"];
Must be this way?
private _newGroup = createGroup resistance;
private _pos = [getpos UPS_heli, 0, 6500, 0, 0, 0, 0] call BIS_fnc_findSafePos;
private _peh = _newGroup createUnit ["I_officer_F", _pos, [], 0, "FORM"];
[_peh, "UPS_marker"] execVM "ups.sqf";
[_peh, "kit_AAF_officer"] spawn dzn_fnc_gear_assignKit;
private _pool =
[
["UK3CB_AAF_I_MG","kit_AAF_Machinegunner"],
["I_Soldier_M_F","kit_AAF_Spotter"],
["I_Soldier_AT_F","kit_AAF_Carl_Gustav"],
["I_Soldier_GL_F","kit_AAF_grenadier"],
["I_Soldier_LAT_F","kit_AAF_light_at"],
["I_soldier_F","kit_AAF_RIFLEMAN"],
["I_Soldier_AR_F","kit_AAF_AR"],
["I_engineer_F","kit_AAF_ENGINEER"],
["I_medic_F","kit_AAF_MEDIC"],
["I_Soldier_exp_F","kit_AAF_Exp"]
];
for "_i" from 1 to (6 + floor random 10) do
{
selectRandom _pool params ["_unitClass", "_loadoutClass"];
_peh2 = _newGroup createUnit [_unitClass, getpos _peh, [], 0, "FORM"];
[_peh2, _loadoutClass] spawn dzn_fnc_gear_assignKit;
};
@cosmic lichen Thanks, mate. Looks like it works how i need it.
You don't need to escape brackets, its only the quotations you need to escape (unless you start mix the outer/inner quotations up i.e 'test"test')
Sharing a script for attachTo at current position relative to a bone on the parent object. Many thanks to Leopard20's matrix examples.
amp_fnc_attachToRelativeBone = {
params ["_child", "_parent", "_bone", ["_lod", 1e15]]; // Memory
if (!isNull attachedTo _child) then {detach _child;}; // Get vectors in world space
private _childPos = _parent worldToModel ASLToAGL getPosWorldVisual _child;
private _childY = _parent vectorWorldToModelVisual vectorDirVisual _child;
private _childZ = _parent vectorWorldToModelVisual vectorUpVisual _child;
private _childX = _childY vectorCrossProduct _childZ;
private _bonePos = _parent selectionPosition [_bone, _lod];
private _offset = _childPos vectorDiff _bonePos;
_parent selectionVectorDirAndUp [_bone, _lod] params ["_boneY", "_boneZ"];
private _boneX = _boneY vectorCrossProduct _boneZ;
private _m = matrixTranspose [_boneX, _boneY, _boneZ];
private _pos = flatten ([_offset] matrixMultiply _m);
_child attachTo [_parent, _pos, _bone, true];
_m matrixMultiply [_childX, _childY, _childZ] params ["", "_vY", "_vZ"];
_child setVectorDirAndUp [_vY, _vZ];
};
See it in action https://youtu.be/H8h3h3ifjiA
is this the part where i mention i did something the exact same without any matrices for two primary weapons v1
mandatory "evenshually" joke
https://community.bistudio.com/wiki/vectorSide is a thing since 2.14, it can save you one vectorCrossProduct when getting _childX 🙃
Excellent. Now just need selectionVectorSideAndDirAndUp
just give us direct access to reading/writing transformation matrix already. I want to be able to mirror/skew things as well 
but since you need another _parent vectorWorldToModelVisual it's actually slower in this case xD
Yo, I'm currently developing a DLL extension for a server-side mod that I'm working on and I was wondering how can I verify the mod actually runs. I have the dll setup so it will create a logging folder on attach but it doesn't seem to work. Anyone has any tips when working with dllextension and generally good ways to debug it?
Add diag_log into your script that calls it.
That would print to log if it runs
thanks, stupid question. had a syntax error elsewhere
hey, whats the code to blow a truck up via a trigger? i cant remeber it at all
Can anybody remind me of exactly under what circumstances AI go into "combat" mode? And does putting them in "careless" prevent them from doing that automatically?
object setDamage 1;
If you put them in careless then they stay there, yes. I think safe+ will transition if AUTOCOMBAT is enabled but I'm not sure on the exact trigger mechanisms.
Having some issues, the sleep happens when i first run the code however it starts skipping it
giveMaterials = {
_pos2 = (getPosATL player) getPos [15, getDir player];
_finalBuilding = nearestObject _pos2;
income = 2;
complete = true;
while { complete } do {
[income] spawn {
uiSleep 5;
_text = markerText "Marker1";
_strSplit = _text splitString ":";
_strNum = _strSplit select 1;
_mp = parseNumber _strNum;
_result = _mp + income;
_text = str _result;
"Marker1" setMarkerText "MP: " + _text;
_pos2 = (getPosATL player) getPos [15, getDir player];
_finalBuilding = nearestObject _pos2;
if (!alive _finalBuilding) then {
complete = false;
};
uiSleep 1;
};
};
};
``` Which im executing via this command
```sqf
[] remoteExec ["giveMaterials"];
Not sure why its skipping it
indentation :/
complete is a global variable, which seems... wrong
Would that break the suspending though?
Nothing's going to break suspending.
But something is, the code waits 5 seconds. then runs without pausing
I'm struggling to tell what it's trying to do
What the code does?
It adds 2 to the number in some marker text until the nearest object to a point 15m in front of the player is dead/null/whatever?
Correct. Im realizing now i need to change the object detection. but thats for later
Spams threads?
It's running a spawn in a while loop?
Yeah, I thought i need to run either spawn or execVM to suspend
Can while statements use sleep?
Only if they're in scheduled code.
I still have no idea what you're trying to do.
what it is doing is pretty crazy.
crazy as in stupid? or as in weird
I don't know. Are you intending to create a few million SQF threads?
I'm not sure tbh, Not very good at optimizing code i make
Like I said, I can't tell what it's trying to do so I can't fix it.
Maybe someone else can guess correctly.
I appear to have fixed my issue, by swapping the spawn and while's positions
That would at least be relatively sane.
I will look into SQF threads to figure out what those are and how i can prevent creating too many
Thank you
Every time you call spawn it's creating a scheduled thread and then continuing with what it was doing.
So if i put spawn before the while, it only creates one?
so:
[] spawn { whatever };
};
Is thread spamming.
This however is a reasonable construct:
[] spawn {
while {true} do {
// whatever
};
};
I was just spamming the spawn statement
So it wasnt ignoring suspending
It was just making alot of them
I see
Thank you again, you have taught me something very helpful
Can anybody tell me exactly what setBehaviourStrong does?
Units and groups have separate behaviour values that do different things.
setBehaviourStrong sets both. Probably.
Got a banned player who is mass-connecting to spam the server for several hours a day for the past few days out of the week. I want to hide Player [BANNED_GUY] has connected. and Player [BANNED_GUY] has disconnected., but I don't want to hide all str_mp_connect / str_mp_disconnect messages -- only the malicious user's.
Any ideas?
I've even used Firewall rules to dump his connection, but he just uses VPN to cycle new IPs every time one gets blocked...
Well you can add a filter for names there, but he might figure it out
That code is just chat messages filter
Yeah, I figured blocking his username would only last so long...Do you think there could be any way to user onPlayerConnected or something to pass/attach info to the message source?
onPlayerConnected is done when they go from lobby to the game, no when they join the erver
Well you can let him in, set him some profileNamespace variable, save his name and then filter it out from connected messages
When he changes his name\IP he probably won't change his game profile so that profileNamespace variable remains
He joins, your script check that var is there, kick him and save his name for ignoring again
Couldnt you tech use his steamID..?
Oh true, it he doesn't change his steam account you can just check by UID
Thought its a cheater situation where they swap accounts too
Using UID is what I'd like to do, I just don't know how to do it. He's not a cheater, just a toxic psycho lol.
Cheaters usually stockpile accounts during sale
I'm certain he will likely start using alt accounts if/when it comes to that, but at least then he has to spend money to harrass haha.
Not usually, but there are some persistent ones
Didn't base Arma 3 go for like -90% recently or something?
That's the moment when they do it
private _uid = getPlayerUID player;
if (_uid == "PUT_HIS_ID_HERE" ) then
{
// Put your code here
};
Something like this prob
Or just get it from server logs
getPlayerUID already returns a string
Oh
I have his UID from BattleMetrics, so don't need getPlayerUID.
Well
I think I have the pieces to do what I wanna do, just not sure the order/how to do it 😅
Still he'll be able to spam "connecting..." because I don't think there is an Event Handler that fires on that
or if it's even possible
onPlayerConnected fires during Lobby->Game transition
You will still need to pull the uid per player because it needs to pull each person connecting to match it
str_mp_connect handles "player XXX connected" and str_mp_disconnect handles "player disconnected" -- but I dunno how to personalize that. It would just hide everyone's connect/disconnect messages instead of only his.
Maybe OnUserConnected?
Oh yeah, its a thing now
So that's what you need
Then get his name with https://community.bistudio.com/wiki/getUserInfo
So you can broadcast it to players so they can ignore it with connecting\connected\disconnected messages
Using my code snippet you can build his name like this:
format ["%1%2%3", _left, _name, _right];
_name = "Sa-Matra"; format ["%1%2%3", _left, _name, _right]; => Player Sa-Matra connecting
This snippet?
Yes
But how can it be tied to his UID?
You need to get his name from UID elsewhere
Would he need to connect in order to get his UID?
in OnUserConnected, then broadcast it to players so they can use it in that function later
Yes
So I would have to unban him but write some kind of silent kick on match?
You can check their UID with getUserInfo in onPlayerJoinAttempt and kick them
Not sure if it will still produce a chat message for others
Does it show a chat message if banned player is trying to connect? 🤔
Yes
It shows XYZ is connecting, XYZ has connected, XYZ has been banned, XYZ has disconnected
Well if it goes to connecting\connected state, OnUserConnected will probably fire so you can grab their name
addMissionEventHandler ["HandleChatMessage", {
params ["_channel","_text"];
_channel = _this select 0;
_text = _this select 3;
_ltxt = toLower _text;
if(_channel == 16) then
{
{
if(_ltxt find _x > -1)exitWith{true};
} forEach [
//[localize "STR_MP_CONNECTION_LOOSING", " "] call BIS_fnc_splitString select 3, // Losing connection
[localize "STR_MP_VALIDERROR_2", " "] call BIS_fnc_splitString select 2, // Modified Data
[localize "str_mp_connecting", " "] call BIS_fnc_splitString select 2, // Player connecting
//[localize "str_mp_connect", " "] call BIS_fnc_splitString select 2, // Player connected
//[localize "str_mp_disconnect", " "] call BIS_fnc_splitString select 2, // Player disconnected
"rulebreakingg" // Ban Message Spam
];
};
}];
This is what I have been using to hide the general XYZ is connecting... messages and then I set his Ban Reason to "rulebreakingg" as a test and it does hide his kick message. All that's left is "has connected" + "has disconnected" + the "Due to how the server is set up you must wait 10 seconds to reconnect" counter from KickTimeout[] in the server config.
- Get his name on
UserConnectedevent by UID check - Broadcast it to everyone
- Ignore all
_channel == 16messages that contain this name
Probably something like this
Yeah that makes sense. How would I broadcast it?
publicVariable, remoteExec
psychoName = ...;
publicVariable "psychoName";
_text find psychoName >= 0
Maybe make it an array so you can keep several UIDs out
Is there a simple way to get file path in addon file?
For eg) I want to use portraitMusic_ca.paa icon in modules_f_curator.pbo.
Yeah, definitely should be an array lol.
Where did you get that file name in the first place?
Is it displayed somewhere without a path?
manually
Dump whole config with kju's tool, Ctrl+F the file name
searching for all addon files in arma folder with pbo tool
You find \a3\Modules_F_Curator\Data\portraitMusic_ca.paa
Maybe you can write a script that could dump you all strings that match input string
what tool did you use?
Thanks for the help man, really appreciate it. 🙂 I'll poke around with things and see if I can get it sorted. Worst case, I'll just nuke the global join/leave messages and that solves that, but I appreciate the help in going the extra mile to preserve it for everyone else. 🙂 I'll let you know if it all works out.
Here is the All in One Config for Apex, as of June 11th stable branch update (1.62.137494).I will be updating these periodically and will include dumps with some of the larger and more popular mods. All of these will be view able from this directory, dependent on what game version the dump was on...
oOo thanks I'll look at it
Just FYI: got the 4 spam messages down to 1 by using Ban Sync from BattleMetrics 😆 Only gotta hide the "XYZ disconnected" message now haha.
Wrote a script snippet to search entire game's config for you:
private _search = toLower "portraitMusic_ca.paa";
private _matches = [];
private _func = {
{
if(isClass _x) then {
_x call _func;
} else {
if(isText _x) then {
private _text = toLower getText _x;
if(_text find _search >= 0) then {
_matches pushBackUnique _text;
};
};
};
} forEach configProperties [_this];
};
configFile call _func;
{
diag_log _x;
} forEach _matches;
_matches;
Watch out, its pretty slow, freezes the game for a while
Wow thanks
the first problem is finding the icon, and then pasting
this will help 2nd step musch faster
Dumps results into RPT and returns the result so it shows in debug menu or where you'll call it
["\a3\modules_f_curator\data\portraitmusic_ca.paa"]
I am writing a script to run in the 3DEN Editor. What is the correct way to create a group and have some units join it? createGroup and join don't seem to be saved by the Editor.
Tested with GMG, same shotShell simulation, yet grenade doesn't explode like tank HE shell does
I compared two shots together but I can't seem to figure what defines if shot explodes on such weak penetration
Maybe you have an idea? https://pastebin.mozilla.org/QbC734Kz/raw
Listed are different config properties between two
Will mirror the question in #arma3_config
I couldn't find any way to do it with existing units. Maybe it will be necessary to change my script to instead create new units and groups via create3DENEntity.
did you use alternative syntax? because its looks like what you need
oh nvm you want edit existing unit. Probably add3DENConnection
How do I correctly switch back to the player's camera?
SPE_Cam_Veh cameraEffect ["terminate", "back"];
camDestroy SPE_Cam_Veh;
Doesn't seem to work
switchCamera player?
Actually, yes. Thanks
The effect type "Terminate" is used to exit the current camera view and switch back to the player's view.
This part on the biki is a bit misleading I think. Sounds like just terminating the camera would automatically switch back.
Is there a reason of why would I start getting this error when my mission was running fine until I updated my server binaries for my dedi?
Warning Message: Preprocessor failed with error - Invalid file name(empty filename)
The mission works just fine on LAN with no errors on startup and behaves as expected
could the mission file "broke"?
what is the file name
thats the thing, idk, haha. As mentioned, the mission was working just fine until the binaries were updated, it does not point towards anything specific
Sounds like you have a broken/wrong include somewhere. If it works on LAN it should also work on the dedi tho.
Maybe some of your serverside mods that's only on the dedi ?
im inclined to believe this is the case, as dedi has some additional stuff than lan does. Ill try to diagnose, thanks for the pointer
#include <iostream> ?
Hi guys, can someone help me with finding the loading screen messages for Livonia?
I found them in Addons\map_enoch.pbo and opened it with a pbo viewer, then converted the cfg from a .bin into a .cpp file
but they're not in the usual format
they're shown like this
loadingTexts[]=
{
"$STR_A3_C_CfgWorlds_Enoch_LoadingText1",
but on the Arma 3 Community website theyre shown like this
loadingTexts[] =
{
"Area of Stratis is 19.3 square kilometers.",
and I want them to be actually readable
so if anyone knows where I can find the text for the Livonia screens please let me know thanks
forceUnicode 1; copyToClipboard(getArray(configFile >> "CfgWorlds" >> "Enoch" >> "loadingTexts") joinString toString [10]) => https://pastebin.com/raw/vjdv03Af
go into editor, input this into console
you'll have all texts in the clipboard
What happens when there's a mismatch between a unit and his group's Combat Behaviour? Also, with setBehaviourStrong, does it include any functionality that involves resisting changes to combat behaviour in the future?
thanks @meager granite big fan of ur game mode btw
@drifting sky As far as I can tell they're used for different things. Stance is based unit behaviour while driving pathfinding is based on group behaviour, for example.
A followup question is I'm looking for any way to make ai more aggressive while they are in combat mode. I'm looking to have them move more quickly in other words, and toward the enemy.
@drifting sky an age old arma problem
You can try disableAI "COVER" / "SUPPRESSION". No promises but it could help.
If you're working with LAMBS Danger, you can use their task functions to get more aggressive behaviour out of the AI.
Another thing I've seen tried is restricting the AI from entering Combat mode at all, using disableAI "AUTOCOMBAT". They will still fight, but without some of the Combat-specific behaviours.
Don't forget to also set their Courage skill right up.
is attachTo always disabling collision or is there a way to enable the collision?
disabling autocombat seems to do nothing
They still go into combat mode, they still do the bounding overwatch
similarly, disabling enableattack on a group still allows ai leaders to issue attack orders.
BTW, can we count stack of recursive function?
Sure, have a counter in top scope or send a counter as argument
No engine support for it. Ok, Thanks!
Is there an EH equivalent of a theorical "WeaponAimed" EH already in the game? I am trying to detect if an Ai unit is about to fire and prevent it if its suppression levels are too high in order to emulate "fear" and perhaps also forcing it to take cover, currently they behave like terminators too much when fired upon
https://community.bistudio.com/wiki/aimedAtTarget
Probably this?
Not sure if it works as KK's note suggests, but it is an old note as well
Thank you, will give that a try 😉
Ok, I can confirm it only works on vehicles still
Have them miss by messing up projectile velocity
Fired event handler, _this select 6 is the bullet, do something like:
_shot setVelocity (velocity _shot vectorAdd [-10 + random 20, -10 + random 20, -10 + random 20]);
I know how to make white and blacklists for ace arsenals using class names but is it possible to do it for a whole mod? Like if I only want to whitelist RHS and CUP can I do that without having to whitelist each individual item from those mods?
Good alternative, I already do that to prevent the static MGs from being laser accurate when manned by Ai... yet having an EH specifically for weaponAimed would be far more performance friendly since a unit takes perhaps a second to aim while in the same second it can fire several (docens) of bullets all running that code. Currently in Arma, Ai firing already eats lots of FPSs even without a firedManEH on the units
We have WeaponDeployed and WeaponRested Event Handlers but no WeaponsAimed 😢
What was the command to have hints visible when viewing through a camera?
showHUD?
Just found it, its cameraEffectEnableHUD
Hey, any ideas why ctrl is not rotating?
with uiNamespace do
{
ctrl = findDisplay 46 ctrlCreate ["ctrlStaticBackground", -1];
ctrl ctrlSetPosition [0.5,0.5,0.1,0.5];
ctrl ctrlSetBackgroundColor [0, 0, 0, 1];
ctrl ctrlCommit 0;
angle = 0;
onEachFrame
{
with uiNamespace do
{
if (angle > 359) then {angle = 0};
ctrl ctrlSetAngle [angle, 0.5, 0.5];
angle = angle + 1;
};
};
};
ctrlCommit is missing I guess Seem to not be the case if 4th param is not set
Also, keep in mind, depending on FPS the control will rotate faster/slower
well, if it's ctrl - it shouldn't go into local scope 
Forget that. I messed it up
The issue is that ctrlSetAngle only works on images or active text
with uiNamespace do
{
ctrl = findDisplay 46 ctrlCreate ["ctrlStaticPicture", -1];
ctrl ctrlSetPosition [0.5,0.5,0.1,0.5];
ctrl ctrlSetBackgroundColor [0, 0, 0, 1];
ctrl ctrlSetText "a3\3den\data\attributes\loiterdirection\ccw_ca.paa";
ctrl ctrlCommit 0;
angle = 0;
onEachFrame
{
with uiNamespace do
{
if (angle > 359) then {angle = 0};
systemChat str ctrl;
ctrl ctrlSetAngle [angle, 0.5, 0.5];
angle = angle + 1;
ctrl ctrlCommit 0;
};
};
};
This works.
Ty!
Can someone help. I'm spawning different type of vehicles from array and want to check if is there place for gunner or commander in this vehicle then spawn them too. If not spawn only driver. Can't find want parametr i need to check in config file to find available crew seats in vehicle?
There is no one config property that lists or controls that. Each crew position is configured separately. You could count them manually, but it would be easier to use https://community.bistudio.com/wiki/emptyPositions.
@hallow mortar Yeah, already taking a look at this command in wiki. I think it must help
interesting , but emptyPositions is closer to my objective, i think.
[] spawn fnc_spawnVehicle;
fnc_spawnVehicle = {
_newGroup = createGroup west;
private _pos = [getpos UPS_heli, 0, 6500, 0, 0, 0, 0] call BIS_fnc_findSafePos;
_VehicleClass = ["UK3CB_GAF_B_BRDM2","UK3CB_GAF_B_BRDM2_ATGM","UK3CB_GAF_B_Offroad_HMG","UK3CB_GAF_B_UAZ_AGS30","UK3CB_GAF_B_UAZ_MG","UK3CB_GAF_B_Ural_Zu23","UK3CB_GAF_B_Gaz66_ZU23"] selectRandomWeighted [14.28,14.28,14.28,14.28,14.28,14.28,14.28];
_veh = _VehicleClass createVehicle _pos;
_crewman1 = _newGroup createUnit ["UK3CB_GAF_B_RIF_1", _pos, [], 0, "FORM"];
[_crewman1, "kit_GAF_RIFLEMAN"] spawn dzn_fnc_gear_assignKit;
_crewman1 moveindriver _veh;
nul=[_veh,'UPS_marker'] execVM 'ups.sqf'
};
_commanderplace = _veh emptyPositions "Commander";
_gunnerplace = _veh emptyPositions "Gunner";
if (_commanderplace > 0) then {
_crewman2 = _newGroup createUnit ["UK3CB_GAF_B_RIF_1", _pos, [], 0, "FORM"];
[_crewman2, "kit_GAF_RIFLEMAN"] spawn dzn_fnc_gear_assignKit;
_crewman2 moveincommander _veh;
} else {
};
if (_gunnerplace > 0) then {
_crewman3 = _newGroup createUnit ["UK3CB_GAF_B_RIF_1", _pos, [], 0, "FORM"];
[_crewman3, "kit_GAF_RIFLEMAN"] spawn dzn_fnc_gear_assignKit;
_crewman3 moveingunner _veh;
} else {
};
Spawning only vehicle and driver 😦 What's wrong with it?
Does createVehicleCrew not do what you want?
i have a feeling this is chatgpt written for a few parts atleast
given a few tags etc look custom so idk if you made this seperately
no, it's written by me 😄
apologies just saw some unusual use cases but yeah a better read through shows that
my script abilities is very bad, so....
is the drivers side the default as when you remove the part that spawns the driver,gunner etc?
ok slow down if you dont mind what is your goal
i don't understand, you mean side "west" or what?
ignore that what are your attempting overall?
i want script to check if is there an commander or gunners place in spawned vehicle, then spawn customized unit in it
if vehicle have only driver place then only driver spawns
ok give me 5 minutes ill write up a short script and explain it
sorry actually i have to go hope someone else can give you a hand this looks decent but check the conditions you may have to use fullcrew and sort for turrets and most vehicles have driver seats
Ok. I am not checking driver's seat in this script, it spawns directly
May be that is the reason that only driver spawns
should be able to use fullcrew to see who is in the turret
Is there a way to get skeleton bone names?
iirc you may be able to use https://community.bistudio.com/wiki/selectionNames on a unit
Hey so im sorta new to the whole scripting thing for arma 3, I have messed with functions before and have experience with scripting in Fallout I have an idea on something I want to do but I am wondering if I can get guidance on how to create variables such integers, refs and floats etc with this language. Maybe a wiki of some sort with the core structure of the language?
Hello fellas, when testing with multiple Arma instances on the same PC, does every Player object return the host only? Looks like im have some "fake" locality issues.
You know the player object isn't immediately client-local in MP?
They're initially created on the server and then control is passed to the client machine.
Shouldn't matter whether they're on the same PC or not.
Does anyone know how I could create a health bar for an enemy ship?
oh drat, totally forgot each object is server based first LOL
do you have any suggestion on how to wait for the transfer to be done?
Im having some issues since most of the code im working with is supposed to be run locally but seems to be at fault when the transfer happens.
I have already tested the code itself on only local units/player itself and works perfectly
waitUntil local player?
turns out my problem is much more complex that just locality itself. HitPart doesn't seem to behave nice on remote units unless the shooter also has the event applied to the remote unit.
What is the best approach to make cutscenes in MP? I suppose I may run into problems with JIP, late joins, etc. So some parts may broke, collide, or just not play at all mid game.
Land_Military_ID_Card_01_F is likely to be the name of the Editor-placeable container that holds the item, not the inventory item itself
One way is to place the container, inspect it in the Config Viewer, and check its TransportItems/TransportMagazines subclass.
However, in this case, that won't work, because Land_Military_ID_Card_01_F is not a container for an inventory item - it's just a prop. It's not interactive and doesn't contain anything.
There are CSAT ID card things that contain inventory items, but they're not visible in the Editor. You can find them in the Config Viewer under CfgVehicles (container) and CfgWeapons (item).
The container classname and item classname, respectively, are:
Item_CSAToperatorAccesCard_01 // Csat_Id_01
There are 5 distinct types, just change the numbers from 01 ... 05
The Item_ prefix is BI's (inconsistent) convention for indicating that it's a vehicle that's for containing an item.
Emphasis on inconsistent
how do i make a npc with a automatic rifle shoot semi automatic?
If you want something that is clearly ID but not CSAT-specific, there is Wallet_ID
Keys
often used to unlock doors, not faction-specific :P
function(_test) { player sideChat format["t: %1", _test]; }("hello world");
function keyword added to carma
good morning, anybody tried these yet? "Added: Extended scripting commands getDir, getPos, and new commands getRelDir, getRelPos" from the devbranch changelog
nvm got the info i needed from the wiki :)
Huh, turns out that damage sent to crashed\frozen player is ignored if their client times out and ownership transfers to server
- Player 2 freezes and crashes
- Player 1 shoots Player 2
- ... is losing connection
- Player 2 disconnects, P2'unit ownership goes to Player 1
- P2'unit is undamaged
inb4 shooting that same unit again after ownership transfer applies cumulative damage, including what was caused in step 2.
Tested it, nope, all that damage is just lost
I guess if Player 2 didn't crash and eventually regained connected the damage would still arrive to them
or would be lost in non-guaranteed network depths
or in guaranteed that are considered to be "sent already, why bother resending?" 🙃
Tried re-connecting before previous client drops, you get "connecting failed"
@meager granite what have you been working on recently? Been seeing a lot of damage questions/testing from you recently.
Trying to have detailed damage tracking for stats\entertainment\anti-cheat purposes
https://community.bistudio.com/wiki/BIS_fnc_showSubtitle, but there are community alternatives with more customization
Is there an explanation/reason of why hitPart only fires on the shooter pc but not on target pc?
It's kinda counter intuitive to have to set up the handler to the object on each shooter pc instead of just setting it to the target you are gonna monitor and do something with that info.
Wouldn't it make sense to have 2 versions of it, one for shooter and one for target is that the case?
I know handleDamage kinda serves a similar purpose (beside its damage handling abilities duh) but it's a little problematic to have the info for detailed selection impacts on hitPart but not handleDamage, specially considering hD returns the hitpoint impact 3 times on different variables.
i assume it's because bullet damage calculations are done on shooter's machine only 🤷♂️
Yeah, HitPart is when shooter hits target (FIRE geometry), thus shooter client side, HandleDamage is when target gets damage calculated by shooter (HitPoints geometry), thus on target client side
Wish there was HandleDamage on shooter side too
HandlePreDamage or something
Yeah, it's just how the engine works. Arma has shooter-side hit detection and object-owner-side damage.
well, if such is the case then I will have to either figure out how custom hitpoints are being identified by the likes of ACE or live my life with network spamming until I figure out the previous. Thanks for the insight guys
I have a problem that I need help with. The point is that I created a warlords scenario and also a custom asset list. The basic AI skill is 70% but I want the AI skill to vary depending on the unit. For example, the sniper should have a higher skill than the normal shooter. What code do I have to write in the description.ext or other file for this to work and above all HOW DOES IT WORK (I have 14,000 hours in Arma 3) please help.
yeah, spent the whole day yesterday reading the medical section for their functions.
It's not clear to me whenever they are declaring just on config and getting via handler or if they are doing something additional to actually assign the hitpoint position and then getting such hitpoint.
place a fake hitpoint deep into the damage tree => log every incoming damage until fake hitpoint gets hit => sort by damage number => apply damage according to most damaged hitpoints => clear the queue, wait for the next dumpsterfire to occur
I assume the fake hitpoint has a dependency on all the others so it's guaranteed to fire.
The real spanner in the works here is the two shooter-side handleDamage calls.
Possibly ACE just hopes that they don't interfere.
In theory you can have two shots with interleaved handleDamage calls, because the shooter-side and target-side calls hit in different frames.
inb4 fake damage calls don't inherit fake hitpoint and don't fire it
I'd be surprised if they did given that they only fire hitHead and general damage.
If they took any notice of hitpoint dependencies then they'd also fire incapacitated, but IIRC they don't.
magic 
they do #structural instead of body or incapacitated
that's just a translation of the ""
This is what they actually do to hitpoints: https://github.com/acemod/ACE3/blob/0e2c7167a5f83026e9407a77fa2043bc46daabb7/addons/medical_engine/script_macros_config.hpp
Kinda surprised that it works because the HitHead that normally fires is shooter-side...
ah wait a minute
class HitLeftArm: HitHands {\
material = -1;\
name = "hand_l";\
radius = 0.08;\
visual = "injury_hands";\
minimalHit = 0.01;\
};\
They are just using the selection to know where the hitpoint is?
That's the standard relationship between selections and hitpoints, isn't it?
Vanilla behaviour has single hitpoint for both left and right arms.
(and another single hitpoint for legs)
so by just defining a new hit point and using the selection as reference they are able to get the info from handle damage itself?
nice, will we see named arguments as well? :)
apparently.

its that the reason of why armor breaks though? or is that other issue regarding the ballistics component?
You mean units being nearly invulnerable to body shots?
ye
It's kinda working as intended :P
i would assume you have to set new passthrough and armor values for these additional hitpoints too unless they have a way to just inherit the arms and leg armor values?
please help
hmm, not sure if they have a hack for adding arm/leg armour back in. It's fairly rare in common Arma mods.
@brittle badge In script terms it's just a matter of calling setSkill on your AI after spawning it.
but that's not something you do in description.ext.
Warlords has dynamic unit spawning so you'd need to hook that.
thanks but how my friend
I think i can work with this if it is the case.
the units in the asset list
You would need to read the Warlords code and figure out where it's creating units.
well, you could hook entityCreated I guess...
but that's ugly and may collide.
class B_recon_TL_F
{
cost = 100;
requirements[] = {};
};
and how to Set the skill under the unit
or by req?
_setunitskill?
I don't know, that's custom Warlords config.
May or may not have skill-setting capability.
did you know one guy ho can help me ?
Nope.
@brittle badge you can create a event handler for "EntityCreated" then filter by class and adjust skill, however, a quick scan through warlords code shows that they change the skill, like when a place is on defense, so that would overwrite whatever you did anyways
when sectors are created, they add random skill to the units as well:
for [{_i = 0}, {_i < _garrisonTotal}, {_i = _i + 1}] do {
if (_i < _spawnPosArrCnt) then {
_spawnPos = _spawnPosArr # floor random _spawnPosArrCnt;
_j = _j + 1;
} else {
_spawnPos = [_center, random 50, random 360] call BIS_fnc_relPos;
};
_newGrp = createGroup [_side, TRUE];
while {count units _newGrp < 8} do {
_newUnit = _newGrp createUnit [_unitArr # floor random _unitArrCnt, _spawnPos, [], 10, "FORM"];
_newUnit setSkill (0.2 + random 0.3);
};
...
...
...
_turretplace = _veh emptyPositions "Turret";
_turretPaths = allTurrets [_veh, false];
while {_turretplace > 0} do {
_crewman4 = _newGroup createUnit ["T_cdf_TTsKO_pilot", _pos, [], 0, "FORM"];
[_crewman4, "kit_CDF2_pilot"] spawn dzn_fnc_gear_assignKit;
_crewman4 moveInTurret [_veh, [0, 0]];
};
What can i put here instead of [0, 0] to make crew spawn in all free turrets?
Hello! Any good tutorial about how to make a script with the function like the RCO sight and how to implement? Trying to find at YT but it always shows me mods recommendations and how to use it in game 😦
- Use
moveInAny; it automatically uses turrets before cargo. _turretPlaceis not automatically updated on eachwhileiteration, the way you have it written. You need to check it again each time.
Since you're replacing the loadout anyway, I suggest you use createVehicleCrew
Can anyone point me in the direction of a simple AI respawn script to respawn a few groups of enemies with a customized loadout (including shoulder insignia)?
wish the spectrum device functions from the contact pbos weren't exclusive to the contact branch
Are they? I remember playing around with them and they're OK
Doesn't it mean it works in vanilla but doesn't in Contact? 🤔
^
it means i cant use all of these functions in a mission unless everyone buys/loads up the contact branch
(i think)\
Iirc the object is in the base game, but the scripts you describe arent loaded unless contact it
Is*
I'm 100% sure I tested these functions without contact
As in in normal game (with Contact bought though)
@digital hollow yeah, your variant works, but i can't assign unitclass to spawn
I stand corrected, now I have to go look at them all...
Does the class matter when you change the loadout afterwards?
@digital hollow not so much, only unit have different identity types
Just checked in editor without contact loaded, cant find any of the functions that he had in his screenshot
https://i.imgur.com/YKWQf7y.png
Checking with the functions viewer, these are the only ones loaded
https://i.imgur.com/7X28l2T.png
Okay, you're right, I mixed it up with with these # variables for the display
Honestly strange why these functions aren't alongside the spectrum device
There are quite a few functions and other things in Contact Optional that I feel really should come to Contact Platform. Antenna stuff, HUD compass, EMP'd vehicle and optic variants, BFAs.... but a dev said very recently that nothing else is going to be brought over.
Is there any command that counts not in vehicle units in group?
There's no command specifically for that, but it's a pretty easy check to make.
_number = (units _group) count {vehicle _x == _x};```
I'm sorry, that's backwards
_number = {vehicle _x == _x} count (units _group);```
Thanks, will check it out
For an array of references to the units in question, you can use select, which is that way round:
_array = (units _group) select {vehicle _x == _x};```
The world would be a better place if the array/condition syntaxes for count and select were the same shape :U
Is there a way to tell if a classname is an optic, bipod, muzzle? I'm trying to scan through CfgWeapons and get only those items
I feel like there is a command for this but I can't find it
I think the item type number (in its itemInfo subclass? maybe?) determines what it is.
Disregard isKindOf, they all share the same kind of "ItemCore"
Like Nikko said. Each item has an item type.
isKindOf isn't a completely reliable way of doing it. There isn't a base flashlight class that all flashlights are guaranteed to inherit from. You could have a unique flashlight class that only inherits from ItemCore - most vanilla flashlights are like this, even. isKindOf would not tell you that's a flashlight unless you had specified its own classname as a flashlight class to check against.
* same for other accessory types
So you can use isKindOf if you already know all the types of accessories you want to look for, but it's not a good way of doing an open-ended search.
It looks like siderail accessories are type 301, muzzle devices are type 101, optics are type 201, and bipods are type 302.
Or use https://community.bistudio.com/wiki/BIS_fnc_itemType I guess
Oh thx for finding those as I was looking through the config and couldn't find them
An item's type is in its CfgWeapons entry, in its ItemInfo subclass
Make sure you have Leopard20's Advanced Developer Tools installed for a much nicer config browser
oh that would probably be a good first step
the only type I was finding was type = 131072 but that was definitely not right as they all had the same number
That's the type listed in the main config class. You need to look in the itemInfo subclass.
I'm assuming the itemInfo subclass is not visible in the vanilla config? That or I'm blind
It is. Once you've selected the item in the left panel of the config viewer, you should see an expanded list of its subclasses, also in the left panel. itemInfo is one of those.
Oh I see
I was only viewing it from the CfgWeapons perspective and not actually going into the class config view
Thx for the help NikkoJT and Fraali 
_NonCargoUnits = {vehicle _x == _x} count (units _newGroup);
if (_NonCargoUnits > 0) then {
_veh2 = _VehicleClass createVehicle _pos;
{_x moveinany _veh2} foreach _NonCargoUnits;
} else {
};
@hallow mortar This not working, seems because _NonCargoUnits is number. Is there any chance to make this work?
Ok
@hallow mortar
_NonCargoUnits = {vehicle _x == _x} count (units _newGroup);
if (_NonCargoUnits > 0) then {
_veh2 = _VehicleClass createVehicle _pos;
for "_i" from 1 to _nonCargoUnits do {this moveInAny _veh2};
} else {
};
Also don't want to work. Swears at "this" in {this moveInAny _veh2};
Okay, no, hold on, this isn't what I thought you were doing
Use the select method I posted before. That will return a list of units, instead of a number. You can then count that list to determine if there are units in it:
if (count _nonCargoUnits > 0) then { ...```
and then use the `forEach` as you were doing before.
@hallow mortar it's all working now. Thank you very much 🙂
anyone know how to muffle sounds. i am trying to simulate a less dense atmosphere and i want to add an effect of muffledness. i am using ace btw, if that makes a diffrence
sound muffling and sound shaders in general are done in config, there is no easy way to simulate interiors/extriors by just using code sadly
doesnt ace have earplugs. how does that work?
fadeSound is the core command I think. That is just volume though.
systemChat "All Players Ready";```
having an error with this, how do i do **or** instead of using || ?
|| and or have the same meaning.
For starters, {_x getVariable ["ready",false]} forEach allPlayers will only return the last players value. It wont make sure every player is ready.
As for the error, what is it?
its saying expecting true or false when i tried or. The force players ready is a thing the team leader can do and that starts the mission but the RPT isnt liking it.
systemChat "Al>
Error position: <|| force_players_ready)}; ```
forEach returns nothing so that's why
could i do for allPlayers instead of forEach?
its to fix the day of the rangers (black hawk down coop) mission, author hasnt been online for ages and im not sure how to fix the error
correct, and i think the || force_players_ready is so teamleader can force all players ready
Thanks! I'll give that a try and see what RPT says
Hmm I think I missed one, probably != instead of ==
getting this error now, am I writing it correctly?
systemChat "All Players Ready";
>
14:52:24 Error position: <= -1;
systemChat "All Players Ready";
>
14:52:24 Error Invalid number in expression
14:52:24 File mpmissions\__cur_mp.Mog\arsenalstart.sqf..., line 22```
allPlayers findIf {(_x getVariable ["ready", false]) == false} == -1 more like this
The code that Polpox sent is ... == -1, is there a reason you changed it to ... !== 1? (Assuming that's the same bit of code)
i thought thats what he meant by = Hmm I think I missed one, probably != instead of ==
findIf already requires boolean and boolean == boolean is unnecessary
But u have to do == or negate inside, cause one non-ready player is enough to not start.
Hence I said !=
But findIf looks for the first element which meets the condition, that is why u need it inside. Otherwise u could get a false positive result. You need to look for the first who is not ready.
getting this error
systemChat "All Players Ready";
>
15:07:01 Error position: <= -1;
systemChat "All Players Ready";
>
15:07:01 Error Invalid number in expression
15:07:01 File mpmissions\__cur_mp.Mog\arsenalstart.sqf..., line 22```
!== Is wrong change it to this !=
thanks! that fixed the error showing in RPT
Your condition for waitUntil, check the var names:
{ (allPlayers findIf { (_x getVariable ["ready", false]) == false} == -1) || forceReady }
it fixed that RPT error but the server was restarting itself for some reason, it said missing config class for some CUP stuff so im going to make sure the mods are all good/reinstall them then try again and see what RPT says
and thats the code for it?
That's BI's code. That's showing you that they change the skill regularly.
and that works for the warlords asset list?
how to put it in? /wehre
I'm telling you that in multiple places, BI changes the ai skill multiple times. So anything you do, it's not going to stick and gets over written.
If I want to make an AI stay at one spot but still turn around, throw grenades, and shoot, do i turn off Path or Movement in abilities?
Path
cool thanks
Hi, im using a spawn Script wich works with markers and uses getMarkerPos as a function to get the spawn postition since getMarkerPos always returns 0 for the z coordinate it doesnt work on roofs or the aircraft carrier. is there an easy way to fix this or do i need to work with obejects and getPosasl
Note that that only works for script-created markers that actually have a Z coordinate to preserve. Editor markers are always placed at ground or sea level.
If you want Editor placement and 3D placement, it might be better to use an invisible object rather than a marker as your reference.
I tried to place it with a script
_marker = createMarker ["newMarker", [0,0,0]];
_marker setMarkerType "Icon";
_marker setMarkerShape "ICON";
_marker setMarkerColor "ColorRed";
_marker setMarkerText "Height Marker";
But I didn’t work either
Well you created it at [0,0,0] (the zero coordinates of the map, one of the corners) and never moved it. That will definitely result in getting a 0 Z coordinate when you check its position.
Yeah I know that was just the template
I don’t got the script on my phone only the template, but I replaced it with the correct coordinates and the debug console still shows “0” for z
Hey all, attempting to use the libertad horse mod for my units deployment. Recreating TF Dagger. Only issue is they dont have any carrying capacity. Im attempting to script in an inventory for the horse, anyone got a good starting point?
If i want to disable a trigger locally, how would i go about that? - mainly after the trigger has been used to improve performance
You can add a local argument (variable) to the activation condition in the trigger, which can be switched to false, so that it gets never triggered again, but you have to uncheck the server only option in the trigger.
Condition for local exec:
if (hasInterface) then { player getVariable ["triggerSwitch", false] && this} else {false};
No need, you can use enableSimulation to disable it temporarily or deleteVehicle for a permanent solution.
Maybe deleteVehicleLocal; I'm not sure if deleteVehicle will delete the trigger globally. Usually everything about triggers is local, but this may be an exception, so you'd have to test that.
inb4 _trg setTriggerActivation ["NONE", "PRESENT", true]; _trg setTriggerInterval 1e13; 
does anybody know where for example Virtual Arsenal takes the addon-logo for each weapon from? I tried using the config's 'dlc' property, running it through cfgMods to get the picture, but that only works for a handful of addons. I also tried BIS_fnc_weaponAddon but it's very heavy and also did not get me anywhere. Any ideas?
Ticket about fake HandleDamage fires that affect non-MP compatible unit bleeding and something else I have no idea about
params [["_config", configNull]];
//Get the DLC, make sure it's a DLC and was not modified by a mod (CBA, ACE)
private _addonClass = "";
private _sourceConfigs = configSourceAddonList _config;
//Exit if there are no source addons
if (_sourceConfigs isEqualTo []) exitWith {[]};
private _mods = configsourcemodlist (configfile >> "CfgPatches" >> _sourceConfigs # 0);
//Exit if there are no mods
if (_mods isEqualTo []) exitWith {[]};
_addonClass = _mods # 0;
//Exit if class name is empty (Vanilla Arma 3)
if (_addonClass == "") exitWith {[]};
//Return class, name and image of the addon
[_addonClass, modParams [_addonClass, ["name"]] # 0, modParams [_addonClass, ["logoSmall"]] # 0]
Something like this works
class Params
{
class GF_Set_AISkill
{
title = "GF_Set_AISkill";
values[] = {0,1,2,3,4,5};
default = 1;
texts[] = {"Novice","Rookie","Recruit","Veteran","Expert","Random"};
};
};
and this?
Just to be sure on the say3D command wiki page, i read "local effect". So in order to play the sound on multiple computer i have to remoteExec it ?
yup
Thanks. I think many mod makers didn't understand that and are unnecessarily asking the server to perform tasks when it shouldn't have to
"easy" way would be to just attach some ammoboxes.
another option is an action on the horse that actually opens the inventory of a separate box.
@cosmic lichen amazing, thank you!
Yeah thats what im thinking
The issue then is - these horses will be in a vehicle spawner of sorts - meaning they will get spawned in by the players. So I would need to spawn a box everytime the horse is created as well.. i think
yes, you can do that with an init cba Class Event Handler for the horse class https://github.com/CBATeam/CBA_A3/wiki/Adding-Event-Handlers-to-Classes-of-Objects
Cba class handler to spawn the box, maybe do what ace does and just attachTo the horse a mile below terrain, then add action to access the box. Idk if attachto stops it from accessing inventory so you could figure out some other way to store them and access
I shoulda figured youd reply 🤣
Is there a way to prevent a player from turning left/right with the mouse? I can disable it from the control settings if I remove the "Mouse Left"/"Mouse Right" entry
unfortunatly the below does not work.
[] spawn
{
waitUntil {!isNull findDisplay 46};
(findDisplay 46) displayAddEventHandler ["MouseMoving",
{
if (inputAction "lookLeft" > 0 || inputAction "lookRight" > 0) then
{
true
};
}];
};
attach the player
that also prevents him from aiming up/down iirc
setVelocityTransformation every frame does the trick
Script look up and down to tilt the object player is attached to 
prevent turning, not aiming, so it's my favourite: put player in empty ffv vehicle.
question about displayAddEventHandler
Code - the code which gets executed when event is triggered. Returning true in event handler code will override default engine handling for keyboard events.
do we have same alternative for engine handling for mouse events ? Like if i want to disable "fire" action for player until something not happend
For use with the WeaponRested event handler, is there any way to determine how a weapon is rested? If it is on the ground, or on (top) of a wall, or rested sideways against a wall?
Take a look into aces framework on handling gun jams
looks like it does not fit for disabling vehicle weapon
you can do that natively for “weapon deployed”, but weapon rested youll have to script it
yes you can with addaction
i'll check it out, ty
i also did it in my burst pbo but i cant actually remember how
oh yeah
you do it with the condition
if condition is true then you dont block it if condition is false then you block it
Is there any suitable eventhandler or way of triggering a script when a curator remote controls a unit?
I need to immediately apply code to remote controlled units, and don't want to constantly check for if a unit is being remote controlled for performance reasons
checking if unit is being remote controlled should be fairly cheap after 2.14
havent tested performance of it yet but you can with the little speedometer icon in debug console, will return how long it took to execute on average with 1000 cycles
CBA player event "unit" https://cbateam.github.io/CBA_A3/docs/files/events/fnc_addPlayerEventHandler-sqf.html
fuckin beautiful cheers mate
Anyone on that can give me a small hand. Small idea I wasn't sure if it was possible
Just wondering if you can move unit from the spot you pick on radio. Sorry to bother everyone still learning
Not really clear what you're asking. More context?
Like I want to use my radio to call a truck with supplies to a point I choose in game
That's set up in editor with the Supports modules.
so watch the support modules video again. Thank you
Small question is there a place to look for spawning in reinforcements for bases so I don't have to bother you guys. Have had trouble finding any video or anything 😞
Again, lots of ways to interpret that. Try to give more details in #arma3_editor, more appropriate channel unless you're asing about scripting.
My bad I thought I would need a script to get them to move to where I radioed them. The support modules are for drop in not control over it. I'll try a different way sorry about this
Im having issues adding a script, and uploading a custom mission file to my server. Would anyone here be willing to help out? I can pay you for your time and expertise.
is posible to make a misile from AA to lock on an object ?
im trying to do something like an iron dome basically
i dont want to make it functional, just an ambient stuff
I wonder if we had something like STRING += NUMBER it would be faster than usual assignment?
"_var" += 10;
```is much uglier than
_var = _var + 10;
cringe
Does such work with the attachTo for a animated Object?
(_object is defined)
private _turret01 = "TG_Turret01" createVehicleLocal (getPos _object); _turret01 attachTo [_object,_object selectionposition "TG_Turret_Position_01", "TG_Turret_Position_01"];
TG_Turret_Position_01 is a memory point in a house which has a animated part
In cfgSkeletons TG_Turret_Position_01 is connected to the animated part of that house.
Taken the example of the attachTo with Usti hlavne, Usti hlavne is also connected with selectionname mainGun
player attachTo [tank, [0, -1, 0], "Usti hlavne"];
but instead of using the xyz coords id like to use the selectionposition
attachTo should work regardless which object is. But if that is a house, which means slow simulation object, will make the attached object slow too.
Also, I do believe using [0,0,0] for a bone attaching, that probably should mean the first point of the desired memory
Do you think the editor could fix that Z thing without breaking anything?
Id assume the mission.sqm already has the 3D coords
Yeah it would be faster.
But no.
These 0,0,0 are these xyz coords and the house is a bigger one and id like to use predefined memory points, so id like to use the selectionposition instead of the [0,0,0]
So im not sure if that works like the example is:
player attachTo [tank, [0, -1, 0], "Usti hlavne"];
And my variant would be s example like:
player attachTo [tank, selectionposition "Usti hlavne", "Usti hlavne"];
Last Usti hlavne is for attaching to a animated
Hmm I think I haven't messed around with attachTo that deep
Yeah im also messing around with it first time and i got the info that its new to attach to a animated part aswell
Also this i already know / noticed, do you probably know a object class that is not able to get moved if it gets collision but for turrets or vehicles the anims still work how they should work?
Yeah the rotation to the bone is relatively new (a few years ago)
And about your last sentence, not sure what it does mean
Id like to make a turret class and a tank class not getting moveable and ive attached it to a invisible house class i did so its just at fixed position all the time, doesnt mind elevation and such, like a house just stays there.
But the AI turret does weird movements like 1fps moves
, if im the gunner it works perfectly fine
Yeah 1 FPS is what I meant in
a house, which means slow simulation object, will make the attached object slow too.
Yep thats what ive noticed
So im looking for a solution that is also keeping its fixed position but doesnt slow down the AI in turret movements
Turret attachTo fake turret while fake turret is attached to house so the real turret is not attached to the house directly

You can attach it to something with a higher sim rate with no house involved. Just need to hide it somewhere no one's gonna knock it over
Yeah but what kind of class does have a higher sim rate
Even the vanilla turrets you can move around with a tank and flip them over etc. Ive tried to increase mass aswell but still you can flip and sometimes you can send them to orbit
Anything that normally moves or has physics, I'd assume
A Z coordinate exists in mission.sqm but doesn't seem to be used, can't be changed in Editor.
I'd guess it can be fixed without breaking the Editor, but I dunno about back compat. Note createVehicle marker syntax for example - might get some floating vehicles that were previously not, depending on how implementation of fix works
Sad
There was that thing recently where I wanted to change a thing to only happen in new eden missions, forgot what it was 🙃
something something pre-init unit variables to objNull, so people don't need to check for isNil "playerSlot1" for empty player slots
If you force set marker Z to 0 on loading any mission modified before the change, that'd probably solve it, but I've no idea how practical that actually is to do
especially when 3d placement in editor is only really viable for objects 
I remember words (from Dedmen?) about maybe getting 3D marker visualisation in the Editor, so it'd be cool to get access to the third dimension alongside that. Only if doable though, obviously.
Ah yes thanks.
I wanted to add creationDate and creation game version into mission.sqm for that.
From the initial first creation of the mission.sqm, to make it only apply to new missions
oof yeah that was a long time ago 😄
That's would be a nice change.
Also that markers with alpha 0 are also invisible in the editor is a pain.
relating to https://community.bistudio.com/wiki/BIS_fnc_initIntelObject;
i have everything working with no problems, but does anyone know if its possible so that when the intel is picked up, the map interface would not open up? or just for the one picking it up?
currently it just pops the map interface up for everyone
my current script;
https://pastebin.com/MqYhJBd9
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Just copy the function and remove the open map part.
unfortunately, i don't know which part is that
Can someone please tell me where in the game files can I find this function? https://community.bistudio.com/wiki/compatibleMagazines
I could only find this after unpacking the game to P drive https://community.bistudio.com/wiki/BIS_fnc_compatibleMagazines
Not only it's outdated but also the result differs between them
its not a function its a scripting command
can I somehow see it's code?
No
logics work for this, spawned with createUnit
_logic = (createGroup [sideLogic,TRUE]) createUnit ['Logic',[-1000,-1000,500],[],0,'CAN_COLLIDE'];
_turret attachTo [_logic]
It's the part that says
openmap [true,false];
yes setMissileTarget
there isnt one there
it's in line 102
dont know if this is a joke or not, but my scrip has 31 lines...
I'm referencing #arma3_scripting message . use the function viewer in game, look at the code for BIS_fnc_initIntelObject, copy it out, remove the map part, put it in your own function, and use that instead of the original.
that explains it, thanks
Questionoid about setObjectScale, since its global effect, it only has to be set where object is local and its then broadcast to all clients right?
if local args yes
Great, now, that command doesnt play well with simulated stuff that arent type of house.
But if you ran it locally on each client, on each frame, but object is remote, would it still have local effect, or just straight up ignored.
And before someone mentiones the evil word preformance, i dont care about it, i think tiny rambo is worth -30 fps
Yeah i noticed i works in sp/listen server, but not on DS
havent tested lan or whatever but would imagine its the same
just if client isnt the server it dont work
So i guess thats a no for tiny rambo 😦
Oh btw, vest attached sidearm doesnt scale, hence small rambo with big (micro) uzi
no, you know how you have certain vests with holsters?
yes
That
you can see theyre fine on the thumbnail here 🙃
yeah i just noticed, but for me it does that, modded or unmodded
Well anyways, ill go with backup idea of combined arms in huge house op
is there a way to get a script to read marker names?
idea is to place a marker on the map and name it for example "hunter" then it be deleted and spawn a hunter on the marker location
im struggling with trying to read infomation from "markerText" and getting that to activate a script judging by the name
What part are you struggling on?
'markerText' should give you the name that the user put for the marker
yes, how do i get that text say "hunter" to activate a script spawning said hunter
somthing like if markertext = hunter then do the thing?
Ya pretty much. If you want to have it happen on mission start then you could put it in an init script
yea i was looking for it to happen anytime during the mission
Ah
i wasnt sure if the init would be the best place for it and is repeatable
If you have lots of users being able to do it then you will have to ensure they type out the name correctly for it to spawn
thats an option but would like to have just one person doing it and ill write somthing that allows it to enable everyone
Are you looking for it to happen only for curators? Or all users
well its a normal mission no zeus or anything but just one player (admin) or all players as an option
Ah ok
but not worried about that well say one player for now
I dont know if theres an event handler for map markers for non curators
If there is then it would be best to use that. Otherwise you could do it on a loop or you could do it on a map closed event (im pretty sure there is something for this)
Ah perfect there you go
😮
Thanks artemoz, im on mobile rn and wikis are hard lol
Is there anyway to access the arguments passed to an addAction in its condition?
it would have to be on map closed tho right? cause if you make the marker wont the event handler activate before i could name it
No, the event happens after the name and everything is added and you press ok
The EH also has a "owner" variable so you can check that if you want only certain users to be able to do it
Ya you wouldn't have to use markerText with this solution
how so? im lost on that
addMissionEventHandler ["MarkerCreated", {
params ["_marker", "_channelNumber", "_owner", "_local"];
}];
thats what it gives out
so id just have a ton of if statments depending on all the vehicles id want to be able to spawn
Yes, its covered in the syntax portion of this page https://community.bistudio.com/wiki/addAction
Imagine Ctri-drawing on the map that spawns more and more Hunters as you go 🙃
oh my
In condition, not in code, though
Maybe it was just my wording, but no there isn't an _arguments variable passed to the condition
Yes or you would have to have the word be exactly the class name for the vehicle
yea to make it user friendly im having "hunter", "hunterGMG" etc
_this select 3 should get it in the code though no?
Sounds like "no" then, save stuff as a separate setVariable on the object or something
Arguments are available in the Code (on activation), but not in the Condition
_this: Object - Caller person to whom the action is shown (or not shown if condition returns false)
Doesn't seem so
Oh wait you want access to it in the condition not the code
Misunderstood the wording, sorry
But you could simulate it by doing setVariable/getVariable on the object the action is added to
@golden verge Take a look at cases, you might find it more efficient then a bunch of if statements
10-4 thank you for all the help
Inb4 hashMap
Yeah I trying to think of some way to get around it, but I'm doing it in a forEach
Whole thing is basically just a box with some actions on it to give players a weapon and magazines for it, but I only want certain guns to appear based on a player variable
params [["_object", objNull, [objNull]]];
if (isNull _object) exitWith {};
{
_object addAction
[
_x,
{
params ["_target", "_caller", "_actionId", "_arguments"];
_arguments params ["_weapon"];
[_weapon] call BNAKC_fnc_grabWeapon;
},
[_x],
_forEachIndex,
false,
false,
"",
"true" /* Should check if _weapon is available in a variable set on the player */
];
} forEach ["MX", "Sniper"/*, etc. etc.*/];
Ya but you'd still have to have a ton of code filling said hashmap, it will end up being the same amount of code probably, just more efficient when the eh is called. Eh I guess you're right then
You can use action ID as part of variable name, i think
So like after the addAction, assign a variable to the object using the action id with whatever _x is?
With whatever addAction returned
Another take would be format-ing the parameter into the condition when adding action 🙃
?
format ["[%1, player] call MUH_check_dat", _x] instead of "true" or whatever condition
Basically, create a proper string condition once when adding an action 🤷♂️
The "🙃" made me think it was going to be some cursed thing like formatting the entire addAction or something
hi guys, trying to figure out how to use attachto on a tank turret and have the objects rotate with it, i understand its using setVectorDirAndUp but my tiny brain cannot process how to work that
You need to find the bone name for the turret, and use attachTo's additional parameters to attach to that specifically, and turn on following bone rotation
Or maybe search this channel for word "eventually", i remember making that jole when similar problem was solved here
#arma3_scripting message or this
how would i find the bone? might be a dumb question but ive never done script work
Try "mainTurret"
alright let me give that a go
alright, so i've figured out everything but the offset, how would i find that?
config looks like this atm
Using mainTurret like that is only correct if the variable name of the vehicle you're attaching to is mainTurret. It does not have to be - that was a suggestion for what to use as the bone name (which you currently have as "otocvez"), not what the vehicle needs to be called.
The offset is the position the attached object will be placed at, relative to the object (or bone/selection) it's attached to. Since this is entirely up to you, the offset is usually found by trial and error.
attach to selection at current relative position https://gist.github.com/ampersand38/1f3d52fedeb9e76ac7e9647072b8e49e
Anyone know how to make it so that when acion "open" is executed with this code
_term = _this select 0;
[_term,['Terminal_source','Terminal_source_sound'],100,1] call bis_fnc_LinkTerminal_Animations},nil,1.5,true,true,"","_target animationSourcePhase 'Terminal_source' == 0",5,false,"",""];
this addAction ["Close", {
_term = _this select 0;
[_term,['Terminal_source','Terminal_source_sound'],0,1] call bis_fnc_LinkTerminal_Animations},nil,1.5,true,true,"","_target animationSourcePhase 'Terminal_source' == 100",5,false,"",""]```
it triggers a "hack laptop"? and what to put into said laptop to complete the task?
@round scroll use OOS for that
(that and type safety)
{
static void foobar(string s)
{
SQF diag_log(s);
}
}```
is there anyway to find the offset apart from trial and error or is that what the link is for
it's code to find the offset and attach to bone at the current relative position. so you can just place the child object in the editor next to the parent object how you want it, and it'll stay like that.
oh wow, let me see if i can get that working
is there a way to know if a player is clmibing up a ladder besides getting the animations?
dumb question but how do i work this, is it the objects init? apologies, never done this before
put the file in your mission folder, then call it like one of the examples given, but with your objects and selection. obj init is fine.
[sandbag, tank, "turretbone"] call compile preprocessFileLineNumbers "attachToSelection.sqf";
alright, i'll see if i can figure it out
Can anyone tell me how to query different variables with one logical operator?
if (_GameTime == 0) then {
if (_check1, _check2, _check3, _check4 && true) then {
hint "1";
} else {
hint "2";
};
I want that "_check1, _check2, _check3, _check4" must be true
so would the init look like this? it's in editor with that github file in the mission file
if (_check1 && {
_check2 && {
_check3 && {
_check4}}}) then {
// here your code if all true.
};
from wiki
Lazy Evaluation
In SQF the following code will evaluate every single condition, even if one fails:
if (a && b && c) then {};
//Even if a returns false (and thus the entire Boolean expression can no longer become true), b and c will still be executed and evaluated regardless.
To avoid this behaviour, one can either imbricate if statements or use lazy evaluation. The latter is done like so:
if (a && { b && { c } }) then {};
//In the example above, condition evaluation stops once any condition evaluates to false.
@digital hollow also,where is script_component.hpp? missing that it seems, crashes without it
oops, just remove that line
thanks
got it
wow thanks. this works. big appreciate 😄
As an entirely amateur scripter, what is the best process for inputting default server loadouts into an ACE arsenal?
Make the loadouts in eden and save them to the mission (default loadouts tab)
Would they be tied to the arsenal if i subsequently saved it to an editor composition?
or would i have to repeat the process every time i put it into the mission?
repeat
womp
so yea, i would have to export the loadouts, and then script them into the editor object to make them available as server loadouts
whats the most expedient way to do that
I already have a script for accessing the ACE and BIS arsenals as a drop down menu
also im interested in being able to blacklist unneeded items from the arsenal to keep it from being overcrowded with a bunch of junk
@burnt elbow The most effecient and scalable way would be to use the leverage the existing Ace Arsenal scrip framework. In this case, the ace_arsenal_fnc_addDefaultLoadout function
This is the page for it https://ace3.acemod.org/wiki/framework/arsenal-framework#43-adding-default-loadouts-via-script
awesome, i will see what i can get worked in, thank you
It should also add the loadout to all arsenals by itself if you check the third parameter as true
I think in your case it will be as simple as:
["Name of Loadout", PASTE THE EXPORTED LOADOUT HERE, true] call ace_arsenal_fnc_addDefaultLoadout
and utilize that in a init script on the mission
(shitf+lmb on the export button will copy the loadout to your clipboard)
does each loadout need a separate array?
the bane of my existance is trying to figure out what needs brackets.
Yes
sick. aight thanks gents, lets see how badly i can mess this up
You shouldn't have to edit the kit, just make the kits in the arsenal, copy it to clipboard and then edit the code that J3FF sent here
What's up guys, could someone help me? I'm trying to set up a trigger to play the "Halt" gesture when activated and when it stops, it should play an environment animation. I've tried doing it this way for the trigger:
params[ "_unit", "_anim" ];
if ( _anim == "Acts_PercMstpSlowWrflDnon_handup1b" ) then {
_unit playGesture "Acts_PercMstpSlowWrflDnon_handup1b";
};
}]; man1 dowatch player;```
And this for the Deactivation:
params[ "_unit", "_anim" ];
if ( _anim == "Acts_PercMstpSlowWrflDnon_handup1b" ) then {
_unit playMove "HubStanding_idle2";
};
}]; man1 dowatch player;```
It plays the animation but it doesn't stay in it
Do you have an idea on what is wrong?
Try this:
On Activation:
man1 playmove "Acts_PercMstpSlowWrflDnon_handup1b";
man1 addEventHandler [ "AnimDone", {
params[ "_unit", "_anim" ];
if(_anim == "Acts_PercMstpSlowWrflDnon_handup1b") then {
_unit playMove "HubStanding_idle2";
};
}];
man1 dowatch player;
Also i have a question is there a way for me to detect player created markers ?
Nothing😭
So what do you want it to do after the hubStandingIdle anim is done ?
Loop of the animation
I want the Halt Gesture stay until I exit the trigger area
And after I exit the area, it should play the hubStandingIdle animation
Is there a way to make a arsenal with limited quanity of items?
Not with the vanilla arsenal. You can only restrict whole item classes. U need to use the equipment storage for that instead.
Does anyone know if its possible / how to add a cooldown to a custom ace self interact
_supplydrop = ["SUPPLY DROP","CALL SUPPLY DROP","\a3\ui_f\data\igui\cfg\simpletasks\types\Container_ca.paa",{execVM "scripts\supplydrop.sqf"},{true}] call ace_interact_menu_fnc_createAction;
[squadleader, 1, ["ACE_SelfActions"], _supplydrop] call ace_interact_menu_fnc_addActionToObject;
Gotcha. I've seen in a group before where they had an ace arsenal but it had limited quanity of items
Have a seperate script running a timer, it will be your "cooldown" and attach a variable to the object thats false when the cooldown is active and true when its ready. And check for this variable in the actions condition
Looks like EntityCreated is executed before variable namespace is copied for respawned unit, but only for remote units.
testunit setVariable ["testvar", 123];
... death and respawn ...
addMissionEventHandler ["EntityCreated", {
diag_log ["111", (_this getVariable "testvar")];
_this setVariable ["testvar", 321];
diag_log ["222", (_this getVariable "testvar")];
_this spawn {
diag_log ["333", (_this getVariable "testvar")];
sleep 0.1;
diag_log ["444", (_this getVariable "testvar")];
};
};
```produces log:
13:29:47 ["111",<null>]
13:29:47 ["222",321]
13:29:47 ["333",321]
13:29:47 ["444",123]
Same but with local unit (player):
13:35:15 ["111",123]
13:35:15 ["222",321]
13:35:15 ["333",321]
13:35:15 ["444",321]
Hello friends, I am trying to make a custom Liberation campaign using the following fork of KP_Lib:
https://github.com/Apricot-ale/KP-Liberation-APR
I am getting the following error on start and it is preventing the mission from generating, but I cannot find the root cause:
KPLIB_b_inf_classes = KPLIB_b_infantry apply >
Error position: <KPLIB_b_infantry apply >
Error append: Undefined variable in expression: kplib_b_infantry```
This is what's in the script it's referencing
Fetch arrays with only classnames from the blufor preset build arrays
Beware that all classnames are converted to lowercase. Important for e.g. `in` checks, as it's case-sensitive.
*/
KPLIB_b_inf_classes = KPLIB_b_infantry apply {toLowerANSI (_x select 0)};
KPLIB_b_light_classes = KPLIB_b_vehLight apply {toLowerANSI (_x select 0)};
KPLIB_b_heavy_classes = KPLIB_b_vehHeavy apply {toLowerANSI (_x select 0)};
KPLIB_b_air_classes = KPLIB_b_vehAir apply {toLowerANSI (_x select 0)};
KPLIB_b_static_classes = KPLIB_b_vehStatic apply {toLowerANSI (_x select 0)};
KPLIB_b_deco_classes = KPLIB_b_objectsDeco apply {toLowerANSI (_x select 0)};
KPLIB_b_support_classes = KPLIB_b_vehSupport apply {toLowerANSI (_x select 0)};
KPLIB_transport_classes = KPLIB_transportConfigs apply {toLowerANSI (_x select 0)};
KPLIB_b_inf_classes append (KPLIB_b_squadLight + KPLIB_b_squadInf + KPLIB_b_squadAT + KPLIB_b_squadAA + KPLIB_b_squadRecon + KPLIB_b_squadPara);
KPLIB_b_inf_classes = KPLIB_b_inf_classes apply {toLowerANSI _x};
KPLIB_b_inf_classes = KPLIB_b_inf_classes arrayIntersect KPLIB_b_inf_classes;```
This is the array's I have set in the custom.sqf for the classes
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Any help would be muchly appreciated
is anyone availible to help me with a bit of scripting, I have been at this for an hour and I cannot get this line to work
don't ask to ask, just state your question, please 
which of 5 "custom.sqf"s? "Missionframework/presets/players/custom.sqf"? Can you post the full file you have now?
Full presets/players/custom.sqf (I am using my own sub-faction mod, found below)
line 76, missing comma, preset doesn't get loaded 🤷♂️
Thank you
@trim sonnet ^
Some localities can be pretty freaky... https://youtu.be/AKPucI6rcl8 :D
@still forum Should I make a ticket about EntityCreated var space issue on remote entities?
No won't fix.
But we should note it on wiki
Done
Super Secure!
This would be a cool building to have with a joint-op. Endless doors and randomly new closed doors causing you to get stuck forever.
whuahahaha!
How expensive is an value in array operation in sqf? O(n)?
whats the issue?
Variable namespace is copied after this EH for remote entities respawning
strange
arr = []; hs = createHashMap;
for "_i" from 1 to 1e6 do {arr pushBack _i; hs set [_i, _i]};
[
diag_codePerformance [{
5e5 in arr;
}]
,diag_codePerformance [{
5e5 in hs;
}]
]
``` => `[[6.57593,153],[0.000529859,100000]]`
hmm, thanks
Ye, makes sense
wdym?
ah yeah that's not really fixable as Dedmen said
Strange why it isn't
@little raptor Did you have a chance to look at shooter client side HandleDamage fires? Would be a great improvement to fix this mess, even if its been there for 10 years.
nope didn't get a chance
is there a way to modify how incapacitated status return someone to life?
I know the function lets you revive in "multiple" states, but is there a way to code the revival only (meaning as only removes the "invisibility" and allows you to move again)
time will never be greater than serverTime correct? (in the case of a client connected to a server)
Was writing some code and then remembered that serverTime is 0 in SP, so I was going to do like _currentTime = time max serverTime, so that it'll work in SP and MP, as well as be synced correctly in MP
Extensions are usually chatted in #arma3_tools
Can't give any time estimate. Is your Extension open source?
Anyone?
Perhaps animdone doesnt trigger for gestures. Since its the same gesture all the time, you could just use a sleep and then play it again. But I don't know if your desired affect of them holding their hand up forever will work, every loop it might just lower it and then raise it again
Ah I see
So there is no way to make it hold right?
I don't know, I havnt tested it. Try playing the gesture and then playing it again halfway through, and see if it holds or if it resets
How can I do it?
just use the code editor in the esc menu
to follow up, is offset literally just trial and error or is there a simpler way to find what coords you need, trying to have rotated items be attached is exhausting
playSound3D [getMissionPath "sounds\Ping_2.ogg", radio1, false, nil, 5, 1, 0, 0, false];
Can someone tell me why I get an error message with: "0 elements provided 3 expected"? I have 3 elements in the sound folder but I don't know why it can't run.
try [0,0,0] for position instead of nil 
Okay, now the error message is gone, but I don't hear anything. Do you know if I need to define the sound in the descirption.ext?
let me actually read the doc
ah
soundSource: Object - the object emitting the sound. If soundPosition below is specified this parameter is ignored
...
soundPosition: Array format PositionASL - (Optional, default [0,0,0]) position for sound emitter, overrides soundSource
ⓘ
If a following parameter has to be used, simply usegetPosASL _soundSourcefor soundPosition instead of_soundSourcefor soundSource.
I believe Lou told me a while ago that only functions can be passed nil and that when engine commands say default or optional on the wiki it doesn't mean you can just put nil
How can I delete all 'Smoke Modules' within a Trigger area?
Or even list all objects within the Trigger area
inAreaArray will give you objects in a trigger area
Like so maybe?
if (isServer) then {
{
name _x remoteExec ["systemChat", allPlayers];
} forEach inAreaArray;
"Entered trigger" remoteExec ["systemChat", allPlayers];
};
Hmm no, doesn't list the objects in chat for some reason
Multiple things wrong there
Im on mobile rn so I cant format it correctly. But look at the wiki page for inAreaArray and remoteExec
InAreaArray requires you to give it a trigger to be checked
And what code should I try?
If you're using the code in the triggers initfield, yes
Look up playGesture, and switchGesture, those should do it
Oh no, I was trying to do it in the "On Activation"
Sorry, ya thats fine
Havnt used triggers in awhile
Okay gotcha
Ah think I know the issue, Smoke Modules aren't an object so they aren't listed in allObjects.. but I can't find another array like that, that will have the modules inside
Hm
The idea is basically when a unit gets within the trigger it deletes the smoke module within the trigger
But I was having trouble figuring out what the name or class name of the smoke module was so I wanted to list everything so I could find it
Are you placing the smoke module in 3den?
Yeah
Was hoping to avoid giving a variable name to all the smoke modules where I want to do this
Just closed the game but this was basically what I had
_objects = allObjects inAreaArray thisTrigger;
{
hint _x
} forEach _objects;
if I changed allObjects to allUnits then it worked and printed my name
allObjects doesnt work like that
Check the wiki page, it needs a number before and after it defining what type of objects
You could also try using entities
Do you have any tips how to make missions more randomized, like changing unit placement, dynamic unit spawning, changing building layouts, etc.? I am trying to figure out the best approach of doing these things to make my mission more dynamic and re-playable.