#arma3_scripting

1 messages ยท Page 124 of 1

cosmic lichen
#

use vectorAdd

polar belfry
#

to what _pos?

cosmic lichen
#

_missile setPosASLW (_pos vectorAdd [0, 0, 45]) ; should do the trick

polar belfry
#
if (( getposasl sub) select 2>=-3) then{  
      private _pos = launch modelToWorld [0,2,1.6];  
      private _missile = createVehicle ["ammo_Missile_Cruise_01", [0,0,0], [], 0, "none"];      
      _missile enableSimulation true;      
      _missile setPosASLW _pos;      
      _missile setVectorDirAndUp [[0,0,1], [1,0,0]];}  
 else{ private _pos = launch modelToWorld [0,2,1.6];  
      private _missile = createVehicle ["ammo_Missile_Cruise_01", [0,0,0], [], 0, "none"];
      _missile setPosASLW (_pos vectorAdd [0, 0, 45]);
      _missile enableSimulation true;            
      _missile setVectorDirAndUp [[0,0,1], [1,0,0]];  
   } 
cosmic lichen
#

There is a } too many

polar belfry
#

yea fixed it in init

#

my issue is what happens on else. I want the missile to spawn on the water surface rather than on the reference point named launch

cosmic lichen
#
private _pos = launch modelToWorld [0, 2, 1.6];  
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0, 0, 0], [], 0, "none"];      

if ((getPosASL sub) select 2 >= -3) then
{
  _missile setPosASLW _pos;
}
else
{
  _missile setPosASLW (_pos vectorAdd [0, 0, 45]);
};

_missile enableSimulation true;      
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
polar belfry
#

looks nicer let me try it

cosmic lichen
#

It's the same code

#

Just removed the duplicated lines

#

So basically two cases

#

If submarine is submerged, spawn it on the water surface (ASLW = 0)

#

if submariine is above water line, spawn it on the launcher?

polar belfry
#

yes

#

launch is an oil stain attached on the submarine for reference

polar belfry
#

should I try to make it [0,0,0] instead of (_pos vectorAdd [0, 0, 45])

#

no that would spawn it at these cords

cosmic lichen
#

Yeah, that's a bit tricky. There are different position formats involved. I am not doing that too often.

#
private _pos = launch modelToWorld [0, 2, 1.6];  
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0, 0, 0], [], 0, "none"];      

if ((getPosASLW sub) select 2 < 0) then
{
  //Submerged
  _pos set [2, 0];
  _missile setPosASLW AGLtoASL _pos;
}
else
{
  _missile setPosASLW AGLtoASL (_pos vectorAdd [0, 0, 45]);
};

_missile enableSimulation true;      
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
polar belfry
#

yes

cosmic lichen
#
sub = vehicle player;
sub allowDamage false;

private _pos = sub modelToWorld [0, 2, 1.6];
private _submergeThreshold = -1;

//private _pos = launch modelToWorld [0, 2, 1.6];
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0, 0, 0], [], 0, "none"];

if ((getPosASLW sub) select 2 < _submergeThreshold) then
{
  //Submerged
  _pos set [2, 2];
  _missile setPosASLW AGLtoASL _pos;
}
else
{
  _missile setPosASLW AGLtoASL (_pos vectorAdd [0, 0, 45]);
};

_missile enableSimulation true;
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
#

This seems to work.

#

So highest is -3?

#

Then you need to adjust _subMergeThreshhold

polar belfry
#

I mean when on surface it says -3 under the speed

#

ok

cosmic lichen
#

So I'd set it to -4

steep lagoon
#

How do I create custom values? So in a trigger using an if I let the other trigger know that something is true, and if its true trigger activates. If its isnt it wont....

polar belfry
steep lagoon
#

1st trigger:
if (triggerActivated trg7)then {LZ = true;}else{to be added;};
2nd one activation:
LZ = true;

#

and it wont work

polar belfry
#

LZ=true tells him to have an LZ value that's true

#

== is the equality operand

polar belfry
steep lagoon
# polar belfry on second try LZ == true

It works partly now. Everything will work as intended ONLY when the player activates trg7 before performing another action that activates the trigger with if. But if player will activate the trigger with if without activating trg7 before, the text message wont show up.

#

I swear to god that those little things make arma very irritating

#

fuck it. Im not wasting my time on this shi

steep lagoon
#

Is it possible to spawn my own explosions with a line of code?

granite sky
#

It's usually done by spawning ammunition and then detonating it.

steep lagoon
#

Would it be big enough? I just want is for visuall effect and nothing with demage

#

I want it to be big

granite sky
#

That's more custom particle effects, but that's certainly not a one-liner.

steep lagoon
kindred zephyr
#

get a bigger charge usually

#

besides that, particles as Jhon said

molten yacht
#

I'm looking to have custom black bars like the cinematic ones creep up from the outside of the screen for a mission title. Is there any way to animate a cutRSC with like, scale, or moving a pair of them up from the bottom and top of the screen?
The existing cinematic mode function kills access to controls and the bars are too big.

acoustic lichen
#

is there any mod that lets you auto crawl? similar to auto run but for proning and crawling?

worn tusk
#

can you create a while statement that only activates after a certain check?

null = executioner1 spawn {executioner1 dotarget execute1; sleep 1; while {alive chinaman_executed1} do {firingsquad1 action ["useweapon", vehicle executioner1, executioner1,0];}};

I've tried adding a ceck for a certain trigger having been triggered into the while statement check as well as wrapping it in an if statement. My issue is it runs regardless if a trigger has been run or not and I've tried a bunch of different ways to figure out if the trigger has been auto triggering. The trigger isnt triggered but the script is running anyway so the rifleman is shooting as soon as he loads in rather than waiting for the trigger.

Its a scene where a rifleman is shooting at an object embedded in a wall behind their target (Execute1) its a sandbag. In front of it, his target (chinaman_executed1). I've done it this way because they were inaccurate when they tried to actually target the individual npc. Anyway, is there a way I can get this script to not run until the trigger is properly triggered? (Its a scene where the player passes and can witness the execution during an on the rails transport segment.)

#

the script is from a youtube video for setting up an AI firing range

https://www.youtube.com/watch?v=leTXtzhCQXs&t=3s

This is an Arma 3 Eden editor tutorial on how to make an Ai unit shoot at a specific object/target.

Copy & paste the following into the units init:

null = this spawn {_this dotarget t6; sleep 0.5; while {alive t6 and alive _this} do {sleep 4; gl action ["useweapon",vehicle _this,_this,0]; }};

โ€ข Change t6 to what ever you have called the targe...

โ–ถ Play video
cosmic lichen
#

Why not spawn the script with the trigger?

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
hallow mortar
#

What R3vo said (this is what the trigger On Activation field is for); if you really want to use purely scripting outside of triggers, you probably want waitUntil

#

If you use the On Activation field, you don't need waitUntil to wait for the trigger to be activated, because On Activation already takes care of that. That's why I said to use waitUntil if you want to work outside of triggers.

hushed tendon
#

I'm trying to get and keep the relative position and rotation of an object to the origin object, the positioning works fine but I can't get the rotation using vectors to work out right. It's probably just from my lack of understanding vectors but even after 8 hours of re-learning vectors I'm still failing to get this working right.

params ["_originObj","_subjectObj"];

//-- Relative Positioning
private _relPos = _originObj worldToModel getPosATL _subjectObj;

//-- Relative Rotation
private _originVectorDir = vectorDir _originObj;
private _originVectorUp = vectorUp _originObj;
private _subjectVectorDir = vectorDir _subjectObj;
private _subjectVectorUp = vectorUp _subjectObj;
private _diffVectorDir = _originVectorDir vectorDiff _subjectVectorDir;
private _diffVectorUp = _originVectorUp vectorDiff _subjectVectorUp;

while {alive _subjectObj} do {

    //-- Set Relative Pos
    private _newRelPos = _originObj modelToWorld _relPos;
    _subjectObj setPosATL _newRelPos;

    //-- Set Relative Rotation
    private _originVectorDir = vectorDir _originObj;
    private _originVectorUp = vectorUp _originObj;
    private _addVectorDir = _originVectorDir vectorAdd _diffVectorDir;
    private _addVectorUp = _originVectorUp vectorAdd _diffVectorUp;

    _subjectObj setVectorDirAndUp [_addVectorDir,_addVectorUp];

    sleep 0.001;
};
worn tusk
little raptor
#

Also getPosATL does not give an AGL pos

#

You should use getPosWorld/setPosWorld

#

(use ASLtoAGL to convert to AGL)

proven charm
#

what is the first moment when player joins server? like when is the player object valid in server

#

i thought maybe initPlayerServer.sqf but not sure

proven charm
meager granite
proven charm
#

hmm catching the only player via init.sqf

#

but i could do preinit too..

#

thx

real tartan
#

does BIS_fnc_holdActionAdd have hard limit for distance check (50m) ? Can I reduce this distance to custom ( lets say 3m from object ) like with addAction ?

winter rose
#

wiki

hallow mortar
#

It doesn't have a specific distance parameter like addAction, but you can include a distance check as part of the condition, e.g.

"(_target distance _caller < 10) && {alive _target}"```
#

I think it does use addAction somehow internally, so the 50m hard limit is probably still present, but I haven't tested

steep lagoon
#

Is it possible to do a script that will force the AI to wait for the player team to get into helicopter? If I will sync "get in" and "load" waypoints AI just waits for the player and then flies away

molten yacht
#

Maybe the third time will be the charm. Is there any information on how best to display a set of cinematic bars without locking out user controls?

#

They're going to be driving, even a second of lockout could kill a dozen people.

steep lagoon
#

person in vehicle;

#

in a trigger

#

found it

wispy venture
#

What is the -mod= parameter for 1944 spearhead?

#

I only know that vn; is SOG.

wind hedge
#

what is this used for: sqf _unit modelToWorld (velocityModelSpace _unit) ?

#

I found it like this on a script:

_agent setDestination [_target modelToWorld (velocityModelSpace _target),"LEADER PLANNED",true];
winter rose
#

velocity vector?

pulsar bluff
#

whats the best way to get a list of dead vehicles (excluding bodies)

#

allDead - allDeadMen?

#

vehicles select {!alive _x}?

granite sky
#

Large array subtraction can be brutally slow, so the second might be better.

#

Although I don't know if vehicles includes dead vehicles.

grim cliff
#

is it possible to set the _frame number in a BIS_fnc_holdaction?

wind hedge
#

can an attached FSM on a unit be disabled later?
For Example:

_unit execFSM "A3\Modules_F_Tacops\Ambient\CivilianPresence\FSM\behavior.fsm";

During the mission:

if !(isNil {_x getVariable "hasTarget"}) then {_unit execFSM "";};
#

How?

#

I don't even know how to test if it worked, as the civ fsm is so minimalistic

sullen sigil
#

how many units did you test it with

granite sky
#

is that like 10 or 1000

#

ok, that's pretty small.

sullen sigil
#

you could probably do 22 by hand pretty quick lmao

#

test with 1000 alive and 1000 dead

#

ok

#

and

#

test at extreme highs

warm hedge
#

Unrealistic scenario is good to test

sullen sigil
#

not at extreme lows ๐Ÿ˜‚

granite sky
#

300 - 100 is realistic.

#

But if you're using low object counts then it doesn't much matter what you use because it'll be fast enough anyway.

#

sizes?

#

102 - 102?

#

You keep quoting one number without saying what it is. That's meaningless.

sullen sigil
#

1200 alive, 1200 dead
allDead select {!alive vehicle _x} 0.7341 ms
allDead - allDeadMen 9.0621 ms
told you so.

granite sky
#

not dead units?

granite sky
#

Well, arr1-arr2 is O(n^2)

sullen sigil
#

dont use the scheduler

#

unless for some ungodly reason you decide to use allDead - allDeadMen

#

overuse of the scheduler just fucks up mods which actually need to use the scheduler

#

no

#

especially given as when you test it in paused debug menu the game simulation is also paused hmmyes

granite sky
#

I don't think diag_codePerformance gets paused by the scheduler.

sullen sigil
#

well then thats a bit silly isnt it

#

youre testing the performance of your code not your computer

#

what on earth are you on about

#

test your code properly

#

simple as

#

which in this case has proved precisely what john said

#

(almost as if he knows what hes talking about)

#

i dont want to get technical because the point is proven

#

and i dont care

#

take the l from your online internet argument about which number is bigger and move on

#

how many arma mods have you published

#

so you have no quantified experience scripting in arma

#

thus your opinion is null and void

#

take the l and move on

#

and do stop tagging me

#

its incredibly irritating

#

maybe dont try and come and throw your weight around while arguing with experienced scripters

#

just a thought

sullen sigil
#

i dont repeat myself often and im not making an exception for you again

#

stop tagging me

#

dear lord he left over being wrong

#

christ

warm hedge
#

Quite a drama to quit the server or even the game because of one opinion from one person you can't agree

sullen sigil
#

not even an opinion

#

statistically 12x slower for array subtraction

meager granite
#

Just thought about it. If particles can be grabbed into scripting variables, why not make a drop command version that returns the particle?

warm hedge
#

True point actually

meager granite
#

How about:

ENTITY = drop ENTITY

where operand is particle source

#

Might be a hassle to setup a particle source if you need only a single particle though ๐Ÿค”

#

To keep backwards compatibility of drop returning NOTHING there can be new binary command:
ARRAY = NUMBER drop ARRAY

#

NUMBER is number of particles you want dropped this frame
ARRAY operand is particle array
ARRAY return is array of made particles

#

1 drop [...] for a single particle

#

ARRAY = NUMBER drop ENTITY to source particle array from particle source too

#

To avoid creating and sending huge array into the command and then having the engine parse it each and every time

#

could same some microseconds in a long run

#

BUT being able to drop them exactly when you need instead of regular timer that particle source offers

#

Maybe spawn number nad array\source around so its more readable, used right operand in example so its in line with existing command

wind hedge
#

nearEntities in its Syntax 5 form ```sqf
area nearEntities [types, matchExactType, aliveOnly, includeCrew]

Is giving me a "5 elements provided, 3 expected error"
warm hedge
#

What is your code

wind hedge
#

full script: ```sqf
private _inAreaHearing = [_x, _infectedHearingRange, _infectedHearingRange, 1, false];
_potentialTargets = _inAreaHearing nearEntities [["CAManBase","LandVehicle","Dog_Base_F"], false, true, false];

hallow mortar
#

That's labelled as a 2.18 syntax so it may not be available in your build

wind hedge
#

Ohh that's it

#

Will use the old dull versions in the mean time ๐Ÿ˜‰

#

Thanks

proven charm
#

When using remoteExec and JIP do you need to remove previous remoteExecs before making a new one?

#

like I have this code ```sqf
disc = discounts remoteExecCall ["onDiscountsUpdate", _side, true];

#

should I do remoteExecCall ["", disc ]; first ?

warm hedge
#

Remove... what?

proven charm
warm hedge
#

I'm not sure what onDiscoundsUpdate should do but I think just execute locally and let local computers refer to publicVariable'd variable

proven charm
#

Id like to use the current approach

warm hedge
#

Then disable JIP queue and call upon somebody JIPs

proven charm
#

my question simply was will new remoteExecCall JIPs override previous remoteExecCall calls

warm hedge
#

Oh wait yeah, just realized you can actually remove JIP queue

grim cliff
#

is there a way to use modules to fail the mission for OPFOR and succeed the mission for BLUFOR?

warm hedge
#

JIP (Optional, default false):

  • String:
  • else the string is treated as a custom JIP ID and the remoteExec statement is added to the JIP queue, replacing statements that have the same JIP ID
#

I think I can read what you say is true. Need a test to confirn on my end though

warm hedge
grim cliff
warm hedge
#

Don't think your idea is semantically so wrong

grim cliff
#

heres hoping

grim cliff
warm hedge
#

You can actually try to launch multiple clients and call it a test

#

If you need you also launch the game in windowed mode

grim cliff
#

my ol beater doesnt have the ram for that. i only have about a gig free with just arma and discord running.

pulsar bluff
# sullen sigil cc <@794878602494738442>

thanks, I will mainly be iterating over like < 100 dead units and < 25 dead vehicles ... it could spike higher rarely i guess depending if zeus is doing something

#

I wonder if its just better to use an abstracted array from the "entityKilled" mission event

cobalt path
#
[]spawn
{
Sleep 5;
_playerPosition = profileNamespace getVariable ["ptlm_anomaly_position_01", []];
player setPosATL _playerPosition;
};

Is there anything wrong with this? I keep getting* Error 0 elements provided, 3 expected* on the setposatl line.
Earlier in code I have:

while {alive player} do 
{
    Sleep 60;
    profileNamespace setVariable ["ptlm_anomaly_position_01", (getPosATL player)];
    saveProfileNamespace;
    Sleep 60;
};
granite haven
#

you only define it after 60 seconds, but you read it every 5 seconds, and the default value you return is an empty array.

#

should atleast do: [0,0,0]

#

as default return value

#
_playerPosition = profileNamespace getVariable ["ptlm_anomaly_position_01", [0,0,0]];
cobalt path
#

I see, so its only a problem the first time right? it gets fixed after 60 seconds?

granite haven
#

yes

#

you could just do this:

_playerPosition = profileNamespace getVariable ["ptlm_anomaly_position_01", (getPosATL player)];
#

meaning if the var isnt defined you get put back on your position

cobalt path
#

I am sure I stood still for 60s. Respawned, my loadout did change (use exatly the same code, just replaced with getunitloadout. And my loadout was replaced while position wasnt

#

I will test

granite haven
#

the error is bc of the empty array, if something else doesnt work im not sure right away why

cobalt path
#

I think there might be an issue with saving coordinates

wispy venture
#

This is what my host provides me with.

#

If i'd put vn;, it would download the SOG dlc when i start the server.

#

It doesn't seem to do anything with SPE;.

ebon citrus
#

adding

        params ["_unit", "_killer"];
        systemChat format ["%1 has been killed by %2.", _unit, _killer];
    }];``` to the init field of an object, as example from https://community.bistudio.com/wiki/addEventHandler
results in (picture)
#

any ideas?

wispy venture
ebon citrus
#

seems it does not trigger an error when attatched to a unit

wispy venture
#

Try that.

ebon citrus
#

problem exists only when not attaching to a man object or vehicle

#

object in question is a satchel charge

#

SatchelCharge_F

warm hedge
#

Where do you put that

ebon citrus
#

the charge or the script?

wispy venture
#

Me or?

warm hedge
#

The script

ebon citrus
#

in the init-field

#

in 3den

warm hedge
#

Are you sure you're not putting this into group Init?

ebon citrus
#

yes, it states "object init"

wispy venture
#

POLPOX, are you sure its "SPE;"?

ebon citrus
warm hedge
ebon citrus
#

it does, but not in this case

#

Is it because it's a module or something?

warm hedge
warm hedge
ebon citrus
#

might just place a crate close to it and add an explosion eventhandler to that

#

make sure it detonates the satchel too if it gets hit

#

extra fun for players to have to be careful not to get explosions near it

warm hedge
#

It probably could because it is an ammo, not a regular vehicle

rough summit
#

If I want to create a server DLL, do I need to whitelist it in BattlEye?

tender fossil
rough summit
#

Are u sure about magazines player?

#

Try items player

rough summit
cobalt path
#
player addEventHandler ["InventoryClosed",
{
    _items = items player;
    if ("rvg_rice" in magazines _items)
    then {
    player removeMagazines "rvg_rice";
    player addItem "FTAC_CannedDailyMeal";
    };
}];

I am trying to replace food items from Ravage food to ACE food. I am getting an "type string, expected object" error. What am I doing wrong?

sharp grotto
cobalt path
sharp grotto
#

your syntax was also wrong as you can see

#
player addEventHandler ["InventoryClosed",
{
    if ("rvg_rice" in (magazines player)) then 
    {
      player removeMagazines "rvg_rice";
      player addItem "FTAC_CannedDailyMeal";
    };
}];
cobalt path
steep lagoon
#

Is there any other way to force the AI to wait for unit to get into vehicle?

a1 in heli2 && a2 in heli2 && a3 in heli2 && a4 in heli2 && a5 in heli2 && a6 in heli2 && a7 in heli2 && a8 in heli2 && triggerActivated trg7;

This thing works only when everyone will be alive, and if the AI will use 10% of its brain and follow orders. Otherwise whole operation is fucked. Can I do something like this?

little raptor
#

it doesn't check if the AI is using "10% of its brain" tho meowsweats

#

a1 to a8 must be in the same group, in that code I called it "myGroup"

steep lagoon
#

Will try, ty

little raptor
#

well it finds if a unit is alive but not in a vehicle

#

so && is correct

#

(if units is dead or already in vehicle, it skips that unit)

#

so when findIf returns -1, either all units are dead, or all in vehicle

steep lagoon
#

@little raptor thanks. It works perfectly

velvet merlin
#

private _tDir = _playerVehiclePositionVisual vectorFromTo (getPosVisual _obj);

#

Leopard can you tell why this is quite expensive (0.1 ms)

dreamy kestrel
#

Q: are map CONTROL 'draw' EH stackable? I am getting a unique _ehID back, but I wonder whether they are?

reason I ask is, I have a service EH which I register which listens for published shape meta data. basically a client side CRUD operation for shapes, read a shapes dictionary, create new (incoming) shapes, update with newly published changed, or delete the same.

server side is fine, I see the related changes happening and publishing.

however, once the shape is "seen" and created, its own EH is registered as a 'draw' callback, that is the only one that I am seeing. I no longer see the service function in my logs from that point forward.

so I wonder is there a better way to handle publishing "shapes" to the client. I'd like to keep each shape draw EH as atomic as possible, draw just that one shape, and be done with it. without it turning into more of a bloat than it needs to be. but I wonder is that possible considering the log evidence.

thoughts? ๐Ÿง  this is a bit of a kerfuffle, I want to sort it out. thanks...

dreamy kestrel
little raptor
#

i.e. similar to getPos and position

#

not sure what you need it for, but generally speaking, use getPosASLVisual/getPosWorldVisual instead

#

seeing that you're taking vectorFromTo, the only correct position format is ASL for both the start and end vectors

#

because only ASL is absolute. other position formats are relative

little raptor
#

add = stack

#

set = replace (non-stackable)

little raptor
#

which iterates over an array of, well whatever you're drawing, and draws them

#

instead of constantly adding event handlers and removing them

#
if (_map getVariable ["my_EH", -1] >= 0) exitWith {}; // EH is already added. so don't add it again
_EH = _map ctrlAddEventHandler ["Draw", {
  {
    // draw
  } forEach Array_Of_Things;
}];
_map setVariable ["my_EH", _EH]
#

to draw things, simply pushBack to that array. to stop drawing, remove it using deleteAt or -

dreamy kestrel
#

well, that's the thing, the approach is not constantly adding or removing, the shapes in question are a bit more sustained than all that.
but still, point well taken.

dreamy kestrel
little raptor
#

add = stack

#

it is stackable

acoustic lichen
#

where is the official download link for pbo manager?

tall lark
acoustic lichen
#

can u link me the website u got this download?

tall lark
#

i got it saved to my Dserver as a file sorry

little raptor
#

afaik it doesn't have an "official" download link
it used to be hosted on armaholic (and iirc some file sharing site like dropbox)

#

which is down

acoustic lichen
#

soo where does everyone download the pbo manager?

tall lark
#

but its a safe download dude

acoustic lichen
tall lark
#

well its up to you dude

little raptor
dreamy kestrel
#

should it return false for instance, for the "other" EH to be processed?

little raptor
#

no

#

it's hard for me to tell you what's wrong without seeing any code

dreamy kestrel
#

the 'crud' EH picks up the initial shape correctly. which adds an EH for 'just that shape'.
and the shape is drawing correctly in the event registered map CONTROL.
but after that drawing event is registered, I no longer see any of the crud.
all of it logged.

#

so at least from this perspective, I do not think I am doing anything wrong, but the EH are not all being processed, counter to the what wiki docs suggest, reverse order, heck any order, but PROCESS THEM. they are not all processing.

#

however, other EH scenarios, control events, keyboard mouse, etc, where BOOL can be returned to signal event handled, I wonder if that guidance is in effect here as well?

little raptor
#

no

dreamy kestrel
#

then this beggars the question ctrlAddEventHandler what is it doing? because behavior suggests stacking is not the case.

little raptor
#

all I can tell you is that it does stack. you're doing something wrong. hard to say what

dreamy kestrel
#

I'm in delta, will share my vscode

#

if you can spare 30 seconds or 5 min maybe tops to lend your eyes

little raptor
#

I don't have time rn

#

if you want DM me the code and I'll take a look at it tomorrow

dreamy kestrel
#

as it stands right now the last event only is being processed. could be returning a BOOL is the issue, true versus false. will do, thanks for at least being available that way.

eternal spruce
#

Hello everyone, I am an absolute scripting novice and would like if i can get a solution to something i've been working on. While using unitCapture/unitPlay on aircrafts, I've notice whenever I'm replaying the captured data on said vehicle the landing gear doesn't deploy upon approach on the runway or at all it just lands on its belly and if damage is enabled it just explode on impact.

while searching online i found this code that seems to work fine and i added the code in the activation field in a trigger before the runway, how do i make multiple units execute this code without placing multiple triggers?

_plane = (UnitName);
_mis = _plane;
_plane action ["LANDGEAR",_mis];
_mis land "LAND";
_landgear = true;

hallow mortar
#

That code doesn't make a lot of sense. Like you've got UnitName, and then instead of just using that, you're saving it to _plane and to _mis - completely unnecessary. Also, the land command is for ordering helicopter landings. Using it for plane landings is...dubious.
Anyway, what you need is forEach.

{
  _x action ["LANDGEAR",_x];
} forEach [unit1, unit2, ...];```
eternal spruce
#

sorry for my ignorance, I'll run the code you gave me

#

@hallow mortar I got an error saying "On Activation: Missing ["

fair drum
#

you can't just "run" the code he gave you in its current exact, you have to modify it to meet your needs.

eternal spruce
#

yes i changed the vibrable names and i realized the error i was getting was from my mistake i had an extra comma

molten yacht
#

Hey, is there any way to send a hint or a systemchat to a unit name

#

in the same way I'd put funkyTank setdamage 1 I'd love if I could remote-exec to that name only

#

....or can remoteExec just take a unit name as an argument

#

oh balls it can

#

nevermind

#

I'll just hint and target the object(s)

eternal spruce
#

I'm having an issue where the AI controlled aircraft in a unitCapture/unitPlay doesn't lower the landing gear by itself and after using this code in a trigger it works but not how i want it.

{
_x action ["LANDGEAR",_x];
_x land "LAND";
} forEach [F15EAGLE_1D, F15EAGLE_2D];

According to the wiki using the unit action "LandGear" will lower the gear near the ground and that is what i'm currently experiencing after the aircraft touches down on the runway.
https://community.bistudio.com/wiki/Arma_3:_Actions#LandGear

Does anyone know how to solve this from the wiki "In the case of AI-controlled aircraft, it has to be used in an each-frame loop to to override the AI behavior".

nocturne bluff
#

nou

#

Godlike my friend

drifting sky
#

Does anybody know if there is any method to force AI groups to plan more direct paths toward an objective?

Any method other than giving them lots of waypoints forming a trail toward the objective, which doesn't seem to work very well anyway.

errant iron
#

use one of the existing AI

#

oh oops thought i was talking to my partner

#

well while im here, what's a good way to define 3D areas in the eden editor that can easily be referenced by scripts? I usually use markers with inArea(Array) but those are a bit inconvenient, having to view in map and also include a manual check for AGL height...

To be more specific, I have one use case where a spawned, server-side script handles checking if a certain set of units are inside a prison area (defined as any marker prefixed with SHZ_prison), but my buddy's also planning to have a "decontamination process" where players walk through several triggers to decon their vehicle and then themselves. I think for the decon we could get by with having this && {player in thisList} in the trigger condition, but I'm curious if I can just have the areas to reference without actually using the trigger activation (and preferably not require hardcoding variable names).

hallow mortar
tender sable
# drifting sky Does anybody know if there is any method to force AI groups to plan more direct ...

How far is the objective? In my experience, and someone could say I'm wrong on this but... if it's past a certain distance (maybe view distance?) it will only pathfind up until that distance and continuously replan on the move making the ai take really suboptimal paths. Best way is to set waypoints about every few kms or so. If your obj is closer than 2-3k maybe adjust combat mode and behavior to suit the desired effect. The alternative is heavy scripting unfortunately.

drifting sky
drifting sky
#

They're trying to go AROUND beaten zones, I'm pretty sure.

#

however, in a long game, everything is a beaten zone, so they'll take extremely long routes around to an objecive. Sometimes going 2 or 3 km in the wrong direction.

tender sable
#

That seems like something else on top of vanilla AI. Running mods?

drifting sky
#

There's nothing that should affect their planning. The problems gets worse the longer the mission lasts.

And when I say they're going out of their way, they go WAY out of their way. Also, higher skilled AI, such as snipers, seem to be affected more severely. I've seen sniper led AI groups take like 30 minutes to travel 100m closer to the objective, with no enemies anywhere in sight. They're constantly moving, but ineffectively, going back and forth but not closer to the objective.

tender sable
#

I'd definitely look into what your running because default ai doesn't do this. I'd ask the discord or whomever developed the game mode your running.

vagrant skiff
#

does anyone know if there is a way to make an event handler apply to a side as opposed to a unit? I'm trying to make it so a notification pops up when a civilian is killed. There's a mod I would normally use for this but unfortunately the mod is outdated

proven charm
queen junco
#

Hi, I am trying to get a playSound3D working. The sound it shall play originates in a mod. I figured I need to use the absolute path to the file. But I am not sure how to use that with the playSound3D command. When I just put the path as the filename no sound appears.
I also tried using a default arma sound with absolute Path, doesn't work either. What am I doing wrong here?

playSound3D ["C:\Program Files\Steam\steamapps\common\Arma 3\Addons\A3\Sounds_F\sfx\alarm_independent.wss", player];
warm hedge
#
playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss",player]```does the thing pretty finely?
#

Not sure why/where you got the clue to use that kind of path

queen junco
#

because If I want to use it with a mod it doesnt work...
and only using the relative path from the mod doesnt work either
therefor I tried getting the absolute path to work

playSound3D ["C:\Program Files\Steam\steamapps\common\Arma 3\!Workshop\@Dog\addons\MFR_Dogs\sounds\DogBark_01.OGG", player];

playSound3D ["MFR_Dogs\sounds\DogBark_01.OGG", player];
warm hedge
#

I don't recall if an OGG can work with it, but in the first place, Arma 3 does not going to find any file that is not located in any loaded PBOs (well basically) so that kind of absolute path is simply invalid

#

Make sure your Mod you're trying to look up has the file PBOPREFIX MFR_Dogs

queen junco
#

according to the wiki an .OGG should be fine with the playSound3D and the mod is packed into a .pbo called MFR_Dogs

warm hedge
#

PBO name is not always equal to PBOPREFIX

queen junco
#

what is the PBOPREFIX then exactly?

#

or rather how do I figure out what the PREFIX is?

warm hedge
#

PBOPREFIX is the prefix/address where the PBO should be located in Arma 3 internally

sharp grotto
#

OGG also works

playSound3D ["RW_assets\sfx\metalclose.ogg", player, false, getPosASL _container, 2, 1, 25];```
warm hedge
#

e.g. Arma 3\Addons\3den.pbo has a3\3den PREFIX, note that it has a3\

#

Who packed MFR_Dogs? Is that yours? If so what software you use to pack?

queen junco
#

No, it is a mod from the workshop I am writing some scripts with

#

But I can just try contacting the creator if there is no other way to find out the prefix

warm hedge
#

One way is to just check the PBO with a text editor or binary editor like Bz

sharp grotto
#

Isn't it always the pbo name ?

warm hedge
#

No

warm hedge
sharp grotto
#

At least for mods thats my experience

warm hedge
#

Some PBO related software can look it up too... like Eliteness or something

queen junco
#

well, already helped alot, thx ^^

warm hedge
#

Official or Mods makes no difference

#

This is what it looks in Bz, the very first lines clearly declares the PREFIX

vagrant skiff
#

so with this script it gives a hint when a player kills a civilian

{
params ["_unit", "_killer", "_instigator", "_useEffects"];
if((side (group _unit)) == civilian) then
{
 hint parseText format ["A Civilian Was Killed By <br /><t color='#c1000b' size='1'>%1</t>",name _killer];
};

}];```
however, if something such as a zeus lighting bolt kills a civilian it displays "Error: No vehicle" where the player name would normally go, is there a way to stop it from displaying the hint if it has the error?
#

I've tried to do


addMissionEventHandler ["EntityKilled",
{
params ["_unit", "_killer", "_instigator", "_useEffects"];
if((side (group _unit)) == civilian) then
{
 if (_killer != _error) then hint parseText format ["A Civilian Was Killed By <br /><t color='#c1000b' size='1'>%1</t>",name _killer];
};

}];```
but it didn't work
warm hedge
#

That means _killer is null

#

So just check isNull _killer

vagrant skiff
#

thanks, I was able to get it working by doing

} else {
 hint parseText format ["A Civilian Was Killed By <br /><t color='#c1000b' size='1'>%1</t>",name _killer];
}```
queen junco
warm hedge
queen junco
#

yea, returns empty

warm hedge
#

What is the code you've run

queen junco
#
diag_log str addonFiles ["MFR_Dogs", ".OGG"];

however as there are subfolders I am not too sure how that behaves

warm hedge
#

Try without extensions

queen junco
#

diag_log str addonFiles ["MFR_Dogs"];
still returns empty
12:15:56 "[]"

warm hedge
#

How about sqf addonFiles ["MFR_Dogs\"];Instead

queen junco
#

ahh, my bad. Yea seems to work now

queen junco
#

Could this be an error on the mod-dev side?

warm hedge
#

Maybe maybe not

#

Probably simply because your code is somewhat wrong could be a reason too

hallow mortar
#

In description.ext cfgSounds, the file path has to be prefixed with @ to use things in addons. Maybe that's the same here?

warm hedge
#

No, that shouldn't be a thing. At least I haven't seen such

hallow mortar
queen junco
#

Well, apparently sometimes it can be such a stupid mistake as missing an underscore. Sorry to have wasted your time...
At least I learned a few new things

#

Still thanks a lot for your help

velvet merlin
#

is there a script/function from BI/A3 or 3rd party to export cfgVehicle code to rpt with the correct inheritance setup (turrets etc)

proven charm
velvet merlin
#

basically you need to get all parents, and recreate in reverse order with the correct turret setup

graceful dew
#

Running into an issue with my FFV turrets where when preparing a grenade through advanced throw, the player is blocked from throwing. Am I missing something in my conifg or is there a way to enable it via scripting?

#

nvm, ace_advanced_throwing_fnc_canThrow is the function returning false so there is something else causing an intersection

polar belfry
#

Is there a way to jack up the volume for playsound3d

hallow mortar
#

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

Syntax:
playSound3D [filename, soundSource, isInside, soundPosition, volume, soundPitch, distance, offset, local]

volume: Number - (Optional, default 1) sound volume. A value greater than 5 gets capped

polar belfry
#

So what would I put to isinside and soundposition as default values

hallow mortar
polar belfry
#

Ok thanks

hallow mortar
#

I'm not actually a wiki repost bot btw

polar belfry
#

I know, you have helped me in the past

#

By providing advice and helping me with code

hallow mortar
#

Today's advice is "when I answer with a link, it's because the link contains helpful and relevant information, and you should read it"

forest perch
#

Would anyone be able to point me in the right direction. I want to have one central arsenal, but inside that arsneal are limited items and only specific slots can get specific items

for example:

Machinegunner, can be the only one to pull out machine guns
Aviators, are the only ones who can pull out flight suits and flight helmets
Engineers, are the only ones who can pull out mine detectors and explosives

queen cargo
#

just some random question @grizzled cliff
how does the SQF VM works?
always thought it was a stack ==> parallel access bad

cobalt path
#

Is there a setDir command, but for different axis?

meager granite
dreamy kestrel
little raptor
#

and I don't see anything in the game code

#

ah nvm it does have bool return

#

yet it's not even documented...

#

looks like a bug

#

will be fixed in the next game version

vagrant skiff
#

I'm trying to use this script to have a helicopter move to a spot (pad2) and then land, but they just end up hovering over pad2. I'm pretty sure this should work because it's pretty much the code in the wiki page for the land command. If anyone can see what I've done wrong it would be appreciated. pad2 is an invisible helipad.

sleep 5;
while { alive HeliPilot && not unitReady HeliPilot } do
{
    sleep 1;
};

if (alive HeliPilot) then
{
    HeliPilot land "LAND";
};```
granite sky
#

Maybe check if it's getting to the second step?

vagrant skiff
#

I think the problem is that it can't fully get to pad2 so it cant mark the move as being done. Problem is I'm not sure how to fix that, I tried making it move to a helper above where it's supposed to land but it stopped before getting to the helper

turbid marsh
dreamy kestrel
drifting sky
#

Has anybody solved the problem of getting an AI unit to immediately move to a new location, regardless of the circumstances?

It seems like the best I can do is to use playactionnow to make them immediately get up and run, but that only seems to work some of the time. The rest of the time, they just run in place.

molten yacht
#

Hey, is there a setting that controls how fast the server switches missions? Every time we end a mission it goes back to our default training range before anyone can read the ending description

analog mulch
#

Anyway flags can be held by the player as an item like a small flag pole and then placed on the ground?

#

if that's not possible, how to maybe set an action where if the player is in a specific location they use the scroll whel to spawn a flag, signaling friendlies took over the area?

granite sky
#

setSpeedMode "FULL" is the speed one

#

IIRC one of "TARGET" or "AUTOTARGET" was important.

#

(disableAI)

drifting sky
# granite sky setSpeedMode "FULL" is the speed one

setSpeedMode seems to be for groups only. I'm talking about causing a single unit in a group to move to a new location, and to do it with the minimum possible delay.

I've tried all of these in various combinations, and all together, without the desired effect:

            _unit disableAI "AUTOTARGET";
            _unit disableAI "FSM";
            _unit disableAI "COVER";
            _unit disableAI "SUPPRESSION";
            _unit disableAI "AUTOCOMBAT";
            _unit forgetTarget _caused_by;
            _unit setunitCombatMode "BLUE";
            _unit setCombatBehaviour "CARELESS";
            _unit forcespeed 100;
            _unit enableStamina false;

            
            _unit domove _cover_pos;
            _unit setDestination [_cover_pos, "DoNotPlan", true];
            _unit setdir (_unit getdir _cover_pos);
            _unit dowatch _cover_pos;    ```

The only thing that actually (sometimes but not reliably) causes them to immediately start moving is:

```_unit playactionnow "FastF";```

I've made sure that _cover_pos is a place that is in the unit's line of sight, and that it isn't colliding with anything by first using setvehicleposition to position an object approximately near the _cover_pos, using the create vehicle algorithm.
granite sky
#

What do they do?

drifting sky
#

they don't cause the unit to move quickly

gray bramble
#

What we saw back in ToJ was that the engine is not thread-safe, so if it's called by multiple threads bad things would happen sooner rather than later.

drifting sky
#

if they move at all

#

usually they don't move at all

#

except if i playanimationnow that is

granite sky
#

You might need to group-switch them. Some behaviour depends on group behaviour rather than unit behaviour.

drifting sky
#

tried that, it had no effect on the problem.

gray bramble
#

Given how deep (and costly) a change that would take to fix, I assume this is still true.

granite sky
#

uh, you haven't managed to make a unit move directly to a point even in its own group?

drifting sky
#

it doesn't seem to ever want to move directly to a position. Not while in combat anyway.

#

the only way i've been able to get it to move successfully is with playactionnow to force the FastF running animation.

#

but that only works about 60% of the time. The rest of the time they just run in place .... as if there's an invisible wall blocking their movement.

queen cargo
#

well, if the engine still is stack based then that is simply bad by concept
you cannot operate on the same stack in parallel

gray bramble
#

Not seeing where any stacks at all come into it. Two threads calling even semi-related functions can conflict in "undefined behavior" ways when not explicitly synchronized.

molten yacht
#

Is there any function to gather all tasks in the mission into a list

#

Including ones that aren't assigned to any units

queen cargo
#

not 100% true

#

it depends

gray bramble
#

Given that they operate on same data - i.e. game engine state

queen cargo
#

exactly

#

and even then

fair drum
#

nope, just keep track of your tasks ๐Ÿคท

queen cargo
#

reading is fine

#

writing will cause trouble

gray bramble
#

I remember making a toj background thread that called diag_log in a loop, crashing the game in minutes at most.

#

And you have the same problem when someone else may be writing, especially if they are not using memory barriers.

queen cargo
#

you should be fine when somebody is writing

#

however, you might end up with a value which is not correct anymore which does indeed is a problem

#

eg. having a 0xFFFFFFFF in memory and somebody changes it to a 0x00000000
you could end up with a 0xFFFF0000 in your reading

#

which then would cause trouble itself again

#

meh ... i rly should get back to work

molten yacht
#

Weird, but okay

#

hm

#

looking at the code there's no central reporting for tasks ๐Ÿค”

#

I'd almost expect them to be registered in an array somewhere

granite sky
#

They would be. It's just not exposed in an SQF command.

meager granite
#

Sometimes I wish for STRING select NUMBER so you can quickly select just a single character without building an array for STRING select ARRAY. Muh microseconds moment again.

#
"#fall" select 0 == "#"
ivory lake
#

cant you use syntax 4 of select?

#

like

"#fall" select [0,1] == "#"
meager granite
#

yeah, didn't want to build an array just to get one symbol

ivory lake
#

ah thats what you meant by that I thought you meant splitString

molten yacht
# granite sky They would be. It's just not exposed in an SQF command.

Yeah, I wish there was some way to find it. I'm reduced to trying things like

private _allTaskMakers = [];
{
if (typeOf _x == "ModuleTaskSetState_F") then {
private _taskState = [(_x getVariable ["ID","NoID"]),(_x getVariable ["state","None"]),(_x getVariable ["Title","None"])];
_allTaskMakers append [_taskState];
}; } forEach units sideLogic;

#

Troublingly, even though someTaskModule getVariable["id","none"]; works, this way of doing it doesn't.

#

I feel like there's some way of getting more direct references to the modules that would make it work but I'm too sleepy to remember it

#

I'm like, touching the group references instead of the objects themselves

granite sky
#

I don't see what doesn't work there.

#

Is units sideLogic select { typeof _x == "ModuleTaskSetState_F" } not picking up some tasks?

molten yacht
#

No, they're all picking up

#

It's just not grabbing the task's ID

#

returns noID instead for all of them

#

I think maybe there's some fuckery with taskIDs vs variableName

#

Using the eden variable viewer, I'm interested to find that all tasks are @taskThisOrThat including tasks with no assigned task ID, which are instead like @task4018234

#

and these each have child variables, .0 through .11

#

....Oh, I'm dummy. Hang on.

#

Remember how I was tired? It should have been looking for ModuleTaskCreate, not SetState.

cosmic lichen
#

Does anyone know a way to disable the map view which shows the hierarchy when clicking on an ORBAT icon?

shut reef
#

So... I've no idea why it does that, but if you do loadConfig "mission.sqm" during a main menu background scene in CWR II and SOG:PF, it crashes arma (Access Violation) with no hint in the logfiles as to why. In fact it does not even print diag_log entries in the file that calls loadConfig, nor the file calling it.
During SP and MP sessions, it seems fine. Haven't actually verified that the code runs there, actually, but it's fine during the regular Altis background scene. Crashes when SOG:PF or CWR II are loaded.

meager granite
#

What compatibleMagazines does exactly? I noticed it fires Warning Message: Error: creating weapon launch_Titan_base with scope=private when used on an illegal weapon, does it actually create the weapon somewhere? Any overhead to this? I plan to walk through all weapons and get magazines for all weapon-muzzle combinations to precache stuff.

#

By overhead I mean some network traffic, some weapon instance stuck in limbo/memory forever.

cosmic lichen
#

IIRC getUnitLoadout CONFIG does create the unit first. Perhaps the same for your case.

#

Can't you get the comp magazines from config?

meager granite
#

Have to go through all muzzles, all magazines, all magazine wells otherwise

#

Didn't think it would actually create some weapons

tranquil jacinth
#

Does setShotParents affect player scores?

In other words, if I modify the killer and instigator in setShotParents, will this change the player scores for the new killer?"

still forum
#

The scheduler has influence on the select loop. Because every iteration it will check against the 3ms limit and may stop right in the middle (though this simple code would trigger SimpleVM to execute faster and won't do suspension checks)
Whereas the array subtraction is one statement, that cannot be suspended.

still forum
still forum
ebon citrus
#

I figured killed and dammaged would work since you detonate the explosive by "killing" it

#

setdammage

still forum
still forum
still forum
still forum
tranquil jacinth
# still forum That is the intended use of that command

Here's a segment of code that spawns a missile and detonates it. The problem is that even when a player is controlling a drone and setShotParents is explicitly set, the player does not receive any score.

I also tried directly setting _killer and _instigator as the player, but it had no effect.

private _killer = driver _uav;
private _instigator = (UAVControl _uav) # 0;

private _missile = createVehicle [_missileType, _uav modelToWorld [0, 0, 0]];

[_missile, [_killer, _instigator]] remoteExec ["setShotParents", 2];
[_missile, true] remoteExec ["hideObjectGlobal", 2];
_missile setVectorDirAndUp [vectorDir _uav, vectorUp _uav];

triggerAmmo _missile;
still forum
#

Missile might be complicated because it isn't direct hit, but instead explodes and does range damage.
I would expect that should...

#

Why is that remoteExec?

#

oh setShotParents is a server command? really?

#

Ah I see. Yeah that's right ๐Ÿค”

meager granite
tranquil jacinth
meager granite
#

position, vectors, parents

warm hedge
#

Doesn't penetrator aka submunitions inherit the shotparent?

meager granite
#

they do

still forum
#

should ๐Ÿ˜„

#

is there a getShotParents? to validate it gets set correctly?

#

Actually nevermind

#

I see the mistake

#

There is no time delay between the missile being created and triggered

#

The missile explodes, befoer setShotParents is even executed

warm hedge
#

Ah that makes sense

tranquil jacinth
half sapphire
#

hey guys. can someone guide me, or point me to a guide, on how to set a up my dedi server so i can save changes to scripts without having to restart the whole thing? i've read something about file patching but its activated and still can't get it done.

fair drum
half sapphire
#

-- edit and save files on dedicated while its running --

winter rose
#

that's why you don't script on the server :p

half sapphire
#

if i knew the code so well that i could just test stuff on self hosted and be sure its gonna work on dedicated, i wouldn't be asking for this hahah. but reality for me is that locality is a biotch and some lines i need to trial and error.

winter rose
half sapphire
fair drum
#

You can also turn off battleeye and click start game again to get two clients open. Then host it on one and join on other

#

No dedi needed

half sapphire
#

i've tried that. steam wont let me open two instances for some reason

fair drum
#

Turn off battleeye? You can start two instances from the launcher

#

Battleeye will kill duplicates

half sapphire
#

yes BE is off.

fair drum
#

Don't start two launchers. Just click start game twice on the one launcher

half sapphire
#

i just thought something changed since that info. im starting to think is something on my end

#

all right yeah. this calls for a re install.

thorny gull
#

I need some assistance, I have an aircraft hidden by default, and it gets unhidden with a "radio alpha" trigger, I need a way to teleport all players in a multiplayer game into that vehicle, I was thinking maybe something in the trigger, so it gets activated at the same time but so far I haven't been able to get anything to work

#

I've tried a remote exec to a sqf that is supposed to teleport the players, ive looked all around forums and reddit for answers and so far I haven't found anything that seems to work

opal zephyr
thorny gull
digital rover
#

Make sure you have the trigger as server only

abstract bay
#

I set the skill in one unit, for example: _grp1 setskill ["general", 0.3];, when it spawns after 15 seconds the skill always returns to 50%. Why? How to prevent it from returning to 50%?

#

I play in Zeus

half sapphire
#

@fair drum @winter rose well after reinstalling the game i can open 2 instances from the launcher without getting that weird steam error. no idea what th that was. thanks for the help.

steep lagoon
#

Can I make a code that will unlock the vehicle for players if it was first spawned with block to all entities status?

#

nvm

#

found it

#

_veh1 setVehicleLock "LOCKED";

molten yacht
#

Any way to make a unit thermally "cold" instead of hot? I'd like them to blend in but not be invisible

still forum
#

@queen cargo the VM is a stack of scripts which it switches through like you expected. Multithreading is not possible because every script is based on an GameState which has the current scripts position and local variables and stuff. And there just cant be two scripts running in one GameState cause they will overwrite each other. Thats not 100% true but thats what i got out of my first testing. But i didnt access the scripting functions itself i called whole scripts in different threads. If your lucky and the engine isnt currently executing something your fine. The good thing on Nou's side is that not all script functions use the GameState or only read from it if called directly so they dont interfere with eachother. The problem with reading a variable while its currently being written is still there tho

#

GetPos for example only calls the GameState to create the gameValue it then outputs via a static function. So as long as your just executing single script functions your mostly fine. But as i do it by calling entire scripts which need to be parsed youll get problems.. Unless! you create your own GameState...

winter rose
tired cargo
#

Hi guys!

How I can check is it air vehicle or ground vehicle in my trigger area ?

molten yacht
#

I'll just have to figure out how the reapers are made

winter rose
tired cargo
#

Or how can i get this ?

winter rose
#

"transport" needs to check cargo space

tired cargo
winter rose
#

yep

tired cargo
#

For example: reapir only for heli and repair for plane - not the same

winter rose
tired cargo
shut reef
# still forum In general no crash says in the RPT why. loadConfig is a hacky thing

The weird part was more that any log messages surrounding that bit of code were also not showing up.
How far back are diag_log calls buffered before they are written to the log?

But more importantly, how hacky is it exactly? Is there a way of testing whether a call to it will be safe?
My solution for now would be to find a way to determine whether the respective code gets called in a background scene or not, but if I knew better what it is crashing there in the first place, I could make it safer in the future.
Either way I'll be adding a comment to the page I guess.

tired cargo
dreamy kestrel
#

Q: after we are done with a drawEllipse (or rectangle, or what have you), no longer need it on the map, what do we do with it? the EH is being removed, but I still see the remnants on the map, is that correct?

dreamy kestrel
dreamy kestrel
tired cargo
granite sky
#

Generally unary commands (like !) have higher precedence than binary commands (like isKindOf), so yeah, the code is incorrect.

#

but also _getVehiclesInHeliTrigger is an array of vehicles, so you need to use a loop command like findIf to check all of them.

#

isKindOf only works on objects, not arrays of objects.

tired cargo
granite sky
#

It means the interpreter reads !_object isKindOf "Helicopter" as (!_object) isKindOf "Helicopter"

dreamy kestrel
dreamy kestrel
granite sky
#

...what?

dreamy kestrel
granite sky
#

you mean "class" isKindOf "class2"? I don't see how that's relevant.

dreamy kestrel
#

saying only works on objects

granite sky
#

Oh, you replied to the wrong sentence.

dreamy kestrel
#

yeah my error

exotic flame
#

Is there a way to walk silently in Arma 3 ? I know i could replace game files but i need to be able to switch to silent moe during the game

granite sky
#

In script? setUnitTrait with audibleCoef maybe.

dreamy kestrel
dreamy kestrel
half sapphire
#

trying to get a player (carring something in particular) to NOT be able to open the arsenal. there is the "arsenalOpened" scripted EH, and that works.. but then there is ACE, and i also have a save load out with a "arsenalClosed" EH. any ideas?

#
RPR_noArsenal = [missionnamespace,"arsenalOpened", {  
params ["_display", "_toggleSpace"]; 
 
if (RPR_item in (itemswithmagazines player))  then  
{ 
_display closeDisplay 1;   
systemChat str "you cannot access the arsenal while carrying the item"; 
}; 

}] call bis_fnc_addScriptedEventhandler;

that i got working. i was just wondering if there might be a more direct way

tired cargo
tired cargo
dreamy kestrel
tired cargo
dreamy kestrel
half sapphire
# fair drum ACE also has its own arsenal event handlers https://ace3.acemod.org/wiki/framew...

yes thanks! i was trying to get away with some magic code that just wont let you open ANY arsenal. dreaming is free lol. i got a set of "put" and "take" EH already working in tandem to track an item, that'd make 4 EH's just for that item. but the risk of someone changing loadouts and the item just disappearing is a real one. or maybe there is some magic code to just keep track of an inventory item? haahaha

fair drum
#

we are all simple here

dreamy kestrel
tired cargo
brazen lagoon
#

is there a consistent way to select a road segment?

#

like, I want to be able to look at a road segment and get sometthing equivalent to its netid (obv wont have one bc its a terrain object)

#

I can do getObjectID to get its ID but I don't know how to turn an ID back into an object

granite sky
#

What's this for? Saving between missions?

brazen lagoon
#

kind of yeah. I want to dynamically spawn bus stops adjacent to roads, so the ideal would be to save a list of road segment IDs and then select those on startup

granite sky
#

You could save the position instead.

brazen lagoon
#

yeah, that was going to be the other option, just save posasl/dir

half sapphire
brazen lagoon
#

its not that big a deal just wanted to do it consistently

exotic flame
exotic flame
granite sky
#

uh, are you talking about noise you can hear or noise that enemy AIs can hear?

exotic flame
granite sky
#

I'm not sure you have any control over that other than using different walking animations.

dreamy kestrel
# exotic flame i'll try

you make less noise if you are crouched, if you are in combat pace, etc. more than that stop running. then you will not make as much noise. sheesh...

tough abyss
#

is that a voice channel ?

lone glade
#

No this is the channel where you complain about BI and the RV engine.

leaden summit
#

Can I use inAreaArray to get an array of all buildings at a location?

shut reef
meager granite
#

Get all buildings in larger area, then narrow it down with inAreaArray

leaden summit
#

I tried _buildings = Building inAreaArray _locationData; but "building" is the wrong object?

#

In that example _locationData is the map location array

meager granite
#

Check the syntax. Left operand is list of objects, right is either search dimensions or location entity.

#

You first need to get all buildings near location you're checking, then narrow it down to only include ones that are exactly inside the area/location

leaden summit
#

Ok yeah I was looking at it all wrong, it's late here JD_Facepalm
Thanks for that

meager granite
#

To get all buildings you can get lazy and do something like this:
(1 allObjects 0) + (8 allObjects 0)
but this will include lots of crap and have ALL objects in the world in one array, very wasteful

#

Proper solution:

  1. Calc the hypotenuse of a triangle with your area\location sides
  2. Use center of your area\location and that calced value in nearEntities, nearObjects or nearestTerrainObjects or other object finder command
  3. Then use that command's output as left operand in inAreaArray to only select objects that are precisely inside your area\location
leaden summit
#

Yeah cool, I've already done 1 and 2.
Honestly it's all just to work out dynamically how many enemy to spawn at a location ๐Ÿ˜‚
I figure if I have the size of a location and the number of buildings then I can come up with some "math" to give me a reasonable number

meager granite
#

You can try getting buildingPos of buildings to see how many positions there is

#

While not perfect it can give you an estimate of how much space inside buildings there is in the location

leaden summit
#

Yeah good point, that's probably going to be the better option

meager granite
#

Won't work for non-enterable citis on Tanoa for example though

#

Maybe it could be enterable spaces per area

#

Just throwing ideas, up to you of course

leaden summit
#

Yeah appreciate it.

drifting sky
#

Does addPublicVariableEventHandler work with setVariable with the optional public argument?

drowsy geyser
#

is there a command to turn the mine detector on?

#

like openGPS true; or showCompass true;

warm hedge
winter rose
warm hedge
#
class Components
{
    class EmptyDisplay
    {
        componentType = "EmptyDisplayComponent";
    };
    class MinimapDisplay
    {
        componentType = "MinimapDisplayComponent";
    };
    class MineDetectorDisplay
    {
        componentType = "MineDetectorDisplayComponent";
    };
    class CrewDisplay
    {
        componentType = "CrewDisplayComponent";
    };
    class UAVDisplay
    {
        componentType = "UAVFeedDisplayComponent";
    };
    class SlingLoadDisplay
    {
        componentType = "SlingLoadDisplayComponent";
    };
};```
winter rose
#

ah, infoPanels and infoPanelComponents

still forum
# shut reef The weird part was more that any log messages surrounding that bit of code were ...

The buffer might be huge.
But I think crash should flush.. maybe.

But more importantly, how hacky is it exactly? Is there a way of testing whether a call to it will be safe?
Its not a feature the engine expected to have. No there isn't.
but if I knew better what it is crashing there in the first place, I could make it safer in the future.
Yeah same here, but so far I didn't get any crash reports.

shut reef
# still forum The buffer might be huge. But I think crash should flush.. maybe. > But more imp...

Well I can tell you it doesn't in this case. Logs get swallowed quite far up the callstack even.
I get that it loses the ones in the same file, but it also drops the one from the calling file(s).

I solved it for now by moving it to parts of the code that will only be executed in actual missions.

I can try and produce some crashreports for you over the next few days.
It's quite trivial to reproduce if you want to try it yourself, tho. Just needs an addon that calls loadConfig "mission.sqm" in pre-init.
It will work for vanilla, but blow up when loaded with SOG:PF.
Also with Cold War Rearmed II, so they're both doing sth that sets it off.

tired cargo
#

Hi guys!

How can I make a table with sides points, which they can use to buy something ?

Like this:

manic kettle
#

That's a long process
Go to #arma3_gui and I recommend watching some yt videos for gui basics

tired cargo
#

In which place (file) I should put the function written by me ?

tired cargo
tired cargo
tender fossil
# tired cargo My think: in init.sqf. Is it right ? If no - why ?

There are no strict rules about it. It's your choice what kind of folder/file structure you want to have. Init.sqf gets executed when the mission starts. You can add multiple script files in a project and call the code in those script files from other scripts. You can start testing your code by writing it directly in init.sqf, but sooner or later you might want to split the code in logical parts (in other SQF files).

worldly fulcrum
#

where do i go to learn about sqf file and how it works in and out overall?

worldly fulcrum
#

thats

#

great!

cobalt sorrel
#

I was wondering.
Are you able to exclude a certain group from a certain check?

I have an extract end condition which works just fine, where it triggers if 20% of alive blufor are in the marker.
Slight problem is, a 3 man mortar team sits in base, and as such, they can potentially be atleast 20% of the alive blufor team.
Which results in the mission ending early, before the force out in the field returns to base.

willow hound
#

What does the current condition (code) look like?

cobalt sorrel
#
_resForce = allUnits select {side _x == west}; 
_resAlive = _resForce select {_x call FNC_alive}; 
_resArea = _resForce select {_x inArea "extract"};
#
if (alive HVT && {HVT inArea "extract"} && (count _resArea > (count _resAlive * 0.2))) exitWith {
willow hound
#

Perhaps something like so?

_resForce = units west;
_resForce = _resForce - units MortarGroup;
_resAlive = ...
barren surge
#

I've been working on an undercorver system for a few days now and im at a point where I believe im about 80% done but my limited knowledge/experience is roadblocking me. anyone think they copuld spare a few mins to help me figure out whats going wrong?

willow hound
hallow mortar
#

Does fnc_alive do anything special, or can it be replaced with simply alive _x?

cobalt sorrel
#

fnc_alive is a function from our framework if I recall.

cobalt sorrel
#

Like... is it that simple?

opal zephyr
#

Yes if the group is named MortarGroup

#

You're just subtracting the array of units in that group from the _resForce array

cobalt sorrel
delicate hedge
#

hi. can someone help? here is my mod (with commented code and README).
Problems: it works fine in SP, but in MP it works fine only on host. Host gets all the variables (parameters) right on every drone, but other players get default values (not that was set in attributes), and somehow players can manage actions if they are controlling drones ('pilotNow' is set to true mb).

delicate hedge
#

i think problem is might be with getting manually settled values in eden attributes of drone on every player connected to server?...

worldly fulcrum
#

in notepad + +, if I save a script as .sqf will arma 3 be able to understand said .sqf file ?

#

obviously if i write it properly and properly put the said .sqf file where it belongs*

little raptor
#

.sqf files are just text files

#

you could even save them as .txt

#

just make sure you save them as utf8

worldly fulcrum
#

i see

#

this addaction ["<t color='#FFFF00'>Virtual Garage</t>", {[("markername")] call opec_fnc_garageNew;}];

this code will open virtual garage and spawn vehicles at marker1, but problem is said marker1 has fixed altitude i need marker1 to be at altidude 205 i think so that it spawns at altitude 205 and not inside of carrier vessel is there a workaround ?

#

i want to use helipad invisible but this is specified only for Marker idk how to make it be helipadinvisible tho hence helipadinvisble can be moved up and down

hallow mortar
#

You don't need to do ("markername"). Just "markername" is fine, there's no order of precedence issue there that you'd need the () to resolve.

worldly fulcrum
#

but the sqf file i got it from requires for me to use marker but idk how to make sqf one use helipad invisible

chrome estuary
#

When we use an array we get this error but we cant figure out what weare doing wrong can someone pls help ??
Files are provided.

The Error:

class peragh_ausgrab_config {
peragh_ausgrabun>
0:21:22   Error position: <peragh_ausgrab_config {
peragh_ausgrabun>
0:21:22   Error Missing ;
0:21:22 File mpmissions\Altis_Life.Altis\config\Config_Ausgrabung.hpp..., line 4
0:21:22 Error in expression <\config\Config_Ausgrabung.hpp"

Config_Ausgrabung.hpp

class peragh_ausgrab_config {
    peragh_ausgrabungsGebiet = "test";
    peragh_ausgrabungsSize = 30;
    peragh_requiredItem = "";
    peragh_searchTime = 10;
    peragh_ausgrabungAnim = "";

    peragh_lootAusgrabung[] = {
        {"hgun_P07_F", "weapon", 0.5},
            {"peach", "vitem", 0.8}
    };
};

fn_actionKeyHandler.sqf

if (player inArea getMarkerPos[peragh_ausgrabungsGebiet, peragh_ausgrabungsSize]) then {
    [] call life_fnc_ausgrabung;
};
#

fn_ausgrabung.sqf:


fnc_startAusgrabung = { 
    private ["_item", "_startTime"];
    
    if (player inArea getMarkerPos[peragh_ausgrabungsGebiet, peragh_ausgrabungsSize]) then {

        if (!(peragh_requiredItem in assignedItems player)) then {
            hint format ["Du benรถtigst %1 um hier ausgraben zu kรถnnen", peragh_requiredItem]; 
        } exitWith {};

        if (peragh_requiredItem in assignedItems player) then {
            player playMove peragh_ausgrabungAnim;

            _startTime = time;

            while ((time - _startTime) < peragh_searchTime) do {
                _item = _x select 0;

                if (random 1 <= _x select 2) then {
                    if ((_x select 1) == "weapon") then {
                        player addItemToBackpack _item;
                    } else {
                        player addItem [_x select 0, 1];
                    };
                };
            } forEach peragh_lootAusgrabung;
        };

        hint format ["Du hast %1 Augegraben", peragh_lootAusgrabung];

    } else {
        hint "Du befindest dich nicht im Ausgrabungsgebiet";
    };
};
warm hedge
chrome estuary
sharp grotto
gray bramble
#

x39: I believe half writes is only a problem for unaligned variables? A more likely problem is that something is written, a pointer to it is written, and that pointer is flushed to deeper caches or main memory, before the data it points to. If you try to read the data in between you get garbage.

chrome estuary
#

But if that's not included, do I have to pass the parameters via params or how does it take the things from the config?

chrome estuary
tired cargo
#

Is it real to detect a flying rocket and if it flies into a certain area (into a trigger, for example), does the sound turn on?

manic kettle
#

Wat

warm hedge
#

What, what sound?

tired cargo
#

If the rocket in the trigger, than players can hear about air warning

warm hedge
#

It's not impossible. I'm not available to write a snippet right now though

tired cargo
dapper nexus
#

I'm trying to write an addaction to add to a Training NPC.
The medDoll%'s are just suspended in the air with sim/dmg/hide off so the idea is the action re-enables simulation, damage and un-hides them
At the moment it's asking for a missing ] but it's eluding me

{ 
    _target = _x; 
    _title = format ["Activate Patients", _target]; 
 _script = format ["_target = %1; hint format [\"Activating %1!\", _target]; _target enableSimulation true; _target allowDamage true; _target hideObjectGlobal false;", _target]; 
    _arguments = [_target, true, false, true]; 
    medDoll1 addAction [_title, {_x call {(_this select 0) spawn {(_this select 1) call BIS_fnc_holdActionAdd;}}},       _arguments, 0, true, true, "", "true", 5, false, ""]; 
} forEach targets;```
#

if anyone could spot the issue/issues that would be greatly appreciated

granite sky
#

Always quote the error text.

dapper nexus
#

Init: Missing ]

granite sky
#

No, the whole error.

#

\" is this C?

#

Pretty sure that backslash escaping doesn't work in SQF.

dapper nexus
#

that would be a part of the problem! yup

granite sky
#

For something like that you just swap quote types. Use single quotes if the outer is doubles.

#

They both work in SQF and it just looks for a match.

#

Beyond that, it's unreadable :P

dapper nexus
#

the quote types did it

#

now it's just a reserved variable and the whole thing being unreadable

gray bramble
#

@still forum I would not be inclined to believe the gamestate (world with all its objects) includes a single scriptstate - rather the executor would have its scriptstate object which has a pointer to the gamestate. Am I wrong? MT would still be quite hard, but for other reasons that would still apply.

barren ermine
#

hi friends is it possible to make a car's wheel break after a trigger is activated ?

gray bramble
#

re half updates - it could perhaps also apply to two-word values, like doubles. Don't know know much those are used though.

granite sky
barren ermine
terse tinsel
#

I have a question, probably simple for you, but I don't know how to do it :(. How to write a script so that the vehicle does not avoid the obstacle in front of it but hits it? For example, so that the tank does not avoid the car?

barren ermine
#

@granite sky @stable dune you guys are literally the goats bro

granite sky
#

This stuff is never simple though. Arma doesn't like to give you that sort of AI control.

terse tinsel
#

I was thinking about unit capture and unit play but it's too much work ;p

real tartan
#

is there some simple example of xml file for BIS_fnc_dbImportXML ?

grizzled cliff
#

heh

#

multithreading is not a problem

#

took me a day or so to get it working

#

but now it is perfectly stable

#

with 100s of threads calling sqf functions

nocturne bluff
#

neato. i'd bet @sullen marsh would want that for his AAR stuff

grizzled cliff
#

yah

nocturne bluff
#

getpossing from C++..

#

such a dreeeam

#

I want it for another tool i have in mind

grizzled cliff
#

yah i just gotta find this little memory leak im getting now

drowsy geyser
#

Is there a command to mute the AI โ€‹โ€‹voice, including pain/breathing sounds, when injured/exhausted?

hallow mortar
#

setSpeaker with "NoVoice" should take care of AI voice chatter.
For breathing sounds, try a soundPlayed event handler

keen rain
#

I presume we can't get to the debug menu/triggers/change objectives icons via Zeus?

winter rose
still forum
#

@gray bramble the gamestate is not the world with all its objects. Its more than a base of all scripts being executed.. better name would be ScriptState but its called gamestate

sullen marsh
#

Aye i'm super interested in it

lone glade
#

Anyone looked into what they're doing with enfusion ?

grizzled cliff
#

i know they have a new scripting language

nocturne bluff
#

I did look at the language

#

its in take on mars

#

I think the ToM wrote it first then they just snagged it upp

sullen marsh
#

Brand new language or is it based on something?

lone glade
#

Knowing BI probably based on C++ somehow.

grizzled cliff
#

yah, looking at it, it looks like its C++ in terms of syntax, the question is how is it interpreted

lone glade
#

That looks noiiiice.

sullen marsh
#

I mean, hopefully it wouldn't be interpreted at all... C++ lives to be compiled, even if it's done at load

keen rain
#

pain

lone glade
#

At least BI support modding properly, it's nice to have a company so supportive of it's playerbase and modders.

sullen marsh
#

That's true, SQF might make me pull my hair out sometimes (and I don't even use it that often) but at least they let us mod at all

#

BUT it would be the death of arma if they didn't...

#

clamp linDamp<0, 1>;

#

Strange syntax

agile pumice
#

is it a lot of work to make a vehicle mod ace compatable?

indigo snow
#

it's probably mostly the cargo framework

tired cargo
#

What the different between spawn and call commands?

granite sky
#

..

#

spawn creates a new "thread" in the scheduler which will run your code at some point in the future.

#

call will run the code immediately and return to where you called it from.

little raptor
#

run the code immediately
that's a bit confusing. only unsch env can run a code immediately
perhaps it's better to say:
call is for sequential execution? think_turtle
whereas spawn detaches from the script that ran it, and does its own thing

keen folio
#

Would anyone happen to know of a Script that would essentially spawn in Destroyed aircraft mid Air, and Despawn them after say a few seconds as they are falling out of the sky to create say and ambiance affect

winter rose
#

no, but it is doable

agile pumice
#

thanks

#

im assuming not able to repair wheels is due to non-conventional memory points?

vapid scarab
vagrant skiff
#

I'm trying to run this code:

sleep 5;
while { alive HeliPilot && not unitReady HeliPilot } do
{
    sleep 1;
};

if (alive HeliPilot) then
{
    (vehicle HeliPilot) land "LAND";
};```
it works fine in singleplayer but doesn't work on a server, anyone know if any of the commands don't work in mp?
barren ermine
keen folio
#

Hello,

This is not a tutorial but a showcase with explanation. Simple concept demonstrating how one can add atmospheric ambient battles to missions. This is aimed at the SWOP mod but is not limited to it in design.

You could use such ambience to add atmosphere to any mission - to make the player feel like they are part of something much bigger.

โ–ถ Play video
dusk gust
vagrant skiff
dusk gust
keen folio
#

I got down how he did the ship to ship firing down itโ€™s more so the AirVics spawning already destroyed and despawning after they started falling abit

#

I might as well ask Chat GPT to write it KEK

vagrant skiff
dusk gust
indigo snow
#

possibly. They have a dedicated slack where you could check

vagrant skiff
#

the server uses a hc so would that make the ai local to the server?

sullen sigil
#

chatgpt cant code

#

especially not sqf

vapid scarab
#

Ah. Cool. I love being wrong here.

Here is how I would do that.
Spawn the fighter, set the pilot's group to hold fire and careless, give them a move waypoint, and use the waypoint complete statement to set vehicle health to 0. Just loop this with a few different fighters and starting from different positions and BOOM! Literally ๐Ÿ˜

Useful Commands:
addWaypoint
setCurrentWaypoiny
setWaypointStatements

vapid scarab
#

I dont know of any premade scripts though to answer your original question. Far too particular to repurpose from some premade code that i have anyways.

keen folio
#

Thatโ€™s fair

#

And everything you said can be done in Eden. And there isnโ€™t a need for a Sqf

vapid scarab
#

that will all be in sqf....

#

Actually, this is fairly simple though.

keen folio
#

Iโ€™ve like never genially scripted anything from scratch so , my knowledge on scripting missions are limited

#

I more of a Code/ Materials Guy

vapid scarab
#

This is a perfect project to start messing with sqf!

keen folio
#

For sure Iโ€™m probably going to start working on it Friday since my work schedule is fucked if I have any questions can I shoot you a DM ?

sullen sigil
#

i have a capital ships mod for that sort of stuff coming out whenever the update for setangularvelocity releases

vapid scarab
#

Go ahead. i dont mind dms

keen folio
#

Valid

sullen sigil
#

capital ships mod

#

fly capital ships

#

make capital ships shoot

#

easy

keen folio
#

I mean couldnโ€™t you just use the attach to Zeus model

#

To fly the static starships

#

I mean I know itโ€™s abit jank but it still works

sullen sigil
#

you could

#

but thats shit

#

so i make them fly

keen folio
#

Will they have interior or how will that work if your able to explain further

sullen sigil
#

yes

#

can land in them

keen folio
#

Dope

feral ravine
#

anyone know of a way to do a fake explosion attached to a helicopter to mimic an rpg hitting it (without any damage) once its gets to a waypoint cause I have the sound and damage alreadly scripted just trying to find a way to do an explosion

warm hedge
#

Making a fake explosion is rather hard. I think I can suggest to create an actual explosion but disable all damages for the heli and crew

feral ravine
#

okay but how can I ensure it actually hits the helicopter

#

and on the area of the heli where I want it to

warm hedge
#

modelToWorld or some way

feral ravine
#

Or hell make it not do damage (sorry I suck at scripting)

warm hedge
#

allowDamage

feral ravine
#

So make everyone also invincible and not just the heli

vagrant skiff
warm hedge
#

Are you sure you have any Mod, especially AI Mods that can overwrite your order

vagrant skiff
#

I'm using lambs but I disabled the pilots lambs ai

shut carbon
#

use unitReady heli

vagrant skiff
#

I am, its just that I'm using not instead of !, pretty much the only difference between that script and mine is that in mine the helipad is already created

shut carbon
#

you were using pilot above

#

the heli doesn't even take off?

vagrant skiff
#

when the script is run the pilot just says the grid that the lz is in and then does nothing. Same thing happened when I gave the move command to the helicopter instead of the pilot

#

it works fine in sp but doesn't work when put onto a server

shut carbon
#

oohh (didn't read that below, my bad)

warm hedge
#

How do you test in SP? Did you use LAMBs in SP too?

vagrant skiff
#

yeah, exact same mods

warm hedge
#

What if you disable LAMBs in your server

vagrant skiff
#

haven't tried that but I don't imagine it would do much. LAMBs pretty much only effects units in combat and the helicopter is set to careless. They also have had LAMBs ai disabled in the editor and confirmed to be disabled in zeus

#

but I just remembered that we're running drongos air operations so I'm going to try disabling that

#

although now that I think about it it's probably not that. I have a truck with a similar script that also isn't doing anything

waitUntil {moveToCompleted TruckDriver};
sleep 10;
TruckDriver doMove position Start;```
warm hedge
#

I highly suspect any AI Mods in this case anyways

vagrant skiff
#

I think I figured it out

#

in zeus I ran the code to execute the script and it worked in global mode and target mode but not local mode

#

I'm going to see if switching the code that calls the script from "heli.sqf" remoteExec ["execVM", 2] to "heli.sqf" remoteExec ["execVM", 0] works

#

it worked

feral ravine
#
bomb = "Bo_GBU12_LGB" createVehicle (player modelToWorld [0,0,0]);    
bomb setdamage 1;  
``` so the bomb isnt being blown up by setdamage the only reason why it even exploding is cause the helicopter causes it to but that can be janky so I was wondering if there was a better way of doing this
warm hedge
#

triggerAmmo

feral ravine
#

so

triggerAmmo bomb;
#

?

teal drum
#

Is there any caveat I should look for when using playSound3D for a whistle sound? Currently, my trigger seems to be activating without issues, but that's a separate situation I'll look into myself.

What I currently have in my trigger activation field (trigger is set to Server Only):

[] spawn {
    private _whistles = ['vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_1.ogg',
       'vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_2.ogg',
       'vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_3.ogg',
       'vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_4.ogg'
    ];


    playSound3D [selectRandom _whistles, whistler, false, getPosASL whistler, 5, 1, 500, 1, false];
}

but it seems to be a hit-or-miss case on a dedicated server with the whistle sound playing on my whistler unit (a singular guy with the variable name set to whistler).

feral ravine
warm hedge
teal drum
#

Looks like it's time to bug someone who has access to the server! Thanks BepThumbsUp

warm hedge
#

Uh so, in MP some plays the sound some don't?

teal drum
#

It worked locally but in MP on a dedi it seems to have failed based on a singular test

#

Will need to look into it properly when we have the time

meager granite
#

Add some kind of logging (diag_log) to see if your conditions are met properly

#

and inside activation, then check RPT after a test to see if your lines are there

warm hedge
#

Don't recall rn but is playSound3D global?

teal drum
#

The last argument is:

local: Boolean - (Optional, default false) if true the sound will not be broadcast over network

warm hedge
#

Oh true

warm hedge
feral ravine
#

finally its done I made a singleplayer helicopter crash script

stable dune
#

Hello,
Have someone build time_slider to attributes on object?
Like CBA settings "TIME", where you can set Min and Max.
Havent seen. Or is there in Vanilla some value for this?
And dont know is this correct place to ask , but lets start from here.

cosmic lichen
stable dune
#

But always i can use something what is already made, but didnt found any

stable dune
#

https://github.com/acemod/ACE3/blob/master/addons/medical_damage/CfgEden.hpp
I know i can do something like this.
But can i do this for object , not in cfgEden.
Under

class CfgVehicles
{
    class B_Soldier_F;
    class MyEntity : B_Soldier_F // Your entity class
    {
        class Attributes // Entity attributes have no categories, they are all defined directly in class Attributes
        {
            class MyEntityAttribute
            {
                // ... attribute properties, see entity attributes <---- Here
            };
        };
    };
};
pliant stream
#

@lone glade more like the game has barely anything to offer without player created content, so here's the bare minimum of tools for our esoteric engine. oh and no need for documentation right? right.

lone glade
#

There's a fuckton of doc, and vanilla content is fine, they also provide constant updates.

grizzled cliff
#

Yea Foxy, you have to be a pesamistic moron to think that.

#

Trust me, if you think modding for Arma is hard or esoteric then you haven't worked on many other game platforms.

keen rain
#

Is there a possibility to make not a full arsenal but something players could make their loadouts off without having access to all weaponry

cosmic lichen
#

Attribute controls work in Cfg3DEN and CfgVehicles.

shut reef
#

Is there a way to access the startup params via sqf?
Or more specifically, can I check in sqf whether the game was launched with -skipIntro?

warm hedge
#

No

shut reef
#

Is there any way to detect whether a background scene is running or not?
Like, is that an UI element? Or how is that implemented?

warm hedge
#

I think the answer is depends on your goal. If you just wanted to detect/run a script upon mission run, just init.sqf

shut reef
#

No, am doing main menu rebranding. And depending on whether there is a background scene running or not I want to show a custom background image. Though depending on this question I might not need to know at all because I can just replace the default background . #arma3_gui message

half sphinx
#
_crate = cursorobject;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;

_headgear = {
    "H_Hat_Tinfoil_F",
    "H_HelmetSpecO_blk",
    "H_HelmetSpecO_ocamo",
    "H_Beret_gen_F",
    "H_Beret_blk"
};

[_crate,((backpackCargo _crate) +_bags)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _headgear + _glasses + _clothing + _vests + _attachments + _acc)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _mags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _guns)] call BIS_fnc_addVirtualWeaponCargo;```
#

something like that should work

candid sun
#

there's about a million things on the wiki with no documentation though to be fair

pliant stream
#

i can't remember ever seeing any docs from bohemia but i'll take your word for it, and yeah i was exaggerating but looking at stuff like asset/animation pipeline for arma 2 at least is pretty non-existant maybe it's better in arma 3 haven't really done anything with that

candid sun
#

hey they included samples in arma 3 tools for like 4 or 5 different things, that's a step in the right direction eh

stable dune
#

Is there way to add condition in attributes .
Like "checkboxState" which enable/ disable whole attributes.
But if i want in attributes.

noble comet
#

Hi, does anyone know on how to execute a script on a person(in a trigger) via ace button?

cosmic lichen
#

In case you own the Spearhead cdlc you can check the config of the Indirect Fire Support module for an example via the config viewer.

stable dune
#

Awesome , thanks

cosmic lichen
#

I think I have such a control in 3den Enhanced as well so you might wanna check the source code in GitHub as well

grizzled cliff
#

C++/CLI

#

its .NET but with C++

final adder
#

Hello, first time hosting server and it wont load due to this message, could anybody assist ? NoReply 'bin\config.bin/CfgMagazines/Aegis_8Rnd_12Gauge_HE.scope

hallow mortar
#

That's not the full error message, that's just a config path. The error message is telling you there's a problem there, but you've left out what the problem actually is. I'm guessing "not found", but details would be useful.
Something is trying to use an 8rd 12gauge HE magazine from the Aegis mod, and that item is either missing or has a problem with its config.
If you don't have Aegis loaded, you need to load it. If you do have Aegis loaded, you need to verify its files to make sure they're intact.
If you have Aegis loaded and the files have been verified, you need to find out whether Aegis_8Rnd_12Gauge_HE (spelled exactly like that) is actually a real classname that exists in CfgMagazines. If it isn't (either doesn't exist or is spelled wrong) then you need to find the script or mod that's attempting to reference it, and either correct or remove that reference.

final adder
#

Yeah sorry this is the actual problem

#

No entry 'bin\config.bin/CfgMagazines/Aegis_8Rnd_12Gauge_HE.scope'.

#

has this for multiple items

slim lion
#

Anyone know what the function is called for the little rotary circle that appears for example when you hold down a key to free a prisoner. As you hold it down the dots progress in a circular pattern until the prisoner is free.

slim lion
vapid scarab
#

For item mass, what is the unit? kilograms?

winter rose
kindred zephyr
#

and it also depends on what mass are we talking about, o.b mass is kilos, ingame mass is a meaningless unit that represents the volume as lou says

feral ravine
#

can i leave a finished script in here

#

?

jade acorn
#

what for?

feral ravine
#

so if someone need a similar script they can find it

fair drum
#

Not really discords thing.

jade acorn
#

I don't see a rule forbidding you from doing so but please do care to add some context to it, since it's a "help with scripts" channel rather than "library of scripts" one

#

there are other discord servers around that are dedicated to snippet collection, I think even BI Forums have a thread and/or a category for such

fair drum
#

How about he posts it, and one by one we make edits until it's no longer recognizable as his original work? Lol

jade acorn
winter rose
teal drum
#

Is it possible to add Zeus modules via a mission script or only mod?

warm hedge
#

What a script can do is also possible for a Mod's script and vice versa too. tldr, yes

teal drum
#

Sweet! Thanks MenheraThumbsUp4

hallow mortar
#

Zeus modules aren't added by script, they're added by CfgVehicles, which is mod-exclusive

formal stirrup
#

Not really vanilla but zeus enhanced has functions to create zeus modules via scripting

velvet merlin
#

updAttPos; 67.48811; 3.03353;""
what is this to take 3ms?

#

is this sounds in a queue or some wss file fetching, or what is this? (almost all have the same sound)

teal drum
still forum
# velvet merlin > updAttPos; 67.48811; 3.03353;"" what is this to take 3ms?

UpdateAttachedPositions
Lights attached to vehicle (spawned by engine, all Man that have flashlight on are attached), Craters/SmokeSources are attached, Lights on vehicles (headlights)

"objects that need some processing between simulation and rendering"
They get separate simulation cycle.

Diag binary has "AttachedOn" diag_enable that will rnder debug shapes on some of them.
Seems lights use this simulation cycle, to move with their parent vehicle/unit.
Soldiers update their flashlight / IR ray.

#

fs is file system. So it'll be reads from disk
wssGD is instead wss get data.

sullen marsh
#

Do you know when you might be up for releasing your C++ bindings Nou?

#

I'm really itching to check it out

velvet merlin
#

thanks a lot ๐Ÿ™‡โ€โ™‚๏ธ

#

doesnt the engine cache sound files, or it does and this is only a "get cached or fetch function"?

sullen sigil
#

are camo coef and audible coef on the same scale? i.e 0.5 camo coef and 0.5 audible coef is same level of "hidden-ness"?

little raptor
#

well they're both coefficients, so they both get multiplied by something

#

but they don't mean the same thing. 0.5 audible might mean you can get 2x closer to enemy (I mean half distance), but 0.5 camo might mean 0.1 closer (0.9 * distance).

sullen sigil
#

blue leopard again looks weird

#

but ya figure decreasing by the same amount is probably the easiest way forward

dusky owl
#

I am trying to bind extra actions when Zeus closes/hides interface but my code doesn't do anything at all.

 addUserActionEventHandler ["curatorToggleInterface", "Activate", { systemChat "Hello world!"; }];
hallow mortar
dusky owl
#

And tried it out in Vanilla too, just in case. But doesn't work either.

wind flax
#

Anyone know if r2t can be used on Night Vision goggles?

sullen sigil
#

no

#

theyre not objects

manic flame
#

Hi, need some help, for some reason even though i attach a flag file (.paa) to my mp mission folder, when i host on linux, its unable to find the flag. Do I need to use other paths?

ie; ./imagefile.paa instead of 'imagefile.paa'

manic flame
#

yes

#

This is how its structured

#

I try to access it from the editor and scripts using its name "flag.paa", and it works fine on windows

#

but when I host the game on the linux server, it says image not found

manic kettle
#

Is there a scripting way to get a mod name from a pbo cfgpatches? Like figure out that ace_medical.pbo belongs to the ace mod?

terse tinsel
#

Spawn...
sleep 5;
Spawn... When I write a script interrupted by a time delay as sqf, it works ok. But when I paste it into the ini of the Eden unit, I get an error. Here's an example

jade acorn
#

sleep must be spawned too if you want to use it in init, it won't work on its own in unscheduled environment.

terse tinsel
jade acorn
#

you might want to write a separate file and then execVM it in the unit's init if the sleep must be outside of the spawns

terse tinsel
#

OK now . you helped me a lot. Thank you ๐Ÿ˜€

grizzled cliff
#

i gotta fix this memory leak, and then the initial very low level bindings will be done

#

it'll require manual memory releasing though

#

i an add you to the github project if you want

#

its private for now

queen cargo
#

best experience i ever had was modding Minecraft ...
no official tools --> decompile, deobfuscate needed
+
as soon as you had access to the whole source code you saw what a gigantic mess Minecraft was :facepalm:
tbh ... i do not want to see ArmAs src code so i never have that feeling again i had back in the days i modden minecraft ...
the moment you realize that most stuff is done twice in the source + all APIs you have are screwed little bitches with missleading names and completly unusable other stuff is the moment you realize what you have done to yourself ...
thats why you also should never allow native code to be ran as mods ...
modders will screw you for every mistake you made in concept phase

delicate hedge
#

I have question: If i spawned some function, and then i spawn it ones more, does it makes like separate thread? Or it removes old one with new? So if i have while in it will it spawn more while-loops?

meager granite
lone glade
#

Does the choice of language count ? huehuehue

delicate hedge
little raptor
#

Yes. Save the handle and terminate it

queen cargo
#

it depends

#

for new people

#

no

#

for those few which do have knowledge in programming, yes

#

eg. you should try to stick to the C-Stylish langs

west portal
#

How do arrays work? I'm attempting to put a squad in an array, but I can't seem to get the syntax right

Ex: _squad1 = ["ai1", "ai2", "ai3", "ai4", "ai5", "ai6", "ai7", "player1"];

stable dune
#

Without quotes

west portal
winter rose
#

if you want to have an array of groups, use the group's varnames without quotes