#arma3_scripting
1 messages ยท Page 613 of 1
@thin owl Cameraview changes AFTER reaching the scope zoom.
I need to determine when the player has stareted to attempt to ADS.
Cameraview changes too late.
i "updated" an existing mod to use backpacks of another mod and want to know if i can use an if() so that these bagpacks are only visible when the mod is installed
@young current
@peak plover intercept the mouse / key press
ad the extra textures for the backpack
@young current
CBA has an event for cameraView changes. but that is too late you just stated
@digital jacinth How to know all the keybinds for ADS?
Is there a way to determine when an action is used like ADS or such?
best bet is this.
https://community.bistudio.com/wiki/actionKeys
I am unsure how to retrieve base game set buttons in sqf
Okay, thanks , I will give it a go
probnably like this
https://community.bistudio.com/wiki/actionKeysNames
If action keys doesn't work you could do a really poor man's eventhandler and do https://community.bistudio.com/wiki/inputAction
every frame, however my solution already sounds like the way worse option :P
Getting the bound keys and using a keypressed handler is the best solution
the action names for it are
optics
opticsTemp
Okay, thank you fellow gamers
i "updated" an existing mod to use backpacks of another mod and want to know if i can use an if() so that these bagpacks are only visible when the mod is installed
@young current is it possible to make this if then in a .sqf and overwrite the scope of an config.cpp class
actionKeys won't give you mouse though will it?
nope. that is why i suggested actionKeysNames, as it might return which buttons it is bound to. No other idea how to get vanilla keybinds
anyone knows if there is a script to stop NVGs from working even when the players are wearing it? like they are wearing it but it just won't work.
@short flame no
why not just run the mission so that both mods need to be run together?
keep it simple
yeah i always think complicated
Hey everyone, Being as confused as I am I came here in search of help for the following problem;
I have a onPlayerRespawn.sqf & the following line in my description.ext;
respawnOnStart = 0;
Within the onPlayerRespawn.sqf I have;
systemchat "hey";
I have completely shut down arma and started it up again to be absolutely sure it loaded description.ext properly. And it still returns absolutely nothing.
What is going on here?
Hmm well it works in my main world so guess its fine
any way to keep AI from shooting at aircraft with small arms?
@sonic thicket did you recently edit description.ext and not fully back out and then try? it only loads if you preview from the editor itself, not if you just click restart or something
I did a full exit, usually re-loading the scenario is enough though
But hey, my script is working fully as intended with radiation and all my icons in place ๐ https://i.postimg.cc/1t5jwgmq/image.png
it looks quite cool
Well, except for the error I just got upon walking in the actual radiated zone
And i messed up putting stuff from another scripting luangage there. all fixed and working now ๐
those custom icons?
Yeah, as shown in the image.png i shared with the link ( Cant share screens here, which is understandable)
they look good
spend a full day making those ๐ I've made them to fit with the vandersons mod
or well a full day after work, so couple of hoursa
I've used ALIAS radiation script for inspiration and added the icons, made the radiation gradually increase towards the center and also made it so radiation equipment fully protects until you get too close and dependant on how much protection you wear
if driver returns the driver of a heli, how do i return the copilot?
@fair drum have you tried https://community.bistudio.com/wiki/assignedCommander or turret/gunner while sitting in the co-pilot seat?
_heli turretUnit [0]
Is there any obvious reason why ```SQF
_unit addMagazine "CUP_200Rnd_TE4_Red_Tracer_556x45_M249";
_unit addWeapon "CUP_lmg_M249_E2";
mag is too big and can't fit the vest?
Does it have to fit into the vest first?
Well that's a pain in the hole when it comes to machinegunners because if it takes it out of the vest then there's a lot of empty space left
But no just tried it with plenty of room in the vest and pack and it still loads in empty
put it into a crate and try how big it is
does it work if inventory is completely empty?
I'll give that a shot
Nope completely empty uniform, vest and backpack and still ```SQF
_unit addMagazine "CUP_200Rnd_TE4_Red_Tracer_556x45_M249";
_unit addWeapon "CUP_lmg_M249_E2";
Ok must be a mag size thing I switched out the classnames for the M240 and it's box mag, still no go but then I swapped it out for an M16 and Stanag and that worked fine
Also M249 with 30 round STANAG loaded = works fine
@leaden summit there is some "add magazine to primary weapon", it could circumvent the issue
Trying to find that in the wiki to no avail
Oh, try maybe linkItem? (after having added the weapon of course)
OK got it sorted.
Unlike every other gear script I've used where the weapons come first, if I move those 2 lines to the end then I spawn with ammo loaded
Morning fellas. I have a small problem I hope someone can help me with.
I've written a function to force a given helicopter to land at a destination because the "LAND" waypoint just doesn't work.
params ["_helicopter", "_destination"];
_helicopter move (getPos _destination);
[] spawn {sleep 3};
if (alive _helicopter) then {
waitUntil {unitReady _helicopter};
_helicopter land "LAND";
};
Where _helicopter is any given helicopter-type vehicle and _destination is well where you want it to land.
Unfortunately waitUntil {unitReady _helicopter}; keeps returning a generic error which I don't understand why because if I try running the command in the debug console it runs fine.
The helicopter lands fine (surprisingly) but I would like to know what exactly is causing this error
@potent dirge depending on where your code is called from, suspension (waitUntil, sleep) is not allowed
Oh I thought only sleep needed to run in a scheduled environment. So I guess I can put in spawn safely?
Somehow placing waitUntil inside spawn breaks the function and causes the heli to take off again after touching down๐คฆโโ๏ธ
You wrote [] spawn {sleep 3};
Is there anything wrong with that?
Well, the spawn is doing nothing than just sleep 3 second and nothing else
You wanted to put the waitUntil inside the spawn statement
Yeah I wrapped the waitUntil in a different spawn statement under the if
Like this now
_helicopter move (getPos _destination);
[] spawn {sleep 3};
if (alive _helicopter) then {
[_helicopter] spawn {waitUntil {unitReady _this}};
_helicopter land "LAND";
};
Or is this better:
_helicopter move (getPos _destination);
[_helicopter] spawn {
sleep 3;
waitUntil {unitReady _this};
};
if (alive _helicopter) then {
_helicopter land "LAND";
};
watchout spawn don't wait for the code inside the spawn statement
Oh thanks for the heads up, maybe that's what's breaking the function
[_helicopter] spawn {
params ["_helicopter"];
sleep 3;
if (alive _helicopter) then {
waitUntil {unitReady _helicopter};
_helicopter land "LAND";
};
};
I think this might be better. Wonderful
the code now spawn a "tread" then wait for 3s, check if the heli is alive, waituntil the heli is realldy and order land. All those step are done in the order you want
Thanks a lot, you just saved me a few hours of rigorous head-scratching
indeed - spawn is creating a "parallel" script that knows nothing of the first one
you are in good hands I see! ๐
Just tested and works like a charm 
I need help with a big project. I am trying to save player scores not only beyond a mission or server restart but also add them up to get the total score each player has achieved on the server to give them ranks according to it.
I figured the only way to do it is to have one database with the total player score and one with the current resp. last player scores. The database with the last player scores would save the current score of every player in the mission every 15 minutes or so and whenever someone disconnects and on mission start all scores from that last player scores database would be added to the total player scores database and then the last player scores database would be completely wiped for the starting mission. I figured that that was the best way to prevent any miscalculations or problems in case the server should ever crash or something like that.
Maybe someone that has worked with those Arma databases alot could send me a basic code structure and I could fill in the details...
if you trust your players, you could always store their info in their own profile, but a tricky player could edit that
(also, if they lose their local profile they start from scratch)
no db xp on my side though
There's some database addons, if you dont wanna do sql use some python extension and use this : https://github.com/overfl0/Pythia
Then you could "database" hoewver the hell you want, either using actual DB, or just using simple jsons or whatever
Is there an easy way to find out whether or not someone has a toolkit with them?
@thin owl Nope, still works. Thanks alot.
Keep in mind that in is case sensitive
Two more questions:
- Is there a way to enable players to carry their incapacitated comrades to safety?
- Does anyone know some welding animation that I could use to "disassemble" Czech hedgehogs and how could I implement it?
You using Ace at all?
Not sure what you mean but I am not using any mods.
Is there a way to stop a sound from playing after executing this script?:
[N1, player] say3D ["Nuke", 500];
couldn't find anything to do so
Het I was wondering if any one had a base Config for making a vest. Like a template?
Thx
@winter rose Do you think this would work if I put it into the initServer.sqf?
playerScores_database = ["#PLAYERS",[]];
totalPlayerScores_database = ["#PLAYERS",[]];
_playerScores_database = profileNamespace getVariable "playerScores_database";
_totalPlayerScores_database = profileNamespace getVariable "totalPlayerScores_database";
if (!isNil _totalPlayerScores_database) then {
totalPlayerScores_database = _totalPlayerScores_database;
};
if (!isNil _playerScores_database) then {
playerScores_database = _playerScores_database;
classes_playerScores_database = [playerScores_database, ["players"]] call BIS_fnc_dbClassList;
_lastScore = 0;
_oldScore = 0;
_newScore = 0;
{
if !([totalPlayerScores_database, ["players",_x]] call BIS_fnc_dbClassCheck) then {
[totalPlayerScores_database, ["players", _x], ["&SCORE", 0]] call BIS_fnc_dbClassSet;
};
_lastScore = [playerScores_database, ["players",_x,"score"], 0] call BIS_fnc_dbValueReturn;
_oldScore = [totalPlayerScores_database, ["players",_x,"score"], 0] call BIS_fnc_dbValueReturn;
_newScore = _oldScore + _lastScore;
_null = [totalPlayerScores_database, ["players",_x,"score"], _newScore] call BIS_fnc_dbValueSet;
_lastScore = 0;
_oldScore = 0;
_newScore = 0;
} forEach classes_playerScores_database;
};
playerScores_database = ["#PLAYERS",[]];
addMissionEventHandler ["HandleDisconnect", {
params ["_unit", "_id", "_uid", "_name"];
_null = [playerScores_database, ["players",_uid,"score"], (score _unit)] call BIS_fnc_dbValueSet;
true;
}];```
welp actually found the way to do so, if anyone is intersted just delete the object that the Say3D sound is coming from by
deleteVehicle N1;
@vague geode perhaps
@winter rose perhaps?! ๐คจ
๐ฎ Perhaps
@vague geode won't work, HandleDisconnect is server-side only
for the rest, I let you script however you want
don't forget to save the profile as well
@winter rose I know that HandleDisconnect is only server-side. The code I sent is meant to be in the initServer.sqf so it would be executed server-side, wouldn't it?
My intention is to save the scores on the server itself that way making it harder for players to temper with them.
oh, my bad, I didn't process the whole message at once
then yes, should work (save the server's profile as well)
@winter rose Like this?
playerScores_database = ["#PLAYERS",[]];
totalPlayerScores_database = ["#PLAYERS",[]];
_playerScores_database = profileNamespace getVariable "playerScores_database";
_totalPlayerScores_database = profileNamespace getVariable "totalPlayerScores_database";
/* here is where the magic happens */
playerScores_database = ["#PLAYERS",[]];
profileNamespace setVariable ["totalPlayerScores_database", totalPlayerScores_database];
profileNamespace setVariable ["playerScores_database", playerScores_database];
saveProfileNamespace;
addMissionEventHandler ["HandleDisconnect", {
params ["_unit", "_id", "_uid", "_name"];
_null = [playerScores_database, ["players",_uid,"score"], (score _unit)] call BIS_fnc_dbValueSet;
profileNamespace setVariable ["playerScores_database", playerScores_database];
saveProfileNamespace;
true;
}];```
don't post your whole code every time ๐
but save to profileNamespace in a MissionName_playerScores variable, use saveProfileNamespace when you change data, that's it
@winter rose Like this?
playerScores_database = ["#PLAYERS",[]];
totalPlayerScores_database = ["#PLAYERS",[]];
_playerScores_database = profileNamespace getVariable "WL_custom_playerScores_database";
_totalPlayerScores_database = profileNamespace getVariable "WL_custom_totalPlayerScores_database";
/* here is where the magic happens */
playerScores_database = ["#PLAYERS",[]];
profileNamespace setVariable ["WL_custom_totalPlayerScores_database", totalPlayerScores_database];
profileNamespace setVariable ["WL_custom_playerScores_database", playerScores_database];
saveProfileNamespace;
addMissionEventHandler ["HandleDisconnect", {
params ["_unit", "_id", "_uid", "_name"];
_null = [playerScores_database, ["players",_uid,"score"], (score _unit)] call BIS_fnc_dbValueSet;
profileNamespace setVariable ["WL_custom_playerScores_database", playerScores_database];
saveProfileNamespace;
true;
}];```
Or can I use `briefingName` in the variable name somehow?
Also which would you advise me to use to change the players' ranks:
A: `player setRank "COLONEL";`
B: `player setUnitRank "COLONEL";`
C: `[ vehicle player, "Colonel" ] call BIS_fnc_setRank;` (also is this one global?)
Does anyone have any know of any particular mods interfering with scripts executing themselves? EG I am trying to execute "camera.sqs" & "intro.sqs" (yes I know they are old and obsolete) with a set of mods (RHS, CUP and a few others) and it wont load both of the two actions. But when I recreate the environment in vanilla it works hands down like a charm.
Any ideas?
Waituntil is afaik the only solid method (combined with CBA XEH postInit)
Unless you force a respawn through the respawn framework and use the Respawn EH
time > 1
there is also a getClientState @tough abyss
maybe a waitUntil not isNull findDisplay 46, but I can't guarantee it
you will have to, eventually
@winter rose Is it right that way and also which one would you advise me to use?
https://discordapp.com/channels/105462288051380224/105462984087728128/746710004542865529
@vague geode I don't know
https://discordapp.com/channels/105462288051380224/105462984087728128/746706767727034368
basically, do your operations server-side, save profile every e.g 5-10 minutes, and on disconnect save once more
regarding the rank I don't know more than what the wiki says about these commands
lots of things, cba_fnc_waitUntilAndExecute, displayload XEH etc
@tough abyss or don't use init fields in MP ๐
Anyone know of a good Slot Whitelisting script? I wanna whitelist Bluefor slots to certain UIDs
https://imgur.com/ElU4dSj Still WIP... Task dispatcher
Is it possible to put some kind of progress bar into a diary record?
more or less yes, iirc you can edit them now
yup
https://community.bistudio.com/wiki/setDiaryRecordText @vague geode
Yeah, I knew that but if it possible to put a progress bar into it?
so I'm setting up a rifle range using pop up targets and need to to reset them as needed after they are shot. I have googled a bunch and see some old videos. the newest option is global reset. My desire is to have the ability to bring targets back up on one range as a separate range is being use.
edit it little by little - with an image for example @vague geode but there is no native progress bar
Ok, thanks anyways. Also I tried to put in an image once but it didn't work for some reason...
This post speaks to global reset of all targets vs. my needs of resetting only certain targets . https://www.reddit.com/r/arma/comments/ewecwj/help_with_controlling_the_pop_up_targets_in_arma_3/
Evening fellas. When nesting forEach, and you want to refer to the _x from the bigger forEach is assigning a local var to that _x a wise way of doing so?
thats how I do it @potent dirge
Thanks for the feedback guys. Enjoy your evening
Is there any way to catch changes to squad composition (units join and leave), without having a loop that constantly checks it?
@potent dirge you mean like this?
{
firstOne = _x;
{
hint firstOne;
} forEach ["Blaaaaah","Blaaaaaaa"];
} forEach ["Blah","Blahblah"];
@thorn saffron Nope.
EH?
@high marsh yeah, I knew it was possible I just wanted to know if it was a good way of doing so
๐
Is it possible to get the side a class belongs to
I'm trying to create a small QRF function using BIS_fnc_spawnGroup
(for exactly what you described, see BIS_fnc_objectSide (https://community.bistudio.com/wiki/BIS_fnc_objectSide ))
Thanks
Interesting, even though I gave the class names wrapped in quotes it still returned the correct side albeit with an error
ah no, it's an object it is expecting, not a classname
and "east" might be the default return value too ๐
Yeah I figured that out, I'm just surprised it was still able to return the correct value
yeah, input errors make Functions magic happen ๐
Yeah I think I'll use configProperties for that instead. Now all I need is a neat way to get the path to said config
getNumber*
Sorry I meant class name not config
that's exactly it @tough abyss
Thanks this is much simpler than sifting through the entire config class for one value
Is it possible to get a list of all event handlers that are applied to a unit?
I have an AI revive script that works pretty well, except for Warlords, where it breaks for some reason. I'm trying to figure out if Warlords is somehow overriding event handlers, like handle damage, or something
I don't think there's a way to. Unless the EHs are added in via config
As for Warlords AI; there are no EH's that I can see, although there are some FSM's running which can override your scripted behaviour.
As for players; I've seen some EH's on 'Killed' and 'Respawn', besides the spawn protection and friendly fire protections (basically ignoring damage).
Does anyone know anything about mods that interfere with scripts properly executing themselves?
There's a lot of way that a mod can interfer with other ones (changing global variables, terminating script in the scheduler, removing event handlers, deleting objects, ...). Also, just a mod changing it's function can break other script that relly in these
The most likely thing to break your script is the bugs in your script
Does anyone know the width of the widest vehicle in game. I'm trying to spawn vehicles in a row side to side and I don't want collisions
Or at least if there's any vehicles wider than 5m
Is there a script that rearms the player on respawn?
argh, I can't find a failsafe way to spawn vehicles; there is always one that seems to like spawning in the middle of the house
BIS_fnc_findSafePos with a slightly larger 'objDist' set?
@obtuse quiver you doing a editor mission or a default Zeus mission?
editor
BIS_fnc_findSafePoswith a slightly larger 'objDist' set?
I tried it withsizeOf _class * 2, I triedfindEmptyPosition, IDK anymore ๐ญ ๐ฅ
[_home, 3, 50, sizeOf _vehicleClass * 2, 0, 0.25, 0, [], []] call BIS_fnc_findSafePos;
maybe I should put the min radius as sizeOf typeOf _home, but still
So is the building in question a custom building, or in terrain?
Is it the only building with problems, or does it happen with multiple ones?
Does it happen with all vehicles you try to place?
btw... it remember a similar issue (although with trees) where the solution was a mix of different checks to be 100% sure
I also tried to create the truck in the air then use setVehiclePosition on the obtained spawnPos, to be double sure
(to no avail)
To make sure position is not inside a building, increase distance to nearest object param.
by KK in wiki notes ๐
although 2x object size SHOULD be enough
I mean, yes o_o
but sometimes it spawns right in the middle of the building, if I don't set the "3" min radius parameter
@fair drum i wanted to create a scenario where players can pickup weapons from the ground and in case they die they respawn with ammo
I do know that some vehicles has some weird bounding boxes, which don't match their actual size. You could try to use (boundingBox _vehicle) select 2
@winter rose
hmm.... currently testing something and I'm baffled...
// 3 dot markers placed on top of buildings
_markers = ["home_1", "home_2", "home_3"];
{
_vehicle = "I_E_Truck_02_transport_F";
_pos = [(markerPos _x), 1, 10, sizeOf _vehicle * 2, 0, 0.25, 0, [], []] call BIS_fnc_findSafePos;
createVehicle [_vehicle , [_pos#0, _pos#1, 0], [], 0, "CAN_COLLIDE"];
} forEach _markers;
It does create 3 vehicles, but not even close to the markers and actually all at the same place resulting in colliding into each other ๐คฃ
so my results are even worse than yours
bah, I did set a hardcoded distance, and if a car explodes or flies once in a while "it's Arma"
i cannot find a rearm script, i think i will use an arsenal but it's a very bad option
i know it's possible but i don't know how to do it
a few ways @obtuse quiver .
1.) you can place all the player units and set their kits to have said ammo in their inventory with a starting weapon. you can then go to attributes/multiplayer and click "save loadout" which will respawn any player with the kit defined in the editor when you place the unit.
2.) you can add onPlayerRespawn.sqf to your mission file and define a player additem "magazine" or other various add magazine commands, it will then fire when they respawn.
3.) you can define a respawnMagazines[] = { "magazine","magazine" }; and a respawnWeapons[] = { "weapon" }; in the description.ext
4.) you can define a CfgRoles and a CfgRespawnInventory in your description.ext then add a BIS_fnc_addRespawnInventory to your units via script
pick one and I'll show you
@fair drum so, the player will have different weapons, do i need to specify every type of weapon and every type of mag?
you saying they will respawn with the weapon they pick up?
yep, but with a normal save loadout on death they will respawn with the ammo they had at death
number 1 will only revert the save loadout of the unit that the game initially initialized from the editor. so if i place a man with a pistol in the editor, run the mission, he goes and picks up a rifle and dies, he will respawn with that pistol setup i gave him in the beginning
that's fine too
then try out number 1, its the most simple. just set what you want their initial and respawn setups to look like, then checkmark the "save loadout" under attributes/multiplayer
oh, so i don't need onplayerrespawn and onplayerkilled?
using the first metod i respawn with the default loadout
Hm okay I'm working on the quick join button again and trying to figure out how EventHandlers work 
thus far I think I need to use findDisplay to find the button I want to add the eventhandler to, then use displayAddEventHandler to add an onButtonDown(/ButtonDown) EventHandler to the button which then when it fires executes the connectToServer command, I just havent quite figured out if thats correct and if it is how I transfer that into actual working code
Hm I've got something that pboProject is fine with now which is
config.cpp:
class CfgMainMenuSpotlight
{
class ACQuickJoin
{
text = "Join the ACServer";
textIsQuote = 1;
picture="acqj\aclogo.paa";
video = "";
action="(findDisplay 46) displayAddEventHandler ["buttonDown","_this call cts.sqf"];";
actionText = "AC";
condition = "true";
};
};
cts.sqf:
connectToServer ["192.168.0.2", 2302, "test"];
But with that Arma throws a Generic error in expression when I press the button
http://prntscr.com/u4imt7
If it is a GUI button element you can just call onClick straight on it like so:
class freezePlayer: RscButton
{
idc = 1604;
onMouseButtonClick = "(lbCurSel 1500) call JC_fn_freezePlayer;";
text = "FREEZE"; //--- ToDo: Localize;
x = 1 * GUI_GRID_W + GUI_GRID_X;
y = 7 * GUI_GRID_H + GUI_GRID_Y;
w = 7 * GUI_GRID_W;
h = 1 * GUI_GRID_H;
};
Why not? Sorry I dont know a lot about scripting with sqf yet 
call takes code as right argument
oooh okay
Ah okay gonna try that, thanks 
@oblique arrow
action="(findDisplay 46) displayAddEventHandler [""buttonDown"",""_this call cts.sqf""];";
// ^^ ^^ ^^ ^^
You also forgot to escape the quotes too, and yeah, call is with a function/codeblock, not a file (you could also do (findDisplay 46) displayAddEventHandler ['buttonDown','_this call cts.sqf']; )
Hi there fellas, I have a small issue with a script using BIS_fnc_spawnGroup:
...
_qrfGroup = [_position, _qrfSide, _qrfTeam, _relPosArray] call BIS_fnc_spawnGroup;
_qrfGroup deleteGroupWhenEmpty true;
_qrfGroup addWaypoint [_destination, 0] setWaypointType "SAD";
systemChat format ["Group count is: %1", count units _qrfGroup];
systemChat ends up returning as 0. Meaning BIS_fnc_spawnGroup doesn't return group to _qrfGroup var.
The parameters for BIS_fnc_spawnGroup are properly filled because it spawns units without errors, so don't bother about those
do systemChat str [_position, _qrfSide, _qrfTeam, _relPosArray] just incase
need to take a look at what that function does exactly in function viewer, and go from there
@fair drum sorry if i bother you again, i did a pause and now im back working on this mission, i still can't figure it out, i tried the first method but i respawn with the default class loadout.
Strangely enough running BIS_fnc_spawnGroup directly from the debug console and filling in the exact same parameters it returns a group
it returns group either way...?
problem is it doesn't have units, or what is the issue again
It returns group when I run it from the debug console but doesn't when from a script
run systemChat str [_qrfGroup] then, and see what you get there, from the script
I figured out the problem. As I added in your above test command, on a whim I decided to comment out _qrfGroup deleteGroupWhenEmpty true; and it works.
Somehow deleteGroupWhenEmpty is running before the units are placed in a group??
@fair drum sorry if i bother you again, i did a pause and now im back working on this mission, i still can't figure it out, i tried the first method but i respawn with the default class loadout.
@obtuse quiver
Standby at lunch. Pm me and I'll walk you through it later
Btw peeps is there a good way to figure out which UI element has which Display ID? I know there's a list on the wiki but I'm not sure which one of those is the spotlight button
I know there's a list on the wiki but I'm not sure which one of those is the spotlight button
๐
I didn't know if you knew where this list was =)
I know where it is and I've looked at it but yeah I'm not sure which ID is the spotlight button
otherwise, you can browse configFile within the gameโฆ and hope to find it quickly
browse confiFile
?
Config Viewer
man why do event handlers have to be so hard to use 
UI is kinda hard to use
Hm do hints work in the main menu?
Because it seems like it only shows errors but not actually hints
Would it be even remotely possible to spawn a light source during the day say inside a shaded building?
propably, yeah
Any idea how? Like if i spawn a light source during the day, it just appears not to be there until night
I just created a tutorial recently :-)
see https://community.bistudio.com/wiki/Lightpoint_Tutorial @sudden yacht
i think i got it thanks guys, thanks to some folks...
@winter rose in your (well made and simple to follow) tutorial you listed, you said Light colour does not affect AI, but ambient does. how does light effect AI?
they e.g spot you at night
ahhh
how does the colour change the fact?
like, does blue light make it easier to see you than red?
or am I missreading this
ambient colour*
I don't know about such specifics though, I don't think it is simulated that far
Hi, is there any way to spawn a car with a specific rotation?
no the rotation/direction needs to be set after it is spawned
@candid cape is there a question there?
Look, I have set the spawn point looking in the S direction and the car spawns in the N direction
Idk why
Here are the graphical tests
@candid cape ```sqf
_veh setDir 180
ok thanks
hey yall i was wondering if i could get some help with working out how to do triggers
i use a starship troopers mod and so far I have managed to spawn in a group of ai with the triggers
however i have no idea how to trigger them to move and attack players once they spawn. Can anyone help me out?
After you spawned the group, make sure you get the group variable or the leader of the group.
With that, simply give them waypoints with addWaypoint
I need to spawn objects in certain locations (can be around 50) if some enemy entered it. What is the best approach to trigger spawn in terms of performance: triggers (event driven approach ??) or loops (while, waitUntil ...) ?
to "wait", an event handler is better (it doesn't wait, it gets triggered by something)
kk, thx a lot
sorry, but I did not find any suitable EH that could trigger an event when some enemy has entered a certain location
I guess , waitUntil is only one option comparing to triggers
you can do waitUntil { sleep <duration>; <condition> }; so the game only checks the condition every duration seconds
so it's not "too often"
while {condition} do {sleep} does the same. Does it work worse towards wait?
it's more readable with waitUntil
(a trigger checks every 0.5s by default)
I was just pointing info, no critics here ๐
that is what I am trying to figure out: what is cheaper. readibility and complexity of conditions is a second question for me ๐
(@tough abyss no I meant that I did not mean what I said as a critique ^^ hahaha we're both on the same page then)
my focus is performance now
promise to write a good doc base in case major goal will be reached ๐
https://community.bistudio.com/wiki/Code_Optimisation ? ๐
@winter rose my second bible
^ this, also sure..a while loop with a long sleep will be the most performant I suppose. Then it's mostly a question of how "fast" do you need to detect that x is close to x
@tough abyss in terms of 3-5 seconds I guess
I would prefer to follow event driven approach and exclude any loops on server side
however mentioned task above can't be solved so easily by events as far as I can see
only loops can deal this
or I am missing something
no events exist about "closeness" of something compared to something else, so I guess waitUntil { sleep 3; leader _group1 distance leader _group2 < 100 };
that's what I would do ๐
you can also use waypoints, but be wary that WP effects are executed on every network machine
could CBA help me with this? I heard they have some extended EHs
I guess they would have scripted EH, but that would be the same
though I think if it is a distance check, the waitUntil is only a fraction of a pebble in your shoe; "don't optimise prematurely", make things work first ๐
ok, I see. Thanks for recommendations ๐
is it possible to transform a direction from 360ยบ to a vector dir?
[sin _azimuth, cos _azimuth, 0]
???
thanks
Hello, when testing this vehicle flip script on single player and multiplayer, everything works fine. However, when I try the script on a dedicated server it doesn't work at all. Does anything stick out that may be causing the problem?
_vehicle addAction ["Flip vehicle",{ params ["_vehicle", "_caller", "_actionId", "_arguments"]; _normalVec = surfaceNormal getPos _vehicle; if (!local _vehicle) then { [_vehicle,_normalVec] remoteExec ["setVectorUp",_vehicle]; } else { _vehicle setVectorUp _normalVec; }; _vehicle setPosATL [getPosATL _vehicle select 0, getPosATL _vehicle select 1, 0]; },[],1.5,true,true,"","(vectorUp _target) vectorCos (surfaceNormal getPos _target) <0.5",5];
you mean the action doesn't show up at all or setVectorUp has no effect?
on a side note i ran into a similar problem a while ago with locally hosted server. setVectorUp and remoteExec just refuse to work. you can try remoteExec ["setVectorUp", 0] (it worked for me)
@tough abyss The action is not showing up at all ๐ฆ
have you double checked the action is indeed added for the player?
addAction is a local command. Where are you executing that code?
https://community.bistudio.com/wiki/selectWeapon
says you can also switch muzzles - but doesnt seem to work with grenades (in A3). special case?
Whats the full syntax you have tried for that @velvet merlin
player selectWeapon (currentMuzzle player)
hmm did you mean gun fired grenades or handgrenades?
@velvet merlin it might be possible it is a special case,
before A3 the grenade was a weapon selected with "F", since A3 it is "G" (Ctrl+G in my case, to prevent happy little accidents ^^)
the underlying issue is that if you have two grenade types, throw the last one of one type, it may not auto select the muzzle of the other
as grenades are not shown as weapons in top right (unless you use them), you also dont know whats up
to fix it you have to switch the grenade muzzle via the extra action
selectWeapon "Throw"?
still doesn't allow you to change the exact grenade type, but it should switch to the grenades
If we are by any chance ever getting createNamespace can we get the option to get a parameter or something to have a local only one and a public one, shared on all clients + server
I don't think we will ever see such a thing, honestly! remoteExec and setVariable (public) ftw
If we are by any chance ever getting createNamespace
unlikely, and if, then local only in form of a hashmap
CBA_fnc_createNamespace works perfectly fine
Anyone know how Eden enhanced actually adds it's attributes and things to the description.ext? I never see any overwrites or anything.
it adds it to mission.sqm, either as an Attribute or as an CustomAttribute
or what kind of attributes are you talking about?
eg. stuff which you can add to your description.ext are by default in mission.sqm as well, under class ScenarioData
things like save loadout, or when it adds respawn templates and such. just always wondered.
CBA_fnc_createNamespace works perfectly fine
it does but it does not mean it's kinda hacky on the insides.
oh okay. didn't know you could do description.ext stuff in the .sqm
you can't, it's using mission attributes
and some stuff can be set in them too.
if I wanted to remoteExec to only players that are in say... a helicopter at that point, how should I go about collecting the arrays of the clientIDs in that heli currently so that I can place them in the remoteExec? I know I have owner to work with, just haven't figured it out yet.
OOHHHH NOOOOO I'm a dumb dumb. ty
๐
Hi, are there any problems reported yet with adding a backpack to a backpack via https://community.bistudio.com/wiki/addItemToBackpack ?
why what you running into?
I want to copy a backpack inventory to another backpack. Unfortunately I cannot add a backpack to a backpack with that command.
just get an array of all the items of the current back pack
delete that backpack
create new backpack
add items to new backpack
Meant backpacks in backpack?
you cannot put a filled backpack into another one
but you can put an empty one, for sure
but you can put an empty one, for sure
@winter rose Thats what the purpose of this is
Get the bigger backpack of those two and copy the inventory of the smaller backpack to the bigger one
no, wait, are we mixing two things here?
Get the bigger backpack of those two and copy the inventory of the smaller backpack to the bigger one
@dim owl + the backpack itself
you can copy backpack 1 content into backpack 2, no problem
you want to add backpack 1 inside of backpack 2, ok - but add an empty one
yeah that's what I'm trying to do
is this new backpack going to be something the players pick up off the ground?
Let's assume backpack 1 content contains an empty backpack. It cannot be added with the mentioned command.
{player addItemToBackpack _x;} count _itemsBackpackBackup;
is this new backpack going to be something the players pick up off the ground?
@fair drum No, it's directly added to the player
private _items = backpackitems player;
removebackpack player;
player addBackpack "backpack";
{ player addItemToBackpack _x } forEach _items;
something like this?
Yeah but in that _items array there is a backpack
have you tried addBackpackCargo?
so.... player has a backpack that is FILLED. you then have to take out those items, put them in the new backpack, and THEN add the now empty backpack.
is that what you want?
have you tried
addBackpackCargo?
@winter rose Would that work with all the other items to?
is that what you want?
@fair drum Yes
nope, but you can make an exception for the backpack
I've tried adding that backpack with that command and it worked. Thanks!
private _oldBackpack = backpack player;
private _items = backpackitems player;
removebackpack player;
player addBackpack "newbackpack";
private _newBackpack = backpack player;
_newBackpack addBackpackCargoGlobal [_oldBackpack,1];
{ player addItemToBackpack _x } forEach _items;
well guess you got it to work, just did this so might as well hit enter
Okay thanks, yeah it's the same command for the backpack to work
Is there a script of some sort to allow helicopters to not explode when they touch an object slightly. You know to keep them a bit realistic and some survivability? Please @ me if you do have something.
could do something like set the vehicle to invunerable at a certain height off the ground
but if its tapping a tree while at flying speed, I'm afraid you're dead lol
@onyx gust โ
so when I use titleFadeOut, it doesn't seem to work. it just instantly disappears.
params ["_group"];
sleep 10;
[["<t size='2.0'>Welcome to Virolahti</t>","PLAIN DOWN",2,false,true]] remoteExec ["titleText",_group];
sleep 5;
[5] remoteExec ["titleFadeOut",_group];
Thank you!
well it looks like i need a sleep after the titlefadeout because the next line runs too fast
which is why it looks like its skipping
most likely because remoteExec order is not guaranteed*
maybe a way to waitUntil?
or actually, what's that other text command where you can set specific times to it?
or if it is intro, put it in init.sqf
that or make a function and remote call it
does playSound3D have the same attenuation problems as say3D?
hello guys, does anybody know how to disable the automatic getout command if the vehicle get damage?
nice thanks
@pure blade note that unless they are in combat mode, the crew will often turn out when that command is true
alright thx for the information tankbuster
๐
Hey, comrades, have anyone invnted a way to remove vest with the gear or put something inside?
Hey all, I was wondering if there is anyway to execute a function and then have it wait until the function is completed to continue on down
@calm bloom look a few messages up, same thing but with back packs
@crisp cairn place a global variable in your function that you can have the last line make it true, then do a waitUntil { globalvariablechosen} in the original script (probably not efficient at all)
@crisp cairn call? ^^
backpacs are objects and vests and uniforms are not(
Ok but thanks
i think i can create vest on player
or add items into it
event handlers added to objects are destroyed upon death/respawn right
say the player has a fired event handler attached, it gets destroyed after dying?
Im currently in the midst of converting one of my files to SQF and Im not sure if im on the right track or not
Does this look right to someone?
_camera = "camera" camcreate [3695.91,3610.04,2.00]
_camera cameraeffect ["internal","back"]
//=== Create Camera End
//=== Intro Start
//comment "shot1";
"_camera camPrepareTarget [98811.75,31889.47,-17641.03]";
"_camera camPreparePos [4344.96,4351.77,5.35]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0"
@camCommitted _camera
sleep 3;
//comment "ots shot2";
"_camera camPrepareTarget [99630.33,-20204.76,-17641.36]";
"_camera camPreparePos [4345.74,4353.17,5.18]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0
@camCommitted _camera
sleep 3;
player cameraEffect ["terminate","back"]
camDestroy _camera
- Missing ; (semicolon)s
- "_camera ~~~" remove these quotation marks
- @ isn't a thing in SQF. Use
waitUntil
Just in general where am I missing semi colons? Im not exactly sure where to distribute them
@topaz field (see pinned message to see how to format in Discord)
//=== Create Camera Start
_camera = "camera" camcreate [3695.91,3610.04,2.00]
_camera cameraeffect ["internal","back"]
//=== Create Camera End
//=== Intro Start
//comment "shot1";
"_camera camPrepareTarget [98811.75,31889.47,-17641.03]";
"_camera camPreparePos [4344.96,4351.77,5.35]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0"
@camCommitted _camera
sleep 3;
//comment "ots shot2";
"_camera camPrepareTarget [99630.33,-20204.76,-17641.36]";
"_camera camPreparePos [4345.74,4353.17,5.18]";
"_camera camPrepareFOV 0.700";
"_camera camCommitPrepared 0
@camCommitted _camera
sleep 3;
player cameraEffect ["terminate","back"]
camDestroy _camera
```you have quotes all over the place ๐
[bns_vars,...] spawn bns_fnc_aaa; //bns_vars: public var.
//fn_aaa.sqf
_array = this select 0; //bns_vars
...
publicVariable "bns_vars"; //used in other scripts
....
{
....
} forEach _array; //forEach bns_vars
This script is run by server side. Any difference btw forEach _array and forEach bns_vars?
a "faster" access to the value (local var is faster than global var, no other scopes to explore)
also, _this select 0โฆ use params ๐
and coding-wise, the code is not dependent anymore on the variable name
so you can rename it bns2_vars and it will still work!
@quasi rover โ
Thanks, please tell me what it means in detail?
and coding-wise, the code is not dependent anymore on the variable name
so you can rename it bns2_vars and it will still work!
@winter rose
if you send a parameter to a function, the function doesn't have to know/doesn't care about what its name is
if you renamed bns_vars to e.g bns2_vars, you would have to rename it everywhere! whereas this function can work with all the functions you want if you use params
you mean,
//fn_aaa.sqf
params ["bns2_vars"]; //bns_vars
...
publicVariable "bns2_vars"; //used in other scripts
....
{
....
} forEach "bns2_vars"; //forEach bns_vars
no
I mean```sqf
params ["_myIterationVar"];
{
} forEach _myIterationVar;
which you can call with
```sqf
[bns_var] spawn BNS_fnc_myFunction
```or```sqf
[anotherVar] spawn BNS_fnc_myFunction
```or```sqf
[["my", "own", "array"]] spawn BNS_fnc_myFunction
params ["bns2_vars"]; invalid, params needs to be local variables
forEach "bns2_vars" invalid, forEach doesn't take string
he is a real-life compiler
//fn_aaa.sqf
params ["_myArray"]; //public var.
...
["uniqueID", "onEachFrame", {
{
drawIcon3D [
];
} forEach _myArray;
}] remoteExec [ "BIS_fnc_addStackedEventHandler", -2, true];
Is it work for every client? do clients know the _myArray value? @winter rose
nope, it's a new scope
No they don't, undefined variable
but I think to StackedEH you can pass parameters? So you can probably pass it as param
So in this case, forEach bns_vars is right? because it was publicVariable "bns_vars"
then yes, for an eachFrame
Thanks guys. ๐
#define CONCAT(ARGA, ARGB) ARGA ## ARGB
CONCAT(A,B)```
What is this actually inflating to?
`AB` or `A B`?
(CONCAT(ARGA, ARGB) no space before ARGB though?)
not sure what you try to tell me ๐
with spaces
I used spaces once (with this voice thing I posted in #arma3_config) and it added a space before the text ๐ค
Is there any way to get the player profile goggles/face?
Alternatively, check if you're in the main menu
//=== Create Camera Start;
_camera = "camera" camcreate [3695.91,3610.04,2.00];
_camera cameraeffect ["internal","back"];
//=== Create Camera End;
//=== Intro Start;
//comment "1";
_camera camPrepareTarget [-17086.25,-92052.84,-18439.74];
_camera camPreparePos [4351.45,3820.57,2.16];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};
sleep 3;
// comment "2";
_camera camPrepareTarget [-17086.25,-92052.84,-18439.58];
_camera camPreparePos [4369.57,3829.97,1.49];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};
sleep 3;
player cameraEffect ["terminate","back"];
camDestroy _camera;
@winter rose Thats how you want it to look?
kk
so the code outputted is correct
That format for when I next do it?
@topaz field it is properly formatted in Discord,
and it seems functional for Arma 3 yes? ๐
player cameraEffect ["terminate","back"];
// โโโ I think
_camera cameraEffect ["terminate","back"];
I tested it hours ago. I havent touched it since but when i ran that current version I had no errors pop up upon me loading in on my character
I'll have a fiddle again
But essentially no errors but didnt work
No such thing as client public variable?
Does it enter the cutscene mode and cut between the two shots? @winter rose
I put it in my mission file that runs on stratis and im calling it through a player int sqf this execVM "intro.sqf";
I just ran it and it just went into the player view (just the standard one with your firearm)
not the cinematic view
don't put it in the init, or set some delay in the script (like sleep 0.01) @topaz field
you think It would be fine it put it in activation of a trigger? @winter rose
yes, but you would have a 0.5s delay
I would have? or need to implement a 0.5s delay?
I just removed it an executed it from a trigger and unfortunately no cigar
then something is wrong - not intro.sqf.txt by all chances?
You asking if I have the incorrect file type?
maybe*
file directory states it as a SQF File so I dont believe so
wrong directory maybe? not the good mission loaded?
I have it in the correct mission
Let me check if
Let me see if it works when I dont have CUP units, weapons and vehicles loaded
I doubt like everyone has said but best to try
Okay thats odd
It works now
But thats when those mods are not loaded
Also doesnt work when I call it through a trigger (via a radio ) only works when I call it in the int
So trigger isnt working but it works when called via int
Good old cup the culprit :)))
*magic* it is then
I will have to try one day
You think If I repair the mods and verify my game data it will do anything?
๐ฎ perhaps
I have no idea what causes this behaviour
one of the people in the cup discord recommended I do that before I came here a couple of days ago
I'll take it back to them
@winter rose How would i go abt making one?
making oneโฆ?
a global variable?
MY_GlobalVariable = ["it", "works"];
```ta-daa
@tawdry harness โ
No thats no what i mean
That's global to everyone in the mission
I want it global to the client
same variable but different for each client
MY_GlobalVariable = ["it", "works"];
```is global on the client. It is not *public*
is
#ifdef something
#ifdef something else
#endif
#endif```a thing nowadays? just saw some a3 file that actually had an include guard and additionally more includes later down the line
a working preprocessor? inconceivable
more like: would mean i have to remove the restriction from sqf-vm
can still remember that i have had added that due to bugs with empty files caused by this
Did anyone else have a problem that if the first call to extension is RVExtensionArgs, the argsCnt argument to it is incorrect?
Didn't notice that and haven't heard about it
I'm trying to develop an extension in Rust.
If I make the first call to extension as:
"dynops" callExtension ["echo",[123,123]];
argsCnt is given some random value, e.g: 1679332212738
All subsequent calls are fine.
If I make a non-parameterized call (e.g. "dynops" callExtension "echo"), then call the parameterized version, everything is fine too.
Ok, figured it out - int argsCnt is 32-bit in Windows 64-bit build, I have expected 64. Case closed
there a EH for when a player changes from FPP to TPP?
is it possible
to mount static weapon with attacho on top of tank,so commander can use it?
while he is turn out
directly no, you can't... But I might have an idea...
Try to spawn ai inside the turret and make the ai invisible, then use takecontrol of that ai, you also need to add the support to "leave" from the turret
Another way would be to create client mod that would make the turrets so that you can remote control them via uav functionality
dammit,thanks anyways
[] spawn {
while { sleep 0.5; true } do
{
private _grenade = createVehicle ["GrenadeHand", ASLToATL eyePos player, [], 0, "CAN_COLLIDE"];
_grenade setPosATL ASLToATL eyePos player;
_grenade setVelocity (vectorNormalized
getCameraViewDirection player vectorMultiply 50); // set speed here
_grenade spawn { sleep 4; deleteVehicle _this };
};
};
```@humble bridge
not the best optimised script, but will do the job nicely
I simply have to copy-paste it in the console?
and which grenade type it will use?
typical boom grenade
(and doesn't explode)
the RGO one
use "GrenadeHand_stone" if you want to throw rocks ๐
is it possible to make it always a RGN grenade?
since they fly in "better" trajectory and further than RGO
yes; use "mini_Grenade" instead of "GrenadeHand"
use
"GrenadeHand_stone"if you want to throw rocks ๐
@winter rose Huh that exists?
oh yes ๐
for cave men
they don't deal damage, but civilians can even throw them iirc

Do they exist as an actual inventory item or can they just be spawned by a script?
they do exist; crate addMagazineCargo ["HandGrenade_Stone", 50];
๐ boots up arma
this will simplify my life a lot
(or for "_i" from 1 to 10 do { player addMagazine "HandGrenade_Stone" }; @oblique arrow)
jeez Lou the fancy scripter 
Btw since I'm already here, any chance anyone knows if the connectToserver command shows errors if the server isnt avaible/the password doesnt match or something like that?
they sound "cling" when thrown, and make a "boom" sound without damage nor smoke though ^^

with scripting you can prevent the explosion by deleting them
the stones were better in Arma 2 though
it doesn't show errors
it doesn't show errors
oki
they do exist;
crate addMagazineCargo ["HandGrenade_Stone", 50];
huh, they're quite janky but yeah they do exist
Hi, can I get some feedback on my code here?
https://github.com/MidnightGH/Blitz-Gamemode
There are major redundancies I know that much, but I don't know how I would go about cleaning it up or what the fastest solutions are
so far everything runs fine with no major hickups on the client. But I know this can be better and faster. That's kind of what I'm aiming with this. Clean and fast code, runs well with lots of players.
So sad ๐ฅบ, already in bed. I'll try to remember tomorrow, can't pass up a chance to complain about code ๐ฉ๐ช
Oh god, please go easy Dedmen. You'll definitely smite me for this
@winter rose, thx again for your grenades script!
simple thing for you, yet very important for me and for whole community, if after considerable help of this script, a lot of objects get fixed by devs
Hey everyone, I have a problem again. So.. While running an outro scene with cams etc I want to activate a trigger with createunit in the trigger area. But somehow the trigger does not fire while in the camera. Without the camera the trigger works perfect. sqf if (isServer) then {_unit3 = (createGroup [WEST,true]) createUnit ["mac_private",getMarkerPos "hidemrk3", [], 2, "NONE"]};
The thing I want to achieve is: The trigger fires and a show module unhides some stuff
if you are scripting, why not use hideObjectGlobal?
Well it's a lot of units and objects :x
or can I unhide stuff inside a trigger with hideObjectGlobal?
sure thing
activation:
blahUnit hideObjectGlobal true;
deactivation:
blahUnit hideObjectGlobal false;
ยฏ_(ใ)_/ยฏ
or the reverse however
sure but how does one implement a triggerArea in this?
you mean like, get the size of the triggeR?
triggerArea trg1 hideObjectGlobal false;```
thisTrigger is a variable that can be used in any of those fields to reference the trigger
might this be the way? xD
you trying to hide everything in the trigger? because that's not what triggerArea does
Everything inside the trigger will be hidden at mission start. Then when the outro runs, I have 3 areas where I need stuff to show again
or rather, unhide everything in the trigger? Lol
yea exactly ๐
I have tried syncing the objects to the show module and syncing the show module to a trigger but nothing I have tried worked
{
_x hideObjectGlobal false;
} forEach thisList;
{
_x hideObjectGlobal false;
} forEach triggerArea trg1;
``` ?
nada.
thisList contains anything inside the trigger based on activation
thing Is I don't activate the trigger
the trigger will only be there to "select the objects" inside the trigger
If you know what I mean
is the objects inside the trigger always the same?
in that case, just make an array of objects to unhide when the intro starts.
Yep, they don't move or will be added or deleted or whatever
It's about 100 objects ๐
if(intro_started) then {
{
_x hideObjectGlobal false;
} forEach [obj_thingy1,obj_thing2];
};
๐ฎ
it's kind of a flashback of the campaign my milsim unit played
like 3 missions out of 14
there has to be a way to unhide all objects inside a trigger area right? we just need to figure out how ๐
yep
{
_x hideObjectGlobal false;
} forEach (list trg1);
list does the same thing when you're not using the fields.
objects as in mission objects, or units too?
objects like h-barrier and units
I'll try your option quickly, brb !
run that on the server btw.
will do
oh one more thing, if I have a helipad (invisible) inside the area and have the camera target set to it, will it screw it up? xD
should be able to tell where it is, even if it's not visible.
Well, that didn't work. FYI all the units inside the trigger are synced to a hide module in the editor
Might this be bad?
Do I have to set the Act Cond to Anybody?
I think if you have them synced to units they become the only activation? Idk forsure.
I would just hide them all at the start with a script instead of the module
yea I'm hiding them now with ```sqf
{
_x hideObjectGlobal true;
_x enableSimulation false;
} forEach (list scene1trg);
and unhide them with
```sqf
{
_x hideObjectGlobal false;
_x enableSimulation true;
} forEach (list scene1trg);
I will try it and report back
disable object collision in addition to rendering. , don't think enablesimulation is necessary
I tried ```sqf
{
_x hideObjectGlobal false;
} forEach (list scene1trg);
so what exactly needs to happen before they become visible again?
the camera passing over?
I'll check if it works and send it to you then
๐
So I had to change it to ```sqf
enablesimulationGlobal
does anyone know how to update credits after it's already called? I want to players to be able to return supplies back to base and have the factory (created from AdvLog_fnc_factoryInit) update by adding credits.
[flagfac, credits] call AdvLog_fnc_factoryInit;
Okay Midnight, it works very well now, except I think something with the simulation is wrong. since when the scene starts, all enemy units are already dead
I put ```sqf
{
_x hideObjectGlobal true;
_x enableSimulationGlobal false;
} forEach (list scene1trg);
{
_x hideObjectGlobal true;
_x enableSimulationGlobal false;
} forEach (list scene2trg);
{
_x hideObjectGlobal true;
_x enableSimulationGlobal false;
} forEach (list scene3trg);
in the initserver.sqf. Is it necessary to be put in the initplayerlocal as well? or would the init.sqf be enough?
hmm, no. initPlayerLocal is only local to player
disabling and enabling simulation wouldn't kill the units either
they just freeze
somehow they just killed each other while hidden
yeah it might be that your AI behavior is still running despite simulation being disabled
so they are fighting each other while hidden? xD
HAHAHA
could someone help me a bit with trigers?
So I guess I'll disable the damage for all of them lol
Describe your problem Ukraine
im trying to get a triger to activate when bluefor enters it, when activated, it makes some csat boyoes get into a truck and go to a locaton
i cant send screenshots
can i send in DMs?
Set your Trigger as following:
Cond: this
Type: Skip Waypoint
Act Condition: BLUFOR
Then rightclick the trigger, select Set Waypoint activation and click on the waypoint that has to be skipped
Choose Skipwaypoint
yup
Why not just put them in the truck from the start?
Greetings everyone. I have been told this is the place to ask for help when it comes to scripting in arma3. I am quite new to the scripting & mission making side of arma 3 and at the moment i am working on a mission where i want new tasks to show up when the players find specific intelligence folders. I got the intelligence folders working already and the folder itself will despawn once it has been searched. Basically what i want to add to that is a trigger that looks if the specific folder is still on the map and if the folder is gone, it adds a new task on the map but i am not sure how this would work script wise and if it is even possible? Could anyone possibly help me with this? Thank you in advance!
If you use BIS_fnc_holdActionAdd on the object you can use createTask in the 'codeCompleted' parameter to create a new task (see example 2 on the wiki).
It is possible to use triggers for this, but that would require even more (complex) coding.
plus holdActions have nice looking UI
Thanks for the fast replies. Would it be possible to create multiple tasks with that? Right now i have it so that 3 tasks should get created with that single intel pickup
you can use createTask as much as you want ๐
wonder how many tasks you can create without it hitching on performance. Especially the ones that have 3D Markers.
great. Kinda silly question but which wiki are you referring to. I am looking at the wiki of Bistudio.com right now but am a bit clueless on what to exactly look for
and all of this should be put in the codecompleted?
right now i have this in the completion: hint"You have found information about 2 new resource nodes, and an military outpost. These have been marked on your map."; deletevehicle intel01;
so after the deletevehicle intel01 i put in the createtasks
Would it be okay for me to DM you @exotic flax I'd like to show you something and explain it a bit better of what i am trying to do
as to prevent me spamming this channel
Does anyone know where I can find the weapon modes for weapons? Like "SemiAuto" "FullAuto" "GL" "Safety"
I'm using CBA and I'm trying to force the player weapon mode in a certain trigger area to be locked on safety, until they leave the area.
hint str (getArray (configFile >> "CfgWeapons" >> currentWeapon player >> "modes"));
could always just override firing the weapon when in an area.
Would it be possible to script a timer that deletes ACE arsenals after itโs expired? How would I go about doing that?
/* add all your arsenal stuff here*/
_yourBox spawn {
sleep 120; //two minutes
[_this, true] call ace_arsenal_fnc_removeBox; //remove arsenal from box
};
https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-
discord supports sqf
ยฏ_(ใ)_/ยฏ
Ahhh crap I was afraid of what I'd see when I debugged the weapons modes.
welp cool cool.
if(canSuspend) then {
waitUntil{!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler["KeyDown",
{
params["_disp","_key"];
if(_key in actionKeys "Fire") then {
if(player inArea "nofirezone") then {
if(currentWeaponMode player isEqualTo "FullAuto") then {
true;
} else {
false;
};
};
};
}];
};
something like this idk
make a marker named "nofirezone". Should work.
basically just overrides the key if they have full auto and are in the no fire zone
Well the thing is I'm trying to prevent my cuckhold friends from shooting each other and throwing grenades at each other while we're doing briefings and what not :D
yep, just place a marker named "nofirezone" (not the text, the variable name) over the briefing area
if(canSuspend) then {
waitUntil{!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler["KeyDown",
{
params["_disp","_key"];
if(player inArea "nofirezone") then {
if(_key in inputAction "Fire" || _key in inputAction "Throw") then {
true;
};
};
}];
};
this'll cover it completely.
I mean, beats what I was gonna do, I'll give er a try.
You ever go into BI inputActions and wonder why they named the things they did?
Fire Weapon, class name is "defaultAction"
No because the action "fire" is for commanding your team.
Oh I'm getting a generic error in expression..
Where though
https://community.bistudio.com/wiki/inputAction/actions, you can find them here.
name is defaultAction though you're right
probably: if nothing else. Shoot at it.
Yeah, changed all that however whenever I press G or Shoot now, the error pops up
what error.
generic error in expression, it's in the if statement for input actions.
oh, duh. Hold on
if(canSuspend) then {
waitUntil{!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler["KeyDown",{
params["_disp","_key"];
if(player inArea "nofirezone") then {
if(_key in actionKeys "defaultAction" || _key in actionKeys "throw") then {
true;
};
};
}];
};
That's exactly what mine looks like.
actionKeys or inputAction, I don't see anything wrong.
Well now, I haven't tried actionKeys
inputAction was wrong, that just returns the state of the key. 0 for not pressed, 1 for pressed
actionKeys I feel is better because someone can bind their weapon fire button to something else but you can still script functionality to whatever they bind it to
fair enough.
Well it's stopped me from throwing grenades, as for shooting my gun, nada.
Oh, of course. Because the mouse isn't a KEY. AAAh. my brain
Yeah....
I just realized that too lmao
I was like "wait mouse isn't a key"
MouseButtonDown?
yes
not sure if you can override input though
if(canSuspend) then {
waitUntil{!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler["KeyDown",{
params["_disp","_key"];
if(player inArea "nofirezone") then {
if( _key in actionKeys "throw") then {
true;
};
};
}];
(findDisplay 46) displayAddEventHandler["MouseButtonDown",
{
params["_disp","_button"];
if(_button isEqualTo 0) then {
if(inputAction "defaultAction" > 0) then {
true;
};
};
}];
};
would look like this
doesn't look like you can override it like you can with KeyDown and KeyUp
Yeah... hmm..
Can I force an action then perhaps?
ACE has the Safety keybind keys, I can just force that fnc while they're in the zone.
https://github.com/acemod/ACE3/blob/master/addons/safemode/functions/fnc_lockSafety.sqf something in here idk
Nah
Well I have to check if they're in the zone.
Thanks @high marsh
๐
@open star
player addAction["",{},[],0,false,true,"DefaultAction","player inArea 'nofirezone'"];
works great
That's hilarious.
why not do a disableUserInput that has a addaction attached to whoever is doing the briefing? then they can reenable it
because that disables, ALL. user input.
I don't care if they run around or do stupid animations.
I'm just trying to stop them from killing each other.
I mean, if you don't care about ammo. Just disable damage.
even better, just disable damage, and if they waste ammo, don't give them more
make them suffer
ยฏ_(ใ)_/ยฏ
They have access to the Arsenal anywhere at any given time while at base.
I made a Self Interaction to open the Arsenal 
if i did that, ops would take an additional 2 hours lol
Barbie Doll?
my playerbase is pretty dumb
any script to respawn in aircraft carrier well? because if I put a repsawn I will spawn in the water..
Raise the respawn up on the Z axis
If you're using Custom Respawn with something be called "respawn_west" there is only way I know how.
You need some sort of object, that has a Vertical Positional Data, make the Variable Name respawn_west or whatever side you want to respawn.
Then in the special states, you can uncheck, simulation, show model, and damage. then you'll have an "invisible" object that is only there for Positional Data.
private _marker = "respawn_marker";
private _altitude = 15;
_marker setMarkerPos (getMarkerPos _marker vectorAdd [0,0,_altitude]);
``` @thick chasm
thanks @winter rose
@high marsh
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/initServer.sqf#L2
forEach (allUnits - [allPlayers]) might/should work
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_addBlitz.sqf#L2
ParamsArray? wuht?
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_boundary.sqf#L2
add a sleep, checking every 2 seconds is probably fine?
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_nameTags.sqf#L3
Recommended to not be used anymore, use addMissionEventHandler instead, also use Draw3D for icon drawing.
name _x != "Error: No unit"
That bug will get fixed afaik.
nearObjects should be fine, you don't need them sorted.
https://github.com/MidnightGH/Blitz-Gamemode/blob/Development/mid_blitz.Malden/functions/blitz/fn_playerLoadout.sqf#L10
comment does nothing but waste performance, just use //
@still forum paramsArray:
https://community.bistudio.com/wiki/Arma_3_Mission_Parameters#Functions
(use BIS_fnc_getParamValue @high marsh)
@winter rose @still forum Thank you! ๐
@still forum there's a nice transform for your optimiser: strip comment <constant-expression> :p
some binary sqf format > sqf optimizer (as then optimization can be done during binarization)
yeah I'd like sqfc support, but thats very unlikely to happen
thats sad tho
but again, I could easily use SQF-VM to generate code that is optimized
So @high marsh we've run into an issue >:D
When you respawn or die, the action no longer activates.
Right, addAction won't persist. You need to add it on respawn.
Aye, how would I do that.
simplest. Create a file in your mission called onPlayerRespawn.sqf . Its an event script. It'll run whenever a player respawns.
I see.
Hi guys, of what use is BIS_fnc_taskAttack? I can't see any difference between this and simply doing _group addWaypoint [_pos, 0] setWaypointType "SAD"
check if there are any in the Function Viewer? From the wiki, it seems not a lot of difference indeed
Yeah I read the details in the function viewer, I'm just wondering why BI added a seemingly redundant function or maybe they were planning to add more to the function and forgot?
not DLCโฆ it was Arma 2
Makes me wonder if there are other "pointless" functions in Arma's library 
Look at BIS_fnc_selectRandom ๐ (I know this was still a thing because of backward compatibility)
Hello, I tried to use inputAction 'optics' and it never returns anything other than 0
I am unable to determine when the player is attempting to ADS
I need to know when the player is starting to ADS, right when they press RMB, before cameraView changes to GUNNER
Tried opticsTemp?
This is an issue with RMB
Yes, tried all
systemChat str (inputAction 'optics');
systemChat str (inputAction 'opticsTemp');
systemChat str (inputAction 'opticsMode');
Ahh, so this is an issue then? Didn't noticed
I just found out :(, this is extremely disturbing
And looks they're not interested with

ah yes, iirc inputAction on mouse is not followed
Any alternative way to detect when player has started to ADS (before cameraview)
@warm hedge I really like the idea of your "Plane Loadout Everywhere"
But I were wondering if it would be possible to make it compatible with any kind of vehicle (air/ground/water). With the possibility to choose the weapon's loadout from a position ( gunner / cannon / chief crew etc..) like Zeus Enhanced's vehicle loadout but without the charge of being in zeus and making it more consistant in the logistic procedure.
I've got a quick question with a little backstory, I started looking into a negative towards the body armor in my unit's modpack, all of our armor is modified to the point where bullets deal bruises and pain (if that specific body armor can stop the round that's fired at it), but the person usually caries on, even when hit by some really heavy-hitting rounds, keep in mind we use ACE like most other units.
Now, I've thought of a knockback mechanic, that it would do the trick, I want to know if it's doable to create a mechanic such as that.
I figured theoretically, I could link it so that if the caliber is > x, then it would turn the player/AI into a ragdoll state, and bring them back after 3-5 seconds.
Since I primarily do config editing, retexturing and modelling, I was hoping to get an answer from you scripters if such a system is possible, and if you have any tips for creating such a thing, thank you in advance
make it compatible with any kind of vehicle (air/ground/water)
No
@tough abyss there's a stagger mechanic used in Project Injury Reaction that is triggered when you are near explosions, maybe you can look into that. Also, isn't there something like a knockback mechanic when someone gets hit by a vehicle and doesn't die? Although it may need some physics tampering to work for your needs
Hm, didn't know that, will look into, and there is a 'Realistic Unit Ragdoll' mod out there, but it doesn't work as for my unit's needs really
@peak plover maybe add an EH for cameraView that stops camera change, run your script then change cameraView for player? It sounds like a bad idea but it's all I can offer
should I be making functions instead of execVM everything?
if you execVM them once, no issue.
if you do it many times, yes, definitely
execVM reads from the HDD, preprocesses, compiles then runs the code, every time
a function does it all once and only runs the code on further calls
so for something like a script that forces players back into fpp except for when they are in vehicles should be a function if its called in the initPlayerLocal?
since its going to be run a bunch of times?
whatever it does
is it execVM'd multiple times, or not?
or is there a while do loop in there
while { sleep 0.5; true } do {
if ((cameraOn == player) and (cameraView == "EXTERNAL")) then {
player switchCamera "INTERNAL";
};
};
so it is execVM'd once
but i'll have to run it on initplayerlocal and in onplayerrespawn right? does it go away in the initplayerlocal if they die?
Isn't there a setting specifically for what you're doing.
only in dev branch
That allows third person in vehicles, but is forced first person otherwise.
its not out yet i don't think
I definitely believe it's out, and been out for 2 some years..
It's what I've been doing at least.
thirdPersonView = 1; // 3rd person view (0 = disabled, 1 = enabled, 2 = enabled for vehicles only (Since Arma 3 v1.99))
we are still 1.98 i believe
Mate... we're on 3.0 something.
1.98 release, 2.01 devBranch
Required game version: 1.98.0 is what the up to date server is currently running without dev branch
I garuntee you even on 1.98 that thirdPersonView = 2 ยฏ_(ใ)_/ยฏ
has worked for 2 years.
and I'm not running dev branch.
nor is probably any of my playerbase.
if it did, there would be an option in the custom difficulty menu, right now 3pp is toggle on or off. no sense making it only available to a server config when there are plenty of people that leave their servers on regular then the admin switches to his custom difficulty he set up in the menus
Well if it's any consolation I just checked, and I can only access thirdPerson while in the vehicle, and that's using the custom difficulty setup in server.cfg
Running the latest build, I'm not saying you're wrong I'm just saying it works for me.
my server is 1.98.0
Is there a way to check if any unit within a group has had behaviour changed to combat. Emphasis on any.
Currently the only way I can think of is creating multiple waitUntil threads for each member of the group, but that seems very performance intensive
units _group findIf { behaviour _x == "COMBAT" } != -1
```@potent dirge
Never heard of findIf till now. Thanks ๐
findif is brilliant
takes some time to get it, but it's brilliant, needed, performant and now irreplaceable
ya
ar you missing a select command from that line?
no, you'r e not
just checking ๐
๐ป
note that Lou's code will return the first group member that is in combat mode
not all of them
units group select {behaviour _x == "COMBAT}
will return all
my code will return true or false, that's it
Thanks alot guys really made my life easier
One more thing can breakTo be used in a switch-do structure?
omg
what exactly are you trying to do? (it should work, but should you do it this wayโฆ)
ive never used breakto and once said it was bad practice. killzonekid told me off
Trying to evaluate the typeName of a parameter and execute a code block depending on what type it was. I'm guessing breakTo is a bad idea
use isEqualType
yep
if (_var1 isEqualType 0) then
{
hint "number";
} else {
hint "NaN";
};
Thanks
Quick question. In a case where I had more than two possible cases how would I use breakTo without chaining ifs
use select like i wrote earlier
that will return an array of all the group units who are in combat mode
When i try to add tickets to the players with "[west, 5] call BIS_fnc_respawnTickets;" it works completely fine but if they're out of tickets and it says "no respawns available" and then i add the tickets they still can't respawn... Anyone know a fix?
it comes up with an error saying something about _deathtime being missing
and when I try to use setPlayerRespawnTime 5; it ignores tickets completely, letting you respawn even if you have none
@finite sail oh no this isn't concerning the group behavior it's evaluating a function parameter whether the parameter is of type group or type object/unit and running a particular code block depending on which
ok
I think I might be using breakTo like goto which is why it's not working. Can breakTo jump to code that is ahead of it?
surely you can only breakto a code that already defined?
so, not ahead of it
or are you using it in a loop?
No not in a loop
it cant be defined than
@potent dirge breakTo goes to a scope, not a specific line
Is there a goto alternative for sqf?
ab-so-lutely NOT
like, don't.
Think of the raptors!
these ones https://xkcd.com/292/
There really is an xkcd for everything
but yeah, don't use goto, 99.9999% of the time it is not needed
structure the code in a better way instead ๐
Alright I'll figure something out
you should structure your code
coming from 1990s BASIC, it was a heard lesson to learn
QBASIC was my first language, so I know your pain kind of
could someone help me with tickets plz ๐
no bump every 10 minutes! 
add the tickets before they reach 0, I suppose
I don't think this system has been thought to work the way you want to
I've seen other groups have it work this way but just don't know how to work arount it myself
also it was 26 minutes after my first message
still
Well, wait for people who know how, because I don't
I figured it out. I used a function within the function, works great. Thanks guys
Does anyone know if it is possible to change the player's name in the top right of the map?
it might be, through idd 12
what do you want to set?
I want to change the players name to a custom string
I tried
class RscDisplayMainMap {
class controls {
class TopRight: RscControlsGroup {
class controls {
class CA_PlayerName: RscText {
onDraw = QUOTE(_this call FUNC(mapPlayerName));
};
};
};
};
};
but no luck so far
tried onDraw and onLoad
The function is just
params ["_control"];
_control ctrlSetText "My String";
wait, where did you put this
config.cpp in an addon
oh
that IDK (and that would then be #arma3_config)
#arma3_scripting-wise, use https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#Map with findDisplay and controls to grab the control and set its text
ah ok, so do I repost this there then?
unit setName [name, firstName, lastName]; changes that name (the one on the map too), but not the rank.
let's delete everything from here then
setName doesn't work in multiplayer
?
In Arma 3 this can be used to set name of a person but only in single player.
Curious and unfortunate.
Very
Is there a way to get the local player's steam ID without having a player object? Like from the main menu
getPlayerUID only
darn, Seems kinda weird to have profileNameSteam but no way to get the ID

๐

I also wanted to use it for something in main menu and was bit disappointed it's not a thing.
should just always return local steamid if not in MP
There can be none.
createUnit + selectPlayer = player unit
And how does it help? you still can't get the steam uid
yeah :<
mod the main menu so it starts a local MP server
๐
Not too worried about it though, I was able to get my thing working
The name is set by the engine, couldn't get it to change. So I just hid it and put my own RscText where it was
ez
Hide by putting the control in front of it?
fade = 1;
and while you had a reference to it, you could not change it?
Yeah, I could do ctrlSetText "test" then ctrlText would report "test"
but it would be unchanged
seen it before, it's weird
Weiiird, but hey
I had to do the same thing with https://github.com/synixebrett/a3additionalmeasurements iirc
ah nevermind no I didn't, but I had to do it somewhere before ยฏ_(ใ)_/ยฏ
Hey boys me again, having a little trouble wrapping my head arround some stuff. So. Is there any way currently, to add options to the respawn menu screen, then rather than calling CfgRespawnInventory running a script to add a custom loadout instead? So still use cfgRoles I did notice cfg respawn templates on the wiki but wasn't sure if myTag_beacon referred to role or not. Otherwise I could use on player killed and on player respawn for those selected roles.
I did discover another option, which was to have them select roles based Purley on the name, spawning them with a random item or weapon, then using a script to detect that item to choose which script to run to deppy the custom loadout, as seen here: https://youtu.be/3-igwA8JBm4.
Though ideally the above method, if possible, would be prefered.
Put simply, I'd like to use the loadouts exported from the virtual arsenal, in my missions, avilable from the loadout selection menu on respawn, without having to join and use the zeus feature to add avilable loadouts.
I have ofc discovered using add actions to do this in onPlayerRespawn, but its buggy and rather inconvenient
I am hoping someone here can save me some sanity. I am trying to give all players in my mission an addAction. I have not had much luck getting it to work though. I found BIS_fnc_MP online and even on the wiki for the function it shows adding action for players.
[[player,
[
"<t color='#0000FF'>Play Bonus Song</t>",
{
ROOK_bonus1 = true;
publicVariable "ROOK_bonus1";
},
nil,
1.5,
true,
true,
"",
"!ROOK_bonus1",
50,
false,
"",
""
]], "addAction", true, true] call BIS_fnc_MP;
When I execute this running locally it works for me, but no other players see the option. I also see the option again if I look at the other players. It behaves exactly like just calling the addAction locally. Also this mission will eventually be hosted on a dedicated server if that effects things. Any Ideas on how to get this to show up for all players in the game?
Need help with Warlords! I'm looking to use _truck setAmmoCargo 0.5; to balance out ammo truck spam . Anyone know how this is done from within the mission?
Well, you need to either run the script locally on all clients or globally
I tried all the options in the debug console and they all had the same effect. No one else was able to see the option. The ultimate goal is to have a trigger add it
Does this work?
[
player,
[
"<t color='#0000FF'>Play Bonus Song</t>",
{
ROOK_bonus1 = true;
publicVariable "ROOK_bonus1";
},
nil,
1.5,
true,
true,
"",
"!ROOK_bonus1",
50,
false,
"",
""
]
] remoteExec ["addAction", -2, true];
In hindsight mine isn't going to work for what you want to do, I believe.
*I didn't see that you wanted it added via trigger.
Thank you both. I'll give that a try when I can get my friend to join up to test it
this is a script for a fletchet hydra does anyone have a script that i could use in a similar way for thermobaric hellfires
`_m255 = _this select 0;
_heli = _this select 1;sleep 0.5;
if(alive _m255) then
{
_rand = 30;
_offset = _rand / 2;
_burstdist = 500;
_counter = 0;
_rocketposX = (getpos _m255 select 0);
_rocketposY = (getpos _m255 select 1);
_rocketposZ = (getpos _m255 select 2);
_velm255 = velocity _m255;if(player in _heli && !(isNull fza_ah64_mycurrenttarget)) then {_burstdist = (fza_ah64_mycurrenttarget distance _heli) - 150;};
waituntil{(_m255 distance _heli > _burstdist)};
_rocketposX = (getpos _m255 select 0);
_rocketposY = (getpos _m255 select 1);
_rocketposZ = (getpos _m255 select 2);
_velm255 = velocity _m255;drop [["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 9, 1], "", "Billboard", 0.5, 5, [0,0,0], [0,0,0], 0, 0.7, 0.5, 0, [8,16,24,32,36], [[0.4,0,0,0.8],[0.4,0,0,0.7],[0.4,0,0,0.6],[0.4,0,0,0.5],[0,0,0,0]], [0], 0.1, 0.2, "", "", _m255];
while {(_counter < 70)} do
{
_mpsm = "fza_flec_cluster" createVehicle [_rocketposX + ((random 30) + (random -30)),_rocketposY + ((random 30) + (random -30)),_rocketposZ + ((random 5) + (random -5))];
_mpsm setdir (direction _m255);
_mpsm setvelocity _velm255;
_counter = _counter + 1;
sleep 0.003;
};
};`
I have an issue where addacitons are duplicating themselves and not syncing it's current state to other clients. Im not experienced at all with arma scripting so I can only assume im using remoteExec/ExecVM incorrectly
show me what you got
in my init.sqf I have
_handle = execVM "scripts\dd1\dd1_generic_actions.sqf";
and here is one of the addactions from the sqf im refrencing in the init.
[dd1_multibox_close01, ["Open", {
dd1_multibox_open01 hideObjectGlobal false;
dd1_multibox_close01 hideObjectGlobal true;
(_this select 0) say3D "container_case_open", 5;
(_this select 0) removeAction (_this select 2);
}, [], 6, false, true, "", "", 2]] remoteExec ["addAction", 0, true];
I'm now thinking I'm probably doing some sort of redundancy with exec. (also if this type of script is men't to go to #arma3_scenario please correct me.)
what im trying to find out is how to sync the status of the action to other clients
and addaction is local so I guess im trying to find a roundabout way to making global
the effect I'm trying to do is for example if one person presses a button and it makes a sound everyone else hears the sound
so you want a player to walk up to said box, and when it opens, does a custom sound that everyone can hear?
nah its fine. doing some other stuff rn as well. so the addaction on the box is going to be global. so do your addaction as normal, but with the say3d, that is what you want to remoteExec
i see, and making the whole addaction not exec would remove the duplication issue?
yes so here is what is happening. placing the addaction on the object is global so that is one instance. now when you remote exec it, you are doing "0" which means runs on server AND clients. so now you have 1 instance for the server, and x amount of instances for however many clients there are
so with 20 players, you get 21 addactions the way you do it
i see makes sense
now if you placed the addaction on a player, that would be local
so try rewriting your addaction as normal, explained on the wiki, then when you get to the say3d, put that as your remote exec
Thank for you the lead will do
There a way to make this ignore DLC weapons?
or perhaps another way with this approach?
found it after refining my discord search-foo. _x >> "DLC" is the answer
"DLC" doesn't refer to actual DLC requirements though
post your final line zacho. i like to see answers on here
What would be the best way to make a timer which executes something if its not extended??
For example, I'm making a script which is similar to UT2004 and Overwatch etc that say "double kill, triple kill, quad kill" etc, I have that part working, but I need to make a timer that resets the killstreak count after X amount of time, but I'd like to extend said timer when you actually get a kill, that way 3 minutes later you're not getting a triple kill off someone you killed a while ago.
you using the "killed" event handler?
I have a killed event handler in use in another file which will call the script below that I'm going to add to the comment. Currently it works like this, you get a kill, kill handler launches an external file which has the code below in it, I'm trying to make the code have a timer that gets started after every kill, which will eventually reset the killstreak variable, that all works fine currently, but I'm not sure how to make a timer which can be extended....
//adds to the killstreak variable
_killamounttotalupdated = player getVariable ["killstreakcount",0];
player setVariable ["killstreakcount",(_killamounttotalupdated + 1)];
_killchainsfx = player getVariable ["ALREADYrunningsfx", 0];
//resets the killstreak variable
if(_killchainsfx isEqualTo 0) then {
player setVariable ["ALREADYrunningsfx", 1,true];
sleep 15;
player setVariable ["killstreakcount", 0,true];
player setVariable ["ALREADYrunningsfx", 0,true];
};
//killstreak sound effects that change based on kill number
if (_killamounttotalupdated isEqualTo 1) then {
playsound "killsound_original_kill2";
};
if (_killamounttotalupdated isEqualTo 2) then {
playsound "killsound_original_kill3";
};
if (_killamounttotalupdated isEqualTo 3) then {
playsound "killsound_original_kill4";
};
is there by chance any scripts that you know of using that function that I can look at and study? the wiki entry doesn't tell me a whole lot
interesting.. i'll see if i can't mess around with that and repurpose it at the very least



