#arma3_scripting
1 messages · Page 82 of 1
this is what i have currently
hint "In Safe Zone";
player allowDamage false;
while [true]
{
player action ["SwitchWeapon", player, player, 100];
sleep 1;
};
Not understanding what you mean by the wrong version. Could you be more specific? I apologize for my ignorance.
I changed the bracketing and I am still getting an error
it says
...
"player allow Damagefalse;
while {true}
|#|{
player action ["SwitchWapon" player, player,....'
awesome. thank you it worked. I really appreciate it
ill for sure give that a read
pushBack modifies original array
no
if you wanna save index yes.
pushBack, then setVar
_array pushBack _asset;
missionNamespace setVariable ["array", _array];
restrictionTrigger1, this select 0;
if !(player in (List restrictionTrigger1)) exitWith{};
player groupChat "RESTRICTED AREA";
playSoundWarning = true;
cutText ["DEATH IS IMMINENT", "plain", 0];
titleFadeout 5;
sleep 7;
if (player in (List restrictionTrigger1)) then
{
player setDamage 1;
player groupChat "YOU WERE WARNED";
}
else
{
{side player == blufor , side player == independent}
then
{player groupChat "YOU HAVE LEFT THE RESTRICTED AREA";};
};
So the first warning, your player dying when you get into the zone, and the "YOU WERE WARNED" message is all working fine. However when I leave the area it doesn't show the last message and an error message pops up on the screen
restrictionTrigger1, this select 0;
if !(player in (List restrictionTrigger1)) exitWith{};
player groupChat "RESTRICTED AREA";
playSoundWarning = true;
cutText ["DEATH IS IMMINENT", "plain", 0];
titleFadeout 5;
sleep 7;
if (player in (List restrictionTrigger1)) then
{
player setDammage 1;
player groupChat "YOU WERE WARNED";
}
else
{
if ((side player) == blufor || (side player) == independent)
then
{player groupChat "YOU HAVE LEFT THE RESTRICTED AREA";};
};```
You were missing an if
thank you. I feel dumb now lol
Also use || or or instead of , if you wanna compare multiple conditions.
Okay ill keep that in mind
Is this ran inside on activation of a trigger?
Ah okay. Just asking cause of sleep
then i have a initPlayerLocal file defining a variable
playSoundWarning = false;
which is another trigger with the condition of
PlaySoundWarning
and the activation of
playSoundWarning = false
I am still getting an error tho and i am unsure as of why
Error says whats wrong
undefined expression: this
The first line is wierd, but if you say it works, i believe you.
Ah, so it is the first line. If restrictionTrigger1 is triggers variable name, you can remove first line
ooo okay that makes more sense
Since you are passing thisTrigger as a parameter to that function,
You could inside function retreive it by private _myTrigger = _this select 0;
this does not exist within function scope, _this however does, and it refers to array before execVM, where select 0 refers to first item in the array, in your case thisTrigger
But if you have global variable, set by variable name of the trigger, you dont need to bother with that
took the first line out and replaced it as suggested. Now I have
private _myTrigger = _this select 0;
if !(player in (List restrictionTrigger1)) exitWith{};
player groupChat "RESTRICTED AREA";
playSoundWarning = true;
cutText ["DEATH IS IMMINENT", "plain", 0];
titleFadeout 5;
sleep 7;
if (player in (List restrictionTrigger1)) then
{
player setDammage 1;
player groupChat "YOU WERE WARNED";
}
else
{
if {(side player) == blufor || (side player) == independent}
then
{player groupChat "YOU HAVE LEFT THE RESTRICTED AREA";};
};
Now the new error is Type Code, expected Bool. Its refering to line 18
Also thank you for clarifying that.
i think it is refering to this line of code
{(side player) == blufor || (side player) == independent}
Works flawlessly now. Thank you my friend. Keeping up with what bracket goes where is killing me lmao
I really suggest reading thru that ^ and trying to understand it. Will clarify alot. Even if you dont get everything at first, it will make sense later.
Will do. I looked through it today but I am going to study it indepth
how would I go about formating parameter size? I mean so whether or not the provided parameter is 4 characters long or not, it adds enough whitespace to make up for the missing characters so it doesnt look zig zagged like so
format["S: %1 | A: %2 | F: %3"]
"S: 100 | A: 50 | F: 200"
"S: 10 | A: 500 | F: 200"
"S: 1000 | A: 50 | F: 20"
"S: 100 | A: 5 | F: 2000"
You mean something like %4u in c? Idk if format supports any of these, or it aint documented. You could make a function that takes value & number of digits, and sticks spaces infront of the number then returns it as string
yeah though in my mind I referenced java's format function. Ill have to do that then
Theres nothing default in arma, but it's not hard to make a crude version of what you want;
_formatString = {
// Max individual string size
_strSize = 4;
// Loop through each individual string
_parameters = _this apply {
// If the type isn't a string, make it one
if !(_x isEqualType "") then {_x = str _x};
_count = count _x;
// If its bigger than the size, reduce it to size
if (_count > _strSize) then {_x = _x select [0,4]};
// If its smaller than the size, add space
if (_count < _strSize) then {
for "_i" from 0 to (_count - _strSize) do {
_x = _x + " ";
};
};
_x
};
// Add the parameters to the end string
format(["A: %1 | B: %2 | C: %3"] + _parameters);
};
// Initial strings to add
_a = "1234 ";
_b = "1 23422 ";
_c = " 3341 ";
[_a, _b, _c]call _formatString
This was testing via SQFVM, so it may not be 100% accurate though I hope it would
Input should be able to be anything but nil
Hello once again :D
Got a question in regards to the Params command as I am working on a function.
Currently I have the params set up like this:
params [["_layer", "", ["asd"]]];
and was wondering if this is the correct way to set the expectedDataTypes to string, I've seen people do "asd" before and I've seen "" I think and I'm not sure which one one is correct.
The expectedDataTypes are just to define a type of parameter.
params [["_layer", "", ["asd"]]];
is functionally the same as
params [["_layer", "", [""]]];
ah, a'ighty cheers.
thanks, I was thinking something like so below originally, but yours does seem smaller and more to the point. Ill test both and see what I come up with.
params["_string", "_size"];
private _strLen = count(_string);
private _newStr = "";
if (_strLen > _size) then {
_newStr = [_string, _size] call TRA_trim;
} else {
if (_strLen < _size) then {
_newStr = [_string, _size] call TRA_extend;
} else {
if (true) exitWith {
_string
};
};
};
TRA_trim = {
params["_string", "_size"];
private _str = [_string, 0, _size] call CBA_fnc_substr;
_str
};
TRA_extend = {
params["_string", "_size"];
private _str = _string;
private _charToAdd = _size - count(_string);
for "_i" from 1 to _charToAdd do {
_str = _str + " ";
};
_str
};
_newStr
also another question, about my nested if statements at the top, could I instead do something like this?
if (_strLen > _size) exitWith {
_newStr = [_string, _size] call TRA_trim;
_newStr
};
if (_strLen < _size) exitWith {
_newStr = [_string, _size] call TRA_extend;
_newStr
};
if (_strLen == _size) exitWith {
_string
};
Yeah you can, it would probably be better for readability as well
Dear scripters, is a FiredMan event handler running on the player a performance hazard? I only care about Throw weapons, and quit the script first-thing if it's not.
Shouldnt be. If you dont make it a preformance hazard yourself.
^. but make sure you measure the performance of what you run
Question,
The getMissionLayerEntities command needs to be executed on the server.
I need the return value of the command in a local script.
Found out that this
private _allLayerTriggers = [_layer] remoteExec ["getMissionLayerEntities", 2];
won't work because the return value of remoteExec is different, is there a way to get the return value of getMissionLayerEntities while still executing it on the server through a local script?
How do I attach a marker to a vehicle so it can constantly be shown on the map relative to the side who has it?
@versed belfry you have to call a function on the server, which then sends the result back to the client.
see the message I replied to
Thanks
in that example:
my_fnc_remote can be something like:
"NMS_fnc_getLayerEntities":
params ["_layer"];
getMissionLayerEntities _layer;
"my_fnc_local" can be anything you want to do. e.g.:
"NMS_fnc_hideLayerObjs":
params ["_layerEntities"];
{
_x hideObject true;
} forEach _layerEntities
[[_layer], "NMS_fnc_getLayerEntities", [], "NMS_fnc_hideLayerObjs"] remoteExec ["my_fnc_remoteExec", 2];
BE gets script post-preprocessor
We know how to improve it. And we keep getting ignored by the person that can change it
There is one bad filter that constantly triggers false positives. And we should just remove it
You can use a Task attached to the vehicle, if you set difficulty to have tasks visible. Or if you only want a map marker, you need to use a loop to set the marker position to the vehicle on a time interval.
I just want a map marker.
How do I set the loop?
Create the marker, save the name, then (roughly)
while {alive _vehicle} do {_marker setMarkerPos (getPosATL _vehicle); sleep 1;}
Thanks will try.
You also wanna delete that marker right after loop
Well, maybe. Sometimes leaving it on the last known position is fine. Depends on the mission design.
Also side check. And create marker local to only players on that side etc...
The question I answered was about the loop. Someone else can answer all that.
It’s a mobile teleport area, so for them to see it constantly would be needed
The difference between deleting it/not deleting it after the loop exits, is whether the marker disappears when the vehicle is destroyed, or remains on the position it was destroyed at
Either way it is constantly updated as long as the vehicle is alive
Ah I see
The vehicle would have its own respawn so it would just move then once it’s respawned?
And how do I keep that side specific?
As ive said, you need to create marker locally on client belonging to specific side
If it's going to respawn, you can:
- delete the marker after the loop exits, and start a new one for the new vehicle as part of the respawn
- replace
alive _vehiclewithtrueand let the same marker persist at all times
Thanks.
That’s done how?
Thanks.
Hey guys, trying to script UAV terminal access through an addaction on a computer, anyone have any idea what action is called on uav terminal activation?
I'd start here:
So if I understand this correctly, this is how I should implement it:
Define fn_remoteExec.sqf in the functions.hpp:
params ["_params", "_function", "_callbackParams", "_callback"];
_result = _params call (missionNamespace getVariable [_function, {}]);
(_callbackParams + [_result]) remoteExec [_callback, remoteExecutedOwner];
Then have fn_getLayerEntities:
params ["_layer"];
getMissionLayerEntities _layer;
and finally have A3A_someFunction.sqf:
//example code
params ["_layerEntities"];
{
_x hideObject true;
} forEach _layerEntities
The line to start everything would be:
[[_layer], "A3A_getMissionLayerEntities", [], "A3A_someFunction.sqf"] remoteExec ["my_fnc_remoteExec", 2];
You can easily try it 😉
A bit hard until the dedicated server is free for testing, plus making sure is always good to avoid rookie mistakes I might make and not notice 😅
you can always run 2 game clients locally if you disable BattlEye (and probably enable windowed mode for convenience) 
In danger.fsm, does anybody know what the danger cause DCexplosion is supposed to do? It doesn't seem to trigger with actual explosions. Instead it seems to trigger with some, but not all, nearby bullet impacts.
Any consistent way to disable an objects collision in general? I saw in ace that they set the mass to almost zero to remove collision, but that doesnt work for me. I don't want to use disablecollisionwith either
Use attachTo?
that doesnt disable collision for me, I can still walk into the object. Do I have to attach it to the object I want the collision to be disabled with?
If I attach em together then they move with me lol, that might be ok though
mm not ideal, I happen to be already attaching it to another object
What about disabling simulation?
nope
set the mass to almost zero to remove collision
setting the mass only works with physx objs
I don't want to use disablecollisionwith either
why?
disablecollisionwith can only be done with one other object and has to be ran on both locality's, I need the collision to be disabled with whatever player is closest and id rather not have to run checks to see which ones closest
I know example 3 on the wiki for it talks about disabling with multiple objects, but that doesnt actually work in practice
There's no absolute way. Maybe if you explained the exact problem you're trying to solve then someone can think of a workaround.
Im carrying an object with ace carry, and attaching an object to it. It collides with the player and makes me fly, I need to avoid this
The second object collides with player?
yup
Why not createVehicleLocal that way the 2nd obj is local to the player. Then disable collision
my second object is a physx object, according to simulation = "thingX", so shouldnt the mass work?
It needs to be visible and everything in multiplayer
I think you probably just need to suck it up and use a remoteExec on the server to disable collision then lol
well I guess so yeah
Im carrying an object
do you attach it to yourself?
no i attach it to the object im carrying, with ace you can raise and lower said object so attaching the second object to me would mean it wouldnt follow said raising and lowering
oh you mean the one im carrying, idk how ace does it, it probably is attached to me
if it's attached to you it shouldn't collide with you tho
No it's attached to the obj attached to him
Object 1 im carrying, probably attached to me through ace, object 2 im attaching to object 1, object 2 is colliding with me
attach obj2 to yourself too 😅
cant
aren't you carrying 1 obj at a time?
Im carrying one object through ace at a time... yes
then what's wrong with disabling collision between you and obj2?
afaik you don't need to run it on both localities as you said
Ok how about this...
Attach obj2 to yourself but use getposATL/setposATL in a while loop, while obj1 attached to move obj2 relative to obj 1
It says I do on the second bullet point on the wiki, and in testing I have to
this is probably the only way at this point
In my testing it never triggered. Its supposed to trigger when explosion is near, but doesnt.
Thanks for your input on the disable collision stuff, ill do some more testing and see which solution I like the best :)
How do I create a sector defense group for both sides?
As of right now only INDFORs response team works but Bluefor and Opfor doesn’t spawn anything.
Does the "targets" command return only targets known to the unit or group?
yes
Fun thing about targets is that it's not MP-synced.
"yes" as in "group knowledge = unit knowledge"
How does one do player respawn similar to the COOP missions in Arma 3, specifically the ones in S.O.G.
In other words, how do I enable respawn on one's group leader in multiplayer? I am familiar with setting it in description.ext but that only enables switching to AI units in a group, not respawning a new unit to that group.
easier to think of it as “respawn” and then “teleport to group leader”
@gentle stump see #production_releases 🙂
@meager granite do you know the difference in key binding between DIK and hexa?
i am encountering some issues where I set a key bind with DIK code and person with some exotic keyboard (chinese?) does not have the action
Not sure what you meant by difference, DIK codes are just preprocessor defines to DIK key numbers.
hmm strange.. just exploring reasons why a chinese community isnt getting the key bind default
basically just (_key == 219) in keydown
Which key it is?
#define DIK_LWIN 0xDB /* Left Windows key */
Probably they keyboard only has right windows or something?
left windows
Hm could be
#define DIK_LWIN 0xDB /* Left Windows key */
#define DIK_RWIN 0xDC /* Right Windows key */
#define DIK_APPS 0xDD /* AppMenu key */
I use a check for all 3 for my windows key functions
hmm
Hmm tried both Simplified and Traditional IME both detects 219
thanks for checking
maybe his left windows key sends the right windows key code 🙃
🙂
actually looks like German and French keyboards do that 
see the DIK codes page
WINL is 220 and WINR is 219 
in BIS_fnc_showNotification examples I see TaskSucceeded example notification, is there already a defined TaskFailed of some sort?
Defined in CfgNotifications
ah so there is? good to know. Im loading up my arma now to check the configs
another question, I have my event handler ID, how would I go about checking whether or not the event handler has been removed?
IIRC they introduced one recently...
display event handler*
perfect, thank you
is there a way to check for both KeyDown and MouseButtonDown with the same event handler or am I going to need to check for one inside of the function called by the other?
If you're looking for modifier keys (shift, ctrl, alt), the mousebutton EHs provide that information
no sadly im getting the arrow keys and space bar. I think im going to just make a missionNamspace boolean variable that gets flicked true on mouse right click, and ill just look for this boolean var in the function called by my keydown event handler.
Instead of flag you can do lastMouseClickFrame = diag_frameNo;, so you don't have to unflick it back to false
Then just do if(diag_frameno == lastMouseClickFrame) then { conditions
that's too inaccurate
Why? Due to float precision?
First they'll need to have game running for a long time, second even with some tiny threshold its probably not a big deal, its user input done by hands anyway, it won't be perfect.
Speaking of threshold, using diag_tickTime can be useful if you want to have threshold for clicks or key presses, something like if(diag_tickTime < lastMouseClickTime + 0.5) then { for 0.5s threshold.
you mean >?
use diag_deltaTime with various timers for different things
I think its correct 🤔
Its 12am and I can't think anymore
Any reason for AI to stop suppressing after two bursts, even if suppressFor is set to three minutes? (Gunner of an IFV)
> would be correct
unless by that condition you mean "do nothing"
diag_tickTime increases, lastMouseClickTime stays the same, it should be true first 0.5 s and then false
oh i read the initial question now, i see
mouse up/down and a flag is the best anyway
I remember having an issue with up event not firing if you remove focus from the game or something? So you ended up with a never removed flag.
not being able to aim at the target
if it happens all the time it could be a bug
Could be. I am totally new in Arma scripting, so yeah
bout time
I meant a game bug
Yes, but my incompetence does not help also
If you have any AI mods running, they could potentially make the AI get distracted
There is a chance
Even trying to cycle through an array of targets, it seems to do fixed amount of bursts on single target and quit
Most AI commands are treated as advisory at best
whether through bugs or intention. Rarely clear.
But you should definitely test vanilla.
Hi guys, how are you ? I have a little problem with markers.
I'm on a server and when i double-click on the map to create a marker, i get the menu but the group is blocked and i can't click OK.
I've tried different difficulties but nothing solves this problem.
Do you have any idea ?
Thanks
what group?
Global channel, camp channel etc
dunno. could be locked by the server/mission you're playing?
also this channel is for scripting questions
I do not understand this. diag_frameNo returns the number of frames currently displayed according to the wiki, why would checked that against its previous self tell me if I right clicked?
it would tell you you have right clicked in that frame. if the frame proceeds you haven't clicked in that frame
tho I don't think it would help much in this case. based on what you've said the two events are not really related and won't happen in the same frame
I have a problem with say3D, I'm trying to make radio loop music that's about 15 minutes long, the problem is that if the player goes away for say like 5 minutes, then the loop would start 5 minutes too early because sleep doesn't pause while the player is away, but the song pauses, causing the radio play 2 songs at once.
Is there a better way to make long 3D audio loop?
I'm working with multiplayer btw.
true, there could be an unlimited time between when the KeyDown eh fires and MouseButtonDown eh fires.
when say3D is done the game deletes its source
check if its source still exists instead of using a timer
The source is an object, in this case FM radio. Should this be done some other way?
I'm not sure how that would stop the desync issue though
instead of using sleep 15*60 you check if source still exists. if not you play the song
I don't think I understand how the object is created, if you have the time could you give me an example on how to do it?
while {true} do {
_source = _radio say3D "song";
waitUntil {sleep 1; !alive _source};
};
no
Well I'm lost
I got the right click cancel working, but its not exactly desirable as after the right click you need to press a key for it to take affect. Anyone got better suggestions?
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.
also I realize for the switch case 57 and 1000 I could probably turn that into another inline function instead of writing it twice. Might do that as well
call the cancel code from the mouse down EH instead of using keyDown 1000
when you rclick it should cancel immediately not wait for another key down
missionNamespace setVariable ['TRA_buildCancel', true];
and instead of these just doTRA_buildCancel = true
well not that var since its useless. I mean others
ah you know what, your completely right. Im not passing in any local variables for the cancel. Why didnt I think of that
oh setting missionNamespace variables works pretty much the same as just creating a variable like you said huh?
Thanks, ill re-write my code now
missionNamespace setVariable ['TRA_buildDisplayID', _id];
and store display related IDs on displays themselves not missionNamespace
yes global variables are created in missionNamespace
hmm? so like (findDisplay 46) setVariable [etc] ?
yes
oh neat, didnt know you could do that
(findDisplay 46) displayRemoveEventHandler ["KeyDown", TRA_buildDisplayID];
and instead of these just write_display displayRemoveEventHandler ["KeyDown", _thisEventHandler]
well I mean in the EH code itself
not the ones in other places
/* While build KeyDown event handler exists, do: */
while {(findDisplay 46) getEventHandlerInfo ["KeyDown", TRA_buildDisplayID] select 0} do {
sleep 1;
};
/* Return whether build was a success or failure after KeyDown eh is removed */
missionNamespace getVariable ['TRA_buildSuccess', false];
when you have an event handler system set up it's best not to use loops anymore
I think I get what your saying, so place that in the function that is directly called by the event handler?
yeah
you have defined the _display var already in your params
_thisEventHandler is a magic var (current event handler ID)
as for this, im not sure how to approach it without a loop. I want to return a boolean when the script finishes running, however since most of the script is called via eh the script would finish before the eh's finish calling my inline functions right?
yes. I'm not sure how your stuff are set up but ideally it should be like this:
- fnc1 calls that function
- that function adds the EHs
- the EHs call fnc2 (success) or fnc3 (fail)
in this case I'm assuming success is placing the object and failure is canceling the job
yes, based on what you said I think I can rework my code a bit and get the desired output
is there a way to get the result of what is returned from TRA_rotateObject in this call?
(findDisplay 46) displayAddEventHandler ["KeyDown","_this call TRA_rotateObject"];
also, I have implemented the rest of the changes you suggested and everything works perfectly now and looks much better.
hmm actually since that is called so frequently I probably dont want that
and that's not really what I meant here
what I meant is, if you want to wait for the return of that function and process it in fnc1, instead, break fnc1 into 3 parts: fnc1 fnc2 fnc3
or just make a fnc2 and pass the result to it as a parameter
if you still don't understand, show me what calls that function to tell you what you should do
if you care about performance that is. otherwise just use what you have now 
I do care, its the main reason I am making this project which is a remake of another project lol. other reason is I think working with sqf is really neat.
This is the function im calling that function from, however the more I think about what you said and why I need to have the build function return a Boolean value. At my current stage in the project I cant really think of a reason I need it to.
I think originally I wanted it to because it just made sense to return a Boolean with the result when it finishes running in this scenario
https://pastebin.com/JzzrNwgt
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.
which one is the function?
this?
private _success = [_player, _parsedData select 0, _parsedData select 1, _fob] spawn TRA_fnc_build;
that's wrong
spawn returns a handle. not result
it was call previously, I turned it to spawn in order to get the loop with a sleep 1 working
but yes that was my function
Is there a way to script restricted zones in WL having an issue where people are able go into random OPFOR/BLUEFOR sectors that aren’t under attack and cap them.
The base WL restriction works for INDFOR positions in the beginning of the match.
well let's say it was a call and you wanted to do something with it, and this was the flow:
private _success = [_player, _parsedData select 0, _parsedData select 1, _fob] call TRA_fnc_build;
if (_success) then {
// build success code
} else {
// build failure code
};
(you might think that's wrong but you can use sleep in a called code, if it's called from scheduled evn. another important thing to learn if you didn't know already since it can save you a lot of performance)
instead you do:
[_player, _parsedData select 0, _parsedData select 1, _fob] call TRA_fnc_build;
// remove the rest of stuff here that need to wait for the result of the above code
// let's say you need this var to pass it to TRA_fnc_buildResult
findDisplay 46 setVariable ["someVariableIneedLaterInResult", _someVar];
TRA_rotateObject = {
// ....
case 57: {
_someVar = findDisplay 46 getVariable "someVariableIneedLaterInResult";
[_someVar, true] call TRA_fnc_buildResult;
};
};
...
TRA_cancelRotation = {
...
// define _someVar here too
[_someVar, false] call TRA_fnc_buildResult;
}
TRA_fnc_buildResult:
params ["_someVar", "_result"];
if (_result) then {
["TaskSucceeded", ["", "Object Built!"]] call BIS_fnc_showNotification;
} else {
["TaskFailed", ["", "Not enough resources to build object!"]] call BIS_fnc_showNotification;
};
as you can see you don't need any loops
you just move from one fnc to another
and you can pass any variable you need in the process as well (such as _someVar in that example)
alright that makes some more sense to me. Thanks for all your help teaching me and making my code better lol
Im trying to change the name of an ai with setName through a script, but it just doesnt work. If i do the same command in game with the console it works fine. Anyone have any ideas?
Try setIdentity
setIdentity requires the identity to be pre-created in description or config, I need the name to be able to be changed to anything, so thats a no go
Script and console do the same thing. Try to figure out the difference with where and when you're running it.
It seems to not work when I use a local unit, this example here does not change the name:
_group = createGroup civilian;
_unit = _group createUnit ["B_Soldier_F", (getPosATL player) vectorAdd [0,5,0], [], 0, "NONE"];
_unit setName "tester";
Well, setName is local effect?
it is, this is being tried in singleplayer rn, ive tried it with and without a remoteexec
Ok, other thing with setName is that forename-surname takes priority if they exist, IIRC
So you typically have to use the array form of setName to change visible names of AIs.
_unit setName ["tester", "", ""]
unfortunately that does not work either
I can change the names after the fact with a command like this:
{
_x setName ["tester","",""];
}forEach allUnits;
and it works no problem, I am clueless as to why it doesnt right after creation
yeah ok, seems to be a timing thing.
Ah that was it, it cant be done right after, sleep needed to be added
There must be some initialization faze for the unit being created that will overwrite my change of the name
Thanks for helping out John :)
I wonder if that's true in MP or not.
We're setting AI names on creation but the code might be slow enough to skip into the next frame :P
Although I guess we're remoteExecing
I was trying it with remoteExec with this command [_unit, "testName"] remoteExec ["setName", 0, true]; to no avail earlier
the mission is incredibly light though, maybe there just isnt enough going on
Immediate remoteExec + long setName Works in MP but not SP:
[_unit, ["tester", "", ""]] remoteExec ["setName", 0, true];
Thankyou for letting me know!
Hey I am trying to end an animation / move for a player but somehow it won't play.
The variables indicating if the player is surrendering are working correctly, I also verified that the code which should start another Animation (hands / arms down) does get executed
I use playMove to start the first animation and later playMoveNow
But even in a console it won't work, if I use switchMove it works just fine byside a little lag / camera adjustment
Any ideas why I can't change the animation with playMoveNow?
My code is pretty much the same / this code also did not work for me
https://github.com/AsYetUntitled/Framework/blob/v5.X.X/Altis_Life.Altis/core/actions/fn_surrender.sqf#L20
playMove requires there to be a known transition between the current and target animation state.
Q: where are loadouts stored? in profileNamespace? by which var(s)?
What loadout? Arsenal?
yes, sorry. arsenal.
Indeed profileNamespace. I forgot which var
I was just scanning the p/ns vars, for the obvious, loadout, etc, nothing pops out.
seems a bit odd allVariables profileNamespace should return empty though...
excepting for the note Using profileNamespace and uiNamespace with this command has been disabled in multiplayer, chagrined so how do I otherwise probe for which vars?
IIRC was not a straightforward name
would not guess it was... hmm
I'm not on my PC rn so... yeah
appreciate it... jumping out to SP...
ACE, seems like somewhat straightforward, "ace_arsenal_saved_loadouts"
gonna scan the other vars bit more intently though.
"bis_fnc_saveInventory_data"
yes I see that now... makes sense. thank you.
next stupid questions might be, the shape of the data... with ACE it seems obvious they are an array of NVP (name value pairs)...
with BIS, is it more like a flat the same, consume [_key, _loadout, ...]?
Looks more like https://community.bistudio.com/wiki/Unit_Loadout_Array except in a different order.
yeah I was wondering the same. which I gather the bits are interchangeable, just needing to validate them individually...
I'm not looking to validate (yet), but I do at least want to understand the level of NVP sorting...
which the above, whereas ACE appears to be a proper associative array, [[_key, _loadout], [_key, _loadout], ...]
oh, that level.
I think it's a flattened version of that, so just [_key, _loadout, _key, _loadout, ...]
cool, I second the nomination, was thinking it appears the same way... thanks.
if I pass an empty hashmap to count() would it return 0?
_maxPlayers = 10; // Maximum number of players allowed in the raid area
this addAction ["RAID", {
_markerPos = [];
{
_markerPos pushBack getMarkerPos _x;
} forEach ["Exit1", "Exit2", "Exit3"];
_randomPos = _markerPos call BIS_fnc_selectRandom;
// Check if the maximum player count is not reached
if (count playableUnits < _maxPlayers) then {
player setPos _randomPos;
{
_x setPos (getPos (_this select 1));
} forEach units group (_this select 1);
skipTime 5;
} else {
hint "Maximum player count reached. Raid area is full.";
}
}, [], 1, true, true, "", ""];```
error: invalid number in expression
Ive looked on the forums I am probably over complicating it.
what line does it say that for?
i think it is the first one which is why i am confused
its on a white board with a map
cant have comments in the init's for objects and units
remove them and you should be fine. I dont remember exactly why but iirc its because the init uses like loadFile or something which doesnt support comment lines
something along those lines
yea it works now HAHA
yeah I have had the error many times before
thank you
np
_maxPlayers isn't defined inside the addAction function though.
ah yeah I hadnt noticed that.
if you wanna pass _maxplayers to the addAction without creating it inside the code for the addAction, look into passing it in where the nil parameter is is in example 5.
arguments: Anything - (Optional, default nil) arguments to pass to the script. Accessible with _this select 3 inside the script. If Array is used as an argument for example, its first element reference would be _this select 3 select 0```
https://community.bistudio.com/wiki/addAction
I will for sure. It lets me put the code in the init but it's throwing me some errors still but I gotta get some sleep so it's tomorrow problem
how do you determine if a classname has a grenade launcher?
Underslung you mean?
Check if the muzzle config has some name other than this
is it always gonna be an EGLM?
Nop
UGL_F or... the name doesn't matter after all
Checking the magazines or such may detect if is a 40mm GL
yeah
so look for it to have more than 1 muzzle, then use the second muzzle's value under the config to figure out the gl's magazine, then check the shot type
Pretty much
a bit annoying but oh well
Slightly quicker method:
private _config = configfile >> "CfgWeapons" >> _className;
private _muzzles = getArray (_config >> "muzzles");
count _muzzles >= 2 && {"gl" == getText (_config >> (_muzzles select 1) >> "cursorAim")}
Worked across a bunch of different modsets in practice.
ah, should cursoraim always be "gl" for it to get that style of attacking
cool
for indirect fire I mean
Note that there are single-muzzle grenade launchers too.
any idea how to get a random backpack
A backpack is a CfgVehicles class, with isBackpack=1
What is the process for turning a script into a mod? I have some good ideas that haven't been done before, I just don't know how to take a script and turn it into a mod.
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
One thing you can refer is this
With a mod, each PBO has a config.cpp in it with a CfgPatches class and whatever else you need after that (eg CfgFunctions as above if it has scripts).
There is a list with animation but how can I check for the known transition?
you can always check yourself: count createHashmap (and the answer is yes)
it's not a "file" so no it doesn't use any file related command.
inits don't have a preprocessor pass. the preprocessor is what removes the comments (and processes macros, etc.)
so it can't compile it
something like this also gives you an error:
compile "hint 'hello' // hello"
do you know how to stop this animation script from changing the ais loadout?
if (local this) then {[this, "GUARD", "ASIS"] call BIS_fnc_ambientAnim;
0 = this spawn {
waitUntil { behaviour _this == "combat"};
_this call BIS_fnc_ambientAnim__terminate;
};}
that and the script commands are two of my favorite bookmarks, all you gotta do is duck arma 3 script commands and you'll find it
Q: about the BIS arsenal save data, aptly named "BIS_fnc_saveInventory_data", I suppose, but that is a topic for another time...
If I reshaped the data to proper KVP, i.e. [[_key, _val], [_key, _val], ...], would that be in basic agreement with the ACE save data?
Notwithstanding the composition of each of the _val bits, of course, I am aware there are differences there as well.
Thanks...
in terms of loadout itself, does it matter the order in which the individual elements are presented? i.e. backpacks, prim weaps, etc, etc? as long as each one is internally consistent?
Does anyone know how to get the descent rate of an object? I've been attempting to use getPosATL, and getPosASL but simply moving forward and backwards is manipulating the data, and leading to inconsistant results
what kind of object?
velocity _object select 2?
only works if the object has a velocity, which is why I asked what kind of object 😒
It's a player / vehicle
then yeah use velocity
Basically trying to determine the glide ratio for a parachute
be careful with velocity depending on what you want to do, IIRC, 'backward' momentum reports as negative.
usually if I want to report that, momentum, then I just abs velocity, that is usually sufficient.
Using velocity should get what you need quite easily, but I'm curious about what was going wrong with checking getPosASL 🤔 it's relative to a fixed altitude, so lateral movement shouldn't affect the Z component in itself. Checking ASL altitude over time should be a fine way to get average vertical speed.
anyone at all have any insights? probably a hard question before 8 AM ☕ I realize...
17:00 you mean?
try and thou shalt see 😛
Yeah, I tried checking every second, but just moving left and right (no vertical change, was standing on a flat object in the air) was slightly different values, assuming somehow the X and Z plays in
not exactly inspiring confidence, but I shalt expiriment 😉
That seems like there was just some slight irregularity in the unit's motion/rounding errors going different ways. X and Y motion should have no inherent impact on the ASL Z axis. I would not extrapolate that slight variation into a predicted large variation.
I would be very surprised if the order wasn't strict. Certainly Antistasi assumes it is when it loads these.
I'll investigate the ACE code as well... thanks.
I'm still having issues understanding the setmarkerpos getmarkpos
the fourm i was sent doesn't make any sense
- what are you trying to do with it?
- what were you sent?
I'm trying to set a marker to an MHQ that players can teleport to.
Was only sent this https://community.bistudio.com/wiki/setMarkerPos
Ah, I remember this
Yes, I’m still not figuring it out.
I'm sure I advised you to do something like
_marker setMarkerPos (getPosATL _vehicle);```
Do I put that in the vehicle's init?
No. That will set the marker's position "once" (on mission start, then each time a new client connects, because inits are executed on every client at the moment they locally start the mission)
You need to make a loop like we were talking about previously. That loop will probably go in initPlayerLocal.sqf but there are a few ways to do it
can you potentially explain this in a VC?
Nope
okay
Here is the discussion we had before, for reference #arma3_scripting message
huh this one is interesting
https://github.com/acemod/ACE3/blob/master/addons/arsenal/functions/fnc_portVALoadouts.sqf
Okay I'll try my best
put what you said in there got this error message
Yep
the sleep is how constent it update correct?
Yes
1 is 1 minute?
No, 1 second
Ah okay, and how do I make it to be set so only Bluefor sees that?
You have to create the marker locally (createMarkerLocal, and use the local versions of other marker-related commands too) in combination with an if check, to determine if the local player is in fact on BLUFOR
"Local" is a network concept. When something is "local", that means it's primarily (or only) hosted on the current machine. A player's unit is local to that player's machine, for example. Doing things locally means you can have different things on different machines, and in this case you're going to exploit that to have the marker appear on some machines but not others.
Hello :D
I've just tested this on a dedicated server and can't seem to get it to work for some reason, if it may help those are the files (all defined in the functions.hpp):
A3A_fn_useRemoteReturn.sqf:
params ["_params", "_function", "_callbackParams", "_callback"];
_result = _params call (missionNamespace getVariable [_function, {}]);
(_callbackParams + [_result]) remoteExec [_callback, remoteExecutedOwner];
A3A_fn_getLayer.sqf:
params ["_layer"];
getMissionLayerEntities _layer;
A3A_fn_markTriggersInLayer.sqf [Confirmed it works on its own if given the correct layer/array]:
params ["_layer", [], [[]]];
private _counter = 1;
{
// Get all the trigger info and prepare markaer names
private _triggerPosition = getPosATL _x;
private _triggerText = triggerText _x;
private _triggerAreaMarkerName = "triggerArea_A3AScript_InLayer_" + str(_counter);
private _triggerPointMarkerName = "triggerPoint_A3AScript_InLayer_" + str(_counter);
private _triggerAreaInfo = triggerArea _x;
// Creates the trigger area marker and sets its settings
createMarkerLocal [_triggerAreaMarkerName, _triggerPosition];
_triggerAreaMarkerName setMarkerSizeLocal [_triggerAreaInfo select 0, _triggerAreaInfo select 1];
_triggerAreaMarkerName setMarkerDirLocal (_triggerAreaInfo select 2);
_triggerAreaMarkerName setMarkerColorLocal "ColorCIV";
_triggerAreaMarkerName setMarkerBrushLocal "DiagGrid";
if (_triggerAreaInfo select 3) then {
_triggerAreaMarkerName setMarkerShapeLocal "RECTANGLE";
} else {
_triggerAreaMarkerName setMarkerShapeLocal "ELLIPSE";
};
// Creates the trigger point marker and sets its settings
createMarkerLocal [_triggerPointMarkerName, _triggerPosition];
_triggerPointMarkerName setMarkerColorLocal "ColorBlack";
_triggerPointMarkerName setMarkerTypeLocal "mil_dot";
if (_triggerText != "") then {
_triggerPointMarkerName setMarkerText _triggerText;
} else {
_triggerPointMarkerName setMarkerText ("Trigger_" + str(_counter) + "_InLayer");
};
_counter = _counter + 1;
} forEach (_layer select 0);
The line that I executed locally to test this:
[["TRIGGERS"], "A3A_fn_getLayer", [], "A3A_fn_markTriggersInLayer"] remoteExec ["A3A_fn_useRemoteReturn", 2];
Any idea what I could've done wrong? 😅
Affirm
class A3A
{
class AI
{
class disableLayerAI {};
class enableLayerAI {};
};
class Utility
{
class markTriggersInLayer{};
class markTriggersInMission{};
class useRemoteReturn{};
class getLayer{};
};
};
For example (should work but may need tweaking/optimising):
waitUntil {!isNull player}; // the player object might need a minute to initialise on start
if (side player == west) then { // check which side the player is
[] spawn { // create a new scheduler thread so we don't get in the way of the main initPlayerLocal thread
BLU_MHQ_marker = createMarkerLocal ["BLU_MHQ_marker",getPosATL MHQ1];
BLU_MHQ_marker setMarkerTypeLocal "b_hq";
BLU_MHQ_marker setMarkerColorLocal "ColorWest";
while {true} do {
BLU_MHQ_marker setMarkerPosLocal (getPosATL MHQ1);
sleep 1;
};
};
};```
( @twin oar )
those give you A3A_fnc_disableLayerAI and stuff
needs a c
also come to think of it this should be [_callbackParams + [_result]]
expansion: fn_functionName.sqf is used in the file names, tag_fnc_functionName (fnc) is used when you call it in code
Copy will update.
So I need to update the files to be fnc instead of fn if I understand this correctly?
will update
no see what Nikko said
No, the file names are correct, the function name when you call it is wrong. It is correct that they should be different; you have them both the same.
Ah, understood, seems like it is working, I'll give it a proper test after updating mission files on the server.
Thank you again for the help :D
🎉 I learned more about functions again
and thanks Nikko for explaining that part ^
didn't say anything was missing but didn't update POS at all
Did it create the marker at all? (if you have an existing editor-placed marker make sure to get it out of the way to avoid confusion)
Well, we are creating a local-only marker on each machine. That has to be done through script. So the editor marker is not used. You don't have to delete it but it will make things clearer.
anyone has a script handy that would fill an empty ammo with the gear of a given faction?
while {true} do {BLU_MHQ_marker setMarkerPos (getPosATL MHQ1); sleep 1;};
waitUntil {!isNull player}; // the player object might need a minute to initialise on start
if (side player == west) then { // check which side the player is
[] spawn { // create a new scheduler thread so we don't get in the way of the main initPlayerLocal thread
BLU_MHQ_marker = createMarkerLocal ["BLU_MHQ_marker",getPosATL MHQ1];
BLU_MHQ_marker setMarkerTypeLocal "b_hq";
BLU_MHQ_marker setMarkerColorLocal "ColorWest";
while {true} do {
BLU_MHQ_marker setMarkerPosLocal (getPosATL MHQ1);
sleep 1;
};
};
};```
this is what I've got
not creating a marker
You have two while loops, you don't need the first
okay took the first one out trying now
that worked, how do I add text next to the specific marker?
BLU_MHQ_marker setMarkerTextLocal "your text here";```
directly after the other similar lines
I appreciate all the help!
then to make one visible to Opfor I just replace BLU with OPF?
and the color with EAST?
The BLU_ part of the marker name is not what controls who it's visible to - it's just a name. You should change it anyway to keep things clear, though.
Remember, we're creating a local copy of the marker on the machine of any player who is on BLUFOR. The part that detects this, and decides whether to create the marker, is the if check, which checks the side of the player unit.
if I do if () exitWith {} inside a foreach loop, does it exit the loop entirely or does it just skip the rest of the current loop
it exits the loop; continue skips to the next iteration
oh didnt know sqf had continue, sick thank you.
any recommendations for a program that will highlight syntac errors? i have the basics of how things flow but im still getting use to proper bracketing etc.
Is there a way to make a container contain a refreshing inventory? Dont wanna place 500 mags of something and dozens of different weapons each time for lag, just want one crate to refresh its inventory when something is taken
probably set up a box with whatever you want. Give it a variable name and do a
createVehicle
sleep xxx
delete vehicle
then loop it somehow
use Take and Put event handlers
_maxPlayers = 3;
this addAction ["RAID", {
_markerPos = [];
{
_markerPos pushBack getMarkerPos _x;
} forEach ["Exit1", "Exit2", "Exit3"];
_randomPos = _markerPos call BIS_fnc_selectRandom;
if (count playableUnits < _maxPlayers) then {
player setPos _randomPos;
{
_x setPos (getPos (_this select 1));
} forEach units group (_this select 1);
skipTime 5;
} else {
hint "Maximum player count reached. Raid area is full.";
}
}, [], 1, true, true, "", ""];
I have this on a object (Map on a stand)
{alive _x && (side _x == west)} count thisList <= _maxPlayers
I have this in the condition field of a trigger in the raid area.
I need to teleport players and their team mates to 1 of the random marker positions within this designated raid area. But i want to limit the number of players that can teleport there due to the space being rather small.
I am currently getting an error that says my variable _maxPlayers is undefined.
Probably a simple fix if someone could show me what i am doing wrong and maybe give me a good source so i can educate myself on this mistake
well if the variable is only used in the add action code just move it into the addAction code
you can also pass variables to the addAction via its arguments
I have this on a object (Map on a stand)
{alive _x && (side _x == west)} count thisList <= _maxPlayersI have this in the condition field of a trigger in the raid area.
that won't work because_maxPlayersis a local var
okay that makes sense and moving the _maxPlayers worked with no issue
The console in Advanced Developer Tools is the only one I've found that's worth using.
Visual studio code with the sqf extension. It's a must
SQF*?

I am back with more dumb questions.
So like i stated previously I have a section of the map that is secluded and i only want a certain number of players to teleport to one of the 3 markers there randomly. I also need to limit the number of players in that area. For example if I only want 10 players in there then once a trigger detects 10 players then no more players will be allowed to teleport.
The thing I am having trouble with is getting the trigger in the "Raid Area" to count the players inside of it and make the variable "playerCount" = the number of players in the raid area.
How would I go about doing this?
you don't need any global variables for this.
all you need is get the list of triggers that still have spots left:
_allTriggers = [trigger1, trigger2, trigger3, ...]; // some array of triggers
_allPlayers = allPlayers;
_limit = 10;
_validTriggers = _allTriggers select {count (_allPlayers inAreaArray _x) < _limit};
if (count _validTriggers == 0) exitWith {systemChat "can't teleport"};
player setVehiclePosition [ASLtoAGL getPosWorld selectRandom _validTriggers, [], 30, "NONE"];
Would a completely non-reactive and immortal vehicle driver/gunner be the result of a misconfigured dynamic simulation setup?
It could be, or just disabled simulation in general
so you can jam containers, uniforms, vest, backpacks, into crates, vehicles cargo inventories, and such. how do you tell that the backpack has contents after you've done that?
After BIS_fnc_saveInventory/BIS_fnc_loadInventory you mean?
no, actually shifting gears after I got arsenal more or less stood up on its feet...
moving on to actual containers, vehicles, handing those inventories.
I figure how to more or less approach actual objects i.e. when I have a cursorobject, but how about containers on the ground?
for instance everyContainer requires an object. but objNull (ground?) no comprende.
anyone managed to select NIArms' weapons muzzles?
err. sorry
not muzzles. weapons slots
this is super weird to me, the config is laid out lilke this:
count ("true" configClasses (configfile >> "CfgWeapons" >> "hlc_rifle_g3a3vris" >> "WeaponSlotsInfo")) returns 1
I feel like I'm having a stroke
everyContainer _vehicle works when I have a vehicle object. but how do I get the same for ground containers, uniforms, vests, backpacks, etc? you know how in player inventory there is sometimes the "Ground" tab, for instance.
https://community.bistudio.com/wiki/everyContainer
The docs suggest it is possible, but there does not appear to be any form where it is...
i.e. Used for accessing containers content stored in ammo box or ground holder
what is a "ground holder"?
@brazen lagoon Probably because configClasses doesn't count inherited entries?
You want configProperties with isClass _x
@dreamy kestrel Probably means weaponHolder or weaponHolderSimulated
still do not really know what that means, there is no primivite container Holder?
if it is only hard objects I can engage, not the worst thing.
that makes sense. Really the only thing I care about is getting the weapons slots for a weapon
yep thanks @granite sky that worked
@dreamy kestrel Not really sure what you're asking.
If you drop a backpack, it creates a GroundWeaponHolder object and puts it in there.
You can't put a vest inside a backpack or anything like that, as far as I know?
The "Ground" tab in the inventory is often a composite of a body and the nearest weapon holder.
https://github.com/SQFvm/language-server
+
https://marketplace.visualstudio.com/items?itemName=vlad333000.sqf
Hi guys question i have made this script witch works but i wounder how i can make this to work with dinamicly spawned tanks eather with zeus or with a script?
Basicly how would i update _allTanks array with dinamicly spawend vehicles. I call this script in Init.
private _allTanks = entities "Tank";
{
_x addEventHandler ["Killed",{
params["_unit"];
systemChat format ["Tank destroyed %1",_unit];
private _pos = getPosASL _unit;
private _helper = createVehicle ["Land_Tableware_01_napkin_F", [0,0,0], [], 0, "CAN_COLLIDE"];
private _tankTurret = createVehicle ["Land_Wreck_T72_turret_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_tankTurret attachTo [_helper,[0,1,0.5]];
_helper attachTo [_unit,[0,0,1]];
detach _helper;
[_helper, [random 100,random 100, random 100]] call BIS_fnc_setObjectRotation;
_helper setVelocityModelSpace [0,2,20];
}];
}foreach _allTanks;
i want to make my AT JAVELINE to have infinite ammo, but why this script not work "this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}];"
I am looking for objects of that class then? i.e. "GroundWeaponHolder "?
no, but you can put those containers into other hard objects, vehicles, crate crates, things of this nature.
that's what I am after.
ultimately for an inventory manager of sorts.
thanks...
setVehicleAmmo only works on vehicles not units. Usesqf this addEventHandler ["Reloaded",{_this#0 addMagazine (_this#3#0)}];to refill magazine everytime he reloads it
how to fix this - No entry 'bin\config.bin/CfgWeapons.vkbo_01'
Remove a bad Mod
how to fix wrong animation ?
on the left wrong animation but the turret work done, on the right is correct animation but missing mod, i just want to fix my left animation to be like right soldier
Use the right vehicle?
use left vehicle
but animation soldier error like the video
how to fix animation soldier on the left
switchMove on what ?
here's what i mean btw
No need to make a video about it, we know what you meant
?
the soldier just at the wrong animation again
Hey everyone! Could someone advise me on some matter regarding MP scripting?
In editor for MP scenario I placed a trigger with below settings which is supposed to play music to group of players in trigger area when detected:
Type: None
Activation: Any Player
Activation Type: Detected by OPFOR
Repeatable: Yes
**Server Only: **Yes
Condition:
this && allUnits inAreaArray thisTrigger findIf {isPlayer _x} != -1
On Activation:
["AttackingComms"] remoteExec ["playMusic",group _unit];```
**Current behavior:** when player group enters trigger area and is detected by OPFOR music starts playing __to all groups inside trigger area__. When new group enters music starts from beginning for everyone inside trigger.
**Desired behavior:** when player group enters trigger area and is detected by OPFOR music starts playing __only for a group that enters__. Other groups that are inside trigger aren't affected.
So basically I want to avoid situation where one group enters, music starts playing for them but then other group enters and music starts from the beginning for everyone.
create local triggers
you won't need remoteExec
@little raptor Oh boy, I'm so dumb xD, so I would just set "Server only" to "no" and then instead of remoteExec just use plain "playMusic"?
yes. tho the condition should also be:
this && {player in thisList}
So in this case it will play music on every player machine separately?
yes
Thanks good man
why does the parachute popup when respawing to a ship? Arma seem to think the respawn is at air. is there a way to fix that?
Hello everyone :D
Question in regards to this script I am working on:
https://github.com/SkippieDippie/A3A-Event-Standard-Files/blob/Nomas_dev/A3AEventMissionBase/initScripts/initEquipment.sqf
I am running into an issue where lines 118-124 are executing before 73-75 it seems, at least that is what I think.
The uniform items will not be added if the uniform does not have enough space, so when I join the server with a slot that has a filled uniform, nothing gets added but the size does get increased.
This mainly happens the first time I load into the mission.
I've tried using WaitUntil but error said it's not possible to susspend this script.
initEquipment.sqf is being included in initPlayerOnRespawn.sqf
Any idea what could be going wrong?
you can fix it yourself by checking AGLS height every frame. see this for example:
https://github.com/Leopard20/A3_Freefall_Fix
Any idea what could be going wrong?
remoteExec takes time
Ah, makes sense.
Is there a way to make sure the script waits until the maxLoad of the uniform has been increased?
you can use the same remoteExec callback thing
or add a waitUntil and check for maxLoad or something
wouldnt setting the setUnitFreefallHeight to 10000 before respawn also fix this problem?
yes but you should also detect if the unit is actually falling
if you do that you can't parachute anymore
but then I just set that to default again
ok thx
hmm doesnt seem to be working for me when I do ```sqf
player setUnitFreefallHeight 100000;
the parachute always appears
where do you put it?
player addEventHandler ["Respawn"
you mean like all playable units init?
yes. or just make a function with preInit. not sure if it works in MP
is the point here to give it enough time to apply the effect?
the point is not giving it any time
if you give it any time the unit goes into freefall pose
like you do now
which is why I just do a perframe EH
it's guaranteed to not give the unit any time
and its performance impact is minimal or just next to 0
you mean like ```sqf
addMissionEventHandler ["EachFrame",
{
player setUnitFreefallHeight 100000;
}];```
that didnt work...
where do you put the EH?
tried in respawn EH and console
put it in preInit
Ah, I assume I'll have to make initEquipment.sqf into a function.
btw is there a function to receive ground z if on ground and water z if on water?
which seems to be easier said than done because the chute is already detached from the player when respawn happens...
wow, getting educated on the vocabulary for inventory manager... sure would be nice to know if a uniform, of vest, or backpack, object or class, is a uniform, or is a vest, or is a backpack ... i.e. _b iskindof 'backpack'. but it does not look like I'm gonna have that by its pedigree, i.e. [_b_cfg] call BIS_fnc_configPath, i.e. ["configFile","CfgVehicles","B_Carryall_cbr"].
_x isKindof 'Bag_Base'
isBackpack config entry
for vest and uniforms there are item types and inventory slots
AGLtoASL
thanks. @proven charm no does not have that pedigree, at least not consistently, but I like the config based approach.
of course, besides what the primitives report are various containers, etc.
another dumb question, for vests, what do you use as a config displayName?
I have displayName for uniforms, it seems like, but not for vests, or at least not some vests
or perhaps just reject any configs that do not have display name? i.e. they are there for scenery only, not for player use?
they should have display name
they should I agree, but config viewer showing not all do
check their scope. maybe they're not meant for use
well what is their scope?
the ones with display name, seems like 2, others 0 for instance
Things with scope 0 cannot be created in any way, even by script, so they don't need display name and you can ignore them. They are classes used only for config inheritance logistics.
ok, thanks... yeah i recall something like that.
what's the difference between unitBackpack and backpackContainer, they seem to be returning the same object instance.
is it possible to globally change a players name through scripting?
What name?
https://community.bistudio.com/wiki/setName
Maaybe try this
if setIdentity or setName do not work, nothing will
A player's name cannot be changed in multiplayer, it will always be their profile name. It can be changed in SP but not MP.
iirc, the "unit name" could be changed at one point, but ofc everything moderation-related (username, etc) was unchangeable (ofc)
Im going to create zeus players like so below, but would I need to worry about when the player the curator is assigned to dies?
params["_player"];
private _grp = createGroup sideLogic;
private _module = _grp createUnit [
"ModuleCurator_F",
getPos _player,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];",
[],
0,
"NONE"
];
_player assignCurator _module;
_module addCuratorEditableObjects [allMissionObjects "all", true];
_module
yeah I guess the zues doesnt really need structures and whatnot assigned to him
Maybe instead would be better?
_module addCuratorEditableObjects [allUnits, true];
_module addCuratorEditableObjects [vehicles, true];
Heya 
Can i know if an object is original from the map or created with createVehicle, createSimpleObject, etc?
yeah. you can also use allObjects for other types too
isSimpleObject
map ones dunno
Thanks
actually there is a way
you can try to move it using setPosWorld. if it doesn't move it's a map obj
I did it with allMissionObjects but this function freezes the game
Thanks, i wil ltry that.
allMissionObjects return all objects created by scripts.
to run code only on original map objects.
use nearestTerrainObjects then
I will try, thanks.
Now i got how this function works, it returns only map objects, right?

Q: how do you get things like headgear or goggles in terms of objects that may be dropped into respective inventory containers?
This feels like some sort of basic misunderstanding.
_container addItemCargoGlobal [headgear player, 1] works, for example.
so handling the STRING is sufficient then
also, yes, that is one use case, maybe... I'm thinking more from an arsenal, dropping some bits into a target container.
think inventory manager, I've got a list of headgear (or goggles, or whatever), I want to populate the target container, whatever that is, backpack, ammo box, vehicle, whatever.
Yes, addItemCargoGlobal would be how you do that, using the item's classname
great, thanks...
Most items are just that. Strings.
They have no attached data.
This is why mods like TFAR define 1000 different radios of each type.
why or because... 😉 I read you. thank you...
Does vectorDotProduct normalise A and B before returning the result?
No.
Alright, thanks
If you want a shortcut to the angle between two vectors then vectorCos is faster.
is there a way to get if the user is currently controlling his own unit (player) or remote-controlling another unit (specifically zeus remote control)?
this one "a3\ui_f\data\igui\rscingameui\rscdisplayvoicechat\microphone_ca.paa" ?
retrieved with https://forums.bohemia.net/forums/topic/231519-icon-viewer-script/ 😉
everything I believe except icons in .ebos
talking about this piece of code again. When you place the Game Master module in the editor, you give it an ID or variable name in the owner text box. How could I go about this via SQF?
_module setVariable ["owner", ...]
would that assign the owner property?
The post is from 2019 but I just found this on the forums
_module set3DENAttribute[ "ModuleCurator_F_Owner", "steam64etc" ];
_module set3DENAttribute[ "ModuleCurator_F_Addons", "All" ];
_module set3DENAttribute[ "ModuleCurator_F_Forced", "1" ];
I was thinking of doing this
{
private _grp = createGroup sideLogic;
private _module = _grp createUnit [
"ModuleCurator_F",
[0,0,0],
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];",
[],
0,
"NONE"
];
_module set3DENAttribute[ "ModuleCurator_F_Owner", _x ];
_module set3DENAttribute[ "ModuleCurator_F_Addons", "All" ];
_module set3DENAttribute[ "ModuleCurator_F_Forced", "1" ];
} forEach TRA_whitelist;
that only works in 3den
oh, alrighty ill give your suggestion a shot in just a moment.
this doesnt appear to work. I am putting a Steam64ID in the "owner" variable but no dice
{
private _grp = createGroup sideLogic;
private _module = _grp createUnit [
"ModuleCurator_F",
[0,0,0],
[],
0,
"NONE"
];
_module setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_module addCuratorEditableObjects [allUnits, true];
_module addCuratorEditableObjects [vehicles, true];
systemChat _x;
_module setVariable ["owner", _x];
} forEach TRA_whitelist;
you mean _x is a string?
also you should probably use the other createUnit syntax
yeah you haven't assigned it either
you mean _x is a string?
yes
also you should probably use the other createUnit syntax
but that doesnt return the module object
you can put everything in its init
createUnit [... toString {
this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
this setVariable ["owner", _x];
}]
not sure if _x is passed
it should be tho
this requires a player though right? I was hoping I could just create these modules on server start based on the players in whitelist rather than create and set on player respawn
either way you have to assign it
hmm, then there is no point setting the owner variable right?
[[player], {
params ["_player"];
_grp = createGroup sideLogic;
_new = _grp createUnit ["ModuleCurator_F", [1,1,1], [], 0, "NONE"];
_new addCuratorAddons activatedAddons;
_player assignCurator _new;
}] remoteExec ["call", 2];``` is (and was) in production for quite some time for self-assigning zeus 
although the edge cases may be not tested due to typical missions on that server
hmm alright, doesnt look like owner variable is set there either though.
Any ways ill try it and just assigning in general. Is there an event handler I could use for when the player starts actually playing as a unit for this?
yeah, doesn't seem to survive player death even on listen server
sad, alright ill just use respawn eh then
and ill probably respawn players after they join anyway
hiya wondering if anyone can help me with scripting and editing current missions by adding scripts to it
BIS_fnc_curatorRespawn function seems to be used for "vanilla" respawn handling. And it adds MPRespawn EH and reassigns curator 
remoteExec has fairly low network priority, I think.
remoteExecCall possibly higher?
shrugs
Might be you have too much guaranteed network traffic in general.
And then something's gotta be delayed.
how much is too much?
about that much
recheck your code, the fact that it works well then gets delayed most likely means something is piling in your network queue @boreal parcel
Not my issue, its his @granite haven. I was just curious
(woops, mb)
having hard time thinking, how do I attach an object to player that would only follow his position, ignoring the direction?
or is there any body selection that does not turn with body, been blindly checking them for attachTo but they all seem to rotate
I have an object that has to be always exactly 600m from the player but with attachTo it will always be in front of the player, I want it to just "follow" the xyz coordinates
each Frame setPosWorld?

[] spawn{
Fnc_changeNUMBER = {
params ["_NUMBER"];
_NUMBER = _NUMBER + 1;
};
private _NUMBER = 0;
[] call Fnc_changeNUMBER;
diag_log _NUMBER;
};
this should log 0 or is my understanding wrong?
should log 0 because scope I believe
yes
alright, I have ```sqf
addMissionEventHandler ["EachFrame", {
_posX = ((getPosASL player) select 0) - 300;
_posY = ((getPosASL player) select 1) - 300;
_posZ = 250;
_redCircle setPosWorld [_posX,_posY,_posZ] }];``` and seems to be working
Lou not so :clueless: after all hey 😛
I was the clueless one
now how do I convert the accidentaly achieved 600 meters of distance3d into XYZ coordinates for the setPosWorld command?
I really suck at maths
well I guess I could just substract
vectorAdd perhaps?
you could use the alt syntax of getPos then set the Z value, or use sin, cos, angles etc
question, is there a way to give a vehicle a variable name after it was spawned in zeus?
If you have a reference to the object then you just assign it like any other variable.
e.g.
_curator addEventHandler ["CuratorObjectPlaced", {
params ["_curator", "_entity"];
vehicleVariable = _entity;
publicVariable "vehicleVariable";
}];```
(probably don't actually hardcode global variable assignments in a curatorObjectPlaced EH, that will result in overwriting the variable each time you place a new thing. That's just an example of one way you might get a reference to the object.)
do you have access to debug console?
double click the object, into init field enter MyNewVehicle = _this and make sure big letter on right hand side is set to G then execute
Ohh
MyNewVehicle will refer to that unit from that point on
That easy?
G means Global Execute, so this variable will be avalible on all clients, to save yourself some trouble later on
text away
Test*
test* away
10-4
4-20
6-9?
ni-ce
can someone direct me in direction on how to attach a working ACE_ChemlightEffect_UltraHiOrange to a crate?
Having a bit of a stuck on google
if you have an ace dependency already you can do player != ace_player iirc? 😅
So, I am trying to figure out which player has the largest number of close players (to later find the center pos of the player squad). Does Anyone have a more efficient idea of how to accomplish this without using nested loops?
{
private _index = _x;
private _unitArray = [];
{
if (_x != _index) then {
if (_index distance2D _x < _maxDistance) then{
_unitArray append [_x];
};
};
} forEach _units;
_unit2dArray append [[count _unitArray, _index, _unitArray]];
} forEach _units;```
_temp = _units apply {[count (_units inAreaArray [getPosWorld _x, _maxDistance, _maxDistance]), _x]};
_temp sort false;
_max = _temp#1
that looks like a faster way to do it, cheers
Into The Radius??
😳
Somebody know a class I could use to removeCuratorEditableObjects for all empty objects?
Apparently adding everything civilian adds all the empty objects on the map to the zeus interface, because oh well arma
And I wan't do delete that shit
does anyone know what a GIF pre stack size violation is?
SQF syntax error that it didn't pick up as a syntax error, usually.
probably a bracket screwup of some kind.
ill send code
`waitUntil {sleep 1; _town = markerColor "ColorEAST"};
_trigger = createTrigger ["EmptyDetector", getMarkerPos _town, true];
_trigger setVariable ["AgiaMarinaTriggerBLU", _trigger];
_trigger setTriggerArea [150, 150, 0, false, 5];
_trigger setTriggerActivation ["WEST SEIZED", "PRESENT", true];
_trigger setTriggerStatements ["this", "(missionNamespace getVariable 'AgiaMarinaFlag') addaction ['Capture Area', {Trigger_Agia = true; publicVariable 'Trigger_Agia';}];", ""];`
i havent used waituntil before so could be a basic error
Not sure what you were aiming for with the waitUntil condition but it doesn't look correct.
Maybe markerColor _town == "ColorEAST"
ill give it a try
what's it actually supposed to do?
so i want a marker that flip flops between colors depending on who controls it
thats fixed it thx
(missionNamespace getVariable 'AgiaMarinaFlag') is equivalent to AgiaMarinaFlag btw
ah thank you
another issue `_town = "AgiaMarina";
_flag = "AgiaMarinaFlag";
//initial town setup
_town setMarkerColor "ColorEAST";
// Add action to flag trigger
{waitUntil {sleep 1; markerColor _town == "ColorEAST"};
_trigger = createTrigger ["EmptyDetector", getMarkerPos _town, true];
_trigger setVariable ["AgiaMarinaTriggerBLU", _trigger];
_trigger setTriggerArea [150, 150, 0, false, 5];
_trigger setTriggerActivation ["WEST SEIZED", "PRESENT", true];
_trigger setTriggerStatements ["this", "(missionNamespace getVariable 'AgiaMarinaFlag')
addaction ['Capture Area',{Trigger_Agia = true; publicVariable 'Trigger_Agia';}];", ""];
// trigger applies changes to marker and flag
_triggerChanges = createTrigger ["EmptyDetector", getMarkerPos _town, true];
_triggerChanges setVariable ["AgiaMarinaFlagChange", _triggerChanges];
_triggerChanges setTriggerArea [0, 0, 0, false, 0];
_triggerChanges setTriggerActivation ["NONE", "NONE", true];
_triggerChanges setTriggerStatements ["Trigger_Agia", "'AgiaMarina' setMarkerColor 'ColorWEST'; ['TaskSucceeded', ['', 'Agia Marina Captured']] call BIS_fnc_showNotification; (missionNamespace getVariable 'AgiaMarinaFlag') setFlagTexture 'flags\west.jpg'", ""];};
{waitUntil {sleep 1; markerColor _town == "ColorWEST"};
deleteVehicle "AgiaMarinaTriggerBLU";
deleteVehicle "AgiaMarinaFlagChange";
_trigger = createTrigger ["EmptyDetector", getMarkerPos _town, true];
_trigger setVariable ["AgiaMarinaTriggerEAST", _trigger];
_trigger setTriggerArea [150, 150, 0, false, 5];
_trigger setTriggerActivation ["EAST SEIZED", "PRESENT", true];
_trigger setTriggerStatements ["this", "'AgiaMarina' setMarkerColor 'ColorEAST'; ", "['TaskFailed', ['', 'Agia Marina Seized']] call BIS_fnc_showNotification;"];};` the action added by addaction is no longer present
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
be more precise @coarse needle, what you mean with "empty objects"
because that term could be everything
The ones that show in zeus under "empty". So all the objects from the editor from under the "empty" tab.
and you want to add them? or to remove em?
removing em is fairly simple, just like adding them
if (headgear player != rhs_altyn && headgear player != rhs_altyn_visordown) then {
player addHeadgear rhs_altyn;
};
// Add an action to the player
player addAction ["Toggle Faceshield", {
params ["_unit"];
// Check the current headgear
_currentHelmet = headgear _unit;
// If the current helmet is the Altyn with faceshield up, replace it with the Altyn with faceshield down
if (_currentHelmet == "rhs_altyn") then {
removeHeadgear _unit;
_unit addHeadgear "rhs_altyn_visordown";
}
// If the current helmet is the Altyn with faceshield down, replace it with the Altyn with faceshield up
else if (_currentHelmet == "rhs_altyn_visordown") then {
removeHeadgear _unit;
_unit addHeadgear "rhs_altyn";
};
}, [], 0, false, true, "", "(headgear player == 'rhs_altyn') || (headgear player == 'rhs_altyn_visordown')"];
getting an error
Error else: Type if, expected code
not sure what is going on
removing those should work with this fancy code
_arr = [];
{
if(_x isKindOf "CAManBase" || {count crew _x > 0}) then
{
_arr pushBack _x;
};
false
} curatorEditableObjects _zeusObject;
_zeusObject removeCuratorEditableObjects [_arr, false];```
You're missing quotes on classnames in the first bit.
Also your else syntax is wrong.
There's no specific else if construct in SQF, so you have to write stuff like this:
if (condition) then {
//code
} else {
if (condition2) then {
//other code
};
};
Situation is ongoing
I think I am having some sort of basic understanding issue.
I create a vehicle, and than change it name
_vehicle = "Sign_Sphere200cm_F" createVehicle position player;
_vehicle = big_baloon;
But than
big_baloon setObjectTextureGlobal [0, "\A3\Characters_F\Common\Data\basicbody_black_co.paa"];
Nothing happens, and I assume because "big_baloon" was not the name? I dunno
private _vehicle = "Sign_Sphere200cm_F" createVehicle position player;
_vehicle setObjectTextureGlobal [0, "\A3\Characters_F\Common\Data\basicbody_black_co.paa"];
or if you want to use it local somewhere else
big_baloon = "Sign_Sphere200cm_F" createVehicle position player;
another code/trigger etc
big_baloon setObjectTextureGlobal [0, "\A3\Characters_F\Common\Data\basicbody_black_co.paa"];
my question would be, why _vehicle = big_baloon; didnt work?
big_baloon = _vehicle;
player addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
_rock = rocket;
_rock attachto [_projectile,[0,0,0]];
}];
im tring to attach a object to the vls for a rocket script, but i cant seem to get it to work.
What are launcher and rocket? Since they are not defined, and _veh isn't even used
rocket is the object i am attaching
launcher was left behind whoops
And does the variable (and object) exist the moment the EH is running?
It might be a good idea to just create a new object the moment the EH fires (inside the code)
cant create one as firing as the rocket needs to be there sitting
rocket does exsits
its an object with rocket in the top above init
But you create the object once, and can be attached multiple times (every time someone shoots), which means it only works correctly the first time.
Or never, because the object is not accessible when the EH is fired (it should be, but you never know with Arma)
So instead create a new rocket object within the EH and attach that to the projectile
but i need the rocket to be sitting there aready
if i create a new one then there is no giant rocket that lauches
it will just spawn in
Either there's something going wrong with the EH, or the object(s) are not working well with attachTo (see notes at: https://community.bistudio.com/wiki/attachTo)
What really helps is that the function is already defined and called, rather than execvm
Also there's the 3ms max scheduled scripting per frame... if it goes past its just stopped iirc?
As for direct speed, idk? Never tested...be interested to know
Remove
I was just wondering what a class would be to remove all the empty objects.
tried "empty" and "land"
is rocket defined as an object? if so how is it defined?
what kind of language is arma's scripting about?
Unscheduled means the code runs right now and will delay the simulation until it's done (this is why suspension is not allowed). Scheduled means the scheduler is allowed to manage its resource usage and limit it to using 3ms per frame at most; the simulation will not be delayed any more than that for each thread.
Stacking up a lot of heavy scheduled scripts running at once can cause slowdown because all those 3ms add up. However, stacking up a lot of heavy unscheduled scripts (or even one particularly bad one) can cause a dramatic lag spike, because the entire game gets paused to wait for it.
Hmm. For BIS_fnc_playVideo, do I want to spawn it or call it? I'd like it to loop indefinitely - it's a short video, about 30 seconds. This is what I have sorta pseudocoded up so far:
(In Init of the object, a BriefingScreen or other large TV:)
_video = "images\dnaspin.ogv";
this setObjectTexture [0, _video];
(In Server-Only Trigger)
while {var1 && var2} do
{
_video call BIS_fnc_playVideo;
// Wiki says that if called, script will wait for video to be over
// before moving on. so I guess we only want the
// below line only if spawned instead of called?
sleep video_length_in_ms;
}```
call bis_function
Sleep video_length
}```
Simple solution, you could write better using scriptDone if you want lol
You can't suspend (sleep) inside call (in normal scheduled environment) so that's why you want to spawn.
I have sqf _ash_post = "#particlesource" createVehicleLocal (position vehicle player); _ash_post setParticleCircle [0, [0,0,0]]; _ash_post setParticleRandom [10, [5,5,0],[0.175,0.175,-0.5],1,0.25,[0,0,0,0.1],1,0.1]; _ash_post setParticleParams [["\A3\data_f\ParticleEffects\Hit_Leaves\Leaves_Green.p3d", 1, 0, 1], "", "SpaceObject", 1, 7, [0, 0,5], [0, 0, -0.5], 2, 10.2, 7.9, 0.1, [0.1,1,0.5], [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]], [0.08], 1, 0.5, "", "", vehicle player]; _ash_post setDropInterval 0.02; for simulating a falling ash, my problem is that this effect looks good only when player is standing, once he starts to move the particles will show up behind him. I tried changing the particleCircle to something bigger but it makes the particles to fly around or go up instead of slowly dropping like it's now
do I have to assign multiple particlesources around him? Or how do I change the area without breaking the "negative" velocity?
You do not need to add a sleep to wait for BIS_fnc_playVideo if the function is executed with call. You are correct that the overall script should be spawned since you (and the function) can't suspend in an unscheduled environment, but inside of that, the function itself suspends the current thread until the video is finished.
Is it necessary for the particles to be only around this player? If it's fine for them to appear missionwide, you could use rain in snow mode instead
yes it doesn't have to be just around a single unit necessarily, I'll try playing with bis_fnc_setRain then, thanks
uh there is an issue, there is no way to keep the "dry" footsteps sound 
no need
nvm, found out about setHumidity, now I just have to figure out a better texture than the raindrop "square"
Why can't i add an addaction to map / terrain objects?
Is there some kind of workaround maybe?
how many?
I want an add an addaction to every ATM
then add the action to yourself
and use its condition to detect if player is looking at an ATM
thats the current solution, i wanted to see if there is any way to add this on an map object
no you can't add actions to map objects
you can create an object on top of them and add the action to those but that's a worse workaround
Du you think deleting every atm und readd in eden would be so bad?
you can't delete map objs either
the conventional solution is to add action to the player and use condition to determine visibility, like if they are pointing at correct object class/model
the catch is that adding action to player comes with a price. condition evaluates always, so adding too many impact performance
speaking of which, an addAction alt syntax with no condition evaluation would be handy
So I have Chem = "Chemlight_yellow" createVehicle [0, 0, 0]; and works as intended in creating the chemlight but can not seem to get a ACE Chemlight to work as I am looking for the HiOrange specifically.
Can someone please advise on how to create a "used and glowing" ACE chemlight with the above method?
you will need ACE chemlight classes, most likely findable in their doc
Am aware, have gone through all the known classes I could find in https://github.com/acemod/ACE3/tree/e5a15d200f44df5fccc0bc5575d18d80b35538dd/addons/chemlights
Pretty much, ye
try triggerAmmo _chem
Thank you, Sir. check method
Also,, discord is on drugs, messages sending twice
is it possible to detect if zeus is open?
findDisplay
ty
findDisplay 312 I think
is rainbow something tied to map, engine or can it be hidden by a script?
it shows up with rain set to 1 and overcast to 0.51, I would rather not have it without doing overcast 1 (because I still need the sun)
read the page on setRainbow
wait no that's not the page 
ah nvm it is 😅
It should be known that this command does not create a rainbow in all conditions. As in real life, the rainbow can only appear after rainfall and opposite of the sun when it is low on the horizon.
// Function to toggle the faceshield
fn_toggleFaceshield = {
params ["_unit"];
// Check the current headgear
_currentHelmet = headgear _unit;
// If the current helmet is the Altyn with faceshield up, replace it with the Altyn with faceshield down
if (_currentHelmet == "rhs_altyn") then {
removeHeadgear _unit;
_unit addHeadgear "rhs_altyn_visordown";
_unit camSetDirection [0, 0, -1]; // Set camera direction to limit field of view
} else {
// If the current helmet is the Altyn with faceshield down, replace it with the Altyn with faceshield up
if (_currentHelmet == "rhs_altyn_visordown") then {
removeHeadgear _unit;
_unit addHeadgear "rhs_altyn";
_unit camSetDirection [0, 0, 0]; // Reset camera direction to default
};
};
};
// Function to apply the "Toggle Faceshield" addaction
fn_applyToggleFaceshieldAction = {
params ["_unit"];
// Add the "Toggle Faceshield" addaction to the player
_unit addAction ["Toggle Faceshield", {
[_this select 0] call fn_toggleFaceshield;
}, [], 0, false, true, "", "(headgear player == 'rhs_altyn') || (headgear player == 'rhs_altyn_visordown')"];
};
// Apply the addaction to the player initially
[player] spawn fn_applyToggleFaceshieldAction;
// Create a respawn event handler to reapply the addaction after respawning
player addEventHandler ["Respawn", {
[player] spawn fn_applyToggleFaceshieldAction;
}];
Ive been staring at this for too long and need another set of eyes
what's the problem?
im getting an error is says
error missing ; route/of/my/file line12
You're probably thinking of camSetDir but I'm highly dubious that it does anything for non-scripted cameras (i.e. the player's eyes)
yea i am trying to limit the players view when the faceshield is toggled down
I don't quite see how camSetDir would do that even if it did work on non-scripted cameras. It changes where the camera is pointing, not its FoV.
it was a suggestion given by a friend but i see your point now. I think it would probably be easier to somehow route an image
Is there a way to define what kind of loading screen is shown?
I am asking because I got a weird issue.
If I run a script that shows a loading screen in Eden Editor in a fresh mission. It shows a loading screen without progressbar and with the Eden Editor logo.
I can do that as often as I want, I always get the same screen.
However, if I run
"item" spawn BIS_fnc_exportCfgWeapons
I suddenly get the mission loading screen with the small image in the center and a progress bar.
Once that function was executed, my function uses the same screen
I check the code and both function create the loading screen the same way (startLoadingScreen [""])
This is the screen that is intially shown
yes the 2nd parameter to startLoadingScreen
It says description.ext only sadly.
Ah ok. Maybe I can plug in one of the other default loading screens.
^lol
dumb question, where can i find the rpt file again?
!rpt
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files
To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
danke
when opening the map via openMap is it possible to "customise" the map? like make it not full screen, change the gui a bit, remove the top left tabs?
No. You can make your own control with a map in it though.
Not really a hard no because you can hack displays up a bit, but it sounds like you'd be better off working from a map control there.
Most likely yeah, planning on making a halo jump GUI.
Can I use "unitPos" to get the last stance a unit was commanded to take? I presume "setUnitPosWeak" does not change the value of unitPos.
On unscheduled code forEach is limited to the first 10000 elements of an array?
no
👍
While has/had such limitation afaik
Yes, i just found that the forEach goes only to 10000 because the array used in it is generated by a while, and the while stop at 10000 cycles.
Fixed by using one while inside a while, now the limit is 10000^2 😬
That could take a while
lol
It's a code to pull stuff from a database.
15000 lines
If scheduled, it take ages.
At the begining of the server. So no problem if it has some freezes.
is it possible to have more than just BLU/OP/INDFOR? i.e 4+ way conflicts? 
i've seen it done somewhere before
Arma 3 just can't do anything we want, this is one thing.
Basically you get three and a half sides.
i presume that's to do with civilian
Yeah, there are limitations about what you can do with civilian.
ya i'd guessed
is there no way to make a blufor squad attack another blufor squad then? 
welll...
They will attack even the ones in their own group.
You can technically have a blufor squad with redfor in it. And then they'll all shoot each other.
Like they detemine target side with side group _unit and their own side with side _unit.
mm, wanting to have multiple indfor factions not friendly to one another against blufor and opfor but looks like it's not possible?
i think that sounds like what ive seen before tbh
Old Arma weirdness. If you create units in a group, their side remains default for the unit. If you move units into a group, their side changes to the group side.
Maybe you can scam something with sideEnemy.
but I think that's going to be mass FF
don't sideEnemy also attack sideEnemy though?
probably yes.
yeah probably not a very useful indfor faction if they're all killing each other 😅
wonder how antistasi plus does the enemy guerilla faction then actually 
though idk if those are friendly to anybody
They're probably occ sided with different gear.
haven't played antistasi plus so don't know if they're occ friendly
sideLogic doesn't work either, not even with sideLogic setFriend [blufor,0]; 😦
for loop doesn't have this limit
yes. but it doesn't work on player issued stances
they're "very strong"
you can make them all renegades 
would like to keep the squad cohesion though 
its ok though ive figured out i can just internally force any other factions to always have an alliance with somebody
even though i hate that workaround it seems to be the only one after googling around
wait, what's the workaround?
just not doing it and saying that theres other sides
so not really a workaround at all
just gaslighting people
i damn wish
tried every side that i can assign with no dice
not even like you can just flip the side the unit is on either
SQF:
_a = []; _a pushBack _a;
Error in expression <_a = []; _a pushBack _a; _a>
Error position: <pushBack _a;>
Error 37943744 elements provided, 39311856 expected
Heya! I'm experiencing errors with my intel coding, could anyone help me out?
The ace interact pip just doesn't show up on the object
funny enough I broke my spawn script a little while ago and when spawning units it became a free for all, the units just killed each other
my problem is maintaining some sort of squad cohesion while doing that though
course, i could always run a loop to make all renegade ai forget about "friendly" ai but they'd still be running around like headless chickens if you were lucky
Didnt arma have a feature where if you shot too many friendly forces you would be considered an enemy? same for ai?
or was that arma 2
@violet prairie This line needs a terminating semicolon:
publicVariable "(IDENTIFIER)triggered"
Fixed that, new error on line 24, scanning through
sorry for bothering yall with this
So now I have a similar error on line 24, File C:...... operation%3a.d41_reugen\initPlayerLocal.sqf..., line 24
You haven't posted the error or the actual code (only some two-file source text full of placeholders).
Sorry! Updated error and SQFs
You lost an opening bracket on line 27.
for _myAction?
Computer1, 0, ["ACE_MainActions"], _myAction] call ace_interact_menu_fnc_addActionToObject;
should be [Computer1, 0, ["ACE_MainActions"], _myAction] call ace_interact_menu_fnc_addActionToObject;
ya but thats for everything, including other renegade units
lolwut, is that real?
Try it
brb trying it
Thanks for mentioning this, i was just asking myself this question.
Error in expression <_a = []; _a pushBack _a;>
Error position: <pushBack _a;>
Error 31979968 elements provided, 33348080 expected
wow
how do you do the code tags anyway?
triple ` at start and end
thanks
You can use inline with two backticks as well
how would I go about getting clicks on the MapControl I am creating here:
/* Open Map for player */
private _ctrlMap = _display ctrlCreate ["RscMapControl", -1];
_ctrlMap ctrlMapSetPosition [0.276875 * safezoneW + safezoneX, 0.234 * safezoneH + safezoneY, 0.44625 * safezoneW, 0.476 * safezoneH];
i love markdown
I actually figured that out just now, next question is how do I translate _mouseX and _mouseY to actual world position? (Height isnt needed)
_ctrlMap ctrlAddEventHandler['MouseButtonClick', {
systemChat (str _this);
params[ "_map", "_button", "_mouseX", "_mouseY" ];
}]
markup pays my bills so i have no love for markdown
Ok so it's kind of markdown
solved that as well
_ctrlMap ctrlAddEventHandler['MouseButtonClick', {
params[ "_map", "_button", "_mouseX", "_mouseY" ];
private _worldCoords = _map ctrlMapScreenToWorld [_mouseX, _mouseY];
private _worldX = _worldCoords select 0;
private _worldY = _worldCoords select 1;
player setPos [_worldX, _worldY, 1000];
}]
It's my first time making a mission and I'm trying to find out how I could detect if a trigger is activated or not that activates a different one. Ex: trigger if a vehicle is not alive and don't trigger if vehicle is alive. I know that I can use !alive to find if the vehicle is destroyed, but I only know triggerActivated to use if conditions are met. Is there anything else I could use to detect if the trigger isn't activated?
Yeah. This is a chat after all. So no point in having headers and tables and stuff
Lists would have been cool
- one
- two
- three
There definitely is room for improvement in discord
Af fascinating as this discussion is, I'd like to ask a scripting question :P
go ahead
does anyone know if there's a way to get chat content from arma? like tap in to what people are saying in global/direct/etc?
