#arma3_scripting
1 messages ยท Page 630 of 1
well it shouldn't be
_hordetype is saved as ["string"] in the paremeters yeah but since it is a different trigger i cant really do thisTrigger or something like it
Ever heard of global variables?
if(("Land_PaperBox_open_empty_F" == typeOf _vehicle) && (!(_cartelbld isEqualTo (group player getVariable "gang_name")) || (isNil {group player getVariable "gang_name"}))) exitWith {closeDialog 0; hint "You don't own this cartel area so you can't look in this box!"};
Litteraly trying to figure this shit out for more then 2 hours.
IF item is landpaperbox AND ( Gang name is not the same OR gang is nil ) it should exit the script yet it's not doing it.
23:45:13 "DEBUG: Cartel cap_data value 1: whitefang"
23:45:13 "DEBUG: Group value 1: <null>"
heard yes, used no
_test = 123;
publicVariable "_test";
will be global right?
so the same without _
plus you're confusing it with "public" variables
ahh yeah bind to missionNamespace
@frank ruin the structure of your conditions are wrong
cause I call the get variable on the _cartel
And if no variable it bugs out?
I should check if nil first on getvariable?
Use the alternative syntax for getvariable
Thanks Leopard20, with an format to turn the varnamespace into a string i could save and call that variable ๐
it works right up to the next line which threw another error but thats scripting i guess haha
One question though, how can i save things under a variable as an array? so that if I where to call it using "_allhordezombies = missionNamespace getVariable _hordetype; "
it would output zombie1,zombie2,zombie3,etc
So basically append to global variable
@frank ruin
(!(_cartelbld isEqualTo (group player getVariable "gang_name")) || (isNil {group player getVariable "gang_name"})
your nil check is wrong way around.
lets say the variable is nil.
(!(_cartelbld isEqualTo nil) || (isNil {nil})
but nil propagates, so
(!nil || true)
propagates further
(nil || true)
and futher
nil
so your whole condition is
if (nil) exitWith {closeDialog 0; hint "You don't own this cartel area so you can't look in this box!"};
but no wait, it propagates further
nil exitWith {closeDialog 0; hint "You don't own this cartel area so you can't look in this box!"};
and further
nil
your whole line is just nil
you need to check for nil before you use the variable, not while or after you use it
which is why I told him to use the alternative syntax
Yes I realized I was the biggest of retards.
And if you have trouble figuring out, maybe just write it in a way that you can actually see whats going on instead of cramming everything into a single hardly readable line
if(("Land_PaperBox_open_empty_F" == typeOf _vehicle) && !(_cartelbld isEqualTo (group player getVariable ["gang_name",""]))) exitWith {closeDialog 0; hint "You don't own this cartel area so you can't look in this box!"};
Like @little raptor pointed out alternative syntax ... solves it. feels stupid as fuck. ๐
Thing is out of frustration I just kept adding more shit to it thinking it would fix it ... ๐ Ofcourse it didn't.... ๐
Figured it out already, appending to string
_data = "hello";
missionNamespace setVariable ["YourString",_data];
_newdata = "friend";
_appendstring = missionNamespace getVariable "YourString";
_append = format["%1,%2",_appendstring,_newdata];
missionNamespace setVariable ["YourString",_append];
_yourString = missionNamespace getVariable "YourString";
_yourString;
appending to global variable*
what??
how about
YourString = YourString + "," + "friend";
๐
Well, that is a whole lot easier
I tried to search and did asked but it got burried under a bunch of text so I figured Ill search for my own solution hence the frankenstein script ๐
you don't need setVariable for missionNamespace (unless you want to public it)
missionNamespace is in most cases the current active namespace, so all non-local variable names go to it
public as in globally accessible by any other script? ( because thats what i want indeed )
no
accessible on all machines on the server
public means across network
missionNamespace is already global (but only on your computer)
Actually YourString = YourString + "," + "friend"; is the same as _append = format["%1,%2",_appendstring,_newdata];
Regarding making it not public, how does that work?
it's not public by default
it's only public if you "publicVariable" it
or set the public flag in setVariable to true
I'm not sure what you're trying to do though
What's the point of that string operation again?!
I can see i got you confused, Barebones: one trigger spawns zombies ( using a script exevm) and puts them under a global variable array. another trigger purges them by using that same global variable and a foreach {}
ok, what does it have to do with the strings?
YourString = YourString + "," + "friend"
was this for "testing"?
yeah, the entire thing was for testing to save all the zombies under an array that can be read using a foreach
save all the zombies under an array
you're using strings here!
I didnt got to the foreach part so i probably would've figured it out then (but i didnt till so far) in that case YourString = YourString + "," + "friend"; from dedman would be preferable as it doesnt saves them as strings ๐
yes it does
_data = "hello";
missionNamespace setVariable ["YourString",_data];
_newdata = "friend";
_appendstring = missionNamespace getVariable "YourString";
_append = _appendstring + "," + _newdata;
missionNamespace setVariable ["YourString",_append];
_yourString = missionNamespace getVariable "YourString";
_yourString;
Thanks Dadmen ๐
dude this is still a string
wtf
I am at a loss, how would i not save it as string?
ignore the _newdata = "friend"; stuff by the way
You use append/pushback to add data to it
Welp, i didnt knew arrays existed
, i didnt knew arrays existed
you mentionedforEach
What did you think it operates on?
https://community.bistudio.com/wiki/forEach
Or actually, i meant i didn't knew specific methods for arrays existed so i was fiddeling things together in a weird way
because yeah i knew arrays existed but no way to append
Well how did you expect to get array from string?! (I mean it is possible but not like what you did)
anyway, read those wiki pages on arrays
You're gonna need them
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
just bookmark this, if you don't know if something exists, just search
Oh i know that page ๐
But you don't know google well enough
I just didnt thought to look for append, i dont know why because thats exactly what i asked here before
Lets not go off on assumptions Leopard20, i get it was stupid of me but im not that stupid.
I think what you actually want is pushback tho
Im gratefull for the help but I dont like people throwing that sort of stuff at me. That really invokes toxicness and thats one of the worst kind of things that can happen to a community.
Anyhow, Ill use pushback, thanks for the help ๐
For whoever wants to have a zombie horde module with more options then ravage or ryan's ( which I think both can be used with the script ) feel free to use this:
The parameters for the trigger are:
//On Activation Example: [0,"mixed",1,2,"horde_marker_1","horde_stop_1",10,5,thisTrigger] execVM "Environmental\HordeSpawner.sqf";
//Parameters [HordeTotalSize,"HordeType",HordeSpawnIntervalMin,HordeSpawnIntervalMax,"HordeSpawnMarker","HordeStopTrigger",HordeSpawnRadius,HordeMaxSpawned,"HordeID"]
Apart from the activation trigger there also is a StopHorde Trigger, a reactivate horde trigger & a stop + purge trigger.
And yes, apart from not being able to google append I did everything in that script using google to learn it + previous experiences ๐
Feel free to throw some salt my way i guess ๐ฅณ
Im having issues trying to send data from our mission file to our server side addon on load of the server. We are using a publicvar in the initserver.sqf file but the server addon functions dosnt seem to pick up it up until its too late and the functions have executed. any thoughts on what we are doing wrong are appreciated.
our server side addon functions are initiated via postinit.
Anyone got a link to any resources on adding/editing entries to the Field Manual? Not having any luck on the wiki.
have you used search?
https://community.bistudio.com/wiki/Arma_3_Advanced_Hints_(Field_Manual)
@lucid shale initserver runs on server. Why are you worrying about sending data from your server to your server?
Is there a guide on making buttons appear on the pause screen? like the settings buttons some modders have for their mods?
@still forum we want to specify some settings in the mission file as it may change from mission to mission but the server addon stays the same. The server addon calls a bunch of functions on postinit and we want it to pick up our desired changes before they execute. we have tried a few things but we are unable to pass the data in time before the functions execute.
Add a preInit in mission, via cfgFunctions?
awesome! we will try that now
Or set a variable at the end of your script
And make your server script wait until that variable is set
@quaint oyster afaik is there no guide/tutorial/example for it, although you could take a look at the source code of CBA how they do it. It's rather complex though.
Not sure how RHS does it exactly, although I believe they simply add a button at a fixed location.
I'm trying to look over a few different scripts, one by connor for his extended chat, and another called voyager compass, but i just don't understand where the button code starts and ends, i'm so confused by it.
I made a battlefield style target marking script, i went a step further and made the player able to change the ping color, and i was gonna make a pause menu drop down menu with a color slider, but i'm absolutely clueless.
I would suggest to use CBA Settings for that, which is a lot easier than trying to make a full UI yourself
i'ma go research it, worse case i'll settle on maybe making a custom userface with like 12 colors on it to pick from as opposed to a slider of somekind
CBA Settings is extremely easy: https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System#arguments-of-cba_fnc_addsetting
even has a build in color picker ๐
๐ฎ
think i got that hooked up already in like 25 seconds, wish it was on the pause screen but this will work in the mean time
one by connor for his extended chat
my interrupt menu buttons are added in a scripted eventhandler when the menu opens
Able to teach meh?
i'm gonna have to trial and error learn this
its just creating controls by script instead of by config
its way over my head skill wise though i'm looking at this cross eyed like its an alien language
is it that you dont know anything about making guis or just not scripting them?
Hey guys, i am looking for a way to find any value that contains "some_value_1" in an array. If i match case it like this:
"some_value_1" in _allVarsNamespace;
it works but i want to be able to use
"some_value" in _allVarsNamespace;
and have it throwing out true.
How would i go about this?
huh?
Im searching for a way to find "HelloThere" by searching for "There" in the following array: ["Hello1","HelloThere","Hellofive"]
so searching for a partially match
private _match = _array findIf {"There" in _x} > -1;
_match // true/false
I'm getting some kind of generic error when trying to activate sidechat with a trigger. I set the activation to radio Charlie for testing, and named the callsign and variable name of the unit "A2"
In my trigger I entered A2 sideChat "Alpha One, be advised. We're running low on fuel. We only have enough to make a few passes but we will try and assist as best we can.";
Which kind of generic error exactly?
and I'm going to guess he's got the left hand parameter wrong, probably sending it a string when it wants am object
Hey all
In game I have a laptop with lots of addAction commands but need to execute it server side as it changes TOD and weather etc
Can someone tell me how to put my addaction script Into a remote exec ?
this addAction ["Set weather forecast - Sunny",{0 setOvercast 0; hint "Forecast set to CLEAR";}];
this addAction ["Remove Fog",{0 setFog 0; hint "Fog Removed";}];
this addAction ["SkipTime 12hrs",{skipTime 12; hint"Time skipped 12hrs";}];
this addAction ["SkipTime 24hrs",{skipTime 24; hint "Time skipped 24hrs";}];
this addAction ["SkipTime 6hrs",{skipTime 6; hint "Time skipped 6hrs";}];
this addAction ["SkipTime 2hrs",{skipTime 2; hint "Time skipped 2hrs";}];
``` that's the code
Basically you're trying to have an add action change weather and stuff on server?
@idle jungle Remote exec the code inside the addAction
You might have to do something like {[[],{code you want on server}] remoteExec ["spawn", -2]}
On phone, cant format it :(
Just push that inside the addaction, should work as intended
Thanks guys!
Also, does anyone know if the code inside of an event handler is stored anywhere in a mission namespace variable or something that I can access?
Also, does anyone know if the code inside of an event handler is stored anywhere in a mission namespace variable or something that I can access?
no. It's not accessible anymore
Alright. Thanks.
this addAction ["Set weather forecast - Rain!!",{0 setOvercast 1; hint "Forecast set to RAIN";}];
this addAction ["Set weather forecast - Sunny",{0 setOvercast 0; hint "Forecast set to CLEAR";}];
this addAction ["Remove Fog",{0 setFog 0; hint "Fog Removed";}];
this addAction ["SkipTime 12hrs",{skipTime 12; hint"Time skipped 12hrs";}];
this addAction ["SkipTime 24hrs",{skipTime 24; hint "Time skipped 24hrs";}];
this addAction ["SkipTime 6hrs",{skipTime 6; hint "Time skipped 6hrs";}];
this addAction ["SkipTime 2hrs",{skipTime 2; hint "Time skipped 2hrs";}];
}] remoteExec ["spawn", 2]}``` does that look ok? or does it have to be for each line?
nope that aint it hahaha im an idiot
@idle jungle the addAction code not the addAction itself
yeah i just realised when i went up to it and nothing appeared lol
plus, this is no longer defined in that code
like this? addAction ["Set weather forecast - Rain!!",];{[[],{0 setOvercast 1; hint "Forecast set to RAIN";}] remoteExec ["spawn", -2]}
ah yeh copy paste bug i forgot to change it
addAction
["Set weather forecast - Rain!!",];{[[],{0 setOvercast 1;}] remoteExec ["spawn", 2]}; hint "Forecast set to RAIN";
@idle jungle Try this instead:
this addAction ["Set weather forecast - Rain!!",{
[[], {0 setOvercast 1; forceWeatherChange;}] remoteExec ["call", 2];
"Forecast set to RAIN" remoteExec ["hint", 0]
}]
ah
@idle jungle the remote exec must be inside the addAction code
yep baby steps im learning lol hahaha
Hello there
I am making a mission, for a Unit and I've got curious if there is a script that let's me close the cockpit door of the Plane, so that the plane looks like its unused or so. Ive done some online digging and found nothing. Is there a script that let's me close the cockpit door. I am still new to the Arma community and would thankful if someone could help me.
I think now it's clear enough
@little raptor thank you i really appreciate it
@idle jungle read this to understand it better:
https://community.bistudio.com/wiki/remoteExec
also corrected a mistake
thooough there is the forceWeatherChange that should be used, too (for overcast only, not rain nor fog)
only for clients, the server broadcasts it
hmm, the page doesn't say that, it should be updated
@idle jungle try the new code
thank you
so another one would look like this?
[[], {0 setOvercast 0; forceWeatherChange;}] remoteExec ["call", 2];
"Forecast set to CLEAR" remoteExec ["hint", 0]
}]```
yeah
also, add syntax highlighting to your code. it's hard to read like this
see the pinned messages
@short fossil You mean the "canopy"?
Not sure if it's possible. Maybe if there are animation sources for that?
Hello all, I have a question, is it possible to attach a silencer on a weapon lying on the ground? I know it is possible when it is in a container, I wonder if that can be done also if the weapon is just on the ground (maybe with a command in init?). Thanks
yes
you'll have to create a weaponHolderSimulated (or maybe WeaponHolderSimulated_Scripted) first, then put the weapon in it
Not possible via init as I understand, right? Thanks @little raptor
I meant in the weapon init
@dull cosmos Just tested this and it works:
_wp = createVehicle ["WeaponHolderSimulated_Scripted", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"];
_wp addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
thanks!
I meant in the weapon init
why use weapon init anyway? (altho I think what you create in editor is already a weaponHolder)
I tried to attach the silencer in editor via weapon init using that command but I can't make it working, now I'm going to try with your method
@dull cosmos I recommend you use a test object for the weaponHolder position
something like:
if (!isServer) exitWith {};
_wp = createVehicle ["WeaponHolderSimulated_Scripted", ASLtoAGL getPosASL this, [], 0, "CAN_COLLIDE"];
_wp addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
deleteVehicle this;
put this in the init box of any object
It will be deleted at the end
replaced with a weapon holder
Thx again, will do that ๐
https://community.bistudio.com/wiki/Particles_Tutorial#Rock_Shower could help you @finite sail ๐
@winter rose
can't wait to see the result!
@winter rose
youtube processing.. only has 360p version at time of writing
noiiiiiiceย !
my pleasure
now you only have to add the water splashes and we're good ๐
Maybe create a vehicle and:
veh setVelocity [0,0,-1000];
lol
you monster ๐
@dull cosmos here's a way to do the same, but keep the same orientation as the weapon you placed.
Meaning place a MX, orient it in the world however you want. and with this script in init, it will replace it with a MX with silencer, in the exact same orientation as you placed the gun in editor
clearWeaponCargo this;
this addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
so it was a weapon holder. I was right
its also simpler, and more performance efficient (not that you'd care at mission start)
yeah. wasn't sure about that either, so I tested
I thought it would get deleted when you remove the last weapon, but apparently it stays around for long enough to add a new weapon back into it
Thats a pretty good trick I think, that should be written down somewhere
btw, how would my code work in MP? I delete the object at the end.
Does it get recreated when a new client joins the server
init event runs locally on every joining client
huh.. good question. race condition I'd say. Some clients will see the dummy was already deleted and not run its init script.
other clients might still have it and spawn a dozen weapon holders with your replacement
but server runs it too, maybe server runs it first. and so soon that other clients will never see that that object existed
if isserver then ?
good call
that's the only "dirty MP trick" in my CAAS mission - I used green helper arrows that get deleted/replaced through the init field by ambient soldiers, server-side :3
Hey! I have a porblem with the following code:
_items = items player;
_all = 0;
{
_curItemName = _x;
_count = {_x == _curItemName} count (items player);
_all = _all + _count;
hint format ["%1",_all];
}forEach _items;```
If I have a firstaidkit in my inventory then it doesn't count right..
what even are you trying to count?
the number of all items it looks like.. but your code is nonsense
you are trying to count all items in inventory, but all items of same type you want to accumulate exponentially?
I'm trying to find out how much of each item I have in my inventory. But then I saw that I got a lot more than it makes sense. So I added it all up and found out that the first aid kits give more than 1 apiece
_items = items player;
_uniqueItems = _items arrayIntersect _items;
_itemsCount = _uniqueItems apply {_item = _x; [_item, {_x == _item} count _items]};
not very efficient, but as long as you don't use ACE its probably fine
Thanks @still forum @little raptor
if you have lots of items, there are much more efficient but a bit more complicated methods.
This there will crush your performance if you have hundred+ items (as for example with ACE Medical bandages)
@still forum isn't this faster:
_itemsCount = _uniqueItems apply {count _items - count (_items - [_x])};
I mean it's stupid but I don't know if it's faster
I had that idea at first, but you are constantly copying potentially very big arrays
I figured maybe the - operator would be faster than looping though the array manually
it will probably be if you get the big item counts done first
although count is fast isn't it?
Sorry to barge in, but need help with a trigger activation random teleport script for an MP mission. For some reason, when the trigger activates it teleports all players, and have no idea why..
private _spawnArray = [sp1, sp2, sp3, sp4, sp5, sp6, sp7, sp8, sp9, sp10, sp11, sp12, sp13, sp14, sp15, sp16, sp17, sp18, sp19, sp20, sp21, sp22, sp23, sp24, sp25, sp26, sp27, sp28, sp29, sp30, sp31];
private _randomSpawn = selectRandom _spawnArray;
private _pos = getPosASL _randomSpawn;
private _rot = vectorDirVisual _randomSpawn;
for "_i" from 0 to 4 do {player addItem "FirstAidKit"};
private player setVectorDir _rot;
private player setPosASL _pos;
did you put this in the trigger activation code?
Yep
first of all:
_i = (floor random 31) + 1;
_randomSpawn = missionNamespace getVariable format ["sp%1", _i];
would be faster
getVariable would be even faster
right!
givin me shivers :u
private player setVectorDir _rot;
syntax error
is that a global trigger then?
if it executes on every players machine, it'll teleport every player
you don't need to private everything
good practice on local variables. but thats also the only place where private exists
Its probably not the script, but trigger settings being wrong
By any change, are 3den editor triggers global?
Because that might answer your question then
you can configure it on the trigger afaik
it has a serverOnly option
ServerOnly isn't ticked
maybe it was the condition thing
this && player in thisList
I remember seeing that, I don't use triggers
you could also put a
if (player in thisList) then {} around your code
or maybe this && {player in thisList}
does the trigger activate per client?
I'm still fuzzy about the trigger activation stuff
that's well and good, but isn't that just activation conditions? meaning that when it does activate, it'll have the same effect?
The trigger activates per client, yes, issue is that it executes globally
Ends up executing the code for everyone on server
I don't think a trigger is a good idea
afaik it triggers globally
Are those spX things outside the trigger area?
Aye, and they're just objects that act as the spawn point locations
ok so it's probably safe enough to use
Thank you so much @still forum !
I guess the question is do triggers only activate globally
if (player in thisList) then {
_i = floor random 31 + 1;
_randomSpawn = missionNamespace getVariable format ["sp%1", _i];
_pos = getPosASL _randomSpawn;
_rot = vectorDirVisual _randomSpawn;
for "_i" from 0 to 4 do {player addItem "FirstAidKit"};
player setVectorDir _rot;
player setPosASL _pos;
};
this should fix the issue
just try the condition thing, and youll see
does the condition evaluate per client?
Doesn't hurt to I guess
does the condition evaluate per client?
does anyone know the answer to this?
I know where to look, but ugh
I guess it should
because "&& player in thisList" is a real thing, so it has to
Worst case scenario, I'll just ditch the trigger and use an addAction since I know that one will execute locally
Thanks nevertheless, I'll try the condition stuff

@still forum That method I mentioned is significantly faster:
a = [];
for "_i" from 1 to 1000 do {
a pushBack toString [floor random 127,
floor random 127, floor random 127]
}
35 ms:
_cnt = count a;
a apply {_cnt - count (a - [_x])}
750 ms:
a apply {_c = _x; {_x == _c} count a}
I don't think you can have more that 1000 items in your inventory!
It's as you said before: if you iterate thru arrays manually, the process will be slower
I had that problem in TFAR.
There are inventory functions that give you the count right away. much more efficient but more work
well, the array was random tho
I think the count was 1 for each string
So that means I'm copying 999 elements
but it's still faster
anyway, I tried with 10000 elements too:
3285 ms vs my game froze
no, kidding
but It's still running
at least it was
for like 30 seconds
I killed the process :p
@still forum
So i tried putting our settings in a function in the mission file and setting it fire on preinit but it doesnt fire on the server it only fires when the player connects. here is my funcetion deffinitions that gets included at the top of the description cfgFunctions.
class utility_9
{
tag = "utility_9";
class utility_9
{
file = "utilities\utility_9";
class init{
preInit = 1;
postInit = 0;
preStart = 0;
};
class monitor_conditions{};
class state_1_apply{};
class state_1_remove{};
class states_remove_all{};
};
};
preInit in mission also fires on server
@short fossil You mean the "canopy"?
Not sure if it's possible. Maybe if there are animation sources for that?
@little raptor I mean like the cockpit door wait let me get a screenshot
@still forum
this is what is in the fn_init.sqf.
As you can see ive tried alot of stuff. the messages only show up once a player connects.
["Got here!"] remoteExec ["diag_log", 2];
diag_log "got here! 2";
if (isDedicated) then
{
//enabled ["features
PIYWfeatures = [
["feature_1", true],
["feature_2", true],
["feature_3", true],
["feature_4", true],
["feature_5", true],
["feature_6", true],
["feature_7", true]
];
publicVariable "PIYWfeatures";
["Feature Settings loadded!!!!!!!!!!!!!!"] remoteExec ["diag_log", 2];
};
@little raptor here is it is there like a script to close that cockpit door without turning the engine on?https://cdn.discordapp.com/attachments/564703559317454878/777202837657878528/unknown.png
just do normal diag_log and watch server log
maybe mission doesn't fully initialize before first player joins?
@still forum
in the code snippet from before , i already tried that. it doesn't work. i let it run and watch the log to ensure its fully started and loaded. is there something special i need to do in my description.ext to enable functions to use preinit?
this is the section of the description.ext where im adding this utility/function
class CfgFunctions
{
// //Utilities
#include "utilities\utility_9\cfgfunctions.hpp"
#include "features\feature_3\cfgfunctions.hpp"
@dull cosmos here's a way to do the same, but keep the same orientation as the weapon you placed.
Meaning place a MX, orient it in the world however you want. and with this script in init, it will replace it with a MX with silencer, in the exact same orientation as you placed the gun in editorclearWeaponCargo this; this addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
@still forum
Tried on dedicated server, it works fine, only had to replace clearWeaponCargo with clearWeaponCargoGlobal
Thx a lot again ๐
the script runs locally everywhere
global shouldn't be needed for either
@lucid shale no that should work I guess
I don't remember a "code snippet from before" that just does diag_log
you do remoteExec in your script
i tried a few things.
ah I see there is a normal log too
at the same time
well it should work..
maybe try a simple mission with just that script and see if that works, maybe something else breaking it
wilco
@still forum it works in clean skin. thanks for your help. time to start commenting things out one at a time.
@short fossil well, yeah, it's called the "canopy" not "cockpit door"
as I said, if it has animationSources for that, you can use that command to close it.
you can find the animationSources in the config
you can also try the "animationNames" command
Btw, thanks Dedmen and Lepoard for the help with the trigger, turns out the && player thing in condition was the solution all along
Definitely noted down for the future haha
I want the player to take a secret letter from the inventory of an AI (Zeus controlled). or drop to pickup the intel.
Is there a way to put a leaflet with intel in the inventory? or a better solution?
intel will be text based, an encrypted message
You can pretend some item is an "intel" document.
Add a "Take" event handler to the player.
Once you find that the picked up item matches your "intel", show some text in a dialog or something
I see (actively busy building the mission) files can be picked up. will see if I can do something with that, add an inspect to reveal the text and recall when handed over to intel department.
May I ask what the script is for turning on helicopter and car engines in Eden and where I can find the scripts (if needed) for setting ambient animations? I tried searching and trying for a bit now but cannot really find an answer online sadly.
(Please ping me c:)
@untold sail POLPOX's artwork supporter iirc
Hm, I took a look at it. It says its for still images, but if you start the scenario will the NPCs keep on doing an animation?
I misunderstood what you wanted to do.
to turn the engine on, you can use engineOn
as for the ambient anim, see BIS_fnc_ambientAnim
@untold sail โ
Interestingly you can also use it to turn the engine off.
it would be even more confusing if engineOff existed ๐
I'm just having fun 
me too, me too
I simply put engineOn onto the init field and then started the scenario. Sadly it didnt work. I also used this https://imgur.com/WXLiJUK but it didnt work either
You need a load of this https://community.bistudio.com/wiki/engineOn
All the knowledge is on that website
I'll give you a hand on that one, because init fields are bad```sqf
if (isServer) then { this engineOn true }
"bad" in MP, because the code runs for every players, even joining ones
_helicopter is the problem
Thats what I tried using to the best of my understanding, sadly I dont really know much about coding except some very basics meanings
Don't no _helicopter exist in that init field
Where should I put that Lou since the init field is the only thing I could think of
The magic will come with this instead of _helicopter 
the init field ^^
Oh I thought its bad xD
the "this" variable will refer to the init field's object
the if isServer prevents the "bad" thing of the init field
(yet still not ideal)
Don't worry, you are not a pro and even the pros will sometimes use the init field ๐
Thank you guys really much, its astonishing how helpful and friendly this community is. Everytime I had a question so far I got patient people to help me, I really appreciate this c:
don't hesitate!
And thank you for Polpox' mod, now I can actually take nice screenshots as a sidenote :D
I want a chopper to have its engine on while not taking off, so my script looks like this now if (isServer) then { this engineOn true } ; this flyinHeight 0;
Hm, wanted to use a codeblock๐
Oh wrong direction then
The problem is it gains height and then just hovers 2-3 meters above the floor
what do you want to happen?
I want the engine to turn on (which functions now due to your help) and now I just want to helicopter to stand on the floor, its more ambiente like.
Do you need / want the pilot? If there's no pilot the engine can still run but it can't go anywhere.
you can disableAI the pilot, or remove it entirely yes
It would look a bit weird without pilot since the players will walk a few meters beside it. if (isServer) then { this engineOn true } ; { this disableAI } ; Will that work like that?
The wiki awaits!
if (isServer) then
{
this engineOn true;
driver this disableAI "MOVE";
};
You're such a big help, I tried it and it works perfectly. The floor doesnt seem to be leveled though and the helicopter tail flies up into the air. I read something about attaching stuff to the floor earlier so I will try educate myself on that for the moment
Does anyone know of a good vehicle respawn script?
Using the vehicle respawn modules it just makes vehicles endlessly blow up :(
Been an issue since 2013
addMissionEventHandler ["EachFrame",{
_spoopy = (allUnits + vehicles) select {_x getVariable ["GOM_fnc_spoopy",false]};
if (currentVisionMode player isEqualTo 2) exitWith {
{_x hideObject false} forEach _spoopy;
};
{_x hideObject true} forEach _spoopy;
}];```
I used this script made by Grumpy Old Man to make certain units appear only in thermal vision
considering its an EachFrame eventHandler
would it be correct in thinking that using this on a group of 40 AI pre placed units is going to massively lag the server? especially if its being populated by 30 players?
@smoky verge that script is clientside only. It won't lag the server at all. And number of players also won't make much difference.
But that script is pretty inefficient it's repeatedly hiding the same units over and over again every frame.
That's stupid, it only needs to do it once, when you switch your thermal mode
is there an eventhandler for thermals on?
and it would also need to play when the player switches the goggles off
@obsidian violet don't use the selectRandom function, use the selectRandom command instead.
And it's random. Maybe you are just unlucky
@smoky verge afaik no, but you can just build your own in the EachFrame handler
Maybe your paradrop function stores your stuff in a global variable. And later calls just overwrite it
Solved the problem its me being a retard.... time for bed
๐ซ
Would help if I would call the correct function that I did all changes in. sorry for my spam and good night โค๏ธ
But that script is pretty inefficient it's repeatedly hiding the same units over and over again every frame.
That's stupid, it only needs to do it once, when you switch your thermal mode
it's also looping through the array twice. in each frame
is there an eventhandler for thermals on?
and it would also need to play when the player switches the goggles off
Would be nice to have an event handler for this which triggers when NVGs are activated and as parameter it should return the unit and vision mode โค๏ธ
I have an issue with a script creating a static object, then orienting it in a certain direction.
in MP (dedicated) there seems to be a few seconds delay in rotating the object.
sometimes its instant. sometimes it takes 10 seconds.
In my script players are teleported onto the object but due to the delay in rotating, they fall off or get stuck.
Any clever work arounds?
How do you do it?
Good question I dont have the script in front of me.
setDir if I remember correctly
is there a beter command?
like setVecordirandUp?
Seems like setDir has some issues and quirks regarding its intended Global Effect.
You can try calling setPos after setDir, maybe that'll help the updated object state propagate.
@short fossil well, yeah, it's called the "canopy" not "cockpit door"
as I said, if it has animationSources for that, you can use that command to close it.
you can find the animationSources in the config
you can also try the "animationNames" command
@little raptor Thank you very much
Someone more experienced able to point out why [any] is returned when "GUER" is supplied into setVariable but then [WEST] and [EAST] are returned when "WEST" or "EAST" are supplied into setVariable in a trigger that has been set up like below?
_x setTriggerStatements [
format ["this && ((thisTrigger getVariable 'BIS_WL_sector') in ((BIS_WL_sectorsArrays # %1) # 3))", _forEachIndex],
format ["(thisTrigger getVariable 'BIS_WL_sector') setVariable ['BIS_WL_revealedBy', ((thisTrigger getVariable 'BIS_WL_sector') getVariable 'BIS_WL_revealedBy') + [%1], TRUE]", "EAST"],
"systemChat format ['%1', ((thisTrigger getVariable 'BIS_WL_sector') getVariable 'BIS_WL_revealedBy')]"];
formatting side does something wierd
ill check
Converting a side to string will not always return the side command text: e.g str resistance // returns "GUER".
See Side page to see the return value of all side commands.
is that relevent?
I think format might do the same thing as str in this case
Thanks for the quick response and suggestion Lou. Using "RESISTANCE" (finally, lol) returned [GUER] as I've been expecting the result to be for some time.
As continuation from that the correct side is supposed to be supplied on the trigger's activation from a _handledSide variable like so
format ["(thisTrigger getVariable 'BIS_WL_sector') setVariable ['BIS_WL_revealedBy', ((thisTrigger getVariable 'BIS_WL_sector') getVariable 'BIS_WL_revealedBy') + [%1], TRUE]", _handledSide],
_handledSide on the other hand goes like so: _handledSide = BIS_WL_competingSides # _forEachIndex;. BIS_WL_competingSides resides elsewhere and is basically: BIS_WL_competingSides = [WEST, RESISTANCE]
As far as I understand _handledSide should provide the needed WEST or RESISTANCE. But for some still unknown reason to me RESISTANCE returns [any]. I don't know if the problem could have something to do with _forEachIndex: so far I don't understand how it (_forEachIndex) should actually work and haven't yet figured out if it really offers RESISTANCE to the trigger's on activation as it should be doing.
Taking from what Tankbuster said there: would it be on the right path that _handledSide is in this case providing "GUER" when it should be providing RESISTANCE (or "RESISTANCE")? If format makes the same thing than str then is there any way to provide RESISTANCE as is? I think format is needed if one wants to substitute %1 with something?
@forest ore if you stringify a side, there is a difference, yes
west/blufor โ "WEST"
east/opfor โ "EAST"
resistance/independent โ "GUER"
civilian โ "CIV"
This seems to be the case Lou. I guess it's now to figure a way how to not stringify a side until certain point..I think
why do you want to stringify the side anyway?
It's like that from the get-go (ie. not my work). I'm just trying to figure out why what's been readily provided does not work for only one side
most likely because str west == "WEST"
Actually I don't even understand that at what point RESISTANCE turns to "GUER" which in turn makes stuff not work
when formatting or str'ing
I don't know the WL framework, I simply hope BI does not rely on str west == "WEST" ยฏ_(ใ)_/ยฏ
I wouldn't know ๐
Guess could ask if there's a chance to educate myself at the same time: what are other possible ways to apply something to something than just using format?
Is there ways to turn this sqf format ["(thisTrigger getVariable 'BIS_WL_sector') setVariable ['BIS_WL_revealedBy', ((thisTrigger getVariable 'BIS_WL_sector') getVariable 'BIS_WL_revealedBy') + [%1], TRUE]", _handledSide], to something else that's without format?
Iโฆ don't get what you are trying to say
why do you use format really? to compile and call it?
Like I said there earlier it's not my work. I'd be all in for using something else than format but at this point in time I at least don't know how or what to use instead.
As far as I understand format is there to pass some data where it needs to be. There is another function that will return true when BIS_WL_revealedBy has been setVariable'd with corresponding side: ```sqf
waitUntil {sleep WL_TIMEOUT_STANDARD; BIS_WL_playerSide in (_sector getVariable "BIS_WL_revealedBy")};
*BIS_WL_playerSide* is `BIS_WL_playerSide = side group player`. `side group player` returns "GUER" so how I read this is that BIS_WL_playerSide needs to be "WEST" or "GUER" for the above `waitUntil` to return true
Number
When 0, the function or command will be executed globally, i.e. on the server and every connected client, including the one where remoteExec was originated.
When 2, it will be executed only on the server.
When 3, 4, 5... it will be executed on the client where clientOwner ID matches the given number.
When number is negative, the effect is inverted. -2 means execute on every client but not the server. -12, for example, means execute on the server and every client, but not on the client where clientOwner ID is equal to 12.
Object - the function will be executed only where unit is local
String - the function will be executed only where object or group defined by the variable with passed name is local
Side - the function will be executed only on clients where the player is on the specified side
Group - the function will be executed only on clients where the player is in the specified group. In order to execute the function where group is local pass owner of the group as param:
_myGroup remoteExec ["deleteGroup", groupOwner _myGroup];
Array - array of any of types listed above```
Which one is just 1 client (for a hint, just want it on 1 guy not everyone
["Shoothouse - Loading event, plase wait..."] remoteExec ["hint", 0];```
thats my code but im aware 0 is everyone and server
hint "my text" ?
@forest ore then that's an awful code that is only meant to work with west or east ๐คทโโ๏ธ
ohhh so hint without remote exec??
if the script is local to the machine, yes
ah
otherwise, ["myText"] remoteExec ["hint", theUnitWhereItIsLocalUsuallyThePlayerUnit]
i nearly just copied that..
hue hue
this addAction ["ShootHouse",
{
[
[],
{
[] spawn
{
if (isServer) then
{
if (isNil "SAS_SHOOTHOUSEDATA") then
{
SAS_SHOOTHOUSEDATA = [SAS_SHOOTHOUSE] call SAS_fnc_AICreate;
G_1 animate ["Door_1_rot", 0]; G_2 animate ["Door_1_rot", 0]; G_3 animate ["Door_1_rot", 0]; G_4 animate ["Door_1_rot", 0]; G_6 animate ["Door_1_rot", 0];
sleep 60;
G_1 spawn
{
waituntil
{
private _Player = [PlayableUnits,_this,true] call BIS_fnc_nearestPosition;
(_Player distance2D _this > 250)
};
[SAS_SHOOTHOUSEDATA] call SAS_fnc_AIDelete;
SAS_SHOOTHOUSEDATA = nil;
};
};
};
};
}
] remoteExec ['bis_fnc_Spawn',0];
["Shoothouse - Loading event, plase wait..."] remoteExec ["hint", 0];
sleep 10;
player setPos(getPos Veiw2);
["Event Started - Shoothouse"] remoteExec ["hint", 0];
}];``` thats the code
some is on the server
apologies if its messy code lol
lmao!
basically long story short its a massive training ground with loads of places on altis with resettable events
which i place ai down on the editor and grab it into a code and it gets put into an array library
โฆcss
I thought it was cs
so you add an action, the player will hint, have the move, but if the player is not the server nothing will happen.
hmmm nope
oh wait, you remoteExec that code. ouch.
newbie lol
https://sqfbin.com/ofazobusawolomufareh
how many tabs did you put there Lou?! ๐
It looks weird!
6 max, apparently :p
well i must say thank you for not laughing in my face lol
that i apprechiate
tabs > spaces
tabs > 4 spaces
ohhh
usually (but it has it's own character)
ive been smashing space bar like its valentines day
try Notepad++
that's where alcoholic astronauts go actually
If you haven't already
(VSCode > N++ ๐)
yeah notepad++ with dark theme
With the right plugin
I couldn't find one with auto completion (at least not one that works)
Also, they're all old
ok ill do some googling thanks gents as for my original question ive taken that hint out of the remoteexec to become local
this addAction ["Para Training",
{
[
{
{
if (isServer) then
{
comment "CODE THAT ONLY THE SERVER EXECUTES HERE.";
if (isNil "SAS_HALOTYLER") then
{
SAS_HALOTYLER = [SAS_HALO] call SAS_fnc_AICreate;
sleep 40;
halo1 spawn
{
waituntil
{
private _Player = [PlayableUnits,_this,true] call BIS_fnc_nearestPosition;
(_Player distance2D _this > 800)
};
[SAS_HALOTYLER] call SAS_fnc_AIDelete;
SAS_HALOTYLER = nil;
};
};
};
};
}
] remoteExec ['bis_fnc_Spawn',0];
hint "HALO - Loading please wait...";
sleep 10;
hint "Halo - Event starting now";
sleep 1;
player moveincargo halo1;
}];```
Like so?
you forgot to delete the { }
ah yep
for that spawn
sorted thanks guys
since this code should only be executed on the server, you could remove the if isServer check and remoteExec with 2 (server) as the target @idle jungle ๐
Hey there again, I was playing around with POLPOX artwork mod and encountered a "problem" to which I couldnt find the answer in his guide. This is an example code that used to start and loop the animations of the NPCs [ "Acts_Explaining_EW_Idle03", -1, objNull, false, 0, "", "", true ] Now playing the scenario it seems like the npcs playing an animation are invincible and dont stop the animation when being shot at. Is there a way to fix that e.g. do I have to change on of the variables?
Hi, I have declared an eventHandler in 'initPlayerLocal.sqf' to trigger below script. It works fine. But Iยดm having one issue with the 'globalChat'
My goal is to print a message that includes 2 variables, in chat for all players to see. Iยดm not getting syntax error but when hosting MP mission, only the player that triggers the event is able to see the chat message.
_thisPlayer = (_this select 0);
.....
[_thisPlayer,(format ["text ..... %1 text..... [%2] text... ", _var1 ,_x])] remoteExec ["globalChat",0];
@untold sail they shouldn't be shot at, since it is for screenshot purpose?
@cedar sundial most likely _x is undefinedโฆ?
can't really tell without the code, what you posted should work
I thought about modyfying it a bit so that the animations can be used on a hosted server to give them npcs a bit more life.๐
It also seems much more comfortable implementing the animations this way
@winter rose
If remoteExec is correc, Iยดll try isolate it and execute. Thanks :)
[_thisPlayer,(format [" text %1", _var1 )] remoteExec ["globalChat",0];
[_thisPlayer,(format [" text %1", _var1 )] remoteExec ["globalChat",0]; // wrong
[_thisPlayer, format [" text %1", _var1]] remoteExec ["globalChat", 0]; // correct
heyo, I'm having trouble with adding an eventhandler to a multiplayer mission on a server. it is working when testing in locally hosted multiplayer. anyone got a clue for me?
this is my init:
if (!isServer) exitWith {};
private _allPlayers = allPlayers select {_x isKindOf "Man"};
{_x addMPEventHandler ["MPkilled",{[_x] call grad_persistence_fnc_redlistClasses;}];} forEach _allPlayers;
if (!isServer) exitWith {};
{
_x addMPEventHandler ["MPkilled",
{
params ["_unit", "_killer"];
[_unit] call grad_persistence_fnc_redlistClasses;
}];
} forEach allPlayers
@tough abyss โ
ou, alright, im gonna try that
oh, alright
would never have figured that out on my own
so, apparently this doesn't work when executed from init as no unit is technically spawned yet? we just added the EH from console after spawning and the EH fired
so should we add a second EH playerconnected to execute that after we're spawned in?
yep
depending on your respawn settings as well (think of the JIP!), all players may not be the same
yikes
though, you shouldn't then need an MPEH, only EH
if you want it to happen server-side only then yes
well, the framework is supposed to be running on server only, so, i guess yes:)
https://community.bistudio.com/wiki/Event_Scripts#initPlayerServer.sqf
This script relies on
BIS_fnc_execVMandremoteExec. If CfgRemoteExec's class Functions is set to mode = 0 or 1, the script will never be executed.
careful ๐
ayyy, we got it working :D the framework is relying on remoteExec anyway
thanks a lot for getting us over that hurdle @winter rose
my pleasure
Is this script correct? I'm trying use it to spawn opfor forces when all three of these vehicles are destroyed. When I test the mission with this script I keep getting a generic error in expression.
({ alive _x } count units Group1 == 0)&&({ alive -x } count units Group2 == 0)&& ({ alive _x } count units Group3 == 0)
i guess "-x" is a typo?
Thanks that fixed it.
no worries
mmm, dev build
well, if you insist ๐
ok, so when I'm drawing on the map (in dev build), left ctrl + left shift, and lmb draws the straight line
is there a way to have a more than a single line in each 'stroke'?
releasing the lmb ends to draw and the marker
also, the line doesn't actually draw until i release the lmb in straight line mode, where as in normal draw mode, (without left shift) it draws as I drag the pointer
biki says setmarkerpolyline
Be aware that this command expects an array with a minimum array size of 4 elements and that the array count always needs to be dividable by 4 and return a whole number.
but if it has anything less than 6 elements in the array, it becomes invisible
Arma2OA. Is there any way to prevent AI armed with only a pistol from going prone on contact with the enemy? I cannot use setUnitPos because it is bugged for AI armed with only a pistol.
Seems like
setDirhas some issues and quirks regarding its intended Global Effect.
You can try callingsetPosaftersetDir, maybe that'll help the updated object state propagate.
@willow hound Thanks Ill try
Arma2OA. Is it possible to prevent AI all belonging to one group from sharing target info with each other?
I don't think there is, because that is an inherent trait of being in a group. The only way I know how to stop info sharing is to have everyone in individual groups.
Unless you did an actual AI modification
The problem is once a member of the group spots you, the whole group has ESP, spinning around to shoot you the millisecond they have line of sight to you, even if they are facing the opposite direction.
you could try a
{
if (leader grouphere != _x) then {
doStop _x;
};
} forEach units grouphere;
but I still think they get shared info however they will ignore the "unit attack that man" command from the squad leader, so it can be slower.
I've already got them stopped and to not accept targets from the leader
However they don't seem to make any distinction between "knowing" of the target, and actually being able to "see" him.
As soon as they "know" about the target, they appear to "see" him the moment they have line of sight. Regardless what direction they're facing, how far away they are, etc.
well they are actually getting a command and following it. once they have a clear LOS, the leader tells that unit to fire upon the unit, so he turns around and engages. Its just silly fast because its the AI that is generating the command. If you have AI in your squad and do the same thing, you will see your squad mate, who may be facing backwards, whip around and engage
I've got disableAI "Target", which is suppoed to prevent exactly that, as I understand it
if person A tells person B "enemy 200m north", than person B can and will turn that direction and most likely see the enemy as well
so it's not that strange IMHO
but I agree that AI can be pretty OP, since they always know where you are and only visual/audible cues are used to check if they will fire at you
maybe attempt to disable autotargeting as well
The situation I'm in right now is urbat combat. I've got men stationed at different positions around the town. Once the group is aware of me, it is basically impossible to sneak up on any of the AI. They will turn toward me the moment they have line of sight, regardless of direction.
or the easiest way is to just make them their own individual groups
yeah from that comment, make them their own groups
and reenable target and autotarget
are you running any AI mods?
Problem is there's quite a lot of AI. don't want to degrade performance by having a lot of groups.
I suppose I could try it and see if it's a problem
well, a group communicates with each other, so if one of them know where you are, all group members do
i am using ASRAI, but as far as I know, it doesn't give AI ESP.
... sigh...
ASRAI and VCOM both have extrasquadal (lol) communication
same with LAMBS
ASRAI also communicate between groups, so if one person knows where you are; all AI units within a range know where you are (independent of group)
I've disabled their radio communication, and I believe that is only for between groups anyway
not within a single group
within single group is already vanilla behaviour
well you wanting group members to not communicate with each other goes against the basic AI package
not possible... now you could write a script that runs on individual units that deletes their target after a certain time, or eliminates knowledge of nearby players after a certain time, etc. but if you have tons of AI and you throw that on, you degrade performance too.
alright forgot this issue. let me go back to the AI units with pistols. Is there a way to stop them from going prone? UnitSetPos causes bugged behavoir for AI armed with pistols. So can you think of another way?
not to prevent the prone command from firing, but you have the right idea with unitSetPos but you would put that as an event handler onEachFrame or with a while { blah; sleep 1;} type thing
and if the pistol gets bugged by putting it away or whatever happens, you can always script them into pulling it back out when it fires
when I use unitsetpos on a guy armed with a pistol, they get stuck forever switching weapons
have you attempted that without ASRAI
nope, but I've read about other people encountering that bug with nothing to do with asrai. Plus looking at all the stuff asrai does, I don't see how it could be responsible for causing the error.
well in the future, always test your theories without AI mods, then introduce them and see if it still works. there are so many things firing with these AI mods at any given second. if you are finding others having the same issue, without mods, then you can conclude that its an unintended bug/interaction and you might have to do something different with your mission.
have you thought about using a pistol caliber primary instead?
The pistols are just there for variety.
I don't suppose I can lock a unit in aware, as opposed to combat mode
even if you were to do a script that changes the combat mode back to something else, the AI will override it. only thing that goes through is "CARELESS"
@drifting sky
Arma2OA. Is there any way to prevent AI armed with only a pistol from going prone on contact with the enemy? I cannot use setUnitPos because it is bugged for AI armed with only a pistol.
I think it's an animation bug (was also present in Arma 3, maybe still is)
I mean if the prone thing is temporary, it's definitely the same bug
In A3, when the AI were running and they wanted to raise their pistol to aim at the target, they would go prone first, then get up
It was a bug in the animation connections/interpolations
can I pass additional parameters to an addEventHandler? sort of like an addAction?
no
get/setVariable the arguments you need somewhere that is accessible in the event, or format the arguments into the event code (if they are static variable values)
alright
Is it a bug that setTriggerInterval doesn't work on triggers created with createVehicleLocal command?
@violet gull
errrr...
https://community.bistudio.com/wiki/createTrigger
@crude vigil createVehicleLocal allows creation of triggers local to clients, whereas createTrigger only allows trigger creation local to server. The triggers work, just can't set the interval apparently.
Since Arma 3 v1.43.129935 triggers can be created locally on clients setting optional param makeGlobal to false
?
Umm no? You can create local triggers with the makeGlobal set to false?
Ooooh god damn it, got confused with the parameter cuz of the mission placed trigger settings...
Mission placed one is either global or local to server lol
I've legit been doing it via createVehicleLocal this whole time 
marker_1 = createMarker ["object", position this];```
Would this spawn a marker on an objects location?
Oh I'm on phone sorry for formatting
@idle jungle You also need to set some other extra marker stuff:
_marker1 setMarkerType"mil_dot";
_marker1 setMarkerAlpha 1;
_marker1 setMarkerColor"ColorPink";
_marker1 setMarkerSize[.5,.5];```
Yeah just wanted to make sure the spawning of it was correct :) thanks @violet gull
If you create more than one marker, it might be a good idea to give it a unique name also:
_marker1=createMarker[format["mkr_%1",getposworld myLittleObject],getPosATL myLittleObject];
If the marker name is the same as another, it'll have issues spawning
Yeah I plan to have quite a few actually so thats even better
So each marker spawn would be _marker1 _marker2 so forth
_marker1 setMarkerShape"ICON";
_marker1 setMarkerType"mil_dot";
_marker1 setMarkerAlpha 1;
_marker1 setMarkerColor"ColorPink";
_marker1 setMarkerSize[.5,.5];```
Ah bloody phone
_marker1, 2, 3, etc is a local variable in your case, so it might be easier to just create the markers within a forEach or something like this:
//I use this for my civilian script when debugging solo
private["_m"];
{
_m=createMarker[format["mkr_%1",getposworld agent _x],getPosATL agent _x];
_m setMarkerShape"ICON";
_m setMarkerType"mil_dot";
_m setMarkerAlpha 1;
_m setMarkerColor"ColorPink";
_m setMarkerSize[.5,.5];
}forEach agents;
Oh yeah thats a better idea
@crude vigil createVehicleLocal allows creation of triggers local to clients, whereas createTrigger only allows trigger creation local to server. The triggers work, just can't set the interval apparently.
@violet gull This looks like a fix to my problem. I wish to make a music cue / trigger. But I want each player to trigger it themselves (competing teams each visit same location). This would allow the trigger to fire separately on each machine, yes?
@acoustic abyss I actually use a couple triggers for that exact purpose, so yes. ๐
_t=createTrigger["MuhTrigger", _muhTriggerPos, false];
As long as it is executed where player is local. initPlayerLocal.sqf or a script called from there should do.
Global triggers in my experience are poops.
Thank you! Saves a lot of headaches with remoteExec
For the marker talk above. I recommend using all local marker commands, until the last one
because every of these marker commands that you use there, is re-sending the whole marker via network to all players
also private["_m"]; Don't use that, its a performance waste @violet gull
Is there a way i can get the AI the react differently to certain Ammo types/Grenades?
hello, im trying to make an AI sniper countersnipe me.
so far i have given the AI sniper knowledge about me with reveal [player,4] and added a destroy waypoint at my position.
dis my code:
//reveal target
_this reveal [player,4];
//add waypoint
_wp = (group _this) addWaypoint [position player, 0];
//set type destroy
_wp setWaypointType "destroy";
//attach waypoint
_wp waypointAttachVehicle vehicle player;
but the AI sniper just refuses to shoot and just runs around :D
also the waypoint is instantly completed ?
the AI stands literally infront of me and ignores me wtf
a) is the AI able to move towards you? Otherwise waypoints don't work.
b) "destroy" is to destroy vehicles etc, not to kill infantry
yeah ai can path. what other waypoint should i use?
or method, it doesnt have to be a waypoint, just what i figured would work
No waypoint, unless it should move around
if i cant use a waypoint, how do i tell the AI to attack the player?
And it should attack you by itself if it's able to, unless you disabled it in any way
following... an AI sniper secondary mission is on my todo list
if i cant use a waypoint, how do i tell the AI to attack the player?
AI doTarget player
in the stuff ive done so far, they rarely engage > 600m
right, forgot about the doStuff. will try
they rarely engage > 600m
Yeah. You need to mod it
ah yes, this works instantly better:
_this reveal [player,4];
_this doTarget player;
_this disableAI "path";
If you want the AI to always know where you are, do this in a loop:
_AI forgetTarget player;
_AI reveal [player, 4];
when you say mod, you mean use an addon?
or script the AI behav
Both can be done. But I meant use an addon
Also, set the AI detection skill to maximum
why forget? to clear wrong positions where it thinks i am?
yes
after 2 mins, they do
without that the target position never updates (when target is unknown), even if you use reveal
even with dofire?
will try that
i think (note disclaimer) that viewdistance might be involved here?
can onyone confirm deny?
nope ,i checked and it says 12 km
ok, good
okay, so it seems that it only works on fresh spawned units.
like, i cant script-order the same unit twice. it will just stop doing anythin
really? why would that be? I;ve come across some counterintuitive stuff in my 15 year career as a BI customer, but thats a new one
well idk. i tried playing them close, add command, they fire. then i zeus move them further away. but they will just stop shooting,even if i run the command again.
if i spawn a new sniper far away + command, it works fine
mmm, keep at it fella. save me all the testing pls ๐
lol sure will. ill try to write a log
hehe
so far the AI snipes at 1km now
2km with fresh zeus spawned unit and
_this reveal [player,4];
_this doTarget player;
_this disableAI "path";
_this setSkill 1;
I told you. You have to forgetTarget
i did and it didnt help
And you do that in a loop?
nope, by hand a couple of times. but since the target never moved, it shouldnt matter
okay, now that snipers somewhat work, how do i make an AI helicopter shoot at infantry ๐
How can I get the displayctrl number of a display, for example display 46.
there is a list here
https://community.bistudio.com/wiki/Arma_3_IDD_List
yeah but i mean the idc of the ctrl not the IDD
idd = id of a display
idc = id of a control
for example i want hide the load button in the arsenal display, what is the number of that specific ctrl
you have to browse the config, or find with allControls display
ok, thanks for the help I'll take a look at it
@glossy pine copyToClipboard loadFile "a3\ui_f\hpp\defineresincldesign.inc"
There are all the IDCs and IDDs of many GUIs including Arsenal
Ok, Ty @cosmic lichen
Hello all, I have another question ๐ . I know this has been asked already (example here https://forums.bohemia.net/forums/topic/167988-hide-gps-crosshair-from-rscmapcontrol/) and as I understand it is somehow hardcoded, but is there a workaround to prevent the GPS crosshair to be shown when you are in certain vehicles? I'm particularly interested in hiding it when you parachute. If it is not possible to delete the crosshair, would it be possible to make it white or transparent? Thanks in advance for replies!
the init fields in editor dont allow "sleep" commands. any other way i can suspend code without using a script file?
ah, using spawn {sleep 1; hint "hi"}; works
can somebody test this script and tell me if it works for them?
```sqf plz (see pinned message)
i made it into an sqf
He means add syntax highlighting to your code on discord
It's not readable like this
is there a way to check if damage is from back-blast ? (using HandleDamage EH)
He means add syntax highlighting to your code on discord
@little raptor like this?
guy1 addEventHandler ["HandleDamage",
{
private ["_return"];
_unit = _this select 0;
_selection = _this select 1;
_passedDamage = _this select 2;
_source = _this select 3;
_projectile = _this select 4;
_oldDamage = 0;
_bodyMultiplier = 0.0000000000127;
_legsMultiplier = 0.0000025;
_handsMultiplier = 0.00000025;
_headMultiplier = 0.0000000075;
_overAllMultiplier = 0.000000000025;
switch (_selection) do
{
case("head") :
{
_oldDamage = _unit getHitPointDamage "HitHead";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _headMultiplier);
};
case("body") :
{
_oldDamage = _unit getHitPointDamage "HitBody";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _bodyMultiplier);
};
case("hands") :
{
_oldDamage = _unit getHitPointDamage "HitHands";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _handsMultiplier);
};
case("legs") :
{
_oldDamage = _unit getHitPointDamage "HitLegs";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _legsMultiplier);
};
case("") :
{
_oldDamage = damage _unit;
_return = _oldDamage + ((_passedDamage - _oldDamage) * _overAllMultiplier);
};
default{};
};
_return
}]; ```
the variable for "guy1" was called "private" which i assumed is the unit's variable name which i promptly changed in the sqf file as well.
Almost. You should put sqf in front of ```
@vestal field private is SQF keyword ๐ , not unit's name
And no
private is a command
it makes the variable "local" to a scope
damage is from back-blast
Isn't that an ACE thing?
@vestal field I don't see anything wrong with that code. (except for that guy thing)
But _overAllMultiplier and the other multipliers are ridiculously small and probably will cause the return value to be too small, and you might not see the unit taking any damage at all
put the sqf after ```
And edit your old code. Do not spam
@little raptor i edited the old code, still doesnt work however so the only culprit i can think of is somehow they're not spaced right or there's somehow a typo... but outside of "this" being replace with "guy1"; the unit's variable name i cant think of anything else
guy1 addEventHandler ["HandleDamage",
{
params ["_unit", "_selection", "_passedDamage"];
private ["_return"];
_bodyMultiplier = 0.1;
_legsMultiplier = 0.1;
_handsMultiplier = 0.1;
_headMultiplier = 0.1;
_overAllMultiplier = 0.1;
switch (_selection) do
{
case("head") :
{
_oldDamage = _unit getHitPointDamage "HitHead";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _headMultiplier);
};
case("body") :
{
_oldDamage = _unit getHitPointDamage "HitBody";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _bodyMultiplier);
};
case("hands") :
{
_oldDamage = _unit getHitPointDamage "HitHands";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _handsMultiplier);
};
case("legs") :
{
_oldDamage = _unit getHitPointDamage "HitLegs";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _legsMultiplier);
};
case("") :
{
if (time == _unit getVariable ["LastDamageTime", 0]) exitWith {_return = 0};
_oldDamage = getDammage AI;
_return = _oldDamage + ((_passedDamage - _oldDamage) * _overAllMultiplier);
_unit setVariable ["LastDamageTime", time];
};
default{
_return = 0;
};
};
_return
}];
wow cheers ๐
i used this link if youre curious about the source https://www.armaholic.com/forums.php?m=posts&q=29428
i didnt change anything apart from the multiplier
i die in like ... about 3 hits lmao
did i do something wrong and i'm actually taking more damage than normal?
@little raptor sorry but can i post a screenshot here
theres an error message
it says "error local variable in global space"
thank you
died after one shot from a 9mm pistol ๐ญ
i leave the init field of the unit blank right?
so under object:init in attributes i gave the object in this case an aaf rifle man the variable name "guy1" without the quotation marks
@little raptor can i post a screenshot anywhere
but yes the unit in question's variable name is definitely "guy1"
@vestal field why don't you just put that code in the unit's init box?
And replace guy1 with this in the code (only the code, not the variable name)
alright np will do
how many hits did your guy take? @little raptor
still dies in 1-2 hits after placing the code in the init field
weapon the ai used on me is the mp443
Are you running ACE?
how many hits did your guy take?
whole mag didn't hurt my guy
nope no ace
i had it on in a earlier scenario but i dont want any interference so i made a new one from scratch without ace
the only addons i have adds objects like rhs/cup nothing that alters any game mechanics like ace
im also testing with vanilia ingame units
@little raptor is there a way to check if the sqf file is working properly?
like bring up a debug menu ingame
put some hint or systemChat at the end
https://steamcommunity.com/sharedfiles/filedetails/?id=2289328606 heres the mission if you wanna test it
@little raptor i just cant figure it out sorry, could you upload or send me your mission.VR and let me test to see if it works?
@vestal field The code should work if you simply changed guy1 to player:
player addEventhandler ...
Simply make that change and execute the code in the debug console
If it doesn't work, you have a mod conflict or something
Ok that's weird. The code doesn't work for me now
I mean it does reduce the damage but it takes me 4-5 shots to kill someone
yea its weird
i cant change it to player as a variable name are you getting that too?
it says restricted characters
not the player name
I said change the code
And try it in the debug console
But doesn't matter now since there's something else wrong
yea i changed it to player
do i just paste the whole code into debug console and hit enter?
@vestal field it was a code issue
Try it again
And increase the damage multipliers
@little raptor weird its working now lol he emptied 2 mags into me
because I fixed it
I changed the code dude. I mean are you using the old one on your PC?
the one you posted at 1:53pm (for me) so about 2 hours ago
no the one you posted in this chat
I didn't send you any code
yea its just weird because it wasnt working 2 hours ago, but i stuffed around with the name and now it just decided to work
guy1 addEventHandler ["HandleDamage",
{
params ["_unit", "_selection", "_passedDamage"];
private ["_return"];
_bodyMultiplier = 0.1;
_legsMultiplier = 0.1;
_handsMultiplier = 0.1;
_headMultiplier = 0.1;
_overAllMultiplier = 0.1;
switch (_selection) do
{
case("head") :
{
_oldDamage = _unit getHitPointDamage "HitHead";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _headMultiplier);
};
case("body") :
{
_oldDamage = _unit getHitPointDamage "HitBody";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _bodyMultiplier);
};
case("hands") :
{
_oldDamage = _unit getHitPointDamage "HitHands";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _handsMultiplier);
};
case("legs") :
{
_oldDamage = _unit getHitPointDamage "HitLegs";
_return = _oldDamage + ((_passedDamage - _oldDamage) * _legsMultiplier);
};
case("") :
{
_return = _passedDamage
};
default{
};
};
_return
}];
@little raptor this one
well yeah I changed it
not really
alright ill try making the multipliers higher
Your arms and legs can take damage
It won't make any difference
@vestal field ok fully fixed now
try the updated code
it was a timing issue
alright thanks again ๐
Your character was taking damage multiple times per frame
@vestal field I think you're using your own code again
that's what you should use
Only problem is that i gotta fire from the debug console for it to function but beside that thanks heaps 
@vestal field in the script change guy1 to this and use it in the init box. ๐ฉ
And learn some SQF if you intend to use scripts
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
copy pasting scripts without even knowing what they do is not a good idea
ok will do, i checked some videos of other ppl doing something similar (not to alter the same functions but they gave the variable name something arbitrary like blue1/red1), and it was working for them so i assumed it shouldnt matter what i name it.
their was much simpler however and only to perform a function like notifying ammo is reloaded so i guess theres a big diff
i checked some videos
most of them are really bad. don't learn programming from videos
You can also learn from other people's scripts (altho it's better to steer off obscure mods). then look up the commands on the wiki to learn what they do and how stuff works
And if you have any questions, feel free to post it here.
https://www.youtube.com/watch?v=rOs4TnckRG0&ab_channel=SneakyKittyGaming this is the video i tried to learn from and code in case you need reference
in case you need reference
why would I?!
thanks, ill try to improve on my coding
idk lol
his codes were working for him so i assumed it should be the same on my end
why would I?!
cuz u bad hue hue hue
im not tryna accuse anyone of giving a crap guide here but ok
j/k, don't worry ๐
hello
I'm trying to optimize an MP mission
and came across this function
https://community.bistudio.com/wiki/BIS_fnc_replaceWithSimpleObject
apparently using this on a large amount of props clogs the server network.
But the biki says this
In MP it is better to directly create the simple object, if possible, to avoid the unneeded network traffic.
which makes me think, is there a way turn every placed object in the mission into a CreateSimpleObject script?
In this way there would be no need to replacing, only creating, which would defenitely decrease traffic.
if something like this exists/would be created it would really change things for mission makers.
there is a tickbox in the object's properties "Simple Object" @smoky verge - you can select all and mass-tick
its not present for all objects, only physx ones
and before you say "then it doesn't need it" I can guarantee there is a difference, for more info check the convo in #arma3_questions
I was not about to. I know https://community.bistudio.com/wiki/Arma_3_Simple_Objects this page and its graphs
is there a way turn every placed object in the mission into a CreateSimpleObject script?
no, just the tickbox from the editor
you could create an array with type/position/vectorDirAndUp, delete everything server-side then create them client-side only (local = true)
"only" the array would be transferred
I see thanks
Sjalom!
An abstract question: in addons, you are able to preinit functions.
Is it possible to pre-init your function in mission scripting? For example in init.sqf?
@tough abyss You can define cfgFunctions with preInit=1
in description.ext?
yes
CfgFunctions can also be used in description.ext
It didn't seem to when I tried. But I will experiment some more.
@exotic flax Yes correct, that is how I added the functions :). But the BIKI seems to describe preInit as something for addons. There's also forum posts: https://forums.bohemia.net/forums/topic/218172-calling-preinit-postinit-functions-from-a-mod/ that describe this.
you could try postInit, since preInit might be too soon
My function doesn't need to load with the game. But it does need to load before mission gameplay starts.
Thanks
preInit does work before the mission initialization
perhaps what you're doing is not supposed to happen then
preStart runs at game start, which won't be called at all when in a mission.
preInit runs at mission start, BEFORE objects/modules/etc are initialized (unscheduled)
postInit runs at mission start, AFTER objects/modules/etc are initialized (scheduled)
See exact moment on https://community.bistudio.com/wiki/Initialization_Order
Someone can help me with Scripts ๐ฆ ?
i getting Error and i can't understand exactly what the problem ๐ฆ
Without looking your script, nobody
i prefer doing it in Private chat,
Then this is not the right place for you @karmic light
Just asking for security sake, is there any way to terminate or modify a spawned script without a handle to it through external means?
Just asking for security sake, is there any way to terminate or modify a spawned script without a handle to it through external means?
@dusk gust
U talk to me?
Whats the issue exactly?
idk, i got a script about Rocket Interception, and it not work pefect it gives me error lines and idk what the problem exactly,
i prefer private, becuase i could spam here xd and i wont do it here, so i asking if someone can help me and will continue in private chat \o/
Nobody cares if you spam this chat, unless it's too much
spam = too much
asking many valid questions on a topic = not spam
@karmic light ๐
_interceptor = position _launcher nearObjects [_ammo, 100] select 0;
```_can_ return [], so `select 0` on this would return nil
@karmic light โ (PS: ideally, try not to post links without description #rules)
no, no.
position _launcher nearObjects [_ammo, 100]
```this โ can return [ ] (empty array)
if you do a select 0 on an empty array, _interceptor will be undefined of course
so check first that this โ does not return an empty array
_interceptor = position _launcher nearObjects [_ammo, 100]
or, to remove the _interceptor
no, becuase u saying here 2 things so i littley confused
and ye it not my script haha
with the above script, you get near objects
then you say "hey, from this list, pick the first item"
the problem is that the list can be empty
if the list is empty, the "pick the first item" returns nil, therefore the variable is undefined
basically, you are not even checking there is something to pick from
ye haha, so i need just remove the Select?
โฆno
you need to check if the returned array is empty, and if not, continue with the first element
it suppose to talk about the system that shoot the rockets out right?
IDK this script, I am telling you where the issue comes from
script-wise, there is an error, that's it
so, there nothing to do?
you need to check if the returned array is empty, and if not, continue with the first element
there is
@dusk gust afaik no.
Anyone know how to change a texture over time?
as in, when i hit 10minutes into the mission, change one texture on the model
sleep (10 * 60);
obj setObjectTextureGlobal stuff
```@brave elk?
Sleep?!
Thanks lou, but i need it to set it to one hiddenselection
i want the screen to change texture
yesโฆ? is it a texture that can be changed with setObjectTexture/Global?
Isn't that the same as what Lou just did?
ah idk, you see i never scripted before ๐
If you know what SCP-079 is, i want to change the screens to that ai face at a certain time for cool missions
as if it were hacking the building
There's only one command to change the object textures and it's that
Thanks lou
how do i do in sp: onPlayerKilled do team switch next unit in squad
overriding with onPlayerKilled.sqs and selectPlayer should do
well syntax wise i am lost.
what did you try so far?
i thought i could find a snippet for that, or somthing similar to modify it. while i can change some things, i still can't write my own code
a very detailed/cut down code that should work:
onPlayerKilled.sqf
if (isMultiplayer) exitWith {};
params ["_oldUnit"];
private _group = group _oldUnit;
sleep 3; // time to die
private _units = units _group;
if (_units isEqualTo []) exitWith { enableEndDialog };
private _unit = _units select 0;
selectPlayer _unit;
no, such command does not exist
the line says "if it is multiplayer, do not do anything"
ah
@winter rose its not working, if i die i get the restart and team switch dialog
i tried it also with this in the description.ext
respawn = 4;
respawnDialog = 0;
respawnButton = 0;
well 4 is wrong anyways, just noticed it
oh wait, respawn 4 = Respawn in your group. If there is no remaining AI, you will become a seagull.
but yeah its not teamswitch
it does not matter in singleplayer
ok
missionnamespace getVariable can be called from client to access a serverside variable, right?
no missionnamespace is local to every client
if it was made using setvariable with the public flag set true
@finite sail that only updates the variable once. any updates will not propagate
:)
@winter rose funny thing, if i am not the initial player and kill my self, the script works as intended
thanks, that settles the question
i have now the ability to automaticly switch to the next squad member if i get killed. this is in the onPlayerKilled.sqf:
if (isMultiplayer) exitWith {};
params ["_oldUnit"];
private _group = group _oldUnit;
sleep 3; // time to die
private _units = units _group;
if (_units isEqualTo []) exitWith { enableEndDialog };
private _unit = _units select 0;
selectPlayer _unit;
the problem is now, it works only if i am not the squad leader. if i am the squad leader and i die, i cant do anything anymore. i can switch to map and back but everything else is locked out of my controls, i have to kill the game then, cause there is no other interaction possible.
replace sqf private _units = units _group; with```sqf
private _units = units _group select { alive _x };
how difficult is it to make a small CBA settings thing from a script?
~~also, where do i start looking?~~https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System#creating-a-setting
I would say CBA doc, but I am not an expert in CBA
works now! many thanks
Hi, how can I remove any items in a vehicle cargo ?
see https://community.bistudio.com/wiki/Category:Command_Group:_Vehicle_Inventory @compact maple ๐
Thanks ๐
clearBackpackCargoGlobal
clearItemCargoGlobal
clearMagazineCargoGlobal
clearWeaponCargoGlobal
were the cmd I was looking for ๐
okay, so i added my cba setting, but how do i access its value? ideally without a chaned_setting eventhandler
the settings name is the values variable name
They're just regular global vars
["AIO_enableMod", "CHECKBOX", "Enable All-in-One Command Menu", ["All-In-One Command Menu", "Initialization"] ,true, 1, {}, true] call CBA_fnc_addSetting;
_value = AIO_enableMod//true or false for checkbox
@winter rose may i bother you again, how can i re-gain high command syncs after i got team switched? ๐
i got so far: player hcSetGroup allGroups;
but looks like i have to send allgroups to a array
yeah to refine my question, how do i do: player hcSetGroup allgroups
I don't know HC well I'm afraid
@sacred slate ```sqf
{
player hcSetGroup [_x];
} forEach (allGroups select { side _x == side group player });
should do
You should also make yourself the commander (high command leader)
if (player != hcLeader _group) then {
hcLeader _group hcRemoveGroup _group;
};
player hcSetGroup [_group];
otherwise hcSetGroup wont work
writing down on paper
well, you own the wiki, write it down there! ๐
hey! just you wait, amma threaten you with an account ๐
@little raptor do you happen to know what is the third param? a string?
thanks!
hmm this add's only the first squad, lets say alpha 1-1
@winter rose The third param is a string. "teamred", etc.
the example is still wrong
F5, dear ๐
by the way, you can add an optional tag to the 2nd and 3rd param since they're not necessary
So I have a random question:
Is it possible to completely override the Lift and Drag values of an aircraft? Not augment, but replace them entirely?
I want to circumvent both the SFM and AFM via scripting.
yes, but with modding, not scripting
Well, the core of the overall mod would be via scripting. So if I understand you, then I would need to do the override via config?
Hey, I'm having difficulty activating a script to an event handler I attached to a weapon.
Should it be something like:
{
fired = "_this call [Fnc Class name]_fnc_[Fnc File name]";
};
"yes" in a way.
see https://community.bistudio.com/wiki/Arma_3_Functions_Library for more details about functions naming convention
And no need for _this
And this works if I add it into a weapons class?
Edit: Wait I think the error was I missspelt EventHandlers in my config. XD
Looking for a little guidance here relating to score...
case: player starts mission in side west, getPlayerScores player shows what you'd expect: [0,0,0,0,0,0]
player uses joinSilent to join a group not in side west, scores tracking seems to get messed up. getPlayerScores player now shows [] and doesn't update when new kills are tracked
player uses joinSilent to join back to a group in side west, score tracking has been working all along; getPlayerScores player shows all kills that were accumulated while player was in other group.
Question; how do I access these scores while player is in the non-west side?
Would it be possible to make a ForEach to play music at all my loud speakers at once by activating one of them with an addAction command.
As I've set it now I have to walk to each one to play it and obviously that get's them off beat of each-other.
@open star
By "loud speakers" you mean some in-game object right?
And not your physical loud speakers?
@worn forge Wouldn't it be better to report it on FT so that it can be fixed?
yep
Well, I wasn't sure it was a bug, yet ๐
It seems like a bug
Loud Speakers, not Load.
yeah typo
an Object yeah, just a little game object that would be used in like schools or soemthing
for Alarms, announcements, etc.
Well if so the answer is yes
["AIO_enableMod", "CHECKBOX", "Enable All-in-One Command Menu", ["All-In-One Command Menu", "Initialization"] ,true, 1, {}, true] call CBA_fnc_addSetting;
_value = AIO_enableMod//true or false for checkbox
@little raptor
oh thats simple
thanks
@open star for example your addaction code could be:
isNil {
{
playSound3D [_musicFile, _x];
} forEach [obj1, obj2, ...];
}
np
Oh cool that's a lot simpler than I would've done.
Note that I mean you should use it inside the addAction code, i.e the second param (script):
https://community.bistudio.com/wiki/addAction
for example:
object addAction ["Title",
{
isNil {
{
playSound3D [_musicFile, _x]; //music file must be defined
} forEach [obj1, obj2, ...];
}
}]
i keep forgetting over and over but:
how do i avoid errors for possibly undefined variables?
f.e. i have a global var " boolean debugmode" and that one gets initialised quite late. any way to just skip earlier checks?
isNull?
isNil
"boolean debugmode"
That doesn't seem right
I mean if it's your variable name
oh yeah, was just to clarify what it is
Alrighty, made my first feedback entry ๐