#arma3_scripting

1 messages ยท Page 128 of 1

meager granite
#

You need to broadcast the variable after you edit it in your safe function

#

publicVariable "ionProfiles"; or publicVariableServer "ionProfiles"; to only send it to server

#

Its a bad idea to let players see all profiles of all players

#

Better approach would be sending each player only their own profile

thorny gull
#

So I am using a slightly modified script from a youtube video to do a paradrop, that your supposed to put in the activation of a move waypoint, It worked a week ago but now it has stopped working, could anyone help me determine what the problem is?

hercD sideChat "GREEN LIGHT, GO, GO, GO!";  
 null = [] spawn {   
{   
  if(((assignedVehicleRole _x)select 0) =="Cargo") then {       
 [_x] ordergetin false;   
 [_x] allowGetIn false;   
 unassignvehicle _x;   
 moveout _x; 
   sleep 0.3;   
};   
} forEach(crew herc);   
}; 

this is all the code in the waypoint, originally by OnlineCombatBN
the modifications whre removing the remove backpack and add parachute lines from the original script, this is because I want it to eject the players with their existing backpack (as the players will already have parachutes)

thorny gull
#

appreciate it, missed the first ping!

mystic scarab
meager granite
#

If both broadcast at the same time you'll end up with one value missing

#

All in all, this is a bad design, make each client operate only their own profile

mystic scarab
#

Alright, thanks, I'm trying to change it. So far I've added this and I see both entries:

"ionProfile" addPublicVariableEventHandler {
  _UID = (_this select 1) select 0;
  _ionProfile = (_this select 1) select 1;
  ionProfiles set [_UID, _ionProfile];
  publicVariable "ionProfiles";
};
thorny gull
#

I am using profiling ^^

hallow mortar
#

Removing the null = won't have fixed it - like I said, it's not the problem, it's just something that isn't necessary any more due to changes since the script was published.

#

Profiling branch is the most likely culprit, because of the recent problem with crew-related checks. These things can happen as it's a semi-experimental branch. You can wait for future prof updates, or switch to stable and try it there.

thorny gull
hallow mortar
#

Provided the server and other clients are also on stable branch. I don't see any issues with the code itself, and if it worked before it will work again, as there have been no changes to stable branch in several months.

#

* technically it should only matter which branch the machine that executes the code is on, but I don't know exactly how you're executing it so it could be any or all of them

thorny gull
#

copy Ill do some quick server testing and it if works there than It should be fine

jade acorn
#

I have an unarmed unit joining another group. Problem is that it keeps crouching and I can't change its pos with setUnitPos and setUnitPosWeak. How can I make that unit move "UP" without forcing whole group to do so with waypoint attributes?

#

if I set two waypoints (in editor) and one makes them all go UP and then second one to AUTO, the "AUTO" pos for the unarmed guy is crouching anyway

indigo wolf
#

Noob question but how do I add large amounts of magazines (like RHS launchers, mortar ammo etc) on a supply box without being limited by the cargo size?

indigo wolf
fair drum
jade acorn
manic kettle
#

is it possible to store the scrip handle for a remoreExecuted script?
I know this doesnt work, but lets say lets say _handle = [somefnc] remoteExec ["call", 0];

granite sky
#

_thisScript might exist in remoteExec'd functions. Not sure.

#

Otherwise I guess you could run a spawn from there and then you'll have a script handle, if you really need one.

little raptor
manic kettle
#

the reason i ask is because i want to find out when a remoteExecuted say3D is finished playing the sound, so i can play a new one

little raptor
#

it's defined on another machine

#

so you can't know if the script is done without remoteExecing a function that remoteExecs the result back to you

#

which is not instant

manic kettle
#

Yeah fair i can see that.

grizzled vapor
#

Hey! I'm trying to use (on 2.14):

[_vehicle] call BIS_fnc_unflipVehicle;

unflip actually happens, but I get an error in the report file:

22:01:14 Error in expression <(getDir cameraon);
_vehicle setPosWorld _adjusted;
_vehicle setVectorUp (_ins # >
22:01:14 Error position: <_adjusted;
_vehicle setVectorUp (_ins # >
22:01:14 Error Undefined variable in expression: _adjusted
22:01:14 File /temp/bin/A3/Functions_F/Vehicles/fn_unflipVehicle.sqf..., line 44
22:01:14 "position above sea level: -0.915052"

Anyone with an idea on what am I doing wrong?

little raptor
grizzled vapor
#

Will do thanks!

ancient mantle
#

how do i fix this

hallow mortar
#

It's not a scripting problem. Your client has different mods loaded to your server, and one of your mods is missing another mod it depends on. You need to read the error message and load/unload mods on the client/server until you have matching configurations with the correct mods.

granite sky
#

Client is loading obsolete ACE compat mods in this case, which is the wrong thing to do 99.99% of the time.

neon plaza
#

Trying to get this line of code to work In Vehicle Init...


veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"


#

tried init; but did not respawn the vec

meager granite
#

issue is in your script then

graceful dew
#

Working on a small script that swaps the position of caller and gunner in vehicle when the gunner is unconscious:

/*
Swaps the position of the gunner and the caller
*/
_object = (_this select 0);
_caller = (_this select 1);

// _playerPosition = _object getCargoIndex _caller;
// hint format ["%1", _playerPosition];
_gunner = gunner _object;

moveOut _gunner;
moveOut _caller;
_caller moveInGunner _object;
_gunner moveInAny _object;

for some reason the gunner is being moved back into the gunner seat and caller is left outside of the vehicle. Anyone have a potential workaround?

warm hedge
#

One thing I want to make sure is, is moveInGunner the correct command to move into the seat you want?

graceful dew
warm hedge
#

I imagine moveInGunner is failed because when it was executed the seat is not empty yet at the frame, not 100% sure though

graceful dew
#

Yeah, seems to be pre empted by moveInAny

warm hedge
#

Probably use setPos instead to force leave the vehicle

graceful dew
#

gunner still seems to be in the seat when moveInGunner is called, will try adding some waitUntil

meager granite
#

This is more complicated than it might seem when you get locality and dead units involved

#

For dead units though, but being able to swap sweats with unconscious units sound great too

graceful dew
#

Interesting

#

dealing with ace unconscious state on my end though

warm hedge
#

So both are players? Then probably locality is the issue as Sa-Matra said

graceful dew
#

ah, local executes first is what you are saying?

#

vehicle is local to commander or driver? or maybe caller?

warm hedge
#

I mean, moveOut or such can be transmitted into the local player other than you, and it can make a bit of lag until it happens

graceful dew
#

what if the command is being executed by remoteExec?

warm hedge
#

No point I guess, moveOut is already GE

meager granite
#

Yeah you need to wait until remote player gets out, it might not happen instantly

#

Not sure if there is a delay when moving into remote turrets the same way as when you move into remote vehicle's driven seat, but you'd need to account for that

graceful dew
#

Ok, two questions
How do I determine who the vehicle is local to?
Would remoteExec solve this issue?

warm hedge
#

remoteExec or such is not a concern, you just need to wait and confirm until the changing seat is done

meager granite
#
  1. Move out remote player\unit
  2. Wait until seat is empty
  3. Move in yourself
  4. Wait until you're in
  5. Move remote player\unit into your old seat
#

In Arma there are 3 types of seats in the vehicle: Driver, Turret, Cargo, to make your function universal you'll need to account for them all

#

gunner and commander are turrets, just config/engine-defined default turret positions for these vague roles, so you'll need turretUnit/unitTurret/moveInTurret commands to cover all possible turret cases

#

You can check locality with local and turretLocal but you don't really need it because you have to wait for actual unit movement in and out of seats which can depend on network latency, clients/server lagging, being frozen, etc.

graceful dew
#
_gunner = gunner _this;
player setPos getPos _this;
_gunner setPos getPos _this;


waitUntil {_gunner in (crew _this) == false && player in (crew _this) == false};
player moveInGunner _this;
waitUntil {player in (crew _this)};
_gunner moveInAny _this;

same issue as before. Will try changing how the command is called as I am currently developing/debugging in the exec box of the vehicle I am working on

hallow mortar
#
_gunner in (crew _this) == false && player in (crew _this) == false```
`_bool == false` -style checks are redundant (you already have a boolean, you don't need to use another command to check if it's true or false, it does that itself). You can simplify this:
```sqf
!(_gunner in _this) && !(player in _this)```
warm hedge
#

(Even though it is legit syntax)

dusk shadow
#

Is there still no getter for the 'time remaining' on things deriving from "TimeBombCore" like "SatchelCharge_Remote_Ammo"?
I'm referring ofc to the time set by the "Set timer (+40 seconds)" action

#

Just gotta wait for 2.18 ๐Ÿ˜ฆ

cyan dust
#

For the

unit forceWeaponFire [muzzle, firemode]

I need a 'muzzle'. And I noticed that for some vehicles "weaponsTurret" does return value that can be used, but for some - don't. For example for gunner inside the marshall the weapon is "autocannon_40mm_CTWS", but the muzzle is "HE" (found out with 'currentMuzzle' command via console)

How do I get this 'muzzle' thing?

lavish stream
#

does currentWeapon not give you what you need?

ivory lake
cyan dust
cyan dust
languid fable
#

does anyone know how to make a completely solid, none transparent background for a map cover? I want to create an ao and then just completely blackout the rest of the map so the players only see within the AO

#

using like "ColorBlack" is still transparent

open hollow
#

someone tryed make rivers "flow" ?
something like if you start swiming the current will drag you, same with boats

#

i just noticed that setspeed dont work in water :/

languid fable
jade acorn
jade acorn
sullen sigil
#

its probably pretty easily doable tho

open hollow
#

i mean, you can use a setpos... but its quite inneficient

sullen sigil
#

setvelocity oneachframe

#

subtract last velocity set with system

open hollow
#

setvelocity dont work when you are on water

#

in units, i didnt tryed on vehicles

sullen sigil
#

then yeah setposasl

open hollow
#

setpos on each frame on multiplayer

#

sounds dangerus, maybe if its done on server side?

sullen sigil
#

its not

#

just do it on vehicle driver

open hollow
#

on vehicles, setvelocity seems to work, ill try to do it then, sounds fun to do

sage marsh
#

Is there a way to change a units "Display name" to something else.

Example: changing from "Autorifleman" into "Bob" when you hover your crosshair to the unit?

open hollow
#

it removes the "swiming state" :/

#

dedmen i have an idea for a new command hmmyes

jade acorn
#

either make a new unit through faction config (needs to be a mod) or completely remove/force disable that nametags thing and write your own like ACE mod does

#

does waitUntil need an existing variable to return true or false for it? I'm creating the variable through a trigger that starts later than a script with the suspension, I thought waitUntil {sleep 1; !isNil myVariable}; would work but instead I get an error that the command returned nil.

hallow mortar
#

isNil requires the variable name to be given as a string

jade acorn
#

oh

#

I'll go and try that, thanks

tacit tartan
#

Hey, does anyone know how to force combat stance on an object not AI but multiplayer Object
Thanks

graceful dew
# graceful dew ``` _gunner = gunner _this; player setPos getPos _this; _gunner setPos getPos _t...

This is what ended up working and going with:

_object = (_this select 0);
_caller = (_this select 1);
 
private _gunner = gunner _object;  
private _unitturret = _object unitTurret _caller;  
private _FFVTurrets = allTurrets [_object, true] - allTurrets [_object, false];
private _cargoindex = _object getCargoIndex _caller;

moveOut _caller;  
moveOut _gunner;  

if (_unitturret in _FFVTurrets) then {
    [_caller, _object] remoteExec ["moveInGunner"];  
    [_gunner, [_object, _unitturret]] remoteExec ["moveInTurret"];
} else {
    [_caller, _object] remoteExec ["moveInGunner"];  
    [_gunner, _object, _cargoindex] remoteExec ["moveInCargo"];
};

Was unable to get the waitUntil to work properly so I resorted to two calls in remoteExec

#

kind of worked in testing but still needs some work

#

Either waitUntil checking position is empty or execVM'ing the move commands and waitUntil scriptDone script handle

jade acorn
vapid scarab
#

So I have a mod called Experimental Drugs. Works just fine. Im creating a config patch for a starwars unit. I pop my original release pbo into the new addon folder. I create a new pbo, and I only added stuff to rewrite display names and similar details, all string variables that are used for display and nothing else. Its purely a config patch. The pastebin below contains the config for the pbos and a sample of the first item.

bax_drugs.pbo (drug mod)
sfa_boosts.pbo (config patch)
https://pastebin.com/gyFYVr2J

When I pair the config patch pbo with the original mod, I start getting errors.

#

As for the error referencing different classes, the recovaMax error occurs when it imports the configs because recovaMax is the first one listed, and chronoClot occurs because its the first when in alphabetic order.

lavish stream
#

It's a config problem.

vapid scarab
#

ChronoClot has the almost exact same config as RecovaMax in the sample, with the literal difference being the names.

lavish stream
#

And it's because you're not inheriting.

vapid scarab
#

Well, i assumed it was an inheritance issue. But i havent been able to figure out how to fix it. Could you explain to fix it please?

lavish stream
#

from your patch mod.

class CfgWeapons {
    class ACE_ItemCore;
    class BAX_RecovaMax_item: ACE_ItemCore {
        displayName = "Energized Kolto Stim";
    };
};
vapid scarab
#

AHHHHH! I think i know how i screwed myself up.

#

Thank ya

#

Ill double check this when i get home

vapid scarab
#

TLDR: Even though im smart, im also sometimes stupid ๐Ÿ˜ ๐Ÿ™ƒ

kindred zephyr
warm hedge
#

No, displayName cannot be update on the fly

kindred zephyr
#

yeah, but the term used is obviously not the correct one, he wants to change the name that shows upon being aimed

warm hedge
#

That's pretty much exactly what displayName means

jade acorn
#

if ACE is used it will display name given through setName/cfgIdentities because it removes the vanilla feature.

kindred zephyr
#

ah, that might be why I remember using it in the past

copper jay
#

question for you find lads, im useing this mod https://steamcommunity.com/sharedfiles/filedetails/?id=752850965 just moved to my server, i have a trigger for activation looks like this

0 = execVM "scoring\airesp.sqf";
0 = execVM "scoring\btToolbox.sqf";
0 = execVM "scoring\init.sqf" ;
0 = execVM "scoring\initPlayerLocal.sqf";
0 = execVM "scoring\misc.sqf";
0 = execVM "scoring\ModifiedBISFnc.sqf";
0 = execVM "scoring\PrykHitPart.sqf";```

Works fine, what i am trying to do is have another trigger that will stop it. the deletevehicle for the trigger worked but i just want to turn it off so when somone is useing it it will work for them.
hallow mortar
#

That very heavily depends on what's actually in those files - how the mod's scripts work and whether any provision has been made to turn it off. It may even be impossible to fully turn it off, depending on what exactly it does.
You might find someone willing to go through and investigate, and/or modify the scripts so they can be stopped, but it'd be a fair bit of work.

kindred zephyr
#

I have an action that is attached to players but the conditional is proving to be detrimental in some cases in order to hide it.

Is there a way to make it happen less often?

Or should I approach the problem from other side and instead remove/readd the action upon the conditionals being achieved?

winter rose
hallow mortar
copper jay
vital silo
#

Good afternoon, does anyone know of an extension that allows you to download image files?

jade acorn
#

I have an AI transport helicopter that is supposed to be escorted by another AI chopper. How to make the other folow the transport one? Grouping them is not the way because when transport heli gets a transport unload waypoint, the other will land too despite having no passengers. Placing a follow waypoint on the transport heli with a returning false condition does not really work because escort changes the destination very slowly and by the time it starts moving, the transport heli is already done with its waypoints

#

managed to get it somehow working with a while + move loop but perhaps there is a proper function or a better way to do that (the helicopter jiggle between each repetition of the loop is kinda visible)

stable dune
#

I assume it doesn't work on helis

jade acorn
#

convoy separation requires both vehicles to be in a single group and I can't do that because when transport helicopter lands, the escorting one must stay in air

granite sky
#

Spamming limitSpeed based on distance to convoy lead works well for land vehicles. Not sure if it applies to air vehicles or not though.

jade acorn
#

as in speed value equal to the distance between two vehicles?

granite sky
#

No, maths is involved.

#

Principle is that you set limitSpeed higher than the convoy speed (or lead speed, I guess) when the separation is too high and lower when it's too low.

jade acorn
#

btw what is the cause of jitter when using unitCapture/Play? I recorded movement with 30 FPS set in the command but the rubberbanding is kinda visible, especially when the movements are little, is turning it up to 60 worth it?

#

I'm doing this on the south-eastern side of Altis so perhaps the floating point is the cause and I just should not be bothered

granite sky
#

Check if it's any better around [0,0], I guess.

#

visible jitter at 20km doesn't seem super-likely to me unless you have your face right up against an object.

mystic scarab
#

Does anyone have experience with the VSM mods? I can't find the uniforms in cfg and they don't show up in the editor, but they're there on the characters, it's weird.

granite sky
#

uniform player

mystic scarab
#

I get a class from that, but I can't find it in cfg and it's not available to place down in the editor. I dropped it from a character in Zeus and I just got a generic dummy container model instead of a uniform. This happens for all the uniforms in that mod, but I see them on characters. Also, if I try sqf getText (configfile >> "CfgVehicles" >> "Item_U_BG_Guerrilla_6_1" >> "vehicleClass"); I get ItemsUniforms, but if I try with any of the VSM items, I get nothing, even though I can get the class name for the worn uniform

jade acorn
#

maybe it's assigned as a unit body, not a uniform? But this would probably require you to look into the actual config instead of using the viewer I guess

#

or reach out to the VSM team, I think Jakerod is one of the devs

granite sky
#

Uniforms are in CfgWeapons, not CfgVehicles.

#

CfgVehicles has some stuff that's various equipment items on the ground.

austere apex
#

I have a question, I added M2 to the vehicle using the 'Attributes' section, and I also modified the vehicle to have more resistance. My question is, what should I do to export the vehicle to my missions?

warm hedge
#

What do you mean by export?

austere apex
#

Yes, I don't know how to refer to that, but I want the vehicle to appear in my cooperative missions. I added the turret in Virtual Reality with the help of Eden Editor, but I don't know what I have to do to use it in my missions.

warm hedge
#

Eden Editor can change a vehicle's appearance, if that's what you mean

austere apex
#

Look, in these images, it shows how the turret looks in the Eden editor, and the second one is when I start the mission. What I want is to be able to use the vehicle with the added turret in my missions (they are usually dynamic), but I don't know what I have to do.:(

warm hedge
#

...You mean you attachTo'd that HMG?

austere apex
#

yes

#

I tried to do it with the Zeus menu during a mission, but it was impossible. That's why I want to know how to 'export' the vehicle with the attached turret.

warm hedge
#

So the goal is to attach the HMG that is useable from vehicle? That's not possible, or rather, very hard

austere apex
#

No, the goal is to be able to use the vehicle in multiplayer because I play Dynamic Recon missions with my friends, and I want to be able to use it in those missions.

warm hedge
#

Then you probably want a Mod to expand Zeus' fnctionality. I don't know which it could be but injecting a code is not a impossible task

flint topaz
austere apex
#

Okay, I will try that. I also forgot to mention that the vehicle only appears in the Eden Editor; it seems to be locked for Zeus as it doesn't appear in the menu.

hallow mortar
#

If you have the attachTo and stuff working properly and the gun is usable when you test it, then select both objects in the Editor, rightclick and create custom composition.
They will then be available, together, in the compositions > custom tab of the Zeus menu, provided the server or mission is set to allow composition init code to run (https://community.bistudio.com/wiki/Description.ext#zeusCompositionScriptLevel).

Note that if the init field code you used relies on the objects' Editor variable names, you'll need to rework it, because those won't reliably exist when placing multiple copies via Zeus. You could try only having the vehicle in the composition, and having its init code use createVehicle to dynamically generate a turret per vehicle.

mystic scarab
#

Hello, how can I differentiate between a backpack and a vest/uniform when getting them from a container with something like the everyContainer function? I'm trying to save them and recreate them for persistency, and I want all bags to persist, but backpacks are created with a different function from uniforms and vests.

meager granite
#

for uniforms and vests

#

check the class that command returns, not class of the container (it will be dummy holder class)

#

backpacks can be checked with

getNumber(configOf _container >> "isbackpack") == 1
mystic scarab
stark fjord
#

Btw is sqf binarization still a thing or forgotten project, also, under what cases does it help with speed of the execution?

stark fjord
#

Ye

#

Or is it simply meant more as an obfiscation method?

meager granite
#

Yeah, obfuscation is also a thing

stark fjord
#

So it only speeds up eg mission load time due to no need to compile functions

#

Or example obsolete execVm

sullen sigil
#

yes

meager granite
#
  1. Use pastebin
  2. You can't exitWith from top most scope inside event handlers that expect return value
  3. By returning 0 you will repair the vehicle
winter rose
#

How to make this script that vehicles don't receive any damage from the environment/terrain? Shouldn't it be the if (isNull _source) exitWith {0}; ? That script is atm running on the server and doesn't seem to work.
(please do not post big chunks of code)

meager granite
#
_vehicle addEventHandler ["HandleDamage", {
    if(true) exitWith {0}; // Won't work, event handler didn't return anything, top scope was aborted
}];
_vehicle addEventHandler ["HandleDamage", {
    call {
        if(true) exitWith {0}; // Will work because last statement was call that returned 0
    };
}];
#

instead of 0 you need to return previous damage value, you can calculate it with:

if(_hitIndex < 0) then {damage _vehicle} else {_vehicle getHitIndex _hitIndex}
#

returning 0 will mean environment damage will actually repair the vehicle

austere apex
#

I tried in the following ways, but none of them worked. ['BlackMamba''''14_(Sedena23)', [-0.03, 0.45, 1.3]]; ['BlackMamba''14_(Sedena23)', [-0.03, 0.45, 1.3]];

hallow mortar
austere apex
#

The thing is, before, I was using a variable name to place it in the code. Now that I try to use the original vehicle name, it's not working.

hallow mortar
#

https://community.bistudio.com/wiki/attachTo
As described in the Parameters information, attachTo only accepts Object references - a specific data type used internally by the game. When you use a variable name, you're giving it something containing an Object reference.
What you're doing by adding in these things enclosed with ' is giving the command String data types. Strings are plain text data and don't directly refer to an object. An object's classname, the internal name for all objects of that type, is usually represented as a String. For example, the Hunter's classname is "B_MRAP_01_F". Is that what you're trying to use? You can't do that, firstly because attachTo doesn't accept Strings, and secondly because a classname describes all objects of that type, not a specific one.

hallow mortar
#

About making the composition available in Zeus:
You need to verify that either the server's config, or the mission's description.ext file, has the line zeusCompositionScriptLevel = 2; in it. Note that if both are defined, the description.ext takes priority.
The composition's overall availability isn't mission-specific and doesn't rely on this setting. Even if this setting is set to 0, the composition should still be available (assuming Zeus doesn't have any budget limits), it just won't work properly.
Because custom compositions are part of your profile, not part of a mission, you'll need to send people the composition if you want others to be able to deploy it themselves.

amber basalt
# meager granite instead of `0` you need to return previous damage value, you can calculate it wi...

Thanks, with this code (after the _hitIndex select in the previous code I sent):

    _prevDamage = if(_hitIndex < 0) then {damage _vehicle} else {_vehicle getHitIndex _hitIndex};
    diag_log _source;
    diag_log side _source;
    call {
        if (isNull _source || side _source == sideEmpty) exitWith {
            diag_log _prevDamage;
            _prevDamage};
    };
    _damage

when hitting some pipes and the vehicle being on top of them, log prints:

19:24:24 <NULL-object>
19:24:24 UNKNOWN
19:24:24 f16 Overflow

Due to the f16 overflow, it just gets stuck there.

How would you go about on modifying this script to make so that vehicles can't receive any damage from the objects they really should not be destroyed from (such as trees, which happens quite often)?
https://community.bistudio.com/wiki/Side With this documentation it says that it should be "empty" side, however in the log it's Unknown for some reason, and I'm quite worried that adding this instead of it being empty can cause other major issues.

meager granite
#

Its empty only for 3DEN stuff, I don't know about it much

#

I think checking for null source should be enough

amber basalt
#

ah, there's that, right. I'll try to modify it a bit.

meager granite
#
    call {
        if (isNull _source || side _source == sideEmpty) exitWith {
            diag_log _prevDamage;
            _prevDamage;
        };
        _damage
    };
amber basalt
meager granite
#

Alternative to all this, without any calls and making sure this is the last statement in the EH:

    if (isNull _source || side _source == sideEmpty) then {
        diag_log _prevDamage;
        _prevDamage;
    } else {
        _damage
    };
#

but you could end up with nested ifs mess if you decide to add more conditions

amber basalt
#

Also how to deal with the "f16 OverFlow"?

meager granite
#

if its some engine config warning, I can't help you

amber basalt
#

https://pastebin.com/YbxTJgRR
This is the code that it's using now, however, when still crashing to a car wreck the tank explodes while ending up in the if statement (confirmed by the log). Same was with a littlebird when my main rotor hits a a tree, it prints the log but damage still received would exclude air vehicles later, but the main priority is to get the tanks working now that they don't randomly explode with the current state of Arma 3 physics + some of our mod vehicles like CWR M1. Since the log is not clearly printed every frame, is there a chance that Arma doesn't run the EH on every frame, and it could be the cause of why the code isn't working properly?

meager granite
#

You get _unit from arguments but operate _vehicle

amber basalt
#

oh right so:
_prevDamage = if(_hitIndex < 0) then {damage _unit} else {_unit getHitIndex _hitIndex}; should work?

meager granite
#

yes

#
diag_log [_prevDamage];
```to log even non-existent vars and nils)
amber basalt
# amber basalt oh right so: ``_prevDamage = if(_hitIndex < 0) then {damage _unit} else {_unit g...

Even after this change, it seems to take damage which causes the tank to blow up, which is really odd, although it logs it a bit more frequently. I guess I need a bit better logging where the killing blow damage really comes from, and if in the end the source isn't really null... It also seems that the appears on the helicopter the blades hitting the tree still deals damage and I confirmed that this was null for sure.

But I'll continue later. Thanks for the help with the event handlers!

jovial totem
#

yo, just a quicky, I have briefing, can I do (IF getPlayerUID) == number from player to make separate briefing for players? Or will it catastrophically fail?

fair drum
#

You need to make a function that keeps in mind the locality of the commands, then you either run that function on that client or you remoteexec that function to the client from the server

jovial totem
#

from initPlayerLocal.sqf I call sqf that has:
if (!hasInterface) exitWith {};
waitUntil {!isNull player};
player createDiaryRecord ["Diary",["example","This works"]];
if I use it as:
(IF getPlayerUID) == number one
player createDiaryRecord ["Diary",["example","This?"]];
(IF getPlayerUID) == number two
player createDiaryRecord ["Diary",["example","will it?"]];

fair drum
jovial totem
#

thx

wind hedge
#

Guys, any idea why:

_potentialNpcs = agents select {_x getVariable ["isNpcAgent",objNull]};

Would give a "Error GIAS pre stack violation" error?

#

Doesn't happen on all matches just some

hallow mortar
#

If the agent doesn't have the variable at all, then the select condition will return objNull. Since that isn't a bool or nil, select doesn't know what to do with it.

#

You should probably use false as the default variable value instead.

wind hedge
hallow mortar
#

That would add them to _potentialNpcs if they have the variable at all, regardless of whether it's true or false. So technically functional, I think, but it depends what you want to do with it.

cosmic lichen
#

isNPCAgent ready suggests a Boolean value.

#

What about this?

wind hedge
cosmic lichen
#

Then just use getVariable with some default value that will never be set.

wind hedge
old thorn
#

I am sorry, but does anyone know how to make AA actually work? I assumed a reveal script could help. If anyone has a reveal script that they can give to me I would appreciate it

jade acorn
#

what AA? vehicles and AA units work pretty well on their own if target is within distance. SAM system needs a radar

granite sky
#

(except for the locality)

fair drum
#

@old thorn @jade acorn I'm assuming skittles is running into the issue where radar AA stays in passive radar mode to start until it gets a signature, then lights up. it does that for protection. typically, the AA won't switch active unless it physically sees the aircraft, recieves info from another active aa, or gets pinged with aircraft radar. you can force it to always be on using enableVehicleSensor

jade acorn
#

I didn't assume anything because my mind-reading orb is out of service sadcowboy
but this could be the case

hallow mortar
#

Are you sure you meant enableVehicleSensor? Seems like setVehicleRadar is the better fit

grand idol
#

I'm trying to set up a user action so that hitting the same key toggles a display on/off. Can this be done in CfgUserActions, or will it need a function? If a function, it seems that when the display is open that the key down is ignored. How to capture that?

class CfgUserActions
{
    class BSF_OpenAM
    {
        displayName = "Asset Management";
        tooltip = "Open the BSF Asset Management UI";
        onActivate = "createDialog 'BSF_AssetManagement_Dialog'";
        onDeactivate = "";
        onAnalog = "";
        analogChangeThreshold = 1;
    };
};

class UserActionGroups
{
    class BSF_controls_group
    {
        name = "BSF";
        isAddon = 1;
        group[] = {"BSF_OpenAM"};
    };
};

class CfgDefaultKeysPresets
{
    class Arma2
    {
        class Mappings
        {
            BSF_OpenAM[] = { 0x25 };    // k
        };
    };
};

In the dialog I can set an onKeyUp EH that fires a function, but when I've done that in the past I've pre-defined the key code. What mechanism is used in a function to recognize a keybind?

warm hedge
#

onActivate there just execute written SQF. So no, like, you can just write hint "it's working" and call it a day

real tartan
#

how to check if object have inventory space ? ( e.g. you can put items to it, no need to check there is a space left )

hallow mortar
#

Checking whether maxLoad is more than 0 would probably do it

hallow mortar
# stable dune <https://community.bistudio.com/wiki/canAdd>

This is for checking if there's enough space remaining to fit a particular item. It's not useful for checking whether an object is an inventory container at all, because something that is a container but is simply full would return false. Avocato specifically wanted to check if it is a container, disregarding whether there's empty space.

queen cargo
#

little developer overhead

#

backward compatibility was always shit

#

live in the past = you are fucked :white_check_mark:

#

lil OT btw.
writing OOS makes fun ^^
only thing i miss now is some IDE

grand idol
hallow mortar
#

I think actionKeys and related commands should do it. That's how vanilla keybinds can be got, and it shouldโ„ข work for mod keybinds too

keen stream
#

@grizzled cliff "eh fuck it, backward compat is easy enough" <-- This is going to bite you in the ass one of these days... ;)

manic flame
#

Hi, im having an issue with the "Fired" event handler.

The fired event handler calls this code:

if (!(_unit getVariable "alerted")) then {
    _unit setVariable ['alerted', true, true];
    systemChat "Unit set to alert";
    {
        private _leader = leader _x;
        if (isPlayer _leader) then {
            _leader createDiaryRecord ["Diary", ["Artillery Alert", _message]];

            _message remoteExec ["hint", owner _leader, true];
                systemChat "Message sent to";

        };
    } forEach allPlayers;
};

I want to send the hint only to group leaders of a squad. But the remoteExec seems to be failing. Any ideas?

#

Everything else works fine

proven charm
cosmic lichen
#

looping allPlayers and then checking if unit is player?

granite sky
#

Checking if their group leader is a player.

cosmic lichen
#

_message remoteExec ["hint", allPlayers select {leader group _x == _x, true];

#

No loop required

stable dune
#

Does getVariable return false if that is not set.
I mean does !(_unit getVariable "alerted") work or should it be

_unit getVariable ["alerted",false]
manic flame
#

getVariable is fine yeah

cosmic lichen
#

_message
Where is message coming from?

manic flame
#

its a private variable at the top, thats fine too

cosmic lichen
#

In the EH?

manic flame
#

No, in the separate script, EH calls the script.

cosmic lichen
#

This will only trigger for players

manic flame
#

Yeah, thats intended

cosmic lichen
#

ok

manic flame
#

I dont think AI need to know about arty

cosmic lichen
#

The Eh is attached to player unit?

manic flame
#

to enemy artillery AI, the script is meant to trigger on fired,

#

on EH fired

#

everything in the script runs fine, my issue was sending the data to the actual group leader

cosmic lichen
#

Did you test that on a dedicated server?

#

Or only Hosted or SP?

real tartan
#

does disableAI improve performance in mission? If yes, which features to disable ?

proven charm
jade acorn
#

with simulation disabled the FSMs are still executed iirc, as in a non-simulated unit still collects info about targets, will go into aware state if detected combat nearby etc

velvet merlin
#

any EH, beside HandleDamage, you may not call the function in the EH directly?
_x addEventHandler ["XXX",FUNCTION]; (vs _x addEventHandler ["XXX",{_this call FUNCTION}];)

granite sky
manic kettle
#

I'm experimenting to create a server authorative hashmap so i dont need to constantly update the hashmap over remoteExec/JIP/publicVariable queue

How can i pull my hashmap from the server as a client?

granite sky
#

remoteExec + publicVariableClient.

open hollow
#

well i was trying to do a script that give rivers a "flow" so you cant cross them easily, but if found some dificulties:

Units
when you are in the water, there is some kind of "swiming state" where:

  • addforce insta kill you ( you cant ragdoll in water)
  • setvelocity dont work
  • setpos on eachframe, works, but you are in a standing position like walking

on vehicles you can use setvelocity, so maybe a well crafted script might work, but if infantery can cross easily there is no point

any ideas?

manic kettle
#

oh cool, thanks john

grand idol
#

I'm wading into CfgUserActions and actionKeys and have a couple of questions. Ultimately, I'm trying to capture and filter keys when a dialog is open just so users can kit the same key to open and close a dialog. In the dialog I have an EH:
onKeyDown = "_this call BSF_Keybind_AM";
If the action is bound to an unmodified key, such as "K", the function is handed [Display #25301,37,false,false,false] and if I log (actionKeys "BSF_OpenAM") I get "37". This is great and useful, but if the action is bound to a modified key such as "Alt-K" the script is handed [Display #25301,37,false,false,true] but logging (actionKeys "BSF_OpenAM") hands me an exponent value "9.39524e+008". Alt+anykey logs the same exponent value. Is there a way to get the keybind in a format that can be used in an IF or SWITCH statement? I was thinking that I might have to take the values of what is sent to the function - [Display #25301,37,false,false,false] - and concat it into something that can be compared to the result of (actionKeys "BSF_OpenAM") Is this plausible?

manic kettle
granite sky
#

You might find that setPosWorld behaves differently to setPos.

#

If not, I guess you can force the animation with switchMove, but that might be super-glitchy.

manic kettle
#

setposworld also resets the animation

open hollow
manic kettle
#

I doubt what you want is really possible

velvet merlin
leaden summit
#

If I have a function that spawns a group _grp1 then I create a trigger in the same function how do I reference that group?
I'm basically creating ambushes on the fly and want the trigger to reveal players to the ambush group and change the ambush group's behavior etc
But I'm pretty sure when the trigger fires, {_grp1 reveal _x} foreach allPlayers; it's not going to know what _grp1 is will it?

proven charm
little raptor
#

you can just use setVariable

little raptor
warm hedge
#

So pretty much I'm lost because I am not a math guy and looking for a correct solution. Basically I'm looking for a way to convert vectorDir Up Side into Euler, as in, model.cfg rotation XYZs. The goal is to align a model rotation into an object's rotation. As you already know Gimbal Lock is a thing, so assuming using Quartenion is the correct way, but actually I'm clueless clueless... vectors -> Quartenion -> rotation, is this actually a correct way?

fleet sand
# warm hedge So pretty much I'm lost because I am not a math guy and looking for a *correct* ...
little raptor
#

But I didn't completely understand your question. What do you mean by aligning a model rotation with object rotation?

warm hedge
#

Let's say you have a turret, that is basically rotates in X and Y. I have an arrow object. Rotate the arrow in Eden, the X and Y will change and turret will look where the arrow looks. Photo is the concept, but in XYZ

little raptor
#

but you don't know the rotation axes do you?

#

or how an animation would affect the turret

#

you can find them out by animating the object ofc, but that information is not immediately accessible

warm hedge
#

Forgot to mention but I have my object and the script is supposed to control it. It has basically every possible translation/rotation animation

little raptor
#

I'm not 100% sure how the game does the rotation animations, but if it uses Euler angles, given a certain orientation in model coords, you can find the Euler angles and anim values as follows:

  1. if it does X Y Z rotations, the rotation matrix will look like this:
[                        cos(b)*cos(c),                       -cos(b)*sin(c),         sin(b)]
[ cos(a)*sin(c) + cos(c)*sin(a)*sin(b), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(a)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(c)*sin(a) + cos(a)*sin(b)*sin(c),  cos(a)*cos(b)]

(a, b, c are euler angles)
2. that matrix will correspond to this (in SQF code):

matrixTranspose [_side, _dir, _up]; // side dir up are in model coords

so you can solve for a, b, c
3. you map those angles to animation controller values based on your animation min/max angles

#

this is the way you solve for the angles btw

#

that example is for Eden rotation stuff but the equations do apply here too (tho rotations in A3 are left handed, not sure if I accounted for that in the equations back then)

little raptor
#

or instead of doing it backwards, remember that the columns of that matrix in 1. are [_side, _dir, _up]. so get the actual vectors, then compute them using those equations, and see if they match

warm hedge
#

Let's see if I can understand you ๐Ÿ˜…

fair drum
limber panther
#

Hello!
I'm wondering, when i use attachTo script to attach an object to another, is there a script to release it and therefore drop on the ground for example? I know i can delete it or play around with that, but is there specifically a way to detach the attached object and make it independent again? Thank you.

limber panther
tough abyss
#

If you haven't done a public release i would consider breaking the api now.
Once its public you can maintain backwards compatiable imo
Maybe do a major version change if you need to break the api later on

oblique arrow
#

Hey peeps, I'm currently working on an intro cutscene for a mp mission, I've used
[cam1, "INTERNAL"] remoteExec ["switchCamera"];
to move all players cameras into cam1, now the problem is how do I switch them back to each players respective unit?
Is there a simple way to get everyones local player so I can just remoteExec again?

#

I tried using
[player, "INTERNAL"] remoteExec ["switchCamera"];
which works in singleplayer, but in mp that doesnt work since its not for the individual players afaik? (if it exists at all in mp)

little raptor
oblique arrow
#

You are my personal hero of the day โค๏ธ โญ

little raptor
#

the reason your code didn't work is that it was evaluating player on whatever PC that runs the remoteExec

oblique arrow
#

Oooohh

#

Yeah that was no good then, and I assume via the call it does it on the individual players PC?

little raptor
#

via call you send whatever's in {} and ask each PC to execute it themselves

#

and when that code executes on another computer, the player on that computer is passed to the switchCamera

#

another way was to define a function on each computer and do [] remoteExec ["PI_fnc_switchCamera"]

//  PI_fnc_switchCamera
params [["_cam", player]];
_cam switchCamera "INTERNAL";
hallow mortar
#

I'd definitely suggest doing all your camera stuff in locally-operating functions since all the camera commands are LA/LE. Just a lot easier to handle it all locally rather than remoteExecing everywhere and dealing with local-only objects from remote machines.

oblique arrow
#

and then it took a few hours after all

granite sky
velvet merlin
granite sky
#

This one really aggravates me but I guess we're stuck with it.

#

Like exitWith {0} behaves identically within SQF but somehow not for commands that call SQF.

grand idol
#

I'm re-asking this, hoping time of day helps...

I'm wading into CfgUserActions and actionKeys and have a couple of questions. Ultimately, I'm trying to capture and filter keys when a dialog is open just so users can kit the same key to open and close a dialog. In the dialog I have an EH:
onKeyDown = "_this call BSF_Keybind_AM";
If the action is bound to an unmodified key, such as "K", the function is handed [Display #25301,37,false,false,false] and if I log (actionKeys "BSF_OpenAM") I get "37". This is great and useful, but if the action is bound to a modified key such as "Alt-K" the script is handed [Display #25301,37,false,false,true] but logging (actionKeys "BSF_OpenAM") hands me an exponent value "9.39524e+008". Alt+anykey logs the same exponent value. Is there a way to get the keybind in a format that can be used in an IF or SWITCH statement? I was thinking that I might have to take the values of what is sent to the function - [Display #25301,37,false,false,false] - and concat it into something that can be compared to the result of (actionKeys "BSF_OpenAM") Is this plausible?

proven charm
grand idol
hallow mortar
grand idol
hallow mortar
#

You don't need to compare any key codes for that. Just have the keybind detect whether the display is open, and either open or close it depending on the answer

grand idol
#

Such as an IF statement in the onActivate = "" field?

hallow mortar
#
if (isNull (findDisplay _yourIDD)) then {
    call troy_fnc_openDisplay
} else {
    call troy_fnc_closeDisplay
};```
grand idol
#

OK, thanks, I'll give it a shot. I was under the impression that the open display blocked the passing of keys outside of the display.

#

I had been testing something similar originally.

hallow mortar
#

Well, test it.
If that is the case, then you have a display of a type where Esc will always close it anyway so you might not need to worry about this

wind hedge
#

anyone knows if this command will work as intended when running from the server on a dedicated server:

if (((getPos _vehicle) getEnvSoundController "houses") >= 0.7) then {
  _vehicle limitSpeed 20;                    // In cities reduce speed limit a little bit.
};
#

_vehicle is also local to the server with an Ai unit on the server driving it

grizzled cliff
#

haha thats what i mean, i want to implement the API in a way that when a new version of the main library is released you dont have to recompile a plugin unless its absolutely needed.

#

i was thinking "i could pass all the sqf functions to client plugins as a struct..."

#

but then i thought if that struct changes because sqf functions get added/removed

#

then older client libraries would break

#

so instead i dynamically get teh pointers from the library

#

that way if a new version is released the older plugins will still just be calling the dynamic allocated functions they know exist

sullen marsh
#

What version of detours this use?

leaden summit
tough abyss
#

anyone know how i get say this this addaction ["Enter Bunker",{(_this select 1) setpos [markerPos "Entrance_1" select 0, markerPos "Entrance_1" select 1, 0]}]; to run a script when used?

#

or have a trigger run a script?

#

idk what im doing XD

formal stirrup
#

What are you trying to get the action to do?

tough abyss
formal stirrup
#

Ah your the guy from tenured's place. One moment

#

One moment

tough abyss
#

XD

formal stirrup
#

Using dmd, the one he linked?

tough abyss
#

ye

formal stirrup
#

Well from looking at it, Try replacing (_this select 1) setpos [markerPos "Entrance_1" select 0, markerPos "Entrance_1" select 1, 0] with [] execVM "DMD_LootSpawn\lootHandler_server.sqf";

#

Keep in mind that just calls the script itself, You'll need to handle the spawn locations seperatly

tough abyss
formal stirrup
#

As in both the server and client script?

#

Ohh

#

I get you

tough abyss
#

yeee

formal stirrup
#

(_this select 1) setpos [markerPos "Entrance_1" select 0, markerPos "Entrance_1" select 1, 0]; [] execVM "DMD_LootSpawn\lootHandler_server.sqf"

#

Plop that between the {}

#

Be careful with that though, It might be better to add the loothandler script into the init.sqf instead of this

formal stirrup
#

From what i'm seeing everytime that script is called it doesnt stop, it forces itself onto a loop

#

Calling it everytime someone goes in that bunker would cause it to run the loot spawning multiple times

tough abyss
#

ah what if i add sleep 120; to the sqf?

formal stirrup
#

Depending on where you put it, it would just delay the loop from repeating

tough abyss
#

ok gotcha

sullen marsh
#

Also, does anyone know if it's possible to entirely disable the AI system while still having them respond to move commands/fire commands

tough abyss
formal stirrup
#

I have no clue, that you'll prob have to ask tenured about

grizzled cliff
#

it uses v3 verox

#

if you cant get it to compile check the cmake file in the loader for the paths

#

sometimes the installer puts them in different places

#

ima rework that later

sullen marsh
#

Detours won't compile for some reason, need to find out why

#

I think WinSDK isn't installed

queen cargo
#

uhrm ... just some stupid idea @grizzled cliff
why not simply an array?

sturdy kernel
#

Is it possible to create a teleport script that goes of steam id? For example one person witht he correct steam id gets teleported but anyone else dosnt?

winter rose
#

yes

stable dune
grizzled cliff
#

offsets would change, i mean it could be an array of op entries, but honestly i already have the infrastructure to call and get a pointer via a name/arg signature

#

so i might as well just use that

#

also i have to do it manually

#

because im assigning static pointers

#

for speed

sturdy kernel
grizzled cliff
#

so it'll be lines and lines of this...

__sqf::unary_random_scalar_raw = (unary_function)functions.get_unary_function_typed("random", "SCALAR");
#

but its easy enough to autogenerate that

#

then im just wrapping those pointers in nice function calls

#

so in the end it'd be rv::random(100.0);

#

why you'd wanna call the SQF random function, I don't know

#

its just an example

#

:P

bold comet
#

any luck with heavy loadouts and enableStamina in v1.54 ? it doesn't seem to work or maybe there's something else i have to do ?

#

enableStamina = false + standard loadout -> i can sprint forever as intended

#

enableStamina = false + heavy loadout -> i can only walk

cobalt path
#

I am kinda trying to do an orbital drop pod script. Issue I have is that it doesn't check if it hits the ground fast enough, meaning by pod will bounce. I need to either prevent bouncing or check it faster. I wanted to use WaitUntil initially, but read somewhere that it doesnt work great in MP

[]spawn
{
    detach mfpodbase1;
    sleep 2;
    addCamShake [10, 5, 25];
    mfpodbase1 setVelocity [0, 0, -500];
    playSound3D ["A3\Sounds_F\ambient\thunder\thunder_01.wss", mfpodbase1, false, getPosASL mfpodbase1, 5, 1.5, 2000];
    while { (getPosATL mfpodbase1) select 2 > 1 } do {
      sleep 2;
      addCamShake [10, 5, 25];
      mfpodbase1 setVelocity [0, 0, -500];
    };
    player allowdamage false;
    addCamShake [10, 1, 25];
    mfpodbase1 setVelocity [0, 0, 0];
    mfpodbaseloc1 = getPosATL mfpodbase1;
    mfpodexp1 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle mfpodbaseloc1;
    mfpodexp1 setDamage 1;
    mfpodbase1 setVelocity [0, 0, 0];
    deleteVehicle mfpoddoor1;
    sleep 3;
    player allowdamage true;
};
abstract bay
#

How to remove the marker Minefield on a map in Zeus?

cobalt path
abstract bay
#

no

cobalt path
proven charm
cobalt path
proven charm
#

you can kill it with this (inside the EH code): removeMissionEventHandler ["EachFrame",_thisEventHandler];

cobalt path
# proven charm you can kill it with this (inside the EH code): ```removeMissionEventHandler ["E...
[]spawn
{
    detach mfpodbase1;
    sleep 2;
    addCamShake [10, 5, 25];
    mfpodbase1 setVelocity [0, 0, -500];
    playSound3D ["A3\Sounds_F\ambient\thunder\thunder_01.wss", mfpodbase1, false, getPosASL mfpodbase1, 5, 1, 2000];
    addMissionEventHandler ["EachFrame", {
        if (getPosATL mfpodbase1) select 2 > 0.1)
        then
        {
            sleep 2;
            addCamShake [10, 5, 25];
            mfpodbase1 setVelocity [0, 0, -500];
        }
        else
        {
        player allowdamage false;
        addCamShake [10, 1, 25];
        mfpodbase1 setVelocity [0, 0, 0];
        mfpodbaseloc1 = getPosATL mfpodbase1;
        mfpodexp1 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle mfpodbaseloc1;
        mfpodexp1 setDamage 1;
        deleteVehicle mfpoddoor1;
        sleep 3;
        player allowdamage true;
        removeMissionEventHandler ["EachFrame",_thisEventHandler];
        };
    }];
};

Something like that I assume?

proven charm
#

yea something like that

fair drum
#

That's not gonna end well for you lol

proven charm
#

sleep wont work inside the EH though

cobalt path
#

oh

#

anyway I can?

fair drum
#

Use CBA wait until and execute instead of all this

#

It will evaluate every frame

proven charm
#

you should keep the sleep required code in the original loop you have and time critical code in the EH

cobalt path
# proven charm you should keep the sleep required code in the original loop you have and time c...

I changed the code a bit, but however now I am getting missing ; error somewhere around if statement

[]spawn
{
    detach mfpodbase1;
    sleep 2;
    addCamShake [10, 5, 25];
    mfpodbase1 setVelocity [0, 0, -500];
    playSound3D ["A3\Sounds_F\ambient\thunder\thunder_01.wss", mfpodbase1, false, getPosASL mfpodbase1, 5, 1, 2000];
    addMissionEventHandler ["EachFrame", {
        if (getPosATL mfpodbase1) select 2 > 0.1)
        then
        {
            addCamShake [10, 5, 25];
            mfpodbase1 setVelocity [0, 0, -500];
        }
        else
        {
        player allowdamage false;
        addCamShake [10, 1, 25];
        mfpodbase1 setVelocity [0, 0, 0];
        mfpodbaseloc1 = getPosATL mfpodbase1;
        mfpodexp1 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle mfpodbaseloc1;
        mfpodexp1 setDamage 1;
        deleteVehicle mfpoddoor1;
        removeMissionEventHandler ["EachFrame",_thisEventHandler];
        };
    }];
    sleep 5;
    player allowdamage true;
};
proven charm
#

right under the addMissionEventHandler you are missing (

formal stirrup
#

((getPosATL mfpodbase1) select 2 > 0.1)

cobalt path
#

ohhhh

#

gotcha

#

works perfectly other than it still bouncing a tiny bit, but I am sure I can fix it, maybe setvelocity is not correct command, I will see. But probably the explosion is causing it thx

lone glade
#

Don't use turtle like loadouts, ?

bold comet
#

yep that's what i'll do but the people playing my mission are already complaining

lone glade
#

tell them to git gud

tidal idol
#

Is it reasonable to use nearestObjects to find a list of all entities with 8,000 meters of a point and run an EMP script on all of them? The script only affects vehicles and disables them for 10 seconds each (already working, will not be changing it), but I'm worried that it might cause too much lag. The radius is pretty big because the eventhandler is attached to a "nuke" ammo that's configged to be a really big bomb but buildings and rocks tend to be ample cover to avoid its effects, despite its ~4km theoretical blast radius.

abstract bay
granite sky
tidal idol
#

Oh yeah meant to say nearestEntites not nearestObjects whoops

#

How can I make the script parameter _radius usable inside the Explode eventhandler?

granite sky
#

setVariable it onto the projectile object.

tidal idol
#

Like this?

granite sky
#

Yes, but you then need to read it within the EH.

jade acorn
#
_a = _this select 0;
_b = _this select 1;
_object setVariable ["data",[_a,_b]];

_object addEventHandler ["Fired", {
_a = ((_this select 0) getVariable "data") select 0;
_b = ((_this select 0) getVariable "data") select 1;
hint format["%1 and %2",_a ,_b];
}];``` example from BI Forums
tidal idol
#

Hmm that didn't seem to work. Hint did not appear. I'm a dumbass and forgot to save the script before re-packing, it worked perfectly!

tidal idol
#

Would the forEach command be appropriate to use when I want code to execute for each element in their own scheduled space? The code I want to execute contains some sleep commands, and I'm wondering if this would apply to each element at the same time, or sequentially as forEach iterates through each member of the array.

granite sky
#

forEach runs for each element sequentially, yes

#

There's even a forEachReversed now.

#

Even SQF code that runs in a separate context is guaranteed not to run concurrently.

tidal idol
#

What could I do to execute each pseudo-simultaneously? I don't need timing to be perfect but do need to give off the impression that each entity is being affected at the same time. I have some vehicle configs with an EH that runs on its own timer for each unit, so I know there has to be some way to do it.

Offload to a separate sqf?

granite sky
#

Not 100% sure what you're talking about, but probably spawn

tidal idol
#

Ah, that might be it, I was thinking call... executeVM... but I don't know the differences between all the different commands that can be used to execute code.

granite sky
#

execVM is a bit like spawn + compile.

jade acorn
#

I doubt the lag between each loop in forEach would be noticeable without running some dev debug tools, unless you're running hundreds of scripts and/or playing in 1fps at the same time

tidal idol
#

The thing is that the code I want to execute is basically "disable vehicle components for 10 seconds" with some sleep commands forcing those 10 seconds, so I can't have it go sequentially.

jade acorn
#

well if you run 500 spawns/execVMs at once, instead you'll introduce a 5 second lag if not worse I guess

granite sky
#

You'd need to give a specific example.

jade acorn
#

and that loop lag would be probably a matter of 1/1000ms?

tidal idol
granite sky
#

If it's an EMP, and every vehicle is affected for the same time, why not:

{
   //disable stuff
} forEach _vehicles;

sleep 10:

{
   //enable stuff
} forEach _vehicles;
#

Now if each vehicle is affected differently then you'd have a better argument for firing off 100 spawns.

#

Not that it's necessarily the best way to do that, but it can certainly be convenient.

tidal idol
#

Yeah, each is different (above) since I designed one code that should work with every reasonable vehicle type.

tidal idol
#

Confirmed that it works, and simultaneously on at least two objects. Code structure below in case anyone happens to stumble across this in the future.. Should have been three objects I tested it on but the plane I used to launch the nuke may ahve been caught in the blast.

winter rose
#

(and you can remove all checks but _isMan)

#
{
  if (_x isKindOf "CAManBase") then { continue; };
  _hitEntity allowCrewInImmobile true;
  _hitEntity setVehicleRadar 2;
  // (...)
  _hitEntity allowCrewInImmobile false;
  _hitEntity setVehicleRadar 0;
} forEach _nearbyEntities;
tidal idol
#

Well I'm actually in the process of implementing the isMan part so I can do things like swap out NVGs for versions with my defunct modelOptics texture versions as well as swap out weapon lights/lasers/some optics.
And since my scripts change slightly depending on the type of unit being affected, I still run some if statements using those checks.

glossy raft
#

@lone glade

bold comet
#

apparently "spine3" used to be among the non lethal hit points and now it's not

#

for reasons

#

messes up revive systems that don't rely on the player actually dying

plush belfry
#
0 spawn { 
tank doWatch (getPosATL target); 
sleep 3;  
tank fire ((weapons tank) select 0); 
};```

Having some issues with IFA and Spearhead DLC Tanks firing. Vanilla tanks and RHS tanks work fine using this simple script. I tried to do ``ForceWeaponFire`` with tanks from both the mod and the CDLC, and that did not work either. ``ForceWeaponFire`` also works with Vanilla/RHS tanks. As far as the CDLC and IFA tanks go, they fire their MG just fine if I change the ``select 0`` to ``select 1``, just their main cannon is having issues.
real tartan
#

I execute disableMapIndicators on initPlayerLocal. Does it need to be executed also after respawn / JIP ?

cosmic lichen
#

Only on JIp

#

Which you already do with initPlayerlocal.sqd

lone glade
#

Hey want a piece of information? THEY CHANGED NEARLY ALL OF THEM

#

they also changed vest and helmets armor values.

queen cargo
#

aww
:tears: for you guys

#

luckily we all rely on HandleDamage

#

ohh no wait

#

not all of us

lone glade
#

The most used ones do huehuehuehuehue

drowsy geyser
#

im trying to loop a sound but somehow it doesn't loop any idea why it doesn't work?

[] spawn
{
    while {someVar};
    private _source = playSound ["sound1", 2, 0];
    waitUntil {isNull _source};
};
#

nvm

#

just saw the error while {} do {}

#

silly me XD

jade acorn
#

does my framerate affect the accuracy of unitCapture/unitPlay? I was wondering what to expect if I record unit in 60 fps (settings-wise) and suddenly I dip into a map area that lowers my FPS by half. Not sure if I should lower settings to minimum when recording and do that as early as possible, as in before plopping stuff and scripts into the mission

little raptor
graceful dew
#

Does scriptDone return true after the code in spawn has been executed or when it has all been added to the scheduler?

proven charm
terse wolf
#

Hey guys! Im currently trying to figure out how to make an certain object only visible to certain players within in the same faction (Blufor).
Is there anyway to even make this possible?

terse wolf
#

Thank you very much

#

Does something like that also exist for general objects besides vehicles?

hallow mortar
#

General objects are vehicles

#

You can also use hideObject if you might need it to become visible to other players at some point

terse wolf
hallow mortar
#

Outside of a couple of special object types (lights, cameras, sound sources) anything that doesn't have some kind of brain is "a vehicle". Even units are technically vehicles, although if you try to create one as a vehicle it won't have its brain.

tulip ridge
# terse wolf Thats very interesting haha

Here's a snippet from a modding sample readme I found

Welcome to Arma 3 where:
    - Your helmet is a weapon
    - Your vest is a weapon
    - You are a vehicle
    - Your uniform is someone's else skin
    - Your backpack is a vehicle loaded into you
    - Your hands are attached to your weapon, and not the weapon to your hands
    - Handguns don't exist
    - Your IR pointer points backwards
    - Dammage and dissassembleInfo
#

Arma has its many quirks

terse wolf
#

Where do I need to execute createVehicleLocal?

cosmic lichen
#

Where you want the object to appear

hallow mortar
#

When do you want to the object to be created?

winter rose
#

right before it appears!

tulip ridge
#

Then why not

#

It's clearly very important info

hallow mortar
terse wolf
#

My rough idea is that on mission start it gets determined who sees the object and who doenst therfore I suppose initPlayerLocal.sqf is the way to go

hallow mortar
#

Using initPlayerLocal.sqf means you don't have to check everyone, just the local player. Thus:

waitUntil {!isNull player};
if (side group player == west) then {
  // createVehicleLocal
};```
fallen locust
#

@bold comet player allowSprint true;

west portal
#

Hello, I'm attempting to mute the player's voice in a config rather than a mission script, so that it applies to any mission. I'm using player setSpeaker "NoVoice" to do this, but I don't really have a good understanding of scripting at all. So from what I understand, I need a preinit file executed from the config to work? I think got it to execute at least.

Here's what I'm putting in my preinit.sqf:

    player setSpeaker "NoVoice"
} forEach allPlayers;```
Doesn't seem like this is working though
hallow mortar
#

You have a few issues:

  • player always refers to the local player of the current machine. So by doing that forEach allPlayers, you're just setting the voice of the local player, times the number of players currently connected.
  • preInit.sqf is not a recognised file, so it won't be automatically run. You should make a function with its preinit flag set, if you want to run something at preinit. (https://community.bistudio.com/wiki/Arma_3:_Functions_Library)
  • doing this at preinit may not be a good idea, because it has to work on the player object. The player object may not exist at the preinit stage. Using postinit may be more sensible.
west portal
hallow mortar
#

Should be.
Doing MP as well should be possible. I think you would need a bit of remoteExec and a Respawn event handler.

west portal
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

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

If all players will definitely have the mod, then use player as the target unit and remoteExec the setSpeaker commands. Each machine will detect its own local player, and instruct all other machines to setSpeaker for that unit.
If the mod is optional (some players might not have it) then it becomes more complicated, because each machine then has to detect and handle all the other players, rather than just worrying about their own. While allPlayers can do some of what you need to do that, the big issue is that players can join and leave an ongoing game, so just checking that once doesn't cover the whole mission.

jade acorn
#

how to center an image with BIS_fnc_dynamicText? the x y points seem to be taken from top left of the text rather than its center. It's a 1920x1080px image, I managed to center it with

["<img size='20.0' shadow='0' image='images\image.paa' />",[-0.5,2],-0.35,10,1,0,789] spawn BIS_fnc_dynamicText;``` but I'd like to have it more universal and working on other aspect ratios.
candid sun
#

anyone tested the new BIS_fnc_lerp yet?

queen cargo
#

what is it doing?

candid sun
#

i dunno, that's why i wondered if anyone here had tested it, i'm not at my main PC

warm hedge
solar cave
#

Hey guys, I'm experimenting with the SOG onslaught modules and would like to use them with Global Mobilisation units to simulate a soviet mass assault. Is there a resource online with the Units XML tags in a spreadsheet or something?

warm hedge
solar cave
#

Yes I was about to edit and ask if that was even the right terminology. Knowing they're called class names makes the Google much easier.

warm hedge
#

One easy way is to place multiple units you want to get, select them, right click, Log, Class

solar cave
#

Hey thank you so much! That was painless!

jade acorn
tough abyss
#

Don't know if it is intentional, but I can't seem to set PVs on the server via the Debug Console in 1.54

agile pumice
#

Question, can the Keys and Userconfig folders be in an addon folder?

#

if not, then why am I constantly seeing these folders included in the @folder and not along side it?

lone glade
#

They can, the emplacement doesn't matter as long as it's in the game root folder

agile pumice
#

thanks

#

is that true for the userconfig folder too? If I dont have the userconfig folder in my arma3 root, i get a not found error for included files

drowsy geyser
#

Better use RscPicture or RscPictureKeepAspect

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
sinful monolith
#

how i can add cooldown for addaction, i took ombra halo jump script and modified it to my needs p1 initsqf this addAction["<t color='#37A9E7'>Call Paratroopers</t>","[player] execVM 'para.sqf';"]; then para.sqf _unit = this select 0; then para.sqf ```sqf
_unit = this select 0;

openMap true;
mapclick = false;
onMapSingleClick "clickpos = _pos; mapclick = true; onMapSingleClick """"; true;";
waituntil {mapclick};

_parapos = clickpos;
_target = para1 setPos _parapos;
openMap false;
sleep 30;

_unit addAction["<t color='#37A9E7'>Call Paratroopers</t>","[player] execVM 'para.sqf';"];
trg1 setVariable ["trigger", 1];

proven charm
#

i wonder why you have two addActions there, when one should be enough...

lone glade
#

Userconfigs might need to go in the right folder.

grizzled cliff
#
[2015-12-01 15:25:15,431] - INFO  - {Z:\intercept\src\client\example_dll\client_dll.cpp:17}t:44652- SQF Random Call: 9.84707
[2015-12-01 15:25:15,441] - INFO  - {Z:\intercept\src\client\example_dll\client_dll.cpp:17}t:44652- SQF Random Call: 83.0076
[2015-12-01 15:25:15,451] - INFO  - {Z:\intercept\src\client\example_dll\client_dll.cpp:17}t:44652- SQF Random Call: 23.5357
#

nice

#
void __cdecl intercept::on_frame() {
    float rand_val = intercept::sqf::random(100.0f);
    LOG(INFO) << "SQF Random Call: " << rand_val;
}
jade acorn
#

can I use ctrlMapScale in editor? And if so, how? ctrlMapScale ((findDisplay 12) displayCtrl 51) in Eden returns a static number that does not change no matter how zoomed in or out I am

cosmic lichen
#

Yeah, that doesn't work.

#

I guess eden editor map is handled differently

jade acorn
cosmic lichen
#

You could reverse engineer the scale value int he status bar

jade acorn
#

you mean the 4th value?

cosmic lichen
#

yep

#

_dis = format [localize "STR_3DEN_Display3DEN_StatusBar_ValueRes",(worldsize * (ctrlmapscale _ctrlMap)) / (getresolution select 2)];

#

hmm

#

They use ctrlMapScale for that

#

@jade acorn ctrlMapScale works for me

#

ctrlMapScale ((findDisplay 12) displayCtrl 51)
You need to use findDisplay 313

azure fern
#

Why isn't Arma 3 pilot AI working properly?

Yes, although it works well for air combat, why doesn't it attack with appropriate ammunition for ground targets (such as shooting with cannons and then falling while there are laser ammunition suitable for tanks) or at the appropriate angle?

I made various attempts to throw bombs on the editor. Like this code that will run when Waypoint activates: this forceWeaponFire ["Bomb_03_Plane_CAS_02_F", "LoalAltitude"];

I first got this code from this topic: https://forums.bohemia.net/forums/topic/234853-fire-weapon-on-waypoint-problem-finding-classname/
and I placed the same bombs on the same plane. However, strangely enough, while most helicopters and ground vehicles managed by AI in Arma work properly (in my opinion), the planes do not work properly in the AI part. There is no action similar to a bomb or rocket launch.

What can I do regarding this issue?

I tried this code on default aircraft using the ammunition classnames below, but still no result:
https://community.bistudio.com/wiki/Arma_3:_CfgWeapons_Vehicle_Weapons
โ€‹

tough abyss
#
if (_saveVehiclesMode > 0) then {
    private _allVehicles = vehicles select {!(_x isKindOf "Static") && !((_x isKindOf "ThingX") && (([configfile >> "CfgVehicles" >> typeOf _x,"maximumLoad",0] call BIS_fnc_returnConfigEntry) > 0))};
    private _varNames = GVAR(allFoundVarNames) select 1;

    if (_saveVehiclesMode in [1,3]) then {
        {_x setVariable [QGVAR(isEditorObject),true]} forEach _allVehicles;
    };

    if (_saveVehiclesMode in [1,2]) then {
        _allVehicles call _fnc_saveVarNames;
    };
};


``` for vehicle position or Inv?
rich frost
#

hi
how are those special objects like "#particlesource" called?
Can you setVariable on them? I try to attach some data to them, but getVariable does not seem to return any value at all.

Not sure what is going on here.

winter rose
#

setVariable may not be allowed on them as they are local and quite simple objects

rich frost
#

oof

#

i was hoping to store some values on them instead of making an array. welp, array, it is.

rich frost
winter rose
#

nope

rich frost
#

only thing i can find. no clue what those are though

winter rose
#

#lightpoint, #soundsource, #reflector (iirc)
that's all I know

it's simple, just create a lightpoint, try to setVariable then getVariable: if it does not work, it's not working on them ๐Ÿ™ƒ ๐Ÿ™‚

#

you can also use allVariables to read all set variables on them

rich frost
#

tried that, didnt return anything, not even [] so i guess thats simply the case i have to accept. at least im not getting crazy cause the code looks fine ^^

#

Thanks!

winter rose
rich frost
winter rose
#

testing more & adding to the wiki doc for clarity

winter rose
#

added! thanks for the intel ๐Ÿ˜Ž

tidal idol
#

Any idea why this script is throwing a Generic Error in Expression?
if (combatBehaviour (effectiveCommander _hitEntity == "COMBAT")) then {_hitEntity allowCrewInImmobile true;};
Full error message in picture
hold up I may be a dumbass...

winter rose
#

(and yes it's a parentheses issue)

tidal idol
winter rose
#
if (combatBehaviour effectiveCommander _hitEntity == "COMBAT")
tidal idol
#

Working great now, thx.

winter rose
fair drum
#

when getting the relative positions for 3den entities, is it better to do modelToWorld or modelToWorldVisual?

nvm, i'm an idiot, i was referencing the same model instead of changing it with forEachIndex

i hate how it takes posting it elsewhere before your brain goes, OH HEY!

queen cargo
#

just as i noticed that right now ...
so ... we keep a WHOLE fucking shit in SQF for backward compatibility but local --> private which makes WAY less sense and breaks like 30% of all scripts available right now is a good to go?

#

seriously who the fuck is doing those stupid decisions! i got the fucking feeling you guys just hired the managers of the company i work at

winter rose
# fair drum ~~when getting the relative positions for 3den entities, is it better to do `mod...

In software engineering, rubber duck debugging (or rubberducking) is a method of debugging code by articulating a problem in spoken or written natural language. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, l...

lone glade
#

It's better to switch it now than later where it would have an even bigger impact

queen cargo
#

ehhh ... ye

#

totally forgot tha most scripts still ahve to be written

#

as arma 3 just got released

rich frost
#
[
[2bb164a0100# 163978: sign_arrow_large_f.p3d,"Debug_Helper"],
[00007FF7AB13E630,"...",1],
[00007FF7AB13E630,"...",1]
] 

I somehow ended up with this...

The first nested array has an object refernce as we usually know it, the 2, and 3, index though seem to be broken? I cant even use select # 0 on it?

lone glade
#

The alternative syntax was "found" 3-4 weeks ago

granite sky
#

You would need to explain the "somehow"

queen cargo
#

so?

#

makes this decision more valid because?

rich frost
#

Basically im creating a particle source
_spawner = createVehicleLocal ["#particlesource", [0,0,0]];

and store that as part of a nested array in a global variable for later use.
CVO_Storm_Local_PE_Spawner_array pushback [_spawner,_spawnerName, _intensityTarget ];

The array you see above is said CVO_Storm_Local_PE_Spawner_array

lone glade
#

Because it would be an even bigger mess later, and local wasn't making much sense.

queen cargo
#

ok

#

tell me

#

enlighten (better: entertain) me

#

why did local made less sense then private

granite sky
#

This part looks incorrect at least:

        CVO_Storm_Local_PE_Spawner_array = CVO_Storm_Local_PE_Spawner_array - [_spawner];   
        deleteVehicle _spawner;
lone glade
#

Consistency across the board ?

rich frost
#

ahm, that shouldnt be triggered at that point i think? lemme look

granite sky
#

Also this one:

        { _x attachTo [_player, _relPosArray]; } forEach CVO_Storm_Local_PE_Spawner_array;
queen cargo
#

consistency ...

#

rly?

granite sky
#

You seem to have a lot of code that treats that array as a simple array of objects when that's not what's in it.

queen cargo
#

so

#

where is it now consistent to?

rich frost
#

yea. it was before, then i came to the conclusion that i cant setVar on "particlesource" objects, so im switching over to a nested array with the obj and the data i wanted to store with setVar

#

but i dont think that caused my initial issue... i think at least

queen cargo
#

private was used to declare variables local to your scope
local means "is object X local to my computer"

#

eg.

lone glade
#

To private ?

queen cargo
#

is <ME> owner of <VEH>

lone glade
#

Private now has the alternative syntax instead of local

queen cargo
#

those two commands have NOTHING in common

lone glade
#

which makes more sense.

rich frost
queen cargo
#

dude ... i know that frking command

#

the thing is it simply does not makes more frking sense there

#

it makes less

granite sky
#

It's possible that you found an Arma bug there but you'd need a less complex replication :P

queen cargo
#

the object is not private to computer X

#

it is LOCAL to computer X

#

and available on ALL other computers too

lone glade
#

But.... it's the same fucking use......

queen cargo
#

NO
FOR
FUCK
SAKEN

#

its now

#

it was not before

rich frost
#

i just want particles man

lone glade
#

the alternative syntax of local had the same use as private ....

rich frost
#

ill see if i can reproduce my horrible code

queen cargo
#

it is like i am talking to a wall

#

just like my wall does not responses stupid shit ...

raw meteor
#

question for you all why dose this not work?

    if (_totaleBurst == 1) then {
            player setVariable ["lastburst", time, true];
            player setVariable ["totaleBurst", _totaleBurst + 1, true];
        };

        if ((abs(_lastburst - time)) > _cooldown) then {
            player setVariable ["lastburst", 0, true];
            player setVariable ["totaleBurst", 0, true]
        };

        if (inputAction "TurnRight" == 1 && ((abs(_lastburst - time)) > _cooldown)) then {
            _vel =  [
            (_vel select 0) + (sin (_dir + 90) * _burstspeed),
            (_vel select 1) + (cos (_dir + 90) * _burstspeed),
            (_vel select 2) // horizontal only
            ];
            player setVariable ["totaleBurst", _totaleBurst + 1, true];
        };

im trying to only have the bell update once per x amount of time with out suspending it as its all in a perframe handler but it keeps setting it to 0 even after the burst goes up past 1

lone glade
#

Previous alternative syntax of local: Privatize a var
New alternative syntax of private: Privatize a Var
Private first use: Privatize vars
Local first use: Check if something is local.

winter rose
#

"it does not work"
do you have an error message or anything?

raw meteor
#

it just keeps setting it to both vars to 0

winter rose
#

tip #1, do not broadcast a variable every frame ๐Ÿ˜

queen cargo
#

and when you come to the point which simply is retarded?
renaming its core functionality?

#

but hey
why not changing the whole terminology of something from IsLocalToClient to IsPrivateToClient
i mean XD its not like private has a totally different meaning then local
or that all people used local for ages for EXACTLY THAT PURPOSE

lone glade
#

And we come back to my first point, consistency

queen cargo
#

it would have been consistent to remove the alternative syntax and leave the locallity check

#

this move now is garbage that destroys scripts

lone glade
#

I'm not sure if you're serious or trolling at this point

hasty current
#

Anyone know if it's possible to change a vehicle's turnCoef via script?

#

Or in some other way impact the turning radius of a vehicle

granite sky
#

I'm not even sure if that's possible through config.

#

You're talking about a ground vehicle?

queen cargo
#

if(local _veh) then {diag_log "i make sense as _veh is local to my computer and remote on others";};

if(private _veh) then {diag_log "i am garbage as _veh private would mean that other computers would not have access to it";};

more happy now?

lone glade
#

........ You need to read what private and local do .... seriously

queen cargo
#

quote:
Check if given unit is local on the computer in Multiplayer games (see Locality in Multiplayer for general concepts).
This can be used when some activation fields or scripts need to be performed only on one computer. In Single player all objects are local.

lone glade
#

BUT THE ALTERNATIVE SYNTAX WASN'T THAT, THAT'S WHY IT WAS MOVED

queen cargo
#

so instead of removing the nonsense on that command we put the whole command as "private" to make THAT command inconsistent then again?
ohh ye
GREAT IDEA

#

whilst we are on it
createVehicle could use more functionality

#

why not merging it with createUnit?

#

would be consistent to have just one command wouldnt it?

#

you have to use deleteVehicle for both too

lone glade
#

........................... Okay I give up, you're trolling.

queen cargo
#

this now? yes THAT was fucking trolling or more showing the obvious via the help of trolling

#

it is complete BS to rename the WHOLE command just to remove one inconsistent shit

lone glade
#

ITS NOT THE WHOLE COMAND

#

LOCAL STILL EXIST

#

GOT FOR FUCK SAKES

queen cargo
#

then the fucking changelog is missleading and you could have saved your time by just telling me

zealous solstice
#

{private "_var"; _var = 1;} == {private _var = 1;}

#

and befor the private keyword was local and that get changed

lone glade
#

It's not like I was pointing out that only the alternative syntax was changed but hey

queen cargo
#

you argued against "the change from local to private is BS as local objects are not private objects" with the alternative syntax being the reason whilst the changelog states that the whole command got changed aka removed ...

austere granite
#

Does anyone know why the fuck for some reason I respawn instantly in stuff I'm working on. I use player setDamage 1 and got "Killed" EH... but in that Killed EH I'm already alive again

#

I can put setplayerRespawnTime 10e10 at the start of the killed EH.... still instant respawn

#

It switches between actually respecting setPlayerRespawnTime and the other one being instant no matter what I do

#

There's only one "Killed" EH added to player and setPlayerRespawnTime is only used within that EH

real tartan
#

are there any "task" event handlers? or are they planned ?

jade acorn
#

you're 6 years late to the feature request party buddy

#

not sure what exactly you want but you can make custom event handlers with what you already have in game (oneachframe etc) or with CBA XEH

#

or make a request/suggestion ticket and hope that BI will hire someone for a part-time job once again to add some new stuff, but we'll probably die of old age before that

sage heath
#

having this error on this mission (modset in zip file), problem is...there is no such expression that looks like that in that mission file so, any ideas? (send help i am going insane)

#

this is the functions folder if you dont wanna download the whole thing, it is likely that the error came from here

#

also the script runs fine, to trigger this error its in radio command, no.3
TLAM Strike

#

the whole thing runs fine, and as intended yet...yeah it spits out that error

sturdy kernel
#

is there a way to add more seats to a vehicle?

warm hedge
#

By script no

proven charm
winter rose
sage heath
#

right...i dont know exactly how to fix it here, sadly

#

i reckon...it came from this file, because well...its the only one that uses doTarget, if someone can look it over, i don't know where this goes wrong

proven charm
#

shouldn't that be ```sqf
[_vic,t3] remoteExec ["doTarget",_vic];

sage heath
#

alright, i'll give it a shot

sage heath
sage heath
#

one last thing im struggling with, is i have this trigger which would activate a script, now...if i were to terminate this script, how would i write it?

[] spawn { 
 { 
  sleep (random 5); 
  [_x] remoteExec ["TNRGN_fnc_wr_vic_shoot2",_x]; 
 } forEach [aa1g,aa2g,aa3g,aa4g,deuce1,deuce2,deuce3]; 
};```
#

cuz i tried... "terminate TNRGN_fnc_wr_vic_shoot2;" didnt work

proven charm
sage heath
#

ohhhhhh so thats what the...ok right, thank you!

sage heath
proven charm
#

what happen?

sage heath
#

nothing happened

#

it just didnt seem to terminate

winter rose
#

it won't stop a function from remote-executing, it will only prevent any future call

sage heath
#

righttttt how would i terminate that function then? i've seen...execVM?

#
airfieldflak = [aa1g,aa2g,aa3g,aa4g,deuce1,deuce2,deuce3] execVM "TNRGN_fnc_wr_vic_shoot2";```
i wrote this, maybe it'll work?
winter rose
#

you can only terminate a script where it is running

sage heath
#

sorry, im not sure i quite catch that?

winter rose
#
private _airfieldFlaks = _allTheAA apply { _x spawn FuncName };
sleep 2;
{ terminate _x } forEach _airfieldFlaks;
#

BUT
if the function cannot be run server-side, you have to do something else

sage heath
#

so to give context, the above script is for an airfield attack, where at a certain point the AAA open up and start shooting, then at a certain point, the guns stop which is where the script terminate

#

the part where the guns stop is activated by a trigger, with the timer counting down after one of the units in the airfield is destroyed which signifies the end of the strike

sage heath
winter rose
#

on Mars!

sage heath
#

rightโ€ฆsorry

proven charm
#

i'm confused what script you want to stop from running ?

drowsy geyser
#

Would be better to stop the gun from shooting by removing its ammo or not? That would stop it immediately

sage heath
#

apparently not XD

sage heath
proven charm
#

well i dont see why terminate wouldnt work on spawn-ed script as long as its on the same PC

sage heath
proven charm
#

then idk :/

#

but that spawned script does end on its own, after the loop with sleeps

#

so im not sure what you want to do here

sage heath
#

im gonna try lou's version

winter rose
#

at your own risk ๐Ÿ˜ˆ

sturdy kernel
#

So I have a respawn module syched to 16 single seat bacta tanks. The problem I'm having is if a player is already in one and another player selects that spawn then the player starts parachuting. Ia there a way to disable that spawn while a player is in it or even like a auto get out script? Any ideas

sage heath
#
[] spawn  
{  
 { _x setVehicleAmmo 0; 
 } forEach [aa1g,aa2g,aa3g,aa4g,deuce1,deuce2,deuce3]; 
};```
right so, i gave up, and just tried setting the vehicles' ammo to zero instead, didnt throw any errors but didnt work either
#

alright so to cap this off i just destroyed them instead, which works, unsurprisingly

winter rose
#

ok, so: are the vehicle targets AI only (and will remain so)?

#

if so, you don't need to remote exec, as they are local to the server.

open hollow
#

also dont need of terminate, just use the while condition

sullen sigil
#

nudge nudge 0 spawn is slightly quicker

jade acorn
#

how can I remove the date that's displayed on record creation with createDiaryRecord?

#

I don't see anything relevant but I don't think something like that would be hardcoded

fleet sand
# jade acorn how can I remove the date that's displayed on record creation with createDiaryRe...

I beleve its hardcoded somewhere for diary record to always show date. But what you could do is just delete that and create your new subject and it wont show the record something like this:

player removeDiarySubject "Diary";
player createDiarySubject ["Briefing","My Briefing Page"];
player createDiaryRecord ["Briefing",["Intel", "Enemy base is on grid <marker name='enemyBase'>161170</marker>"], taskNull, "", false];
proper sigil
#

Is mission file only limited to use scripts within it's directory?

I made a supply system for my unit, they can search crates, find supplies and bring them to base. Bringing supplies results in updating global variable holding the supply count.

For now for each mission file we have to manually update the values before putting it on the server. To solve this I was thinking whether it's possible to create an singular ini file or DB on the server that all mission files would use use to get current supply count AND update as mission progress? I know of inidb2 and extDB3 systems but after going through documentation I can't tell if it's possible to use common file by multiple missions files so perhaps someone can tell me if it's even possible for mission file to reach outside of it's directory?

proven charm
#

and in sqf you cant write files

hallow mortar
#

You could save the relevant information to a variable in the server's profileNamespace, using setVariable

proper sigil
proper sigil
hallow mortar
proven charm
proper sigil
proper sigil
cobalt path
#

question, can I give a variable to addmissioneventhandler ["eachframe..... so I can kill it at later point?

cobalt path
proven charm
#

one way ```sqf
addMissionEventHandler ["EachFrame",
{
removeMissionEventHandler ["EachFrame",_thisEventHandler];
}];

winter rose
#

(other way)

cobalt path
#

So I can just do:
myeh1 = addmissioneventhandler ["eachframe.....
and than
removeMissionEventHandler ["EachFrame",myeh1];
}];?

winter rose
#

IDs are made for that yeah

hallow mortar
#

Note that EH IDs are specific to each client - they can be the same on different clients, but aren't guaranteed to be - so saving and retrieving them should be done locally

cobalt path
#

ahh I see than you

frigid spade
#

are variables remembered inside of "forEach" loops?

#
_defender_number = 0
{
    (_grpdefenders select 0) moveInTurret _x
    _defender_number = _defender_number+1
} forEach _base_turrets;
```sqf
#

use this for example

hallow mortar
#

That will work, except for the missing ; after moveInTurret _x

frigid spade
#

i forgot several semicolons lol

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
frigid spade
#

hey thats nifty

still forum
frigid spade
#

so it will indeed step the variable up each time, instead of re-pulling the "=0"

still forum
#

If you don't write the assignment to zero, then it won't do that.
You do it once above the loop, the loop doesn't even know that code exists, it won't run it.
And it also won't create code inside the loop, that you didn't write there

It just does what you tell it to

frigid spade
#

What function would I use to refer to the specific spawned unit once it's been created by a script?
for instance, if i run

    _nextobject = _nextclass createVehicle _nextpos;

and then do

    _base_turrets pushBack _nextobject;

it's not putting the thing I just spawned into the array, its putting its classname or whatever into that array, so later on when I do the "moveInTurret" function I'm telling the unit to get into a hypothetical turret of that classname, not specifically the one thats directly next to him

still forum
#

The code you posted puts the object into the array

#

unless the spawning failed, then it will put a null object

frigid spade
#

hmm, both the object and the unit are spawned but its not putting the unit in the turret

still forum
#

your moveInTurret is wrong

#

it takes an array on the right

#

you gave it an object

#

it needs the vehicle AND the turret path (which seat in the vehicle)

frigid spade
#

ahh, into the config view i go, i suppose?

still forum
#

you can also sit a unit in

frigid spade
#

i was doing several things wrong

#

I was trying to get far too fancy

#

first off I discovered that its isKindOf "static weapon" not "turret"
second, i just did "createVehiclecrew", idk why i thought i had to use moveInTurret

tidal idol
#

Any help on why this condition is not skipping the shielded vehicle's forEach iteration?
The code shown correctly reads the variable since the hint shows up, but the rest of the forEach iteration still plays (since the crew hops out of the vehicle)

The quick fix I'm thinking of doing is just putting the rest of the block in an else statement but I don't want to do that if I can get the continue working.

still forum
#

The forEach is already ran through completely and has ended. Before that if executes

tidal idol
#

Hmm I'll probably just add an else condition that does the code then actually I'll check for a not equal to IsShielded and just encase in a single if statement

unique sundial
#

How many of you use respawnVehicle command?

tidal idol
#

Script for a function called by a module:
Why is this isNil condition returning an error? To my understanding, isNil is used to check if an array is defined but has nothing inside, and IIRC I've used it on arrays before. I don't understand why it doesn't want to accept an array as a parameter.

hallow mortar
tidal idol
#

Hmm, I've used it in this context before. Looks like I should've put the variable name in quotes anyway.

granite sky
#

That wouldn't throw an error but it wouldn't do anything useful either. synchronizedObjects always returns an array, not nil.

tidal idol
#

Hmm is count _syncTargets == 0 the next best way to check if it's empty then?

granite sky
#

If you want to check whether the array is empty then _array isEqualTo [] and count _array == 0 are the options.

tidal idol
#

Fixed that, thx.
One more error is coming up though on my forEach line but I think it's because I used curly braces instead of paren

granite sky
#

The forEach {_syncTargets}? Yes.

#

You don't need either there but parentheses won't hurt.

sullen marsh
#

respawn mode perhaps?

winter rose
sturdy kernel
#

I have a respawn module synced to 16 different vehicles to repsawn onto custom psotion. Problem im having is there one seater so if another player spawns in it it juse kicks them out. Can any point me in the right direction were i could either have them auto get out once respawned or make that respawn position disabled until the player gets out were it would them become available again? Any help would be appreciated.

flint topaz
sturdy kernel
flint topaz
sturdy kernel
flint topaz
#

Itโ€™s what I do ye

unique sundial
# winter rose please don't _replace_ any old behaviour? ๐Ÿ˜…

the new system has ability to update vehiclecrespawn params in respawn queue. so you can cancel respawn all together if you want. the problem is while you can read how many respawns left, it gets confusing when it reaches zero. zero means no respawns left but 0 also currently unlimited respawns. i'd rather have -1 as unlimited.

#

if you had- veh respawVehicle[ delay] for unlimited respawns you are fine. if you had- veh respawnVehicle [delay, limit] for limited respawns you are fine. if you had- veh respawnVehicle [delay, 0] for unlimited respawns, this could be a problem

#

considering 3 people in the world used it in any meaningful way the risk to benefit ratio is small

formal chasm
#

So I am trying to make a connect players API, I have the API fully done and written in JavaScript which pulls from our roster. Now I am trying to load an extension which is the only part im stuck on how to do? The extension I am trying to load is this http://killzonekid.com/arma-extension-url_fetch-dll/ ?
This will also be going on our server so after I am done how would I convert this to a server mod? This is like my second day of SQF scripting I looked at the arma docs on how to load extensions and it didn't make much sense on how to load them(probably cause I'm spoiled on nicer looking documentation)
I understood how to call the extenstion, but not where to place files

#

I understood how to call the extenstion, but not where to place files

still forum
#

you put the extension into your @mod folder

#

next to the "addons" folder, not inside

formal chasm
formal chasm
# still forum next to the "addons" folder, not inside

so I have this code inside my init.sqf file

url_fetch = {
    //url SPAWN url_fetch;
    private "_result";
    waitUntil {
        if ("url_fetch" callExtension format [
            "%1",
            _this
        ] == "OK") exitWith {true}
    };
    waitUntil {
        _result = "url_fetch" callExtension "OK";
        if (_result != "WAIT") exitWith {true}
    };
    if (_result == "ERROR") exitWith {
        //deal with error here
        hint format [
            ">>> [url_fetch] >>> ERROR: %1; ARGUMENTS: %2",
            "url_fetch" callExtension "ERROR",
            _this
        ];
    };
    //deal with result here
    hint format [
        ">>> [url_fetch] >>> RESULT: %1",
        _result
    ];
};

"http://killzonekid.com/hello.php?name=KK" spawn url_fetch;

And I am receiving this error, Now I am pretty sure its the where it says exitWith {true} as there is no check to to exitWith {false}
Just incase I am loading the extension wrong I also have a picture of my root arma directory

#

But that also means I am probably not loading the extension

still forum
#

That means _result was nil.. but.. callExtension doesn't return nil

#

I don't see the purpose of that exitWith

formal chasm
still forum
#

url_fetch_x64.dll is in your @mod folder?

#

Ah yeah its not, because there is no x64 version of it

#

you'll need to find a x64 version somewhere

formal chasm
still forum
#

"daa" callExtension ["get", ["someHandle", "https://stuff.de/api/v1/server"]];

addMissionEventHandler ["ExtensionCallback", {
params ["_name", "_function", "_data"];

if (_name != "DAA") exitWith {};

if (_function == "someHandle") exitWith {
    //_data has your reply data here
};
}];

Getting replies is a bit more complex with mine as it uses callbacks for it

formal chasm
formal chasm
#

(probably something i did)

flint topaz
still forum
#

yes

#

KK's one does it too, but by polling in a loop until it returns != "WAIT". still won't hang but less efficient

flint topaz
#

Nice I may look into that for one of my projects at some point

#

Seems a nice system

#

This is something you may know actually whatโ€™s the data input/output limit to/from a dll using callExtension

still forum
#

input no limit *Except the maximum string limit which is 9mb I think?, its written on the String wiki page)
output limit for callExtension command I think is 16k, is written on callExtension wiki page.
ExtensionCallback, I think about 3gb, but it won't like that much

flint topaz
#

I think youโ€™ve got bigger problems if you are transferring 3GB of data ye

#

Thanks

#

Dam after reading the wiki again Iโ€™ve considered redoing the dll Iโ€™ve made to support callbacks thanks for this

sullen sigil
#

i need to write an extension for my capital ships project but fuck that

#

pain in the balls for arma normally

#

unless youre patient enough for c++

flint topaz
#

I did mine is C++ ye

flint topaz
sullen sigil
#

capital ships

#

big flying ship go zoom

#

youve heard of physx time for kjwx

flint topaz
#

No but Iโ€™m going to search it up

#

Well Iโ€™ve heard of physx before

sullen sigil
#

i need 2.18 for the mod

#

angular velocity stuffs

#

and because no geo lods on a lot of modded capital ships/large objects have to be in parts and attached so lose collisions it means i have to make a new physics engine

#

sqf is too slow for that but its a later down the line thing

#

just need angular velocity commands out first

winter rose
#

(if you wear glasses)

sullen sigil
#

the nuget packages for dll export for c# are 50/50

#

and for .net core stuff it has to be AOT compiled

flint topaz
# winter rose you can C#

So is the idea to have ships move around and be able to collide with and be walked around in or what exactly is your end goal with the ships

sullen sigil
#

yeah

#

that

#

ive already got walking around in them while moving etc

flint topaz
#

Okay thatโ€™s cool I thought of the theory but ye never really tried it yet

sullen sigil
#

collisions is just a nice thing to have

#

would require effectively remaking a geo lod in 3den for the coords tho notlikemeow

flint topaz
sullen sigil
#

i think i have a few clips i can dm you later

little raptor
sullen sigil
flint topaz
#

Ahh a mimic nice okay

sullen sigil
flint topaz
#

So you canโ€™t really have them actually be on the ship while itโ€™s moving then without desync correct?

sullen sigil
sullen sigil
#

stuff with geo lods -- i.e base game submarine -- just slides out from under your feet

#

and no WMO doesnt rectify that

little raptor
flint topaz
#

Yeah cause I thought about using theory of Walkable Moving Objects but desync is a large concern for that theory

kindred zephyr
sullen sigil
#

yeah itd be desynced no matter what you do

#

easiest way is static interior

#

means you can also have very complex interiors

#

ive got clips i just have to dig for them and cant post them here either

flint topaz
#

And you just move it along โ€œstaggeredโ€ or just have it in a corner of the map

sullen sigil
#

corner of the map

#

no movement of it

flint topaz
#

Yeah makes sense

#

So ships with windows I assume itโ€™s just an unfortunate result that it wonโ€™t show them moving

sullen sigil
#

i have done picture in picture windows

#

however

#

those only really work for small windows

flint topaz
#

Yeah they must lag if large

sullen sigil
#

for things like entire flight decks or whatever yeah theres no viable solution afaik

#

not even the lag

#

its just unconvincing

hallow mortar
#

eventually you're going to wake up in the morning and realise you've basically just made your own entire game engine

sullen sigil
#

pm'd you a clip of picture in picture windows for the bridge of the ship

flint topaz
#

Thanks

sullen sigil
still forum
#

Couldn't find link in the url_fetch and url_fetch v2 posts

unique sundial
#

Probably havent updated, probably havent updated A LOT OF things notlikemeowcry

simple trout
#

Nah Lou, outsource it!

old owl
#

Would anyone know how I would prevent fire particles from doing damage to nearby players without doing something wacky like disabling player damage entirely?

proper loom
#

When it comes to Vehicle in Vehicle Cargo, is there a way for the first item loaded to be automatically rotated 90 degrees? I am having this issue where the first crate loads straight and then the second crate will rotate 90 degrees which makes a 'T".

I want all the crates the rotate 90 degrees so I could fit three crates.

old owl
old owl
tough abyss
#

probably not the right channel, sorry if it isnt, but im looking to see if someone can write me a script to automatically assign zeus placed AI units to a headless client. Im trying to learn SQF but i simply dont have the time and ive been trying to do this for a while.

astral tendon
#

any tip on how the get a position 200 meters of a unit from its left side?

granite sky
#

_unit getPos [200, -90]

#

actually never mind, that's compass direction.

#

Use getRelPos instead, otherwise identical.

astral tendon
astral tendon
#

This is another work around I did to get from the direction from a enemy unit to the caller

    private _Place = "Land_HelipadEmpty_F" createVehicle (getposATL _Target);
    private _dir = [_Place, _Caller] call BIS_fnc_dirTo;
    _Place setDir _dir;
    private _pos = _Place getRelPos [200, 270];
    deleteVehicle _Place;
hallow mortar
#

That looks substantially more complicated than it needs to be

#
private _dirToCaller = _target getRelDir _caller;
private _positionBehind = _target getRelPos [200, _dirToCaller + 270];```
kindred zephyr
#

by any chance, does configName does not work with the cfgSounds entries?

#

nvm, i found whats happening

lost vessel
#

@queen cargo I have to ask, why do you offend people and just have a toxic attitude? Have a civilized conversation ffs.

candid sun
#

sqf is serious business bro

cyan dust
#

Is there anyone out here who uses Intercept Minimal Dev + Arma Debug Engine for debugging? Does breakpoints work for you or only 'halt' command?

still forum
#

Breakpoints require correct path mapping in the VS Code project config

pulsar bluff
grizzled cliff
#

oh god

#

so many wrappers to write

leaden ibex
#

With the new functions coming in 2.18 for syncing units anim states, is there already a way to sync a vehicle like this?
Mainly interested in turret direction/gun elevation.

I would go with animSourcePhase, but those afaik are not present on vehicles mostly and the naming scheme is not standardized.

rich frost
#

is there an hashmap equivalent of objNull?
trying to limit the datatypes for a params command

cyan dust
hallow mortar
proven charm
#

how do you make officer to sit on right direction? ```sqf
[_off,"SIT"] call BIS_fnc_ambientAnim;

_off attachTo [_chair, [0, 0, 0]];

_off setdir (getdir _chair);

hallow mortar
#

Once an object is attached to an object, direction-setting commands become relative to the parent object. So if you do setDir 90, the resulting direction will be 90 degrees to the right relative to where the chair is facing.
Note that for some objects, relative zero is not in line with where you might think the "front" of the object is, because the object is sideways or backwards in its own model space.

proven charm
#

did _off setdir 180;

still forum
hallow mortar
#

I see (not really but let's pretend)

#

I wasn't sure if there was a difference between referencing a permanently-allocated "empty" and creating a new one every time

still forum
#

objNull is not a permanently-allocated value

#

every time you call it, a new one is created

hallow mortar
#

That sounds awful

still forum
#

yeah could probably use some tweaking

#

We recently changed true/false to be permanently-allocated. Could do that with the nulls too

cosmic lichen
#

deleteVehicle doesn't work for terrain objects, does it?

#

Nevermind. Biki description mentiones it.

steep verge
#

Hey guys, quick question. Maybe someone does know what function would be responsible for disabling the ACE interaction menu on a vehicle?

fair drum
granite sky
#

Wait, it does? I thought you had to hide them instead.

cosmic lichen
#

I have just tried it and none of the objects were deleted.

fair drum
#

Oh duh I'm not thinking, yes hiding it. My bad.

fleet sand
# steep verge Hey guys, quick question. Maybe someone does know what function would be respons...

https://github.com/acemod/ACE3/blob/master/addons/interact_menu/functions/fnc_removeActionFromObject.sqf
You can remove it with that: And i dont know but if you put this in init of a vehicle it should work.

[this,0,["ACE_MainActions"]] call ace_interact_menu_fnc_removeActionFromObject;
GitHub

Open-source realism mod for Arma 3. Contribute to acemod/ACE3 development by creating an account on GitHub.

frigid spade
#
       {
           private ["_grenadePos","_grenadeObj"];
           _grenadeObj = (_this select 0);
           waitUntil { (getPosATL _grenadeObj select 2) < 0.1 };
           _grenadePos = getPosATL _grenadeObj;
           "mrkName" setMarkerPos _grenadePos;
            hint str getMarkerPos "mrkName";
       };

Can someone help me figure out why "mrkName" is returning [0,0,0]?
I checked _grenadeObj and it does indeed return the correct position, but when I feed that pos to a marker it seems to not stick

steep verge
#

Work's like a charm for me. But i really appreciate the help ๐Ÿซก

kindred zephyr
#

Can a Dialog/Display be created using cutRsc?

I have a couple of dialogs that are intended to be shown on screen during an undetermined time since the info on them update constantly but as we know, createDialog and createDisplay partially block inputs. Would using cutRsc be the correct approach? Do cutRsc requires another type of declaration or the same dialog/display can be used with that command?