#arma3_scripting
1 messages Β· Page 22 of 1
I wouldn't necessarily bother.
For fine tuning the velocity I assume I'm just changing the 30 in both of these?
yes.
Gotcha, should be all -- thanks for the help π
hello! I have a question is there a way to add weapon optics Eg. for the addWeaponTurret
like adding the HMG from an APC to another vehicle then enabling optics for aim
That would require config changes (and maybe model changes)
ok π¦
is there a script command that can run an input on the player's behalf?
i.e if the player presses shift to run, I can have a script that forces the player to stand up
Weird Question is there a script or method for me to introduce artifical lag/low fps, so i can test my scripts funcs under those conditions to ensure proper output
spawn a bunch of scripts π
omg thank you, my brain is running at half power right now so this really helps β€οΈ
i am trying and failing to find something that causes lag but dosent crash me instantly
just run something like
[] spawn {
for "_" from 0 to 10000 do {
[] spawn {
while { true } do { sleep 1; }
}
}
}
I'm getting an unknown enumerator error for player action ["Stand", player];
https://community.bistudio.com/wiki/inputAction/actions
any idea why that is?
the script works perfectly otherwise, but it doesn't recognize the action
ah ok
I'm not finding anything here to change the player's stance
ooh, that works in the console, let's see if it works in the script
ah it works, but it freezes all player inputs lol
π€
I'm trying to add a switchAction with an empty recipient to see if that overrides it
I suspect the action lasts a fair bit longer than the animation, thus only "ending" sometime after the animation has played out
i just tried what i sent and it works fine, no input freezing or anything like that
must be a local problem then
I had a good 10 seconds of input freeze afterward
could still look around but not move
ah yeah, because I had it inside a while true loop
thanks for the help!
I am using ctrlTextHeight to set the size of my structured text control, but it doesn't seem to be getting it quite right...
Here is my script:```sqf
_ctrlTitle ctrlSetStructuredText parseText ("<t size='1.25'>" + _title);
_ctrlMessage ctrlSetStructuredText parseText _message;
_ctrlTitle ctrlSetPosition [1.2, -0.37, 0.3125, 0];
_ctrlMessage ctrlSetPosition [1.2, -0.31, 0.3125, 0];
private _titleHeight = ctrlTextHeight _ctrlTitle;
private _messageHeight = ctrlTextHeight _ctrlMessage;
_ctrlTitle ctrlSetPositionH _titleHeight;
_ctrlMessage ctrlSetPositionH _messageHeight;
Here is what is showing up on screen: https://imgur.com/a/yx7Zr3v
I am repeating the script with different messages. It seems to be getting it correct for the 1-liners, but giving me values too high for the longer ones.
Is there a script that would force a player to place their backpack on the ground? Like with a "Hold Space" Prompt?
I think there's a drop backpack action
bis_fnc_holdActionAdd with the action command to drop bag
set initial ctrl height to something high
set the text, then call ctrlTextHeight
also ctrlCommit before you get the height
ok
bis_fnc_holdActionAdd; player action ["DropBag", _gwh, typeOf OPTRE_Fury_Backpack_Nuke player]; trying this, but its saying im missing a [ , not sure where its suppossed to go
making stuff up will not magically make it work 
Is it possible to add some text to a TV or other monitor? Would like to add a countdown.
or would it require making 60 texture files and swapping them by script?
texture files i'm guessing
bis_fnc_holdActionAdd; gwh = "a" createVehicle getPosATL player;
player action ["DropBag", _gwh, OPTRE_Fury_Backpack_Nuke player]; changed it a bit, it its still giving the same error
you are trying to combine two separate steps.
Step 1: write script to force the player to drop the bag
Step 2: input it into the holdAction function
ah
you need to follow syntax on the wiki for both of these steps
@maiden bay I think these are all the resources you need to achieve your goal
lmk if you have specific questions about the instructions on the page
actually you also need to create a weaponHolder to contain the bag
Can it be any object, or has to be something with an inventory
the target needs to have an inventory I believe
its supposed to be placed at the foot of an object
with the wording on it the wiki, it says it can be placed on the ground, assuming an invis helipad would work
no, you need to use a weapon holder
https://community.bistudio.com/wiki/createVehicle to create an object of class "GroundWeaponHolder" at the desired position
you can get a position array by either right clicking in eden and logging the position to clipboard or using a getter like getRelPos
hm interesting, i might be able to just spawn the backpack or nuke object
so your list is now
- create weaponholder
- force player to drop bag into weaponholder
- incorporate script into hold action
i believe you still need to make a groundweaponholder to physically spawn the backpack
Honestly, it really dosent have to be a hold action, it can just be a clikc promt
the hold action is the simplest part
here is an example of creating a groundweaponholder
oooofffffff, thats some large stuff
_target = "GroundWeaponHolder" createVehicle (player getRelPos [0.5, 0]);
player action ["DropBag", _target, backpack player];
```example of creating a weapon holder and dropping the bag into it
all of these commands highlighted in red have wiki pages
actually there's already a working example on the wiki
see example 2 under the DropBag action
(and comments explaining why it's better than the code I just wrote)
how would i ensure that a trigger only works while one player is inside the trigger area?
is this right?
{isPlayer _x && side _x == west} count thisList == 1
What do you mean by "a trigger [...] works"?
the trigger is set to:
any player
repeatable
I want the trigger to only work for one player at a time. So if a player is in the trigger area, it should not work for other players entering the trigger area
In that case, yes, your condition should work.
Since the trigger activation is set to Any player, you can remove isPlayer _x from the condition (because thisList only contains players for triggers with that activation).
how can I disable both a geometry and roadway lod of an object?
disablecollisionwith is stated to not disable the roadway
tried to attach it to something else but I don't think that actually matters
scaling an object up often does the job but I need the original size
at which point? If inside BIS_fnc_findSafePos - then it's probably because your last argument if just one position, when the function calls for two
_questDestination returns number
And this number always is first number of building cords array (x)
so, trouble in ```sqf
, getPosATL _questBuilding]
but if u do like that , u always get center of object
, [getPosATL _questBuilding, getPosATL _questBuilding]]
Well, that's it then π€·ββοΈ the function expects to see two default positions in the last argument
My bad then...May be
anyone able to help, I'm trying to get friendly targets on sensor / radar to show as enemy instead of friendly. But cant seem to find the right place to look.
Is there a command for detecting whether a position is on the underside of an object? Everything I've tried to do thus far hasn't worked as intended...
How can I enable team switch on an AI during gameplay with zeus
https://community.bistudio.com/wiki/teamSwitch
You can force it if you are playing and you have debug enabled to logged admin from mission display
cursorObject enableAi "teamSwitch";
Curator display
(curatorSelected #0#0) enableAi "teamSwitch";
(I'm not sure of curator selected array, cannot test that currently, but you can check what it return on watchlist curatorSelected #0#0
Or use
curatorMouseOver #0
https://community.bistudio.com/wiki/curatorMouseOver
When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it _unit enableAI "TeamSwitch" so that the unit continues with waypoints.
So im trying to do this in singleplayer, which means im admin automatically right?
Yeah π
If you have debug console showing when you play you can use these , you can change that from settings or enable via description.ext
Here is guide to do that
https://community.bistudio.com/wiki/Arma_3:_Debug_Console
Is this what your talking about
Well I cant send a picture
But when I press ESC it shows an "extended debug console"
Yeah, then you have it
I have zeus enhanced
Sweet, now I just type in "cursorObject enableAi "teamSwitch";" this and it;ll work?
Should yeah
When it says "cursorObject" does this mean I select the unit and then press ESC and type that in?
And just point that ai what you want or from Zeus use selected
And in single player you can use command
https://community.bistudio.com/wiki/addSwitchableUnit
Hello, I've seen select being used in scripts, but how does it work? I've read the wiki and am still confused? can someone help me understand this?
which part are you confused about?
im just wondering how do you use it? and its general purpose
ok ill read it again!
examples at the bottom
Hello! is there a way to stop playing a sound? I'm using `playSound3D and want it to stop when an action is stopped, how can I accomplish this?
no, use https://community.bistudio.com/wiki/say3D instead
it returns a sound source which you can https://community.bistudio.com/wiki/deleteVehicle
will this delete the sound or my object or both when used?
only the sound
ok thanks!
see example 3
of say3D
its saying my sound isnt found but it was working on playSound3D
say3D takes a classname not a path
make a CfgSounds definition if you havent already
how do you do that?
see description.ext on the wiki
k
Can i delete the dust from a explosion?
From "HelicopterExploBig" explosion.
This explosion generates lot's of small dust objects.
Anyone know of a script that disables the "load" option in Zeus spawned Virtual Arsenals?
I'm trying to make a truly limited arsenal that will get players actually involved in the stories I'm trying to create for them
Is _args ever a magic word in sqf?
I got a peculiar piece of code that does indeed work but refers to _args without ever defining it and the wiki is silent on it
what piece?
magic word is more or less something that the engine sets in the scope
i never recall any _args
[[_target] call LOOTER_fnc_calcLootTime, [_target, _nearestVehicle], {[_args select 0, _args select 1] call COMPILE_FILE(fnc_lootContainer)}, {false}, "Looting", [_args select 0] call LOOTER_fnc_canLoot] call ace_common_fnc_progressBar;
It's from Looting Enhanced
Nowhere is that variable ever set
https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_progressBar.sqf#L47 its set here
nothing magic about it
But how does that work?
The call is not coming from the same scope
it is though
that hurts my brain xD
So cause a variable by that name is defined in the function I am calling I can refer to it in the paramters I give to that function?
_forwardCall = {
params ["_fn", "_args"];
call _fn;
};
[{ hint _args }, "Hello"] call _forwardCall
it's defined in many places, i'm slow
It's not defined in the code that calls it
just look at the snippet i sent
and I'm still used to programming languages that would laugh at you for trying sth like that
its literally what it is
yeah, as I said, it doesn't work like I'd expect it to
local variables carry into child scopes
its literally same thing if you wrote an if statement
But that is not carrying into a child scope, it's anticipating a variable that will defined in a child scope.
It's calling code from another mod entirely
Ok so,
I have a parachute jump target being used for a separate script that spawns objects on said target.
However I need that parachute jump target raised in height so it will then spawn the objects on top of something (E.G. an aircraft carrier). setPos?
code is just a set of instructions,
_print = { hint str _a; };
_a = 5;
call _print;
//exact same
call { hint str _a; };
if true then _print;
//exact same
if true then { hint str _a; };
good luck trying that in C++ π
well yeah obviously
sqf is basically dynamic scoping
Yeah, I hate it π It never works where I would need it and then it just fricks my brain like that
don't take a look at PHP then :p
@winter rose am i going crazy or is getPos page on the wiki incorrect? it says return in x, y, z but uses select 2 in the example for finding height..?
and what is the issue�
Yes, Z is height
surely it should be select 3
Remember, select is 0-indexed
π
Im a moron
nah, just had a brainfart
Sorry for useless ping π
That would explain why my code wasn't working too
Was trying to use select 3 in getPos
(well it's not mutually exclusive but still, don't worry π)
Excuse me while I was muted I turned nearly all my retexture config into macros and made ketamine in arma
I am frankly intellectually brilliant this past week
Can i know what Particles video settings the player is using?
i don't think so
you can maybe hack the ui though and read it from there
Q: getting my feet wet understanding procedural textures in the context of drawEllipse. Not sure this is quite the right channel to ask. More of an ellipse fill question than a texture question I think, but definitely texture protocols in nature.
https://community.bistudio.com/wiki/Procedural_Textures
How do I spec out a color that is translucent? I assume that is perhaps the alpha channel in the rbga .
Also trying to understand what the preamble means.
"#(rgb,8,8,3)color(1,0.6,0,1)"
// ^^^^^
In this example the color filling the ellipse shows up all black, which I am not sure should be the case.
"#(rgb,8,8,3)color(1,0.6,0,1)"
// ^^^^^^^^^
Even taking into consideration the alpha channel, red, green, blue are definitely not black. At least I might expect it to appear brownish.
the wiki page you linked answers the first part of your question, the second i'm not sure, have you tried argb instead if rgb?
did you also set the line color to [1,1,1,1]? (in drawEllipse)
I am not trying to render anything to surface. I have an ellipse that I am drawing on a map control via drawEllipse, would like to fill it appropriately, I grasp the alpha channel. I think the colors might be what I am looking for although a bit confusing why the first appeared more black than brown.
did you also set the line color to [1,1,1,1]? (in drawEllipse)
Re: line colors, yes, initially the color is responding correctly, with correct coloration, etc. this is next level maturation of the algo in question.
What I do not understand are the height width mips aspects...
I gather maybe this is a kind of compression (i.e. much in less) perhaps?
texture height (in pixels), texture width (in pixels), mips are (iirc) basically LODs with lower sizes
so (rgb,8,8,3) is probably optimum without getting too crazy.
so #(rgb,8,8,3) is 8x8 pixels base size with 2 extra downsized versions π€·ββοΈ
tbh i don't understand what's wrong with (rgb,1,1,1) for monochrome, but who am i to ask?
so I can focus on the color part. that's fantastic, what I need to know.
IDK either except I think maybe it is a kind of compression, at least if the wikipedia has any authority on the subject.
but this level of graphics is also not my specialization.
okay doo, thanks folks
im making a big wall going across terrain that uses scaled up wall pieces, would there be an easier way to connect them up rather than playing in single player checking its positioning then going back to editor
With the "createLocation" Syntax, where do I put the actual script?
class CfgSounds
{
class EASZombie2
{
name = "EASZombie2";
sound[] = {"sounds\EASZombie2.ogg", 1,1};
titles[] = {0,""};
};
class Othersound
{
name = "...";
sound[] = {"sounds\....ogg", 1,1};
titles[] = {0,""};
};
class Othersound
{
name = "...";
sound[] = {"sounds\....ogg", 1,1};
titles[] = {0,""};
};
};
is that correct if i wanted to add 3 custom souns?
yes!
3den enhanced has a slider in attributes for sizing which changes it in the editor
my lord arma 3 add echo to custom sound if one is inside...
depends
inside a aircraft hanger
getPos should be returning above any surfaces including objects, right..?
Or have I misunderstood and it doesn't include objects?
i want to find the height above the next surface down so yes use getpos
Or lineIntersects (or whatever it's called)
but it seems to be ignoring objects... going from the underside of a vr cube with an object beneath the position isnt including it and neither is the position being on top of the vr object
Maybe it only includes buildings. Or map-placed objects. Or some other subset. Or just inconsistent
except running getPos player on top of said object works fine as expected... 
but when i getPos of the projectile it seems to ignore all surfaces underneath...
it's "don't use setPos" ^^
yes that too
how?
ooooooh might it be that getPos makes an exception for projectiles e_e
does it actually
well when i do the sound via a trigger for a brifein inside a hanger, theres a echo.. but outside of it there is no echo.
use say3D's alt syntax, we talk scripts here sir π
i could use lineintersects........
or i could create an object on the position, getPos it, and then delete the object
this way when i start optimisation i feel better about myself
hehehe
not sure which costs more tbh
i assume it is a marginal impact
i dont know how to test the latency my code creates so i will be blissfully ignorant
also the exception isnt on the wiki as far as i can see lou
_entityPos = getPosASL _entity;
_thePosition = createVehicle["CBA_B_InvisibleTargetVehicle",_entityPos];
_thePosition setPosASL _entityPos;
_entityPosAboveFloor = getPos _thePosition;```
god i hate this
does teleport work with a module?
...and it doesnt even work
what r u trying to do?
find the height of a position above its highest surface beneath it
try a ruler
i think i will just lineintersectssurfaces
not even that works its returning the object its impacting on 
wtf
LineIntersectsSurfaces returns an array of arrays. Each array represents one intersection (it can be made to not stop at the first). The first element is the positionASL of the intersection. You can use distance, or just compare Z values, to determine how far away that position is from your reference.
its fine i think i just need to bump it down a short tad
and then i need to exit if the array is not empty
done
I have hundreds of BIS_fnc_dynamicText in my mission.
I use very big numbers for the rscLayer parameter, and now i just noticed this make the fps fall from 70 to 45. For example:
["<img shadow='0' size='3.5' image='images\shot_head.paa'/>",0,0.25,1,0,0,5343245] call BIS_fnc_dynamicText```
After this code above run, FPS drop from 70 to 45 forever.
If i change 5343245 to 12, for example (small number), the FPS is not affected.
This is a bug?
It might be, but it also might be because of how Arma handles large numbers. Any number with more than 6 digits is converted to a floating point format, e.g. 1,000,000 is actually stored as 1e+006. Your number, having 7 digits, is converted, and this may have a performance impact.
Very large floating point numbers also lose precision due to rounding. I'm not sure if your number is big enough to run into that, but it might be, and if so that's probably not good for it.
Try it with 1 less digit and see if that helps.
Better start learning GUI, it will help a lot
π
or using the UI number generator function?
Hmmm, seens good!
aren't all numbers in Arma floats?
if I had to guess, I would suppose that the GUI id system is e.g filling an array from 0 to -number- with null or something like that, assigning intermediate values
but again, it is only a guess and nothing more
Yeah, that's kinda fun.
Feels like a bug if it does that. Surely some people were using fairly arbitrary large numbers to avoid collisions.
I recall some dodgy old code in Antistasi that uses 7000 or something.
how would I go about finding what vehicle a wreck goes to? Like if I have a m1a1 wreck, how would I get the classname for m1a1
is it possible to get this from a wreck in-game?
I'd imagine the typeOf command should do fine.
Hello! I'm having an issue with the BIS_fnc_holdActionAdd its being executed globally through remoteExec, Everything works but in the progress part of the code seems not to be letting people other than me in MP use it. Here is my arguments for progression "(satc distance _caller) < 5",. satc is another object next to the target object, anyone sees a reason or possible reason that I'm the only one who can use it?
Post the full code please
GAZ_fn_Hacked = {
[
tower,
"Plant Explosives",
"\a3\ui_f_oldman\Data\IGUI\Cfg\HoldActions\destroy_ca.paa",
"\a3\ui_f_oldman\Data\IGUI\Cfg\HoldActions\destroy_ca.paa",
"true",
"(satc distance _caller) < 5",
{hint "Planting Explosives"},
{},
{call GAZ_fn_Tower_Main, [tower, _actionId ] remoteExec ["BIS_fnc_holdActionRemove", 0, tower];},
{hint "Planting Explosives\nUn-Successful!"},
[],
30,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, tower];
};```
GAZ_fn_Hacked is executed by another script
tower is the object the code is in
satc is another object placed next to tower (EDITED)
how is satc created? In editor? In some other script?
and both tower and satc are assigned those variable names in the editor?
and what happens for other people?
other players cannot progress the script
"(satc distance _caller) < 5", is to progress the action but its not letting anyone else progress
they see the action but when they go to press it its cancels out and gives the interruption message
and are they close enough to satc object? Because exactly your code works well on my machine with both in-game hosting and dedicated server π€·ββοΈ
weird ill re-test it with a friend
I just retested it twice with my friend and he says that it doesent work for him, do you think this is because of remoteExecCall? and maybe i should use remoteExec?
what remoteExecCall
im using that to execute the BIS_fnc_holdActionAdd
] remoteExec ["BIS_fnc_holdActionAdd", 0, tower];
then maybe try to use the code you've posted here π€·ββοΈ
or do you mean you remoteExecCall the GAZ_fn_Hacked?
doesn't matter
ok
maybe try to print the actual satc distance _caller in the fail message and see if anything is strange with that
ok
do i do that by adding a variable?
GAZ_fn_Hacked = {
[
tower,
"Plant Explosives",
"\a3\ui_f_oldman\Data\IGUI\Cfg\HoldActions\destroy_ca.paa",
"\a3\ui_f_oldman\Data\IGUI\Cfg\HoldActions\destroy_ca.paa",
"true",
"(satc distance _caller) < 5",
{hint "Planting Explosives"},
{},
{call GAZ_fn_Tower_Main, [tower, _actionId ] remoteExec ["BIS_fnc_holdActionRemove", 0, tower];},
{params ["_target", "_caller", "_actionId", "_arguments"]; hint str ["Planting Explosives\nUn-Successful!", satc distance _caller];}, // something like that
[],
30,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, tower];
};```
std::string a;
auto print = [&]{ Hint(a); };
a = "5";
print();
[&]{ Hint(a); }();
if (true) print();
if (true) [&]{ Hint(a); }();
but you're capturing a dats cheating!1!1 π
is it possible to remove the climb action from a ladder? I tried using removeAllActions on it but that did not work
No
Doesn't count, you declared a before using it π
All numbers are technically floats but only some are converted to the exponent format, and only some potentially lose precision.
I too was guessing, which is why I asked them to test it.
If the problem was the number being huge, but not the exponent threshold specifically, dropping one digit should have improved performance but not completely fixed it, since the number is still very big. It sounds like it did fully fix it though, so...
afaik it's only the tostring representation, it doesn't change how the number is used?
Β―_(γ)_/Β―
Unless they come back and say "actually, that only partly fixed it" then it seems being over a million is some kind of special threshold, whether it's because of the exponent or not
leaves
if i create a lightpoint via the init field of an object will it be available for all clients in MP?
should i use createVehicle or createVehicleLocal?
local
if you use an init field it will run on every client thus you will be creating a lightpoint locally on every client (which is correct)
when I do setscale the hitbox is also bigger is it like that in mp?
call { [] spawn titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaMedium' >Command</t><br /><t color='#ffffff' size='1.5' font='PuristaMedium' shadow = '2' >Copy that get out of there.</t>", "PLAIN DOWN", -1, true, true]; sleep 5; call { [] spawn titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaMedium' >Command</t><br /><t color='#ffffff' size='1.5' font='PuristaMedium' shadow = '2' >Copy that get out of there.</t>", "PLAIN DOWN", -1, true, true]; }}
anyone know how to fix that? i get a error saying suspending isnt allowed. but the top message works
You failed to spawn it
what do i need to do?
[] spawn {
// first titleText
sleep 5;
// rest of the code
}```
The Arma 3 LOD limits still apply, meaning walk-able surfaces can only be X m in size, and collision in general will only work up to X m from object center. This command works on all objects in Eden Editor or scenario preview, but it will not save and will reset when objects get moved. Eden Editor support is only intended for artists.
β
Setting the scale of non-simple objects, such as vehicles with players/AI in them, static objects (simulation = "house" in config), etc. might be possible, but not officially supported. You may encounter issues.
β
Changing the direction of the object (e.g. using setDir, setVectorDir, etc.) will reset the object back to its original size (probably because the engine normalizes the directions, thus the scale in the transformation matrix becomes 1), so those commands should be run before resizing the object.
setObjectScale is global, so yes its effects are available disregarding execution origin.
Regarding the hit box, the wiki states that this command is restricted by the same rules regarding LODs in each object, so it's would likely be limited to 100m x 100m x 1km in size, however that is also dependant on the way each object is made, so this threshold might actually be smaller case-basis. Better to outright experiment instead, since this command is used mostly for decoration, as using it in gameplay actually involves looping in non-simple objects afaik. Might be wrong, hopefully someone can complement if I'm
btw 70m* for the max size iirc
^
hey just quickly would this be a function? i can see that the brackets arent closed please ignore it sqf ncl_fnc_spookparticle2 = [] spawn {
spawn returns a Script Handle, what ncl_fnc_spookparticle2 will be
see https://community.bistudio.com/wiki/spawn
ok cool ill just change iy just had brain stop and needed smart person to tell me if not hanks lou
think it like this:
ncl_fnc_spookparticle2 = {hint "code here, inside the brackets";};
call ncl_fnc_spookparticle2;
Alternatively, instead of call, use remoteExec or Spawn according to needs and scheduling requirements.
Although, your naming convention suggest that this functions is intended for the function library, so why not declared it in cfgFunctions directly instead, since the file that contains it still needs to be execVM from its file if its not compiled?
You also get the benefit of having them be a bit more secure in the long term
I know how to fix it just can't think enough to determine if it is a function
function is (more or less) code in Arma
myBadFunc = { hint "OK" };
myScriptHandle = 0 spawn myBadFunc;
is there a way to prevent player for adding more items that he already have in inventory when I have whitelisted items in arsenal via BIS_fnc_addVirtualItemCargo ?
want to prevent example: when I have whitelisted that only medic can have Medikit, but player pick one from ground and duplicate them via arsenal
ACE does have this handled, not sure how to do it in BIS arsenal
"function" does not mean anything in sqf itself, there is no such type "function". there is only a CODE type {}, there is the CfgFunctions part, but under the hood it's no different than doing my_fnc_blabla = { hint "blabla" }; (apart from it maybe making the "function" final aka compileFinal/compileScript)
I am trying to prevent player for multiplying restricted items in arsenal, that they found on ground or picked from enemy, got this, but items from inventory are available in whitelisted arsenal
_box setVariable ["bis_addVirtualWeaponCargo_cargo", nil, true];
[_box, _items, false, false] call BIS_fnc_addVirtualItemCargo;
[_box, _weapons, false, false] call BIS_fnc_addVirtualWeaponCargo;
[_box, _magazines, false, false] call BIS_fnc_addVirtualMagazineCargo;
[_box, _backpacks, false, false] call BIS_fnc_addVirtualBackpackCargo;
["Open", [false, _box, _player]] call BIS_fnc_arsenal;
is there a code so one doesnt take friendly fire damage?
Use a HandleDamage event handler with a check to see if the shooter's side is the same as the target's, and return the existing damage value if it is.
this addEventHandler ["handleDamage", {(if (east, opfor (_this select 3) == west, blufor (_this select 0))) then {false}}];
hows one get this to work?
so like _vehWreck typeOf _vehClass ?
typeOf _vehicle == "MyVehicleClassname"
ah I should have read the typeOf docs, thanks
is there a way to add map marker info without using strategic map for example you hover over a marker and a box of info appears or something
I know you can do it with a click event on the map
this is nonsense
that will install an event handler but the attached code makes no sense
this addEventHandler ["HandleDamage", {
// Separate the EH information into easily usable variables
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
// Check the sides of the victim and shooter
if (side _unit == side _instigator) then {
// If they are the same then the new damage should be set to the same as the old damage
_damage = _unit getHit _selection;
};
// Return the damage value to override the EH. If the side check failed, this will be the normal damage the unit would take from the hit.
_damage
}];
Don't forget to read through and try to understand why this is how it is.
how do i man hook hand ghook car cdoor
Isn't sqf side group _unit isEqualTo side group _instigator a better practice?
ok so i have an array of objects and i want to turn them all into cordinates them create a vehicle at its position (a particle source) would i be able to use getpos in a foreach then turn it into a variable of cordinates then place that variable in the position part of the createvehcile?
how so?
wouldn't the group command just be an extra operation?
you're overcomplicating it
alternatively you can just create the particle source in the forEach loop (probably better, unless you need that array of coordinates)
thx
There are some instances in which the side of a unit would differ from their real "original" side, while their "Group Side" always remain the original one
besides the instigator being dead?
or damaged player being setCaptive that sets the unit's side to CIV
id like to keep the array for cleanup
then put the particle sources in the array instead
make an array and just append with pushBack when you create the particle sources, you don't need to keep the coordinates
I'm trying to get hints to execute for everyone, but is it only working for me? this is how I've structured it
CODE ---> remoteExecCall ["TAG_fn_Test", 0, testobject] ---> TAG_fn_Test = {hint "This is a Test for MP Compatibility!!!"}; (Just Something I put together for an Example use only)
because other clients don't know what TAG_fn_Test is
you have to define it on other machines too
use CfgFunctions
Why destroy a city give 25% less fps to all clients, even if they aren't near the destroyed city? https://imgur.com/OxF8eLe
I'm scripting mass destruction weapons, but this destroy a lot of houses and the more the destroyed houses, the less the general fps.
If i destroy all map houses using a simple script, fps fall to 5.
Why destroyed houses are so heavy?
Help!
try destroying, then disabling simulation of the original object + the ruin perhaps?
also how do you destroy houses
The original object is still there?
I destroy the city just by spawning lots of bombs on it.
After bombs gone, no more dust, no more craters, fps is 25% less to all players.
well then yeah, that's gonna tank the performance while things are being destroyed
if it stays the same later, yep that's bad
@winter roseβοΈ
Ops
During explosions fps is horrible, yes, but it never back to normal even after an hour.
do you want 100% of buildings down?
Before explosion: 70 fps
During explosion: 20 fps
After Explosion: 50 fps
Only one city destroyed (Kavala)βοΈ
Not 100%. I destroyed 100% of the buildings just to check performance inpact, and general fps was 10 or less, 5/7 for me.
the thing is: the server has to stream the state of each destroyed building to players, on creation and on players movement iirc (not 100% certain of this). So yeah, it has an impact
People are able to destroy cities.
But this will affect all players FPS.
Sad.
So i will make the bombs just kill AI, vehicles and players, not buildings.
π
π οΈ
maybe a scripted solution exists, but I am not certain at all
like destroying certain specific buildings locally (each client destroys his own local buildings) and disabling their simulation globally
very unsure but worth a try
Thanks for insisting in the topic, now i understand you. I already have some ideas based on what you talked. Thanks!!!
@echo yew https://community.bistudio.com/wiki/createLocation
Example 3 shows what works and what doesn't.
A lot of map markers aren't locations and you can only hide them by replacing the map, IIRC.
^
had the same problem, ruins and other destroyed map objects seem to be globally simulated for a unknown reason.
you can reduce it a bit by running this on the server (reduced simulated objects by ~35%)
{
_x enableSimulationGlobal false;
} foreach allMissionObjects "RUINS";
you still have other destroyed objects being simulated tho
tried to find out what type/kind they are but no success

Hey guys, I am trying to make a mission where the player i walked through the use of the use of ACE equipment for sniping etc. through tasks (simpleTask), and for the most part it is going very well, but for some reason I am running into an issue here. I have a task which instructs the player to move into position, and then a trigger which will make the new task when the player enters the trigger area, the use of vector-21.
Problem is that the task is shown on mission start even though no one has entered the trigger π
Activation: Any player
Activation type: Present
Trigger init: this
Trigger on activation
Sniping_Task_Vector = player createSimpleTask ["Getting target data",Sniping_Task_Parent];
Sniping_Task_Vector setSimpleTaskDestination (position Ammo_Marker);
Sniping_Task_Vector setSimpleTaskDescription [
"Using the Vector-21 you can aquire data on your target (long explaination following)",
"Getting target data",
"Getting target data"
];
Sniping_Task_Vector setSimpleTaskType "scout";
Sniping_Task_Vector setTaskState "Assigned";
["TaskAssigned", ["", "Getting target data"]] call BIS_fnc_showNotification;
Sniping_Task_Move_2 setTaskState "Succeeded";
["TaskSucceeded", ["", "Get into position"]] call BIS_fnc_showNotification;
Thanks beforehand, hope the message isn't too long!
well are you sure that you have no players in the trigger at the beginning?
Yes 100p
well fuck
Nice, i will try! πππ
Earlier this year IIRC Leopard or Lou talked about houses and wrecks being basically duplicated when destroyed, as original houses only hide but their simulation still remain somehow. I dont remember the details, but someone suggested getting the house entities that were fully damaged, hiding them and disabling their simulation to "remove" the duplicate houses, since you cannot delete map objects. Might aswell try that
Thats not the reason the ruins are even simulated when no player is nearby ^^
Can i get the ruin class of a house? I can find only the damaged version of a house (when texture changes, damage < 1) but not the ruin class name (when damage = 1).
this addEventHandler ["Fired", {
moveOut (driver cursorObject);
hint "moved out";
}];
so im running this in debug console, i'm tryna make a "crowbar" that can get someone out of a wrecked vehicle, but its not working, the hint isnt hinting either
am i using the addEventHandler wrong? or does cursorObject not work in a event callback
could anyone help me with a mod i cant make it work properly?
Its that i dont know how can i make it work writing a command but dont know where
i'm not even sure there is a proper link from building to ruin class and not p3d model in configOf _house >> "DestructionEffects" >> "Ruin1" π€·ββοΈ At least the wiki seems to only mention the ruin model at https://community.bistudio.com/wiki/Building_Configs
is this defined?
if you're running that in debug console
need context
https://community.bistudio.com/wiki/Building_Land_Classes also says that. So the way to find a ruin class would be to find a DestructionEffect with "ruin" simulation, get a "type" from that and find a "Ruin" subclass with matching "model" property. And if i read correctly they may no even be a matching strings 
well it's right there in the example
i dont know how can i set this mod to a flagpole like where do i have to write it
initPlayerLocal.sqf i'm assuming is where you'd want to run that
its not in the ini of the object? like in the ini of the flag i want to make it work
?
Thanks!
Strange thing: I'm on stable 2.10, and i can't create a ruin object with createSimpleObject or createVehicle, the result is allways a null object, i tried with "Land_Cargo_Tower_V3_ruins_F" (i checked and this class exists).
what u mean like too early??
sorry i am really new in scripting arma 3 so i am just starting to learn
although now that i think about it, there is a BIS_fnc_createRuin function. Let me check the source :3
yeah, it seems to look into the "Ruin1" effect 
π
and dev 2.10 creates said class for me with createVehicle [ "Land_Cargo_Tower_V3_ruins_F", screenToWorld [0.5,0.5], [], 15, "NONE"] π€
Yes, i was wrong. I can create a ruin, my code was fault π¬
is this a valid trigger activation condition?
{
if (_x isKindOf "Car") exitWith { true; };
} forEach thisList;
meh
remove ; after true
no
thislist findIf { _x isKindOf "Car" } != -1
```should do the trick π
true; is not boolean
no, true is
yet the ; doesn't matter here
private _result = if (_condition) then { true; } else { false; };
_result == _condition; // true
ah thanks. Im planning on basically making it so that while vehicle wrecks are in the trigger an addAction is added to the wreck.
Are wrecks still considered their original type? like car wreck is still a car or helicopter wreck is still helicopter?
while vehicle wrecks are in the trigger an addAction is added to the wreck.
π
is that the wrong way to go about something like that?
yes ^^
"while" mean "do this until it's false"
"- is there a car? yes? add an action"
second check
"- is there a car? yes? add an action"
etc.
you then get multiple actions ^^
I was thinking add the addAction onActivation and remove it on deActivation
Are wrecks still considered their original type? like car wreck is still a car or helicopter wreck is still helicopter?
wrecks as in working vehicles that got destroyed, yes
wrecks as in "decorative asset", no
I would say a trigger is not exactly good for this
I was thinking that while looking into it. What would you recommend?
if there aren't many vehicles, you can just add actions from the get-go to them and check if they're in the trigger area as action condition
well, if trigger is used as a marker for inArea...
as long as OnAct/OnDeact is not usedβ¦
there could be alot of vehicles. I am adding a feature to liberation to be able to recover wrecks and repair them for a portion of their original cost
vehicle this fire "rhs_weap_fab250"
mig flyinHeightASL [30, 30, 30];
i have them both in a move waypoint. the jet drops bombs.
but the code gives a error
missing semicolon
; semicolon
a line return doesn't separate statements, a semicolon does
Hello guys ! Is it ok to post ace related questions here ?
ace discord may be more appropriate
Can you invite me to it, my mp should be open !
Thanks
Please ignore my dumb question, i found it in #channel_invites_list
Hello quick Q, I'm trying to assign to increment the sum of player distance2d getPosATL _object for all players that are under 20 meters of _object.
What's a non-dumbass way of achieving this?
I'm very much a script kiddie, so any hints or help would be really appreciated even if this is very basic
You actually want the distance sum, not just the count?
private _objPos = getPosATL _object;
private _allPlayers = allPlayers - entities "HeadlessClient_F";
private _nearPlayers = _allPlayers inAreaArray [_objPos, 20, 20];
increment = 0;
{ increment = increment + (_x distance2d _objPos) } forEach _nearPlayers;
I'm looking for the sum, so for 4 players who are 10, 3, 2, and 22m from the object, I would want the variable "increment" to be 15 (since 22 would be excluded)
well, that's what I wrote, out of sheer bloodymindedness :P
oh okay! SQF is hard to read for me, but I'll wrap my head around it!
Oh wow I didn't know about inAreaArray, very neat
If you don't need it to be fast then just use the dumb version:
increment = 0;
{
private _dist = _x distance2d _object;
if (_dist <= 20) then {increment = increment + _dist};
} forEach (allPlayers - entities "HeadlessClient_F");
Thank you so much! I learned a lil today
oh yeah, it's probably faster to do the headless client subtraction after the inAreaArray.
Array subtraction on large arrays is... not quick.
maybe not significant, because the headless client count is small.
We don't use em so we should be good!
Array should never be bigger than 10-12 in our use case
Is there a way to use localize with formatted string? As in, the sentence contains a variable?
(besides localizing the parts before and after separately, which does not work for all languages)
Localize the format string, then run format on that π€·ββοΈ
See example 3 at https://community.bistudio.com/wiki/localize
Oh! Damn, skipped over that comment. Thank you!
Hey, do any of you know if it is possible to find out the actionName for the actions in ACE3? Can't find a straight forward list like there is for vanilla ARMA, but thought some of you might know a way π
Vanilla arma list https://community.bistudio.com/wiki/inputAction/actions
I need it for executing a script w. inputAction https://community.bistudio.com/wiki/inputAction
so this script is supposed to delete one group + their vehicle on their last waypoint, how should it be modified to delete a group of three vehicles (well, a convoy)? brain machine melted, whatever I try it either deletes the first vehicle or removes only the crew, unless I give everything a variable name which I'd like not to do
cleanUpveh = vehicle leader this; {deleteVehicle _x} forEach crew cleanUpveh + [cleanUpveh]; deleteGroup this;```
have you checked actionIDs & actionParams commands?
Loop through all group units and save the unique vehicles inside an array.
Q: I wonder is there a good way of converting text to speech?
@proven charm Not those pages actually, but I am having difficulty understanding how to get them to work.. But if I understand them correctly I dont think they work, as I need the ID of using the control to use the Vector from ACE to find distance and azimuth.. I know that the control it [TAB] + [R] but I need the ID of the control
I have used these sites
https://voicemaker.in/
https://www.naturalreaders.com/online/
https://speechify.com/text-to-speech-online/?landing_url=https%3A%2F%2Fspeechify.com%2Ftext-to-speech-online%2F
They seem to provide a decent "normal" voice and not too robotic, but all of them have limitations when used free
However I gather no mods per se, no scripting commands or functions. I have to convert to the audio file and so forth first.
Arma has no built-in text-to-speech feature, you make your own .ogg sound file, put it into the mission or wherever and play it
^ ^^ gathered
and if free TTS services are not enough it might be better to just hire some voice actors from fiverr for a couple of bucks, prices for premium TTS can be really high sometimes
How do you interrupt sound files from playing when you're using playsound3D to play multiple dialogue files one after the other?
For example, an AI is speaking but when the player gets detected by the AI, I want him to stop speaking that dialogue
maybe a similar question, instead of playing sounds, how might I cause a unit to 'identify surroundings, other units, etc'
my goal there is that his verbiage is audible by players
"BUILDING" don't work with nearestTerrainObjects?
"BUILDING" is on the list of names you can use.
Try "HOUSE"
Ah! Thanks!
"Building" works for me. I do not think it is a terrain object. usually nearestObjects of a type (class).
A lot of the nearestTerrainObjects types are unused in Arma 3, IIRC.
https://community.bistudio.com/wiki/nearestTerrainObjects see by yourself clicking this tiny button π
In practice it's all a pain because it's based on the 2d map icon, which is used... artistically.
So on Altis you'll often get graves and some walls marked as HOUSE, for example.
yes - also note that empty (0) results are not listed in the wiki result table
empty?
e.g no "VIEW-TOWER" on Altis
Oh, you mean stuff that isn't used on the map.
yes
I wonder if we could make a giant table listing all the numbers (and if it would remain readable)
It's fine, you have the full type list at the top.
What tends to need investigation is what actually counts as what in practice.
could I do this? or should I instead use an exitWith condition check?
thislist findIf { _x isKindOf "Car" || _x isKindOf "Helicopter" }
yeah I do, also this is in relation to the wreck script I mentioned yesterday. Is there a way to tell if a vehicle is a wreck? would I just check if vehicle health is 0 or something? or is alive?
alive _veh
alright thanks
so im testing and the trigger activates for living vehicles but it doesnt trigger after I blow them up. Perhaps isKindOf "Car" isnt detecting the Car wrecks
setParticleClass "ObjectDestructionFire1Smallx"
How to find a list of all classes?
https://community.bistudio.com/wiki/setParticleClass
CfgCloudlets
look at```sqf
private _particleClasses = "true" configClasses (configFile >> "CfgCloudlets");
How can i define a drone's waypoints altitute / the altitute it loiters in?
I cant seem to find an appropiate command for that.
nvm, i found it in the waypoint commands group page
can someone tell me how to point a laser at a players head?
addMissionEventHandler ["Draw3D", {
drawLaser [
eyePos laserPointer vectorAdd [0, 0, 0],
getCameraViewDirection laserPointer,/// how to aim the laser at the head of a player?
[1000, 0, 1],
[],
0.7,
0.3,
500,
false
];
}];
Direction parameter:
(eyePos laserPointer) vectorFromTo (eyePos yourTarget)```
If you're going to vectorAdd [0,0,0] you don't need vectorAdd
many thanks!
how can I make it so every time a player is incapacitated a script function is called eg.
When incapacitated code ---> calls TAG_fn_Test
butI i cant find a way to make it so when incapacitated the function is called
try a hit/damaged Event Handler?
k
hi did anyone write a quick converter script that parses
getUnitLoadout player to class format ?
class MyLoadout
{
uniformClass = "U_B_CombatUniform_mcam";
backpack = "B_AssaultPack_mcamo";
linkedItems[] = { "V_PlateCarrier1_rgr", "H_HelmetB", "ItemCompass", "ItemWatch", "ItemRadio", "NVGoggles" };
weapons[] = { "arifle_MX_ACO_pointer_F", "hgun_P07_F" };
items[] = { "FirstAidKit", "FirstAidKit", "FirstAidKit" };
magazines[] = {"30Rnd_65x39_caseless_mag", "16Rnd_9x21_Mag","SmokeShell","HandGrenade" };
};
Hi guys question what is the best way to get the bullet impact position?
Ty. So i want to create small sphere at the bullet impact point on objects and this is the code i have for that:
player addEventHandler["Fired",{
_bullet = _this select 6;
_bullet addEventHandler ["HitPart",{
_pos = _this select 3;
player sideChat format ["%1",_pos];
_Spherere = createVehicle ["Sign_Sphere10cm_F",_pos,[], 0, "FLY"];
}];
}];
But when i shoot on Objects the sphere is just floating in air any tips? Ref Picture: https://imgur.com/AX1NSsY
well first thing, hitpart returns pos as ASL not AGL, second is that you have the parameter "FLY"
player addEventHandler["Fired",{
_bullet = _this select 6;
_bullet addEventHandler ["HitPart",{
_pos = _this select 3;
_pos = ASLTOAGL _pos;
player sideChat format ["%1",_pos];
_Spherere = createVehicle ["Sign_Sphere10cm_F",_pos,[], 0, "CAN_COLLIDE"];
}];
}];
Use parameter "CAN_COLLIDE" instead, or else the vehicle will spawn in a place where it doesn't collide, since you are spawning it on a bullet impact, that means the bullet is colliding with a surface
Yea thank you very much i didnt see the hitpart was using ASL for position
I have a bunch of vehicles (Minigun qillin) that are supposed to fire continuously, gunner is an AI with their AI disabled, in single player, this code works, but in multiplayer they don't fire, any idea why?
[] spawn {
while {Tro_DBMove_IsAboutToGround} do {
{
[_x, "LMG_Minigun_Transport"] call BIS_fnc_fire;
} forEach Tro_DBAttack_MinigunA_Vehicles;
sleep 0.01;
};
};
Tro_DBMove_IsAboutToGround is true
Tro_DBAttack_MinigunA_Vehicles is an array of vehicle objects, now here where it gets tricky, vehicles are spawned on each client using createvehiclelocal, then a gunner is spawned using createunit on each client too, for every vehicle, so the unit that is sitting in the local vehicle is also local to the client themselves, maybe that it causing the problem? idk
here is how the vehicle is spawned if anyone is wondering: https://sqfbin.com/bujuhogifuxezudanave
btw BIS_fnc_fire is returning true
use ammo event handlers
This might be better going in #arma3_gui and in case it does, i can move it there;
I've come across a problem that is very much probable me being a irremediable dumb-dumb, I'm having a very specific issue with a custom GUI I'm building.
Everything works great, interaction, logics etc etc.
The only real part that I can't seem to be able to get to work for some reason are 2 controls of the RscListNBox type, these controls, according to the game itself, are not being created, however they are being called in the exact same way another GUI I made and have working in the same mission space are done, which, weirdly enough, is using the same type of controls but with different IDC and they work. Same applies to an additional mod I made, when loaded into the mission the mod shows it correspondent GUI with it's correspondent RscListNBox correctly.
I'm a bit in a loss here, as I don't really know what I should be looking for as this only happens to those specific controls.
At first I thought they were using maybe, remotely, reserved IDC numbers but even changing it doesn't really change anything.
If anyone could shine me some knowledge in why could this happens, I'm all ears.
What's the best practice way to get all objects in a mission that are of a certain class which I got the name of as a string?
Specifically for this example, how to retrieve all objects in the mission that are "Land_RepairDepot_01_tan_F"?
I tried entities, but it does not recognize it like that. ThingX is the deepest into the hierarchy that makes it recognize the object
allMissionObjects I guess. It is somewhat performance unfriendly command so watch out
It's not gonna be called often.
Thanks, I'll try that one
Ugh. Nvm, entities works. I had the wrong class name xD
is it possible to view what action was/is enabled on object? what I mean is I want to check if player has WeaponOnBack action (that was added through SoldierOne action ["WeaponOnBack", SoldierOne];) and execute a script if it returns true
if you ran the action yourself, you can keep track of it
Where's that spawn running?
fixed it using forceweaponfire, the answer is that its running on each client so that each unit that is local to them fires the vehicle that is local to them
i suspect bis_fnc_fire runs on the server? that's why it didn't work
yes it does
the function itself is ran server side no matter what, from there, it tells the correct machine to fire
welcome aboard the madness train!
hey
hello :0
i remember you
xd
well, now i'm trying to DIY my way into making a per player system
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
Would that work?
as well as the fact that i wasn't able to add a "disable respawn" way
for now i don't get much on how to do it
your code adds 3 tickets to the player
nice, is what i want to, my question is, how do i add it to the player
what i don't get is now to check how many tickets each player has
how do i add it to the player
your code literally does that
no,i mean as a file into the mission
https://community.bistudio.com/wiki/BIS_fnc_respawnTickets
tickets: Number - added respawn tickets. When missing or set to 0, number of tickets won't be affected, which means you can use the function to simply get amount of tickets.
as a initPlayerServer.sqf
i explain myself poorly, sorry
you can do it there, initPlayerLocal.sqf is also fine
ok, how do i shut donw the sv on 3den, or how do i quickly test it out
so
the code should be (i'm going to do it, not asking)
set tickets for each player to 3
when they respawn, they lose 1
if the player has 0 tickets, they are no longer able to respawn
if the player has 1 ticket, allow then again
am i a moron for asking somethink like so?
well, and how do i add tickets to only players from one side?
as well ans how do i shut donw the server on the 3den
you can pass a side, fx., west aka blufor
^is a bummer to start as a single player
thanks
i don't know actually π
i just exit the editor if i need to do that
and enter back in
ah, no ploblem
i already knew that one, and is so time wasting-intensive
xd
actually, you can click Play at the top and play in single player
i knew that one already
that'll shut it down
but is TOO weird that there's a specific button to shut it off
no idea
AAA
run into a problem
units don't use the custom loadout i've gave then
also
code seems to not work (weird)
can't help without context 
ok, sorry
for now i'm running the game with ACE3,on respawn on custom position with manual respawn
and it allows more than 3 respawns
wait, i can't pass images?
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
if (_playerTickets = 0) then { Hint "no tickets" };
@copper raven would that be fine?
i see, i dont get the syntax then
wait, why not?
if you die, you lose 1 ticket right?
that means you are going to go to 0 right??
you're adding 3 tickets to the player then immediatly comparing it to 0
ah, what i want to do is to check if the player has no tickets
to see if at least the code detect the player has no tickets
pass 0 if you want to return the actual tickets (without adding)
ah, so i have to compare to 1?
why 1? you said you want to check if they have none
because of what you said
i'm confused
tickets: Number - added respawn tickets. When missing or set to 0, number of tickets won't be affected, which means you can use the function to simply get amount of tickets.
you're passing 3, which means you add 3, so the function returns current tickets + 3
if you want the current ticket count, pass 0 like i said, instead of 3
no, i want to be noticed when you have no tickets
aaa
i'm so embarrased
wait, then how do i check the player's current number of tickets
haven't even realised
holy










sorry
ok
i don't get it


the function always returns the resulting tickets, ergo add 0 to get the existing tickets
you're talking about how you set up this?
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
i was asking about how do i check the number of tickers the player currently has
read this carefully
uhm... 
that also works for counting the number of tickets a player has?
what do you think is stored in _playerTickets
the ammount of tickets the player currently has
the returned number of tickets, look what the return field says on the wiki
why do i feel so stupid holy, i'm gettins stressed out of this, simple because i don't get why i don't get it
sorry
i don't get it yet
do you know what return means
in the context of functions
you can say no I'll send a link if you dont
yes, but in this context no
do we mean that when he dies, he adds one to _playerTickets?
i feel so dumb that is unreal
BIS_fnc_respawnTickets is just a block of code, call is a command to execute this code with the inputs you provide
ok
that's why
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
only adds 3 tickets
i get that
_variable = call _function will store whatever the output of the code is into the _variable
the output of BIS_fnc_respawnTickets is the remaining tickets after they are added
ok, but is there a way to check the ticket's of the current player?
what do you add to get the same number
ok... so you're saying that _playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
_playertickers = 3 ?
no
gosh
_playertickets will be existing tickets PLUS 3
this is painfully stupied
as it says on the wiki
i know
Return Value:
Number - remaining tickets after adjustment
and if we start with 0 tickets
ok, and if the player respawns, it will subtract 1 right?
that is what the wiki says
or do i have to tell the code to add that event
ok, and how do i get that return value?
read
ok, so return value is 3 in my case
right?
ok...
if the function returns 3 then 3 will be stored to your variable
so i have to use _variable?
you already made a variable
_playerTickets
you can reference _playerTickets later
*in the same scope
ok, so i just have to use if (_playerTickets = 0) ?
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
FCUUUUUUUUUUUUUUCK
you're right
now i see it
i was stating that _playerTickets was 0, instead of comparing if it was 0 right?
yeah the = syntax sets the variable
then this has to be allright?
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
if (_playerTickets == 0) then {Hint "No tickets"};
how will it be 0 if you're adding 3
first line adds 3, second line checks if it's 0
i have to place a onplayerdeath?
_playerTickets doesn't get substracted by 1 when you die?
or do i have to place a onplayerkilled?
the first line adds 3 tickets and returns the total to _playerTickets, _playerTickets will never be 0 with this code
ok, so i have to place a event when the player itself dies, right?
I don't know what you want to do. If you want to check tickets when the player dies, yes, just input 0 instead of 3
if ([player, 0, true] call BIS_fnc_respawnTickets == 0) then {Hint "No tickets"};
what i want is to
Set the player's tickets to 3
when it dies/respawns, susbtract 1
if the number of tickets the player has is 0, he cannot respawn again
^for now just make a message pop up
you need to do those separately
set tickets to 3 in initPlayerLocal (I think, depends on locality with the function), check if 0 in onPlayerKilled
2 files for making this?
i already told you that the game automatically doesn't allow respawning if you have 0 tickets, all you have to do is just set the initial tickets
well there you go
tested it, and it seemed to fail
no
then it won't work
or i don't think so
it's even stated in the wiki page here https://community.bistudio.com/wiki/BIS_fnc_respawnTickets
Manage respawn tickets used by Tickets respawn template.
how do i check it
read the wiki, you need to setup a description.ext
ok, so to sum up
i have to state that the game is going to use the "respawn = 3;" for example on the Description.ext file
once done i can use the " _playerTickets = [player, 3, true] call BIS_fnc_respawnTickets; " on the initPlayerLocal.sqf file
is that all?
because i'm being really dizzy about this for how weird it is being to me
you also need the template like i said
something like respawnTemplates[] = { "MenuPosition", "Tickets" };
that states that you're going to respawn on the "select respawn point" menu, and that tickets are going to be used?
respawn = 3;
respawnTemplates[] = { "MenuPosition", "Tickets" };
it should yeah
@copper raven i'm going to use it with this
the second line makes no sense
why?
i don't get it
what i want on the second line is the following
if the player has 0 tickets
it pops up a message saying that they have no tickets
it doesn't work like that
damm, how could i do it then
https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers respawnTicketsExhausted
not wanthing the code
you mean a call BIS_fnc_respawnTickets; ?
wait
and now i've respawned 3 times
and it teleported me to another spawn point
what
update
current description.ext
respawn = 3;
respawndelay = "3";
respawnTemplates[] = { "Tickets" , "MenuPosition" };
current initPlayerlocal.sqf
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
what's wrong there?
Why is your respawn delay a string?
It might be erroring out because it wants a number thus it doesn't reach the template line.
OH, nice to see you hypo, i've started a university degree, and learned to code on C
and that impulsed me to try to do SQF
rn i'm trying to do the infamous "individual ticket"
for now the only problem that seems to pop up is information related about tickets and AI
anyways
the goal is to have a ticker per player, so when the "X" times they respawn, they no longer can
and it was mentioned that with BIS_fnc_respawnTickets it could be done
There is a hidden ticket type which you might want. It's not listed on the wiki (I might change that). I'll look it up when I get home.
One removes the ticket before respawn (on death), the other removes the ticket after respawn.
But yeah, I'll walk you through what you want when I get on my PC in a few hours.
are you jokinly talking about the default one?
Tickets is the default one. There is an additional one that is not on the wiki that acts opposite of it.
why is it hidden
It's in the config but I don't remember off the top of my hand
i just want to have tickets per individual player π
You can. Let me get home.
great, i'll be here
It might be late. Work has been rough the day after the hurricane.
ah, no problems
AND also i'm back to the good'ol problems of "my units respawn with armamtent that doesn't correspond
see BIS_fnc_arsenal doc I believe
Description.ext requires anything to load it up?
it's automatically detected
description.ext
just make sure it's in the same directory as the mission.sqm
ok, now it wants to work, neat
well
back to my topic
xd
ok, so now description.ext seems to work out for me
with this
respawnOnStart = 1;
respawn = 3;
respawnDelay = 2;
reviveMode = 0;
respawnTemplates[] = { "Tickets" , "Counter" , "MenuPosition" };
now the question is, how do i setup the ticket system
Use a limited respawn ticket pool for players. Pool can be applied to everyone, a side, a group or a single unit.
UseBIS_fnc_respawnTicketsto update the amount of available tickets. Note that the template will have no effect if this function is never used, meaning players outside of all given pools will have infinite respawns.
source: https://community.bistudio.com/wiki/Arma_3:_Respawn#Official_Templates
i was already on that track, nice, still
what i'm not sure is to place it on a even script
on in wich way
for now i've tried init.sqf and the initPlayerLocal.sqf
I believe it has to be in initServer.sqf
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;
just to try it
and then how to i check the number of tickets someone has?
ok
let's try it
doesn't seems to work out
set:
[west, 5] call BIS_fnc_respawnTickets; // set 5 tickets for bluefor
get:
_westTickets = [west, nil] call BIS_fnc_respawnTickets; // get amount of tickets for bluefor
If the second parameter is 0 or nil, it will return the current number, otherwise it will set it to the given number
if you haven't read preoviusly, the point is to make a per unit ticker system
in that case change west to player
and set it in initPlayerLocal.sqf (after the player exsits)
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets; like so?
uggg
great
:)
thank you so much, but one question, how do i add more respawns to only players from one side?
you could check to which side a player belongs, and add more (or less) tickets
yes, i mean, the syntax behind it
(mainly for capture points or triggers)
simple, but can't recall how it was done for capture sectors
is literally
detect wich side capture
give a X number or respawns
probably with something like this:
_winner = west; // set to team which should get the points
{
if (side _x == _winner) then {
[player, 5, true] call BIS_fnc_respawnTickets; // add 5 tickets
}
} forEach allPlayers;
can probably be written much better, I'm a bit rusty with SQF π
Winner in this case what means
don't worry
i am as well
winner is the side which got the capture or trigger (by getting the side of the players who triggered it)
why in that case you said winner = west?
i don't get that part
just as an example, since west is one of the sides
wait, so winnter means only who captured the flag?
yes
no need for _winner = west; ?
no, but you do need to know and set _winner to the side which should get the points
hmm....
you can set it _winner_1 and _winner_2?
[west, 5] call BIS_fnc_respawnTickets should produce the exact same thing, you meant _x instead of player there i think π
could that be applied for a sector changing sides constantly?
sure
up to you
fine,i'll se you tomorro, here is 3:30AM
Hi guys Quick question what would be best way to get building position index. I have this script where i get building positions:
///House building positions.
_house = nearestBuilding position player;
_test = _house buildingPos -1;
{
_Sphere = createVehicle ["Sign_Arrow_Large_F",_x,[], 0, "CAN_COLLIDE"];
}foreach _test;
and _test prints:
[[1816.72,5641.87,0.561687],[1818.56,5651.83,4.07474],[1819.68,5647.61,0.627316],[1818.08,5645.42,3.96448],[1813.88,5642.38,4.0001],[1821.29,5646.01,4.0001],[1820.99,5641.13,4.0001],[1820.17,5653.21,4.07474],[1823.02,5649.9,3.99574]]
How i can declare that [1816.72,5641.87,0.561687] position is building position inedex 1 ? or how if there is a fnc or command that gives me building position index that would be nice ?
do you want to get a specific position only? i don't understand your question 
No i want to get the index of the building position.
use find
but only if you have the original array reference from the list of positions
else you need to just pick the closest one, or do some rounding, because of float precision
what exactly is "" _selection in HandleDamage EH?
@warm hedge I was in the wrong channel. Not sure what this is about:
private _curDam = call {
if (_selection == "") exitWith {
damage _unit;
};
(_unit getHit _selection)
selection is selection, basically the part of the vehicle that got a damage
I know, but why would it be blank?
Because it could be blank when the damage is a generic one
is that damage that goes directly to global health pool without hitting a specific part? i didn't know that was possible.
HandleDamage can be fired multiple times per a damage source. Without hitting a specific part might be possible, but multiple HandleDamages are more likely to happen
is there a way to detect explosive being planted?
I'm trying to make a team kill detector. I doubt that event handlers will be totally reliable with explosives.
Good morning,
Friend of mine have problem with forceweaponfire. Is there some other way get correct muzzle and weapon to plane.
Plane is
waypoint position
[[_dropZone #0,_dropZone #1,200],0];
But even this they did not do CAS
_weapon = (weapons _veh) select 3;
_mode = (getArray (configFile >> "cfgweapons" >> _weapon >> "modes")) select 0;
if (_mode == "this") then {_mode = _weapon;};
(driver _veh) forceWeaponFire [_weapon, _mode];
//Force a CAS fire a rocket.
I do not know do i have set pylons to planes (CAS) and try different modes
at best forceWeaponFire will only make ai fire at empty space. that is the problem with ai planes.
use only gunships for ai cas. fixed wing ai = garbage.
The A-164 Wipeout is a ground attack and Close Air Support jet used exclusively by NATO forces in ArmA 3. Role: Close air support The Wipeout is a twin turbofan-engined, ground attack jet that uses a cantilever low-wing monoplane wing design with a wide chord. It is meant to be used exclusively for ground attack and close air support. Armament B...
only potential issue i'm seeing is locality, rest looks ok to me
forceWeaponFire takes local arg
how would i run a while loop for 10 seconds? cant figure it out XD
Get current time > add 10s > while time is less than newtime...
private _future = diag_tickTime + 10;
while { diag_tickTime <= _future } do {
// your script
}
I think you have the comparison operator backwards
true... copied it from a waitUntil, where it is correct π
Keep in mind @drowsy geyser the differences in while loops in unscheduled and scheduled environments.
Hi Guys i have a question how i can create a vehicle spawner where i have this array:
private _groundVehicleArray = [["B_MRAP_01_F",5],["B_MRAP_01_hmg_F",2],["B_APC_Tracked_01_AA_F",1]];
``` And then on the object i have a ( addaction or aceinteraction ) list of vehicle names and amount of vehicle avaiable and when i spawn 1 vehicle the amount decreses by 1.
so what is the question?
Basicly how i would go about creating that kind of vehicle spawner where i have class name of vehicle and amount avaiable. And if i want to spawn specific vehicle decreses the amount available. And if the amount is 0 to not spawn the vehicle ?
do you want it to last for 1 session or save to a database?
For 1 session only
ok
so the way id do it is have some box and remotexec an addaction on it when someone opens it opens gui and they can remove a vehicle and doing so changes a global variable that counts how many of that type of vehicle are stored and then use createvehiclelocal and attachto to show them a place to put it then getpos on the local vehicle to fil out the position of a createvehicle give them an addaction to place it
or you can fiddle with nested arrays
unless any of the more experienced people have some smarter ideas
Thank you for your input. Yea i had the same idea but never the less the direction i go GUI, or interaction via ace or addaction i will need to deal with neasted arrays and sorting them so i will need to play with that a bit in future.
i wouldnt figure with ace actions there isnt too much documentation iirc and addaction is usually sufficent enough
ACE Interactions actually has a decent documentation, for both configs and scripted: https://ace3.acemod.org/wiki/framework/interactionmenu-framework#3-adding-actions-via-scripts
thank you from what i heard it was quite limited havent dont too much modded stuff in a while
add_action is just "add action to object and forget about it"
ACE Interact can do the same, but also allows for more complex things (conditions, before/during/after functions, etc)
hello, is there any way a mod can detect if the user is in the main menu of Arma (the menu with singleplayer, multiplayer, tutorials and options) ?
A combination of these might help https://community.bistudio.com/wiki/isGameFocused https://community.bistudio.com/wiki/isGamePaused
@rare ether
To go through your array in a array in a for each, you'd use
_x params ["_class", "_count"]
On my phone so I can't type out much more atm.
et = {; ?!?
perams;?
et=tu?
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
moving semicolons around is usually a bad thing since they only have one place to go
You have semicolons in the wrong places, and you're spelling and using params wrong
We don't neither, since we haven't seen your code
uff
You sure you just switched a few semicolons?
Looks more like a fist hit that code
currentturret addEventHandler ["Disassembled",{params ["_entity", "_primaryBag", "_secondaryBag"];
[_primaryBag,_secondaryBag] spawn disturret;}];```
and replace select 1 and select 2 with 1 and 0 in the other script
the current state of code is: "When the turret is dissassembled - delete two backpacks". In a very, very, VERY broken SQF
No need for that inline function really
learn how to use semicolons before anything else
sadly that didn't worked, thanks for the idea tho π
Why not?
Oh, because of MP I recoN?
Your semicolons are in the wrong place and you're spelling and using params wrong
currentturret addEventHandler ["Disassembled",{
params ["_entity", "_primaryBag", "_secondaryBag"];
[_primaryBag,_secondaryBag] spawn {
sleep 1;
{
deleteVehicle _x
} forEach _this;
}
];```
basicly i execute the script post Init of the mission, but as you have the map screen game is still paused there
at least the logged values from both functions show that in the log
If you have problems with the documentation you should mention them in #community_wiki , we're always trying to improve it
it would probably sound rude, but one bit of understanding can replace 100 bits of trying every possible combination π€·ββοΈ
_in #community_wiki _
For now, try the code I posted just now.
@lilac ravine https://community.bistudio.com/wiki/SQF_Syntax "Terminating an expression"
nothing wrong with the docu
the only difference from normal is that you need semicolon after {} in some cases, like the code after "then"
if () then {};
script = {};
if you use the eclipse ide you should get the "sqdev" plugin. it catches syntax errors.
except it hasn't been updated since 2019, so somje commands are not in it
Arma's documentation has been compiled over the course of, what, 2 decades? Mostly by users, not developers. It does have some flaws and blind spots - a lot of the knowledge is reverse-engineered, or recovered from badly-written blog posts from 2005, and some of it is just not known. But for most basic things, it is possible to figure out how stuff works by reading the pages for the commands and following links in examples. And, of course, you can ask for help here (...politely)
I know you've come from other languages so you have experience with them, but sqf has a lot of weird quirks so it's better to not come in with a lot of preconceptions.
And if you have suggestions for specific improvements, post them (...politely) in #community_wiki and someone will probably try to help or get it fixed.
use "site:https://community.bistudio.com keyword" in google to search the wiki.
The wiki search is case-sensitive btw, some people are looking at how that can be changed but for now, just keep that in mind
wiki search engines are fairly useless
Guys, get back to scripting, everything related to docs can go into #community_wiki
you deciding to randomly place a semicolon after an opening bracket is not the fault of the wiki authors
If we assume that the semicolons were originally properly placed, the code was close to working, but it was blocked by the incorrect spelling and usage of params.
The page for params (https://community.bistudio.com/wiki/params) clearly lays out the proper syntax, and now that you've seen it in action in the fixed code, you can hopefully understand why it works now.
I'm not 100% sure about other languages, but SQF will definitely fail to work if a command is spelled wrong.
Not to mention there is a finished example π
No, I'm pretty sure you got wrong exactly what I just said you got wrong
if you scroll to the top of that sqf syntax link there's a bunch of links to direct you to the different aspects of the language
not to get into the wiki stuff like r3vo requested but in terms of scripting it should have everything you need
and honestly I find everything just fine by opening a search engine tab and typing in what I want to accomplish, it usually serves up the wiki page of the command in the first couple results. Hopefully this information helps you cut down on your frustration
SQF is an old small primitive language. With some quirks, but they are few as the language is primitive and small. And most of modern(-ish) looking features are just code conventions (which are sometimes taken into engine, but are still mostly external to the language itself) π€·ββοΈ
The thing is, if you can write this code, don't blame it on documentation.
You may also learn a thing or two by listening to the people here who have decades of SQF knowledge and kindly help
sorry, I meant this message.
(@hallow mortar soz, wrong post!)
not like i myself wasn't criticized by not reading the goddamn "Discussion" page on FSM (are there any relevant "Discussion"s on the wiki other than that?) 
harder than what? No documentation at all π
It Just takes time to get familiar with it
That's the thing with all docs
not entirely yet 90% of it, hey
there are welcome pages, tutorials, command pages, etc
and #community_wiki remains open to suggestions
no joke, this wiki is still maintained
I see you blaming doc in 90% of your messages here, or the "shit language", but there is some logic behind it all, I swear!
is there? tell me, now ? π
if you have doubts or questions, the channel is here for you, no problem
shoo, guys. Can you please stop?
Well...the major problem with your code could have been solved by simply going to the page with the exact name of the command. Sometimes it can be difficult to find things if you don't know what you're looking for, but that doesn't seem like one of those times
anyway, back to your problem and how to solve it
Wiki -> #community_wiki
Code problem -> <#arma3_scripting message>
Then go #community_wiki and make suggestions
needs a pebcak page
Pretty sure if you type "event handler" in the search bar, you don't end up or Kirby's website π
Yeah, that prarams was not the issue.
Sometimes I fear that half of my messages are simply vanishing into the void never to be read
They are read, but not by the one you think cough CIAcough
not reading that sorry
there should be event handler for placing explosives
There is; it's the Fired EH with the Put weapon
For ACE explosive placement you have to use their CBA handler instead, but IIRC that one is documented.
so if you place a mine/charge _weapon = mine/charge object?
No, mines, charges, and grenades are magazines for the Put and Throw weapons
i need the position of the placed item
That's not a problem. Fired/FiredMan EH gives you the projectile as a parameter, so you can do getPosATL _projectile
Hi, was a pub Zeus and someone ran a Script where only SLs can use side channels and it disables global chat. Anyone have a link to it?
@little parrot https://community.bistudio.com/wiki/enableChannel in https://community.bistudio.com/wiki/Event_Scripts#initPlayerLocal.sqf with the given condition
hello, i want to force to have a minimum amount of grass, how i can do that?
the server's options can force that, that or setTerrainGrid
i want to move the darter using a look down camera, how i can do it?
im trying to change where the "pilot" camera is looking, but i cant find how to do it
You could create a new camera and allow/force the player to change their view to that. However, changing the position of the actual native pilot camera would be a config or model change, not possible with scripting.
any idea on how to have the same "UI" as the gunner?
Do you mean:
- as the pilot, you receive the same UI as the gunner [does]
- as the gunner, you receive the same UI [as the pilot does]
- as the new virtual camera, you receive the same UI as the gunner [does]
Note that because the gunner's camera is on a turret, it is possible to force its direction usinglockCameraTo, so if you're OK with them using the gunner's camera, that can be made to work the way you want. Giving the gunner's camera the pilot's HUD is probably not possible though.
https://cdn.discordapp.com/attachments/763643908080009226/1025929029062250556/unknown.png
maybe that image will ilustrate what i need lol
to aim that, you should be able or to have an pip with a "crosshair"
or a secondary camera, where you can control the drone looking to the ground
If you want to shoot from drone camera i guess you could just add magazine and turret to drone and shoot when in gunner exmpl:
_this addWeaponTurret ["LMG_Minigun_Transport2", [-1]];
_this addMagazineTurret["2000Rnd_65x39_Belt_Tracer_Green",[-1],2000];
``` just replace the name of the weapon and magazine with what you want.
