#arma3_scripting
1 messages · Page 132 of 1
if you get severely stuck, we can walk you through further tomorrow.
i think ill be able to figure this out
you've gotten me to a far enough point that i should be
just read the wiki carefully when you run into errors
havent been able to get past this point sadly
Your near objects line is wrong. Read the wiki page on how to use the command.
i know its wrong i just cant figure out how
Could be "weaponholdersimulated" not sure. Either way reread the syntaxe
_pos nearObjects ["objectclass", 10];
im not sure how to make the script work tho
i need an object for deleteVehicle and that's an array
{
deleteVehicle _x
} forEach array
ah
An array is like a row of objects. If you want the first object in the array it's just _obj = _array select 0
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
private _pos = getPosATL _unit;
private _obj = _pos nearObjects["GroundWeaponHolders", 10];
systemChat _obj;
{
deleteVehicle _x
} forEach _obj
}];
that look about right or am i still messing something up
Remove the select 0 if you are gonna use forEach
systemChat str _obj
Or
systemChat format ["Array of objects: %1", _obj];
what do these help with
systemChat only accepts inputs of type String. _obj contains an object reference, which is of type...Object, so you have to do something to translate it into a String
*sorry, _obj contains an Array of Objects. Different but still not a String
can you see anything else with the rest because i dont know how to make it work
couple qs, can object scripts running be delayed (due to lag)? and is the script of Land_ClutterCutter_large_F available somewhere, or is it hardcoded?
Hey all, anyone know how to fix an error I'm getting when running this script
// Example usage: Filter objects by type and name
// Function to calculate QDR (Quadrant Distance and Bearing) between two positions
QDRBetween = {
_playerPos = getPosASL player; // Position of the player
_ndbPos = getMarkerPos "NDB_Location"; // Position of the target object (ndb_location)
// Calculate the distance
_distance = _playerPos distance _ndbPos;
// Calculate the bearing
_bearing = getDir _playerPos;
_bearing = _bearing - (getDir _ndbPos);
_bearing = _bearing mod 360;
if (_bearing > 180) then {
_bearing = _bearing - 360;
};
// Output the distance and bearing in the system chat
hint format ["Distance to NDB: %1 meters, Bearing: %2 degrees", _distance, _bearing];
};
// Loop for 5 seconds
private ["_endTime"];
_endTime = time + 5;
while {time < _endTime} do {
// Call the function to calculate QDR and display
call QDRBetween;
// Pause execution for a short duration
uiSleep 1; // Adjust the duration as needed (in seconds)
};```
will try now thank you @proven charm
unless you meant something like _playerPos getDir _ndbPos
yeah i want to get a magnetic heading from the station
got it working nice
got a question tho if I wanted to create an UI or an image of this in the cockpit of a plane I jumped inside is there any documentation on how to do this ?
there's example here: https://community.bistudio.com/wiki/ctrlSetAngle (Example 2)
ChatGPT sucks at SQF
Unbelievably bad. It's so bad, if you are new you are actually worse off than with nothing lol.
its funny that can identify chatGPT code bc is too bad lol
I think its funny that if you give chatGPT examples of how SQF works and then ask it to repeat said code given to it, It will fail and break the code
I'm NGL sometimes I kind of don't mind ChatGPT for SQF. It fails to understand basic syntax and will entirely forget semicolons however I feel like for me, it is a good way to find scripting commands I want to use for something. Especially for things like Unit Inventory, where the is just a vast so many and I am not sure which may be the best way of doing things.
use it with caution is all we say 🙂
like any tool, going blindly is a recipe for disaster 😄
"it is a good way to find scripting commands I want to use for something"
Well it will make up script commands that don't exist 😢
@winter rose I 100% agree with you. I liked what you linked too, understanding is important. For the beginners I don't think it's a bad tool but only if used as a tool 🙂
Also @still forum I can definitely tell you've got your experience with using it because definitely feel that haha. Sometimes it prints stuff all-too convenient and you're just like:
if (canFinishMission) then
{
{ endMission } forEach allPlayers;
};
```_huehuehue_
lmao
Anyone know of a way to check if a black screen is being shown?
Ref to this - https://community.bistudio.com/wiki/BIS_fnc_blackOut
Are you the one blacking out their screen?
Cause if so you can just assign a variable to the player stating as such
Yeah, I was looking for something more elegant
There is likely a way by detecting displays but you’d have to find out what the blackout display’s ID is
Like I guess my question is why you want to know
Made a mod that uses blackscreens, and it's diag errors in singleplayer, midly annoying to see at the bottom
C++11 is god like sometimes, i swear, best language ever...
game_value_array<4> line_intersects_args({
game_value_vector3(start_pos_),
game_value_vector3(end_pos_),
*ignore_obj1_,
*ignore_obj2_
})
that allocates all the needed arguments to lineIntersects on the stack automagically.
no heap allocations like normal SQF arguments in SQF itself.
@wind flax it should appear on alldisplays or as a control in display 46
i was trying to make fun of the "new commands" that chatGPT creates, but surprised me with this code ( it almost hit it ) https://chat.openai.com/share/80e9e98e-dd01-4499-9fb4-0ee4138d669c
just a minor problem with array operations lol
IIRC createMarker is a no-op if the marker already exists.
And putting a string into _groupName is not gonna work.
In addition to the obvious vector fails.
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
private _pos = getPosATL _unit;
private _obj = _pos nearObjects["GroundWeaponHolders", 10];
systemChat str _obj;
{
deleteVehicle _x
} forEach _obj
}];
this is as far as i got
On the map you can spawn trees with a script, but they arent listed anywhere in the eden editor. Is there somewhere I can find a list to these classnames? Ive looked at the sub-categories of the arma 3 asset page without any luck.
Its "GroundWeaponHolder"
Singular
o
You can check typos like that using isClass
If you want the death drop ones then it's WeaponHolderSimulated.
alr
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
private _pos = getPosATL _unit;
private _obj = _pos nearObjects["WeaponHolderSimulated", 10];
systemChat str _obj;
{
deleteVehicle _x
} forEach _obj;
}];
now im here and still confused
systemChat doesnt turn up with anythin
im not sure what i am still doing wrong
The classname is still wrong.
I don't know if this works anyway. Trouble is that EntityKilled might fire before the weapon holders are created.
how might i go about delaying it
Probably better to start from EntityCreated.
Check the classname with isKindOf, check the corpse with getCorpse, delete it.
I'm not sure what locality the weapon holders are created with, so the timing might be unpredictable.
alright sooo
i did that and now cant even open the inventory
so i did somethin wrong
i think it actually deleted the primary weapon though
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
_entity isKindOf "WeaponHolderSimulated";
getCorpse _entity;
systemChat str _entity;
deleteVehicle _entity;
}];
this is probably very wrong but im not sure what i did
You are returning the values for whether the created entity is a weaponHolderSimulated, and what corpse it belongs to (if any), but you're not actually checking what those results are. The script continues regardless of whether it's a weaponHolderSimulated or not. So you're just instantly deleting literally every entity that gets created ever.
Not sure if this is the right place:
Can i use a server mod to add actions to players via remote exec?
Yes, you can add a function to the server's CfgFunctions (https://community.bistudio.com/wiki/Arma_3:_Functions_Library) that auto-runs in the post-init phase (or pre-init probably) and remoteExecs stuff to the players.
Try not to remoteExec huge walls of code though, it does have to be sent over the network when people join.
alr im still a bit confused
Expansion: a common structure would be that the CfgFunction function works as a launcher. It would define the code to be remoteExec'd as a non-CfgFunctions function (i.e. my_fnc_stuff = compileFinal { <some code here> };, transmit the function to clients with publicVariable, then remoteExec that function
if (_entity iskindof "weaponholdersimulated") then {do stuff} else { do other stuff };
i added this and it deleted the primary just not the secondary
how would i make it apply to both
pretty sure thats dev only rn
It is
whats a different way i could do it then
idk how im supposed to make it apply to all weapons
hmm. getCorpse doesn't have a link on the secondary?
There is a lot of chat history here, are you trying to get rid of the weaons that are dropped from corpses?
yes
i dont want people to pick up enemy weapons
i have one of those scripts that saves their loadout
thats why
either that or i did something very wrong again
Perhaps you'd better post what you did so we can find out
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
_bool = _entity isKindOf "WeaponHolderSimulated";
getCorpse _entity;
if (_entity iskindof "WeaponHolderSimulated") then {deleteVehicle _entity} else {};
systemChat str _bool;
}];
rn im here
You're doing getCorpse _entity but not doing anything with the result. So what getCorpse does or doesn't detect is actually irrelevant!
This means the script should actually be more aggressive than you expect - it will delete any weaponHolderSimulated, regardless of its origins.
i dont know if thats what i want or not
i dont want anyone to drop their guns on death
This suggests that the secondary weapon might not be stored in a weaponHolderSimulated. It might be (and I haven't confirmed this) that holstered secondaries are placed in a static container along with the other equipment on the body itself.
wait, you mean the handgun, not the secondary?
arent they the same thing?
handgun in secondary spot
Oh right, "secondary" is actually the launcher because Arma
o h
When I say "secondary" I've been talking about the handgun. When John says "secondary" he's been talking about the launcher
how do i just delete all three
Yeah, handgun doesn't get dropped like that. Only primary and launcher.
if there is all three
Launchers will be eaten by the script you have now, since they get dropped in a separate physics holder
probably either removeAllWeapons or clearWeaponCargoGlobal depending on what kind of inventory space a corpse counts as
I think it's removeAllWeapons but I could be wrong.
Or _unit removeWeapon handgunWeapon _unit, but removeAllWeapons should be fine.
so do i just do _unit removeAllWeapons somewhere in there
btw, if you have an if () then {} else {} but there's no code in the else {}, you can remove the else {}
Would it be better to use the killed event handler for that?
already tried entityKilled
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
if (_entity iskindof "WeaponHolderSimulated") then {
removeAllWeapons (getCorpse _entity);
deleteVehicle _entity;
};
}];```
You can use a killed-type EH, but since we have getCorpse and we have to do an entityCreated EH anyway, we might as well do it in the same EH and save creating another one
am i able to have triggers set off user actions like opening a door
the boat passes inside this trigger and the door opens, not just the animation plays
up to this point ive been having it hit the trigger and only play the animation but the mod it comes with has expanded the amount of units able to leave at a time which doesnt work when only the animation plays
How do you prevent the pop up targets from popping back up again?
I vaguely remembered it being something like noPop = false, but doesn't seem to be working when testing
noPop = true
Appreciate it, tried true and false but I was apparently using the wrong target objects
I was manually animating the targets to reset them, but that seems to make them unable to be shot back down again.
_object addAction [
"Reset Targets (100m)", {
params ["_console"];
_targets = nearestObjects [_console, [
"Target_Swivel_01_left_F",
"Target_Swivel_01_right_F",
"Target_Swivel_01_ground_F",
"Land_Target_Swivel_01_F"
], 100];
{_x animate ["Terc", 0];} forEach _targets;
}
];
Also somewhat related, what is the normal standing target that can be shot down? I could only find the "Target Human (Simple)" (TargetBootcampHumanSimple_F) one, but that target did not respond when shot.
I don't want the one that opens a menu when placed because that pops up on its own and (seemingly) doesn't use noPop.
I wrote a biki pge about popup targets a long time ago. It should show up on Google
Found it.
Can I ask a little question about the init for the ai?
I want to setup a trainingcoarse with them. This means i want to be able to shoot the ai without them moving or shooting back. And when they they they respawn at the same place again.
Does somebody know the init code or how to do it?
Without moving or shooting would be disableAI and setting their group behaviour to careless/force hold fire
Hey, I have a group dynamically spawned in once BLUFOR steps into a trigger. And that works fine, but I would like to delete this group again once BLUFOR steps out of the trigger. But that's where I'm struggling. I've been trying a couple of methods but so far no luck.
Code for spawning used in OnActivation:
_grp1 = [getMarkerPos "spawn1", east, ["O_Soldier_SL_F", "O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],0] call BIS_fnc_spawnGroup;
_wpt1 = _grp1 addWaypoint [getMarkerPos "move1",5];
_wpt1 setWaypointType "MOVE";
code for deletion added to onDeactivation
{ deleteVehicle _x }forEach units _grp1;
I've tried some other snippets too but no luck so far. Anyone able to help out with this?
For context: It's supposed to react to heli's staying in 1 position too long on a point and AI wanting tto investigate what this heli is doing... and this would repeat over and over.
the deletion doesn't work because _grp1 is a local variable and therefore doesn't exist in deactivation. if you change it from _grp1 to grp1 in both code pieces then you probably have better luck
If I change that, does that mean the group will have grp1 as it's variable?
yes, grp1 is global variable then
Great! I'll test that you. I'm guessing wpt1 can stay the same and it wouldn't matter
it shouldnt matter
Works! Also funny how 1 character makes a difference :p Thanks for the help!
I'm looking for a way to remove cursor in splendid camera/zeus?
I can't quiet isolate the control for the cursor to hide it, anyone know how to approach this, or better yet a solution...
Mouse cursor? Or the ui grid with the center cursor?
Mouse Cursor, which also happens to be visible when overlay is toggled
for brevity
I'd ask what is your intention first
Is it possible to define an existing group on the map as a variable?
some_group = group some_unit;
thanks!
Does anyone know of a way to get a hidden selections current texture?
Not the one in the config, what it's presently set to?
getObjectTextures?
The documentation says it'll return an array of textures
I need to know what a specific selection on the object is set to
find select and getObjectTextures
Thanks, figured it out
Simply, video recordings without the cursor
I know I could use gcam, but I'd like a solution that doesn't require a mod
When screenshots are taken, using GeForce Experience, cursor Isn't captured
When videos are taken, cursor is captured
there's some sort of integration ofc, figure I'd try and hide it for when I'm recording videos as well
I do believe it is a part of recording software, not game's something
Could be, cursor's still a control, certainly It can be hidden, can it not?
I know you might want to avoid a mod but the quality improvement just with control is probably worth it using GCam but the suggestions above are good alternatives
is the cursor a control? I have some doubts
Steam screenshots also don't capture the cursor, for example. I think it's separate and partly OS-level.
You could try this: https://nvidia.custhelp.com/app/answers/detail/a_id/4592/~/how-to-hide-your-mouse-cursor-in-geforce-experience-share-video-recordings, or try using different capture software that has a native option for cursor on/off
Looks interesting. How do I "learn" c++ for arma? Should I just learn normal c++ ? I only know SQF.
Unfortunately doesn't seem to work, but good lead, I'll take a look for solutions similar to that
I stand corrected, works perfectly fine, just had to reboot twice for some reason
tysm bud
🍻
Second scripting question of the day 😅
I found a tracker script on the web and adjusted it a little bit to only be from the SLs. I’ve had this running a couple days ago but now I cannot terminate it anymore. And I’m quite confused why. Any ideas?
Tracker code:
sqf
tracker = 0 spawn {
while {true} do {
// Check if the player is a squad leader
if (leader group player == player) then {
// Player is a squad leader, play the sound
_pPlayer = getPosASL player;
_pTarget = getPosASL target;
_offset = vectorMagnitude (_pPlayer vectorFromTo _pTarget) / 20;
tracker = playSound3D [
"a3\sounds_f\sfx\Beep_Target.wss",
player,
false,
_pPlayer,
0.5 + _offset,
0.8 + _offset,
0
];
sleep ((sqrt (_pPlayer vectorDistance _pTarget) / 5 - _offset) max 0.05);
} else {
// Player is not a squad leader, do nothing
sleep 1;
};
};
};
Code on radio alpha trigger:
sqf
terminate tracker;
Ideally I’d only want the code to be local to anyone who has a mine detector.. but I couldn’t figure that one out
Forgot to mention this is on an MP setting. Dedicated server
If you start more than one, terminate will only terminate the most recently started one
maybe youre starting it multiple times
tracker gets set to the return value of playSound3D in the middle. This seems very wrong.
Also that's a really bad name for a global variable. Be a bit more specific when naming globals.
like myTracker
Should the playSound3D be ideally starting at the top of the script?
It's not about the position of the playSound3D, it's about the fact that it overwrites the tracker variable, which was previously storing the script handle for the spawn scope, with the sound ID it returns
I believe the sound you're using is only a single beep, and you don't try to stopSound it anyway, so there's no reason to store the return from playSound3D at all
I'm getting into arrays for the first time, and I don't really understand how they work. I'm trying to hide and unhide multiple markers, but I don't know how the syntax works
_natoinvasionmarkers = ["natoinvasion1","natoinvasion2","natoinvasion3", "natoinvasion4", "natoinvasion5"];
_natoinvasionmarkers setMarkerAlpha 0;
Your array is correct, but your application of the command is wrong. setMarkerAlpha only accepts a single marker as an input (on the wiki, note that its marker input data type is listed as String, not Array).
You need another command, forEach, to iterate over each element in the array.
Would this work?
(forEach _natoinvasionmarkers) setMarkerAlpha 0;
https://community.bistudio.com/wiki/forEach
{
_x setMarkerAlpha 0;
} forEach _natoInvasionMarkers```
{ code } forEach listOfStuff
what is _x?
_x is a magic variable available within a forEach's code. It represents the current element the forEach is iterating on.
alright thanks so much
I suggest making sure you don't learn C first. That's a bad way to learn it because it forces you to grasp huge complications to understand what is actually fairly basic concepts. Plus it forces you to unlearn stuff later. Unfortunately most c++ courses to this day seem to start there.
All of the information they provided you is on the wiki you were reading
The examples on forEach were confusing me on the wiki, and I didn't understand the explanations for _x on the wiki, so I was hoping for more clarification. Still doesn't make sense to me, but I don't want to take anymore of their time up
hey guys
So basically intercept is only for professionals...
hi
do you know a way where I can make some vehicles whitelist for some people, like infantry soldiers can't use drones, artillery etc?
like a whitelisting vehicles for spectific player
help.... works in single player but not dedicated server.... ```this addAction
[
"EDIT TEAM MEMBER 1 LOADOUT",
{ params ["_target", "_caller", "_actionId", "_arguments"]; ["Open",[true,player,A1]] call BIS_fnc_arsenal;
},
nil,
1.5,
true,
true,
"",
"true",
3.5,
false,
"",
""
];```
like you want them to be removed from the vehicle when they attempt to get in? then you use a "GetIn" event handler with a filter. Do you have an array made up of your white list for specific vehicle classes yet?
i dont thinki got arraay madde up
it's for military simulator server.
do you want them filtered by player name or uid? or by the slot they choose in the lobby?
hypoxic is there any chance i talk to you later in dm about that, sorry for distrubing though
just kind of busy with some
yup, whenever
All I'm saying is you need to find a book or course that does not try to toss you off the best they can like a rodeo.
I gave the first edition of ISBN 978-0-321-99278-9 (stroustrup) my stamp of approval. It's made for learning C++ as a first (programming) language, and it keeps the complications for later, but it is quite comprehensive.
Just scanned the table of contents, and it's encouraging (in terms of not starting with C) that pointers aren't mentioned until page 588.
That book will also teach you a style of programming that will prevent several classes of bugs.
How do i get the content of a backpack inside a container ?
It is written with the assumption of a higher education setting, meant to be done over a semester, and being able to "ask for help from instructors or friends" if you get stuck.
Oh ! Thank you very much 🙂
Is it possible to animate a weapon, a uniform, or a helmet ?
Via script? No
Hmm ok
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
hey im having a promblem with the enableAI "Move"
if (alive Sp3) then { CPT disableAI "MOVE"; } else { CPT enableAI "MOVE"; };
i dont know bu its first time i have a problem where my ai dosent move he just stand still and no mather what i do he wont go to the nexst check point
Hmm I wonder what did the newest 1 minute Arma 3 update do because my arma 3 server stopped working...
is the AI the CPT? disableAI "MOVE" makes them not moveable
Hm helloh I need help again, trying to create a diary entry with an image in it, however the image just shows up completely white
player createDiaryRecord [
"Diary",
["Objective", "
This is what the crate looks like: <img image='crate.jpg' width='400' height='250' />"],
taskNull,
"",
false
];
it might be a snow crate
it isnt 😄
use paa
correct path to the file?
should be yeah, the image is directly in the mission file
tried it with an images folder first but simplified it to debug
So, why is this not working?
if ([player, "tools"] call BIS_fnc_hasItem) then {hint "Yes"} else {hint "No"};
It returns no in both cases. the tools are a named toolkit (item_ToolKit). Oh, and no it doesn't work with the classname either. What am I doing wrong?
Ackording to biki it should return true if the player has the tolls, but it doesn't.
*tools
where is this code run?
for testing purposes I have it in a radio trigger onAct
I'm just trying to figure out how to check inventory
it might be case-sensitive, try Item_ToolKit
I did... No cigar
The [player, "tools"] call BIS_fnc_hasItem should eval true as far as I understand it, but apparently it isn't satisfying the if condition
oo... I see..... I'll try that
and don't make me start Arma 3 again for assistance è.é 😄
classname is "ToolKit"
item_toolkit might be the placeable toolkit, aka a "weapon holder"
you got Arma'd 😄
doh... Kepps forgettin the convoluted ways of arma
So how do I do the same check with a magazine? The usb disk registers as a magazine in the the inventory. (item_FlashDisk)
BIS_fnc_hasItem works for any kind of inventory item, as far as I know
item_FlashDisk is likely to once again be the ground holder object, though. I'm pretty sure the inventory item itself is FlashDisk, but you can check by placing the holder object, rightclick > find in config viewer, expanding the class on the left, and opening its TransportItems or TransportMagazines subclass
Inventory items can only be referred to by their classname, they can't be given unique variable names. This is because they aren't unique objects. The game doesn't know which ToolKit you have, it just knows you have a ToolKit.
(Magazines actually are unique in some ways and have unique IDs, but there aren't any commands to work with those so...)
You were correct sir. Thanks.
Sorry guys I was working on something (Kinda New To Modding) and I dont kn0w how to get ride of these lines in the mission? they apear out of no wear and not sure how to get rid of them (The Red Line) (It starts to point out what the units are doing in the Scenario
any help would be most appreciated
then it looks like this
If you're running the A3 Diagnostics exe (you would have to deliberately choose to do this, so you'd know) then try "All" diag_enable false in the debug console.
If you're not, then it's a mod, god help ye
https://steamcommunity.com/sharedfiles/filedetails/?id=2333728432 how to remove this annoying lines and text ? ːretro_questionMarkː
this guy had the same problem
no mods that would do this
like 5 mods
Please try it without mods. I think you will be surprised.
but I need them for this senario
it said you required them
have you not scene these lines before?
I just bought the game
it looks like some editing tool being pressed
but im not in editor
It does look like that, but there isn't any tool that does that in the base game outside of the Diagnostics exe (which I am trusting you're not using). So it's very likely that a mod is doing it.
The purpose of launching without mods is to quickly verify that for sure. You don't have to load this specific scenario; you can just open the Editor, place a few AI and a playable unit, and try it. That will immediately show whether the overlays are still present.
Thankyou.. would ace do this?
not by default. lets see the modlist
It's pretty plausible that ACE has a tool like this in it, though it wouldn't be turned on by default for obvious reasons. I don't know for sure though.
I see, also I got the DLCs are you suppose to activate them together (I have all of them)
Standard DLCs (Apex, Marksmen...) are always installed and active. You can uninstall them through Steam, but shouldn't. Creator DLCs (Global Mobilisation, Western Sahara...) work like mods. Servers may or may not allow them, and compatibility between them isn't guaranteed. Some of them work together very well, some of them probably shouldn't be put together (mostly SOG + anything else).
Not really a scripting question though, try #arma3_questions if you have more general issues
do the helis have points for rappel ropes or should I just figure them my self?
does Arma3 support any way for you to cycle the command bar instead of simply selecting F1 to F12 keys?
heh, digging that one up again lol
also is there any way (much like get in nearest) to use an "assign nearest" type of command?
such as, alpha1 assign nearest vehicle. alpha can then enter the vehicle closest
thats crewed obviously,like a transport heli
he's using an old version of my mission which is slightly modified and claiming he made it himself.
big oof
On the arma 3 wiki it says enableAI “MOVE” is a command to make Ai walk to nexst watpoint if its nit walking becouse of the diableAI . I just need my Ai to walk when my enemy Ai is death an only walk when is death. So i ide the if and else command: that again is an arma command and the alive is of the enemy is alive. I did something like this but like when i killed a specefic Ai then my frindly Ai would kill another Ai for a theam sniper mission and i used the same tactic with if alive or Else and it worked. But if the diableAI move and the enable witch one Can i use then. Becouse when i just use it like disableai” move” and then sleep 5; and then enableAI”move” then it works, why? I used what it Said in the arma 3 code wiki?
The CPT is the name of the specefic AI
hello,
wanna know if there is a script i can use and how to use it that enables these same multiplayer settings but in SP when playing with AI
basically if AI in my group gets hit they get incapacitated so that medic has time to get to them, ty
the Revive system does not work for AIs.
just one question: what does https://community.bistudio.com/wiki/setMissionOptions mean “Sets various mission options”? does this mean we can also force video options like resolution, gamma, brightness etc. ?
Hello fellas,
Does anyone knows if Animate happens to be JIP compatible?
Im doing some animations for door oppening purposes in one of my missions but it doesnt always does it for every player, as it seems to affect only JIPs.
This is problematic since im also locking said doors (which do lock for all properly).
This is done during mission start in initServer
can I somehow access the 'DESCRIPTION' field of an object placed in the editor via SQF?
No, at the moment (on dev branch) it only does the specific options described on that page. It's unlikely that command will be expanded to include video options, because those aren't the kind of options it's meant for.
Wouldn't there be a script to bypass that?
There are internal parts of the revive system that simply do not work even if you force it to run on an AI (notice how it stops working on player units when the player leaves, for example)
You could use a handleDamage event handler to make your own revive system for AI, but it will be complicated
https://community.bistudio.com/wiki/roleDescription @round scroll
thanks, will try that!
Hello, I been bashing my head in with this issue for a bit now
I have the code
informant switchMove "Acts_ExecutionVictim_Loop";
which should realistically put the civilian with the variable name "informant" in the animation
I even tried
this switchMove "Acts_ExecutionVictim_Loop";
Am i doing something wrong?
It does not work in very first frame of the game. Use spawn to wrap it up
sorry, where would put that?
informant spawn {_this siwtchMove "Acts_ExecutionVictim_Loop"};``` and it makes the code executed a very bit later
oh, i was putting this in the civilian's init area, would i be putting your code in a trigger then?
oh thanks this worked
Is there any trick to make a properly walkable ship ?
Use psychos wounding
A3 Wounding System_________________________________________________by Psychobastard Hello, this wounding system based on the AIS Wounding Module from BonInf*`s Arma 2 version. Again this one based on the vanilla wounding module from BIS. (but it wasnt MP compatible) Well, essentially not a comple...
Its the best revive for player and AI script imo. good customisability and lightweight. can be configured for side, playable,all etc etc
AI can also heal AI without oyur input(but if in your group u must as leader order them to heal man)
randomPoint= selectRandom ["AO", "AO"];
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "CYCLE"; randomPoint= selectRandom ["AO", "AO"]; ;
can someone help with the above
everything is fine however im trying make the first waypoint the current waypoint,thus attempting to delete all pre assigned waypoints
i tried using "setcurrentwaypoint"
i tried using deletewaypoint
private _group = group _unit;
for "_i" from 0 to (count waypoints _group - 1) do
{
deleteWaypoint [_group, 0];
};;
where i changed _group name to Alpha1
Well, save the first waypoint to a unique variable instead of overwriting it every time you add a new one, then setCurrentWaypoint should work fine
private _randomPoint = selectRandom ["AO", "AO"];
myGetOutWaypoint = Alpha1 addWaypoint [getmarkerpos _randomPoint, 1000];
myGetOutWaypoint setwaypointtype "GETOUT";
myGetOutWaypoint setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
for "_i" from 1 to 5 do {
private _wp = Alpha1 addWaypoint [getmarkerpos _randomPoint, 1000];
_wp setwaypointtype "SAD";
};
private _wp = Alpha1 addWaypoint [getmarkerpos _randomPoint, 1000];
_wp setwaypointtype "CYCLE";
// ...
Alpha1 setCurrentWaypoint myGetOutWaypoint;```
I just wanted to ask, is there a way to add NVG capability onto a helmet?
ie) have a certain helmet to have NVG ability, even though you may not have an NVG
Via script? No, via config, yes. Special Purpose Helmet from Apex does it
thank you, im trying to understand it. Isnt however there a simpler way to simply use a "remove all waypoints" type of command that can be the run as i call my syntax?
_wp Alpha1 cancel all waypoints for example
iv tried the three examples on this page already
it isnt working
Then you're doing something wrong
We have no chance to understand you by just told it isn't working
im trying to explain, so you see my syntax originally above? so i took all the example sfrom the page you linked
and i attempted to incorporate them at the beginning of the syntax
applying Alpha1 name where needed
And... where is your attempt code? Any errors?
yet when i call the syntax,it just keeps adding 7 new waypoints instead of deleting are giving 7 new ones
no code error
let me show examples..one moment
randomPoint= selectRandom ["AO", "AO"];
deleteWaypoint [_Alpha1, 2];
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "CYCLE"; randomPoint= selectRandom ["AO", "AO"]; ;
randomPoint= selectRandom ["AO", "AO"];
private _group = group _Alpha1;
for "_i" from (count waypoints _Alpha - 1) to 0 step -1 do
{
deleteWaypoint [_Alpha1, _i];
};
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "CYCLE"; randomPoint= selectRandom ["AO", "AO"]; ;
randomPoint= selectRandom ["AO", "AO"];
private _Alpha1 = group _Alpha1;
for "_i" from 0 to (count waypoints _Alpha1 - 1) do
{
deleteWaypoint [_Alpha1, 0];
};
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "CYCLE"; randomPoint= selectRandom ["AO", "AO"];
;
Above are the three examples i incoprorated from the wiki to no avail
_Alpha1 vs Alpha1?
iv also tried to modify them to the end of my original syntax rather than the start
i corrected the Alpha in editor, iv tried both _ and without
your saying these should work?
I'm just trying to hunt what exactly you want and error there
to give further full context, the syntax is run from radio trigger. it generates the 7 waypoints. im trying to hit trigger again,have it cancel original 7 and generate 7 new wp's
make sense?
And codes like this, is this the full code within a trigger?
rather than add to 14 21 28 etc
14 21 28??
yes
is any syntax i have written correct?
on act of radio trigger
No error means the syntax is correct
yes so im not sure why my first waypoints arent deleting
randomPoint= selectRandom ["AO", "AO"];
private _Alpha1 = group player;
{deleteWaypoint _x} forEachReversed waypoints _Alpha1;
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
_Alpha1 setBehaviour "Aware";
for "_i" from 0 to 6 do {
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
};
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "CYCLE";```Worked perfectly fine for me
This makes WPs for player group
yeah confirmed working on my play
hmmmm why not the AI group
How do you confirm it doesn't remove WPs
High command / zues show current waypoints
i changed "player" with _Alpha1 and get an error
"Alpha1" no error but not working
variable name of unit not group i guess
yes it works IF i name Alpha1 group leader
and change "group player" for "group tom"
but i need it running off the group name as leader may die
zues enhanced/zues. high command shows on 2D map all active waypoints. can see realitime
tom , is the name of Alpha1's leader
following so far?
and then it works ok
but as said,i need to run it off group variable and not individual
"group this" work here?
as Alpha1 is the reference?
randomPoint= selectRandom ["AO", "AO"];
private _Alpha1 = group Alpha1;
{deleteWaypoint _x} forEachReversed waypoints _Alpha1;
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
_Alpha1 setBehaviour "Aware";
for "_i" from 0 to 6 do {
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
};
_wp = _Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "CYCLE";;
type group expected object
is there a way to make it recognise the group?
Alpha1 there already is a group
Again, Alpha1 is already a group. There is no way to convert group into group
group Alpha1 == trying to convert a group into a group which is invalid
i understand,im trying to suggest a way for it to detect the current alive leader
tom dies, harry takes over for example
Why?
because leader tom may be killed,if he is,wouldnt this syntax fail to run?
wont fnd his name so group doesnt get new waypoints
No. If a group leader has been updated, the group remains the same
ohhhhh?
let me see..
no i tested
if tom dies, and syntax called again, no new waypoints are given
I GOT IT
randomPoint= selectRandom ["AO", "AO"];
{ deleteWaypoint _x } forEachReversed waypoints Alpha1;
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "SAD";
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint, 1000];
_wp setwaypointtype "CYCLE"; ;
forEachReversed
all that was needed
Yeah i found in the past this has been tricky,im some instances it keeps the group and in others it wont. Regardless thank alot,you helped me solve it
so now the result with syntax above= when called Alpha1 will have 7 waypoints randomly generated in a zone,ending with a cycle,then if called again,all aypoints are removed and fresh ones given. Sweet
Another observation and sth i wasnt expecting is that the AI,even currently on a waypoint to say grid 0,0,0 ,after having new wp's given,essentially stop,and disregard the 0,0,0 waypoint. An old arma3 issue with "cancel" waypoints noT actually cancelling the previous until destination was reached.
@tough abyss Intercept is probably more for people that are good at programming. Programming isn't some kind of magic, being a good programmer is about as hard as becoming a good musician.
You can get a taste for it by playing the recorder in kindergarden (=mixing other peoples code snippets into mission scripts) and a lot of it is just down to plain old spending time playing (programming) but at the end of the day you'll need some kind of education to really go above and beyond. Think learning to read sheet music, learning basic music theory, learning specialist techniques for your instrument, studying other artists and composers to get a feeling for what's possible, learning other instruments to broaden your horizon, etc. In programming this means stuff like understanding C-like language syntax, learning about basic datastructures and algorithms, learning the ins-and-outs of a language, studying programing concepts and paradigms, learning different langauges (not just C/C++/Java/C# but truly different stuff like ML/Haskell/etc), etc.
To get to that level, both in music as well as programming, you don't need to be a professional, but most people at that level will be professionals (which makes sense when you think about it).
The easiest way to achieve these high levels is to go and get a formal education in music/computer science from a university, however many great musicians and programmers have taken different paths, teaching themselves through books/videos/etc. However even those people will usually hit a point where they'll want to attend courses, seminars, classes or find a mentor/tutor in order to develop their skills to that level of real mastery.
sorry don't understand whats the issue here. I tried disableAI/enableAI "MOVE"; and it worked fine
is it possible to set a injured face without applying damage to the player?
Thnx I'll check it out
okay just figured out
player setHitPointDamage ["hithead", 0.5]; //injured head, player overall damage is 0
player setHitPointDamage ["hithead", 1]; // player overall damage is 1, dead
hmm, the roleDescription seems to work for players, but not for arbitrary objects, like empty helopads ...
so afik there is no event handler to detect when a player a player changes zoom level correct? is there any good way to detect that a player has changed zoom? (not change optics mode with crtl+right click)
So... holding right click or numpad + and -?
https://community.bistudio.com/wiki/getObjectFOV
If this doesn't work... I don't know, maybe check for the key input?
POLPOX, I was going to ask you one more question eralier regarding the example i showed,i think this is an easier answer but i get errors if i try any syntax variation
_wp = Alpha1 addWaypoint [getmarkerpos randomPoint,1000];
_wp setwaypointtype "GETOUT"; ;
the 1000
How can i go about removing an actual distance from the centre point,and instead,just selcting any random pos in the marker area?
You can use a UserActionEventHandler (well, several of them) to detect when the player uses any of the zoom actions https://community.bistudio.com/wiki/inputAction/actions
yeah good example of this is an aimed down sight EH making an AI play surrender anim. pretty cool
There is a syntax for createVehicle that has an "init" parameter, but it doesn't really work the same way as an Editor init field.
Object inits are something that's only needed for Editor-placed objects (and even then not really needed, just convenient). If you're spawning a vehicle by script, you're already in a position to just.....do stuff to the vehicle. You have a reference to the vehicle.
private _vehicle = createVehicle ["someClass",[0,0,0]];
_vehicle allowDamage false;
_vehicle addItemCargoGlobal ["FirstAidKit",4];
// etc```
anyone know?
I want the new vehicle to become the arsenal, with ["AmmoboxInit", [this, true]] spawn BIS_fnc_arsenal; How wold I do that if I can't get to the vehicle init?
Part 1:
Anything can be delayed by lag if it's sent over the network.
Anything running in Scheduled can be delayed if the Scheduler is overloaded.
Anything running in Unscheduled can't be delayed as such, but poor performance can make the entire frame happen slower.
Part 2:
I'm pretty sure grasscutters are not scripted, they're enginestuff. Most static objects have a grasscutting effect to stop grass growing through them; grasscutters just use that but have no visible model.
thx for the insight, basically my problem is how long time to give to grass cutter before it has done its job, I got JIP covered but I dont want the leave the cutters on map after they are done
Nothing in this requires a vehicle init. The function follows this syntax:
["mode", [_objectReference, bool]] spawn BIS_fnc_arsenal;```
When you use `this`, you're just using the object reference variable that's provided by the init field. If you have an object reference available by other means - for example, because you just did `createVehicle` and saved the object reference it returns - then you can use that instead.
I would not be certain that the grasscutting effect of an object persists after the object is deleted.
they do
private _vehicle = createVehicle [ ... ];
["AmmoboxInit", [_vehicle, true]] spawn BIS_fnc_arsenal;```
Hey guys. Does anyone know of a way to play a reload animation? I'm trying to support 2 different reload animations, from what I've read, you can play the animation, but if it's not the main reload action, the mag proxy won't work
Hello, I have a simple cold weather script that ticks while the player is not near a heat source. I would like to add a frosty overlay over the screen as the player gets progressively colder.
However, because these overlays fade in slowly, the effect repeats each time the condition is met. How can I make it so that the overlay is activated for each cold level only once, once the condition is met?
Script Pastebin because I can't seem to paste it here: https://pastebin.com/fK3PuUpa
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.
The concept:
I'd say set a variable when an overlay state begins/ends, and also check that variable when the condition is met and don't reapply the effect if the variable is already true
example:
if (missionNamespace getVariable ["vuo_frosteffect_state1",false]) then {continue};
missionNamespace setVariable ["vuo_frosteffect_state1",true];
// apply effect```
Thanks, will try that.
Given how abstract Intercept is, you don't need to be a master programmer to use it
The API is pretty simple, even more intuitive than SQF is really
f.e. object setHit [part, damage] turns into set_hit(obj_, part_, dammage_);
I dont know either when i put my ai in the scrip he just dosent move at all, could i be becouse of some of the denne or buildings? Or is it the if or else command?
You should be using PATH. Disabling move makes it so they can't even turn.
He has WP?
But beginner programmers could certainly struggle
_this addAction ["Action Title Here",{
params ["_target", "_caller", "_actionId", "_arguments"];
_actionId1 = _target addAction ["Action 1",
{
{_target removeAction _x} forEach _actionId1234;
}
,[_actionId1234],1.9,false,true,"h","_target getCargoIndex _this == 3"];
_actionId2 = _target addAction ["Action 2",{},[_actionId1234],1.8,false,true,"q","_target getCargoIndex _this == 3"];
_actionId3 = _target addAction ["Action 3",{},[_actionId1234],1.7,false,true,"w","_target getCargoIndex _this == 3"];
_actionId4 = _target addAction ["Action 4",{},[_actionId1234],1.6,false,true,"s","_target getCargoIndex _this == 3"];
_actionId1234 = [_actionId1, _actionId2, _actionId3, _actionId4];
},[],1.5,false,true,"","_target getCargoIndex _this == 3"];
I've been struggling with this code all day, I'm trying to make a sort of interation menu, where when you use one action, it creates some new actions and deletes the old selection.
Issue is that the ID for the next action is created after the arguments for the second action are passed
so I have no idea how to make one action remove the other actions that were already there...
Updated to Version 2. Thought i would share an addAction menu system i wrote. Your free to do with it what ever you desire, of course a little mention is always welcome. 😄 The actionMenu system provides a usable multi depth menu in the form of addActions. It has a simple structure of addAction pa...
Maybe you can use that
So, how does logNetwork work? I've wrote a code like this while I'm in a server I run:sqf 0 spawn { _handle = logNetwork ["myLog.txt", [""]]; systemChat str _handle; sleep 3; logNetworkTerminate _handle; };And no worky, it says _handle is a nil
On what branch of the game did you try this. Myb that command is aviable only on diagnostic branch.
Diag branch doesn't support MP, so there is no chance to have it
I'm in Stable right now
Did you try to run it in Unsceduled enviormente ?
And on what server did you run this command hosted or dedicated ?
Then it has to be broken command.
Thing is I have never tried this command very recently, even after 2.16
Try
logNetwork "test.txt";
No, it is a invalid syntax
in the utils it says its like that if you run utils 5
supportInfo "u:logNetwork*"```
> `["u:lognetwork ARRAY"]`
But I imagine the struggling would be mainly due c++, not intercept
Lost the keys?
I've not heard of it being broken, but who knows
Hi all, I'm currently running into a shared resource problem with race conditions. I have an array that is modified by multiple objects, but it's critical that only one object can modify it at once. Does SQF have any sort of mutex or semaphore that can be used to create critical sections of code? Are there other ways of handling this problem?
One thing I would say is: firstly make sure your concept is correct. Having multiple instances of SQF (Scheduled environment, to be exact) that controls one object, is it actually necessary to do?
What kind of control/set commands you need to use in your situation?
The different "tasks" check over the shared resource (an array of true/false bools). If an element is false, the task that is accessing it performs a routine and sets the element true. The actual commands that need to be used on the array are: "select" and "set" to read from and write to the array
The shared resource problem being:
- Task 1 accesses array and reads element "A", which is false
- Task 1 begins a subroutine
- Task 2 accesses array and reads element "A", which is (still) false
- Task 2 begins a subroutine
- Now there are two separate tasks performing two subroutines that end up conflicting with each other
- Task 1 finishes and sets element "A" to true
- Task 2 does the same
Note that even setting the element to true right after reading it still leaves a period of time another task can access it in it's false state
are there any commands for checking if an array is a subset of another array?
how can i add an action to a player thats attached?
my actions aren't showing until i detach myself
@meager granite #arma3_scripting message
Currently working on doing this with server profilenamespace. When you go to sync data to the server, do you update the server after every local event change to the data? Or do you update at regular intervals.
Depending on update type, triggered by client
if client says update is important (money spent, etc.), instant update
Otherwise there are some thresholds
up to you to decide
this is just my first draft so far: https://pastebin.com/s1TSRAEd
I don't think the hash is going to be big enough to worry about it being sent over network too much as I'm just pulling the player data from the main hash. So I could probably do it on every unlock/kill/death/capture change. Until I figure out what else I want tracked.
_playerData get _playerUID will be nil if there is no data for uid
but otherwise you get the idea, its all really simple
Guys does this syntax look correct to run to all blu units?
{
if (side _x isEqualTo WEST) then
{
_enableAttack false;
};
} forEach allUnits;
or am i missing a curly bracket after "false"?
trying to run this from a radio trigger also so wanted to ask if it should be in any way written differently
{
if (side _x isEqualTo west) then {
_x enableAttack false;
};
} forEach allGroups;
if using allUnits then use side group _x isEqualTo west, but since enableAttack can take a group, its better to use that as there are less iterations.
yes i see what you mean. nice one thank you
also, if the group isn't local, enableAttack requires a local argument, therefore, say its being called from a non local source, you would use
[_x, false] remoteExec ["enableAttack", _x];
then you are fine. only matters in MP
OK if i wanted to again,reenable atack to true, can i run that on the same repeatable trigger through on deactivation by chance?
just a thought. i never tried any thing with on deact before
you can, just make sure your conditions allow for that
so CON: This / radio india . and the same syntax used except replace false with true,and enter it into the deactivation box?
radio is repeatable
the condition at some point has to return false for it to be deactivated
Is it possible to get the game volume for comunications ?
how do i do that? i could easily make a 2nd trigger with true , but id like to learn
how would i make the condition return false?
i'm not exactly sure if using the radio part of it allows it to return false. I don't use triggers at all so I don't play with them enough. try running with what you have so far and see if it deactivates
there is a command out there that lets you grab the client's volume settings, but you can't force a setting on them. outside of that, you have your typical musicVolume | fadeMusic soundVolume | fadeVolume etc
Il try thanks.
just put in some logging to see when things turn true/false
could it be a bug that when you want to see head camera of other player you can only see from the camera that player is using atm? like: _camMan switchCamera "INTERNAL"; may show third person camera if player is using that. or is it intended behaviour?
Yes he has waypoints
dont know then
is there a way to have (add)actions work for units inside a vehicle?
or you have to either add the action to the vehicle (or the player when he is inside the same vehicle too)
If you can see out of the vehicle then they just work by default.
Hence in Antistasi you can capture flags while sitting in a car, because we forgot to block it.
i think you just need long distance for the addaction
Long enough, yes.
From the description of the scheduler, I don't think there's any 100% method. Even something like waitUntil {isNil "myLockoutVar"}; myLockoutVar = true; might be interrupted between commands if there were already nearly 3ms of scripts in the frame.
You can use isNil { // check and lock } if aborting instead of waiting is acceptable.
It is also possible that the myLoadoutVar method does work because you get at least one statement after the waitUntil returns. Difficult to test.
Also adding a sleep before the waitUntil may have different behaviour.
hm i am trying have revive crew from within the vehicle - for each unconscious crew
atm we have the action to the player, and you revive a random one (if there is more than one) and you cant have the name as part of action
_originalTarget: Object - The original object to which the action is attached, regardless if the object/unit is in a vehicle or not
from https://community.bistudio.com/wiki/addAction
however that seems not to work if you are inside the same vehicle
I believe addAction generally requires line of sight to the object it's added to, so if you can't actually see the unit when it's in the vehicle, you'll definitely need a different solution
Ah, the trouble there is that crew aren't real.
cursorObject on crew wouldn't work, for example.
(on a sidenote the holdAction implement doesnt support above from what i understand as it does: _target = _originalTarget; instead of _target = vehicle _originalTarget;)
do you happen to know if BI supports getting out multiple unconscious from a vehicle? or also just one at a time
(eject any vs eject dude1 and eject dude2)
I'm pretty sure the vanilla unload unconscious action just unloads all of them at once....but I'm not completely sure
Maybe worth adding that here if it'd be useful to you https://feedback.bistudio.com/T179964
anyone knows why my video isn't synced with audio whe i play it with playVideo?
But is my scrip correct thoug How i used the if Else on the enemy Ai Sp3 maby its the problem or should i just try completely use a new Ai?
post your script and people can take a look
hi all. I'm trying to get a list of all objects (units, vehicles, mission objects etc) within a trigger. I can use this to get all vehicles and units, but how do I get all the props I have placed in eden?
allUnits inAreaArray thisTrigger;
vehicles inAreaArray thisTrigger;
I tried using allObjects instead of allUnits but I think it's not working
ok nvm I think this did it. It works, but is it the best way?
allMissionObjects "All" inAreaArray thisTrigger;
Is there a way to read out the params a users used to launch arma?
There is for some like Filepaching example:
https://community.bistudio.com/wiki/isFilePatchingEnabled
But if you want to get somebody launcher parameters your best bet would be to make a file extension.
https://community.bistudio.com/wiki/Extensions
I basically want to force disable -skipIntro but for that I would firstly need to know if it's enabled but I don't think there is even a command to disable this.
I don't think you'd be able to do this. You can't force user settings like the volume sliders either... You just want people to watch a video before going to main menu?
I am guessing its for the main menu mod or something like that. Its possible but with extension and unfortunately not with a command in SQF. Myb you could put a ticket on Feedback Tracker and myb one day you get that feature where you can have access players startup params. But I can see that as a Huge risk. If a mod is changing startup parameters.
Main menu mods are okay and don't require extensions so that's why I'm wondering what they are wanting.
And yes, it would be a HUGE risk forcing startup parameters on clients.
Hey, I seem to struggle with a createUnit - waitUntil line. For some reason the _vehicle is never assigned or for whatever reason the waitUntil-Loop is never finished. Any ideas?
_group = createGroup civilian;
_vehicle = _className createUnit [(getMarkerPos _spawnPoint), _group, /*this is for unit init*/"", 0.5, "PRIVATE"];
waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Can't leave loop
pay special attention to the return value of that syntax of createUnit on the wiki
since you have the group already, you want to use the primary syntax
how do you loop a script indefinitely?
you just do true on your while loop condition. its not suggested you do this unless you have a specific use case.
thanks, will check it out ^^
Trying to increase damage on webknight smasher but it doesn't seem to respond to the setDamage command like everything else does. Would be nice if there was a way to reduce its power a bit.
That's a question for him how you can modify it. Go to his discord and ask.
rgr
for example like this ?
[] spawn {
while {true} do {
< code>
};
};
[] spawn {
while {true} do {
// something
sleep 1;
};
};
[] spawn {
while {sleep 1; true} do {
// something
};
};
@fair drum thank you it worked
Thing is that -skipIntro is not working how it is described in wiki. I want users to force disable if they load it so I can edit main menu to be consistent.
See, if users have this enalbed then they get a initial background image when launching game for the first time, but the second they join a server / load any mission arma breaks and will never return to a static image in the main menu. It will always load a weird map at xyz 000 and display water (that is why you even hear water sound when initial background is displayed, mission is loaded but not shown) so after joining any mission arma loads this as main menu background all the time. And due to the command prohibiting any "real" mission from being loaded you are stuck with a stupid water screen you can't do anything about. Forcing disables -skipIntro would solve that (at least for main menu, not multiplayer background).
I'd like to use a extension but it's pretty hard to code from what I've seen, is there any tutorial or guideline I could cling to to have some guidance there?
Yea here:
https://community.bistudio.com/wiki/Extensions
And this:
https://github.com/overfl0/Pythia
Also this but its a bit older dont know if this still works:
http://killzonekid.com/arma-scripting-tutorials-how-to-make-arma-extension-part-1/
Can someone help me write a script so that the player, as an individual, can listen to the radio conversations of the group called grp1 (ai)?
unless the radio conversations are scripted, it's not possible
if they're scripted (using bikb), you can just join on the same conversation channel
the thing is that as a game I don't belong to any group, and I want to hear AI conversations like I see the enemy, shoot the corner from another group which, for example, has the name group 1 is it possible ?
no
ok, thank you for your answer
Fleeing behviour: https://community.bistudio.com/wiki/fleeing
is it possible to create an exact location for a side to flee to?
How to decrease delay between unit get in vehicle and fire at some target ?
trying these but find out that it won't work without some 0.1-0.2s delays
loadAgent = createAgent ["C_man_1", [0,0,0], [], 0, "NONE"];
loadAgent disableAI "ALL";
loadAgent moveInTurret [_vehicle, [0]];
[
{
vehicle loadAgent fireAtTarget [objNull];
[
{
loadAgent moveOut (vehicle loadAgent);
},
[],
0.1
] call CBA_fnc_waitAndExecute;
},
[],
0.2
] call CBA_fnc_waitAndExecute;
As for condition before fireAtTarget also tried this one but with no success. Unit getting in vehicle but won't fire
loadAgent in _vehicle && {unitReady _vehicle && {loadAgent == assignedGunner _vehicle}}
CBA_fnc_execNextFrame
tried, doesn't help
that's the smallest amount of delay you can possibly get if that is what you are asking
via CBA_fnc_execNextFrame ?
i am actually asking about smallest amount of delay and also working solution. You are right about CBA_fnc_execNextFrame but unit won't fire with it for some reason
oh I see what you are asking. try a different fire command instead, there are multiple, and even bis_fnc_fire as well.
no success. Tried
BIS_fnc_fire
fireAtTarget
forceWeaponFire
was there a class name change to "hide" in game(referncing misc objects)
for example: map objects:
// hide (delete) terrain objects for better map performance
// percentages for deletion
_rock_perc = 50;
_tree_perc = 25;
_bush_perc = 25;
_fence_perc = 5;
_wall_perc = 5;
_hide_perc = 25;
_rock_fac = round (100 / _rock_perc);
_tree_fac = round (100 / _tree_perc);
_bush_fac = round (100 / _bush_perc);
_fence_fac = round (100 / _fence_perc);
_wall_fac = round (100 / _wall_perc);
_hide_fac = round (100 / _hide_perc);
// get all specific terrain objects
// 3,513
_rocks = nearestTerrainObjects [[worldSize/2, worldSize/2], ["ROCK"], (worldSize * 1.41) , true, true];
// 101,960
_trees = nearestTerrainObjects [[worldSize/2, worldSize/2], ["TREE"], (worldSize * 1.41) , true, true];
// 288,461
_bushes = nearestTerrainObjects [[worldSize/2, worldSize/2], ["BUSH"], (worldSize * 1.41) , true, true];
// 11,189
_fences = nearestTerrainObjects [[worldSize/2, worldSize/2], ["FENCE"], (worldSize * 1.41) , true, true];
// 14,190
_walls = nearestTerrainObjects [[worldSize/2, worldSize/2], ["WALL"], (worldSize * 1.41) , true, true];
// 192,325
_hides = nearestTerrainObjects [[worldSize/2, worldSize/2], ["HIDE"], (worldSize * 1.41) , true, true];
//delete given percentage of terrain objects (not randomly cause it will be done on each machine locally and should be the same)
{
if((_forEachIndex + 1) % _rock_fac isEqualTo 0) then {_x hideObject true;};
} forEach _rocks;
{
if((_forEachIndex + 1) % _tree_fac isEqualTo 0) then {_x hideObject true;};
} forEach _trees;
{
if((_forEachIndex + 1) % _bush_fac isEqualTo 0) then {_x hideObject true;};
} forEach _bushes;
{
if((_forEachIndex + 1) % _fence_fac isEqualTo 0) then {_x hideObject true;};
} forEach _fences;
{
if((_forEachIndex + 1) % _wall_fac isEqualTo 0) then {_x hideObject true;};
} forEach _walls;
{
if((_forEachIndex + 1) % _hide_fac isEqualTo 0) then {_x hideObject true;};
} forEach _hides;
refers to piles of logs,power lines etc etc
Any way to delay a cruise missile's sensor activation so it goes up higher before starting its turn?
i am really new to all of this. how did you do this? I've been looking for days for somthing just like this
Is there a command to get the attachments of a weapon in the backpack of the player ?
works for vehicles, not for units
I didn't say use it on the unit. use it on the backpack
Like: sqf weaponsItemsCargo backpackContainer player
I wish there is a comprehensive getter/setter of inventory anyways, like set/getUnitLoadout
There is with cba but i get ya.
i'm making a new inventory system so we can store variable to inventory items an indeed, inventory functions needs some improvements
I see, thank you
Current way can lose attachments very easily yeah. Especially vehicle inventory
Hello! Happy easter!
I had a stupid Idea. And decided to make an addAction script for on up coming OP for my unit. One player (the interpeter) can interact with civilians to question them. Problem is im runing into a lot of problems.
First the game responds on loading that the script has an invalid number in expression. I have no Idea what its talking about.
Second the "Greet" add action should create the following add actions. and remove the greet add action, so the player dosent spawn an infinite amount of add actions.
Third there are no called responses, eaven though there are array's created to call them in.
I know this is a lot of problems. But im just learning arma 3 scripting. Any help is appriciated.
- In which line?
- Yeah this is not great anyways
- Well most likely because your code is actually running nothing
Give me a few to point up your things
_RES1is only defined in the script.RES1is not equal to_RES1- global variable vs local variable.call some_fnc_functionusage there in_RES1and so fourth, is actually executed at these lines which means nothing is going to happen or something you don't intend will happenexecVMrequires a script file to run, whilegreetthere is just a Number (which is returned byaddAction)
Hi, can the forceWalk be executed locally or does it have to be executed on a server?
https://community.bistudio.com/wiki/forceWalk
I am looking for either a pre existing way to generate basic profiling information for existing mods/scripts that I don't control, ie I want diag_time on a per frame basis. Any ideas?
I used CBA extended displayLoad eventhandler to add custom stuff.
.... run diag_time from an onEachFrame EH?
That will give me an idea of frame time, but I guess what I am more looking for is "script abc.sqf took 4ms in this frame" sort of answers. As it stands I know ace is bleeding 4+ms a frame but its a big mod with a lot of places to look. So I am either missing how to use onEachFrame for that purpose or I have not explained well what I am trying to do.
diag_captureFrame for example shows the engine time, the mod total is somewhere in there (still haven't really worked out where!). Gives me the sort of output I would like to have about the script time.
So for example http://imgur.com/47NeVW6 shows the output of diag_captureFrame, it shows the breakdown of time for a frame so you can say confidently 30% of the time is spent simulating and 40% rendering. I kind of want a way to do the same but for mods. Make more sense?
I don't currently know of anything that does it and the only idea I have about how to is to use diag_tickTime and then write a parser to go through all the files in all the mods and generate wrapping statements so I capture the times of everything and then have the community run the debug versions of the mods that output logging information on the times for a frame. Its a lot of work to do that, parsing the script files to inject is non trivial!
Is there a list of waypoint statements? i cant find any on biki
wondering if theres a wp statement to turn engine off. anyone know?
got an attack helo on some simple move wp's with a cycle at end,they repeat 20 mins later. i was trying to get them out of vehicle at last wp,no problem but they then ignore the first wp which was GET IN NEAREST. Really confused me,so im settling for the last wp to be TR unload, but i want at least engine off
Isnt BIRD action ["ENGINEOFF"] supposed to disable engine?
i meant type of statements
@bleak mural
This has your vanilla waypoint types
For engine off stuff, just throw that into the waypoint completed statement.
thanks man,still its not what i meant. dont waypoints have special statements _wp setwaypointstatement engine off
for example above. things to modify the wp besides speed ,behaviour etc
here , im not using editor wp's:
randomPoint= selectRandom ["AO", "AO"];
{ deleteWaypoint _x } forEachReversed waypoints Ugly1;
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "MOVE";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointBehaviour "AWARE";
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointTimeout [1, 2, 3];
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointTimeout [1, 2, 3];
_wp = Ugly1 addWaypoint [position pad, 0];
_wp setwaypointtype "TR UNLOAD";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointTimeout [300, 330, 344];
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "CYCLE";
A waypoint statement is just a condition script and a completion script that tells the game engine that a waypoint is completed. Once it is, the statement can run the completion code.
Trying to make an AH patrol and attack a zone...RTB,land and turn engine off.. engine off part i am unsure of
So for instance, you use setWaypointStatements on your last waypoint. In the completion string is where you put your engine off command.
On my phone at work so I can't write you a full example
i do understand
Using toString can help clean up the look of your statements as well.
And use the engineOn command instead of the action version.
got it! thanks. reason i was initially looking for the engine off command to work was because they werent cycling the first GETINNEAREST , and so the syntax wouldnt loop correctly after the reached last wp and got out, they wouldnt get in again. realised the cycle wp is positionally important
so im just gona use GETOUT to chill the crew out until timer counts down. thanks though
you know your brain is fried from a day of Arma when after 4 years you forget how a cycle wp works
🤦♂️
randomPoint= selectRandom ["AO", "AO"];
{ deleteWaypoint _x } forEachReversed waypoints Ugly1;
_wp = Ugly1 addWaypoint [position pad, 0];
_wp setwaypointtype "GETIN NEAREST";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointBehaviour "AWARE";
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointTimeout [1, 2, 3];
_wp = Ugly1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointTimeout [1, 2, 3];
_wp = Ugly1 addWaypoint [position pad, 0];
_wp setwaypointtype "GETOUT";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointTimeout [300, 330, 344];
_wp = Ugly1 addWaypoint [position pad1, 0];
_wp setwaypointtype "CYCLE";
thats it if anyone is interested.
so i have this line which creates a task for the player to complete which is working fine. but i want to call it multiple times during the mission and have each time its called be a new task and not the same one that is just set to assigned again. how would i go about doing that?
[west, "Assault", ["One of our recon teams has found the location of an FIA location. Go to the coordinates and elimited the Insurgents stationed there.","Assault the FIA Outpost", ""], _OutpostSpawnPosition, "AUTOASSIGNED", 0, True, "attack", False] call BIS_fnc_taskCreate;
Perfect, thank you so much
Use some string formatting to make a unique task id. If you need an example it will be a while as I'm at work on phone.
1000/diag_Fps = frame time
ill just google it, thanks for the help though o7
You'll be using format
got it o7
And some sort of incremental variable you tag onto the end of the string using format
average frame time*
i got it working, much appreciated!
Is it even possible to make this work? ```sqf
{onMapSingleClick "player setpos _pos"} forEach units group player;
Where do I put the _x for it to work? I can't figure it out
There are several ways in which this is wrong. Allow me to explain:
Well, basically I want an AI with me as I teleport around the map. Thought it would be simple
onMapSingleClick is a single thing. There can only be one onMapSingleClick active at a time. When you set onMapSingleClick, it overwrites all previous onMapSingleClick. So assuming you managed to get the references to the individual units correct, you would only end up with an onMapSingleClick referencing the last one that the forEach operated on.
player refers to the unit the player is currently controlling. Your code, player setPos _pos, only sets the position of that unit. If you want the AI to teleport with you, that won't do it.
I haven't finished.
ofc... Can't be simple :/
You can use a Mission Event Handler to make a stackable map-click detector that won't overwrite others.
You need to think a little harder about the structure of the code and what it does. Teleporting the AI with you is actually pretty simple, but it should be obvious that player setPos _pos won't teleport anyone except the player.
What I thought, but I was hoping...
onMapSingleClick "{ _x setpos _pos } forEach units group player;";
Don't do that
messy result i know 😄
addMissionEventHandler ["MapSingleClick", {
params ["_units","_pos","_alt","_shift"];
if !(_shift or _alt) then {
{
_x setPosATL _pos;
} forEach units player;
};
}];```
thanks guys, but no need to overengineer a stick
im just teleporting around while designing missions
function wont work when done anyways
I don't remember if the Editor preview teleport requires holding Alt. If it does, then change if !(_shift or _alt) to if (_alt && !_shift)
Wrap it into is3DENPreview to make sure it doesn't work if you forget to remove it 😄
Evening gents - not really sure where to ask this. I've tried using UnitCapture on a CUP helicopter (a Little Bird) unfortunately BIS_fnc_UnitPlayFiring doesn't seem to work. I've done some trial and it seems to be able to record and replay gunner playfiring perfectly fine. I also can do so with a Pawnee as a pilot perfectly fine as well. Do you guys have any tips or workaround to record and replay the pilot's firing sequence?
Hi! Attempting to attach a building to another building for the purpose of an animation as the building I'm using comes in 3 parts. I have been using BIS_fnc_attachToRelative however when the other parts are attached they lag behind the animation and it looks pretty terrible. Anyone know a solution to this?
Hi - buildings have a low simulation rate (being… buildings); attach them all to e.g a Logic to have it refresh faster
Thanks for the quick response, this does make sense - however; I have attached the top to the logic, the mid to the logic, and then the logic to the base. This is as the base is the part that is animated. In this configuration the other parts still "lag" behind.
attach everything to the logic
Attaching everything to the logic causes only the base to move within its animation while the other two parts stay static.
Just to clarify this is using BIS_fnc_attachToRelative for everything.
is simulation disabled on any of the objects?
nope its enabled for all of them
Think I've found a solution for this. I've placed a kart at the bottom of the building and animate the kart instead and attached everything to that. So far it appears to be working great - thanks for your suggestions though, was very helpful in figuring out the problem.
Is there a way to lock a cruise missile onto a new target after launch?
Actually, maybe easier question
does anyone know the right code to send a hint to a player who walks into a trigger zone
I guess triggers are locally executed, even though I barely use non-server executed triggers
I'm overcomplicating things in my head....
with CBA_fnc_addPerFrameHandler, does the added Eh stay after respawning?
perFrameHandlers stay until you remove it with removePerFrameHandler
cool ty
you can have more than one displayAddEventHandler of the same event type right?
say event is MouseButtonDown
Yes
weird, I'm overwriting another mod's somehow, will have a fresh look tomorrow, ty
In EHs where the return value matters (e.g. handleDamage applying the returned number as damage), only the return from the most recently added EH is considered. MouseButtonDown isn't documented as having a return value override, but its keyboard counterpart does, so it's possible MouseButtonDown actually does too. If it does, and the other EH uses it, your EH being added later could break it.
Does anybody know a way to disable the church bells sound effects? I already tried deleting the church but the sound still plays from that location.
This is on Malden, no mods.
It's very annoying during the night when time is sped up 😂
Did you just hide it?
Try destroying it, maybe then it will stop?
Yeah it's just hidden because I have something else in its place.
I'll try that on the others cheers
Try setDamage 1 and then hide
over 16 frames
f1 = {player weaponAccessories currentWeapon player};
f2 = {primaryWeaponItems player};
[
call f1
,diag_codePerformance [f1]
,call f2
,diag_codePerformance [f2]
]
```=>
```[
["","acc_pointer_IR","optic_KHS_blk","bipod_02_F_blk"]
,[0.00203617,100000]
,["","acc_pointer_IR","optic_KHS_blk","bipod_02_F_blk"]
,[0.000510821,100000]
]```
Why is weaponAccessories so much slower than say primaryWeaponItems? 🤔
I don't think you'll be able to get the fidelity you want without wrapping the script
You could try something like that if you're trying to find what script is causing problems
Record active scripts and the frame time, do that every frame and find out what scripts correlate with higher frame times
the simple answer if you are not using a per-frame handler is each script is taking less than or equal to 3ms per frame
because that is the hardcoded limit to how much sqf can process over the duration of each interframe processing
Is it possible to get the [10] call BIS_fnc_bloodEffect; to stay permanently?
Just use 10e30 or such?
unfortunately it fades away after a few seconds
Not unreasonable. First line is binary + unary command, second is just unary. Plus weaponAccessories isn't a direct accessor, it needs to search against the three weapons.
Sounds like search is done in SQF with that x4 performance difference
You'd get nearly x3 just from the unary vs binary + unary.
Bumping this one back up. Any idea?
Does anyone know how to make a function that has can make an array of a groups members?
Is the gun you are using tied to the pilot or the gunner?
units myGroupHere gives you an array of group units
so if i have a function and i want to create an array of one of the groups i'd write varname = units groupvarname?
Yes. But if it's a function, you should be using private/local variables. So _myVarName
Cheers
I finaly found out what the problem is by some reason it just didnt read the script again, it didnt loop so i just used the sleep command to loop it now it works.
Does anyone know how to add diary entries only for zeus or admins? I want to be able to write to entries and monitor certain triggers that have happened on the mission
maybe this: ```sqf
_curatorUnit = getAssignedCuratorUnit (allCurators select 0);
"Only first zeus sees this hint!" remoteExec ["hint", owner _curatorUnit ];
no need for the owner command there. Engine does that
good point I had some issues getting switchmove set locally without the owner command, not sure what it was
i am try to do somthing along the lines of this to saving having 10 plus lines of this add action in the init box of an object, i not sure where or how to start
If variable name on an object = Heavy_Veh than excuted Heavy_Veh sqf
inside Heavy_Veh sqf
this addAction ["somename", "folder\classname.sqf"];
Do you expect variable name to change during the game or be randomly assigned?
Init fields of any objects you need:
this execVM "somescript.sqf":
somescript.sqf:
if(vehicleVarName _this == "Heavy_Veh") then {
_this addAction ["Whatever", ...];
};
if(vehicleVarName _this == "Not_Heavy_Veh") then {
_this addAction ["Whatever 2", ...];
};
or execute yet another script instead of addAction
i ran into a problem, when i create a cutscene and assign an animation to the player, everything works without any issues but after a few seconds the player goes into prone position, this issue does not happen with ai.
this is how i set the animation:
[player, "ALL"] remoteExec ["disableAI", 0];
[player, "Acts_Explaining_EW_Idle02"] remoteExec ["switchMove", 0];
also tried like this:
[player, "ALL"] remoteExec ["disableAI", 0];
[player, "Acts_Explaining_EW_Idle02"] remoteExec ["switchMove", 0];
[player, "Acts_Explaining_EW_Idle02"] remoteExec ["playMove", 0];
the player performs this "amovppnemstpsraswrfldnon" animation after a few seconds
idk if this is a bug or im doing something wrong
i tried also without disableAI as it does nothing for players but its still the same issue
so Acts_Explaining_EW_Idle02 doesnt have the prone anim?
no this happens with all animations i have used its an array of animations and none of them have prone in it, they are mostly for cutscenes
hmm ok but you should know the correct way to use switchMove is run it where the target object is local. so with player/client you dont even need remoteExec
i think i fixed it, it was because i have setPos the player and immediately after it play/switch the animation but now after adding a delay of 1 second it does not happen 
to the pilot
Quick question if i want to make a modded keybind with this:
https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
To map a key like CTRL + W How would i map it ?
Is it like so:
Test_Key[] = {
"512 + 0x11"// CTRL + W
};
Hey, im trying to make a script that draws the path from a starting position to a destination (in this case cities). It works kinda, as in it does draw the markers, however, it doesnt do so consistently / it seems to be unable to draw it completely for more than 1 city. If theres a second in the radius it checks for it only draws the markers that have an index number that hasnt been used already drawing the way to the previous city. How do i fix that?
//////// find cities
_cities = nearestLocations [getMarkerPOS _centerAO, ["NameCity"],_radius];
{
_markerpos = locationPosition _x;
_marker = createMarker ["City" + str _forEachIndex, _markerpos];
_marker setmarkertype "hd_dot";
_marker setMarkerText "City" + str _forEachIndex;
_marker setmarkercolor "ColorYellow";
} forEach _cities;
//////// draw path
{
_path = (calculatePath ["man", "safe", getMarkerPos "HQ_US", locationPosition _x]) addEventHandler ["PathCalculated",
{
_points = _this select 1;
_markername = "AoA" + (str (_forEachIndex +1)), _x;
["_markername"] call {
_markername = _this select 0;
{
private _marker = createMarker [_markername + str _forEachIndex, _x];
_marker setMarkerType "mil_dot";
_marker setmarkercolor "ColorRed";
_marker setMarkerAlpha 0.6;
} forEach (_points);
};
}];
} forEach _cities;
Looks like you have marker name collisions
_marker = createMarker ["City" + str _forEachIndex, _markerpos];
This will generate the same marker names for each run of the outer loop, right.
Also _forEachIndex doesn't exist inside the PathCalculated event handler.
Can someone remind me, is it possible to stop a number from going below a specific number? I'm trying to do something that constantly subtracts till it hits 0 and won't go negative.
Is it "floor"?
Floor makes a decimal round down
You’d just check if it’s 0 then not reduce typically
Or have your loop stop at 0 depends how you are using it
I tried that with my latest attempt, it worked okay.
Ty for the reply
Or just max
i guess the order of multiple remoteExec is not guaranteed?
It is, provided they were sent by the same machine
obviously if two remoteExecs from different machines cross in midair, neither of them would've known about the other before sending, so the order in that case is down to network conditions
they are but sometimes packets get lost (depends on protocol udp tcp )
dont know which one arma uses
Packets can get lost, but there are methods for knowing when a packet has been lost and re-sending the missing packets until the message is complete
right
Guaranteed messages, like remoteExec, are called guaranteed messages because....they're guaranteed to arrive
ok thx
Want to make a SP mission where at the beginning the commander briefs the player using the map and the markers move accordingly. There is this in the BIKI:
https://community.bistudio.com/wiki/Arma_3:_Animated_Briefing
but absolutely have no idea how to use it. If someone knows a tutorial or a guide somewhere I would appreciate it
What you've got is the guide actually. You can check Tac-Ops missions for more examples anyways
tac-ops the dlc?
Yes
but how would i know how the animated briefing was implemented in that
By checking the mission?
but he may not have the DLC ^^
Isn't Tac-Ops first party DLC and PBO already?
no i have that DLC
you can open Tacops\missions_f_tacops.pbo then 🙂
you will need a PBO viewer to extract the data and see the scripts
You just place markers in the editor and create a timeline as shown on the biki
On every step of the timeline you manipulate the markers.
i'm really code illiterate need like someone to break it down visually
this thing aint easy if ure not a coder
I don't think there is a good tutorial for it.

its showing me 3 folders but they are empty, i have completed them tho in this profile
Is it possible to activate a trigger through a script?If so, how?
I wish I understood that page.
they aren't empty (because i was opening them thru PBOManager) but they dont have a .pbo file tho just saves
You need to open the pbos inside the root folder of Arma 3
Not the save folders in your profile folder.
Easiest way is to look for existing keys in your keybinds.
You can check your name.Arma3Profile file, it lists all your current keybinds.
Bind CTRL+W to something and look it up in there
I can't see where you got your 512 from, that's not listed anywhere on that page.
I just bound a user action to CTRL+W, that becomes keyUser1 in my Arma3Profile file.
And Left CTRL+W ends up as 487784465 Which is hex 0x1D130011
Which https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding#Additional_documentation_on_key_bitflags_(CfgDefaultKeysPresets)
and https://community.bistudio.com/wiki/DIK_KeyCodes (This page is not linked on the keybinding page, probably should be)
Decodes as
comboKB = 0x1D (DIK_LCONTROL)
deviceType = 0x13 (INPUT_DEVICE_COMBO_KB + INPUT_DEVICE_MAIN_KB (Keyboard key combined with keyboard key))
doubleTapInfo = 0x00
keyId = 0x11 (DIK_W)
So its basically the first example of A+2xB, without the doubletap and with different keys
i have noticed that the sleep command is not very reliable in mp and wanted to ask if this version for example would be more reliable:
private _future = serverTime + 1;
waitUntil {serverTime >= _future};
Reliable in what sense?
i noticed that sleep in MP is not synchronous between clients
Both sleep and waituntil will not be 100% accurate
It depends on current scheduler load on whatever client is doing the check
But its not just about the scheduler either, MP by design is only approximate due to many reasons.
What are you trying to do anyway?
Sort of. serverTime is indeed must be the same for all the clients, but it gets synced every now and then. Now I'm not sure what your goal is, but have you tried maybe
//server side
TAG_GlobalPublicFlag = false;
... some logic...
TAG_GlobalPublicFlag = true;
publicVariable "TAG_GlobalPublicFlag";
//client side
waitUntil {
!isNil "TAG_GlobalPublicFlag" && {TAG_GlobalPublicFlag}
};
@meager granite so i got execVM but it saying that the sqf is not found?
Init sqf
execVM "assetsSpawn/core.sqf"
Core sqf
_this addAction ["M1A2C", "assetsSpawn\assetsSpawnHeavy\M1A2C_TUSK_II_Desert_US_Army.sqf"];
_this addAction ["M1126 M2", "assetsSpawn\assetsSpawnHeavy\M1126_ICV_M2_Desert_Slat.sqf"];
_this addAction ["M1126 MK19", "assetsSpawn\assetsSpawnHeavy\M1126_ICV_MK19_Desert_Slat.sqf"];
_this addAction ["M1128 MGS", "assetsSpawn\assetsSpawnHeavy\M1128_MGS_Desert_Slat.sqf"];
_this addAction ["M1129 MC", "assetsSpawn\assetsSpawnHeavy\M1129_MC_MK19_Desert_Slat.sqf"];
_this addAction ["M1130 CV", "assetsSpawn\assetsSpawnHeavy\M1130_CV_M2_Desert_Slat.sqf"];
_this addAction ["M1133 MEV", "assetsSpawn\assetsSpawnHeavy\M1133_MEV_Desert_Slat.sqf"];
_this addAction ["M1135 ATGM", "assetsSpawn\assetsSpawnHeavy\M1135_ATGMV_Desert_Slat.sqf"];
};
if(vehicleVarName _this == "Light_Veh") then {
_this addAction ["Whatever", ...];
};
if(vehicleVarName _this == "Air_Veh") then {
_this addAction ["Whatever", ...];
};```
Your have wrong paths then
arr it was back slash instad of forward
Also you need to send this into execVM, not just execute it
this execVM "assetsSpawn\core.sqf"
this in vehicle init field is the vehicle itself (magic local variable without the _)
(Magic = 25 years old crap)
now i geting Undefined variable in expression: this, line 1
got it working
im not finding alot of information on how to do this,its a quite complicated function to achieve as the groups variable names cant be used at least in a traditional sense... what im trying to achieve is to set a small repeatable trigger area, inside it,if there is a group,and new units that enter that trigger area automatically join the first group already there
i understand id need something with count and inthislist
join etc
but what im unsure of is how to factor in the group variable,as they will always be random and different mission to mission
one group variable must remain aswell,i cant create a new group in this context.
is this the right channel to ask questions about particles?
By script? Yes
i mean, i script the spawner, but i use the config style params
so #arma3_config then?
Depends on your actual question then
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
this addEventHandler ["CombatModeChanged", {
params ["_group", "_newMode"];
if (_newMode == "COMBAT") then
{
leader _group sideChat "Contact,We're engaged with enemy!";
_soundFile = selectRandom ["showcase_infantry_01_enemy_spotted_pap_0.ogg","showcase_infantry_01_enemy_spotted_alp_0.ogg","showcase_infantry_01_enemy_spotted_alp_2.ogg","showcase_infantry_01_enemy_spotted_alp_1.ogg","showcase_infantry_01_enemy_spotted_poi_0.ogg"];
playSound3D ["\a3\dubbing_f\showcase_infantry\01_enemy_spotted\" + _soundFile, player];
[] spawn
{
sleep 3;
_soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"];
playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player];
};
};
}];
this addEventHandler ["UnitLeft", {
params ["_group", "_oldUnit"];
if !(alive _oldUnit) then
{
leader _group sideChat "Man down,we've Lost one!";
_soundFile = selectRandom ["showcase_infantry_x01_medic_dead_alp_0.ogg"];
playSound3D ["a3\dubbing_f\showcase_infantry\x01_medic_dead\" + _soundFile, player];
[] spawn
{
sleep 3;
_soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"];
playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player];
};
};
}];
the script above i threw together a year ago, i just recovered it and tried using it on the init of a group but i keep getting errors with the eventhandler "combatmodechanged"
has something changed in Arma with this? iv no understanding why its not working,it used to work flawlessly
sure its init of a group and not unit?
i tried with a unit too
if unit change this to group this
let me try
no, still erroring. regardless,as its written im 110% sure it worked in 2023
post full error
....his addeventhandler ["combatmodechanged"|#|, { params ["_group","_newMode"];... " ERROR Missing ]
this is whats displayed when attempting to enter in init of either group or group leader
pretty sure its meant to be in init of the group,not leader,but error shows on "unit left" event handler sometimes too
from what i can guess,the structure coming after the initial calling of EH is wrong
hmmm i entered it again,no changes,and im not getting the error(so a copy n paste language error) ,its working
although im not hearing any ogg sounds
move it into a separate file and call it
I didn't check what code does
so far it looks like you messed up with copying somewhere
because of missing ] error
ye its really weird tho
heres full :
this addEventHandler ["CombatModeChanged", {
params ["_group", "_newMode"];
if (_newMode == "COMBAT") then
{
leader _group sideChat "Contact,We're engaged with enemy!";
_soundFile = selectRandom ["showcase_infantry_01_enemy_spotted_pap_0.ogg","showcase_infantry_01_enemy_spotted_alp_0.ogg","showcase_infantry_01_enemy_spotted_alp_2.ogg","showcase_infantry_01_enemy_spotted_alp_1.ogg","showcase_infantry_01_enemy_spotted_poi_0.ogg"];
playSound3D ["\a3\dubbing_f\showcase_infantry\01_enemy_spotted\" + _soundFile, player];
[] spawn
{
sleep 3;
_soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"];
playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player];
};
};
}];
this addEventHandler ["UnitLeft", {
params ["_group", "_oldUnit"];
if !(alive _oldUnit) then
{
leader _group sideChat "Man down,we've Lost one!";
_soundFile = selectRandom ["showcase_infantry_x01_medic_dead_alp_0.ogg"];
playSound3D ["a3\dubbing_f\showcase_infantry\x01_medic_dead\" + _soundFile, player];
[] spawn
{
sleep 3;
_soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"];
playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player];
};
};
}];
ok so the sections for SIDECHAT work
but im not hearing any ogg audio. i think the syntax is correct though
the ogg files are all from vanilla Arma3 campaign
"playsound3D" should just play in any location and audible
Change it to this execVM "somefile.sqf" and have your stuff there in the file instead
sorry i dont follow, you mean write this syntax in a new . sqf file, and call that sqf file from the init.sqf?
this addEventHandler ["CombatModeChanged", {
params ["_group", "_newMode"];
if (_newMode == "COMBAT") then
{
leader _group sideChat "Contact,We're engaged with enemy!";
_soundFile = selectRandom ["showcase_infantry_01_enemy_spotted_pap_0.ogg","showcase_infantry_01_enemy_spotted_alp_0.ogg","showcase_infantry_01_enemy_spotted_alp_2.ogg","showcase_infantry_01_enemy_spotted_alp_1.ogg","showcase_infantry_01_enemy_spotted_poi_0.ogg"];
playSound3D ["\a3\dubbing_f\showcase_infantry\01_enemy_spotted\" + _soundFile, player];
[] spawn
{
sleep 3;
_soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"];
playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player];
};
};
}];
this addEventHandler ["UnitLeft", {
params ["_group", "_oldUnit"];
if !(alive _oldUnit) then
{
leader _group sideChat "Man down,we've Lost one!";
_soundFile = selectRandom ["showcase_infantry_x01_medic_dead_alp_0.ogg"];
playSound3D ["a3\dubbing_f\showcase_infantry\x01_medic_dead\" + _soundFile, player];
[] spawn
{
sleep 3;
_soundFile = selectRandom ["out2a.ogg","out2b.ogg","out2c.ogg"];
playSound3D ["\A3\Dubbing_Radio_F\Sfx\" + _soundFile, player];
};
};
}];
finally got it working
tweaked it a little
also copy pasted many times,and rewrote some syntax. the special code messes up the syntax on BIS forums and other formats maybe
Had/heard it often, if you copy from BI forum there can be invisible symbols or some shit that breaks it.
use Notepad++ and "show special characters" to view them (e.g non-breakable spaces / nbsp)
Thanks for the tip.
// List of units allowed to eff around with the crate
private _bluengi = ["B_T_Engineer_F","B_Engineer_F","B_D_Engineer_IxWS","B_W_Engineer_F"];
spawnres = createvehicle ["gm_fortification_crate_05", position bluebeach];
[[west, "blu"], "Mobile spawnpoint resources landed. Good luck."] remoteExec ["sidechat"];
// Do semthing useful with the crate
if (typeof player in _bluengi) then {
[spawnres, ["<t color='#FF0000'>Construct spawn point</t>","s\setupspawn.sqf"]] remoteExec ["addaction"];
[spawnres, ["<t color='#8888cc'>Load resources on a boat</t>","s\b_loadspawnres.sqf"]] remoteExec ["addaction"];
[spawnres, ["<t color='#8888cc'>Load resources on a truck</t>","s\loadspawnres.sqf"]] remoteExec ["addaction"];
};
Why is my unit check failing? I've been fighting with this for a few days now and I just can't figure out what I'm doing wrong! Please help? (The rest is fine, anf if I remove the unit check it's fine too... )
in is case-sensitive, maybe it's that
also if that's running on the server, player is objNull
Hey, has someone a tutorial to add a sqf file as an function in a mod. with the official wiki its dont work. i have tried with the cfgFunction, ther is every time the error fil not found.
Lol everything! haha
If it's in a mod then the addon prefix matters. That usually trips people up.
Addons without a prefix apparently get an automatic prefix which is undocumented.
how does pastbin work?
..what
open pastebin, new document, paste, define a document duration time, save, get the URL of this document, paste it here
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.
How do you do something similar to this
https://community.bistudio.com/wiki/createDiaryRecord
But instead of adding the topics under briefing, it creates new separate category in the map menu, like the diary record module?
createDiarySubject
you set a different thing than "Diary", "MyTopic" should do if I remember it right
you may have to create a diary subject
i have set the addonPrefix in den Addonbuilder to GRU an have set the filtpath to: GRU\Equipment\Arsenal, is a leading \ requiert for this path?
No
i still have the error file not found. have i todo more than put a sqf file in the mod and the cfgFunction in the config.cpp?
512 is the integer for left ctrl i was thinking it could be added like that but later i saw that number at front isnt integer but the bitflag for a action.
Also i didnt compleaty understand this warrning on Wiki:
If the key code is large enough, for example 0x1D130023 (Ctrl + H), then adding values may lead to a wrong result due to rounding errors
Other then that big thanks for explanation.
but 512 is not the integer for left ctrl.
left control is 0x1D, which is 29
Here on the wiki it says its 512 https://community.bistudio.com/wiki/DIK_KeyCodes
Ah I see you were looking at INPUT_CTRL_OFFSET instead of DIK_LCONTROL
Well, you do need a CfgPatches entry in the config.cpp
Oh yea i see now.
Mh maybe 512 could also work then 🤷 but thats not what the game does when you set a CTRL+W keybind, so I wouldn't trust that
i have a CfgPatch entry and a CfgVehicle entry and the units i have insert will work, only the scripts doesnt work. need the sqf special commands inside ?
Nope.
If you zip up your addon and send it to me then I'll check it.
Too many tiny ways that this can go wrong to keep suggesting stuff.
Here is a simple way you can put your fnc in a mod:
Mod structure:
MyFile // Addon folder
|__config.cpp
|__fn_Test.sqf
In config.cpp:
class CfgPatches
{
class MyTestMod
{
name = "MyTestMod";
author = "Legion";
url = "";
requiredVersion = 1.60;
requiredAddons[] = { "A3_Data_F_Decade_Loadorder"};
units[] = {""};
weapons[] = {};
skipWhenMissingDependencies = 1;
};
};
class CfgFunctions
{
class LEG
{
tag = "LEG";
class Category
{
file = "\MyFile";
class Test {};
};
};
};
In fn_Test.sqf:
params ["_text"];
hint format ["This is my Test Text: %1", _text];
Hi guys! im creating a map in ArmA 3 and i want to know how to make some of my editor placed markers just visible to one side
Hi; you could have in your initPlayerLocal.sqf:
if (side player == east) then
{
deleteMarkerLocal "markerName"; // or "markerName" setMarkerAlphaLocal 0
};
```to do many markers at once:```sqf
if (side player == east) then
{
{
deleteMarkerLocal _x; // or _x setMarkerAlphaLocal 0
} forEach ["marker1", "marker2", "marker3"];
};
Thank you Lou!, I'll try it just now
You could do something like this but you will have to name your markers correcly:
CIV_MyMarker1, CIV_MyMarker2 -- Civ markers WEST_Marker1, WEST_Marker2 -- West Markers EAST_Marker1, East_Maker2 -- East Markers GUER_Marker1, GUER_Marker2 -- Ind Markers
//Init.sqf
0 spawn {
waitUntil { !isNull (findDisplay 46)};
{
private _arr = _x splitString "_";
private _pre = _arr select 0;
if(_pre in ["WEST","EAST","GUER","CIV"]) then {
if(format ["%1",side player] == _pre) then {
_x setMarkerAlphaLocal 1;
}else {
_x setMarkerAlphaLocal 0;
};
};
}foreach allMapMarkers;
};
I tried Lou one and it worked perfectly, also thank you Legion!
Legion's version allows for an "automated" system so you can Ctrl+C/Ctrl+V markers
if you only have a handful, go for the simple version
how to exclude a control from being delete using the below?
_allControls = allControls findDisplay 46;
{ctrlDelete _x;} forEach _allControls; //tried following but didn't work: {ctrlDelete _x;} forEach _allControls - [_exampleCtrl1,_exampleCtrl2, etc];
it works for allCutLayers though
_allLayers = allCutLayers;
{_x cutFadeOut 0.01;} foreach _allLayers - [_exampleCtrl1,_exampleCtrl2, etc];
Are you sure all your controls are on display 46 ?
yes
i want to exclude 2 controls from being deleted but the command deletes every control
forEach (_allControls - [ctrl1, ctrl2]);
now if these controls are sub-controls… don't delete the parent(s)
is there a tool to quickly figure out the door number in a building?
thanks, that actually worked!
If you can place one of that type in the Editor, open its attributes and go to the Special States section. The door numbers there should match.
If you've got one on the terrain but can't/don't want to find it in the placeable objects, the Edit Terrain Object module shows you the same information.
How do I acess the Edit Terran Module?
You might be surprised to learn it's in the Modules tab
Editor > right panel (Assets) > Systems > Modules > searchbox > "Edit Terrain Object"
I go tit
What value with vector3Ds let you just point straight up?
Or nvm I guess, Why is it when I use drawLaser, the vecor of [0,0-1] shows the laser in the ground, but [0,0,1] doesnt show anything?
hey all quick question!
for this scripting:
reducedDamage = 0; // Reduced damage
what are the values? 0 means no reduced damage. is 1 fully invincible or is 100 fully invicible. if i wanted to reduce the damage players take from AI to 80%, what would be the value for example? 0.8 or 80?
in what context are you doing this?
post the whole thing
sorry! its setting the server settings for AI damage dealt to players
so how much damage AI do to human players
some say its just on or off, 0 = no reduced damage and 1 = reduced damage with no ability to control “how much reduced damage” others say you can control the amount of damage reduction
https://community.bistudio.com/wiki/Arma_3:_Difficulty_Settings
It's just off/on.
If you want to have finer control over damage levels, you'll need some handleDamage Event Handlers.
ahh thank you!
do you happen to know if “AI” damage is only from AI units like infantry, tanks, aircraft etc or do things like IED, traps count as well?
According to the documentation, it reduces damage taken by the player and members of their group - no specific source is mentioned, so presumably all sources.
(* not scripted damage. setDamage or setHit will bypass the reduction.)
ohhh interesting! thanks nikko 🙂
hello! The doc for civilian presence module mentions switching civilians to "panic state animations" when they feel danger. Is there a way to enable the "panic state" from my own script?
https://community.bistudio.com/wiki/Arma_3:_Civilian_Presence
you can play the action animation itself:
_civ playAction "panic"
How to prevent AI vehicles from using jungle footpaths on map Tanoa? Vehicles often drive straight into jungles and get stuck because they want to take the shortest route. How to prevent it? I tried to block the paths with walls and the like, but the vehicles manage to bypass the walls and go onto the paths
nice, thx, will it cause the AIs to move while covering their heads? I've seen animations for that
Is there a way to lock a cruise missile onto a new target after launch?
I'm concerned it'll just fly into the hillside otherwise
Is there a way to check an items classname to figure out what kind of item it is like what can be done with a vehicle?
I'm trying to figure out if a classname is a uniform. Goal is to count and remove all uniforms from a container.
NVM Solved it.
that might help if I initially have the cruise missiles targeting an invisible thing or two in the sky
Has it been heard before that addWeapon can cause the gun to be silent to other clients? ive switched missions on a dedicated server and found that we couldnt hear most of the AI weaponry, and ive isolated it down to this: ```sqf
private _grp = createGroup east;
private _unit = _grp createUnit ["O_Soldier_F", getPosATL player, [], 0, "NONE"];
{_unit removeMagazine _x} forEach magazines _unit;
removeAllWeapons _unit;
private _weapon = "arifle_akm_f";
_unit addWeaponGlobal _weapon;
private _mags = getArray (configFile >> 'CfgWeapons' >> _weapon >> 'magazines');
{_unit addMagazineGlobal _x} forEach _mags;``` if the unit's weapon gets replaced then we cant hear it, even if we pick up their gun and shoot it (the shooter can hear it, but not others)
curiously it sounds fine with setUnitLoadout...
Thought: Swap around addMagazineGlobal and addWeaponGlobal order?
So you first add the magazine, then the weapon
https://community.bistudio.com/wiki/addWeaponGlobal
There is a note of this command being broken and supposedly fixed in 2.00
Since you create the unit right in this script, use normal addWeapon/addMagazine instead?
oop addWeapon/addMagazine is what i originally tested before their global variants
swapping their order didnt work
Do you use any mods/addons btw?
yes, a few on the server - notably RHSUSAF, RHSAFRF, and Project SFX: Remastered - and unrestricted for clients, but this set of mods was used before 2.16 and we didn't have this issue
We had similar issues with JSRS breaking some of RHS stuff, some guns were silent for non-JSRS players
yup, im familiar with that
It could be sound mods breaking the gun somehow if its created on their side?
Or the other way around if gun is created on non-sound mod side and then used by sound modded clients
Test same script without any mods at all
i tried unloading RHSUSAF+RHSAFRF and Project SFX: Remastered without success (though technically not all three at once), and some of us tried joining completely vanilla without luck either
i guess ill go all the way then
Try having it all vanilla for dedi and players
Yeah, looks like sound mod is at fault
so having SFX and no RHS didnt work, having RHS and no SFX didnt work, but removing both fixed it...
joining with those mods again (server being vanilla) i can't hear them firing anymore...
in addition this issue was also present when i had loaded the same RHS and SFX mods as the server, but tbf i had other weapon mods as well
the last time we ran this gamemode (no changes related to the usage of addWeapon) was Jan 22, so definitely during arma v2.14, which means this is probably a regression in 2.16?