#arma3_scripting

1 messages ยท Page 200 of 1

granite sky
#

You didn't specify how/where you're running this code or what's in moveforward.sqf, so I can't tell you what's correct for this particular line.

open marsh
#

Any1 know why HC group disappears, no more under subordination, when made to enter vehicle

thin fox
#

maybe creating a GUI on start so player can select such parameters

#

and then "load the mission" after it

cosmic lichen
#

There is a new parameter now to disable vanilla parameter handling which makes it super easy without weird workarounds.

cosmic lichen
#

It's supposed to be. But I haven't gotten beyond the "This is WIP" part yet๐Ÿคฃ

#

It's on my list so maybe I find some time tomorrow.

thin fox
#

neat

proven charm
remote cobalt
#

Hey folks,

maybe you can help me understand.

I have this line in a Script:

_bomb = createVehicle ['SatchelCharge_F',getPos _thisTrigger,[],0,'CAN_COLLIDE'];

But everytime when I start it I get the error in the picture.

I probably have just some Error in the call for createVehicle but I can't see it for the love of god. Can anybody help me?

proven charm
#

getpos _thisTrigger seems to return empty array. maybe _thisTrigger is not defined?

still forum
#

did you mean "thisTrigger" instead?

remote cobalt
still forum
#

I tihnk some syntax error, but I tried opening wiki and the cloudflare bullshit just keeps reloading and retrying and isn't working, so can't help you

remote cobalt
#

From Wiki:

_veh = createVehicle ["ah1w", position player, [], 0, "FLY"];
#

createVehicle [type, position, markers, placement, special]

cosmic lichen
#

Isn't that the wrong class name?

granite sky
remote cobalt
granite sky
#

Sounds like a recompilation issue.

still forum
#

Make sure to drink enough water

granite sky
#

If the error's not in the log then you're looking at the wrong log. If you're getting that error with that code then you're not running the code that you think that you're running.

cosmic lichen
#

Be aware that thisTrigger is not available in console

remote cobalt
#

So, thanks to all of you. Don't ask me why, but this works now:

_bomb = createVehicle ['DemoCharge_Remote_Ammo',getPos thisTrigger,[],0,'CAN_COLLIDE'];
#

So _thisTrigger was obviously wrong but it was also the wrong element to spawn.

dire island
#

anyone know how to get an AI unit to switch to launcher? From what I can find on BIKI, either of the following should work, but they don't:
_unit selectWeapon (secondaryWeapon _unit); or _unit selectWeapon "rhs_weap_rpg7";

stable dune
#

Force it, remove all other weapons and leave rpg.
Ai don't want to use rpg ๐Ÿ˜ƒ

fair drum
hallow mortar
fair drum
#

don't know, just putting it out there

formal violet
#

Hello everyone. I've been working on a mission file for a group of mine and I am struggling to connect the powerlines to the poles via scripting. I've done some digging on the forums and scripts, but haven't been able to piece anything together. Is there a way to connect them together without using objects as reference points for the cable ends?

tough abyss
#

How can I set an NPC's faceware to a blindfold?

[] spawn {
    _captiveUnit = (createGroup [east,true]) createUnit ["C_Man_French_universal_F", [0,0,0], [], 0, "CAN_COLLIDE"];   
    _captiveUnit linkItem "G_Blindfold_01_white_F"; 
};

I also tried doing addItem then assignItem but nothing happens either. I also cant seem to remove faceware like glasses that sometimes randomly appear on NPC spawn using removeAllAssignedItems _captiveUnit;, removeAllItems _captiveUnit;, etc.

hint str assignedItems player; with my player character wearing the blindfold also does not show the blindfold as an item I am wearing

#

nvm im actually dumb as shit it was addGoggles well apparently _captiveUnit addGoggles "G_Blindfold_01_white_F" doesnt work either but hint goggles player; does print the blindfold out

fair drum
#

try removing whatever goggles are on the unit first, then adding the blindfold via addGoggles

_captiveUnit removeGoggles (goggles _captiveUnit);
_captiveUnit addGoggles "G_Blindfold_01_white_F";
tough abyss
#

@fair drum This is the actual code I am trying to run that isnt working:

private _captiveGroup = createGroup [east,true];
_captiveUnit = _captiveGroup createUnit ["C_Man_French_universal_F", _containerPosition vectorAdd _objectPosition, [], 0, "CAN_COLLIDE"];

                removeAllWeapons _captiveUnit;
                removeAllItems _captiveUnit;
                removeAllAssignedItems _captiveUnit;
                removeUniform _captiveUnit;
                removeVest _captiveUnit;
                removeBackpack _captiveUnit;
                removeHeadgear _captiveUnit;
                removeGoggles _captiveUnit;
                removeAllContainers _captiveUnit;
                _captiveUnit addGoggles "G_Blindfold_01_white_F";
fair drum
#

there is nothing sticking out that is wrong with this snippet. however, in your spawn block above, you are losing reference to _captiveUnit if you don't pass it to the spawn scope

#
[_captiveUnit] spawn {
    params ["_captiveUnit"];

    // _captiveUnit is now in this scope
};
tough abyss
#

ok, that shouldnt be an issue for the actuaal full script I just wrote that to simplify, all my code is actually in the spawn block in a sense

#

once the unit is configured i dont need the reference anymore anywyas

#

id just pust the whole script but its way too long for discord

fair drum
#

also instead of all those commands to strip naked, consider

_unit setUnitLoadout (configFile >> "EmptyLoadout");
#

put your whole script into pastebin, then post. easiest way.

tough abyss
fair drum
#

is this code you are executing in a zeus composition?

tough abyss
#

thats the idea but for testing I just run it from debug in SP zeus

#

it needs ezm loaded first

#

aafter running this is what the dudes look like

granite sky
#

Seems to be a timing issue in the engine.

#

Works fine scheduled:

private _captiveGroup = createGroup [east,true];
_captiveUnit = _captiveGroup createUnit ["C_Man_French_universal_F", getPosATL player, [], 0, "NONE"];
sleep 0.01;
_captiveUnit addGoggles (goggles player);
tough abyss
#

I can throw it in an isNil {}; if you think that might do it?

granite sky
#

Does not work unscheduled.

fair drum
#

yup its a timing thing. needs to be next frame after creation or a small sleep. just finished testing my own version

granite sky
#

Not sure if that's specific to goggles.

hallow mortar
#

Their facewear randomisation is probably happening after you do your thing and so overwriting it

granite sky
#

Ah yeah, that makes sense.

fair drum
#

I did mine with vanilla base classes as well

tough abyss
#

ok, well apparently i cant put a sleep here so ill figure it out thanks for the help, this gives me a way forward!

fair drum
#

sure you can, make a new spawn thread after creation since you are creating multiple at the same time

tough abyss
#

oh i just mean it didnt like sleep 0.1; right after it

#

is all

granite sky
#

yeah if you're unscheduled then you'll need to spawn the addGoggles at least.

#

Or exec next frame if you're into the CBA stuff.

tough abyss
#

im trying to keep this working on vanilla servers as much as possible EZM was just a simple way for me to get a GUI but ill probably write my own later

hallow mortar
tough abyss
#

rotation is messed up now but I can fix that after

#

thanks for all the help everyone, appreciate it

granite sky
#

You should get a better debug console btw :P

#

Try the "Advanced Developer Tools" mod.

tough abyss
#

probably but I dont know anyone who does any arma development im pretty much running off my day job being software and whatever i can scrape out of the wiki

#

i will chekc it out, thanks!

#

i have just been coding in intellij with some sqf plugin that is missing some of the syntax

#

i was using vscode but it decided to turn off autosave without telling me and i lost like 4 hours of work to it crashign with out of memory despite using like none of my ram. so fuck vsc

wooden grail
#

Hey @proven charm , thanks again for helping with me on this man. Quick question though, I'm trying to update the script to react to BOTH OPFOR and INDFOR and I can't seem to get it work. Can you please help me out if you're free?

#

The current code I've changed it to is this:

[] spawn
{

[FIAOfficer, "WATCH1", "ASIS"] call BIS_fnc_ambientAnim;

waituntil { sleep 0.1; ({ _x distance FIAOfficer < 5 } count (units opfor)) > 0 };

waituntil { sleep 0.1; ({ _x distance FIAOfficer < 5 } count (units independent)) > 0 };

detach FIAOfficer;

FIAOfficer call BIS_fnc_ambientAnim__terminate;

};

#

However the NPC only identifies the first waituntil line and not the second

proven charm
#

so you want to delete officer when enemies are near ?

#

ugh i mean detach

wooden grail
#

Yessir

#

Both OPFOR and INDFOR

proven charm
#

ok so you can combine the two lines: ```waituntil { sleep 0.1; ({ _x distance FIAOfficer < 5 } count (units opfor + units independent)) > 0 };

wooden grail
#

Thanks so much haha

#

Also, the whole ASIS line for ambient anim still doesn't work cause the script deletes primary weapons or backpacks depending on the anim

#

Any chance you know how I can fix that haha?

proven charm
#

umm no, i dont even know why it deletes gear

wooden grail
#

Yeah fair. Regardless, thanks for helping me out again!

warm hedge
#

Because BIS_fnc_ambientAnim is simply poorly written/implemented

proven charm
warm hedge
#

The function removes weapon whenever the animation is configured to do so, ASIS is not involved there

wooden grail
#

Ohhh, I'll take a look. Thanks guys

wooden grail
#

Assuming I change up the B_Soldier_F that is

proven charm
#

sorry i dont follow

wooden grail
#

I saw this

#

So does that mean I can extrapolate from my arsenal loadout list?

warm hedge
#

Syntax 3 and Syntax 4 is different

#

Or rather, you simply just do like:

private _loadout = getUnitLoadout _unit;
[FIAOfficer, "WATCH1", "ASIS"] call BIS_fnc_ambientAnim;
_unit setUnitLoadout _loadout;```
wooden grail
#

Oh okay, I'll give this a try now thanks @warm hedge

proven charm
warm hedge
#

Arsenal is not related with it

wooden grail
warm hedge
#

Then make some sleep between

wooden grail
#

Sleep?

warm hedge
#

Yes

split ruin
#

How to make a vehicle invisible when simulation is off ? ๐Ÿค”

wooden grail
#

Sorry I don't know what that is

warm hedge
#

hideObject

#

sleep is a command to sleep the code

wooden grail
#

Right gotcha, I'll give it a try. Thanks @warm hedge

drifting badge
#

Quick question: I have a trigger are that forces the AI to open fire as soon as a player steps into it, but I want to add a visibility check, so the AI will only shoot when they actually have a clear line of sight to the player (as it makes no sense when they fire if there is terrain or a wall or other objects between them and the player). Would a checkVisibilitycheck do the trick? So something like:

_canSee = [objNull, "VIEW"] checkVisibility [eyePos _groupleader, eyePos _enemy];
        if (_canSee > 0.7) then { ...
little raptor
#

yes. but add the _groupLeader as the ignore object

drifting badge
#

so switch out the "objNull" with "_groupleader" (which is the AIs group leader) and "_enemy" is any unit considered enemy (that steps into the area). Got it! Thank you :)

trail smelt
#

Hello, I would like to ask you, I found some older missions that used manual role assignment for ctab, does anyone know if it is still necessary to have such a script in missions or is it an unnecessary power hog?

//NATO
if (!(isNil "acoy_1")) then {if (acoy_1 == leader acoy_1) then {acoy_1 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_2")) then {if (acoy_2 == leader acoy_2) then {acoy_2 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_3")) then {if (acoy_3 == leader acoy_3) then {acoy_3 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_4")) then {if (acoy_4 == leader acoy_4) then {acoy_4 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_5")) then {if (acoy_5 == leader acoy_5) then {acoy_5 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_6")) then {if (acoy_6 == leader acoy_6) then {acoy_6 setGroupIdGlobal ["A-Coy"];};};

if (!(isNil "dingo_phq_1")) then {if (dingo_phq_1 == leader dingo_phq_1) then {dingo_phq_1 setGroupIdGlobal ["Dingo-PHQ"];};};
if (!(isNil "dingo_phq_2")) then {if (dingo_phq_2 == leader dingo_phq_2) then {dingo_phq_2 setGroupIdGlobal ["Dingo-PHQ"];};};
if (!(isNil "dingo_phq_3")) then {if (dingo_phq_3 == leader dingo_phq_3) then {dingo_phq_3 setGroupIdGlobal ["Dingo-PHQ"];};};
if (!(isNil "dingo_phq_4")) then {if (dingo_phq_4 == leader dingo_phq_4) then {dingo_phq_4 setGroupIdGlobal ["Dingo-PHQ"];};};
ornate whale
#

Do you guys know whether doWatch uses AGL or ATL? Thanks

tulip ridge
#

From what I remember, most AI related commands are AGL

ornate whale
#

Can anyone confirm that this will always return Z=0 over land, even if there is a surface above the position? The description is not clear, it says AGLS, and AGL right after that. Thanks

proven charm
#

(getposATL player) getpos [1, 0]; returns zero on land and negative z in water - just tested

ornate whale
amber junco
#

is there a script that could turn this death background into just a black screen?

drifting badge
#

Is it possible to "move" an attached object B (that has been attached to object A via "attachto") to a new attached to position (still attached to object A) and make that transition show up in steps with ```sqf
for ... from ... to ... step

Or is that not possible to do with an object that has been attached to another?
sturdy sage
drifting badge
#

oh nice, how would the code look for this (if you like to share), might be able to adjust it to what I am trying to do

sturdy sage
#

Discord doesn't let me post the message for some reason. Despite being under length limit. Says can't be send because we don't share server. But i was sending it in this channel wasn't even trying PM's ๐Ÿ˜•

#
{ 
        null = [_this] spawn {
            _this # 0 params ["_target", "_caller", "_actionId", "_arguments"];
            private _vehicle = _arguments select 1;
            private _parachuteClass = _arguments select 2;
            private _parachuteAttachPos = [0,-2.5,1];
            _arguments # 0 params ["_originalX","_originalY","_originalZ"];
            _vehicle allowDamage false;
            [_target,_actionId] remoteExec ["removeAction",0,true];
            private _parachute = createVehicle [_parachuteClass,[0,0,0]];
            _parachute allowDamage false;
            _parachute disableCollisionWith _target;
            _parachute attachTo [_target,[_parachuteAttachPos # 0,(_parachuteAttachPos # 1),_originalZ]];
            _parachute setVectorDirAndUp [[0,0,1], [0,-1,0]];
            sleep 2;
            
            for [{private _i = ceil _originalY}, {_i > -10}, {_i = _i - 0.1}] do {
                _parachute attachTo [_target,[_parachuteAttachPos # 0,(_parachuteAttachPos # 1) + _i,_originalZ]];
                _vehicle attachTo [_target,[_originalX,_i,_originalZ]];
                sleep 0.01;
            };
            _parachute attachTo [_vehicle,_parachuteAttachPos];
            _parachute setVectorDirAndUp [[0,0,1], [0,-1,0]];
            detach _vehicle;
            sleep 5;
            deleteVehicle _parachute;
            _vehicle allowDamage true;
        };
}, 
#

Ah that worked, i cut some stuff out. I guess the length counter way lying to me? ๐Ÿคท

#

I used the advanced for loop there, but you could just as easily do it with for from to step.

ornate whale
formal violet
# formal violet

myRope = ropeCreate [transformer_start, [0,0,7], 51, [" Land_HighVoltageColumnWire_F", [0,0,7]], [" Land_HighVoltageEnd_F", [0,0,7]], "Rope", -1];

Here's what I have so far from the wiki

hushed turtle
edgy dune
#

I am trying to have a drone spawn 10 meters above the ground, I thought having "FLY" for the special string would make it so it starts off hovering but it just falls upside_down

_spawnedDrone = createVehicle ["B_UAV_01_F",(position player),[],0,"FLY"];
_spawnedDrone engineOn true;

but the darter just spawns at its default height and falls down death
https://community.bistudio.com/wiki/createVehicle

spiral narwhal
#

probably b/c its a drone

edgy dune
spiral narwhal
#

hmm

#

so with fly it spawns in the air?

#

interesting then...

edgy dune
#

yeah ~50meters

spiral narwhal
#

brb booting up arma

#

my guess is that you'll need to setup the script to do the basic UAV connectivity things.

sly cape
hallow mortar
#

Yes, you need a dab of createVehicleCrew, otherwise there will be no pilot to maintain altitude

#

UAVs in Arma still require crew, it's just a special type of invisible unit that you remote-control

edgy dune
edgy dune
#

maybe I guess zeus was showing that there was a gunner but not a pilot lol

#

but yea that was the fix

#

create vic crew

#

ty ๐Ÿซก

fair drum
#

will DirectPlayID always return a string of numbers with getPlayerID? Is it safe to always parse to number?

gleaming rivet
#

But yes, it would be totally possible to create a rope, create a vehicle, attach the rope to said vehicle (which would be like the seat) and then attach it to the helicopter itself.

lunar lichen
#

this has got my brain going

gleaming rivet
#

As for "throwing" the rope, you could possibly use a very very scripted grenade's landing point to find the final location for it.

#

And then attach a rope you could "climb"

lunar lichen
#

might be able to get it through a fired EH

gleaming rivet
#

Probably.

granite sky
#

Isn't it too long?

#

It's not safe to parse any string of numbers longer than six digits to an SQF number.

lunar lichen
#

think i need to look about some EH's

#

prob the best way to do it

swift ferry
#

Would it be possible to do it through a ugl?

lunar lichen
#

ugl?

swift ferry
#

Create a special round

gleaming rivet
#

Could do something similar for the Ziplines and the UGL.

swift ferry
#

Underslung Grenade Launcher

gleaming rivet
#

However

lunar lichen
#

ah

gleaming rivet
#

The best thing to do would be to make a proof of concept first

#

before jumping straight to extra stuff

#

scope

fair drum
#

if that's the case, i'll just work with it in string form then

lunar lichen
#

yeh, i think the biggist issue would be the climb

#

just brainstorming atm

gleaming rivet
#

Unsure about a climbing animation.

#

You could possibly treat the rope as a ladder.

lunar lichen
#

not only that, ur climbing up a moving / phisics enabled object

gleaming rivet
#

It would look messy but work.

swift ferry
#

Could somehow lock the helicopter in place

lunar lichen
#

we are talking climbing up an object

swift ferry
#

Ohhh right

gleaming rivet
#

Anyhow, using an invisible ladder there would work, but if the surface was sloped it wouldn't exactly end well.

lunar lichen
#

ive have little play with the ropes, ive only made a slinky that de-synced my server lol

#

@gleaming rivet ladders + arma ??

#

u crazy? lol

gleaming rivet
#

๐Ÿ˜›

#

Have a test run with what Baermitumlaut's done with the fastroping for ace

lunar lichen
#

i have nightmares from A2 ladders still

swift ferry
#

I don't know enough to possibly even comment about that

lunar lichen
#

ladders + arma = bad things

swift ferry
#

They're not bugged though, it's a feature ๐Ÿ˜›

lunar lichen
#

#PopulationControll

swift ferry
#

Or that, natural selection at it's best

lunar lichen
#

people ask me to go up an ladder, ussual responce is ima jump of this cliff... more chance to survive

granite sky
#

Probably should have been seven digits, but I doubt the distinction is relevant here.

swift ferry
#

I remember going up a ladder in the Alpha, instantly died as I clipped through a rock and my dead body shot off into space ๐Ÿ˜„

lunar lichen
#

thats was the final of A2 was like

#

i think i would try to make this a script and not a mod

gleaming rivet
#

They work relatively okay in A3

lunar lichen
#

i still dont touch them lol

gleaming rivet
#

I haven't fallen off a ladder since... Alpha I think.

lunar lichen
#

ladder phobia

gleaming rivet
#

They're safe. Lol

lunar lichen
#

LIES

swift ferry
#

Those editor placed ones aren't!

lunar lichen
#

ROFL

gleaming rivet
#

Eh well, we stacked the Tactical Ladders in ACE 7 high before someone died.

#

๐Ÿ˜›

#

Safe!

lunar lichen
#

ur crazy

swift ferry
#

I wouldn't dare be on the same map as that

lunar lichen
#

IKR

swift ferry
#

I'd be climbing up nicely then get slingshotted into the ground

lunar lichen
#

fking lethal

#

need to make a mod that logs every ladder death and shows a webpage with a number of people who have died on ladders

swift ferry
#

Millions in a week!

lunar lichen
#

start a project at 3am?

swift ferry
#

Hell yeah!

#

I'm trying to config, not a good idea.

lunar lichen
#

urg....................

swift ferry
#

At least you have some clue of what you're doing! ๐Ÿ˜›

lunar lichen
#

urg

#

i wish

swift ferry
#

I'm using a config template and having trouble, so you'd obviously be much better

winter rose
magic dust
#

Is there a command to read items inside a backpack in the container?

For example, a ground weapon holder(or container) have a backpack, the backpack have some stuff in it, how to get the stuff?

lunar lichen
#

ok enough staring at my screen

#

think i know how to track a objects thrown location

proven charm
#

i dont think you can get backpack "contents" when its inside a box because the contents are not saved anywhere

#

I could be wrong but i think the backpack is just name in the box

winter rose
proven charm
#

but thats just if the backpack is on ground?

hallow mortar
#

Read the note at the bottom of the page

winter rose
#

like an invisible crate

proven charm
#

hmm

hallow mortar
#

@ Lou it might be good to change the "return value: array" to "return value: array of objects"

magic dust
#

So, if you wanna get all kinds of items in a box, you need to:

// the item box
_box = cursorObject;
_items = [];

// get all kinds of items in the box
_items pushBack itemCargo _box;
_items pushBack magazineCargo _box;
_items pushBack weaponCargo _box;
_items pushBack weaponsItems _box;
_items pushBack backpackCargo _box;

// get all kinds of items in the containers(uniform, vest, backpack) in the box
{
    _container = _x#1;
    _items pushBack itemCargo _container;
    _items pushBack magazineCargo _container;
    _items pushBack weaponCargo _container;
    _items pushBack weaponsItems _container;
    _items pushBack backpackCargo _container;
} forEach everyContainer _box;

// flatten the array, remove duplicates, remove empty string and number
_items = flatten _items;
_items = _items arrayIntersect _items;
_items = _items select {_x isEqualType "" && {_x != ""}};

_items

swift ferry
#

That's a good start!

lunar lichen
#

im "borrowing" a buds life server to test this on lol

#

why is their stones in this game -.-

#

of all things

swift ferry
#

Don't break it ๐Ÿ˜›

lunar lichen
#

i thought they came broken?

#

testing on a live server, โค

#

ROFL

swift ferry
#

If you ever need a server to test stuff on and you can't get that one. I have one that sits and does nothing for 6 days of the week

lunar lichen
#

thx for the offer, but i have a VPS just sat around

#
  • i like the life file system
#

poeple gunna hate me for saying that

frail skiff
#

Had a question about vehicleChat

I'm doing a mission with two helicopter pilots talking to each other. I'm trying to make the subtitles of the second pilot appear as vehicleChat (with the golden name). However, the subs only show for crew members of the second helo, and not for the pilot of the first one. Is it possible to make it so that this message is seen by everyone and not just the crew of the second helo?

I've tried this :

[BIS_helicopter2, "message"] remoteExec ["vehicleChat"];

but it didn't work, and I have a feeling that using remoteExec is not the way to go here

hallow mortar
#

vehicleChat uses the Vehicle channel, which is specific to the vehicle the transmitting unit is currently in. So by doing remoteExec, you're making sure the message is transmitted on every machine (good) but it's still only visible to units who actually have access to that instance of the Vehicle channel.

#

In other words, you need to use a different channel

swift ferry
#

Some things about Life servers are good, I'd love a taser for my ops ๐Ÿ˜„

frail skiff
#

So radioChannelCreate?

hallow mortar
#

You could create a custom channel and add only units that are in the helos to that channel. Or, you could use sideChat, and either make the messages visible to all units (easy) or use remoteExec to target only the machines whose player is in the helos.

lunar lichen
#

lol

frail skiff
#

I guess I'll try to figure my way out with custom channels, thanks for your help!

lunar lichen
#

OMG

#

ROFL

#

WTF

#

ARMA PLZ

#

i did a arma?

#

ROFL

#

omg, i cant breath

#

i somhow moved the building by attaching a rope to it

swift ferry
#

What the...

#

How on earth did you do that? ๐Ÿ˜ฎ

lunar lichen
#

dude i dno

#

i attached a veh to the building with a rope

#

ok, so ladders and ropes

raw acorn
#

having some issues, i know of a script that you can throw on (for example) the briefing room screen, and you can make it so you can choose the map location that it will show. any ideas as to what it was?

cosmic lichen
lunar lichen
#

i think the rope is too short so its winching the building

#

dnt know i could do that

swift ferry
#

Might be able to join two together

lunar lichen
#

u can set lenght

#

lengh*

swift ferry
#

Oh right

lunar lichen
#

i just dont know what unit its in

#

m, cm, mm fk knows

#

its arma

hidden jacinth
#

Hi, Im looking for a method to do the following:
I want to write a mod/script that allows players to press a keybind to "tilt" their player/camera/weapon whichever forwards or backwards while they are currently deployed on a bipod. This would address the weirdness that sometimes happens when deploying a bipod on badly mapped terrain (Terrain that looks flat, but doesn't have flat colliders) causing them to either look too high, or too low. Or sometimes straight up in the ground.

I looked into SQF and couldn't find a method to achieve this. So I turned to C++ and I can't even get a default environment setup for that, so for now im at a loss.

I wonder if anyone has any ideas, or pointers to get me back on track?

swift ferry
#

Go with mm to make things interesting!

lunar lichen
#

lol

#

need to re-think how i do this

proven charm
swift ferry
#

Wish I could help

lunar lichen
#

man that was too funny

round hazel
#

Just checking with the scripting gurus; On a dedicated server, who is represented by the identifier 'player', if it's used in a remote execute

proven charm
#

in dedi server it should be null

round hazel
#

Gotcha, cheers!

fair drum
#

Depends how you pass it

round hazel
#

I've done a work around, don't worry. I was just fixing a bug with my mission in multiplayer, figured that was it but I can't access the documentation at the moment for some reason

swift ferry
#

Didn't even know you could move buildings like that ๐Ÿ˜„

lunar lichen
#

same

fair drum
#

Oh I was misunderstanding your question. I thought you meant you were passing player as an object to the dedi. Not the opposite way.

lunar lichen
#

ummm

#

i restarted the server, the building is still moved

#

dafuk

#

umm okkkkk

ancient gull
#

Is there any mod that add's building? The only 2 I found is one that needs ace and is pritty shit and one that does not fit my needs (it has a crate of objects you can place in it, im looking for like a gui you can open to build).

#

Or script aswell.

swift ferry
#

Wait what? ๐Ÿ˜ฎ

lunar lichen
#

yup

#

oh jesus

#

lol, im uloading this

frail skiff
#

Is there a way to force a careless unit to run? According to the biki, _unit forceSpeed (_unit getSpeed "NORMAL"); should work to force a unit to sprint but doesn't in this case.

lunar lichen
#

just wen i think ive worked arma out

hidden jacinth
#

Getting a default keybind error
Error Params: type bool, expected Array
Trying to add default keybinds for a mod im working on to CBA_A3. This is the line of code before calling CBA_fnc_addKeybind;

[false, true, false, false, 201] // default: Ctrl + PageUp
Anyone know what im doing wrong here? if you need more of the code as context i can post it

#

nvm I got it. Correct formatting is [201, [false, true, false]]

swift ferry
#

I was thinking that until I tried to make my own faction ๐Ÿ˜›

lunar lichen
#

just

#

just...

#

arma -.-

swift ferry
#

Oooh! Someone should have secured that better

lunar lichen
#

anything i attach ropes too uproots and i can just drag about

#

dont matter what it is

#

not sure if i should bug tracker that

vapid scarab
ancient gull
vapid scarab
#

I dont know about old old arma 3. But i know public zeus doesnt let create custom menus on other peoples stuff. Only way I know to create a menu in pubzeus is that I can create a cuatom list of actions in the top left scroll menu.

#

Im sure its out there though. The Zam guys are insane.

ancient gull
#

I used it all the time in public zeus.

ancient gull
vapid scarab
#

As of now, BattlEye will kick you if any your scripts call createDialog. Or anything with the word create for that matter. i think i had to deliberately rename function createTank to spawnTank. Any function name called remotely with the word create in its name or code block results in BE kicking you.

ancient gull
vapid scarab
#

I dont know how new. i did some pubzeus a year ago. Before that... who knows.

#

Maybe there are some non-battleye enabled servers, nor or previously.

#

Theoretically, any menu that has some scripted dialog rather than config dialog could be hijacked.
So like, call function that spawns a menu. Change menu by referencing UI vars or UIDs. Boom, custom menu. only limited to whatever ui is created by the menu though.

#

And Zam already modifies the zeus menu. so we know its possible to some degree at least.

swift ferry
#

Probably should. Greek buildings apparently don't have foundations

lunar lichen
#

lol

lime rapids
#

though the ui is shit looking back at it should propably redo\

#

as for EZM it is on zams website

winter quartz
#

does anyone know how to make this in arma 3 https://www.youtube.com/watch?v=CXd0-9UW5Z4 i normally used a invisible and unsimulated man and attaching it to a vehicle but that doesnt work well with keyframes and it sometimes stutters is there another way to do this

TrackIR / Oculus CV1
GPU: ASUS TUF RTX 3080OC 10GB
CPU: AMD Ryzen 9 5950X (16-Core)
Memory: 32 GB RAM
SSD: 1TB Samsung 980 EVO M.2 NVMe
Current resolution: 2560 x 1440, 120Hz
HOTAS: Virpil Throttle and Warbird Stick
Pedals: Logitech G Pro

Music from Tunetank.com
SHANTI - Extreme (Copyright Free Music)
Download free: https://tunetank.com/t/35fu/...

โ–ถ Play video
lunar lichen
#

RIP lol

#

i had somthing else i wanted to submit

#

cant rember now..

fair drum
swift ferry
#

It is around 5am

lunar lichen
#

yup

swift ferry
#

I'm done for the night, see you next time. Good luck on the script! ๐Ÿ˜ƒ

lunar lichen
#

later bro

#

nn o7

edgy dune
#

I was trying to force explode a grenade I spawned with createVehicle using setDamage 1, but it didnt work, can grenades be forced exploded or do I have to use another explosive type?

edgy dune
open marsh
#

guys

#

I have a init.sqf where i calll 4 scripts thar are intensive that setup the mission

#

what do i do

#

do i do [] call for each

#

do i use spawn, do i use execvm

atomic niche
#

What is the issue you are trying to solve?

open marsh
#

Just wanted to know whats standard

#

no issue

#

my scripts use sleep command

#

@atomic niche any clue?

proven charm
#

execvm is fine if you run the files only once

open marsh
#

I only wanna run at start of the mission, singleplayer only

#

but i wanna be able to save game and load that save

#

The scripts contain loops that will run all the time

#

Throughout entire mission

proven charm
#

i would think savegame saves your scripts / variables

open marsh
#

Theres dynamic stuff to it

#
if (isServer) then {
    private _debug = false; // Set to false for production
    if (_debug) then { systemChat "=== INITIALIZING ALL SYSTEMS ==="; };
    [_debug] call system;  
    
   
    [_debug] call system2
    sleep 1;
    
    
    [_debug] call system3
    sleep 1;
    
    
    [_debug] call system4:
    sleep 1;
    
    if (_debug) then { systemChat "=== ALL SYSTEMS READY ==="; };
};```
#

How to do this ? @proven charm

proven charm
#

sorry do what?

#

save?

open marsh
#

no call scripts

#

Ccould u rewrite this to how u wud do it ?

#

sketch code

open marsh
proven charm
#

that depends on what its supposed to do

#

you want to run files?

open marsh
#

Yeah

#

Run scripts

#

That setup the game

#

mission, enemies etc

#

behavior

#

just on init, and then to keep things unside those files runnin like loops

#

@proven charm

cosmic lichen
#

Put them into cfgFunctions and use postInit

#

or just use init.sqf, not really sure what's the issue.

open marsh
#

No i wanna use init sqf

#

My question is how do i call them how do i do this

#

Imagine if u have system1folder/system1.sqf etv

#

Do you precompile

#

and then do [] call

#

just give me an example bro jesus why is it so hard to understand

#

how do you call functions in an init.sqf what is the standard way of doing it

proven charm
#

you can do like ```sqf
[_debug] execvm "myCoolScriptFile.sqf";

#

no standard really

open marsh
#

but there is a differenc ebetween spawn, execvm and call

#

in terms of threads and all that

#

performance

#

persistence

#

and i dont know what they are

proven charm
#

execvm is very similar to spawn because both run in new thread

open marsh
#

because alll knowledge is buried inn forums and theyre down and the devs are too incompetent to solve a ddos issue so they took the plug out of the website instead

open marsh
#

Bexause i know that for example you cant do sleep commmand in certain context

cosmic lichen
#

Read the scripting introduction on the wiki.

proven charm
#

spawn and execvm run in scheduled mode so they can sleep

open marsh
#

The website literally doesnt load for me

#

I cant open the websites

#

Why did the devs add 3 ways to call functions

#

Jesus christ what a community, too lazy to explain even rudimentary things. As if i requested RHS mod to be made from scratch here

#

@atomic niche

#

The link doesnt work mate

#

The forums dont work..i guess we have to pray to Jesus to explain us how ArmA works?

hallow mortar
# open marsh Why did the devs add 3 ways to call functions

They behave differently.
execVM is used to directly load a plain script file. It's less efficient because the file is compiled every time - and it can't be used to execute "ordinary" code, only separate script files.
spawn is used to create a new Scheduled thread. The Scheduler is an engine system that manages the scripts that are currently running. Each Scheduled thread is limited to a certain amount of execution time per frame, and the Scheduler enforces that limit, as well as handling script suspension.
call is used to execute code "as if it was in-line" in the current context.

atomic niche
# open marsh Why did the devs add 3 ways to call functions

Why did the devs add 3 ways to call functions
Because they are 3 different things that have different functions...

Jesus christ what a community, too lazy to explain even rudimentary things
you are demanding an answer to a question you could have googled

The link doesnt work mate
What part "doesn't work" I currently have it open. we would have to look into why it doesn't work

open marsh
#

It doesnt work for me

hallow mortar
atomic niche
open marsh
hollow thistle
#

worth a read. While the ACE practices might not be necessary for your use case it gives an overview of the scheduled vs unscheduled and which commands do what.

hallow mortar
# open marsh how do you know when to use which? is it just async vs sync?

It depends heavily on what you're trying to do.
Unscheduled code is guaranteed to happen in the current frame, so it's good for time-sensitive applications. But, that means the entire frame will wait for it, so suspension is not allowed, and heavy code can cause stuttering.
Scheduled code may be delayed if the frame script budget runs out, but suspension is allowed.
There are also important considerations aside from scheduled/unscheduled state. spawn is a new thread; that new thread will not wait for the current thread. call is as if the called code was in-line here; the parent context will not continue until the called code is completed, and the called code has the same scheduled/unscheduled state as the parent context.
execVM is a little bit obsolete tbh, I would generally prefer to make a function and use call or spawn, as they're more efficient. I'd only use execVM if I'm being exceptionally lazy, or if I need to execute a script file I can't access to turn into a function (e.g. existing script file inside a mod).

open marsh
#

This is great information

#

I have been using a lot of spawn+sleep

open marsh
hollow thistle
#

It depends on what you're building

#

SP, MP does not matter. It's the thing you're building.

If you're starting with SQF you should be fine doing mostly scheduled code. You can shoot yourself in the foot with unscheduled if you don't know what you're doing.

pallid palm
#

ouch my foot hert's, he he

pallid palm
#

@hallow mortar thx you so much for that clear explantion of Call and Spawn, it helped me alot, thx again your the greatest

novel dove
#

Hello, I would like to know how to recreate subtitles identical to the SPEARHEAD 1944 DLC. Rectangle with face and background. Is it a new command or just an embedded image?

cosmic lichen
#

See SPE_MissionUtilityFunctions_fnc_showSubtitle in the functions viewer

novel dove
winged thistle
#

I have this: MY_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown","hint 'Key pressed'; _this call MY_fnc_keyPress"];

#

If I enter it in the debug console, it works.

#

Where should I put it to make it work for all MP players?

fair drum
#

Is the line under prowler 3 an image?

winged thistle
#

I have tried init.sqf, initPlayerServer.sqf, and initPlayerLocal.sqf

molten tree
#

Q: How do I declare an SQF a function?

#

I have a file I want to run repeatedly, but I don't want to have to recompile it every time if this is accurate.

granite sky
#

quick dirty way: compileScript, proper way CfgFunctions.

molten tree
granite sky
#

You read those pages on the wiki.

molten tree
#

Alright, wait one.

granite sky
#

And then you come back only if you don't understand it :P

molten tree
molten tree
thin fox
#

under a TAG

molten tree
#
{
    class CD
    {
        class CDFunctions
        {
            class vehicleFollow {};
        };
    };
};```
#

This? I have this in my description.ext.

thin fox
#

almost, Idk if "CDFunctions" would work cause from what I remember is path related

molten tree
#

Path is currently \BasicFunctionTest.Altis\Functions\CDFunctions\fn_vehicleFollow.sqf. Game isn't throwing up any errors so I know it's detecting it.

tulip ridge
thin fox
molten tree
thin fox
#

and check if you can see your function in the function viewer

molten tree
#

Yep, that was it. Thanks @tulip ridge !

tulip ridge
#

๐Ÿ‘

#

If you want a different structure, you can specify a file parameter which points to a folder / script

molten tree
#

Previously I was calling CD_CDFunctions_vehicleFollow

tulip ridge
#

Yeah CfgFunctions will always name files TAG_fnc_functionName

molten tree
#

Last question; if I want to precompile it, how do I get it to point at the sqfc?

tulip ridge
#

Don't need to do anything
Arma should read a *.sqfc file with the same name if it exists iirc

molten tree
#

Awesome, TY.

molten tree
#

Hokay... new question. sweat_smile What command would work well to determine if an AI is under fire? I'm doing a follow script, and I want that script to terminate if any of them detect that they are under fire. I tried using damage, but it's unreliable because sometimes they'll stop because the damage threshold wasn't reached.

fair drum
#

Do you care if they are already under fire before? If not, then you can check the current behavior of the group. It will turn to combat when under fire.

#

There's an event handler for it

molten tree
#

This is what I have right now:

if (damage FOLLOW2VAR >= 0.4 || damage FOLLOWER2VAR >= 0.4 ) then { FOLLOW3VAR = FOLLOW2VAR;}; 
if (damage FOLLOW3VAR >= 0.4 || damage FOLLOWER3VAR >= 0.4 ) then { FOLLOW4VAR = FOLLOW3VAR;}; 
if (damage FOLLOW4VAR >= 0.4 || damage FOLLOWER4VAR >= 0.4 ) then { FOLLOW5VAR = FOLLOW4VAR;}; 
if (damage FOLLOW5VAR >= 0.4 || damage FOLLOWER5VAR >= 0.4 ) then { FOLLOW6VAR = FOLLOW5VAR;}; 
if (damage FOLLOW6VAR >= 0.4 || damage FOLLOWER6VAR >= 0.4 ) then { FOLLOW7VAR = FOLLOW6VAR;}; 
if (damage FOLLOW7VAR >= 0.4 || damage FOLLOWER7VAR >= 0.4 ) then { FOLLOW8VAR = FOLLOW7VAR;}; 
if (damage FOLLOW8VAR >= 0.4 || damage FOLLOWER8VAR >= 0.4 ) then { FOLLOW9VAR = FOLLOW8VAR;}; 
if (damage FOLLOW9VAR >= 0.4 || damage FOLLOWER9VAR >= 0.4 ) then { FOLLOW10VAR = FOLLOW9VAR;}; 
if (damage FOLLOW10VAR >= 0.4 || damage FOLLOWER10VAR >= 0.4 ) then { FOLLOW11VAR = FOLLOW10VAR;}; 
if (damage FOLLOW11VAR >= 0.4 || damage FOLLOWER11VAR >= 0.4 ) then { FOLLOW12VAR = FOLLOW11VAR;};```
hushed turtle
molten tree
hushed turtle
#

Why do you use moveTo over doMove?

#

Why to use these commands over waypoints? Maybe you just want to move a group member

stable dune
hushed turtle
#

True, also no need to check same thing twice in one condition

tulip summit
#

is there a way to get the contents of backpacks/vests/uniforms inside of a container/vehicle?

winged thistle
#

Noob mistake. I forgot: waituntil {!isnull (finddisplay 46)};

molten tree
# hushed turtle Why do you use `moveTo` over `doMove`?

I'm trying to reduce stress on the game engine; it's supposed to update the move location repeatedly, and refreshing waypoints hammers the engine. I personally didn't notice a difference, but if it's multiplayer, that could be VERY different.

molten tree
#

For example (this doesn't work atm):

_dmgn = 0.4;
_dmg = "damage _fV > _dmgn"; 
_dmgd = compile "damage driver _fV > _dmgn";
 
if ( _dmg || _dmgd ) then { true } else {false};```
#

Wait, nevermind, I'm a dummy. sweat_smile

#
_dmgn = 0.4;
_dmgv = damage _fV;
_dmgd = damage driver _fV;
_dmg = compile "_dmgv > _dmgn || _dmgd > _dmgn";
 
if (call _dmg) then { true } else {false};``` There we go. ๐Ÿ˜„
cosmic lichen
#

use macros for that

#

and please give those macro names a proper name

hushed turtle
hushed turtle
drifting badge
#

Do I have to set each disableAI argument individually or can i use the following to get those needed all in one? (Also am not really sure if one even has to remoteExec the disableAI as it is a local argument but has a global effect).

[_groupleader, ("MOVE","COVER","AUTOTARGET")] remoteExec ["disableAI", 0];
stable dune
hushed turtle
#

Create a function which does all three and and execute it where _groupLeader is local

drifting badge
#

oh that is quite clever Prisoner, did not even consider writing it like that! (am still such a complete NOOB when it comes to scripting)

rich frost
#

im looking for a afunction to see if a helicopter can slingload a certain object. ideally both based on classnames.
Anyone familiar which configs are relevant here?

proven charm
pallid palm
#

holy cow i had to riase up my view Distance, After learning how to use call and spawn better in my missions, cuz my game was Running so fast, woohoo

ornate whale
#

Am I right if I say that remoteExec can not execute an arbitrary block of code, like [] remoteExec ["{....}", 2]; ? Thanks

digital hollow
hushed turtle
errant iron
winged thistle
#

"GAME LOADED" maybe?

bleak valley
#

Hello
(I think my question belongs here, but I might be wrong)
Is it possible to make buildings lamps flicker like you can do with streetlamps ?
(I'm using a modded map that contains modded corridors, and those have lamps)
Is it possible to make them "believe" it's day time so they turn off ?

#

ofc I don't want it to be really daytime, or at least so my players still use their headlamps
even with 100% cloud coverage it's still pretty bright during daytime

fair drum
#

Yes. You'll use nearestTerrainObjects to get the lamps on the map, then you'll iterate through those by setting the damage of them to 0.9 and back to 0 over and over again with some randomness

bleak valley
#

answered my own question, I put it here if anyone looks :

I placed

    _x switchLight "OFF";
} forEach (1 allObjects 0);```

in my init.sqf file
bleak valley
winged thistle
#

And I'm too busy lol

#

Maybe we'll get lucky, and there'll be someone out there that is not tremendously lazy or busy simultaneously...

harsh bloom
#

Im having trouble getting a squad to skip to the end of their waypoint chain when they encounter the enemy.
What im doing currently is:```sqf
Lookout_1 setCurrentWaypoint [Lookout_1, 6];

I thought maybe doing setCurrentWaypoint followed by doStop would help but it hasnt.
fair drum
#

any AI mods like lambs?

harsh bloom
#

i will have to check one sec

#

ye, the modpack has lambs RPG,Supression,Danger and Turrets

fair drum
#

take those off, then retest. if it works, then its a mod issue

harsh bloom
#

TBH i dont even know what those do

fair drum
#

also, make sure that your waypoint index is 0 based

harsh bloom
#

I think thats how its portrayed in game by default

crude tendon
#

Hello. I want to learn how to check anything for all objects in an array. Is it possible to do? As an example: {_x in vboat == true} forEach allPlayers (I know it doesn't work and the reason of it. I just want to know if checking anything is possible for objects in an array.)

stable dune
#

Too fast Lou

crude tendon
#

Thanks!

#

No, wait
It only returns a number of the first object which satisfies the condition *(e.g. *allUnits findIf {_x in vboat} returns 0 while 0, 1, 2 satisfy the condition)

#

Wait, I need to try to use the "Example 2"

#

I think this is what I was looking for.
waitUntil{ { _x in vboat } count allUnits == 4}

winter rose
#
waitUntil{ _theUnits findIf { !(_x in vboat) } == -1 }; // better perfs
crude tendon
winter rose
#

allUnits is checkingโ€ฆ well, all units, so that's a bit much?

crude tendon
#

Okay. So it's allUnits

winter rose
#

what do you want to check: that 4 people are in the boat? check crew _myBoat perhaps, that's even better

crude tendon
#

I am just testing it. There's no more units except 3 bots and 1 player squad.

crude tendon
hallow mortar
#

units _group

crude tendon
stable dune
crude tendon
#

Arma says they don't, okay. The squad name is a Group and not an Array

winter rose
#

units thesquad

hallow mortar
#

units group player means "get the units that are in the group that the player is in". It's the same as units someGroupVarName if that variable points at the same group.

#

(units group player could also be shortened to units player - if a unit is provided, the command assumes you mean that unit's group)

crude tendon
dire island
#

Regarding execVM and player, on BIKI (https://community.bistudio.com/wiki/switchMove), i found the following example:
[player, "AmovPsitMstpSlowWrflDnon"] remoteExec ["switchMove"];
with the caption "Sit player immediately and globally".

Let's say I run it on my machine. Does it
a) Cause everyone on the server to see my character sit down, or
b) Cause everyone on the server to sit down?

That is to say, does "player", when remoteexec'd, still refer to the player character on the machine who executed the command, or refer to the player character on the machine to which the command is sent?

winter rose
#

you are sending the player object, player will not be evaluated on each machine

cosmic lichen
#

This first one is correct, the 2nd one isnt

tulip ridge
#

Last one shouldn't have the variable name in quotes

#

Difference is that private keyword makes the variable not available to other scripts, you can run into issues when not making variables private

cosmic lichen
#

Yes

#

use private _varName = myVar; though in this case

tulip ridge
#

What do you mean?

cosmic lichen
tulip ridge
#

It's a local variable that exists for the runtime of the script

#

Doesn't have anything to do with objects

#

Underscore makes a variable local, private keyword is an extra layer for local variables

cosmic lichen
#

A local variable is only visible in the Script, Function or Control Structure in which it was defined.

tulip ridge
#

No, local to the script

cosmic lichen
#

Because that's what you usually want

tulip ridge
#

Because you should always use it unless you explicitly want other scripts to be able to access and modify variables

#

Which you don't want 99% of the time

cosmic lichen
#

You can run into some nasty stuff that is hard to debug if you don't

#

_var is local to the script

#

var is local to the client e.g. available in all scripts

#

private _var makes the variable local to the current scope (it will not be available in the parent scope)

#

A good way to learn these things is to test them. You got an idea, just write the code

granite sky
#

The word "local" is used in two different ways when you're talking about SQF.

#

local vs global variables, local vs global objects/execution.

vapid scarab
brazen fable
#

Very simple question on my end. How do I make a script for a hold action that adds an item to the inventory of the player who completes the hold action in a MP mission

vapid scarab
brazen fable
vapid scarab
#

Oh... yeah.

#

actions execute code locally. Use player and make sure to use a global command for adding an item.

brazen fable
#

its currnetly just
player addItem "insert item here";

#

that work, when I put the specific item there

vapid scarab
#

Thatll work. Double check that addItem is a global command or has a global alternative

brazen fable
#

sweet

#

thank you

bleak valley
# fair drum Yes. You'll use `nearestTerrainObjects` to get the lamps on the map, then you'll...

I tried like you said, but to no avail (I know for a fact lamps go off when building is destroyed, I tested it using the "edit terrain" module in Eden for one corridor)
I think it's because my script is wrong, but I don't see the issue

{
        while { true } do
        {
_flicker setDamage 0.9;
sleep (random 2);
_flicker setDamage 0;
sleep (random 2);
    };
};```
ofc, I call my sqf file in my init with` execVM "flicker.sqf";` (file is named "flicker")
do you see it ?
winter rose
#

yes, your scope around the while

#

you create a piece of code that is never called, basically

bleak valley
#

I see ... so this way then ?

if (isDedicated) exitWith {}; 
{
        while { true } do
        {
_flicker setDamage 0.9;
sleep (random 2);
_flicker setDamage 0;
sleep (random 2);
    };
};```
winter rose
#

youโ€ฆ did not remove that scope

sharp grotto
bleak valley
#

oh okay I get it now, thanks (I may have to change the "if" thing but otherwise I get it)

sharp grotto
#

Also nearestTerrainObjects gives back an array

#

you would need to select an element, otherwise it will not work

private _flicker = (nearestTerrainObjects [[769, 2585, 0], [], 150, false]) select 0;
bleak valley
#

I thought it would apply to the entire array without having to select an element, my bad

winter rose
#

forEach ๐Ÿ˜‰

inland iris
#

Can someone help me write a script to get all the items in an ace arsenal box?
I wanna black list all the uniforms and I can't seem to find an easier way of doing it

#

Some of the modded stuff gets added to CfgWeapons with all the weapons buy I only need the Uniforms

#

This is what I did

private _items = "true" configClasses (configFile >> "CfgWeapons");
private _filtered = _items select {getNumber (_x >> "isItem") == 1};
private _names = _filtered apply {configName _x};
copyToClipboard (_names joinString ", ");
hint format ["%1 general items copied to clipboard.", count _names];
#

But this returns all the items but I only need the Uniforms

tulip ridge
#

Just check _x >> ItemInfo >> type

#

Uniforms are 801

#
private _allUniforms = "getNumber (_x >> 'ItemInfo' >> 'type') == 801" configClasses (configFile >> "CfgWeapons") apply { configName _x };
bleak valley
#

a "while" loop doesn't break "_x" ?
Nvm, I fixed the "undefined variable" error

near snow
#

how would you define what units to set a Post Processing Effect can I have it directly in a for each loop or would I need to make it its own function and call it in there?

fair drum
raw vapor
#

Is there a command to automatically copy the pylon loadout of one vehicle to another?

#

My use case:
I start players inside of a hangar off-map spawn area that they can only leave by teleport. Inside that hangar is a fighter jet. On that fighter jet is a hold command that teleports the pilot and deletes this jet, and the pilot goes into an identical jet that is unsimulated and in the air with its engine on at load time. When the pilot uses a hold command to START MISSION the jet becomes simulated and flies normally.

What I want to do is maybe make the prop jet able to have its loadout changed, and when the pilot gets teleported, that pylon loadout gets copied to the unsimulated aircraft.

raw vapor
#

๐Ÿ‘

#

So something like

someOtherJet setPylonLoadout _myJetLoadout;```
#

or better yet

#

something like someOtherJet setPylonLoadout (getAllPylonsInfo this;);
with this being the object I am executing the command on, the jet I am editing, while someOtherJet is the jet I am copying the loadout to.

fair drum
#

you need to do some array manipulation. these commands aren't directly compatible

raw vapor
#

I guess I would not know where to start in that regard.

fair drum
# raw vapor I guess I would not know where to start in that regard.
if (!isServer) exitWith {};
private _data = getAllPylonsInfo myBasePlane;
{
    _x params ["_index", "_name", "_turret", "_magazineClass", "_magazineAmmoCount"];

    // setPylonLoadout is local executed, need it to be global
    [myClonePlane, [_index, _magazineClass, false, _turret]] remoteExec ["setPylonLoadout"];
} forEach _data;

an example

tough abyss
#

Keep in mind that when directy restarting (not resuming) a game (e.g. ESC -> Restart or #restart on servers), the main display 46 will carry over from the old mission and the init.sqf (or any other mission script) will be executed again, adding an additional keyDown event.

raw vapor
#

oh that is perfect

#

That works exactly as desired.

#

The only anomaly is Firewill planes don't like when I spawn them without pylons; the pylons get removed completely, so I got weapons floating mid-air.

Easy fix. If I'm copying the loadout anyway, just have the other plane start with pylons so even if they get overwritten with nothing they'll just be an empty pylon and not clean.

#

I don't know Firewill documentation to fix this but it works perfectly for vanilla.

tough abyss
#

(CBA fixes this by accident currently, so if anyone wants to confirm - do it without any mods)

bleak valley
#

I spent a few hours yesterday trying to understand why it won't work and testing multiple possibilities (changing the scope of "forEach", trying "_x" and the variable name, etc)
I'm starting to think it won't work anyway notlikemeow
Can someone explain to me why this doesn't work please ? (if it's because I miss a ";", I might throw my computer through my window)

{
if ( time > 0 ) then
    {
while { true } do
               {
_x setDamage [1, false];
sleep (random 2);
_x setDamage [0, false];
sleep (random 2);
        };
    };
} forEach _flicker;```

(for context, it's an .sqf file I call using execVM in my init file, and I don't get an error message)
winter rose
hallow mortar
#

I'm not sure that setDamage 0 after a previous complete destruction (setDamage 1) actually works

bleak valley
#

now I'm locked into a loop of error messages and I can't spawn anymore x)
I must have f***** up something, probably a scope

bleak valley
hallow mortar
#

So the way your code is structured, this will start a while loop on the first object in the _flicker array, and then.....continue doing that while loop and never get to the next object

bleak valley
#

even with forEach ? f*** me

hallow mortar
#

forEach operates sequentially. It does the thing with the first item, then it does the thing with the second item, then...
If the first iteration contains an infinite loop, it will...wait for that loop to complete before moving on to the next iteration.

bleak valley
#

got it, makes sense, I have to tell it to apply to every single object in the array

hallow mortar
#

Are you wanting all the objects to flicker at the same time, or at different intervals for every object?

bleak valley
#

different interval for each
I'm starting to think I would have already finished if I set the script individually for each object using the "edit terrain" module in Eden x)

hallow mortar
#

Here are a couple of possible options for you. I'm just talking about overall structure here; I'm still not sure that setDamage is actually capable of bringing back fully destroyed objects.

private _flicker = nearestTerrainObjects [[769, 2585, 0], [], 150, false];
waitUntil {time > 0};

{
    _x spawn {
        while { true } do {
            _this setDamage [1, false];
            sleep (random 2);
            _this setDamage [0, false];
            sleep (random 2);
        };
    };
} forEach _flicker;

// =========

while {true} do {
    private _obj = selectRandom _flicker;
    if (damage _obj > 0.9) then {
        _obj setDamage 0;
    } else {
        _obj setDamage 1;
    };
    sleep (random 2);
};```
bleak valley
jovial sigil
#

I remember that you could spawn in with a black exile uniform when I hosted a server 8 years ago and can't find any information on how to implement it on my server I have just hired as I don't have my scripts

sharp grotto
#

But you can just add it to ExileServer_object_player_network_createPlayerRequest (inside the exile_server.pbo unpack/edit/repack)
line 31

_bambiPlayer forceAddUniform "Exile_Uniform_ExileCustoms";

That should be enough

jovial sigil
#

So the exile_server pbo not the altis.pbo ok thanks

sharp grotto
hidden jacinth
#

Would someone mind helping me rq with the findif syntax?
Trying to check that the variable in my foreach loop matches the variable in my _validTypes array
forEach vehicles is the loop.
And the code thats checking is if (_validTypes findif {_x isKindOf _x}
It seems to be running code no matter what type of vehicle it finds so im questioning _x isKindOf _x

sharp grotto
hidden jacinth
#

Not comparing classnames am I? My _validTypes array contains "private _validTypes = ["Plane", "Helicopter"];"

hidden jacinth
#

Oki haha. But ye, do you know anything about the _x variable and if Im utilizing it correctly?

jovial sigil
sharp grotto
jovial sigil
#

Ok that sounds the easiest option then, thanks again

round hazel
#

Hello! Anyone know the remoteExec for these two lines?

[_video,[16,9]] call BIS_fnc_playVideo;
#

I have two instances of this code, one launching from a Hold Action and the other from the Event 'Killed' of a civilian. The second does not work on a dedicated server. If anybody has any guesses as to why, I would be eternally grateful!

cosmic lichen
#

setObjectTextureGlobal

round hazel
#

Did not know that existed! I figured out how to put it in a remoteExec, but I'll test that afterwards!

#

What I ended up with

[Screen , [0, _video]] remoteExec ["setObjectTexture"];
[_video,[16,9]] remoteExec ["BIS_fnc_playVideo"];
cosmic lichen
#

Looks correct. But use the global command.

#

Without remoteExcec*

round hazel
#

You mean like this? @cosmic lichen

Screen setObjectTextureGlobal [0, _video];
[_video,[16,9]] remoteExec ["BIS_fnc_playVideo"];
cosmic lichen
#

Yes

sweet raft
#
Bohemia Interactive Forums

Page 35 of 35 - Development Branch Changelog - posted in ARMA 3 - DEVELOPMENT BRANCH: 14-12-2015
EXE rev. 133719 (game)
EXE rev. 133719 (launcher)
Size: ~46 MB (and ~63 MB hotfix)
ย 
DATA
Added: BIS_fnc_getName now has new parameter to clamp the name size if needed
Fixed: In MP Bootcamp, JIP players could not take magazines from the weapon holder at the weapons firing range
Fixed: Cropped difficulty indicator in certain languages in the Scenarios and Campaigns displays
Tweaked: Some of...

tardy osprey
#

Anyone here have an idea on how you achieve the filter used on voice lines over radio, BI style? Like instead of sounding like someone whos speaking into their microphone, it actually sounds like someone is talking on the radio, kind of like a speaking into a can sort of sound effect.

cosmic lichen
tender fossil
tardy osprey
tender fossil
#

Additionally, you can add small static noise (there should be generator for it in Audacity) on the background for the duration of the "transmission"

hallow mortar
torpid dagger
#

Arsenal integration in eden... Does that mean i can equip placed units directly in eden?

tardy osprey
#

I'll take a look, thanks.

tough abyss
#

Hi, I could use some help. I'm trying to enable the debug console but for some reason it's not picking up. I've enabled it through the Server.cfg:
// Debug Console Access
enableDebugConsole[] = {"SteamID"};
I've also whitelisted myself as the developer in the whitelist.sqf. I'm also brand new to this, any assistance would be greatly apprecaited. Thanks.

sharp grotto
tough abyss
#

Thank you!

arctic bridge
#

Quick question, I've seen a few options for perFrame event handlers and I was wondering which one I should use?
Stacked? Mission? CBA perFrame?

tulip ridge
arctic bridge
#

And I've seen this done but I'm not sure it's good practice - while loops instead of perFrame eventhandlers?

tulip ridge
#

Situation dependent, but the while {true} do { ... }; loops that people use can be replaced by a PFH yes

arctic bridge
#

Hm ok, thanks man

granite sky
#

while loops aren't guaranteed to run every frame.

#

that may or may not be a good thing.

spring stone
#

@torpid dagger Thats it. When you right click on a unit or multiple units you can select or create a loadout in the arsenal. This will be used for the unit(s) if you exit the arsenal!

signal kite
granite sky
#

If you only have two valid types then using findIf is overcomplex anyway.

#

but yeah, if you need to refer to the value of _x from a parent loop then copy it into another variable first.

crude tendon
#

Hello. I wanna ask if it's possible to make a trigger that checks something only once 2 seconds after a scenario started and stops checking if the condition wasn't satisfied.
Does "Interval (default: 0.5)" starts checking right after the server started or after the amount of time mentioned in that "Interval" passed from the start?

fair drum
crude tendon
torpid dagger
#

even for multiple units? that's awesome ๐Ÿ˜ƒ

crude tendon
#

Can someone help me? This shit which destroyed my last nerve in my totally empty nerve system thing appears 24/7.
Explanaton: I have 4 civs (civ5, civ6, civ7, civ8) which appear with a 50% probability. Variable possibletrigger == 1 if civdocs (the document to interact with) spawns on scenario startup (80% probability of spawning). I don't know what I'm doing wrong, this error appears 60 times per milisecond (with other errors of the same kind, the only thing which changes is a number in civ_X).

warm hedge
#

possibletrigger is undefined I presume

crude tendon
drifting badge
#

trying to warp my brain around "locality" in connection with player hosted MP games and if I should use

if !(local unit) exitWith {};
// ACTIONS TO DO

or either

if (isServer) then { //run on dedicated server or player host }; 

if (hasInterface) then { //run on all player clients incl. player host }; 

in my addaction called commands for things like for example force a unit to fire its weapon. I have also been trying to remoteexec those commands that are LA/GE, so there would not be any issues in player hosted MP (as this is what our little group uses).

Been testing with the following commands:

[_groupleader, "M16"] call BIS_fnc_fire; // works as it is GA/GE and so does not have to be remoteexec'd
[_groupleader, "M16"] remoteExec ["fire", 0, true]; // weird as it fires twice in close succession on the hosted end
_groupleader forceWeaponFire ["M16", "Single"]; // this works but it not remoteexec'd
[_groupleader, "M16"] remoteExec ["forceWeaponFire", "Single"]; // does not work ?

So what is the most sensible/effective thing to use in case of player hosted MP games? When to use "local" or "hasInterface" or the remoteexec "target -> 0/2/-2) and JIP "true" setting?

warm hedge
crude tendon
#

Found out

#

It returns 1

#

I checked with Zeus - civdocs actually exists

warm hedge
#

You sure all variables that is used in your trigger exist?

crude tendon
warm hedge
#

What if you make a trigger without civ5 to 8?

crude tendon
warm hedge
#

I am asking if it returns the error, not how it should behave/what it should do

crude tendon
warm hedge
#

I slightly bet you're just deleting these object, I meant to remove these civ5 to civ8 mentions in the code

crude tendon
warm hedge
#

That means either !alive civdocs or possibletrigger == 1 is causing it

crude tendon
#

That means errors appear only if any mentioned object doesn't spawn.

#

Any ways to avoid it?

warm hedge
#

Make the civdocs variable no matter it is spawned or not

#

I don't know when it does spawn

#

Easiest way is civdocs = objNull;

crude tendon
hushed turtle
#

objNull is valid value of type OBJECT

warm hedge
#

It does. So the variable stores nonexistent object. That means alive can take its place with it. If the variable is not an object, alive cannot be used

little raptor
#

in this case maybe it's not what they want tho
because alive civdocs will return false when it doesn't exist

crude tendon
#

No

#

NO

#

It does exist!

#

It returns 0 while it's alive!

warm hedge
#

Basically using null in such getter work. This is useful in such case

drifting badge
#

Any insight when best to use utilize "local"/"hasInterface" or the remoteexec "target -> 0/2/-2) and JIP "true" setting? Should those always be added?

fleet sand
drifting badge
#

Oh, thought anything that has LA/GE needs to be remoteexec'd? Because I also tested with some animation and playmovenow and this also is listed as LA/GE on the wiki but does not work in MP if not remoteexec'd?

For MP should not everything be run on the server and it will distribute to the clients?

fleet sand
# drifting badge Oh, thought anything that has LA/GE needs to be remoteexec'd? Because I also tes...

Here is simple example of your script.

private _cW = currentWeapon player;
private _fMs = getArray (configFile >> "CfgWeapons" >> _cW >> "modes");
private _fM = selectRandom _fMs;
player forceWeaponFire [_cW,_fM];

For MP should not everything be run on the server and it will distribute to the clients?
No. You want to run most of the scripts on clients so there is no network traffic between clients and server that is not nessery.
You only want to run scripts on server that everybody needs to see.

thin fox
trail smelt
#

Hello, is it possible to overwrite/deactivate a pbo that is in another mod with my own mod so that the original author does not have to interfere with the mod himself?

little raptor
little raptor
little raptor
#

generally speaking yes. you can just patch it and disable what you don't want

trail smelt
#

I have a mod in the package that combines several things into one, but the original author also included a pbp for a texture for one plane. I'm trying to deactivate this single PBO so that when loading the arma, the error that the PBO requires that plane doesn't appear.

little raptor
#

I think you can patch the CfgPatches of that mod. but I've never tried it so there's no guarantee
anyway, just replace its requiredAddons with one without that PBO

spring stone
#

It is, Eden is the best thing that happened to Arma xD

red estuary
#

@sweet raft i remember putting Arsenal intergration on the Eden suggestions (more people did that aswell i assume), Nice to see it intergrated now, cant wait for the official release of EDEN

granite sky
cloud stirrup
#

Hey,
FiredNear event doesn't work on vehicles ?
It doesn't get trigerred for people inside vehicles so i tried to apply to a vehicle but still not working, do you have any solution to make it works ?

#

The workaround i can think of is using the fired event and get every vehicles around the player to trigger manually a simmilar event

cloud stirrup
#

Forcing player to be in 1st person when someone shoot near them

cloud stirrup
rough pendant
#

hey anyone got/know/can help with a KAT med script for spawning injured uncon AI for practicing

hasty current
#

Is there any way to set a player's aiming direction? Preferably like how weapon sway does it, AKA just moving the weapon and arms itself, but a way that moves the camera itself too would also be acceptable. I wanna see if I can make something like Arma 2's low stamina aim thing (with the reticle moving randomly within a radius on the screen)

warm hedge
#

No actually

hasty current
#

Sad, thanks

pallid palm
#

OMG thanks You: To All The Awsome Guys in this Chn: (To many to Name), For helping me with all my stuff, Everything is working so GOOD, Im having so much FUN, i freeking love it, i Love You Guys, thx again

hallow mortar
drifting badge
#

this

cloud stirrup
#

Hello ๐Ÿ™‚
Is using remoteExec from server to clients a lot of times a bad habits ?
I want to modify a marker pos for ~20 clients only while it still hidden for all others clients, set pos is given by the server every second, I don't think it's going to be in a good shape or is it a common way to do that thing ?

#

Meaning that the remoteexec will tell the client to do a setmarkerposlocal

ruby turtle
#

What kind of BAD Audio is comaptible with arma 3? Normally the audio files should be 32 Bit and 44,1KHz, But for radio music, I want to downgrade the whole audios into smaller bitrate and smaller Frequency. How low does arma support audio oggs?
is it possible to use 16KHz or 11,025KHz?

hallow mortar
cloud stirrup
#

Thanks

#

Meaning that if my position is random i have to calculate everything before sending it to the client, looks a good idea

drifting badge
#

got something puzzling (am sure I have a mistake somewhere)

The following works - placed in the INIT field of the group leader unit), using named units (i.e. Man1, Man2,...) in the group.

{ _x playMoveNow _anim } forEach [Man1,Man2,Man3];

But I am trying to make it into a more general script that works without having to name units but neither of the following seems to work as the one above (either throwing an error "is array and not object" or there is no error but nothing happens:

{ _x playMoveNow _anim } forEach units group this;
{ _x playMoveNow _anim } forEach units (group _this);
{ _x playMoveNow _anim } forEach (units (group this) - [leader (group this)]);

As said am trying to make things more copy/past-able without the need to always name units in Eden as it can be tedious. So a more general script that can work "copy/paste style" would be better.

warm hedge
#

How do you run the code? In where?

hallow mortar
#

units this or units group this should be correct if you're definitely working in the init field of the group leader.

BUT init fields are not always a good place for this; they run on every machine separately (including JIPs), which can lead to conflicts, and sometimes they run before the unit/mission is initialised enough for some commands to take effect.

still forum
charred monolith
#

Hi ! I come to you to ask a question regarding the inventory. I want to limit the amount of item a player can carry. Either if they take it from an arsenal or take it from another inventory.

Is there an event Handler that can detect when a specific object is picked up or when it is added to the inventory ? I know I can detect when the inventory is opened or closed but that depends on the player opening or closing it.

I know I can use loops it thing like that but honestly I have bad feeling about making loops or script that continuously run (because Iโ€™m bad at code so the performance will be bad)

charred monolith
lyric mortar
#

please help me figure out how to correctly wait for my function to complete before executing further code.

granite sky
#

Is there a good reason that you're not just calling the function?

lyric mortar
#

first, I call a function that adds a large number of weapons to the virtual arsenal, and then I call another function that removes something unnecessary.
and apparently, the second function works faster than the first one finishes working
, as a result, the unnecessary weapon is not removed.

if i put sleep between them, then everything works correctly, but I don't like this approach.

ornate whale
#

Is there a way how to share a variable assigned to an object and make it available only on the machine where the object is local (and may become local in the future), without making it public? Thanks

granite sky
#

Fun fact, the CBA loadout player EH alone makes Arma about 0.1% slower :P

#

But it does the work anyway so there's no additional cost for using it.

granite sky
#

Is that function your code or someone else's?

granite sky
lyric mortar
granite sky
#

And it's the BIS functions that are spawning internally?

#

If you don't know then just say what the function is.

rugged spindle
#

Is there a way to use setObjectTexture on the windows of a car?

lyric mortar
#

It's actually weird, I went to smoke a cigarette and when I came back everything started working correctly. Do you have any idea if I use a "call", the game is always waiting for it to end, or sometimes it can go on?

granite sky
#

call executes the specified code and returns.

#

There's no spawn anywhere in those virtual cargo functions so if you call them then the state should be correct afterwards.

delicate tangle
#

Im having an issue where moving a group, which is spawned by a Spawn AI module, via setpos deletes the groupโ€™s waypoint. Is this a common issue?

lyric mortar
granite sky
#

Correct (and execVM).

delicate tangle
#

It seems to cancel the Sector Tactics logic

lyric mortar
lyric mortar
#

now another problem, it does not add magazines to the arsenal via "BIS_fnc_addVirtualMagazineCargo", and calls all the functions of adding items (weapons, magazines, backpacks, items) They're standing next to each other. But if I add manually via the console, then everything is OK.

cloud stirrup
drifting badge
#

Got another question in regards to "addaction" -> currently the addaction only shows when one "aims" at the unit/object that the addaction is attached to, but is it somehow possible to make the addaction show up when the players are within a certain distance of the unit/object without them having to aim/target that object? (So a bit like it is with a trigger -> when the player enters the trigger the action shows up.)

little raptor
#

yes. add the addAction to yourself (player) and tweak its condition to show only when you're close to the object

drifting badge
#

Oh hell did not even think about that! Thanks!!!

faint burrow
#

Add an action when a player enters a trigger, and remove it when the player leaves the trigger.

ruby spoke
#

Is there a function in SQF equivalent to md5() or any other hashing function?

gritty escarp
#

I am having an issue where the AI keep getting their first waypoint to [0,0,0], is there a way to have a script just select and delete all waypoints in a specific area? or do it through a trigger?

queen cargo
#

no

hushed turtle
#

Why would that be at position [0,0,0]?

queen cargo
#

what the hek you need something like that for @ruby spoke ?

hushed turtle
#

It's normal thing for group to have one waypoint created automatically, but right on leaders position

gritty escarp
#

I'm using Vcom and for some reason it always makes the AI have their first waypoint to [0,0,0] position, other than that, vcom works wonderfully, I already checked my own patrol script and there are no issues with it, so I'm just trying to figure out a remedy for the symptom

hushed turtle
#

getMarkerPos returns position [0,0,0] when no marker is found

#

So you spawn AI using script anywhere on the map and somehow they get first waypoint at [0,0,0]?

ruby spoke
#

I'm making a police database system, and I want to have a unique ID for every entry. If I do only random(xxx) then there will still be a possibility for multiple entries to have the same unique ID.

gritty escarp
#

while running VCOM yes, it does happen, without it, their waypoints work as intended

#

so the issue is within VCOM, I rather just have a trigger or something scanning that grid every few ticks and delete any waypoint parkers on that area

#

another way would be to go through every single group and check every single waypoint and if the position is [0,0,0], then it deletes it, but its resource intensive and will just kill all performance

queen cargo
#

then why using SQF at all for stuff like that?

#

you already have to use a dll anyway

#

so use a dll for that too

#

100% faster than any SQF scripted function ever can be here

hallow mortar
#

it wouldn't be the most lightweight script in the world but it's not doing that much, and for one run every...30 seconds, say? it'd be fine

#

Alternatively, you could use a groupCreated mission event handler, wait a couple of seconds after it's created and then check if its first waypoint is at [0,0,0]

ruby spoke
#

Okay then, I guess I'll just use the dll on KK's blog. Thanks anyway!

ornate whale
#

Are local (client's) missionNamespace variables saved when the host saves the game in MP?

tough abyss
#

Police database system ?? Life RPG Server ? MySQL Backend?
Just use a database unique key then

queen cargo
#

you mean an autoincrementing index @tough abyss ?

tough abyss
#

Yeah, assuming its getting saved to the backend

queen cargo
#

because there is no such thing like a "unique database key"

#

at least not as type

tough abyss
#

You can have unique keys & have it auto increment ๐Ÿ˜› you know what i meant

sharp grotto
radiant lark
#

How exactly do I make my game know the difference between fall damage and glitched-in-wall damage. And apply fall damage but not glitched-in-wall one?

radiant lark
drifting badge
#

The following works nicely, selecting the first 8 units from the "_CurrentGroup" group array:

} forEach (units _CurrentGroup select [0,9]);

...but for the life of me I can not figure out how to get odd specific units out of the group, like for example the 3rd, the 5th and the 9th of that group array - should that not be possible with select and the index number?

} forEach (units _CurrentGroup [_this select 2, _this select 4, _this select 8]);

Tried it with the above and some iterations of it, but there has to be some mistake I am making, as it is just not working.

tulip ridge
#

Well that second one doesn't make sense, but you can just check the index in the forEach itself

{
    // Starts at 0, so even index is odd unit number, while odd index is even
    if (_forEachIndex % 2 != 0) then { continue };
    // ...
} forEach (units _currentGroup);

-# (Side note that it may be faster to filter units _currentGroup with selcet before the forEach)

drifting badge
#

my bad I think I have badly explained what I am trying to do (should get some sleep), I have a group of about 18 soldiers, and I am trying to use the forEach in combination with "select" to pick out specific guys, like the guys at position 4 and position 17 in that group array to do something

fair drum
#

are they always going to be in those positions or will you need some other identifier than just array position?

tulip ridge
#

Oh if you have known indexes you can just grab those specifically

private _currentUnits = units _currentGroup;
private ["_unit"]; // only creates the _unit variable once for the whole loop
{
    _unit = _currentUnits select _x;
} forEach [3, 16]; // or whatever you'd like
#

I'm not sure if unit order is consistent between loads though, not something I ever messed with

drifting badge
#

they will always be in that position so to speak, that is why I thought that array and select index should work, but I always get an error if I try to do forEach select 5, select 8, select 13 to get the desired guys

tulip ridge
#

Well the syntax is just wrong, the way you'd do that would be like:

private _units = units _currentGroup;
{
} forEach [
    _units select 5,
    _units select 8,
    _units select 13
];

But it's longer

drifting badge
#

Oh boy so I was really wrong there (thought it would be something like the array select "from to" thing that I mentioned and that indeed works, The code for the specific units to do something goes between the {...} I assume. Really looks different from what I expected (thanks for showing both versions, the longer one helps to understand things easier).

Much appreciated mate! And thanks to both of you for your help.

meager granite
#

Dart's version is much better since its all inline

drifting badge
#

oh that is interesting too as this is more like I thought it would look/work - but would never have figured out to utilize "call"!

#

feel like an microbe among giants ;)

meager granite
#

Figured out how to script trigger new 82mm illumination flares

#
deleteVehicle f;
f = createVehicle ["Flare_82mm_AMOS_White_Illumination", player modelToWorld [0,300,300], [], 0, ""];
triggerAmmo f;
f spawn {
    _this setVelocity [0,0,-3]; // Can't set velocity on same frame
}
#

not sure where this initial 1 second of sleep comes from, couldn't find it in config

meager granite
granite sky
#

Arming distance maybe.

meager granite
#

It has no velocity and float in the air though

#

Nevermind this delay is not needed, I guess I messed something up with my velocity tests originally

#

Simplified the script

fair drum
#

do dedi servers have a profile name space as well as the server namespace?

meager granite
#

Yes

#

and mission profile namespace

radiant lark
#

Can you override vanilla functions on arma? Functions such as setPos

#

I want to dig deep into how I could monitor and โ€œpatchโ€ setPos to prevent cheating

nocturne bluff
#

Yes he does.

#

But hes trying to make himself look smart.

warm hedge
#

It is a command not function, and no, that's not what we can

radiant lark
#

Yeah command sorry

radiant lark
fair drum
#

what are you running into as far as cheating goes?

radiant lark
#

If I happen to want to disable setPos in cfgDisabledCommands will it mess up the game?

fair drum
#

depends, are you running setPos on any client sided scripts?

radiant lark
radiant lark
#

But maybe arma uses it

#

Same with allPlayers etc

#

If it were for me Iโ€™d have banned most commands

#

Uh oh the wiki.. `Reminder
Once again, consider carefully what commands you want to disable and verify that disabling is not interfering with default functionality of the game. Don't forget to check .rpt file to avoid any confusion in the future.

`

fair drum
#

i mean, @meager granite can probably give you more on it due to KOTH, but cheaters still get through there too. you just need good moderation

radiant lark
#

Hardcore cheaters try to go there

#

I got told BE filters can do the job but they look ugly ๐Ÿ˜‚

fair drum
#

i mean sure? any popular pvp game mode that is public you'll have them.

#

pve it doesn't really matter

meager granite
#

Its true that real anti-cheater protection is moderation

fair drum
#

if you aren't doing any hive based stuff like he does, you can just ban and reset the match

meager granite
#

There are tons of ways to teleport and setPos is just a bit of it

radiant lark
#

I just wanna get to the point where the MOST a cheater can do is just Aimbot and ESP

#

Then I will just do anticheat extension

meager granite
#

Also most advanced cheats don't even touch SQF directly, they form network messages themselves and you can't detect that unless these messages are logged by BE and only some are logged

radiant lark
fair drum
#

just get some moderators and pay them for their time. always gonna get cheaters. its why as I've gotten older, I've kinda moved away from pvp games and more to pve/coop/singleplayer games. its only getting worse as time goes on. I think gaming in general is losing the fight against them (and instead, are messing with the kernal which doesn't even stop the more advanced cheaters, just giving up control/data to your pc for free).

queen cargo
#

not rly @nocturne bluff
but there are many misconceptions of this in the overall (not only arma) modding scene

#

if i would want to look smart i would first ask which database backend and then use the correct terms for the specific stuff there

#

because index is also no real datatype

#

correct one would be eg. INT

dusk gust
#

Always going to be cat and mouse with cheating tbh

sharp grotto
drifting badge
#

while testing today I noticed that I forgot to take "killed" units in the group into account when using "forEach (units _group etc.)", is there any way (except of course specifically naming units in Eden) to keep "dead" guys in their group position? I.e. like it is with player lead groups where if you have 6 guys, they will always be selectable by F2 -> F7, even is they get killed as their "spot" is not filled (unless you have new units join the group). I would like it to be this way for AI lead groups too, so if I use "select 3" in the AI group array, and that guy at select 3 is dead, that it does not select a different guy but just skips this one. Hope that made sense?

Also is there any real way to reorder a (player) group? So you do not have "empty F(number)" spots? Is to ungroup and to regroup everyone the only way?

broken pivot
#

**# Hello everybody ** Im looking for a way to transfer Zeus compositions to Eden Editor (dont know if this is correct place for post)

Ive got a 6years old Liberation FoB wich I would like to move to the Editor. All I can do is to create
a composition that I couldnt use in the editor... Is there a known way?

still forum
#

Zeus compositions are just groups, which should be available in Eden Editor under the groups tab already

broken pivot
#

Ive tried to find them but didnt managed to success..
Are there cases in that compositions cant be saved: Like attached Liberation Scripts
-> yes Ive also checked the "Own" tab

delicate tangle
#

The sector tactics module creates an eventhandler that fires when a sector is captured. How can I tie into/use that eventhandler in a separate script

tulip ridge
#

Wrong channel, and you can't pay someone to import something. It's against eula

broken pivot
#

.#Eisenschmiede greets.

drifting badge
#

Is there any way to disallow players to open/access backpacks/vests from friendly or enemy AIs when close to them (and they are not dead)? I vaguely remember this was possible but a search turned up nothing?

broken pivot
#

Its a straight server setting. Idk exact but I think that its something with difficulty
NOT SURE!!!

thin fox
drifting badge
#

it is weird as I seem to recall that access was not possible on alive AIs (but could be that I am mixing this up with the OPF days)...

thin fox
drifting badge
drifting badge
#

@broken pivot -> did you look under "custom"? (I also always have to search for where the compositions are

broken pivot
#

Yes

#

Its empty

#

Ive tried with the Liberation FoB and with some vanilla buildings, nothing shows up...

drifting badge
#

that is weird, did you try placing one or two objects and just save a new custom composition just to see it it shows up?

broken pivot
#

Yes

#

Thats what Ive did with the vanilla buildings

thin fox
#

@broken pivot I know that liberation has a fob export for enemy fobs (secondary objectives), maybe you can tweak the code to get your fob

broken pivot
#

Could it be that its because Im using another profile because the liberation is safing on server client profile wich I had to import

broken pivot
drifting badge
#

that might be it - check in your second ARMA3 profile, the composition might be there!

broken pivot
#

Ill check all of the profiles... Just lemme fin the current Altis rework step

#

My hud went through supersize me but wont show up any composition

bold blade
#

Hello everyone. I'm new here. I have an issue with a script. It is not mine, but It is bugged and i intend to fix it. However i am not sure how to properly implement a fix.

#

I cannot seem to be able to pinpoint exactly what string of code makes it break.

#

It is a script that governs suprressing fire.
An invisible object is spawned at the suspected enemy position, then the squad leader will command his units to fire at it for a set number of seconds, so to suppress the enemy.

This works fine for the most part until the enemy is too close or is hidden behind certain objects.

At that point the invisible object is spawned in the air, making units fire at the sky.

#

This is the code.
Please take a look if you can, and tell me if there is a value that must be changed so my soldiers stop shooting at the sky:

fleet sand
bold blade
fleet sand
bold blade
#

A2. but as i said i am quite sure this would work on a3 technically

fleet sand
# bold blade A2. but as i said i am quite sure this would work on a3 technically

This would need rewrite for arma 3 example configfile command:

getNumber (configFile/"CfgVehicles"/typeof (leader _group)/"zeu_Exclude")"

It would need to be like:

getNumber (configFile >> "CfgVehicles" >> typeof (leader _group) >> "zeu_Exclude")

If you are playing Arma 3 with mods like Zeus Enhanced just use their fnc:
https://github.com/zen-mod/ZEN/blob/master/addons/ai/functions/fnc_suppressiveFire.sqf

GitHub

Zeus enhancement mod for Arma 3. Contribute to zen-mod/ZEN development by creating an account on GitHub.

bold blade
#

It's called Zeus but it has nothing to do with Zeus the gamemode, let us be clear

#

my issue is that the soldiers shoot at the sky

#

do you think you would be able to pinpoint why this happens by looking at the code?

fleet sand
bold blade
#

I understand. I can't do that unfortunately, i am not good enough with scripting to rewrite something like this. Also this is linked with other parts of the mod. I can only limit myself to making small modifications i fear

bold blade
tulip ridge
granite sky
sharp grotto
#

The whole internet is coolfrog

granite sky
#

The target position code is just this:

            if( vehicle _tgt isKindOf "man" ) then {
                _pos setPosATL [(_ally getHideFrom vehicle _tgt) select 0, (_ally getHideFrom vehicle _tgt) select 1, ((_ally getHideFrom vehicle _tgt) select 2) +0.7];
            } else {
                _pos setPosATL [(_ally getHideFrom vehicle _tgt) select 0, (_ally getHideFrom vehicle _tgt) select 1, ((_ally getHideFrom vehicle _tgt) select 2) +2];
            };
#

So it's intentionally shooting above the target. If you don't want it to do that then you could just remove the z-axis additions.

bold blade
#

I did notice this at first but, i thought, surely this wouldn't make my guys shoot at the sky
thinking about it, at close ranges it probably does

granite sky
#

yeah the other option would be to scale the offset with distance.

#

0.01 * distance2d or something like that.

bold blade
#

i'll consider it if i have other issues after deleting the z axis additions

#

speaking of which

#

do you think this would make the suppressing squad shoot at a wall in front of them instead? if the target is behind them

#

well i'll try it first then i'll come back here if it happens

loud venture
#

Hey guys. Forgive me because I do not know any scripting but I am trying to use ChatGPT to develop a script for Drongos Map Population mod. The goal is to despawn and cache units as the players leave the area and I kept getting the same message "scripts/dmp_unitCache.sqf not found". I then isolated that script and I am still getting the same error. For some reason this sqf file cannot be found. I have put it in a "scripts" folder and called on it through the .init file but nothing happens. I will post below for reference

#

// initServer.sqf

// Restore cached groups on mission start
[] execVM "scripts\persist_cache.sqf";

// Start monitoring for newly spawned DMP groups
[] execVM "scripts\monitor_dmpGroups.sqf";

granite sky
#

You don't call scripts/dmp_unitCache.sqf there.

loud venture
#

Okay. Where do I call it from?

#

I have tried in the init.sqf as well and it didnโ€™t work

hallow mortar
# loud venture Okay. Where do I call it from?

John's not saying "you shouldn't", it's a statement of fact that you currently don't. The error is saying that dmp_unitCache.sqf can't be found - but the code you posted is only trying to call persist_cache.sqf and monitor_dmpGroups.sqf, not dmp_unitCache.sqf. That means you have some other code somewhere else that is trying to call dmp_unitCache.sqf, and that's where the problem is.

#

You shouldn't use ChatGPT, for anything, but especially for SQF scripting. Large Language Models like ChatGPT rely on having an extensive body of high-quality training data to be anywhere near useful, and there is no such body of data for SQF. With good data, LLMs are still prone to hallucinations, inconsistencies, and mistakes; without it, they get much worse. SQF also relies on a lot of things that you need to actually play Arma to understand, which LLMs obviously can't do.

loud venture
#

I see.Yeah, thatโ€™s what I was afraid of. I believe it calls for it in the monitor_dmpGroups.sqf and the persist file.

#

Is there any scripts out there that are assembled already for unit caching with persistence built in. I would like to add something to Drongos Map Population to respawn units like ALIVE does because it drags the server if we move into multiple areas

#

His mod already spawns when players get within a certain distance but they donโ€™t respawn. He has a module for unit caching I believe and it helps but not as much as despawning them does

granite sky
#

Persistence is generally hard logic and not the sort of thing that you can approach with chatGPT.

#

You need a plan and understanding of the language.

bleak gulch
#

Can somebody drop the link on compiled rpmalloc-v145.dll for Windows x64. DM if you have some.

loud venture
#

Gotcha. Thanks for info

split ruin
#

any global way to disable face gear for enemies?

hallow mortar
#
{
  removeGoggles _x;
} forEach units east // west, independent```
split ruin
#

gives "missing ]" typo, I cannot find where the error is ๐Ÿค”


KIB_specOps = [
                "B_Soldier_SL_F",
                "B_soldier_LAT2_F",
                "B_soldier_AR_F",
                "B_Soldier_GL_F",
                "B_soldier_AA_F",
                "B_HeavyGunner_F",
                "B_soldier_LAT_F",
                "B_Sharpshooter_F",
                "B_soldier_M_F"
              ];
publicVariable "KIB_specOps";

//Infantry units array
KIB_infUnits = [
                "B_Soldier_SL_F",
                "B_soldier_LAT2_F",
                "B_soldier_AR_F",
                "B_Soldier_GL_F",
                "B_soldier_AA_F",
                "B_HeavyGunner_F",
                "B_soldier_LAT_F",
                "B_Sharpshooter_F",
                "B_soldier_M_F"
                ];
publicVariable "KIB_infUnits";

//Static weapons array
KIB_staticWeapons = [
                        "B_HMG_01_F",
                        "B_HMG_01_high_F"
                        "B_GMG_01_F",
                        "B_GMG_01_high_F",
                        "B_static_AA_F",
                        "B_static_AT_F"
                    ];
publicVariable "KIB_staticWeapons";
//Enemy veh array
KIB_usaVeh = [
                "B_T_APC_Tracked_01_AA_F",
                "B_T_APC_Wheeled_01_cannon_F",
                "B_T_APC_Wheeled_01_atgm_lxWS",
                "B_T_APC_Tracked_01_rcws_F",
                "B_T_AFV_Wheeled_01_up_cannon_F",
                "B_T_MRAP_01_gmg_F",
                "B_T_MRAP_01_hmg_F",
                "B_T_LSV_01_AT_F",
                "B_T_LSV_01_armed_F",
                "B_T_MBT_01_TUSK_F"
             ];
publicVariable "KIB_usaVeh";
warm hedge
#
"B_HMG_01_high_F"```here
stable dune
split ruin
#

@warm hedge , @stable dune thanks, I am blind to this kinds of errors ...

meager granite
#
//Static weapons array
KIB_staticWeapons = [
                         "B_HMG_01_F"
                        ,"B_HMG_01_high_F"
                        ,"B_GMG_01_F"
                        ,"B_GMG_01_high_F"
                        ,"B_static_AA_F"
                        ,"B_static_AT_F"
                    ];
publicVariable "KIB_staticWeapons";
```*This post was made by leading comma gang*
pallid palm
#
//Static weapons array
KIB_staticWeapons = [
    "B_HMG_01_F",
    "B_HMG_01_high_F",
    "B_GMG_01_F",
    "B_GMG_01_high_F",
    "B_static_AA_F",
    "B_static_AT_F"
];
publicVariable "KIB_staticWeapons";
winter rose
#

This post was made by leading comma gang
heretic!

pallid palm
#

hello Mr. Lou Montana

atomic niche
pallid palm
#

ummm huh

winter rose
pallid palm
#

lol hahahaha

#

i got to say guys im having so much fun in Arma 3: cuz of all the help i got from all you lovely people in here thx so much guys

#

everything works perfectly and i mean everything

meager granite
# winter rose > This post was made by leading comma gang *heretic!*
    private _kill_icon = if(_this get "is_vehicle_kill") then {
        format ["<img image='%1'%2/>"
            ,getText(configFile >> "CfgVehicles" >> _this get "killer_vehicle_class" >> "picture")
            ,if(_is_dark_font) then {
                " shadow=1 color='#222222' shadowColor='#aaaaaa' shadowOffset=0"
            } else {
                " shadow=1 shadowColor='#000000' shadowOffset=0"
            }
        ];
    } else {
        [
             getText(configFile >> "CfgMagazines" >> _this get "killer_magazine" >> "picture")
            ,getText(configFile >> "CfgWeapons" >> _this get "killer_weapon" >> "picture")
        ] select {_x != ""} apply {
            format ["<img image='%1'%2/>"
                ,_x
                ,format [" shadow=2 size='%1'", KILLFEED_LINE_OVERSIZE]
            ];
        } joinString " "
    };
pallid palm
#

lol