#arma3_scripting
1 messages Β· Page 645 of 1
should be
You can remind me in 9 hours when I can look at the docs
Umm you don't have problem with interceptDb. You have a problem with basic sql. You can't use prepared statements to define columns and table.
Unless that "prepare" is not using mysql driver but some custom logic (which I doubt it does) stuff like this won't work.
Should be myself driver yeah
And I think "surname,uid" is a invalid column name anyway
That whole query is invalid
Prepared statements are there to secure you from weird user input with SQLi (not only) , not build the query dynamicaly.
People tend to take the path of least resistance.
Tell people to use eh.. these server defined functions, or to hardcode queries in config file and not define them in scripts because that's unsafe.
People will ignore all safety and pluck it down to just make it work quick.
If I'd let them store database login credentials inside scripts inside their mission pbo, they totally will do that.
@hollow thistle thanks for clearing that up, in the past I've only really used SQL in PHP (where you can use prepared statements to define columns and tables) so I though the same behavior would work here.
You can't do it in php, at least not in mysql
It's entirely handled by db driver lib. Runtime does not matter.
I hope you were not joining strings from user input. ;P
This kinda explains basics of prepared statements.
Terrible
Don't call that prepared statement.
I'm sure theres some security threat other than sql injection in that case, what is it?
is there a command to restrict fire modes on infantry weapons?
is Say3D Global?
well to be fair, it also has the global tag there too so I could see how he could get confused
I didnt know those represented it. it was that I was just on some forums and people were mentioning the difference in things etc
so I keep getting the following error on mission start
23:46:51 Error position: <removeAllContainers _unit;
removeAllAssi>
23:46:51 Error removeallcontainers: Type String, expected Object
yet when I run the function in the mission, everything works fine. I have the function in question on a preinit cfgfunctions and I'm calling the function for every unit on a side in the init.sqf
the only param given to the function is an object
preinit and init.sqf? if _unit is _this#0 then may it be the string that preinit gives as _this#0?
I mean, I don't think the function is getting fed that string. I'm calling it with:
//init.sqf
//Maga Loadouts
{
[_x] call hyp_fnc_maga_loadout;
} forEach (allUnits select {side _x == independent});
//Trumper Loadouts
{
[_x] call hyp_fnc_trumper_loadout;
} forEach (allUnits select {side _x == civilian && typeOf _x == "C_man_1"});
both functions have the same params and lines at that section where the removeAllContainers is at
I think you are right, let me rearrange some stuff here and see if it goes away. I'll take it out of preInit
you said you have it on preinit though
so in cfgfunctions get rid of preinit=1; and it should be fine
how do I get a return value from remoteExec
assuming you mean from the function you remoteExec, not the jip id remoteExec returns... another remoteExec to send result back to a new fnc. or a public variable targeted at the remoteExecOwner
ahh alright I was just wondering if there's a better way of doing it
there is no getting the return from remotely executed code from the remoteexec command, because remote execution isnt instant
You can easily do it with promises though
Ah yes that solves 80% of it.
Any idea to get some feedback from a virtual firesupport thingy? so spawned in shells.
how would I go about making a translator role with ACRE 2's babel system?
i know acre_api_fnc_babelSetSpokenLanguages exists, but i'm trying to apply it to two variables, zeus and translator.
Hi, I'm using this from BIS_fnc_establishingShot but can't get the message to display...
It'll display only 1/10 times
and display for some people but not for all
I literally didn't change anything to the script
my first guess would be something wrong with the conditions on line 10 or 51.
you should add logs in and around those lines to see how far people make it when the script runs
i usually copy paste diag_log format["%1 %2",__LINE__,__FILE__]; everywhere so i know exactly which lines are/nt executing
I found a script for the spectrum device in multiplayer. Somehow, it refuses to track any targets, despite everything being set properly. Does anyone want to take a look?
@mental prairie some functions are only available when you're running the Contact expansion.
Itβs a script, it does not involve any module whatsoever.
A module is also a script, and as Ryko said, some functions are only available when you have the Contact DLC so it's possible it doesn't work properly without it.
Additionally; the functions/modules from Contact have not been dissected fully yet, so any scripts build on it might not be working completely or require additional manual work.
Hello i am a very beginner when it comes to scripting. I try to preconfigure some ACE Slideshows as function but when i call the function i get Error Generic Error in Expression can some one maybe give me a hint where i need to look
params [
["_slideObjects", [], [[]] ],
["_slideControllers", [], [[]] ]
];
[
[_slideObjects],
[_slideControllers],
[
"z\tr\addons\s3\data\slide1\tr1m1_01_co.paa",
"z\tr\addons\s3\data\slide1\tr1m1_02_co.paa"
],
[
"Slide1",
"Slide2"
], 0, "Training 1"
] call ace_slideshow_fnc_createSlideshow;
params [
["_slideObjects", [], [[]] ],
["_slideControllers", [], [[]] ]
];
[
_slideObjects, // is already an array
_slideControllers, // is already an array
[
"z\tr\addons\s3\data\slide1\tr1m1_01_co.paa",
"z\tr\addons\s3\data\slide1\tr1m1_02_co.paa"
],
[
"Slide1",
"Slide2"
], 0, "Training 1"
] call ace_slideshow_fnc_createSlideshow;
thanks i was never think about it ^^ i'm so stupid π
Is there any way to get the localization of the menu buttons? I would like to tell people where they can find and change the Custom Controls-key bindings...
which menu buttons?
do you want to use them in the mod or separately? (like in Steam Workshop description)
if you want to use them in your mod, it's really easy because they're already localized
for example, the OPTIONS button in pause menu:
getText (configFile >> "RscDisplayInterrupt" >> "controls" >> "ButtonOptions" >> "text")
anything from the vanilla game can be found in \a3\ui_f\config.cpp (or other ui_f_*), and the translation strings in \a3\language_f\stringtable.xml (or other language_f_*)
Thanks. I'll take a look whether I can find them in the config.cpp...
Hi, i trying to make an AI logic for animal, but have problem,
I think is something like 2 fsm's on this animal (default arma animal fsm) and my custom.
Is possible to disable default fsm for given animal?
yes
see KK's note on https://community.bistudio.com/wiki/createAgent
_justCreatedAnimal setVariable ["BIS_fnc_animalBehaviour_disable", true];
@winter rose i do, just after creation animal. But this animal is still doing something (i think is default fsm), maybe i doing something wrong:
bear = createAgent ["Brownbear_F", getPosATL player, [], 0, "NONE"];
bear setVariable ["BIS_fnc_animalBehaviour_disable", true];
[bear] execFSM "bear.fsm";
nope, you are doing what you are supposed to do
but since the bear is not an official animal, maybe the script does not support this feature disabling
hm, understood
thank you! I will try to define my fsm into animal config, maybe it will help
by logic - this (default animal fsm) must be listed in diag_activeMissionFSMs?
unsure
i wonder... if given a red, blue, green, or yellow wire to cut for a defuse without given any hints, which is more likely to be chosen by a player.
Each has a 25% chance to be selected π€·
that's not the question π
When all of them have the same probability, each of them is just as likely to be selected
sure if its a computer, but humans have bias
He's talking about people associating colors with purposes
by a player being the key here
I know what he's talking about.
there's no way to tell. it's completely random
yeah i think red is rock bottom lol
so?
so I just picked red randomly
i bet even with n = 30, we could see a winner by a significant amount
(@little raptor)
yeees� we are wondering what the masses would choose, a single example is pointless!
Why though, would the bomb builder use red because people would associate it with a live (aka positive) ? Or does a bomb builder care about norms and use blue as a neutral.
red may either scare people away (red = danger, forbidden) or make them associate danger = red = cutting red = cutting danger
Or is it a double bluff..
yeah I don't know which way I want to go for this one. do I follow the trope of red = live, or do I do the opposite?
or will i be even more mean and make 4 choose 2? lol
The bomb builder is already playing mind games using 4 wires, the bomb probably doesn't speak SPI
in which order?
It also depends on the type of color blindness π€
Google:
"cut the read wire" 656k results
"cut the blue wire" 527k results
"cut the green wire" 542k results
"cut the yellow wire" 297k results
in fluitkettels Dynamic Enemy Population scripts, the wire to successfully disarm the IEDs is completely random - you've got a 1 in 3 of getting it right
red*?
:U yes
can i place a small composition of some units random on the map without scripting?
but you're asking how to do stuff without scripting in the scripting channel π
in editor you can set probability of presence, set a chance that says whether the object spawns
place multiple locations, set chance down so that only one probably spawns on one of the locations you placed it at
thx
from 1 to 2 is two iterations correct? or do i have to do from 0 to 2
1 to 2 is two iterations yes
so this might be a really stupid question, but is there any way I can group items of the same type in an array together? or more specifically make an array inside the array with a count
For clarification, here's an example:
3x Item_1
2x Item_2
1x Item 3
1x Item 4```are all put into an array together by using nearestObjects, and the array ends up looking like this:
`["Item_1","Item_1","Item_1","Item_2","Item_2","Item_3","Item_4"]`
but what I want is to get the array like this
`[["Item_1",3], ["Item_2",2], ["Item_3",1], ["Item_4",1]]`
so essentially go from [element1,element2,elementN] to [[element1, count],[element2, count], [elementN, count]]
how will zbe cache or bsi dyn sim behave while intensive unit switching?
Hey so im trying to make a blackout effect, but its not going so well, this is all inside the On Activation field in a trigger.
_lightypes = [
"Lamps_base_F",
"Land_LampAirport_F",
"Land_LampSolar_F",
"Land_LampStreet_F",
"Land_LampStreet_small_F",
"PowerLines_base_F",
"Land_LampDecor_F",
"Land_LampHalogen_F",
"Land_LampHarbour_F",
"Land_LampShabby_F",
"Land_PowerPoleWooden_L_F",
"Land_NavigLight",
"Land_runway_edgelight",
"Land_runway_edgelight_blue_F",
"Land_Flush_Light_green_F",
"Land_Flush_Light_red_F",
"Land_Flush_Light_yellow_F",
"Land_Runway_PAPI",
"Land_Runway_PAPI_2",
"Land_Runway_PAPI_3",
"Land_Runway_PAPI_4",
"Land_fs_roof_F",
"Land_fs_sign_F"
];
for [{_i=0},{_i Λ (count _lighttypes)},{_i=_i+1}] do
{
_lights = getMarkerPos "Blackout" nearObjects [_lighttypes select _i, 500];
{_x setDamage 0.95} forEach _lights;
};```
It returns an error within that. And im really new to scripting so i cant find it myself haha
@winter rose
<#community_wiki message>
you writing sqc now? π€ͺ
@true frigate
tip: if you use 3 strokes at the beginning and end, you get
codeblock
check rpt logs in %localappdata%\arma 3 if the error isn't showing up on screen
nvm π
Im in arma 3 folder, where do i find the logs?
assuming you went where I told you and not your actual install directory they should be right there
the logs are the .rpt files in the screenshot you sent me
right click and open them in n++ or notepad
@true frigate
ohhh thank you haha
#arma3_scripting message < if anyone could help would be great
];
for [{_i=0},{_i Λ (count _types)},{_i=_i+1}] do
{ ```
thats not the full error
the full error should end with something like file at line ##
Ohhh they have timestamps
5-10 lines
let me copy all from one second, its just an error - expression - position - missing
];
for [{_i=0},{_i Λ (count _types)},{_i=_i+1}] do
{
>
22:53:59 Error position: <Λ (count _types)},{_i=_i+1}] do
{
>
22:53:59 Error Missing ;
22:53:59 Error in expression <"Land_fs_sign_F"
];
for [{_i=0},{_i Λ (count _types)},{_i=_i+1}] do
{
>
22:53:59 Error position: <Λ (count _types)},{_i=_i+1}] do
{
>
22:53:59 Error Missing ;```
private _itemsCount = [];
{_itemsCount pushBackUnique _x} forEach _items;
_itemsCount = _itemsCount apply {
private _item = _x;
[_x,{_x isEqualTo _item} count _items]
};
_itemsCount
Error Missing ;
^
stupid question, i know im missing a ; . but where exactly am i missing it? because i put it at the end of do and it returns the same error
again im very new to scripting - as is probably obvious by now.
i dont think you're missing a semicolor I think its syntax
the other for syntax is faster iirc
for "_i" from 0 to count _types - 1 do {```
but i dont do much with for loops
you sir, are a genius π
Result:
0.0064 ms
Cycles:
10000/10000
Code:
for [{_i=0},{_i<5},{_i=_i+1}] do {}
Result:
0.0023 ms
Cycles:
10000/10000
Code:
for "_i" from 0 to 5 do {}
much faster
now i need to figure out why the lights arent actually turning off
_lightypes = [
"Lamps_base_F",
"Land_LampAirport_F",
"Land_LampSolar_F",
"Land_LampStreet_F",
"Land_LampStreet_small_F",
"PowerLines_base_F",
"Land_LampDecor_F",
"Land_LampHalogen_F",
"Land_LampHarbour_F",
"Land_LampShabby_F",
"Land_PowerPoleWooden_L_F",
"Land_NavigLight",
"Land_runway_edgelight",
"Land_runway_edgelight_blue_F",
"Land_Flush_Light_green_F",
"Land_Flush_Light_red_F",
"Land_Flush_Light_yellow_F",
"Land_Runway_PAPI",
"Land_Runway_PAPI_2",
"Land_Runway_PAPI_3",
"Land_Runway_PAPI_4",
"Land_fs_roof_F",
"Land_fs_sign_F"
];
for "_i" from 0 to count _types - 1 do {
_lights = getMarkerPos "Blackout" nearObjects [_lighttypes select _i, 500];
{_x setDamage 0} forEach _lights;
};```
the hint works fine, so everything is triggering and im not getting any visible errors
for "_i" from 0 to count _types - 1 do {
_lights = getMarkerPos "Blackout" nearObjects [_lighttypes select _i, 500];
{_x setDamage 0} forEach _lights;
};
wat?
use forEach
i am
for "_i" from 0 to count _lighttypes - 1 do {
{
_lights = getMarkerPos "Blackout" nearObjects [_x, 500];
{_x setDamage 0} forEach _lights;
} forEach _lighttypes;
^^ even better
_lightypes = [
Youve seen this, ill spare the spam, it hasnt changed
];
for "_i" from 0 to count _types - 1 do
{
_lights = getMarkerPos "Blackout" nearObjects [_x, 500];
{_x setDamage 0} forEach _lights;
} forEach _lighttypes;```
is it like trying to teach a brick wall?
π
remove the for
better than my friend, he didnt have notepad installed. Somehow managed to remove notepad from windows
dont ask how because im not sure π€£
scripting on windows notepad π¬
scripting π¬
Notepad++ is my go to for general stuff
{
_lights = getMarkerPos "Blackout" nearObjects [_x, 500];
{_x setDamage 0} forEach _lights;
} forEach _lighttypes;```
better? π
remove the whole for loop I meant 
ohhhh lol
_lightypes = [
a lotta lights
];
{
_lights = getMarkerPos "Blackout" nearObjects [_x, 500];
{_x setDamage 0} forEach _lights;
} forEach _lighttypes;```
hopefully the last time i have to post this lol, trying not to be too much of an idiot
if switch while else then do {
// your code
} forEach count throw try sleep;
π€£

the most important part is trying, they are toying a bit with you but don't lose patience/hope/faith π
Ahhh its all good theyre better than me π
they butter be helpful or I fite'em π π
btw... the code in the channel description needs to change...
IF (script == true) THEN {chat here};
``` it returns an error π€£
```sqf
if (_scripting) then {systemChat "here";};
``` looks way better
not since 2.00
Not everyone is good at teaching and explaining.
Many people here are experts on a high level, usually not dealing with so low level problems.
And it's been years they've been at that level, not remembering what they would've needed to get told to understand something
π 
okay now i dont know if ive got the light names wrong, because its still not working
Try changing the setDamage 0 to a setDamage 1.
It won't work as you want to, but atleast you should see effect
The light types I saw look correct, atleast the majority
but if the lights are "alive" then wont that just make them "alive" again
Depends on the terrain tho, but I guess you're testing on altis or Stratis
Chernarus, it might use different light names
setDamage to 1 will kill lights
Damage 1 == dead
I shouldve specified that
Oh really? i thought damage 0 was
ohhhh
i get it
damage 0 means no damage taken
Uh. Not sure. It's likely there are atleast some lights that will work on cherno.
I don't know what lights they exactly use
doesnt look like it had any effect π¦
let me try with an eden placed light, that way i can get the exact name
There is a better way to write it with isKindOf (the nearestX command that does that) most lights inherit common class.
Dunno it's name
I wrote a blackout script a few months ago.
@dolph man did you have the lights script?
Land_lamp_F π
@acoustic turret βοΈ
okay no its my script thats the issue, even with the correct light name, it didnt register
no damage
_lightypes = [
"Land_PortableLight_double_F",
];
{
_lights = getMarkerPos "Blackout" nearObjects [_x, 500];
{_x setDamage 1} forEach _lights;
} forEach _lighttypes;```
Do you know how the debug console works?
I wonder if nearestObjects is faster?
it doesnt return all lamp types
not at all π
Try out just your nearObjects line in debug console and see if you get what you expect
_lights = nearestObjects [getMarkerPos "Blackout", _lighttypes, 500];
I think that's faster
how would i do that? and test if it worked?
@acoustic turret reeee.
Did you have the blackout, lights out script?
Answer plox π¬
wait is the debug just the box that pops up when you hit esc in game?
Take your nearObjects line.
Replace the _x by one of your light classnames.
Remove the _lights= infront of it.
Put it in debug console and press local execute
yes
Cuz right now all thats in there is Qwfsm`
try what I wrote
one line
nearestObjects [getMarkerPos "Blackout", _lighttypes, 500];
this doesnt return all light types
and define _lighttypes too
y ping me re
Read message
ok sec
Error, type any, expected array
a quick test in tanoa main city has nearestObjects returning 102 objects and nearObjects combined returning 202
na what would make you think that
Undefined variable
i cheese everything and hardly do anything "for real" lol
and define _lighttypes too
I made it for someone who builds missions. And you do that :u
its all under a thin curtain thats good for 99% of players
maximum cheese
doin 1-2 missions weekly for years no time for script
Then I dunno who has it.
Maugrim probably sleep.
My lights out script works on many terrains :u
Okay so
cause i asked mason if he has one, than was too lazy to implement it and cheesed it anyway but mason said that kirito has one
This is what i put in the execute box
getMarkerPos "Blackout" nearObjects ["Land_PortableLight_double_F",500];
and this is what it returned
[20566b37580# 1033497: portablelight_double_f.p3d]
does this work for preplaced map lamps only or for editor placed ones too ?
why not?
I found it!
Forget about it working everywhere tho. It's crap and I can't believe that came from me...
{
private _lamps = thisTrigger nearObjects [_x, 5000]; //radius in metern, thisTrigger kann auch variablenname von objekt sein
{_x setDamage 1} forEach _lamps;
} foreach ["Lamps_Base_F","Land_PowerPoleWooden_F", "Land_LampHarbour_F", "Land_LampShabby_F", "Land_PowerPoleWooden_L_F", "Land_PowerPoleWooden_small_F", "Land_LampDecor_F", "Land_LampHalogen_F", "Land_LampSolar_F", "Land_LampStreet_small_F", "Land_LampStreet_F", "Land_LampAirport_F", "Land_PowerPoleWooden_L_F", "PowerLines_base_F"];
Power Outage script von Dudemen
Funkioniert super in trigger
I thought I had something more fancy.
Maybe I should slep
That means that part of your script is working atleast.
Now you know the problem is not on that line
idk
na i was looking for a emp script thats what i asked mason for
I think the above was the one that didn't work for fuel stations
Could i use _lighttypes instead of portablelight?
pretty sure kirito used some kind of blackout/emp script in Operation Arctic 03.04.2020
affecting radios as well
Not in nearObjects I think. It only takes one type
The others are talking about nearestObject which can take your multiple types, but apparently there might be some issue with it?
so getMarkerPos "Blackout" nearObjects [_lighttypes, 500]; wouldnt work?
no
im gonna try this one
dont, it doesnt work as well
Ah yeah. That was mine, it was only radio tho afaik.
I assumed you'd ask me about it I could've pulled it out
But it also didn't work in the mission, had to manually fix it 
i remember it would not stop and we had problems getting the radios workin again
So we know your _lights variable works, you just tested it.
To me it looks like the rest should work too.
Yeah I had to manually run the un-jam script. But I think it was trigger not activating fault.
That's the only thing left. But it looks correct to me
Lighttypes won't work
They are strings, you can't setDamage on a string, only on an object.
Just try your whole script in debug console
@true frigate
hint "Initiating blackout. Standby for transformer overload...";
_lightypes = [ >>>>>>>>>>>>>>>>>>>>>>>>> Find the diff
"Land_PortableLight_double_F",
];
{
_lights = getMarkerPos "Blackout" nearObjects [_x, 500];
{_x setDamage 1} forEach _lights;
} forEach _lighttypes; >>>>>>>>>>>>>>>>>>>>>>>>>>> Find the diff
_lightypes != _lighttypes
me confusion
Double check your variable names
*unconfuses @true frigate*
this was not very effective
cheers π€£
Well sometimes a fresh look just help... for hours u get confused thinking hardcore details, then it turns out stuff like this
true tho
it is why taking a break is good
Wait did i mistype a variable name...
Oh tip, notepad++, double click your variable names so it highlights other places where you used the same.
Can show typoes really easily.
Just click around a bit while staring at the screen, instead of just staring
Also camelCase helps spotting issues light this
if it works first try now im gonna facepalm into next week
Or snake_case
....
Well I got a meeting to attend in about 9 hours so I better sleep.
You have a good typo and frustration littered day/night.
it worked

or using visual code and a corresponding visual code plugin π€ͺ

No, plugin buggy
but plugin can be fixed if one does it

np, took my precious 5 seconds :<
as I said, fresh eyes see different ^^
take a break :P
Will do haha
thank you
Okay, so the majority of the lights are disabled, good news, its working
bad news, there are still some lights not listed under my Lighttypes
You can send link to image
oh theyre just outside of a store
Are they part of the building? Or seperate objects
Part of building is annoying, and might actually not even be solvable
Yes works. And yes is part of building
if need be
You'd need to setHitPointDamage which I can't explain now.
You can also get rid of the building completely
i can destroy the building. For my backstory its a war torn city
but not sure how that ties into a blackout lol
or how i find the object name of the building
Object name is easy
Go in-game, aim at the building
Go to debug console and execute
typeOf cursorObject
Have fun, good night 
Thank you for your help everyone π
[
tp_1,
"To Roof",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeoff2_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeoff2_ca.paa",
"tp_1 distance _target < 3",
"_caller distance _target < 3",
{},
{},
{_caller setpos getpos tp_2},
{},
[],
1,
0,
false,
false,
] call BIS_fnc_holdActionAdd;
I'm having an issue with that hold action in a object init field mentioning a missing [. Can anyone give me hand here?
one , too many
not added to the object, but you could add the action to the player and only show it if near the object
depends on what you mean by invisible though. actions wouldnt work if the object is hideObject true i believe, but objects that are just invisible/textureless models should still work. i know the invisible wall works with actions
I just want an interaction on an object that can't be seen. I tried clicking the show model box in the attributes but the interaction wouldn't show
Anyone have any clue on how to decrease the size of trigger over time? I'm trying to make a battle royale styled zone.
if you used createTrigger to create the trigger you should be able to update the size with setTriggerArea
how can I append a value to an array inside an array
specifically all arrays inside an array
like this?
{_x pushBack _value} forEach _array
I'm not sure how to decrease the size without manually doing it as I plan to have it in a while loop
_curSize = worldSize / 2;
_minSize = 25;
_steps = 10;
// create trigger at center of terrain
_trigger = createTrigger ["EmptyDetector", [worldSize / 2, worldSize / 2, 0]];
// make trigger fill the terrain
_trigger setTriggerArea [_curSize, _curSize, 0, false, -1];
_running = true;
while {_running} do {
sleep 30; // wait 30 seconds
// don't make trigger smaller... end of round
if (_curSize <= _minSize) then { _running = false; };
// get new trigger size
_curSize = (_curSize - _minSize) / 100 * _steps;
// set new trigger size
_trigger setTriggerArea [_curSize, _curSize, 0, false, -1];
};
something like this
I'm not sure how I should change _curSize for a 65 by 155 area
that is a very strange size for an area in a battle royal style system π€
although you can easily modify the script to have an X and Y value
Not exactly a battle royale, just a shrinking border.
oh I think I know how to do it now
lineIntersectsSurfaces would be the answer
you can use the invisible wall object for this, I do that all the time
Also the VR BallsSpheres with transparent texture.
local
it does now π
that's what shβ π
no worries - don't hesitate to tell us in #community_wiki if needed π
ammocrate = createVehicle ["B_CargoNet_01_ammo_F",[], 0, "NONE"];
_ammocrate = createVehicle ["B_CargoNet_01_ammo_F",[], 0, "NONE"];
addMissionEventHandler ["Draw3D", {
drawIcon3D [
"",
[1, 1, 1, 0.5],
getPos _crate,
1,
1,
0,
"LOADOUT Drop",
2,
0.0325,
"PuristaSemibold",
"center",
FALSE
];
}];
ammocrate will work but not _ammocrate maybe because it local (idkπ ) is there a way to get it to work (locally) i call the script more than once, and i would like for each crate to get its own marker
ammocrate, _ammocrate or _crate? 
But yes, it fails because _crate (or whatever) does not exist in the Mission EH scope.
Put all your crates into a missionNamespace array and go through that array with drawIcon3D and forEach, should solve your problem.
Hello all! I am having some difficulties trying to create an explosion when a player defuses a bomb with an addaction. For some reason the explosion does not do any damage to the player that is doing the addaction, but the other players around him do get damage. Here is my code.
Inside BR_fnc_SpawnBomb:
if !(isServer) exitwith {};
// Spawn bomb
_bomb = (selectRandom "Land_Suitcase_F") createvehicle (getmarkerpos _bombspawn);
// Add action to defuse bomb for all units WEST(I took out the rest of the pieces of the addaction as it is not relevant to the question)
[_bomb, "<t color='#FFD25525'>Defuse bomb</t>", {_this call BR_fnc_BombDefuse}] remoteExec ["BIS_fnc_holdActionAdd",WEST,true];
Inside BR_fnc_BombDefuse (executed local on player that did the addaction):
_bomb = _this select 0;
// Execute BR_fnc_DeleteAll globally.
[_bomb, true] remoteExec ["BR_fnc_DeleteAll", 0, true];
Inside BR_fnc_DeleteAll (executed globally):
_bomb = _this select 0;
_explode = _this select 1;
// Let the server create the explosion vehicle
if (isserver && _explode) then {
[_bomb] call BR_fnc_BombExplode;
};
Inside BR_fnc_Explode (executed by server):
_bomb = _this select 0;
_explosions = ["DemoCharge_Remote_Ammo_Scripted","SatchelCharge_Remote_Ammo_Scripted","ClaymoreDirectionalMine_Remote_Ammo_Scripted"];
// Select a random explosion
_choice = selectRandom _explosions;
// Based on https://community.bistudio.com/wiki/createVehicle example 6
_explosion = _choice createVehicle position _bomb;
_explosion setDamage 1;
_crateis not defined in the EH- don't use
getPos. useASLtoAGL getPosWorldVisual _crateinstead
- don't use
positionandgetPos
selectRandom "Land_Suitcase_F"
?!
[_bomb, true] remoteExec ["BR_fnc_DeleteAll", 0, true];
wasn't the explosion server only? (not the issue but a waste of network bandwidth, unless you do other things in that function too)
I don't see anything else wrong. I guess it's related to the position, but not sure.
and one more thing:
_bomb = _this select 0;
_explode = _this select 1;
params ["_bomb", "_explode"];
I only show the relevant parts of the code. So the _bomb = (selectRandom "Land_Suitcase_F") createvehicle (getmarkerpos _bombspawn); part should be _bomb = "Land_Suitcase_F" createvehicle (getmarkerpos _bombspawn); ofcourse. There is an array of varias objects which i selectrandom.
yeah I figured
but again, that's not the problem
jup, i know it spawns and i know that everything - in theory - should work properly.. but for some reason the player doing the addaction does not get the relevant damage
as mentioned, replace position with the appropriate position alternative
it could be the issue
i will try that thank you so much
for example, use:
ASLtoAGL getPosASL _bomb
Anyone who knows whether this issue was ever fixed?
https://www.youtube.com/watch?v=Rx_e_5aRPQk (video of issues with set/getUnitLoadout syncing)
If I want to do so AIs won't enter a specific area
Anyone got a good method?
Basically the players need to defend an area but that's difficult when AIs can just walk through the walls
How are the walls made?
Properly set up and placed objects are the only thing that can block movement.
Hello everyone!, i'm making a respawn script and i keep getting an error saying "Generic error in expression" if Respawn_Point isn't equal to "plane", does anyone know why?
if (Respawn_Point == "plane") then
{
if respawnpoint is an onbject, "planw" is a string (or maybe a marker)
they are different datatypes, so generic error
cant compare things that aren't alike
its a variable? that's not helpful.. is it an array? a position? an object?
oh sorry, its a string(i think), this is what i've put in the init
Respawn_Point = "plane";
i hope this helps
it doesnt π
i can send the script if you want
brb, lunchtime
alright
thanks il check it out now
this lists them, open each one to see what they are for
its a position, ive almost got it figured out now
which one is a position?
ok, so it's actually an array that has numbers? [123234, 76547643,0] for example?
maybe, i tried an array but i gave me an error saying "array given, expected object, number, string, "etc..
ok, i'm worried you've got rid of the error by throwing stuff at it, rather than understanding what was wrong and how you fixed it
something which we all do sometimes π
i did throw stuff at it
hehe
How do I find out the current ammo of a player and put it in a box for them? Its for a resupply script, but dont want just every bit of ammo under the sun
just to save any confusion, you're asking about magazines, ammo is something different
and https://community.bistudio.com/wiki/magazines returns the magazines the player has
but bear in mind, that will only get magazines they have, it might be better to get the magazines from all the weapons they are carrying if you want to strategically fill an ammo box for them
I have a small question about
systemTime
when calling it on the server, time of the server is given - but is it true, when calling it on the client, the time of the client is given?
I want to create a permanent text on screen which shows the current date and time of the client (for easier support, when showing screenshots)
Hello! I want to make a mission where I have to kill all my enemies in a building. My issue is the task is not workink (when the enemeis dead mission is success) and they are always leaving the building. Can someone send a link abaut how can i set the ai to not leave the building and when they are all dead the mission is success?
https://community.bistudio.com/wiki/systemTime
it returns the local machine's system time yes
So how do I get that? _magazinesAmmoFull = magazinesAmmoFull player; ?
primaryweapon player
will get the rifle
secondaryweapon player will get the tube
not sure how to get the pistol
having got those, you'll need to get which magazine each uses
Got it cheers
primaryWeaponMagazine
will return the magazine of their primary, but (and this is an assumption)
ONLY if they have one of the magazines in their inventory
which I don't think is what your wafter
Okay will read through that wiki too, thankyou
π good luck
_mags = magazines player;
_mag = ( selectRandom ( _mags ) );
_crate addMagazineCargoGlobal [_mag , (random 10)];
``` Seems to be working thankyou
Yup
@valid abyss
use isEqualTo instead of ==
and make sure Respawn_Point is defined
if not, replace it with:
(missionNamespace getVariable ["Respawn_Point", ""]) isEqualTo "plane";
he's mixing case in his string names... I'd be using == instead of isequalto right now
string == string is case insenstive
iirc
yes, but the actual problem is he's mixing types
yeah, i think he's fixed it, but doesnt know how he fixed it
which is less than ideal
use doStop to stop the AI from moving:
https://community.bistudio.com/wiki/doStop
(they may stay move to take cover, which means they may still exit the building)
as for how to win, there are many ways, such as triggers, event handlers, etc.
for example, for the trigger version, you can place a server trigger with:
activation: "EAST", "NOT PRESENT" (
_trigger setTriggerActivation ["EAST", "NOT PRESENT", false])
on activation code: mission completion code, for example: "EveryoneWon" call BIS_fnc_endMissionServer;
You may need another trigger with the opposite activation for losing ("ANYPLAYER", "NOT PRESENT")
and the event handler method involves using the "Killed" event handler.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPKilled
It could be a bit harder to get this to work (especially for beginners), but it's the preferred method
I'm not a mission maker so I'm not sure if there are easier and better ways to do it via Eden for example
Thanks, Iβve fixed it now by replacing the string with an object variable
I have a small issue that maybe some folks out here could help me with
I have this _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. _vehicle enableVehicleSensor ["ActiveRadarSensorComponent",false]; _vehicle enableVehicleSensor ["IRSensorComponent",false]; _vehicle enableVehicleSensor ["VisualSensorComponent",false]; _vehicle enableVehicleSensor ["PassiveRadarSensorComponent",false]; _vehicle enableVehicleSensor ["LaserSensorComponent",false]; _vehicle enableVehicleSensor ["NVSensorComponent",false]; [_vehicle] call life_fnc_clearVehicleAmmo;
The disableTIEquipment works
life_fnc_clearVehicleAmmo works and is called fine
but for some reason
all of the enableVehicleSensor are ineffective
but when i run them manually clientside they work too π€‘
anyone has any idea why?
local command?
should we even bother ourselves with the life (community) issues?
yes as long as it is not about l*fe
perhaps his tag is life π€£
life == ban
no, it is not a l*fe issue
quickly registers dead as my person tag
nope, illegal l*fe servers == ban
which might be 90%, but not 100%.
I thought they're all illegal
its a tricky one, isnt it... life mods pushed a2 from nowhere to the top of the charts and made BI a considerable amount of money, yet almost all of the nonlife community actively shun it
nope, the framework itself isn't
most (from what I heard/read/know) are, because they use ripped content or use paywalls - but not all of them
there are even officially monetised servers
but that's offtopic π
which is 100% illegal
what is?
offtopic
Yes, it works as a local command, but not when run in a servermod
so it's a local command, which needs to be executed on all clients
meh, so there's no way around to execute it globally?
unless you rewrite the RV Engine... I'm afraid not
well ok, thanks π
and would be glad to discuss with people "hating" on life in #offtopic_arma π
hate? perhaps not hate... despise, maybe π
I'm sure somebody made it - static weapon recoil. Any refrence script?
Did it use _veh animateSource ["mainTurret", add recoil here, 0.01]; or something else?
wat?
are you sure it's not just cam shake?
I mean legit static weapons recoil
It seems quite intuitive that somebody would do that
But now after lurking some time it seems that it's impossible?
yes it is.
the closest thing you can get is cam shake
π
i have a question which has probably been answered before, but how would i add a teleport script to an object without needing an external notepad doc with the code in it?
write all the code on the object
the "notepad doc" is just so it is easier to read and edit
so what i'd write in notepad would instead go into the innit part of the object?
yea
normally you would put the addaction command on the object and reference the sqf file. but in this case you would put the code in place of the file path
ah i see
so replace the spot the sqf file name is with the code and it should work as it would with an sqf
ah awesome
Anyone know of ways to interact with specific items in someones inventory such as using the MagazinesDetail command? I've been trying to track certain items based off their ID but I want to see if it's possible to drop them via script or transfer them specifically via script.
How do I make the AI automatically use their Night Vision and IR?
they automatically use the NVG
and they only use IR when in combat mode
So During the night, they automatically turn it on?
Adding and removing create a new ID since they are technically not the same thing anymore. Is it possible to persist the ID?
@normal abyss
as for dropping them, create a weapon holder and add the items to it (use the "cargo" vairant of the commands)
https://community.bistudio.com/wiki/addMagazineCargoGlobal
what ID?
anything you put is the inventory is a string
it has no ID
why do you want the ID?
Like I said I'm tracking the based off ID, essentially using that ID to have a work around of not being able to use Setvariable on items.
it's internal usage, and afaik not MP-sync
(and if you drop/pick-up, it may be different, unsure about that and within which restrictions)
plus, I think if you transfer an item in the inventory, it'll change
Ah so they are essentially assigned client side?
I've tested transferring through inventories they remain the same, but if the ID's don't match up in MP or are internal I guess there's not much more I can do with it.
@normal abyss are you trying to track what happens to a particular magazine?
where it goes, who has it etc?
Essentially, I've got a custom item setup in CfgMag, I know TFAR essentially does it by defining 1000 unique ones, but I'm just looking into other ways to do that.
yes
Working on some multiplayer scripting. Running into an issue with localization and order of initialization.
What I want to do is have some values that are tracked at the server level, and then a "laptop" object with an addAction that allows you to show that value via a hint.
Right now, I declare the variables and setup the handlers for them in the initServer.sqf - however, my singleplayer method of having addActions in the object init of the laptop doesn't work, because objectInit is initialized prior to initServer.
Is the "recommended" method to instead put my addactions in init.sqf (which I believe is initialized after initServer.sqf?)
idk about recommended, but if it works then sure.
according to the wiki initServer does execute before init.sqf, but idk if it actually completes execution before init.sqf starts because it is scheduled, so that is something to consider. wiki says it does but ive never tested it myself.
@robust hollow just tried it, unfortunately it doesn't work.
My add action hint is still returning "any" instead of the proper %1 param
oh, the server variable is in the action code?
Yeah
you need to use publicVariable after setting them in initServer
and again if they ever update
They update via an event handler, set in initServer.sqf
This is my initServer.sqf (or, a snippet of the relevant code)
lane1targets = [target1_1, target1_2, target1_3, target1_4, target1_5];
for "_i" from 0 to 4 step 1 do {(lane1targets select _i) animate["terc", 1]};
lane1score = 0;
target1_1 addEventHandler ["Hit", {lane1score = lane1score+1}];
target1_2 addEventHandler ["Hit", {lane1score = lane1score+1}];
target1_3 addEventHandler ["Hit", {lane1score = lane1score+1}];
target1_4 addEventHandler ["Hit", {lane1score = lane1score+1}];
target1_5 addEventHandler ["Hit", {lane1score = lane1score+1}]; ```
And I'd like to return lane1score in the addAction, so in init.sqf I have:
rangePC addAction ["Lane 1 Score", {hint format ["Lane 1: %1 out of 5", lane1score]}];
do I have to declare lane1score as a publicvariable in the initServer.sqf, or do I only have to declare it when in init.sqf?
you use publicVariable every time after you set the variable.
though given how frequently hit can fire it might get a bit hazardous for the network
So do I have to put it in the eventhandler?
yes. every time you set the variable.
target1_1 addEventHandler ["Hit", {lane1score = lane1score+1; publicVariable lane1score}];
Does that look right, in my initServer.sqf?
publicVariable "lane1score"
target1_1 addEventHandler ["Hit", {lane1score = lane1score+1; publicVariable "lane1score"}];
and after you set it to 0
I will try that now! Should only take 5-10 minutes to implement
No question but holy cow! Hashmaps!
Thank you!
Can't wait for it to come off of dev branch
@fallen thunder post in the appropriate channel, whatever its activity. Thanks
I thought that was DayZ
that too
There is a reason that TFAR, ACRE and ACE all use this scheme when they need items to store data on.
my point was that life mods and by extension, dayz transformed the arma world
and the company
Please drink a glass of milk, its healthy.

Can you fix the actions next

There are so many actions that flat out dont work
Well, i say so many... but it's probably just a few
I just happen to need these actions and none of them ended up working
Some worked halfway and some didnt work at all
no
because it'd be too late π€ͺ
plz add sqc
Could someone help em with this error
2021/01/13, 12:04:57 File mpmissions\__cur_mp.Malden\addons\ACS\resources\definitions.hpp, line 6: '/RscListbox.sizeEx': Missing ';' at the end of line 2021/01/13, 12:04:57 Error context rowHeight = 0.03;
I tried to run it in visual code but cannot get language for hpp
oh also...sizeex has been fixed
2021/01/13, 12:04:23 Warning Message: File addons\ACS\resources\definitions.hpp, line 8: '/RscListbox.': ';' encountered instead of '=' 2021/01/13, 12:04:23 Warning Message: Config : some input after EndOfFile.
there is also this error
i'd start by removing the ; off line 12
ok
done
@robust hollow do you have any idea for the second error? I have no idea how can it even occur because for me, everything seems ok
fixing line 12 stops all errors for me
regarding what I said here:
#arma3_editor message
I'm not sure how you make someone join the sideFriendly tho
does anyone know how?!
https://community.bistudio.com/wiki/Side_relations
does it even exist in the game?
I've never seen it
The way i would do it is place units in eden editor that are in the side you want. Even with mods, not all factions are on every side (Obviously), so this would be my solution. Place an player object and mark it as player/playable in it's attributions. Maybe someone else has a different solution
wat?
what does it have to do with sideFriendly ?
And in arma, sides are not labeled as friendly/enemy/neutral. Only indipendante can have attributes set to be enemy/friendly with west or east
This is to set the relations between the factions.
If I'm correct
@robust hollow What app did u use to check hpp
cfgconvert
this is not how sides work in Arma ^^
they have side relations, e.g blufor and opfor can be friends
thank you
Yeah i used wrong expresion... I did wrote that sideFriendly is to set relations between sides
See https://community.bistudio.com/wiki/Side_relations for more details
@winter rose U helped me a lot here. And I know you know a lot. So could you maybe help me with
2021/01/13, 12:38:33 Error context #line 1 "addons\vcom\cfgFunctions.hpp" 2021/01/13, 12:38:33 Warning Message: File description.ext, line 740: '.': '{' encountered instead of '=' 2021/01/13, 12:38:33 Warning Message: Config : some input after EndOfFile.
line 7 is line 740 in desc.ext
chaps.. does anyone know the effective range of a Titan AT? I can't get a lock beyond 2KM, but can fire an unlocked much further.. I'm wondering how far they will go and damage their target before being deleted?
it depends on the full equation of motion
timeToLive is how long they can survive
combine these and you'll get how far they'll go
locks are also limited by the object draw distance
yeah, ive cranked up object draw distance as high as it will go
cant get a lock beyond 2000m... 2KM is what the field guide says is the range of a Titan AT
but I've got unlocked Titan kills beyond that
just wondering how far they will go
It does not say "you cannot use it afar", only "cannot lock over 2km"
it's easy
you need to write a simple equation for projectile motion with quadratic drag and thrust
there are two times to consider:
t <= thrustTime -> thrust > 0
t > thrystTime -> thrust = 0
you are mocking me now lol
ok, so time to live gives, not unsurprisingly a time, not a distance
I'd need to know the velocity of the round... i think i'll just test it in mission and get an imperical answer π
may also depend on loss of velocity, angle, etc π
@finite sail
solution in MATLAB:
t = thrustTime;
v0 = initial velocity
k = drag coefficient
T = thrust
(make sure you change these vars to sqf equivalents)
#define tanh(X) ((exp(2*(X)) - 1)/(exp(2*(X)) + 1))
v = (T^(1/2)*tanh(T^(1/2)*k^(1/2)*t))/k^(1/2);
x = 1/2/k*ln((T-k*v0^2)/(T-k*v^2));
t = timeToLive - thrustTime;
v0 = v from last equation:
v = 1/(k*(t + 1/(k*v0)));
x = -ln(v/v0)/k;
```(this x must be added to the x from the previous equation to get total travel distance)
this is not an accurate equation because it assumes that the projectile moves straight.
the full equation of motion doesn't have an explicit solution.
if you want you can check out some articles. for example:
https://www.atiner.gr/journals/sciences/2014-1-2-2-Chudinov.pdf
gulp
wow, thanks for looking that up
its way beyond my paygrade lol
probably be quicker for me to test in game... so far, a titan will hit at 3,2 km
i think teh game models top attack and direct attack mode... at least you can switch between the 2, not sure if the flight path is actaully different
aha
the round detonated before the end of a 4km flight
so between 3.2 and 4
Hello, I have a problem with a remoteexeccall, normally I never do with this kind of call but I had to make a stupid error. The problem comes from the declaration of the functions I think but I declared it both in the cfgremoteexec and in the config cpp on the server side
you can't "declare" (define) functions in cfgRemoveExec
non sorry is translate is not #define is this F(INO_fnc_scommande,SERVER)
does anyone know the command for an ai to surrender and put their hands up? i only know the scripting command setCaptive but there it just changes the sides to civilian. other way is to zeus it, set the surrender state manually. but i want activate it with a trigger so four ais surrender at the same time...looked into the bi commands list but cant find it...
@little raptor thanks man. Is this mp compatible? How do i set it up in a trigger? I mean the activation field. If my unit has the variable s1 and i want him.to surrender on the radio command Alpha, what do i have to type in?
s1 action ["Surrender"]
???
s1 action ["Surrender", s1]
it has global effect:
https://community.bistudio.com/wiki/action
so it's MP compatible as it is
and your trigger must be executed by one client
preferably the server
Hey guys, I've been building out a mission with the ALiVE mod lately and when I go to add in the Dynamic Groups stuff to IniServer.sqg and InitPlayerLocal.sqf but it just seems to break my missions lobby and makes it unable to select any of the player slots to actually begin the mission with.
Any thoughts? Am I missing a step or something important elsewhere?
I just did what the BIKI says, doing option 1 for both files.
it also seems to work fine locally on an MP server hosted on my computer but when I put it up to the dedicated server thats when I get the issue.
Is BIS_fnc_setUnitInsignia still bugged in MP (especially JIP), because for some reason it doesn't set the insignia on dedicated servers...
is there a way to let BIS_fnc_dynamicText permanent? just set the seconds higher then the server is online?
create your own "dynamic text"
Does anyone know how to script in custom respawn loadouts? I have 1 working but I cant add in more than 1. It just will not show up. I'm using BIS_fnc_addRespawnInventory
and how do you do it exactly?
Should I send my Description and Init files?
I'm quite new to this so I cant really explain what I have done. I just referenced tutorials
Ahh Its to large bare with
Sorry for being vague I don't have a clue what I'm doing I stayed up all night trying to figure this out
the issue is quite obvious:
https://community.bistudio.com/wiki/BIS_fnc_addRespawnInventory
call the function twice
{
[west, _x] call BIS_fnc_addRespawnInventory;
} forEach ["TGAF1", "TGAF2"];
naturally, if you want more than these two, add them to the array
["TGAF1", "TGAF2", "TGAF3", ...]
Ok thanks I'll give it a go
Feel like such an idiot. I do just replace whats in my init.sqf with what you sent correct?
you can add it wherever you want it to execute
if it was in your init, then yeah, replace it there
I'm getting a error saying [BIS_fnc_addRespawnInventory] "TGAF2" not found in CfgRespawnInventory or CfgVehicles
did you actually create the inventory?
I just used what you showed me in the screenshot
so if it's not defined, define it
Yeah I did in Description.ext
Thats what the name is defined as
check your description.ext again
if it's defined, it should work
and you should completely exit the mission and start it again
restart won't update description.ext
Ok I've got it working now. Thank you for the help
Is it possible to change the thickness of the line created using drawLine3D?
i dont believe so
Yeah didn't have much hope
It's possible AFAIK, but not reliable, and will cause unnecessary consequences
I'm intrigued, can you elaborate? How do you do it, and what are the consequences?
i guess one hacky way is to draw multiple lines with slight variations in the position π€·
onEachFrame {
for "_i" from -0.01 to 0.01 step 0.0025 do {
drawLine3D [player modelToWorld [_i,0,0], cursorTarget modelToWorld [_i,0,0], [1,1,1,1]];
};
};
Via modding CfgCoreData (IIRC). It defines how thick those lines including 2D lines or such, so if I try to make it thicker, every single line in game will become thicker
well there you go. they are textures
configfile >> "CfgCoreData" >> "textureLine"
configfile >> "CfgCoreData" >> "textureLine3D"
Yeah interesting but... It's always better to set thickness via the command's argument
Dedmen, pwease?
Would be nice π
So I would have to create my own addon config with ```
class CfgCoreData {
textureLine3D="";
};
Yes IIRC
Okay, thanks I will give it a try π
https://feedback.bistudio.com/T122512
Pour your heart out on it
Hey guys, I'm having some issues playing around with cameras. No matter what I do in the camCreate command, it always spawns the camera at [0,0,0]
private _camera = "camera" camCreate (ASLToAGL eyePos player);
_camera camPrepareTarget player;
_camera camPrepareRelPos [0, -5, 10];
_camera cameraEffect ["internal", "back"];
_camera camCommitPrepared 0;
waitUntil { camCommitted _camera };
_camera camPrepareRelPos [0, 5, 2];
_camera camCommitPrepared 5;
waitUntil { camCommitted _camera };
sleep 30;
_camera cameraEffect ["terminate", "back"];
camDestroy _camera;
And then the camera flies towards the player, running as normal.
@frail egret what is your intent? If you move _camera camPrepareRelPos [0, -5, 10]; underneath _camera camCommitPrepared 0; it doesn't fly from somewhere out on the map
Not sure if this has an exact answer, but why do while and waitUntil only allow code blocks instead of bools like if statements?
because if only evaluates once, but while/waituntil evaluates on every iteration
so you provide the code to evaluate, instead of evaluated code
Ohhhh, right. facepalm
I need a little input trying to get a particle effect looking better. I do want it to look like a water stream falling from the (currently imaginary) ceiling.
Right now it looks like this
https://i.imgur.com/0xuuean.png
The particle params are currently this.
[
["\a3\data_f\ParticleEffects\Universal\Universal.p3d", 16, 12, 8],
"",
"BillBoard",
1,
4,
[0,0,0],
[0, 0, 0],
0,
1.39,
1,
0,
[0.2,0.2,0.2,0.2,0.2,0.2,0.1],
[[0.7,0.7,0.8,0.3], [0.7,0.7,0.8,0.7]],
[1],
1,
0,
"",
"",
_particleSource,
0,
true,
0,
[[0.8,0.7,0.2,0]]
]
I already tried to use the refract texture, it does look better but is almost invisible in low light environment.
tickhet
@still forum already exists:
https://feedback.bistudio.com/T122512
π
When will breakWith arrive in game?
when the stable comes out 
it's already in dev branch
Hello all, I am currently dealing with a weird issue that I am unable to fix.
I run a mission where players do team based PVP. Each match lasts only for a couple of min after which they all get moved to spawn where they can choose loadouts and vehicles.
For some reason a client occasionally gets a bug where their gun makes no sound for other clients when firing. If you attempt to retrieve the bugged client's weaponclass with currentWeapon then it return a silly name like "Throw" or "Grenade" even though the client has equiped an actual weapon. I've tried re-assigning their loadout using setLoadout / getLoadout but it doesn't always fix it.
Does anybody else experience something similiar?
No, but it sounds like there is a missing addon somewhere
Anyway to make an animation play to its full duration (1) then after its done make it return to its place of origin? (0)
And then possibly repeating that over and over until turned off by user action.
Thanks I will look into that, by the description it sounds like I would have to create 2 seperate animations. But thats fine.
Hello, is it possible to add an option to an item so that players could go into spectators view?
Like that one
you could do this:
player addAction ["Spectate", {["Initialize", [player, [], true ]] call BIS_fnc_EGSpectator;}];```
You'd probably also have to code in a way to leave it once you're in. I pulled that code from this:
That was fast...thank you man
For getting out of it without debug console access you could probably do a keybind or replace the abort button with a close button the same way that the splendid camera does
Hrm...I'll try to think of something
Sounds good, the code for closing it is this:
["Terminate"] call BIS_fnc_EGSpectator;```
What kind of Keybind would it be with that one?
You'd have to create one. If you'd like to figure out how to do that here are the steps:
You'll need to do a bind a UI event handler to execute some code (the closing code). Here are all of the UI eventhandlers: https://community.bistudio.com/wiki/User_Interface_Event_Handlers
(Probably you'll want to use onKeyDown)
You can find the spectator display using findDisplay, im not sure what the ID of the spectator display is so you'd need to do some searching. Then you just say if the pressed key is whatever key you want then execute the terminate code
Just found it actually, spectator display seems to be 60492
It's a vanilla mission. No mods loaded. The weapon itself is visible to all clients, its just the sound not producing
How could one check if a player has any form of a weapon, that being primary, secondary or launcher? Seems like all the answers I found require large scripts which more or less appear to do way more than what I need.
I know of hasWeapon but with that I'd need to list weapons. The only way to use this would be if I could get a list of all weapons.
I do realize that not always is there a simple solution, but it'd be preferrable over a wall of text.
primaryWeapon player + secondaryWeapon player + handgunWeapon player == ""```
So that will return false if said player has a weapon equipped (I don't want weapons in backpacks to trigger it)
this will return false if a player has any equipped weapon (rifle, handgun, launcher)
backpack weapons not considered
Yeah, I just realized my typing error, but yeah.
what does the getPos script do exactly? from what i understand it's used to activate a module using a trigger using a marker? could this be done (setting a location to activate the module at) in gameplay?
thanks i've read that but could this script be used to activate the module at a designated location during gameplay rather than just in the editor?
getPos does get, not set
so i should be looking at set instead?
Yes I think? Depends on activate you meaning
i explained more thoroughly what i'm trying to do here #arma3_editor
what don't you get with Don't crosspost? I explained it to you earlier: do not post in multiple channels about the same thing
so where do i ask my question? i was unsure whether i'd be in trouble for posting it here which is why i redirected to a related topic
it is an editor-related question, let's keep it to #arma3_editor, no problem - unless it goes way into #arma3_scripting
but then we will move the conversation here. that is to prevent multiple threads on the same topic (and having to navigate in multiple channels to find the info)
right i'll lurk in editor for the time being
thanks π
@winter rose Thanks btw, the script works as intended now. I was having trouble at first since the sqf file worked perfectly fine except for the part where it should've checked weapons. Issue turned out to be the fact that having _ at the start of the object name (_player in this case) was not tolerated for this part.
noice!
Not sure why, could be related to my script but if I call tvSetCurSel it crashes my game. But if I do it manually through debug console it doesn't. I'm not sure what could be causing this π€ Any suggestions?
share your script
private _display = uiNamespace getVariable "structuresCameraDisplay";
private _structureList = _display displayCtrl 1501;
if (_intersect in structuresCameraLocalObjects && structuresCameraLMB && !structuresCameraDragging) then {
structuresCameraSelectedObjectOffset = _offset;
structuresCameraSelectedObject = _intersect;
structuresCameraSelectedObjectLastValidSpot = getPos structuresCameraSelectedObject;
private _index = structuresCameraLocalObjects find structuresCameraSelectedObject;
//_structureList tvSetCurSel [0, _index]; // crashes game for some reason?
};
if (_intersect isEqualTo objNull && structuresCameraLMB && !structuresCameraDragging) then {
structuresCameraSelectedObject = objNull;
_structureList tvSetCurSel [-1];
};```
This is the bit that causes the crash, if you want the whole thing I can upload to pastebin
I've already confirmed that the parent exists and the index returned from find is correct
idk really. my only guess would be the _index is out of the tv range but you've already checked that.
i'd change it to only select [0] and see if that works, then [0,0], then [0,_index] again and see at which point does it start crashing.
Ah yeah, I'll give that a shot
is that script scheduled?
No
could also try [_structureList,_index] spawn {(_this#0) tvSetCurSel [0,_this#1]};
just incase it is one of those ui things that doesnt like happening in the same frame as something else
make sure to spawn that other one as well just to be safe
okay, thanks!
I'm trying to test my script in the editor, but it seems remoteExecute isn't working
[_source, "jihadi_song"] remoteExec ["say3D", -2, true];
//_source say3D "jihadi_song";
the commented line works, but the one above doesn't
I did not
throw it in your description.ext
not needed by default�
Oh, my bad
is "jihadi_song" the classname?
it should be the file path
_source say3D "jihadi_song" works fine though?
class CfgRemoteExec
{
class Commands
{
mode = 1;
jip = 1;
class say3D { allowedTargets = 1; };
};
};
lou may be thinking of playSound3D π€
my bad, I was thinking β that 
no worries
no need for CfgRemoteExec
no?
I'm just in the editor
you are testing in editor with -2. you are 2 so it excludes you
just remoteExec without number argument, it's identical to using 0
I do want to exclude the server in an actual multiplayer environment though
you don't, because a server can be a player π
when its a dedicated host?
right that's what I assumed
make your mission to be playable everywhere
it's not going to cost anything regarding performance
because by default, everything is allowed
only use it to restrict (safen) your mission
oh I see
If I remoteExec something from client to server, how can I set a variable back on the client (ie. player setVariable) I'm currently passing player as a parameter in the remoteExec but doesn't seem to work
I know there's remoteExecOwner but seeing as how it's a number I wasn't sure if it'd work
and on top of that some of my scripts involve more than one player
i guess what I'm asking is how can I pass a player as a parameter via remoteExec
[player] remoteExecCall ["myFnc",2];
// myFnc
params ["_unit"];
_unit setVariable ["myVar",_value];// sets value on the unit, only the server can see the variable
_unit setVariable ["myVar",_value,remoteExecutedOwner];// sets value on unit, only player can see the variable
you meaning one of those?
ahhhh was I supposed to be using remoteExecutedOwner as the third param for setVariable? I've been setting it as true
ahh alright
thanks as always
@robust hollow would it be possible to do owner _unit in the script above if I'm calling another script through the remoteExec'd script, or should I pass the net ID through the remoteExec
on the server, yes.
if I'm calling another script through the remoteExec'd script
if by "calling" you literally mean calling ([] call fnc) thenremoteExecutedOwnershould still work in lower functions because they are executing in the remoteExec context
i believe that is the case anyway, other context based things work like that
[] remoteExec [serverfnc,2]
inside serverfnc:
[] call fnc_defined_in_functions_library
even if it's not an inline function?
yea that should be fine. give it a try
alright cool
inline vs variable functions are no different in that sense.
Hey i am the biggest newb with this stuff can anyone explain to me why this wont work if i put it in the init on a static weapon
this addEventHandler
[
"Reloaded",
{
_player setVehicleAmmo 1;
}
];
But this will
this addEventHandler ["Reloaded",{(_this select 0) setVehicleAmmo 1}]
_player is a local variable (indicated by the _); when the EH code is executed, it can not access that variable.
_this is a parameter that the EH passes to your EH code when it fires, that's why you can use that.
_localVar = "Sample text";
systemChat _localVar; //_localVar is available here.
GlobalVar = "Sample text";
systemChat GlobalVar; //GlobalVar is available here (and everywhere else after the line above).
MyObject addEventHandler ["Reloaded", {
systemChat _localVar; //_localVar is not available here. As a local variable, it stops existing once the script (file) ends, and the EH code is executed long after that (and has its own scope).
systemChat GlobalVar; //GlobalVar is available here.
}];
execVM "myScript.sqf"; //_localVar is not available in myScript.sqf (because myScript.sqf has its own scope), but GlobalVar is available.
[_localVar] execVM "myScript.sqf"; //_localVar is available as (_this # 0) in myScript.sqf, GlobalVar is also available (as GlobalVar).
```Read https://community.bistudio.com/wiki/Variables#Scopes to learn more about scopes.
Hi all, looking for some advice on selecting an array and passing it to playSound3D specifically the ASL information provided by the hitPart EH
In my config.cpp i've added my EH to the object with
{
hitPart="(_this) execVM '\pathto\myscript.sqf';";
};```
and in my script.sqf I have;
```private ["_target", "_pos"];
_target = ((_this select 0) select 0);
_pos = ((_this select 3) select 0);
before I call playSound3D. When I then use playSound3D ["pathto\mysound.wss", _target, false, _pos, 2, 5, 1000]; I get an error: zero divisor on the _pos variable. I've tried changing the source of _pos to _pos = _this select 3; and I'm also hitting the same error.
Does select work when I'm trying to select the array from hitPart or am I barking up the wrong tree?
try to get some info from the array
like what it returns
cuz I'm not sure
type this at the beginning of your script:
systemChat str _this;
copyToClipboard str _this;
then retrigger the event handler, see what it gives you
Thanks, this is a good idea - give me a mo.
also, instead of select, you can use param
param has a safeguard against out of bound errors
and you can provide a default value if the index is out of bounds
and if you want all elements from your array, use params instead:
_this with hitpart returns;
[[1d8f279cb80# 5: blinktroll.p3d,B Alpha 1-1:1 (Vils),<NULL-object>,[5054.36,4045.45,6.66185],[-345.144,657.913,9.94668],["blinktroll"],[10,0,0,0,"B_65x39_Caseless"],[-0.045738,-0.998954,-0],0.403605,"a3\data_f\penetration\armour_plate_12mm.bisurf",true]]```
Yeah
So in my brain,
_pos = _this select 3;
Should assign the ASL of the EH to _pos unless I'm missing something
it's SQF if you're trying to do the syntax highlighting (see the pinned messages)
you have a nested array
the wiki shows the proper way to do it:
this addEventHandler ["HitPart", {
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
}];
so your pos is:
_pos = _this#0#3;
also it's not called the "ASL position of the EH"
because EH is just a code
I'm having issues with one of the scripts...could someone help me trace the origin of error
Error in expression <tposatl _nearestRoad) getDir (getposatl _connectedRoad)); _vehicle setDir _roadD> 16:58:40 Error position: <_connectedRoad)); _vehicle setDir _roadD> 16:58:40 Error Undefined variable in expression: _connectedroad 16:58:40 File mpmissions\__cur_mp.Malden\addons\vAiDriving\vAiDriving.sqf..., line 429 16:58:41 Error in expression <tposatl _nearestRoad) getDir (getposatl _connectedRoad)); _vehicle setDir _roadD>
and this error `Error in expression <alden\addons\scripts\radio.sqf"
_loop = this select 1;
_run = true;if !(_loop)>
16:58:16 Error position: <this select 1;
_run = true;if !(_loop)>`
also...is it radio script actually bad written? Just asking since i see loop in it and I know this is not good for CPU
the problem at the second script is tat "this" is not defined or smth
Set up sharex with imgur and problems werent
thats the error. the road array is probably empty thats why it says undefined
this needs to be _this.
The loop uses sleep, so it's not bad.
thank you guys π
so roadDir should come first
if I understand the image corect
correct*
no the arrow point at the source of the error
awwwhhh
you are trying to get nearby roads, and the select the first one. but if it finds no road, you select "null" as your first road and you can operate on "null" -> error
so you need a check to prevent that.
also your second script can be enhanced a tiny bit:
https://pastebin.com/8Ga0q4P6
this is a variable that only exists inside special scripts like the editor init field. dont use it in your normal scripts
its "_this" in your scripts
contains the parameters passed to your script
if (isNull _nearestRoad) then { _roadListSorted = [_roadList, [], { _vehicle distance2D _x }, "ASCEND"] call BIS_fnc_sortBy; _nearestRoad = _roadListSorted select 0; };
owki :3
This is like the security if the output is null
but still
it's on 418 line
that doesnt look very secure
ah so if your nearestRoad is null you just get the closest one by sorting all roads by distance
ye
can you guarantee that _roadList is never empty?
could you use _nearestRoad if there are no roads connected to it?
yes
When in went into the game the AI was on the road but they were just bumping into each other
done
I just increased the size of
radius: Number - (Optional, default 50) search radius from centerfor BIS_fnc_nearestRoad
to 500
ig that should be enough
it was at 20 earlier
thats not really safe tho. your script can still crash if you re just unlucky
how about you set _connectedRoad = _nearestRoad if its null?
I mean, the default is 50
since you always have a nearestRoad afai can tell right?
or you could just skip the part with the connected road if it doesnt find one
done
Will test and come back with results
I have to fix something in eden first
just a quick question
could this be edited so it would automaticlly control all vehicles
<vehicle> remoteExec ["AIDC_fnc_init"]
not just the vehicles I input
i was wondering if i could use vehicle variable or _vehicle
but dunno if that would work
hmm, if i understand correctly what you are asking, cba xeh is the easiest way to do this
what would be the variable? or can you teahc me how...I've only copied scripts using CBA, not actually wrote one
that would run the script on server + all clients for the single vehicle. what you are looking for is a way to run it for every vehicle -> spawned eventhandler.
not sure if arma provides one, CBA probably does
unit Event Handler (added locally)
So im working on an eventhandler that counts how many times a unit has been hit makes the unit invincible, im using it for accuracy testing and It was working last night but now its broken. The EH is firing and the counter is going up, but the unit is dying. according to the EH documentation the last value in the EH is the new damage, so the unit should take no damage, but they are still dying, can anyone see anything wrong here?
this disableAI "Move"; tgt setUnitPos 'Middle';
lastTick = 0;
x = 0;
this addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (diag_tickTime - .1> lastTick) then{
x = x + 1;
Systemchat str(x);
};
lastTick = diag_tickTime;
0;
}];
The diagTick is just to make sure x only gets counted once per bullet hit, bc the EH is firing multible times every time a soldier gets hit
Got any mods running? For example ACE?
Yeah I have ACE and OPTRE running
Il try vanilla see if that changes anything
Well theres my issue, vanilla works fine
I thought I had ACE loaded last night but i guess I dint
Well, ACE has it's own damage system, so that EH will work for logging but not for handling the damage
yeah that makes sense, thanks
use the unit's namespace (using setVariable) instead of those global vars to avoid conflicts
will do, thanks for the tip
so I'm looking for a great code that allowed the host - through console - to dynamically reassign zeus module to certain zeus slot with variable. I'm having an issue that in uncertain cases when zeuses join game (either JIP or on start) their slots are not connected to proper zeus modules. it is possible to reassign the modules again with the console, but I have no idea how to achieve that. Any suggestions?
just to be clear if I player setVariable ["varname",value,TRUE] it will only set it on the unit and not all players? I was using Connor's example for me last night and realized the server couldn't read these player variables, and most of these variables in question need to be read by server.
^ i run that player setVariable serverside btw
player is local to the computer that runs the command
I pass player to the server as a variable, it works fine I just wanted to make sure by setting the publicity to true it wouldn't set it on other players as well since I read in the wiki on the player page that it's executed globally, wasn't sure if that meant it would execute it on all players or make it public to all clients
i'm assuming its the latter though
I have no idea what you just said, but check out:
https://community.bistudio.com/wiki/assignCurator
https://community.bistudio.com/wiki/unassignCurator
also, you need to use _curator setVariable ["owner", getPlayerUID _newOwner] if you change the owner
are you sure you're reading the Bohemia Interactive wiki?!
https://community.bistudio.com/wiki/player
player is local
where do you get global from?
so I have to add variables to the modules too?
Boolean - when true, the variable broadcast is global and persistent Effects of this scripting command are broadcasted over the network and happen on every computer in the network
https://community.bistudio.com/wiki/setVariable
Go ahead and ignore I see that I was correct, I just wanted to make absolutely sure
true means broadcast this variable to other machines for this object
right thanks
//Server:
Player1 setVariable ["MyVar", 1, true];
Player2 setVariable ["MyVar", 2, true];
//Everybody:
Player1 getVariable "MyVar"; //1 on all machines.
Player2 getVariable "MyVar"; //2 on all machines.
what do you mean?
I mean that I have to assign proper variables to curator modules too? so each module has it's own variable
english keeps getting harder and harder for me 
what do you mean by variable? that's what I don't understand
that curator's module is named "module_zeus_1", second one is "module_zeus_2" etc
ok
well that depends on how you want to do it
if you want to work with those variable names then yeah
but there might be better alternatives depending on what you want
also, your question seems to be related to #arma3_editor
I think you're not setting up the slots properly
it should work as it is
I don't think it's possible to set up zeus slots wrong, but thanks for clarifying, I'll move the topic to another channel
I think you need to set the owner too
like that example I showed you
_curator setVariable ["owner", getPlayerUID _newOwner]
I've never created any MP missions so I'm not sure if this is necessary in Editor
Maybe someone else can clarify
The module has a field where you can fill in the variable name of the slot (placeholder) unit iirc.
yes, I know that and I always place curators like that. but the problem is that even with proper Zeus set up there's something wrong with execution of this module that sometimes they just don't connect to owners
I can restart same mission 6 times and 3 times the Zeus works, 3 times it's not assigned.
@still forum
Think we could get another parameter on the say3D playsound series? Since we have an offset of start time, could we get an end time as well? Could be really nice to have one big master voiceline/sound file and just point to different sections.
Also had that issue a couple of times.
Usually it helps to start the server and let it rest for 5min before joining.
Alternative is to use a scripted way to create the Zeus module
no
I remember using a script that was searching for any modules preplaced in mission, selecting one by number (something select #0 and some more code, can't really recall) and reassigning to the user's slot. it was quite efficient but I don't have the script now and I have too small brain to reproduce it.
1. Get all curators.
2. Find one that has no (valid) owner.
3. Assign new owner.
Execute that in initPlayerLocal.sqf for every player that should have Zeus access.
Possible use remoteExec spawn or call from PlayerConnected event handler directly on player?
π€¨
explain in more detail
i have PlayerConnected evh on server side, and i trying execute code from handler to player , [[],{diag_log "somde"}] remoteExec ["call",_owner]; But it doesn't work
BUT! If i remoteExec, for example BIS_fnc_endmission, function executed success
does your server block call or spawn?
in cfgRemoteExec: https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec
also, have you defined _owner?
server ignores cfgremoteexec
right, server ignore config, but it not work
have you defined _owner?
are you saying that this works for example:
["end1"] remoteExec ["BIS_fnc_endmission", _owner];
but this doesn't?
[[],{diag_log "somde"}] remoteExec ["call",_owner];

