#arma3_scripting

1 messages Β· Page 757 of 1

drifting portal
#

well I'm used to zooming with camera

#

guess I will have to find a ratio and eyeball it

#

until it seems a bit good

copper raven
#

and use that with camSetFov

drifting portal
#

well

drifting portal
#

you mean this?

#
RscPicture ctrlSetPosition [0.301595 * safezoneW + safezoneX, 0.22786 * safezoneH + safezoneY, 0.386302 * safezoneW, 0.363 * safezoneH];
copper raven
#

yeah

drifting portal
#

what shall I input, the first two coordinates? or the first two in _cameraInUiWidth and the last two in _cameraInUiHeight?

copper raven
#

no, width and height accordingly

drifting portal
#

I guess 0.301595 * safezoneW + safezoneX, 0.386302 * safezoneW is for width but how would I put this array into that variable I don't think I should do that?

copper raven
#

0.386302 * safezoneW and 0.363 * safezoneH

drifting portal
#

stay sharp I guess

copper raven
#

i'm not sure if it will work

drifting portal
#

I will try it

#

nope

#

it doesn't change the fov of the camera

#

weird

drifting portal
#

the fov doesn't change

#

but when its below 4

#

it changes drastically

#

and at 0 it zooms very far

#

for example

#
KK_fnc_trueZoom = { 
    ( 
        [0.5,0.5]  
        distance2D   
        worldToScreen  
        positionCameraToWorld  
        [0,3,4] 
    ) * ( 
        getResolution  
        select 5 
    ) / 2 
}; 

(1 * call KK_fnc_trueZoom * (0.386302 * safezoneW / 0.363 * safezoneH))
#

this returns 0.76

#

below 1 the zoom actually starts

copper raven
drifting portal
copper raven
#

try it, yeah

#

i'm waiting for my new motherboard, don't have anything to run arma properly with meowsweats

drifting portal
#

it makes more sense now

#

but the zoom still looks a bit weird

#

so I guess I will have

#

to multipy it

#

by a small factor

#

to make it more plausible (its stretched)

copper raven
#

yeah because it still uses the ratio from your actual screen

#

there isn't much documentation on how the entire fov/zoom stuff works

drifting portal
#

and

#

the fov calculator for arma 3

#

is down

#

if its not down it would have made my day much easier

copper raven
#

i'm pretty sure it uses made up value for scaling anyways

#

fovLeft = fovTop / height * width is all you need to know really

drifting portal
#

thats what I meant

#

anyways It looks good now after I found a good number to multiply the thing with, thanks

tepid vigil
#

To properly #include CBA stuff into .sqfc files, do I need a copy of CBA on my P: drive?

past lodge
#

How do I set up an AI wing man

tough abyss
#

Need help with this
Condition to open lock the door
Code, scripting the required conditions to unlock the door, can be anything, must return BOOL
I tried this

_Bob2 setOwner 76561198202693127 = True;
hallow mortar
#

Well, that's a command, not a condition. So that just means that every time the condition is evaluated (maybe every frame if it's an addAction 😬 ) you're setting the network owner of the _Bob2 unit to whoever's Steam ID that is, assuming they're in the game.

Except that's probably not working, because you're taking that command and trying to set its value to true, which is fundamentally incorrect syntax.

#

It would help to know what you actually want the condition to be.

tough abyss
#

can i shoot you a dm of my screenshot?

hallow mortar
#

I'd prefer it if you described what you want the condition to be

#

If it's a screenshot of the error, that won't help; the error is caused by an underlying major flaw in the script and it needs to be changed regardless of what the error says

tough abyss
#

its a door im trying to have people's uid be checked if true from list then it will unlock. using Mrhmilsim tools biometric scanner

hallow mortar
#

Then your condition will probably need to look something like

(getPlayerUID _this) in [array,of,UIDs];```
obviously fill that array with the UIDs you want.
tough abyss
#

its giving me a bool error though so how would I need to implement =True?

hallow mortar
#

You don't.
= true means "set this variable to true", so using it on a command is wrong syntax. You probably meant == true, "compare this variable to true", but you don't need to do that since that since _variable == true will just return true if the variable is true...so you can just return the original variable (in this case the output of the in command)

#

Based on how completely incorrect the original code was, I suspect you may have other errors elsewhere that will also be popping up. Script errors usually display the position of the error in the code, which would be useful info for fixing it.

#

Note: "completely incorrect" sounds harsh. I'm not attacking you; sqf can be complex and unintuitive. But...it was completely incorrect.

tough abyss
#

its a fill in on eden module not a scripted document

hallow mortar
#

Okay, so it probably won't give a line number, but what does it actually say?

tough abyss
#

Condition to open lock the door
Code, scripting the required conditions to unlock the door, can be anything, must return BOOL

hallow mortar
#

....the error

tough abyss
#

got a Bool error

hallow mortar
#

A bool(ean) is a type of data that has two possible states, true or false. You have an error that involves a bool, not a bool error. What does it say exactly?

tough abyss
#

call compile _condition;
if (typeName |#|_condition != "BOOL") exitWith {
system...'
Error Undefined variable in expression: _conditon
Filr MRHMiscItemsFunctions\fn_MilsimTools_miscItems

if !([_building,_do...'
Error Undefined Variable in expression: _condition

hallow mortar
#

Okay, that's not actually a bool-related error, that's an undefined variable error. Something inside that script is looking for a variable called _condition that doesn't actually exist.

#

Btw, script errors are logged in a special text file called an RPT file. This is stored in %localappdata%\Arma 3 and will save you a lot of transcription.

tough abyss
#

so what do i need to put in the Condition to open lock the door for only certain people to open it

#

i look at the mods wiki and it say wip

hallow mortar
#

Either exactly what I posted or something very similar.

This script error means one of 3 things:

  • the Condition field is empty
  • a different Condition field is empty
  • the mod is broken

I don't know which. I don't have this mod installed and I don't know anything about it. Maybe you can check the Workshop comments or contact the author.

tough abyss
#

ok thank you for the help and teaching me the correct meaning of bool in arma

hallow mortar
#

It also means that in any sort of programming

digital wasp
#

hello, i wanna change the magazine to cluster rockets in mk41 VLS. the variable name is g2. is this how i do it?

g2 loadMagazine [[0], "weapon_VLS_01", "ammo_Missile_Cruise_01_Cluster"];
#

i put it in object init

copper raven
drifting portal
#

I'm getting this error

#

what is that?

winter rose
#

an error

#

a callExtension error, even

drifting portal
#

is it because my code is too long?

#

tried shortening it and it worked

#

but I'm still facing a problem

winter rose
#

did you read it? I did, it says "Number, expected Array"
a variable that should be an array is actually a number

drifting portal
#

hmm

#

how would I know exactly what it is referring to so I can fix it?

winter rose
#

check the values around the error location

drifting portal
#

configfile?

winter rose
#

isn't this error a script error?

drifting portal
#

nope

#

when I remove a bunch of lines it seems to work

#

really weird

#

I have about 500 lines

winter rose
#

then Β―\_(ツ)_/Β―

drifting portal
#

does

owner (allplayers select 3);

give me the OwnerID of the fourth player?

granite sky
#

Assuming that you run it on the server, and they've been connected for long enough for control to transfer to that machine?

drifting portal
#

run it on the server?

#

so locally won't work?

granite sky
#

owner only works on the server.

#

clients don't know the owners of remote units.

#

They just know if it's them.

drifting portal
granite sky
#

What is this actually for?

drifting portal
#

need to grab the clientID of a _unit that I will select through a list

granite sky
#

Why?

drifting portal
#

publicVariableClient

#

I want to use this

granite sky
#

You know the data has to go through the server anyway, so generally you're better off telling the server to do stuff like this.

drifting portal
#

can you show me an example of how to grab the ID?

#

through the server

#

kinda lost

granite sky
#

from the server it's just owner

drifting portal
#

ok

#

now when I do that

#

I want it to be defined locally to me too

drifting portal
#

I want the clinetID to be grabbed and defined as a variable locally to me

#

so I route it from the server to me locally basically

granite sky
#

I feel that the approach here is probably fundamentally wrong, but yeah, you could setVariable the machine ID on the player object if you really wanted to.

#

But it needs to be player setVariable ["GrabID", clientOwner, true], otherwise it won't be broadcast.

drifting portal
#

player

#

in that case

#

is who?

#

me or the fourth player I'm grabbing?

granite sky
#

I mean you can just run that as global if you like.

#

and then everyone has their machineID published on their player unit.

copper raven
noble zealot
#

A WeaponHolderSimulated, after it stoped to move, is like a GroundWeaponHolder? I ask that because i will create 200 Weapons Holders, and i don't want to use the simulated one if it will use more server and clients resources. But simulated is better since some will be created in air and need to fall to the ground.

granite sky
#

IIRC from profiling they still continue to use simulation resources.

#

So if you want them to drop initially then ideally you'd manually transition them after a few seconds.

noble zealot
#

@granite sky thanks!

drifting portal
#

although its actually a length problem

#

that was fixed by either shortening the code in debug console

#

or putting the code in an init of an object or sqf file

#

debug console basically gave up at 500 lines of code

#

so I had to change the execution method

#

I'm using leopard20's debug console

tight cloak
#

trying to make a script that spawns a copy of an object that your looking at, and then be able to manipulate it.
specifically. spawn the object your looking at; at your feet and attach it to you

#

cursorobject and cursortarget return obj null

#

disregard, forgot typeof exists

hushed loom
#

Hi, how can i find class name for a missile used in drone's loadout? i'm trying to remove all its weapons using removeWeapon "some_class" but don't know how to find the class name..

tight cloak
#

go into gunner of the drone, select the missile and then try

vehicle player currentWeaponTurret [0]; vehicle player magazinesTurret [0];
#

should return the weapon and its ammo

hushed loom
#

thanks

digital wasp
#

how do i spawn a group of objects each with own variable name

hushed loom
#

returns empty string and array

open fractal
digital wasp
#

i need to spawn a checkpoint with each object (about 15 objects total) having a unique variable name e.g. obj_1 obj_2 etc. i need it because i want to make a hold action that "builds" a checkpoint object by object and if interrupted, removed the checkpoint object by object

distant oyster
#

wouldnt an array be more useful then?

open fractal
#

wouldn't it be better to-

#

yeah what terra said

distant oyster
#

:)

open fractal
#

can't you just reverse the array too

#

for the deleting part

distant oyster
#

yeah what real artisan foods said

open fractal
#

yeah!

digital wasp
#

sorry im very bad at coding, how would one do that?

distant oyster
#

how are you spawning the checkpoint?

digital wasp
#

i'm not sure: i asked how to do it, got no response

open fractal
#

is it relative to the player or is it a predefined emplacement

digital wasp
#

i thought about having the checkpoint somewhere far away and just setting their position so they already have variables and i can use it

open fractal
#

like when you hold a button in a lego game and the thing builds?

digital wasp
#

yes

#

19 objects total

open fractal
#

personally I would just hide the objects and unhide when the player "builds" them

digital wasp
#

hide? like move away?

open fractal
digital wasp
#

ooooooooooooh

#

thanks

open fractal
#

yw

#

is this for multiplayer?

hallow mortar
digital wasp
open fractal
#

hideObject has a local effect, you either execute it for everyone or execute it on one machine with hideObjectGlobal

#

depends on how you're writing the script

winter rose
#

on the server I believe?

digital wasp
#

does it just hide the visual? physically it's still there?

open fractal
#

no you can walk through it

hallow mortar
digital wasp
#

but if it's mp and i hide it locally?

#

so it's not visible for me and i can still walk through? what will the other players see?

open fractal
#

i haven't tested it myself but I'd imagine it would allow local objects to pass through

hallow mortar
#

They will see the object and will not be able to walk through it

open fractal
#

like the player character and their vehicle

#

but for everyone else it's just there

digital wasp
#

okay

open fractal
#

dont quote me on that though

digital wasp
#

so to hide it from start i type hideObjectGlobal "objectvariable";?

open fractal
#

no

#

quotes only go around strings

hallow mortar
digital wasp
#

okay, thanks

#

still in init of the object tho?

open fractal
#

if you're in eden editor you can just uncheck "Show Model"

digital wasp
#

okay

open fractal
#

it's under special states

digital wasp
#

thank you

open fractal
#

np

digital wasp
#

appreciate that

hallow mortar
#

The wiki page explains how to format the command properly.
Take note that where it says "server execution", it means server execution only, executing on all clients can have negative effects. If you run it in an init field you need an if isServer then { }; to make sure it only runs on the server.

digital wasp
#

so what if i'll be running it in multiplayer AND sp sometimes for myself? how would it look?

#

if server then hideobjectglobal, else: hideobject?

open fractal
#

no

#

in sp you are the server

digital wasp
#

okay

digital wasp
#

to unhide objectName hideObject false;?

open fractal
#

yeah

digital wasp
#

thanks

fleet sand
#

Hi guys i have a simple question why is this code not showing the hint?

_veh = "B_G_Van_01_transport_F" createVehicle position player;
_veh addEventHandler ["Fired", {
    
    if(_this select 1 == "CarHorn") then {
        hint "Test";
    };
}];
hallow mortar
#

Are you certain that that vehicle has a CarHorn? There are several different horn weapons

fleet sand
hallow mortar
#

Okay, this came up a while ago and it seems like horns just don't set off the Fired EH

digital wasp
#

okay, i used sleep + hide object false but i found an issue: if i interrupt, the code to unhide objects contrinues while the other code tries to hide them. what mistake did i do?

#

im sorry im just pretty bad at coding

open fractal
#

codeProgress: Code - (Optional, default {}) code executed on every progress tick.

digital wasp
#

so it's executed every tick? how do i make the code spawn different objects then?

open fractal
#

when you hold down the action it'll count from 1 to 24 and pass that to the code expression

digital wasp
#

okay, im getting lost. 24 ticks to finish hold action, right?

open fractal
#

yes

#

it gives you the tick it's on

#

and you can turn that number into an index number for your array

digital wasp
#

so if my array is a list of objects to spawn, the 1st object will be spawned at the first tick, the second on the second tick etc., right?

fleet sand
open fractal
#
{
params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
private _multiplier = ((count your_array) / _maxProgress);
private _index = (_progress * _multiplier);
if (_index % 1 == 0) then {
(your_array select (_index  - 1)) hideObject false
}
},
#

@digital wasp

#

this will count how many objects are in the array, get the progress as a fraction of that number, and then if it's divisible by 1 it will hide the object at that index

digital wasp
#

my array should be in init.sqf?

open fractal
#

yeah that'll work

digital wasp
#

and i have to put it in?

open fractal
#

vad_buildArray = [Obj1, Obj2, ...]

digital wasp
#

init of the object? code start? code progress?

open fractal
#

what I posted is the codeProgress parameter

digital wasp
#

thank you

jade acorn
#

can I disable the briefing screen when I use initIntro.sqf ? I have the "Show Briefing" unchecked in mission attributes but when I playtest my mission (from the editor) with an intro, it is still shown instead of a smooth transition to the actual game.

open fractal
#

hold on vad i messed something up there

#

just realized

#

fixed @digital wasp

digital wasp
#

what?

open fractal
#

i wrote the wrong variable at one part

digital wasp
#

oh okay

open fractal
#

edited the block

#

i also just realized this will only work with an even number of objects, I'm not good at math so if nothing else you can do a isObjectHidden check and ceil to round up the index so it's always an integer

digital wasp
#

to hide everything on interrupt i would have to:

{_x hideObject true} forEach your_array;
```? im trying to figure some things on my own so correct me if 'm wrong
open fractal
#

besides the typo that's correct

digital wasp
open fractal
#

sounds good lol

digital wasp
#

thank you

distant oyster
open fractal
digital wasp
#

okay

open fractal
#

i should have paid attention in algebra class meowsweats

digital wasp
#

same

cursive tundra
#

Is there a way to globally set AI skill for all current and future units in 3den editor? Or do i have to set the skill of units i spawn with scripts manually?

distant oyster
open fractal
#

@digital wasp ```sqf
{
params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
private _multiplier = ((count your_array) / _maxProgress);
private _index = ((ceil (_progress * _multiplier)) - 1);
private _object = your_array select _index;
if (isObjectHidden _object) then {
_object hideObject false;
};
},

distant oyster
#

touchΓ©

winter rose
#

now how come you did not fix it πŸ˜›

distant oyster
#

i am trying to find the messages in #community_wiki with more info but discord doesnt find anything

fleet sand
# cursive tundra Is there a way to globally set AI skill for all current and future units in 3den...
[] spawn {
    while {true} do {
        {
            _x setSkill ["general", 1];
            _x setSkill ["aimingAccuracy", 1];
            _x setSkill ["aimingSpeed", 1];
            _x setSkill ["endurance", 1];
            _x setSkill ["spotTime", 1];
            _x setSkill ["courage", 1];
            _x setSkill ["aimingShake", 1];
            _x setSkill ["commanding", 1];
            _x setSkill ["spotDistance", 1];
            _x setSkill ["reloadSpeed", 1];
        } forEach allUnits;
        sleep 10;
    };
};``` I guess something like this is what you need but its quite expencive becouse of the infinite loop.
distant oyster
#

i like to verify my contributions unlike some other people

winter rose
open fractal
fleet sand
open fractal
#

it effectively does the same thing i believe, just adds a little variation

#

might be better to set a variable for all of the units and run a check if they've already been assimilated

fleet sand
#

I have a quick question so i have this code:

[] spawn {

_veh = "B_G_Van_01_transport_F" createVehicle position player;
waitUntil{!isNull findDisplay 46};
    (findDisplay 46) displayAddEventHandler["MouseButtonDown",{
        params["_display","_button"];
        private _car = objectParent player;
        if(!isNull _car && {_button == 0 && driver _car == player && _car isKindOf "B_G_Van_01_transport_F"}) then {
            hint "Test";
        }
    }];
};``` how would i check if player pressed left click in only that vehicle that is _veh with out makeing the variable global ?
digital wasp
#

im not sure why, but it doesn't work. my arrays ii int.sqf:

objlist1 = [obj1, obj2, obj3, obj4, obj5, gate5];
objlist2 = [gate6, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15, obj16, obj17];

i put your code in "Code Progress", i changed "your_array" to objlist1, i thin i did everything right. what could be an issue?

open fractal
digital wasp
#

i cant send sscreenshots

open fractal
#

why not use a global variable?

#

you can also add an event handler to the vehicle to pass the _veh to a player variable and then check if the player variable matches the vehicle

fleet sand
#

could you pls elaborate a bit how would i do that.

open fractal
#
_veh addEventHandler ["GetIn", {
    params ["_vehicle", "_role", "_unit", "_turret"];
        player setVariable ["clickVic",_vehicle];
}];
if (player getVariable ["clickVic",objNull] == vehicle player) then {...}
fleet sand
open fractal
#

you're welcome

hallow plover
#

Is there any way I can disable a specific function in the controls menu (keyboard)?

still forum
#

I may be a day late. And if you're thinking that, you'd be correct! meowtrash

sudden yacht
#

Im trying to get a squad to add the nearest vehicles to use. Help. _list = P1 nearEntities ["CAR", 200]; { p1 addVehicle _x; } forEach _list;

sudden yacht
#

the group

#

Oh... i think i see what you mean

#

needs to be an object.

#

got it. ty

true frigate
#

is there a way of doing this

_selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
[_x, 0.2, _selection, "vehiclecrash"] call ace_medical_fnc_addDamageToUnit;
``` for all units around an object? (around 5 meters) Normally id use `forEach units grp_1;` but I'm trying to make have an effect around a certain position
#

to make it more complicated, the object moves around, and up and down

true frigate
#

Forgive me for maybe giving somebody an aneurism, but is this the correct usage?

{_selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
[_x, 0.2, _selection, "vehiclecrash"] call ace_medical_fnc_addDamageToUnit} 
forEach getPosATL _obj1 nearEntities [type, radius]```
copper raven
true frigate
#

I just saw that haha, it has to be an object not a number, but thank you!

copper raven
#

it wasn't a number meowsweats

true frigate
#

Sorry, array

fleet sand
#

Hi guys so i have math question. So how can i make it so the cannon shoots from direction that is point at. So i have a cannon that is rotating on X angle 360. and i want to fire a object from direction that cannon is faceing but every time i fire the bullet is going to the left or front depending on what side of X rotation cannon is: code:

_Bullet = createVehicle ["Land_GasTank_01_khaki_F", position smokeeffect, [], 0, "CAN_COLLIDE"];
                _dir = direction cannon;
                _vel = velocity cannon;
                _speed = 20;
                _Bullet setVelocityModelSpace  [
                    (_vel select 0) + (sin _dir * _speed),
                    (_vel select 1) + (cos _dir * _speed),
                    (_vel select 2)
                ];```
granite sky
#

setVelocityModelSpace is relative to the bullet's heading, so that won't work as intended.

#

If you don't care about the facing of the bullet then setVelocity should work.

fleet sand
#

i did try with Setvelocity and it shoots but it shoots sideways, how would i fix so it shoots just in direction that is pointing at.

granite sky
#

Remind me what direction 0 is in Arma :P

fleet sand
granite sky
#

Also does this cannon have a 3d direction or just 2d?

#
_bullet setVelocity ((vectorDir cannon vectorMultiply 20) vectorAdd velocity cannon);
_bullet setVectorDir (vectorDir cannon);
#

better just to work with vectors if you have them.

#

Can't guarantee that the direction part is sensible because it depends which way up the objects are modelled.

leaden ibex
#

who executed the scripts passed by execVM?
Is it only the client calling the execVM, or server, or all clients and server?

copper raven
leaden ibex
jade acorn
#

can I change the position of 3rd person camera without creating a mod for it? I'm checking out some mods like this on workshop and all of them have to refer to CAManBase in CfgVehicles (config.cpp) so I assume it's impossible to be changed by a sqf/hpp script on fly or defined in description.ext?

coarse dragon
#

How could I... at a certain point in a mission. Switch to a AI on a emeny team for me to control

granite sky
winter rose
#

^

granite sky
coarse dragon
#

Seems like it can be bugger for MP

granite sky
#

mostly works IME :P

coarse dragon
#

Buggy

granite sky
#

Follow the caveats and you should be ok.

coarse dragon
#

Thanks meowawww

little raptor
# digital wasp im not sure why, but it doesn't work. my arrays ii int.sqf: ```sqf objlist1 = [o...
   {
        params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
        private _minIdx = floor (((_progress-1) / _maxProgress) * count your_array) - 1;
        private _maxIdx = floor ((_progress / _maxProgress) * count your_array) - 1;
        for "_index" from (_minIdx max 0) to _maxIdx do {
          private _object = your_array select _index;
          if (isObjectHidden _object) then {
              _object hideObject false;
          };
        };
    },
little raptor
digital wasp
#

i mean it works fine for me, do i have to change it?

#

he helped me out in dms too

little raptor
#

depends what maxProgress is

digital wasp
#

it doesn't really

#

it spawns all of them in

little raptor
#

then the number of your objects is fewer than maxProgress

open fractal
#

Yeah we went over it in dms there are fewer than 24 so it works as is

#

appreciate the correction though

digital wasp
#

is this the script to check if group is in vehicle:

call{units group_name findIf {!(_x in vehicle_name)} < 0}
```?
granite sky
#

If any of that group are in that specific vehicle? Should work.

digital wasp
#

okay, thanks

#

how to fade out at the end of the mission?

#

like fade out to black

velvet merlin
#
_x addEventHandler ["Local",
{
params [["_entity", objnull,[objNull]], >
  Error position: <params [["_entity", objnull,[objNull]], >
  Error Params: Type String, expected Bool```
#

code used

            _x addEventHandler ["Local",
            {
                params [["_entity", objnull,[objNull]], ["_isLocal", false, [false]]];```
#

this the string return a bug or part of the "expected" behavior of local EH?

fair drum
#

for large public MP, is it better to define your variables in the config security wise?

little raptor
little raptor
tepid vigil
#

Is it possible to check if a map coordinate is on-screen when looking at a map?

bold grove
#

Regarding structured text, is it possible to put text alongside an image? I've been messing with the vertical alignment, but that just adds a single line of the paragraph and the rest goes underneath

granite sky
tepid vigil
distant oyster
distant oyster
#

then no

bold grove
#

Balls

little raptor
#

so not equivalent, no

granite sky
#

ugh, might be losing the plot :P

little raptor
tough parrot
#
    _man = param[0,nil,objNull];

Error Type Object, expected Array meowhuh

granite sky
#

third parameter of param is an array of expected types, so:

_man = param[0,nil,[objNull]];
tough parrot
#

I suppose I did not notice I was missing that for a while because [] unintentionally works for arrays.

fair drum
#

wooooh black betty, man param

little raptor
#

not arrays

tough parrot
fair drum
#

["woo", "", "", "wee"]
how can I use joinString/splitstring to get
"woo", "", "", "wee"

granite sky
#

I don't get it. You just removed the brackets?

fair drum
#

yeah I want to change the array to a flat string while retaining empty strings

#

figured it out:

copyToClipboard (str primaryWeaponItems player splitString "[]" joinstring "")

//returns
"ACE_muzzle_mzls_smg_02","","",""
tranquil jasper
#

Does anybody know a way to get the specific WeaponHolderSimulated a unit creates when it dies?

tough parrot
tranquil jasper
#

No that's not right

#

Unfortunately I did find the answer though. When you kill a unit with a primary weapon, the "Put" event handler fires...

#

unfortunate because I don't want my script responsible to put an event handler on every unit in a mission

stark bone
#

alrighty so i have a script that i want to have stacking effects of increasing the animation speed coef when its activated and i have some code that essentially is this

_current = (getAnimSpeedCoef _target);
_increase = _current + 0.5;
_apply = _target setAnimSpeedCoef _increase;

the issue is atm _current gets stuck with the initial value of 1 for some reason and i cant increase the coef past 1.5 no matter how many times the script activates

granite sky
#

@tranquil jasper Put handler attached to the dead unit or the killer?

drifting portal
#

@winter rose sorry for tagging but can you send that biki sqf editor programs page that you sent in this channel again?

drifting portal
#

the page contained a bunch of debug consoles

#

and sqf editors

#

such as notepad++ and visual studio

winter rose
#

oh
Search for "Community Tools" in Discord

#

(or on the wiki for that matter)

drifting portal
somber radish
#

Anyone knows where to get the armor on a infantry Vest?
So far the closest I am getting is:

(getText (configFile >> "CfgWeapons" >> "V_PlateCarrier1_rgr" >> "descriptionShort"))

Which returns:

"Armor Level III"

And that is fine in most cases, but then you got mods with other values, and there are explosive-resistant vests and this throws the system into the bin.

#

What I am asking, is there somewhere in the config I can extract a numerical value of some sort, that represents the armor given by said vest

warm hedge
#

The description is just a description, doesn't represent the actual value. Are more like a flavor text

#

Hang on, let me check what it was

somber radish
#

Nice!

ivory lake
#

yeah it's just a string assigned in the description of the item, mods can either write their own, ignore it, or mistakenly inherit it. so you might have a baseball cap that's level II armour or something stupid, it doesn't mean its actually armoured

#

you'd have to check the HitpointsProtectionInfo class inside ItemInfo

somber radish
#

Nice! thank you!

#

How would i write that query in sqf?

granite sky
#

The practical issue there is that the new data has a lot more numbers, so you'd need to figure how you want to combine them.

somber radish
#
(getNumber (configFile >> "CfgWeapons" >> "V_PlateCarrier1_rgr" >> "itemInfo" >> "HitpointsProtectionInfo" >> "Chest"))

This is not working, so I have some error somwhere

somber radish
granite sky
#

You need >> "Armor" on the end there.

ivory lake
#

Yeah that

#

if you want to collect all hitpoints from a vest or similar you'll want something like:
untested:

_configs = "true" configClasses (configFile >> "CfgWeapons" >> "myVestClass" >> "ItemInfo" >> "HitpointsProtectionInfo");
granite sky
#

typical range for the chest armour value is 8-28 for armoured vests.

#

Carrier GL has 78 but high passthrough, so that's gonna look weird.

somber radish
#

Oh

#

so the passthrough needs to be calculated in there for a final result

granite sky
#

I'm not 100% sure what it actually does :P

warm hedge
#

You can check Arsenal function if you want to check how it behaves in Arsenal stat bar

somber radish
#

Thank you guys! I really appreciate the help!

drifting portal
#

how do I check if the vehicle is an air vehicle?

distant oyster
#

i think it was

_vehicle isKindOf "Air"
``` to make sure check the config parents
drifting portal
#

vehicleClass = "Air";

proper sail
#
_abc = ["_array1",1,2,3];

//stuff

_varNameToCreate = _abc select 0;

//whatgoeshere

//Result
_array1 set [count _array1,(_abc select 1)];```
#

is this possible

#

want to dynamically create an array based on a string name

winter rose
proper sail
#

yeah agreed

#

Im trying to not do that

winter rose
#

so don't πŸ˜„
what ails you here?

proper sail
#

That i need to generate a var based on a stringname

#

I mean i can do setvariable but i dont quite know if thats the best solution

granite sky
#

Often the better option these days is hashmaps.

#

but things like missionnamespace getVariable ("myarray_" + str _n) are also possible.

proper sail
#

thats what i was looking for

#

appreciate it

#

the set/getvar was my initial thought too but wasnt quite sure

#

but ill use that

granite sky
#

The slightly hacky logic-object "namespaces" that people used before hashmaps probably work in A2 as well.

#

If you don't want to dump too many arbitrary variable names into global namespace.

stuck rivet
#

what do I use if I want to check if a button is pressed in an If statement?

granite sky
#

What, like a UI button?

stuck rivet
#

keyboard, mouse or anything

#

i want to modify this script from killzone kid so that I can exit the camera with a button press

#
    _null = _this spawn {
        _missile = _this select 6;
        _cam = "camera" camCreate (position player); 
        _cam cameraEffect ["External", "Back"];
        waitUntil {
            if (isNull _missile) exitWith {true};
            _cam camSetTarget _missile;
            _cam camSetRelPos [0,-3,0];
            _cam camCommit 0;
        };
        sleep 0.4;      
        _cam cameraEffect ["Terminate", "Back"];
        camDestroy _cam;
    };
}];```
#

i'd also like to know if its possiblet o make this script not remove control of your character

granite sky
#

inputAction would be the direct answer, but if you want to avoid polling every frame then displayAddEventHandler + keyDown.

coarse dragon
#

Can you make a vehicle explode with a trigger?

granite sky
#

Making a vehicle explode is just _veh setDamage 1

fair drum
coarse dragon
#

Hmm interesting

hallow mortar
#

It bothers me a lot that that description spells it "hooming" every time

coarse dragon
#

Hmm how do I move a newly created unit to a new Layer I made?

tranquil jasper
little raptor
coarse dragon
#

Sorry

true frigate
#

Hey, does anyone know how I can find the class name of an RPG round from a mod? Something along the lines of "M_Titan_AT" but obviously thats for the titan launcher.

tranquil jasper
#

would be in the mod config somewhere I'd imagine

open fractal
#

then just fire the weapon

true frigate
#

Would I run that in debug menu?

open fractal
#

yeah you can just slap it in there

true frigate
#

Thank you so much!

open fractal
#

it'll copy it to clipboard

#

yw

somber radish
# granite sky I'm not 100% sure what it actually does :P

So i did manage to come up with a system that returns consistent values

_finalArmour = (_chestArmor / _chestPenetration)
The following numbers represent the _finalArmour variable.
16 Level 1 vests.
30 Level 2 vests.
53 Level 3 vests.
100 Level 4 vests.
130 Explosive resistant vests (should be the same as lvl 3, some potential errors here).
240 Level 5 vests.
#

Anyway, now I am trying to figure out the armor values on uniforms

#

And that is a lot harder

#

I am looking to extract the ballistic protection for this:

"U_O_R_Gorka_01_F"

However "ItemInfo" on uniforms does not contain any "HitpointsProtectionInfo"

#

Anyone got any clues?

floral beacon
#

Anyone know if Ace3 website is actually down or if it's just me? I can't find anyone else anywhere confirming it's down.
(ace3mod.com)

little raptor
#

afaik they don't thonk

granite sky
#

@somber radish I never found it, which is strange because it's definitely a thing. I even swapped a CSAT uniform onto a blufor guy to test.

#

The CSAT uniforms definitely reduce damage. Not a myth :P

little raptor
#

not the uniform

granite sky
#

That's what I figured, so I swapped the units.

little raptor
#

uniforms have a body

somber radish
little raptor
#

called uniformClass

somber radish
#

ooh

little raptor
#

maybe that's what provides the "ballistic protection"

granite sky
#

ah yeah, that thing

#

otherwise the arsenal code might tell.

somber radish
little raptor
granite sky
#

looks like the CSAT guys all have armorStructural 4 while everyone else has 3.

#

No idea if that one actually does anything though.

little raptor
#

so yeah, that explains it

somber radish
#

It does

#

Nice!

granite sky
#

ah yeah, 6 in most places & .33 passthrough compared to 1 & 0.8 for normal people.

ionic talon
#

Could someone tell me, if via the mapping I can put an area in which the damage on buildings would be deactivated?

little raptor
#

mapping?

granite sky
#

You mean the editor?

#

I guess you could drop down a logic object and allowDamage false on all nearby buildings in the init statement.

#

If you want a non-circular area you could filter with inAreaArray and a marker.

ionic talon
ionic talon
ashen hawk
#

Hello, is there a way to make an AI Jet do a scripted move? Such as the equivalent of holding A and S as a player?

foggy hedge
#

Can someone help me on converting type "string" to type "object"? Basically, I have 144 walls, and I want to unhide them all when some code executes. They are in sets of 4, of g*w#, where * is 1,2,3, or 4, and # is 1-36. I have a for loop to automate hiding the walls, but using FORMAT to combine "g1w" with the 1-36 number results in a string, and I can't find any command to convert a string into a object type?

private _gWalls = ["g1w","g2w","g3w","g4w"];
{ 
            for [{private _i = 1}, {_i < 37}, {_i = _i + 1}] do {
                private _wallName = format ["%1%2",_x,_i];
                //_wallName = _wallName select [1,-1];
                [_wallName,1,-1] call BIS_fnc_trimString;
                //_wallName = call compile _wallName;
                _wallName hideObject false;
            };
        } forEach _gWalls;
#

(spacing is weird as it's nestled into a bunch of other control structures with tabs)

#

I've tried select, trimString, and something I heard about call Compile being able to convert the string, but none seems to work.

#

Probably missing something basic here I bet

little raptor
#

for [{private _i = 1}, {_i < 37}, {_i = _i + 1}]

#

don't use for like this

foggy hedge
#

Alright, how should I use it then/what other loop should I use?

little raptor
foggy hedge
#

My code is probably kinda cursed right now as I'm taking a java class and it bleeds into my sqf

#

Ah, so formatting like example 3 for FOR is discouraged?

#

for [{ _i = 0 }, { _i < 10 }, { _i = _i + 1 }] do { systemChat str _i };

little raptor
little raptor
#

it's both slow to type and execute

foggy hedge
#

understood, thank you

foggy hedge
#

Ah I see

#

Haven't used FOR much so far, forEach has satisfied me until now

ashen hawk
tough abyss
#

hello people very good evening someone will have the script to put the ace arsenal in a box

tough abyss
little raptor
tough abyss
#
addMissionEventHandler ["Draw3D", {   
 drawLaser [   
muzzle player vectorAdd [0,0,0]
  player weaponDirection currentWeapon player,   
  [0, 1000, 0],  
  [],   
  0.05,   
  0.05,   
  -1,   
  false   
 ];
}]; 
``` im getting an error at the ```sqf
player vectorAdd [0,0,0]
  player weaponDirection currentWeapon player,
``` line im not very experienced with vectors this was just a one off script for a friend i think ive done something basic wrong
warm hedge
#

You forgot a comma

tough abyss
#

where?

warm hedge
#

Between vectorAdd [0,0,0] and player

tough abyss
#

thx

tulip ridge
#

Using UnitPlay to have a helicopter fly in and land for the intro of a mission, but after the movement finishes, the helicopter just shoots up into the sky, I've tried turning the engine off after it finishes, setting the velocity to 0, deleting the crew, helicopter still shoots up.

// intro_flight.sqf
_movementdata = [...];

heli engineOn true;
heli allowDamage false;
_sequence = [heli, _movementdata] spawn BIS_fnc_UnitPlay;
waitUntil {scriptDone _sequence};
heli engineOn false;
heli setVelocity [0, 0, 0];
deleteVehicleCrew heli;
tough abyss
warm hedge
#

Full code please

little raptor
warm hedge
#

Oh true. I'm tired it seems

#

Also vectorAdd [0,0,0] is nonsense as well

little raptor
tough abyss
#

i did something similar a bit ago is there another place i put the muzzle as it is a location on the player

#

like the part of their body

#

or am i misunderstanding this?

little raptor
little raptor
tough abyss
#

ok

#

i might return once i read a few syntax

little raptor
#

There's no direct command for it

tough abyss
#

ah is there a general location similar or not?

little raptor
#

I once posted something in this channel for someone. I'll see if I can find it

tough abyss
#

thx for your help

little raptor
#

Here

#

Just make it into a function (minus the onEachFrame part)

#

And return _p1

slate swift
#

Hi all, been several years since I've played with ArmA and going to start messing around with creating a mod. Can someone please confirm that each client that connects should also execute server sided code? E:G: looking at Altis Life framework it has an initServer.sqf which then runs the server sided init

#

Also hoping someone is able to advise the best development env? Is stopping/starting a server the best way or do most people just do most on the editor?

digital wasp
#

hey guys, how do i remove players from the squad (i need a trigger that removes all the ai from my squad when i enter it)

copper raven
digital wasp
#

so all players will leave their squads?

copper raven
#

this will create a new group and the player will join it, which is pretty much the same to what you wanted

digital wasp
#

hmmm okay thanks

copper raven
slate swift
#

I see. So on the mission file, the initServer will only execute once (E:G: the first player to login)?

digital wasp
#
count (allPlayers select {alive _x && _x in heli_1}) isEqualTo count allPlayers
``` is this the correct way to check if all players are in the heli?
copper raven
slate swift
#

Ahh, perfect. OK. Thank you kind sir.

#

Let my modding experience begin πŸ™‚

digital wasp
#

so ```sqf
call{allPlayers findIf {!(_x in heli_1)} < 0}

copper raven
#

yes

#

the call is redundant though

digital wasp
#

im not a native english speaker, what does redundant mean?

#

not necessary?

copper raven
#

it does nothing

digital wasp
#

oh okay

#

so if i were to check if all players are in the heli and if all tasks are completed, i'd have this as a trigger condition?

allPlayers findIf {!(_x in heli_1)} < 0 && tskall == 1;
copper raven
#

looks ok yeah

digital wasp
#

ok thanks

copper raven
#

apart from tskall == 1, are you just setting the value to 0 or 1?

digital wasp
#

i have a trigger that sets tskall = 1 if all 3 tasks are completed

copper raven
#

yeah so you should use booleans, true or false

digital wasp
#

hmm okay

copper raven
#

at which point you can remove the == 1

digital wasp
#

and just use tskall?

copper raven
#

yes

digital wasp
#

and it will fire if tskall == true?

copper raven
#

yes, but no need to do that(the comparison)

digital wasp
#

interesting, i'll take a look into it

copper raven
#

this would be best way: tskall && { ... findIf ...} as your condition

digital wasp
#

so for tasks instead of tsk1 = 1; i use tsk1 = True;?

copper raven
digital wasp
# copper raven yes

and in trigger condition that checks for all tasks and sets tskall to true, i should use tsk1 && tsk2 && tsk3?

#

if they're all true

copper raven
#

yeah

digital wasp
#

okay, great, thanks

tulip ridge
digital wasp
#

maybe [allPlayers] joinSilent grpNull?

copper raven
#

no

digital wasp
#

can i make an empty squad for my players to join then?

copper raven
#

allPlayers joinSilent grpNull should be like this

digital wasp
#

so if i do this, all players join into a new group/squad?

copper raven
#

yes

digital wasp
#

into the same group

copper raven
#

yes

digital wasp
#

okay thanks

#

and how do i make somebody a group leader?

copper raven
digital wasp
#

so if my player's variable is p1 then:

group player selectLeader p1;
copper raven
#

you have to execute it where the group is local

#

[group player, p1] remoteExec ["selectLeader", group player];

digital wasp
#

so my trigger on activation field will look like this?

allPlayers joinSilent grpNull; [group player, p1] remoteExec ["selectLeader", group player];
copper raven
#

grpNul should be grpNull

#

also you should either add isServer check, or make trigger server only

#

because you will run that code on all machines otherwise

digital wasp
digital wasp
#

cheers, thank you

copper raven
#

but then, group player is wrong

#

just create the group then, and pass it to all the commands

#

private _group = createGroup <your side>; and use _group everywhere

digital wasp
#

<your side> is like WEST or EAST?

copper raven
#

yes

digital wasp
#

so if i were to create a blufor team it would be private _grp1 = createGroup WEST and then use _grp1?

copper raven
#

without the <>

#

and yes

digital wasp
#

i changed it to _grp1 since i may add other groups

digital wasp
digital wasp
copper raven
#

no, in the trigger activation

copper raven
digital wasp
#
private _grp1 = createGroup WEST; allPlayers joinSilent _grp1; [_grp1, p1] remoteExec ["selectLeader", _grp1];
copper raven
#

yes

digital wasp
#

thanks

copper raven
#

is p1 a player?

#

if it's not, then you have to also join it to the group before calling selectLeader

digital wasp
#

it's a player

#

i have 8 playable ai slots, the first one is original group leader which is always a player and therefore set to p1

#

so after players join new group, the leader stays the same

#
[]spawn {
[0,0,false] spawn BIS_fnc_cinemaBorder;
private _grp1 = createGroup WEST; allPlayers joinSilent _grp1; [_grp1, p1] remoteExec ["selectLeader", _grp1];
[   
  ["HQ","HQ to Beta 3-4.",0],  
  ["Pilot","Beta 3-4 to HQ.",1],  
  ["HQ","We need a helicopter transport, on Delta 1-1's position, how copy? Over",4],   
  ["Pilot","Affirmative, on my way now.",8]
] spawn BIS_fnc_EXP_camp_playSubtitles;
uiSleep 8;
[1,1,false] spawn BIS_fnc_cinemaBorder;
};
``` did i implement it correctly?
copper raven
#

no that's wrong, the code has to be ran server side only

#

well the part you sent earlier

digital wasp
#

it is server side, trigger is server only

copper raven
#

yeah but then your code makes no sense

digital wasp
#

why?

copper raven
#

because cinemaBorder and the subtitle functions are ran locally

#

thus only the server would see them(if it's a dedi it won't anyway)

digital wasp
#

oooooooooooh that makes sense yeah

#

so i did see cinema borders because i was the server

#

okay, thank you

slate swift
#

Me again -- is there a standard for database interactions? Otherwise, I think I might have to take EXTDB3 and Altis Life framework inspiration πŸ˜„

copper raven
#

extDB is more commonly used though

slate swift
#

Alright... thanks sharp. We don't deserve you ❀️

digital wasp
copper raven
#

and make trigger global again

digital wasp
#
if isServer then { private _grp1 = createGroup WEST; allPlayers joinSilent _grp1; [_grp1, p1] remoteExec ["selectLeader", _grp1]; }; []spawn {
[0,0,false] spawn BIS_fnc_cinemaBorder;
[   
  ["HQ","HQ to Beta 3-4.",0],  
  ["Pilot","Beta 3-4 to HQ.",1],  
  ["HQ","We need a helicopter transport, on Delta 1-1's position, how copy? Over",4],   
  ["Pilot","Affirmative, on my way now.",8]
] spawn BIS_fnc_EXP_camp_playSubtitles;
uiSleep 8;
[1,1,false] spawn BIS_fnc_cinemaBorder;
};```
copper raven
#

looks ok now

digital wasp
copper raven
digital wasp
#

okay

#

thank you

#

one day i'll learn how to code properly

floral beacon
#

Has anyone else confirmed that the Ace3 framework wiki is down for them as well?

solid ocean
#

question for you im having problems where the driver of a vehicle keeps getting out of the vehicle and unwanted

#

is there any scripts that would force him to stay in the drivers seat

#

?

granite sky
#

Depends why he's leaving. With vanilla AI, a lone driver won't get out of a driver seat even if he's in combat mode, with no orders, and you literally shoot him in the face.

#

If he's part of a larger squad then he probably will get out. If the vehicle loses wheels or engine then he'll bail unless you set allowCrewInImmobile.

finite imp
#

heyo, i have a question regarding stealth in arma. Could there be a possibility of creating a script that simulates stealth in Arma? For example an EH or something that checks in a trigger if a player has weapons drawn for example, if yes and opfor detects the player they switch sides from maybe civilian to bluefor or any other combination. Would this be feasible? is there something laying around maybe already? Maybe a way to simulate this easier?

solid ocean
#

i would normally use transport unload

#

but thats not working only getout gets the other squad mates out

#

so to summarise he needs to stay in but his squad mates need to disembark

granite sky
#

Is splitting the group an option? Because that's by far the easiest.

solid ocean
#

wait one ill test

granite sky
#

@finite imp Usually it's done with setCaptive rather than group-switching. But yeah.

#

You will typically find that you need a lot of event handlers, plus some polling.

finite imp
#

the simplest thing i can think of right now

solid ocean
granite sky
#

If you're gonna set them un-captive when spotted then I don't see the point of setting them undercover in the first place.

#

Generally undercover systems are to stop enemies shooting at players even when they're spotted.

finite imp
granite sky
#

yeah that's reasonable.

finite imp
#

Or, maybe if the AI sees a player with a weapon that is not holstered or like with a weapon equipped. But I wouldnt know a way to check for that

granite sky
#

you can check their weapon slots in an InventoryClosed EH.

#

The spotting part is expensive to do properly though. There are no EHs for units gaining or losing vision on a unit.

#

Probably best to drop all protection when a unit has a weapon drawn, or maybe use camoflage coefficients if you want more of a range.

tough abyss
#

using the create vechile command can you make a VLS cruise missile visually? ive seen people do something similat just trying to make an controllable vls missile and know what other scripts im going to use if so what is its name like in terms to make it for example I_Mortar_01_F for a mortar etc

gloomy aspen
#

Hey guys, could somebody point out what I've done wrong here?

__Intention : __
Players enter trigger,** screen fades to black for 7 seconds**, title shows with text, mission ends

What's currently happening :
Players enter trigger, no fade, title shows with text, mission ends

Script:

cuttext ["", "BLACK OUT", 7]; 
sleep 5; 
titleText ["<t color='#ffffff' size='1'>7 TROOP, 22 SAS - UKSF REALISM UNIT<br/>____________________</t><br/><t color='#ffffff' size='5'>OPERATION BOREAS</t>", "BLACK FADED", -1, true, true]; 
sleep 10;
'end1' call bis_fnc_endMission;
tough abyss
#

try that

tribal onyx
#

What's the easiest way, to concatenate an array, into a string, while changing the connectors? Let's say I've got

_terms = ["bla","blo"];
_result = _search apply {format ["This is %1",_x]}; //["This is bla","This is blo"]

And I want the result to be "This is bla && This is blo"?

little raptor
copper raven
tough abyss
#

thx will look there im just a dumbass and looked in cfg weapons

copper raven
tough abyss
copper raven
#

configfile>>cfgammo

#

use the ingame config viewer

#

you can also just do:
vehicle player addEventHandler ["Fired", {copyToClipboard configName configOf (_this select 6)}]

#

and it will copy the classname for you after you shoot the weapon

tough abyss
#

thx

tribal onyx
#

I've got an array of units, and I wanna find the first of a given class in that array, but I can't for the life of me find the command to compare a unit's classname with a string.
I swear I used to know how to do this, but I can't find the exact command I need and I'm going insane.
Edit: Yup, I was going insane, it's typeOf, which I swear I scanned the list of commands and didn't see.

tough abyss
copper raven
#

well then add the event handler to it

#

use cursorObject or something

tough abyss
#

k thx

keen folio
#

can anyone help me with the set object to scale script im abit new to arma scripting within eden and i honestly dont know where to start

tough abyss
#

ok so you first need to either attach the object or disable sim or maybe make it a simple object then just use the basic syntax anything with a decimal in it is smaller you cant go into negatives (as that would reverse an object that just wouldnt work) it is pretty basic if you have other details lmk

#

btw to anyone seeing now im helping via dms

royal crow
#

can someone correct me a list of assets for warlords? I don't know why but it doesn't work

abstract girder
#

is there a way to disable the ability of setVariable to broadcast a variable globally or at least to the server? i'm storing data on my server that i wouldn't want tampered with by a malicious actor.

still forum
#

store in a non-networked namespace

#

profileNamespace, or uiNamespace, or... there are others forgot the names, the new stuff
People cannot pubVar to a namespace thats not network synced

abstract girder
#

ah okay, thanks

distant egret
#

Is it possible to figure out if a object is local to the client? Not if the current client is the owner (I guess he still would be though...).
But if the object is only spawned locally for that player, like fish, snakes, rabbits that spawn randomly (agents).

winter rose
distant egret
#

They seem to have a owner of 0, while player is 2 (local MP session). But that won't work in SP I believe.
Also netId returns nothing... I guess I'll create a ticket.

hallow mortar
#

Well, it doesn't really matter if it doesn't work in SP, because in SP everything is only local to the current client :P

distant egret
#

True.... And what I'm doing won't be used in SP anyway...
But it doesn't feel clean to do it like that.

#

Oh, their netId is "0:0". That might be more reliable.

near ibex
#

what do i have to write into the init line of a group to affect all members? 'this' doesn't seem to work

#

trying to make all members 'doStop' btw

hallow mortar
#

{ <code> } forEach (units this), with the magic variable _x representing the current unit the forEach is working on

#

beware of locality when using init fields as they are executed on all clients

near ibex
#

so "doStop forEach" and then? (I'm really bad at scripting

#

units this didn't work

#

oh, I got it to work. I wrote "doStop (units this);"

hallow mortar
fair drum
#

oh wow it does

near ibex
#

thanks!

fair drum
#

but if I recall correctly, doing doStop on a group without filtering out the leader can cause some wonky behavior

cosmic lichen
#

doStop can break a few things. Be careful with it.

fair drum
#

I remember it one time making all units belong to a 'object' side. ai ceased to function and its side was unknown

near ibex
#

I'm keeping an eye on it. Currently only using it on machine gunners in a bunker

hallow mortar
#

doStop can make units appear to be "empty" in Zeus but they do behave normally (aside from being stopped)

near ibex
#

how can I stop the AI from abandoning good static weapons mid combat to wander around? setUnloadInCombat doesn't do the job

hallow mortar
#

Try locking them

near ibex
#

oh good idea

#

wait isn't that ignored when already inside a vehicle?

hallow mortar
#

A vehicle being locked is supposed to remove the option to dismount as well as the option to mount. It's possible the AI will be able to ignore it because Arma, but it's worth trying

near ibex
#

nope they still unload

granite sky
#

@abstract girder localNamespace is probably the one Dedmen was trying to remember :P

winter rose
quasi shale
#

Hey guys. I'm working on a blackhawk down type mission.

Starts at the airbase with AI squads set to hold for the briefing. They all mount up on radio alpha. It looks cool. Then radio bravo is take off. Check they fly in. I set altitude to 25meters check. They arrive at their fast rope positions then just site there... anyone have any ideas how to get the advanced rappel to work?

solid ocean
#

so im making little guerilla type units that have a light and fast vehicle a bike and a passenger, what i want them to do is drive circles around the enemy and the passenger shoots them a harrasment hit and run style sort of thing

#

what would be the best way to achieve this?

hallow mortar
#

You might be overestimating how much fine control you can have over Arma AI. This sort of behaviour could be possible, but it might need some in-depth work from #arma3_ai, and of course you will also need a bike that actually has an FFV passenger seat (most don't).

fair drum
thorny swift
#

Can someone help me whitelist a function?

#

I am getting this when trying to use a third party mod to spawn in zombies.

#

0:23:58 Scripting function 'rvg_fnc_zed_spawn' is not allowed to be remotely executed

winter rose
dusk gust
thorny swift
#

Thank you guys

#

Fixed it

drifting portal
#

Is it possible to get the position of the cockpit of any vehicle?

#

By cockpit I mean for example HEMET driving cockpit

#

Not like the position where the driver sets

#

But the environment used for rendering the cockpit in 1st person

drifting portal
dusk gust
pulsar bluff
#

any way to make AI stay in the vehicle even when it is flipped

#

?

dusk gust
keen folio
#

Are there commands to output certain parts of AI behaviour and thinking?
Ex. Seeing what position an AI wants to move to when in Combat mode, or the created orders during a Seek and Destroy waypoint
Really interested in wanting to see how the AI works on a deeper level, especially since it managed to outmaneuver me

little raptor
keen folio
#

Thank you!

#

Does PathCalculated work live, or does it only work for fake/commanded calculatePath calls?

keen folio
#

Cool!

keen folio
#

Yeah I suppose any resources into learning how the vanilla AI works / calculates situations / commands would help my curiosity a lot.

crude stream
#

Anyone know of a script that would add an item added to a container inventory to an ACE arsenal on the same object?

little raptor
winter rose
still forum
#

:poutcat:

warm hedge
#

It feels I'm watching me

distant egret
noble zealot
#

I can't remember, but i believe yes, since they are no-network objects also.

distant egret
#

Yeah that's what I'm thinking as well, just didn't test it.

drifting portal
#

is it possible to place objects inside vehicle cockpits without them being outside it when you are sitting in the vehicle?

acoustic abyss
drifting portal
#

let me add photos to clarify

drifting portal
#

so here I placed a jerry can for example inside the taru pod, it is attached to the object

#

from outside it looks normal, inside the pod (i made it float for presentation)

#

BUT when I take a seat in the taru, the jerry can is rendered enlarged + outside the cockpit

#

how can I make it render in the same proportions (as outside the cockpit) inside the cockpit ?

#

I understand that this happens because the cockpit of vehicles are rendered separately in another location and overlayed on current view, but is it possible to get the position of where the cockpit is rendered? so I can place the object in that position and have it appear normally in the cockpit?

steel fox
drifting portal
#

so if I'm able to grab the vehicle cargo geometry location and put an object in the position wouldn't it render inside the cockpit?

winter rose
#

no

steel fox
#

if that is how RV did cargo geometry everything would be PIP. Imagine the performance....

proven silo
#

i was wondering if anyone could help me get my custom flag working online. I am using this setflagtexture "flag.jpg"; it works fine in the editor, but online I see the flag for a few seconds and it disappears.

distant oyster
winter rose
#

you saw nothing πŸ˜›

distant oyster
#

god damnit lou i was writing a novel here

winter rose
#

huehuehue

#

I don't know why, but I was persuaded there was something like setFlagTextureGlobal
I may have mistaken it with forceFlagTexture in some (weird) way

proven silo
#

Going to try it right now, yeah ive tried a few things and its really weird because I see it then it just goes away like only the flag pole

distant oyster
#

thought so too first

distant oyster
proven silo
#

that made it spawn without a flag at all

distant oyster
#

uuh okay maybe

if (local this) then {this setFlagTexture "flag.jpg";};
proven silo
#

okay

#

also what how do i post in the sqf format again whats the command for it

distant oyster
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
proven silo
#
if (isServer) then {
  this setFlagTexture "\A3\Data_F\Flags\flag_green_CO.paa";
};```
#

i tried that to make sure it wasnt my flag that was the problem and it was still empty going to try that other command now

winter rose
#

```sqf <line return>

proven silo
#

Ya that code didn't make it show up on the server it worked on the editor though, by the way this is on a dedicated server if that matters.

near ibex
winter rose
#

rather, mods make it difficult to know where the issue is, etc

proven silo
#
this setflagtexture "flag.jpg";
#

that works in the editor, and on multiplayer for a brief moment then the flag dissapears complety. I tried ```sqf
if (local this) then {this setFlagTexture "flag.jpg";};

winter rose
#

oh, try getMissionPath perhaps?

proven silo
#

how do I do that I am a noob lol

#

hmm i just noticed something

#

running the mission from arma it works fine but the problem only happens on my dedicated serve

proven silo
#

so annoying

#

i see it for a few seconds on the multiplayer server and it vanishes on the dedicated server

finite bone
#

I'm trying to execute an SQF whenever I place a module in the terrain from my custom addon. This is my first few lines for init:

params ["_logic"];
_marker = createMarker ["mymarker", getposatl "_logic"];
null = ["mymarker"] execVM "\MyTestMod\scripts\create_entity.sqf";
sleep 3;
deleteMarker "mymarker";

When I try to execute the module in Zeus menu, I do not receive an error. However, upon closer analysis in the error and remote files, I get this error:
Bad conversion: array and more detailed as:

Error in expression <rker = createMarker ["mymarker", getposatl _logic]; 
null = ["mymarker>
Error position: <getposatl _logic]; 
null = ["mymarker>
Error getposatl: Type Array, expected Object
Error in expression <\MyTestMod\scripts\create_entity.sqf"; 
sleep 1; 
deleteMarker "mymarker">
Error position: <sleep 1; 
deleteMarker "mymarker">
Error Suspending not allowed in this context
Error in expression <_marker = createMarker ["mymarker", getposa>
Error position: <createMarker ["mymarker", getposa>
Error 0 elements provided, 3 expected
Info: Zeus interface queued deletion of Alpha 3-1 group with 0 units inside.
Info: Zeus interface deleted Alpha 3-1 group.

TL;DR - When executing this command _marker = createMarker ["mymarker", getposatl "_logic"]; , I get two erros,
One - Error getposatl: Type Array, expected Object
Two - Error position: <createMarker ["mymarker", getposa> and Error 0 elements provided, 3 expected

still forum
#

null =
don't do that, thats nonsense

#

getposatl "_logic" GetPosATL doesn't take a string, it takes an object

#

getPosATL _logic

#

but I don't see any need to do this, as wiki says you can just pass object as
createMarker ["mymarker", _logic];

finite bone
#

I apologize, I was trying with the quotes on to see if that works. I initially had _marker = createMarker ["mymarker", getposatl _logic];

#

The entity spawns as per line 3. but it spawns at [0,0,0] instead of the position from getposatl _logic

finite bone
hallow mortar
#

yes

finite bone
#

Ah cool thanks!

cursive hazel
#

Does anyone know a way to remove built in actions?
The action in question is the "Treat X" action when wounded.
I'm unable to find a reliable method for this.

winter rose
cursive hazel
#

How do you mean?
It has to work with all player inventories.

#

My current workaround is returning any FAK used and reverting the wounds to before the healing.
I tried also overwriting the healing animation but that lead to all actions for everything disappearing permanently afterwards.

cursive hazel
#

Damn it.

#

Well that's out of the question.

#

If a script is server side and uses CBA functions do all connecting players need CBA too?

hallow mortar
#

It depends. If the CBA functions are only executed on the server, then no, only the server needs CBA. If the script runs server-side but involves remoteExec'ing CBA functions to the clients, then the clients will need CBA.

*provided the CBA functions don't themselves remoteExec other CBA functions on the clients - hopefully the CBA documentation, or inspecting the functions in Function Viewer, can answer that

finite bone
hallow mortar
#

You can use diag_log to write arbitrary things to the RPT

#

or systemChat if you want to do it live

bleak thicket
#

Guys tell me how to make sure that after recording with the help of unit capture, the bot does not shoot directly, because during the recording I shot in different directions in the ver, down the building. And after I activate the recording, the bot repeats all the movements except shooting at the top and down purely straight.
I'm already tormented with this question.

winter rose
#

the firing capture I believe does not take in consideration the turret aiming - this function does not copy 1:1 all the captured behaviour

bleak thicket
#

And there is such a script ready to be tested.

finite bone
#
params ["_logic"];
_marker = createMarker ["mymarker", _logic];
``` I'm trying to create a incrementing marker variable (for example, mymarker_1, mymarker_2, etc) that is created whenever the module above is executed. There are no examples for the ``BIS_fnc_counter`` in the wiki that I can refer. Ideally I want the markername take unique values and globally available for other scripts to execute.
A rough version of what I've come down with is:
```sqf
params ["_logic"];
my_markerNumber = 1;
final_marker = "mymarker" + my_markerNumber;
_marker = createMarker [final_marker, _logic];
[final_marker] execVM "\MyTestMod\scripts\create_entity.sqf";
my_markerNumber = my_markerNumber + 1;

I fear I'm doing something wrong here but don't know what exactly it is.

winter rose
#
if (isNil "PEPE_markerIndex") then { PEPE_markerIndex = 0 };
private _markerName = format ["theMarkerName_%1", PEPE_markerIndex];
PEPE_markerIndex = PEPE_markerIndex + 1;
```etc πŸ™‚
otherwise you always reset it to 1
finite bone
#

ah so thats what messing up the counter

#

Thanks again!

fair drum
#

there is a modified unit capture script that someone made, but it still isn't going to give you what you want

bleak thicket
#

I see, it's sad thanks for informing me

open fractal
#

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

Use with caution as this technique is not very clean - it should not be used for many objects and definitely not in MP games.

//initServer.sqf
private _simples = [] spawn {
    {
        [_x] call BIS_fnc_replaceWithSimpleObject
    } forEach ((getMissionLayerEntities "Simple Objects") select 0);
};
waitUntil {scriptDone _simples};
sleep 10;
[intro_heli] spawn art_fnc_opening_server;
``` I have this in initServer.sqf, but I don't quite understand why I should *definitely not* use in MP. I understand that deleting and replacing a bunch of objects can saturate the network, but what is the detriment if I give the server time to do it before anything else (and before players have loaded in)? Does the function behave differently in MP?
#

would issues be mitigated if I spawn the function instead?

#

and last question, is there a better workflow for placing simple objects using eden editor that don't have a Simple Object checkbox in the properties?

finite bone
#

My script/module works fine in the initial stage. However, after sometime, if I invoke the script/module again, it throws the BIS_functions_mainscope error. Googling the issue had a fix for manually setting creator logic and side or use CBA (which I already do).
Edit: No matter what module/script I use, I see this error.

bleak thicket
quasi rover
fair drum
#

but imo, I'd just hit him with lightning

#

and call it a day

quasi rover
#

haha... but I can't watch players all day to punish them with lightning. give me any more detail, plz. @fair drum

open fractal
#

i'd just hit em with the ban

proven silo
#

Can anyone help me with this problem. I have a custom flag using ```sqf
this setFlagTexture

dusk gust
steel fox
steel fox
dusk gust
#

That is true

proven silo
#

I never had any errors pop up on the screen, I tried it with the base arma flag and it did the same thing it shows the flag and then dissapears. Its werid because it works fine if i host it thru arma thru the .pbo but on a dedi it seems to have issues. Solution I was not running the mission through the .pbo but through the folder and that was causing some bugs. Problem fixed appreciate the help πŸ™‚

steel fox
#

Any server side mods/scripts not on your client?

proven silo
#

I dont think so, its just a mission i made in editor no addons or anything

crude vigil
steel fox
#

Then the flag pole is local to the server, gotta execute the command on there.

proven silo
#

How can I fix that im new to arma misssions and scripting. I have that code in the init on the flag in the mission

crude vigil
#

where do you execute this code?

#

where is it written?

proven silo
#

in the mission file its in the flag pole init in the editor.

steel fox
open fractal
#

you were quick

crude vigil
proven silo
#

someone reccomended that last night, and I tried it, but that made the flag not spawn at all. Let me try it again. I put this in the flag pole init in mission correct?

steel fox
proven silo
#

yes in the root folder called flag.jpg

crude vigil
#

Although if it shows it , I doubt thats a problem.

proven silo
#

ya it shows

steel fox
#

Might be on the server. Try to convert to paa to be sure.

#

if it can accept paa, use paa.

proven silo
#

i used a different .paa also

#

and it showed and did the same thing

#

thats the flag on local server

#

let me try that code and put it on my dedi real quick

open fractal
#

are you sure there isn't a mod interfering

proven silo
#

oh

steel fox
#

Uhm, is this a capture the flag mission or something?

proven silo
#

and i also wanted to say

steel fox
#

Looking at the score board

proven silo
#

when i go to the screen to choose a character

#

and spawn in i can see the flag and it goes away

#

and im using these mods actually

#

its a TDM mission, but i was just trying to learn custom flags cause i thought it was neat.

#

okay i got ```sqf
if (isServer) then {
this setFlagTexture "flag.jpg";
};

#

okay with that flag poles are empty, doesn't even show the flag at the start im going to try a default flag

#

going to use this texture too see if its a texture problem "\A3\Data_F\Flags\flag_green_CO.paa"

steel fox
#

To save yourself some issues, enable the debugconsole for admins in de description.ext and give the flag poles a variable name. Then you can test without having to reload the mission everytime.

proven silo
#
if (isServer) then { 
    this setFlagTexture "\A3\Data_F\Flags\flag_green_CO.paa"; 
};
#

okay

#

wow that works perfect

#

i see the green flag and its not dissapearing so i guess its a problem with the flag.jpg?

crude vigil
#

convert it to .paa to play safe.

proven silo
#

so my problem with is, it says flags are suppose to be 200x200 and i cant covert that resolution to a .paa

crude vigil
#

For Arma 3 it says 512x256

#

200x200 prior to arma 3

proven silo
#

does anyone have a flag.paa i could use and test it?

steel fox
#

yeah sure. give a sec

proven silo
#

awesome thank you

steel fox
#

Sorry for that but thats easier then trying to explain github rn.

proven silo
#

all good no worries

#

going to test it rn just put it on dedi

steel fox
proven silo
#

@steel fox i just tried that flag, and same result no flag just the poles

steel fox
proven silo
#

okay ill try that

steel fox
#

And how are you putting the flag into the mission folder? Are you putting a PBO on the server?

proven silo
#

@steel fox i just put the .paa in the root of the mission folder

steel fox
#

Alright and how is that mission going to the dedicated server?

proven silo
#

going to test a fresh mission making it right now on the dedi no mods

#

oh

#

So i make the mission in the editor and it saves to my documents folder as the mission folder and i copied that mission folder to my dedicated not the pbo

#

the folder and mission name look like 'DonJulio_Kavala_CQC_V1%2e7.Altis"

steel fox
#

Export to multiplayer and use the PBO. It gets exported to your arma 3 install folder > MPMissions

proven silo
#

also just made a fresh mission on the dedicated and same problem Solution I was not running the mission through the .pbo but through the folder and that was causing some bugs. Problem fixed appreciate the help πŸ™‚

#

can a dedicated server run the mission from just the .pbo

steel fox
#

Let's move this to DM

proven silo
#

Okay np

#

thanks again for all the help man I really do appreciate it

fair drum
fair drum
#

just gather position and direction and model and you're good.

open fractal
#

I think I have that already done for another mission now that I think of it

#

what's the command to get the center of an object again?

#

modelToWorldWorld right?

fair drum
#

i take that back

#

getPosWorld

open fractal
#
private _obj = _this;
private _path = (getModelInfo _obj) # 1;
private _vector = [vectorDir _obj, vectorUp _obj];

_simpleObject = createSimpleObject [_path, getPosWorld _obj];
_simpleObject setVectorDirAndUp _vector;
#

isn't this all I need if it's just static objects?

fair drum
#

I typically use getDir and BIS_fnc_getPitchBank and BIS_fnc_setPitchBank

#

but you are also gonna want to delete your first object too after you make the simpel one

open fractal
#

lmao good call forgot that part

proven silo
#

Question I am using this in my initplayerlocal.sqf ```sqf
player addEventHandler ["Respawn",{

params ["_newObject","_oldObject"];
deleteVehicle _oldObject;
_newUnit = _this select 0; // Get the respawned unit
private _spawn_pos = selectRandom["random_start_1", "random_start_2", "random_start_3", "random_start_4", "random_start_6", "random_start_7", "random_start_8", "random_start_9", "random_start_10", "random_start_11", "random_start_12", "random_start_13", "random_start_14", "random_start_15"]; // Get a respawn position at random
_newUnit setPos (getMarkerPos _spawn_pos); // "Teleport" the unit

}];
it is working fine, but how can I make it so the the independent team has different spawns. I triedsqf
if (side player == guerrila) then {

fair drum
#
if (side group player isEqualTo resistance) then {}
#
switch side group player do {
    case west: {};
    case east: {};
    case resistance {};
    default {};
};