#arma3_scripting

1 messages Β· Page 22 of 1

sullen sigil
#

Gotcha I thought so then

granite sky
#

I wouldn't necessarily bother.

sullen sigil
#

For fine tuning the velocity I assume I'm just changing the 30 in both of these?

granite sky
#

yes.

sullen sigil
#

Gotcha, should be all -- thanks for the help πŸ™‚

velvet linden
#

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

hallow mortar
#

That would require config changes (and maybe model changes)

velvet linden
#

ok 😦

warped igloo
#

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

graceful kelp
#

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

copper raven
#

spawn a bunch of scripts πŸ˜„

warped igloo
graceful kelp
copper raven
warped igloo
#

the script works perfectly otherwise, but it doesn't recognize the action

copper raven
#

those are input actions you're looking at

warped igloo
#

ah ok

warped igloo
copper raven
#

_unit playAction "PlayerStand" should work

#

(assuming _unit is local)

warped igloo
#

ah it works, but it freezes all player inputs lol

copper raven
#

πŸ€”

warped igloo
#

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

copper raven
#

i just tried what i sent and it works fine, no input freezing or anything like that

warped igloo
#

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!

past wagon
#

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.
maiden bay
#

Is there a script that would force a player to place their backpack on the ground? Like with a "Hold Space" Prompt?

open fractal
#

I think there's a drop backpack action

#

bis_fnc_holdActionAdd with the action command to drop bag

copper raven
#

set the text, then call ctrlTextHeight

#

also ctrlCommit before you get the height

past wagon
#

ok

maiden bay
copper raven
#

making stuff up will not magically make it work meowsweats

scenic shard
#

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?

copper raven
#

texture files i'm guessing

maiden bay
#

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

open fractal
maiden bay
#

ah

open fractal
#

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

maiden bay
#

cool

#

will do

open fractal
#

actually you also need to create a weaponHolder to contain the bag

maiden bay
#

Can it be any object, or has to be something with an inventory

open fractal
#

the target needs to have an inventory I believe

maiden bay
#

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

copper raven
#

no, you need to use a weapon holder

open fractal
#

you can get a position array by either right clicking in eden and logging the position to clipboard or using a getter like getRelPos

maiden bay
#

hm interesting, i might be able to just spawn the backpack or nuke object

open fractal
#

so your list is now

  1. create weaponholder
  2. force player to drop bag into weaponholder
  3. incorporate script into hold action
#

i believe you still need to make a groundweaponholder to physically spawn the backpack

maiden bay
#

Honestly, it really dosent have to be a hold action, it can just be a clikc promt

open fractal
#

the hold action is the simplest part

#

here is an example of creating a groundweaponholder

maiden bay
#

oooofffffff, thats some large stuff

open fractal
#
_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)

drowsy geyser
#

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
willow hound
#

What do you mean by "a trigger [...] works"?

drowsy geyser
#

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

willow hound
#

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).

smoky verge
#

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

south swan
#

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

rough summit
#

_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]]
south swan
#

Well, that's it then πŸ€·β€β™‚οΈ the function expects to see two default positions in the last argument

rough summit
#

My bad then...May be

tough abyss
#

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.

sullen sigil
#

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...

kind cedar
#

How can I enable team switch on an AI during gameplay with zeus

stable dune
# kind cedar 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.

https://community.bistudio.com/wiki/teamSwitch

kind cedar
stable dune
#

Yeah πŸ‘

kind cedar
#

Well I cant send a picture

#

But when I press ESC it shows an "extended debug console"

stable dune
#

Yeah, then you have it

kind cedar
#

I have zeus enhanced

#

Sweet, now I just type in "cursorObject enableAi "teamSwitch";" this and it;ll work?

stable dune
#

Should yeah

kind cedar
#

When it says "cursorObject" does this mean I select the unit and then press ESC and type that in?

stable dune
#

And just point that ai what you want or from Zeus use selected

kind cedar
#

Now how do I execute the command?

#

Just leave it in there and un pause?

stable dune
velvet linden
#

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?

copper raven
velvet linden
copper raven
#

read the wiki again

#

it literally has everything described there

velvet linden
#

ok ill read it again!

copper raven
#

examples at the bottom

velvet linden
#

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?

velvet linden
copper raven
#

only the sound

velvet linden
#

ok thanks!

copper raven
#

of say3D

velvet linden
#

its saying my sound isnt found but it was working on playSound3D

open fractal
#

say3D takes a classname not a path

#

make a CfgSounds definition if you havent already

velvet linden
#

how do you do that?

open fractal
#

see description.ext on the wiki

velvet linden
#

k

pseudo ridge
#

Can i delete the dust from a explosion?

#

From "HelicopterExploBig" explosion.

#

This explosion generates lot's of small dust objects.

pseudo ridge
#

allObjects will help.

#

Explosion dust is local?

violet lintel
#

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

shut reef
#

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

copper raven
#

what piece?

#

magic word is more or less something that the engine sets in the scope

#

i never recall any _args

shut reef
#

[[_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

copper raven
#

nothing magic about it

shut reef
#

But how does that work?
The call is not coming from the same scope

copper raven
#

it is though

shut reef
#

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?

copper raven
#
_forwardCall = {
  params ["_fn", "_args"];
  call _fn;
};

[{ hint _args }, "Hello"] call _forwardCall
south swan
#

it's defined in many places, i'm slow

shut reef
copper raven
#

just look at the snippet i sent

shut reef
#

and I'm still used to programming languages that would laugh at you for trying sth like that

copper raven
#

its literally what it is

shut reef
#

yeah, as I said, it doesn't work like I'd expect it to

copper raven
#

local variables carry into child scopes

#

its literally same thing if you wrote an if statement

shut reef
#

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

willow sandal
#

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?

copper raven
shut reef
#

good luck trying that in C++ πŸ˜‰

copper raven
#

well yeah obviously

shut reef
#

Anyway, thanks for pointing it out

#

I still feel like this should be illegal xD

copper raven
#

sqf is basically dynamic scoping

shut reef
#

Yeah, I hate it πŸ˜„ It never works where I would need it and then it just fricks my brain like that

winter rose
#

don't take a look at PHP then :p

sullen sigil
#

@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..?

hallow mortar
#

Yes, Z is height

sullen sigil
#

surely it should be select 3

hallow mortar
#

Remember, select is 0-indexed

sullen sigil
#

Wait

#

Yes

winter rose
#

😁

sullen sigil
#

Im a moron

winter rose
#

nah, just had a brainfart

sullen sigil
#

Sorry for useless ping πŸ’€

#

That would explain why my code wasn't working too

#

Was trying to use select 3 in getPos

winter rose
sullen sigil
#

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

pseudo ridge
#

Can i know what Particles video settings the player is using?

copper raven
#

you can maybe hack the ui though and read it from there

dreamy kestrel
#

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.

copper raven
copper raven
dreamy kestrel
# copper raven the wiki page you linked answers the first part of your question, the second i'm...

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?

south swan
#

texture height (in pixels), texture width (in pixels), mips are (iirc) basically LODs with lower sizes

dreamy kestrel
#

so (rgb,8,8,3) is probably optimum without getting too crazy.

south swan
#

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?

dreamy kestrel
#

so I can focus on the color part. that's fantastic, what I need to know.

dreamy kestrel
#

but this level of graphics is also not my specialization.

#

okay doo, thanks folks

worthy igloo
#

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

willow sandal
#

With the "createLocation" Syntax, where do I put the actual script?

real tartan
#

is there a way to check if _vehicle is loaded in _plane's cargo space ?

coarse dragon
#
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?

drowsy geyser
#

yes!

sullen sigil
coarse dragon
#

my lord arma 3 add echo to custom sound if one is inside...

coarse dragon
#

inside a aircraft hanger

sullen sigil
#

getPos should be returning above any surfaces including objects, right..?

#

Or have I misunderstood and it doesn't include objects?

south swan
#

"don't use getPos!" in 3...2...

#

But yeah, in theory it should include objects

sullen sigil
#

i want to find the height above the next surface down so yes use getpos

south swan
#

Or lineIntersects (or whatever it's called)

sullen sigil
#

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

south swan
#

Maybe it only includes buildings. Or map-placed objects. Or some other subset. Or just inconsistent

sullen sigil
#

except running getPos player on top of said object works fine as expected... thonk

#

but when i getPos of the projectile it seems to ignore all surfaces underneath...

winter rose
sullen sigil
#

yes that too

winter rose
winter rose
sullen sigil
#

does it actually

coarse dragon
#

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.

winter rose
coarse dragon
#

no

#

but ok

sullen sigil
#

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

winter rose
#

hehehe

sullen sigil
#

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

coarse dragon
#

does teleport work with a module?

sullen sigil
#

...and it doesnt even work

coarse dragon
#

what r u trying to do?

sullen sigil
#

find the height of a position above its highest surface beneath it

coarse dragon
#

meowsweats try a ruler

sullen sigil
#

i think i will just lineintersectssurfaces

#

not even that works its returning the object its impacting on thonk

#

wtf

hallow mortar
#

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.

sullen sigil
#

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

pseudo ridge
#

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?

hallow mortar
#

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.

pseudo ridge
#

Thanks, starting to fix hunderds of BIS_fnc_dynamicText πŸ˜”

#

πŸ§•

drifting portal
pseudo ridge
#

πŸ’

winter rose
#

or using the UI number generator function?

pseudo ridge
#

Hmmm, seens good!

winter rose
granite sky
#

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.

boreal parcel
#

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?

violet gull
#

I'd imagine the typeOf command should do fine.

velvet linden
#

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?

warm hedge
#

Post the full code please

velvet linden
#
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)

south swan
#

how is satc created? In editor? In some other script?

velvet linden
#

in editor

#

its a physical object thats placed next to tower

south swan
#

and both tower and satc are assigned those variable names in the editor?

velvet linden
#

yes

#

as i said it works

#

but only for me?

south swan
#

and what happens for other people?

velvet linden
#

other players cannot progress the script

#

"(satc distance _caller) < 5", is to progress the action but its not letting anyone else progress

velvet linden
south swan
#

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 πŸ€·β€β™‚οΈ

velvet linden
#

weird ill re-test it with a friend

velvet linden
south swan
#

what remoteExecCall

velvet linden
#

im using that to execute the BIS_fnc_holdActionAdd

south swan
#

] 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?

velvet linden
#

yea

#

i was just about to clarify

south swan
#

doesn't matter

velvet linden
#

ok

south swan
#

maybe try to print the actual satc distance _caller in the fail message and see if anything is strange with that

velvet linden
#

ok

velvet linden
south swan
#
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];

};```
still forum
copper raven
scenic shard
#

is it possible to remove the climb action from a ladder? I tried using removeAllActions on it but that did not work

warm hedge
#

No

shut reef
hallow mortar
# winter rose aren't all numbers in Arma floats? if I had to guess, I would suppose that the G...

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...

winter rose
#

afaik it's only the tostring representation, it doesn't change how the number is used?

hallow mortar
#

Β―_(ツ)_/Β―

#

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

winter rose
#

that's because of your negative attitude!

#

:D

#

@still forum tells no tales πŸ˜›

still forum
#

leaves

drowsy geyser
#

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?

copper raven
#

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)

worthy igloo
#

when I do setscale the hitbox is also bigger is it like that in mp?

coarse dragon
#
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

warm hedge
#

You failed to spawn it

coarse dragon
#

what do i need to do?

warm hedge
#
[] spawn {
    // first titleText
    sleep 5;
    // rest of the code
}```
coarse dragon
#

thank you very kindly

#

color='#00ff00'

#

is there a list of colors somewhere?

warm hedge
#

That's not how the Hex color works

coarse dragon
#

oh right

#

sweet thanks

kindred zephyr
# worthy igloo when I do setscale the hitbox is also bigger is it like that in mp?

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

winter rose
#

btw 70m* for the max size iirc

kindred zephyr
#

^

tough abyss
#

hey just quickly would this be a function? i can see that the brackets arent closed please ignore it sqf ncl_fnc_spookparticle2 = [] spawn {

winter rose
tough abyss
#

ok cool ill just change iy just had brain stop and needed smart person to tell me if not hanks lou

kindred zephyr
# tough abyss ok cool ill just change iy just had brain stop and needed smart person to tell m...

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

tough abyss
winter rose
real tartan
#

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

copper raven
real tartan
# real tartan is there a way to *prevent player for adding more items* that he already have in...

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;
coarse dragon
#

is there a code so one doesnt take friendly fire damage?

hallow mortar
#

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.

coarse dragon
#
this addEventHandler ["handleDamage", {(if (east, opfor (_this select 3) ==     west, blufor (_this select 0))) then {false}}];

hows one get this to work?

boreal parcel
violet gull
#

typeOf _vehicle == "MyVehicleClassname"

boreal parcel
#

ah I should have read the typeOf docs, thanks

worthy igloo
#

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

boreal parcel
#

I know you can do it with a click event on the map

open fractal
#

that will install an event handler but the attached code makes no sense

hallow mortar
# coarse dragon ```sqf this addEventHandler ["handleDamage", {(if (east, opfor (_this select 3) ...
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.

graceful dagger
#

how do i man hook hand ghook car cdoor

wind hedge
tough abyss
#

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?

open fractal
#

wouldn't the group command just be an extra operation?

open fractal
#

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)

tough abyss
#

thx

wind hedge
open fractal
#

besides the instigator being dead?

south swan
#

or damaged player being setCaptive that sets the unit's side to CIV

tough abyss
open fractal
#

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

velvet linden
#

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)

copper raven
#

you have to define it on other machines too

velvet linden
#

how can i do that?

#

do i use publicVariable?

open fractal
#

use CfgFunctions

pseudo ridge
pseudo ridge
#

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!

winter rose
#

try destroying, then disabling simulation of the original object + the ruin perhaps?
also how do you destroy houses

pseudo ridge
#

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.

winter rose
#

well then yeah, that's gonna tank the performance while things are being destroyed
if it stays the same later, yep that's bad

pseudo ridge
#

Ops

winter rose
#

… I did notice ^^

#

try using scripts, first

pseudo ridge
#

During explosions fps is horrible, yes, but it never back to normal even after an hour.

winter rose
#

do you want 100% of buildings down?

pseudo ridge
#

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.

winter rose
#

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

pseudo ridge
#

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.

#

πŸ˜”

#

πŸ› οΈ

winter rose
#

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

pseudo ridge
willow hound
granite sky
#

A lot of map markers aren't locations and you can only hide them by replacing the map, IIRC.

kindred zephyr
#

^

sharp grotto
#

you still have other destroyed objects being simulated tho

#

tried to find out what type/kind they are but no success

plucky hornet
#

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!

copper raven
plucky hornet
#

Yes 100p

copper raven
#

cannot reproduce blobdoggoshruggoogly

#

something wrong on your end

plucky hornet
#

well fuck

pseudo ridge
kindred zephyr
# sharp grotto had the same problem, ruins and other destroyed map objects seem to be globally ...

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

sharp grotto
pseudo ridge
#

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).

fair lava
#
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

opal night
#

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

south swan
copper raven
#

if you're running that in debug console

fair lava
#

oh

#

thanks lol

south swan
copper raven
#

well it's right there in the example

opal night
#

i dont know how can i set this mod to a flagpole like where do i have to write it

copper raven
#

initPlayerLocal.sqf i'm assuming is where you'd want to run that

opal night
#

its not in the ini of the object? like in the ini of the flag i want to make it work

#

?

copper raven
#

init of the object might be too early

#

i don't know the source so can't tell

pseudo ridge
opal night
opal night
#

sorry i am really new in scripting arma 3 so i am just starting to learn

south swan
#

yeah, it seems to look into the "Ruin1" effect meowsweats

south swan
#

and dev 2.10 creates said class for me with createVehicle [ "Land_Cargo_Tower_V3_ruins_F", screenToWorld [0.5,0.5], [], 15, "NONE"] πŸ€”

pseudo ridge
#

Yes, i was wrong. I can create a ruin, my code was fault 😬

boreal parcel
#

is this a valid trigger activation condition?

{
 if (_x isKindOf "Car") exitWith { true; };
} forEach thisList;
winter rose
winter rose
real tartan
#

true; is not boolean

winter rose
#

no, true is
yet the ; doesn't matter here

private _result = if (_condition) then { true; } else { false; };
_result == _condition; // true
boreal parcel
#

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?

winter rose
boreal parcel
#

is that the wrong way to go about something like that?

winter rose
#

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 ^^

boreal parcel
#

I was thinking add the addAction onActivation and remove it on deActivation

winter rose
#

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

winter rose
boreal parcel
copper raven
#

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

south swan
winter rose
boreal parcel
coarse dragon
#
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

copper raven
#

missing semicolon

coarse dragon
#

erm

#

,?

open fractal
#

; semicolon

winter rose
runic edge
#

Hello guys ! Is it ok to post ace related questions here ?

open fractal
#

ace discord may be more appropriate

runic edge
#

Can you invite me to it, my mp should be open !

#

Thanks

unborn bronze
#

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

granite sky
#

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;
unborn bronze
granite sky
#

well, that's what I wrote, out of sheer bloodymindedness :P

unborn bronze
#

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

granite sky
#

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");
unborn bronze
#

Thank you so much! I learned a lil today

granite sky
#

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.

unborn bronze
#

We don't use em so we should be good!
Array should never be bigger than 10-12 in our use case

shut reef
#

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)

south swan
#

Localize the format string, then run format on that πŸ€·β€β™‚οΈ

shut reef
#

Oh! Damn, skipped over that comment. Thank you!

plucky hornet
#

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

jade acorn
#

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;```
proven charm
cosmic lichen
dreamy kestrel
#

Q: I wonder is there a good way of converting text to speech?

plucky hornet
# proven charm have you checked actionIDs & actionParams commands?

@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

plucky hornet
dreamy kestrel
jade acorn
#

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

jade acorn
#

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

dreamy kestrel
#

LOL right... fair enough

#

thanks

plush belfry
#

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

dreamy kestrel
#

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

pseudo ridge
#

"BUILDING" don't work with nearestTerrainObjects?

#

"BUILDING" is on the list of names you can use.

sharp grotto
pseudo ridge
#

Ah! Thanks!

dreamy kestrel
granite sky
#

A lot of the nearestTerrainObjects types are unused in Arma 3, IIRC.

granite sky
#

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.

winter rose
#

yes - also note that empty (0) results are not listed in the wiki result table

granite sky
#

empty?

winter rose
#

e.g no "VIEW-TOWER" on Altis

granite sky
#

Oh, you mean stuff that isn't used on the map.

winter rose
#

yes
I wonder if we could make a giant table listing all the numbers (and if it would remain readable)

granite sky
#

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.

boreal parcel
#

could I do this? or should I instead use an exitWith condition check?

thislist findIf { _x isKindOf "Car" || _x isKindOf "Helicopter" }
winter rose
#

can do

#

but you want a boolean as a result

#

so check != -1

boreal parcel
#

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?

copper raven
#

alive _veh

boreal parcel
#

alright thanks

boreal parcel
#

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

wanton swallow
#
setParticleClass "ObjectDestructionFire1Smallx"

How to find a list of all classes?

winter rose
#

look at```sqf
private _particleClasses = "true" configClasses (configFile >> "CfgCloudlets");

rich frost
#

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

drowsy geyser
#

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
        ];
}];
hallow mortar
#

Direction parameter:

(eyePos laserPointer) vectorFromTo (eyePos yourTarget)```
If you're going to vectorAdd [0,0,0] you don't need vectorAdd
drowsy geyser
#

many thanks!

velvet linden
#

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

winter rose
velvet linden
#

k

sonic linden
#

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" };
};
fleet sand
#

Hi guys question what is the best way to get the bullet impact position?

winter rose
#

it would be to use the new projectile event handlers

fleet sand
# winter rose it would be to use the new projectile event handlers

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

drifting portal
#
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"];
    }];
}];
drifting portal
fleet sand
drifting portal
#

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

#

btw BIS_fnc_fire is returning true

copper raven
kindred zephyr
#

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.

shut reef
#

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

warm hedge
#

allMissionObjects I guess. It is somewhat performance unfriendly command so watch out

shut reef
#

It's not gonna be called often.
Thanks, I'll try that one

#

Ugh. Nvm, entities works. I had the wrong class name xD

jade acorn
#

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

copper raven
drifting portal
#

i suspect bis_fnc_fire runs on the server? that's why it didn't work

copper raven
#

the function itself is ran server side no matter what, from there, it tells the correct machine to fire

bright robin
#

Hello

#

i've finally started to learn some coding

winter rose
#

welcome aboard the madness train!

bright robin
#

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

copper raven
bright robin
#

what i don't get is now to check how many tickets each player has

copper raven
bright robin
copper raven
bright robin
#

as a initPlayerServer.sqf

bright robin
copper raven
bright robin
# copper raven 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

copper raven
#

the first is all you need to do

#

the rest is done automatically

bright robin
bright robin
#

as well ans how do i shut donw the server on the 3den

copper raven
#

you can pass a side, fx., west aka blufor

bright robin
bright robin
copper raven
#

i just exit the editor if i need to do that

#

and enter back in

bright robin
bright robin
#

xd

copper raven
#

actually, you can click Play at the top and play in single player

bright robin
copper raven
#

that'll shut it down

bright robin
#

but is TOO weird that there's a specific button to shut it off

copper raven
#

no idea

bright robin
#

AAA

#

run into a problem

#

units don't use the custom loadout i've gave then

#

also

#

code seems to not work (weird)

copper raven
#

can't help without context meowsweats

bright robin
#

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?

copper raven
#

no

#
  1. = is assignment, == is comparison
  2. _playerTickets is never 0 here
bright robin
#

i see, i dont get the syntax then

bright robin
#

that means you are going to go to 0 right??

copper raven
#

you're adding 3 tickets to the player then immediatly comparing it to 0

bright robin
#

to see if at least the code detect the player has no tickets

copper raven
bright robin
copper raven
#

why 1? you said you want to check if they have none

bright robin
#

i'm confused

copper raven
#

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

bright robin
#

aaa

#

i'm so embarrased

bright robin
copper raven
#

i've answered that 3 seperate times already meowsweats

#

check the wiki link i sent again

bright robin
#

holy

#

sorry

#

ok

#

i don't get it

south swan
#

sigh

#

you add 0 tickets to get the current number

open fractal
#

the function always returns the resulting tickets, ergo add 0 to get the existing tickets

bright robin
#

i was asking about how do i check the number of tickers the player currently has

bright robin
open fractal
#

what do you think is stored in _playerTickets

bright robin
open fractal
#

the returned number of tickets, look what the return field says on the wiki

bright robin
#

sorry

#

i don't get it yet

open fractal
#

do you know what return means

#

in the context of functions

#

you can say no I'll send a link if you dont

bright robin
#

i feel so dumb that is unreal

open fractal
#

BIS_fnc_respawnTickets is just a block of code, call is a command to execute this code with the inputs you provide

bright robin
#

i get that

open fractal
#

_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

bright robin
open fractal
bright robin
open fractal
#

no

bright robin
#

gosh

open fractal
#

_playertickets will be existing tickets PLUS 3

bright robin
#

this is painfully stupied

open fractal
#

as it says on the wiki

bright robin
open fractal
#

Return Value:
Number - remaining tickets after adjustment

bright robin
#

and if we start with 0 tickets

open fractal
#

yes

#

it will be 3 if you add 3 to 0

#

so to get current tickets you add 0

bright robin
open fractal
#

that is what the wiki says

bright robin
#

or do i have to tell the code to add that event

bright robin
bright robin
#

uggggg

#

i feel so stupid

#

sorry

#

i'm really sorry

bright robin
#

right?

open fractal
#

if the function returns 3 then 3 will be stored to your variable

bright robin
#

i dont get it yet

#

i'm getting closer

bright robin
open fractal
#

you already made a variable

#

_playerTickets

#

you can reference _playerTickets later

#

*in the same scope

bright robin
open fractal
#

==*

#

=sets a variable, == checks it against something else

bright robin
#

you're right

#

now i see it

#

i was stating that _playerTickets was 0, instead of comparing if it was 0 right?

open fractal
#

yeah the = syntax sets the variable

bright robin
open fractal
#

how will it be 0 if you're adding 3

bright robin
#

ah

open fractal
#

first line adds 3, second line checks if it's 0

bright robin
#

i have to place a onplayerdeath?

bright robin
bright robin
#

or do i have to place a onplayerkilled?

open fractal
bright robin
open fractal
#

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"};
bright robin
#

^for now just make a message pop up

open fractal
#

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

copper raven
#

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

open fractal
#

well there you go

bright robin
copper raven
#

are you using the apex template?

bright robin
copper raven
#

then it won't work

bright robin
#

or i don't think so

copper raven
bright robin
#

how do i check it

copper raven
#

read the wiki, you need to setup a description.ext

bright robin
#

is that all?

#

because i'm being really dizzy about this for how weird it is being to me

copper raven
#

you also need the template like i said

#

something like respawnTemplates[] = { "MenuPosition", "Tickets" };

bright robin
#
respawn = 3;
respawnTemplates[] = { "MenuPosition", "Tickets" };
copper raven
#

it should yeah

bright robin
copper raven
#

the second line makes no sense

bright robin
copper raven
#

it doesn't work like that

bright robin
bright robin
#

not wanthing the code

bright robin
bright robin
#

wait

#

and now i've respawned 3 times

#

and it teleported me to another spawn point

#

what

bright robin
#

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?

fair drum
#

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.

bright robin
#

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

fair drum
#

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.

bright robin
fair drum
fair drum
#

It's in the config but I don't remember off the top of my hand

bright robin
#

i just want to have tickets per individual player πŸ˜”

fair drum
#

You can. Let me get home.

bright robin
fair drum
#

It might be late. Work has been rough the day after the hurricane.

bright robin
#

ah, no problems

#

AND also i'm back to the good'ol problems of "my units respawn with armamtent that doesn't correspond

wary needle
#

How would I go about making a limited arsenal

#

I cant find info on it online

winter rose
#

see BIS_fnc_arsenal doc I believe

bright robin
#

Description.ext requires anything to load it up?

open fractal
#

it's automatically detected

#

description.ext

#

just make sure it's in the same directory as the mission.sqm

bright robin
#

well

#

back to my topic

#

xd

bright robin
#

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

exotic flax
#

Use a limited respawn ticket pool for players. Pool can be applied to everyone, a side, a group or a single unit.
Use BIS_fnc_respawnTickets to 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

bright robin
#

on in wich way

#

for now i've tried init.sqf and the initPlayerLocal.sqf

exotic flax
#

I believe it has to be in initServer.sqf

bright robin
#
_playerTickets = [player, 3, true] call BIS_fnc_respawnTickets;

just to try it

bright robin
#

ok

#

let's try it

bright robin
exotic flax
#

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

bright robin
exotic flax
#

in that case change west to player

#

and set it in initPlayerLocal.sqf (after the player exsits)

bright robin
#

uggg

#

great

#

:)

bright robin
exotic flax
#

you could check to which side a player belongs, and add more (or less) tickets

bright robin
#

(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

exotic flax
#

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 πŸ˜‰

bright robin
bright robin
#

i am as well

exotic flax
#

winner is the side which got the capture or trigger (by getting the side of the players who triggered it)

bright robin
#

i don't get that part

exotic flax
#

just as an example, since west is one of the sides

bright robin
exotic flax
#

yes

bright robin
exotic flax
#

no, but you do need to know and set _winner to the side which should get the points

bright robin
copper raven
bright robin
copper raven
#

sure

bright robin
#

as a event

#

i mean

#

or as a trigger

copper raven
#

up to you

bright robin
fleet sand
#

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 ?

copper raven
fleet sand
copper raven
#

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

tough parrot
#

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)
warm hedge
#

selection is selection, basically the part of the vehicle that got a damage

tough parrot
#

I know, but why would it be blank?

warm hedge
#

Because it could be blank when the damage is a generic one

tough parrot
#

is that damage that goes directly to global health pool without hitting a specific part? i didn't know that was possible.

warm hedge
#

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

tough parrot
#

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.

stable dune
#

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

tough parrot
#

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.

stable dune
#
Armed Assault Wiki

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...

copper raven
#

forceWeaponFire takes local arg

drowsy geyser
#

how would i run a while loop for 10 seconds? cant figure it out XD

hallow mortar
#

Get current time > add 10s > while time is less than newtime...

exotic flax
hallow mortar
#

I think you have the comparison operator backwards

exotic flax
#

true... copied it from a waitUntil, where it is correct πŸ˜‰

fair drum
fleet sand
#

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.
fleet sand
# tough abyss 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 ?

tough abyss
fleet sand
#

For 1 session only

tough abyss
#

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

tough abyss
#

unless any of the more experienced people have some smarter ideas

fleet sand
# tough abyss or you can fiddle with nested arrays

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.

tough abyss
#

i wouldnt figure with ace actions there isnt too much documentation iirc and addaction is usually sufficent enough

exotic flax
tough abyss
#

thank you from what i heard it was quite limited havent dont too much modded stuff in a while

exotic flax
#

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)

rare ether
#

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) ?

cosmic lichen
#

@rare ether

fair drum
cosmic lichen
#

et = {; ?!?

south swan
#

perams;?

fair drum
#

et=tu?

cosmic lichen
#

Post the whole code

#

formatted

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
cosmic lichen
#

moving semicolons around is usually a bad thing since they only have one place to go

hallow mortar
#

You have semicolons in the wrong places, and you're spelling and using params wrong

cosmic lichen
#

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

hallow mortar
#
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
south swan
#

the current state of code is: "When the turret is dissassembled - delete two backpacks". In a very, very, VERY broken SQF

cosmic lichen
#

No need for that inline function really

tough parrot
#

learn how to use semicolons before anything else

rare ether
cosmic lichen
#

Oh, because of MP I recoN?

hallow mortar
#

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;
  }
];```
rare ether
# cosmic lichen Why not?

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

hallow mortar
#

If you have problems with the documentation you should mention them in #community_wiki , we're always trying to improve it

south swan
#

it would probably sound rude, but one bit of understanding can replace 100 bits of trying every possible combination πŸ€·β€β™‚οΈ

hallow mortar
tough parrot
#

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

open fractal
#

what's wrong with the docs?

#

what are you looking for?

hallow mortar
#

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.

tough parrot
hallow mortar
#

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

tough parrot
#

wiki search engines are fairly useless

cosmic lichen
#

Guys, get back to scripting, everything related to docs can go into #community_wiki

open fractal
#

you deciding to randomly place a semicolon after an opening bracket is not the fault of the wiki authors

hallow mortar
#

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.

cosmic lichen
#

Not to mention there is a finished example πŸ™‚

hallow mortar
#

No, I'm pretty sure you got wrong exactly what I just said you got wrong

open fractal
#

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

cosmic lichen
#

My feelings =/

#

Most of the stuff was rewritten a few years ago

south swan
#

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) πŸ€·β€β™‚οΈ

winter rose
#

sorry, I meant this message.

#

(@hallow mortar soz, wrong post!)

south swan
#

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?) notlikemeow

cosmic lichen
#

harder than what? No documentation at all πŸ˜„

#

It Just takes time to get familiar with it

#

That's the thing with all docs

winter rose
#

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!

cosmic lichen
#

is there? tell me, now ? πŸ˜„

winter rose
#

if you have doubts or questions, the channel is here for you, no problem

south swan
#

shoo, guys. Can you please stop?

hallow mortar
#

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

winter rose
#

(not you @cosmic lichen)

#

plz provide sugg

cosmic lichen
#

It's always the one infront of the screen

#

Someone told me

winter rose
#

anyway, back to your problem and how to solve it

hallow mortar
cosmic lichen
open fractal
#

needs a pebcak page

winter rose
#

Pretty sure if you type "event handler" in the search bar, you don't end up or Kirby's website πŸ˜„

cosmic lichen
#

Yeah, that prarams was not the issue.

hallow mortar
#

Sometimes I fear that half of my messages are simply vanishing into the void never to be read

cosmic lichen
#

They are read, but not by the one you think cough CIAcough

winter rose
#

not reading that sorry

tough parrot
#

there should be event handler for placing explosives

hallow mortar
#

There is; it's the Fired EH with the Put weapon

granite sky
#

For ACE explosive placement you have to use their CBA handler instead, but IIRC that one is documented.

tough parrot
#

so if you place a mine/charge _weapon = mine/charge object?

hallow mortar
#

No, mines, charges, and grenades are magazines for the Put and Throw weapons

tough parrot
#

i need the position of the placed item

granite sky
#

That's not a problem. Fired/FiredMan EH gives you the projectile as a parameter, so you can do getPosATL _projectile

little parrot
#

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?

open hollow
#

hello, i want to force to have a minimum amount of grass, how i can do that?

winter rose
#

the server's options can force that, that or setTerrainGrid

open hollow
#

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

hallow mortar
#

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.

open hollow
#

any idea on how to have the same "UI" as the gunner?

hallow mortar
#

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 using lockCameraTo, 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.
open hollow
#

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

fleet sand