#arma3_scripting

1 messages · Page 109 of 1

meager granite
#

19 explosions from single HE shot

cursive comet
#

My buddy said I should ask here about about making a mission work. I want to make a multiplayer mission where players need a "key" to open prison doors. If a player has a object('ACE_key_lockpick' in this case) than I want "player setVariable ["copLevel",1,true];" to apply to them. I do not know how to implement this thorough scripts, event handlers, or such. Thanks for any assistance.

astral bone
#

I could still go for some help with this-

winter rose
#

well, it's scripting after all

astral bone
#

yea, scripting to place the stuff, then export it to TB later x3

#

inb4 there's a way to place the poles and TB does the wire creation

#

But yea, idk what's up. I also was never the best with geometry, so-

cosmic lichen
#

Perhaps one of the terrain builders has a solution for this already?

#

I'd give it a try.

astral bone
#

I tried it, and couldn't find anything.

#

it looks like it's an issue with up/down?

#

angle isn't quite right-

astral bone
#

uh- huh-

#

well, that didn't help- x3

digital hollow
#

Since terrain can slope up/down, the poles can easily be too far apart for the lines to reach. you should probably do just line pieces to line pieces then generate poles at the nodes.

astral bone
#

that is an idea- then I could use this for the endings, since this does get me close, just not perfect

#

although, the too far part should be fixed by dividing the distance by 50, then plugging that into object scale.

digital hollow
#

but they way the powerline objects are set up, if you scale up, the lines get higher (i think?)

astral bone
#

it's not the scale rn, it's the fact the angles aren't right 😅

#

wait...

#

I- I needa worry about roll??

#

... I needa worry about roll

digital hollow
#

I assume you mean the pitch angle? I think you'd need at least 2 iterations.
from end point, add line length toward goal (flat), find terrain height then pole height, find line length along that pole-height-vector.
at that point you can hope that the pole has enough leeway to accommodate the slope difference or do another check.

astral bone
#

nah, I leave out pitch and roll, only have yaw change, then I manually change pitch via the eden widget, local of the object, roll it's 0 and it's aligned

rich frost
#

How can i play the sound of an plane engine?

I'm using the C130 static for the players to jump out of the rear but its awfully quiet.

the config of the plane i want to borrow the sound from just has

soundEngine[] = {"",1,1};,
Plane and plane_base_f classes as well.

only real alternative i find is this
soundEngineOnExt[] = {"A3\Sounds_F_Exp\vehicles\air\Plane_Civil_01\BTT_engine_start_ext",1,0.8,600};

is there a sensible way to create this sound source?

i am inclined to just attach a normal plane above the static of the plane and have that simulate the sound ...

thick merlin
astral bone
#

with the widget, how is it rotating-

#

grr- ok, I guess I'ma have to use cables instead 😅

#

cables then poles, I mean. Instead of pole, then cables generated between them

digital hollow
rich frost
#

do i need to loop this?

digital hollow
#

Depends if you want it to keep playing, I'm just saying this sound probably fits

rich frost
#

is there a way to figure out the duration of that sound?

worn tusk
#

you could probably find the actual file and play it which would display its length

rich frost
#

not wrong

rich frost
proud schooner
#

Does anybody have any recommended SQF editing programs? I’ve written a gear script and shit won’t work and I can’t find the error

digital hollow
#

vs code, with sqf extension

ivory lake
#

Yeah - explosive > 0.7 (or was it 0.6... its on the wiki anyway) ignore penetration values (caliber) EXCEPT for foliage

next kraken
#

is there any way to have only one player executing a script locally on a dedicated server ? i

granite sky
#

Well yeah? You can execute scripts on whatever machine you want.

next kraken
#

its a bit comlicated i guess, im working with the animal as agents and there´s no way but executing it locally on one machine

#

this is what i have:

#

// spawn goat
_goat = createAgent ["Goat_random_F", getPosATL goat_pos_1, [], 5, "NONE"];

// following loop
[_goat ] spawn {
params ["_goat"];

while {true} do
{
sleep 3;_goat moveTo getPosATL goat_pos_1;
};
};

#

the only way it works, (no more anyimals then one is shown, is ingame via execute local

#

i tried that

#

too

#

"scripts\animals.sqf" remoteExec ["execVM","zeus"];

#

what does the "execute locally button exactly do ? (code wise)

#

sorry where can i find formating this right for the discord forums here, ?/ code?

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
stable dune
# next kraken what does the "execute locally button exactly do ? (code wise)

The expression can be executed in the unscheduled environment using the following buttons:
Local - execute on player's computer using remoteExec to call the given code.
Global - execute on all computers using remoteExec to call the given code. Only enabled in MP.
Server - execute only on the server using remoteExec to call the given code. Only enabled in MP.
Performance Test - See: diag_codePerformance

https://community.bistudio.com/wiki/Arma_3:_Debug_Console

granite sky
#

Local is something like { //code in box goes here } remoteExecCall ["call", clientOwner];

#

but I don't feel like this is going to answer your question.

#

You'd need to specify what your code entry point is, and how you're identifying the client that you want to run on.

silver ingot
#

Is there a way that a player could clip their grenades and smokes to their rig/belt/backpack? Similar to how DayZ does it

meager granite
#

Local createSimpleObject on each client and set position each frame, depending on player's inventory

meager granite
#

Also these old dark green Altis forests 😢

#

SOUL vs SOULLESS

#

jk ofc, but I like old trees better

#

Even map was less pale 🤔

#

Probably altered for Tanoa or something, which is barely played compared to Altis

sullen sigil
#

which is which? thonk

meager granite
#

says in the bottom right watermark

sullen sigil
#

oh neato

pulsar bluff
meager granite
#

Not serious of course, would be very janky in a best case scenario

blazing zodiac
#

Does anyone have a solid multiplayer method of determining if a unit is killed by explosives?

tough abyss
#

A sure fire way would be to store the object name of the last damage taken on the client's computer and upon death, you use the last taken value and check if it is an explosive class name or not.

digital hollow
#

Is there a way to get the default vehicle/unit name "B Alpha 2-3:4" when it has a variable name assigned, other than piecing it together throug side groupid and group unit order?

tough abyss
#

MPHit and MPKilled event handlers could be used.

winter rose
#

not afaik, why?

digital hollow
#

I need to show which remote pylon the player is selecting. Not a problem!

candid sun
#

MPHit can't be relied on to be triggered upon death

tough abyss
#

Ya, have had problems with that before as well. What about just the regular "Hit" event handler.

#

Same thing, just read it.

limber thunder
#

Hello guys,
can someone tell me how to read the positions of all playableUnits on the map? I want to put a marker over each playableUnits.

tough abyss
#

HandleDamage is very unstable as well

opal zephyr
#

get the postition of playableUnits, could do it in a forEach loop, example:

{
  createMarker ["Marker1", position _x];
} forEach playableUnits;
tough abyss
#

There is an Explosion event handler. "Triggered when a vehicle or unit is damaged by a nearby explosion."

limber thunder
candid sun
#

someone in here was doing the same thing a day or two ago, i can't remember what they came up with

tough abyss
#

Only returns the object the event handler is assigned to and the damage inflicted though.

opal zephyr
#

it would need to have a variable, so like this:

_marker = createMarker ["Marker1", position _x];
_marker setMarkerType "Warning";

or whatever type you wan instead of warning

hallow mortar
limber thunder
candid sun
#

there's a command to check hit damage on individual body parts isn't there? i think he decided that's the best course of action

hallow mortar
#

e.g.

private _marker = createMarker [format ["UnitMarker%1",netId _x], position _x];
_marker setMarkerType "Warning";

This format is based on the unit's unique network ID, which means you can reconstruct it later if you want to update the markers again

opal zephyr
#

Because of what nikko said

#

If its for all playable units, wont the network id of the playable units that are AI still just be the server? In which case it would be the same?

hallow mortar
#

Object network IDs aren't the same as machine network IDs

opal zephyr
#

ah kk

tough abyss
#

HitPart is an event handler for it. If you want a loop for checking damage to parts you can use getHit

#

player getHit "head"; for example

#

getAllHitPointsDamage player;
//[
// ["HitFace","HitNeck","HitHead","HitPelvis","HitAbdomen","HitDiaphragm","HitChest","HitBody","HitArms","HitHands","HitLegs"],
// ["","neck","head","pelvis","spine1","spine2","spine3","body","","hands","legs"],
// [0,0.0939002,0.0319932,0.0858595,0.174491,1,1,0.168495,1,0.5,0.195907]
//]

candid sun
#

hitpart, that was it!

#

he did something with that, sorry i can't be more useful

blazing zodiac
#

It's ok thanks for the info, I've used hitPart before for target practice feedback and didn't realize it returns objNull in case of an explosive. I should be able to use that since manually adding the classnames isn't an option as it will break modded explosives support.

tough abyss
#

As far as I know there is no set function for the class of explosive versus the class of standard ammunition. Even then, what is an explosive round classified as? Bullet or explosive?

blazing zodiac
#

Not sure, that's a solid question. Looking at hitPart I don't think it will work for me as I would need to retrieve the persons UID who triggered the EH. It's not crucial but would've been a nice little addition to the mod.

#

I'll post back if I get a reliable working method

tropic summit
#

Is there any way to broadcast curatorCamera over a network to players? I'm trying to attach a zeus object directly to the zeus camera and everything works well but unfortunately it isn't propagating across the network so other players dont see the object moving.

Here is the (rudimentary) code I have so far:

  godcam_victim = _this#0; 
  onEachFrame { 
    godcam_victim attachTo [curatorCamera, [0,3,-2.2]]; 
    if (!alive godcam_victim) exitWith
    {
      detach godcam_victim;
      onEachFrame {};
    };
  };
}; 
 
[_this] call godcam_fnc;```
little raptor
#

instead you have to broadcast its movement

candid sun
#

how can i put a square bracket inside a string?

tropic summit
#

ah thats what i feared

#

is there an efficient way to do that at all or is pretty much just gonna be a case of spamming getpos?

rich frost
#

RemoteExec setWind[x,y,forced]

When trying to remote execute the setWind command, i am greeted with the following error.

 9:33:45 Error when remotely executing 'setwind' - wrong number of arguments (3) passed, must be either 0, 1 or 2
 9:33:45 Error in expression < _xWindEnd);

eventhough the syntax describes 3 parameters?
https://community.bistudio.com/wiki/setWind

Is this a bug or am i doing something wrong?

little raptor
#
godcam_fnc = {
  godcam_victim = _this#0;
  godcam_victim attachTo [curatorCamera, [0,3,-2.2]]; 
  onEachFrame {
    if (!alive godcam_victim) exitWith
    {
      detach godcam_victim;
      onEachFrame {};
    };
    godcam_victim setPosWorld getPosWorld godcam_victim;
  };
}; 
 
[_this] call godcam_fnc;
#

btw you were attaching the object every frame. that could be why it wasn't broadcasting anything

tropic summit
#

I was because whenever I tried attaching just once it didnt follow movement

little raptor
#

well you shouldn't attach something every frame...

tropic summit
#

ya ofc i was purely just trying to get it to work lol

little raptor
#

also I don't think you can attach stuff to cams? think_turtle

south swan
tropic summit
#

you can

#

it works well locally just not in mp

#

ill try that when i get a chance to test tho thanks

rich frost
south swan
#

eh, remoteExec needs some brainbending even when fully awake

little raptor
# tropic summit ya ofc i was purely just trying to get it to work lol

you could also try this:

godcam_fnc = {
  godcam_victim = _this select 0;
  
  onEachFrame {
    if (!alive godcam_victim) exitWith
    {
      detach godcam_victim;
      onEachFrame {};
    };
    if (isNull attachedTo godcam_victim) then {godcam_victim attachTo [curatorCamera, [0,3,-2.2]};
    godcam_victim setPosWorld getPosWorld godcam_victim; // probably not needed
  };
}; 
 
[_this] call godcam_fnc;
tropic summit
#

will see

#

as of rn what I know is that it works completely in local guy stays attached and all perfectly, only issue is propagating that movement to other clients so im hopeful the setposworld solution is what i need

candid sun
#

...when that string is inside an array

oblique lagoon
#

Is there a limit on setLightFlareMaxDistance? Seems like it is shown only in few hundred meters

#

I set it to 3000

oblique lagoon
#

Seems like light flare is not rendering in specific condition. Even when the LOS is not blocked.

#

However light of flare grenade/mortar shell is visible in long range...

#

How do I set my light flare visible in long range?

limber thunder
#

How can I change the following code so that it does not check if the player is alive but conscious? At the moment the function is executed even if the unit is unconscious.

if(alive p1) then {
    _playerMarker1 = createMarker ["marker1", _playerPosition1];
    _playerMarker1 setMarkerType "hd_objective"; //Marker typ
};
warm hedge
#

inb4 “unconscious” but in ACE

limber thunder
limber thunder
warm hedge
#

Yes

#

ACE doesn't use vanilla feature in the most of features

limber thunder
#

Okay, do you know how I can check if the unit is conscious when I use ace?

warm hedge
#

I never use ACE so please don't ask me if there's anything else

limber thunder
#

okay thanks

astral bone
#

How would I get the status of 3den widget cordinate space?
global vs local transformations

astral bone
#

ahh action, right. Ok thanks ^^

tulip ridge
#

Can you not pass a value to a switch's case statement?

cosmic lichen
#

What do you mean by "pass"?

#

variables from upper scope will be available

tulip ridge
#

Hm, I was getting undefined errors when trying to reference variables

cosmic lichen
#

Post code

winter rose
#
private _value = floor random 5;
switch (_value) do
{
    case 1: { hint "one"; };
    case 2: { hint "two"; };
    default { hint "zero, three or four" };
};
tulip ridge
#
params ["_vehicle", "_role", "_unit"];

if !(isMultiplayer) exitWith {};
if !(_unit call CWR_fnc_isPlayer) exitWith {};

switch (_role) do
{
    case "driver";
    case "gunner": { (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 1, true]; };
    default { (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 0, true]; };
};
#

_vehicle and _unit are undefined in the default case

cosmic lichen
#

What is the value of _vehicle and _unit if default case gets executed?

#

use params with default values

hallow mortar
#

Are they undefined in the default cause, or is the default case happening because they're undefined?

tulip ridge
#

They're definitely defined, it's just specifically only erroring out in the default case

cosmic lichen
#

Default Case is missing )

tulip ridge
#

Copy/paste error

cosmic lichen
#

k

tulip ridge
#

If I'm remembering right, I had this same kind of thing happen before but the values were passed through params/_this rather than being already defined

cosmic lichen
#

Add a diag_log for vehicle and unit

tulip ridge
#

Yeah they're definitely defined, gives the proper vehicle, role, and unit

cosmic lichen
#

Well, the code works for me.

tulip ridge
#

The variables only seem to be defined for me if I re-do the params in the default case, so like default { params[...]; ... }

cosmic lichen
#
[vehicle player, "commander", player] spawn 
{

    params ["_vehicle", "_role", "_unit"];

    switch (_role) do
    {
        case "driver";
        case "gunner": { (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 1, true]; };
        default { systemChat str [_vehicle, _role, _unit]; (_vehicle) setVariable [format ["TFAR_IntercomSlot_%1", (netID _unit)], 0, true]; systemChat str _role;};
    };
};

Works fine.

south swan
#

inb4 CWR_fnc_isPlayer undefines _vehicle/_unit :3

tulip ridge
#

I would be somewhat impressed, given that it just returns a boolean on whether a unit is a player and/or a remote controlled unit

hallow mortar
#

If it uses variables named _unit and _vehicle and fails to private them, it would overwrite the ones from the upper scope

cosmic lichen
#

yeah. Had the same thought. These are the worst mistakes

tulip ridge
#

It'd just be _unit if anything, but I had taken out the multiplayer/player checks for testing and was still getting an undefined error

hallow mortar
#

Are you testing in SP or MP?

tulip ridge
#

SP and lan MP

hallow mortar
#

I mention this because netID (allegedly) doesn't work in SP

tulip ridge
#

It just returns ""

#

The testing I did in SP was just using some diag_logs, not the "actual code"

limber heart
#

I want to make it where:
Player 1 walks into trigger

  • timer starts
    Player 1 walks into second trigger
  • time it took is displayed with scroll wheel option on an object.

How would i go about doing this?

serene sentinel
#

Hi. Trying to make script spawning group with random number of units (6-15) and randomly equipped (using dzn_gear loadout customization script).
As i think, i need to make multi-dimensional array there unit class and loadout will be.I don't really know how to do it correctly, I provide my attempt to write this script below:

_Alpha = createGroup resistance; 
private _pos = [getpos UPS_heli, 0, 6500, 0, 0, 0, 0] call BIS_fnc_findSafePos;

_peh = _Alpha createUnit ["I_officer_F", _pos, [], 0, "FORM"];
[_peh, "UPS_marker"] execVM "ups.sqf";
[_peh, "kit_AAF_officer"] spawn dzn_fnc_gear_assignKit;

_RandomUnits = [
         ["UK3CB_AAF_I_MG","kit_AAF_Machinegunner"],
     ["I_Soldier_M_F","kit_AAF_Spotter"],
     ["I_Soldier_AT_F","kit_AAF_Carl_Gustav"],
     ["I_Soldier_GL_F","kit_AAF_grenadier"],
     ["I_Soldier_LAT_F","kit_AAF_light_at"],
     ["I_soldier_F","kit_AAF_RIFLEMAN"],
     ["I_Soldier_AR_F","kit_AAF_AR"],
     ["I_engineer_F","kit_AAF_ENGINEER"],
     ["I_medic_F","kit_AAF_MEDIC"],
     ["I_Soldier_exp_F","kit_AAF_Exp"]
];

_RandomUnit = [_RandomUnits] call BIS_fnc_selectRandom;

for "_i" from 1 to (6 + floor random (15 - 6 + 1)) do {

_peh2 = _Alpha createUnit [_RandomUnit, getpos _peh, [], 0, "FORM"];

};

Of course it is wrong right now, may be someone can help with it....

winter rose
#

you createUnit with the array selected in _randomUnits

serene sentinel
#
_peh2 = _Alpha createUnit [_RandomUnits, getpos _peh, [], 0, "FORM"];

Must be this way?

cosmic lichen
#
private _newGroup = createGroup resistance; 
private _pos = [getpos UPS_heli, 0, 6500, 0, 0, 0, 0] call BIS_fnc_findSafePos;

private _peh = _newGroup createUnit ["I_officer_F", _pos, [], 0, "FORM"];

[_peh, "UPS_marker"] execVM "ups.sqf";
[_peh, "kit_AAF_officer"] spawn dzn_fnc_gear_assignKit;

private _pool = 
[
    ["UK3CB_AAF_I_MG","kit_AAF_Machinegunner"],
    ["I_Soldier_M_F","kit_AAF_Spotter"],
    ["I_Soldier_AT_F","kit_AAF_Carl_Gustav"],
    ["I_Soldier_GL_F","kit_AAF_grenadier"],
    ["I_Soldier_LAT_F","kit_AAF_light_at"],
    ["I_soldier_F","kit_AAF_RIFLEMAN"],
    ["I_Soldier_AR_F","kit_AAF_AR"],
    ["I_engineer_F","kit_AAF_ENGINEER"],
    ["I_medic_F","kit_AAF_MEDIC"],
    ["I_Soldier_exp_F","kit_AAF_Exp"]
];

for "_i" from 1 to (6 + floor random 10) do 
{
    selectRandom _pool params ["_unitClass", "_loadoutClass"];
    _peh2 = _newGroup createUnit [_unitClass, getpos _peh, [], 0, "FORM"];
    [_peh2, _loadoutClass] spawn dzn_fnc_gear_assignKit;
};
serene sentinel
#

@cosmic lichen Thanks, mate. Looks like it works how i need it.

tough abyss
#

You don't need to escape brackets, its only the quotations you need to escape (unless you start mix the outer/inner quotations up i.e 'test"test')

digital hollow
#

Sharing a script for attachTo at current position relative to a bone on the parent object. Many thanks to Leopard20's matrix examples.

amp_fnc_attachToRelativeBone = {
    params ["_child", "_parent", "_bone", ["_lod", 1e15]]; // Memory

    if (!isNull attachedTo _child) then {detach _child;}; // Get vectors in world space

    private _childPos = _parent worldToModel ASLToAGL getPosWorldVisual _child;
    private _childY = _parent vectorWorldToModelVisual vectorDirVisual _child;
    private _childZ = _parent vectorWorldToModelVisual vectorUpVisual _child;
    private _childX = _childY vectorCrossProduct _childZ;

    private _bonePos = _parent selectionPosition [_bone, _lod];
    private _offset = _childPos vectorDiff _bonePos;
    _parent selectionVectorDirAndUp [_bone, _lod] params ["_boneY", "_boneZ"];
    private _boneX = _boneY vectorCrossProduct _boneZ;

    private _m = matrixTranspose [_boneX, _boneY, _boneZ];
    private _pos = flatten ([_offset] matrixMultiply _m);
    _child attachTo [_parent, _pos, _bone, true];

    _m matrixMultiply [_childX, _childY, _childZ] params ["", "_vY", "_vZ"];
    _child setVectorDirAndUp [_vY, _vZ];
};

See it in action https://youtu.be/H8h3h3ifjiA

sullen sigil
#

is this the part where i mention i did something the exact same without any matrices for two primary weapons v1

south swan
#

mandatory "evenshually" joke

digital hollow
#

Excellent. Now just need selectionVectorSideAndDirAndUp

south swan
#

just give us direct access to reading/writing transformation matrix already. I want to be able to mirror/skew things as well blobcloseenjoy

digital hollow
oblique anchor
#

Yo, I'm currently developing a DLL extension for a server-side mod that I'm working on and I was wondering how can I verify the mod actually runs. I have the dll setup so it will create a logging folder on attach but it doesn't seem to work. Anyone has any tips when working with dllextension and generally good ways to debug it?

still forum
candid sun
#

thanks, stupid question. had a syntax error elsewhere

coarse dragon
#

hey, whats the code to blow a truck up via a trigger? i cant remeber it at all

drifting sky
#

Can anybody remind me of exactly under what circumstances AI go into "combat" mode? And does putting them in "careless" prevent them from doing that automatically?

granite sky
formal stirrup
#

Having some issues, the sleep happens when i first run the code however it starts skipping it

giveMaterials = {
  _pos2 = (getPosATL player) getPos [15, getDir player]; 
  _finalBuilding = nearestObject _pos2;
  income = 2;
  complete = true;
  while { complete } do { 
    [income] spawn { 
      uiSleep 5;
      _text = markerText "Marker1"; 
      _strSplit = _text splitString ":"; 
      _strNum = _strSplit select 1; 
      _mp = parseNumber _strNum; 
      _result = _mp + income; 
      _text = str _result; 
      "Marker1" setMarkerText "MP: " + _text;  
      _pos2 = (getPosATL player) getPos [15, getDir player]; 
      _finalBuilding = nearestObject _pos2;
      if (!alive _finalBuilding) then {
        complete = false;    
      };
     uiSleep 1;  
    };   
  };
};
``` Which im executing via this command
```sqf
[] remoteExec ["giveMaterials"];
#

Not sure why its skipping it

granite sky
#

indentation :/

formal stirrup
#

Sorry... VSC doesnt auto do it for me so i just ignore it

#

That should be right.

granite sky
#

complete is a global variable, which seems... wrong

formal stirrup
#

Would that break the suspending though?

granite sky
#

Nothing's going to break suspending.

formal stirrup
#

But something is, the code waits 5 seconds. then runs without pausing

granite sky
#

I'm struggling to tell what it's trying to do

formal stirrup
#

What the code does?

granite sky
#

It adds 2 to the number in some marker text until the nearest object to a point 15m in front of the player is dead/null/whatever?

formal stirrup
#

Correct. Im realizing now i need to change the object detection. but thats for later

granite sky
#

uh wait

#

It spams threads until that condition?

#

why?

formal stirrup
#

Spams threads?

granite sky
#

It's running a spawn in a while loop?

formal stirrup
#

Yeah, I thought i need to run either spawn or execVM to suspend

#

Can while statements use sleep?

granite sky
#

Only if they're in scheduled code.

#

I still have no idea what you're trying to do.

#

what it is doing is pretty crazy.

formal stirrup
#

crazy as in stupid? or as in weird

granite sky
#

I don't know. Are you intending to create a few million SQF threads?

formal stirrup
#

I'm not sure tbh, Not very good at optimizing code i make

granite sky
#

Like I said, I can't tell what it's trying to do so I can't fix it.

#

Maybe someone else can guess correctly.

formal stirrup
#

I appear to have fixed my issue, by swapping the spawn and while's positions

granite sky
#

That would at least be relatively sane.

formal stirrup
#

I will look into SQF threads to figure out what those are and how i can prevent creating too many

#

Thank you

granite sky
#

Every time you call spawn it's creating a scheduled thread and then continuing with what it was doing.

formal stirrup
#

So if i put spawn before the while, it only creates one?

granite sky
#

so:

[] spawn { whatever };
};

Is thread spamming.

formal stirrup
#

I see

#

Oh shit. i just realized my issue

granite sky
#

This however is a reasonable construct:

[] spawn {
  while {true} do {
    // whatever
  };
};
formal stirrup
#

I was just spamming the spawn statement

#

So it wasnt ignoring suspending

#

It was just making alot of them

#

I see

#

Thank you again, you have taught me something very helpful

drifting sky
#

Can anybody tell me exactly what setBehaviourStrong does?

granite sky
#

Units and groups have separate behaviour values that do different things.

#

setBehaviourStrong sets both. Probably.

viral birch
#

Got a banned player who is mass-connecting to spam the server for several hours a day for the past few days out of the week. I want to hide Player [BANNED_GUY] has connected. and Player [BANNED_GUY] has disconnected., but I don't want to hide all str_mp_connect / str_mp_disconnect messages -- only the malicious user's.

Any ideas?

I've even used Firewall rules to dump his connection, but he just uses VPN to cycle new IPs every time one gets blocked...

meager granite
#

That code is just chat messages filter

viral birch
meager granite
#

onPlayerConnected is done when they go from lobby to the game, no when they join the erver

#

Well you can let him in, set him some profileNamespace variable, save his name and then filter it out from connected messages

#

When he changes his name\IP he probably won't change his game profile so that profileNamespace variable remains

#

He joins, your script check that var is there, kick him and save his name for ignoring again

formal stirrup
#

Couldnt you tech use his steamID..?

meager granite
#

Oh true, it he doesn't change his steam account you can just check by UID

#

Thought its a cheater situation where they swap accounts too

formal stirrup
#

TBF, Buying arma on multiple accounts aint cheap

#

Unless its on sale

viral birch
meager granite
viral birch
#

I'm certain he will likely start using alt accounts if/when it comes to that, but at least then he has to spend money to harrass haha.

meager granite
#

Not usually, but there are some persistent ones

#

Didn't base Arma 3 go for like -90% recently or something?

#

That's the moment when they do it

formal stirrup
#
private _uid = getPlayerUID player;
if (_uid == "PUT_HIS_ID_HERE" ) then
{
// Put your code here
};

Something like this prob

meager granite
warm hedge
#

getPlayerUID already returns a string

formal stirrup
#

Oh

viral birch
formal stirrup
#

Well

viral birch
#

I think I have the pieces to do what I wanna do, just not sure the order/how to do it 😅

meager granite
#

Still he'll be able to spam "connecting..." because I don't think there is an Event Handler that fires on that

viral birch
#

or if it's even possible

meager granite
#

onPlayerConnected fires during Lobby->Game transition

formal stirrup
#

You will still need to pull the uid per player because it needs to pull each person connecting to match it

viral birch
#

str_mp_connect handles "player XXX connected" and str_mp_disconnect handles "player disconnected" -- but I dunno how to personalize that. It would just hide everyone's connect/disconnect messages instead of only his.

viral birch
meager granite
#

So that's what you need

#

So you can broadcast it to players so they can ignore it with connecting\connected\disconnected messages

meager granite
#

_name = "Sa-Matra"; format ["%1%2%3", _left, _name, _right]; => Player Sa-Matra connecting

viral birch
#

This snippet?

meager granite
#

Yes

viral birch
#

But how can it be tied to his UID?

meager granite
#

You need to get his name from UID elsewhere

viral birch
#

Would he need to connect in order to get his UID?

meager granite
#

in OnUserConnected, then broadcast it to players so they can use it in that function later

viral birch
#

So I would have to unban him but write some kind of silent kick on match?

meager granite
#

You can check their UID with getUserInfo in onPlayerJoinAttempt and kick them

#

Not sure if it will still produce a chat message for others

meager granite
viral birch
#

Yes

#

It shows XYZ is connecting, XYZ has connected, XYZ has been banned, XYZ has disconnected

meager granite
#

Well if it goes to connecting\connected state, OnUserConnected will probably fire so you can grab their name

viral birch
#
addMissionEventHandler ["HandleChatMessage", {
    params ["_channel","_text"];
    
    _channel = _this select 0;
    _text = _this select 3;
    _ltxt = toLower _text;
    if(_channel == 16) then 
    {
        {
            if(_ltxt find _x > -1)exitWith{true};
            
        } forEach [
        
            //[localize "STR_MP_CONNECTION_LOOSING", " "] call BIS_fnc_splitString select 3,            // Losing connection
            [localize "STR_MP_VALIDERROR_2", " "] call BIS_fnc_splitString select 2,                     // Modified Data
            [localize "str_mp_connecting", " "] call BIS_fnc_splitString select 2,                        // Player connecting
            //[localize "str_mp_connect", " "] call BIS_fnc_splitString select 2,                        // Player connected
            //[localize "str_mp_disconnect", " "] call BIS_fnc_splitString select 2,                    // Player disconnected
            "rulebreakingg"                                                                                // Ban Message Spam
        ];
    };
    
}];

This is what I have been using to hide the general XYZ is connecting... messages and then I set his Ban Reason to "rulebreakingg" as a test and it does hide his kick message. All that's left is "has connected" + "has disconnected" + the "Due to how the server is set up you must wait 10 seconds to reconnect" counter from KickTimeout[] in the server config.

meager granite
#
  1. Get his name on UserConnected event by UID check
  2. Broadcast it to everyone
  3. Ignore all _channel == 16 messages that contain this name
#

Probably something like this

viral birch
#

Yeah that makes sense. How would I broadcast it?

meager granite
#

publicVariable, remoteExec

#
psychoName = ...;
publicVariable "psychoName";
#

_text find psychoName >= 0

#

Maybe make it an array so you can keep several UIDs out

oblique lagoon
#

Is there a simple way to get file path in addon file?
For eg) I want to use portraitMusic_ca.paa icon in modules_f_curator.pbo.

viral birch
#

Yeah, definitely should be an array lol.

meager granite
#

Is it displayed somewhere without a path?

oblique lagoon
#

manually

meager granite
#

Dump whole config with kju's tool, Ctrl+F the file name

oblique lagoon
#

searching for all addon files in arma folder with pbo tool

meager granite
#

You find \a3\Modules_F_Curator\Data\portraitMusic_ca.paa

#

Maybe you can write a script that could dump you all strings that match input string

oblique lagoon
#

what tool did you use?

viral birch
# meager granite Maybe make it an array so you can keep several UIDs out

Thanks for the help man, really appreciate it. 🙂 I'll poke around with things and see if I can get it sorted. Worst case, I'll just nuke the global join/leave messages and that solves that, but I appreciate the help in going the extra mile to preserve it for everyone else. 🙂 I'll let you know if it all works out.

meager granite
oblique lagoon
#

oOo thanks I'll look at it

viral birch
meager granite
# oblique lagoon oOo thanks I'll look at it

Wrote a script snippet to search entire game's config for you:


    private _search = toLower "portraitMusic_ca.paa";
    private _matches = [];
    private _func = {
        {
            if(isClass _x) then {
                _x call _func;
            } else {
                if(isText _x) then {
                    private _text = toLower getText _x;
                    if(_text find _search >= 0) then {
                        _matches pushBackUnique _text;
                    };
                };
            };
        } forEach configProperties [_this];
    };
    configFile call _func;

    {
        diag_log _x;
    } forEach _matches;
    _matches;
#

Watch out, its pretty slow, freezes the game for a while

oblique lagoon
#

Wow thanks

#

the first problem is finding the icon, and then pasting

#

this will help 2nd step musch faster

meager granite
#

Dumps results into RPT and returns the result so it shows in debug menu or where you'll call it

oblique lagoon
meager granite
#

["\a3\modules_f_curator\data\portraitmusic_ca.paa"]

oblique lagoon
#

Can we hide this?

#

Just exsiting and show when we open comms menu

peak pond
#

I am writing a script to run in the 3DEN Editor. What is the correct way to create a group and have some units join it? createGroup and join don't seem to be saved by the Editor.

meager granite
#

I compared two shots together but I can't seem to figure what defines if shot explodes on such weak penetration

#

Listed are different config properties between two

peak pond
golden cargo
cosmic lichen
#

How do I correctly switch back to the player's camera?

SPE_Cam_Veh cameraEffect ["terminate", "back"];
camDestroy SPE_Cam_Veh;

Doesn't seem to work

hallow mortar
#

switchCamera player?

cosmic lichen
#

Actually, yes. Thanks

#

The effect type "Terminate" is used to exit the current camera view and switch back to the player's view.
This part on the biki is a bit misleading I think. Sounds like just terminating the camera would automatically switch back.

kindred zephyr
#

Is there a reason of why would I start getting this error when my mission was running fine until I updated my server binaries for my dedi?

 Warning Message: Preprocessor failed with error - Invalid file name(empty filename)

The mission works just fine on LAN with no errors on startup and behaves as expected

#

could the mission file "broke"?

sullen sigil
#

what is the file name

kindred zephyr
#

thats the thing, idk, haha. As mentioned, the mission was working just fine until the binaries were updated, it does not point towards anything specific

sharp grotto
kindred zephyr
marsh lark
#

#include <iostream> ?

dapper elbow
#

Hi guys, can someone help me with finding the loading screen messages for Livonia?

#

I found them in Addons\map_enoch.pbo and opened it with a pbo viewer, then converted the cfg from a .bin into a .cpp file

#

but they're not in the usual format

#

they're shown like this

#

loadingTexts[]=
{
"$STR_A3_C_CfgWorlds_Enoch_LoadingText1",

#

but on the Arma 3 Community website theyre shown like this

#

loadingTexts[] =
{
"Area of Stratis is 19.3 square kilometers.",

#

and I want them to be actually readable

#

so if anyone knows where I can find the text for the Livonia screens please let me know thanks

meager granite
#

go into editor, input this into console

#

you'll have all texts in the clipboard

drifting sky
#

What happens when there's a mismatch between a unit and his group's Combat Behaviour? Also, with setBehaviourStrong, does it include any functionality that involves resisting changes to combat behaviour in the future?

dapper elbow
#

thanks @meager granite big fan of ur game mode btw

granite sky
#

@drifting sky As far as I can tell they're used for different things. Stance is based unit behaviour while driving pathfinding is based on group behaviour, for example.

drifting sky
#

A followup question is I'm looking for any way to make ai more aggressive while they are in combat mode. I'm looking to have them move more quickly in other words, and toward the enemy.

pulsar bluff
#

@drifting sky an age old arma problem

hallow mortar
#

You can try disableAI "COVER" / "SUPPRESSION". No promises but it could help.
If you're working with LAMBS Danger, you can use their task functions to get more aggressive behaviour out of the AI.
Another thing I've seen tried is restricting the AI from entering Combat mode at all, using disableAI "AUTOCOMBAT". They will still fight, but without some of the Combat-specific behaviours.

#

Don't forget to also set their Courage skill right up.

carmine sand
#

is attachTo always disabling collision or is there a way to enable the collision?

little raptor
#

you can move the object every frame instead

#

using setVelocityTransformation

drifting sky
#

disabling autocombat seems to do nothing

#

They still go into combat mode, they still do the bounding overwatch

#

similarly, disabling enableattack on a group still allows ai leaders to issue attack orders.

oblique lagoon
meager granite
oblique lagoon
#

No engine support for it. Ok, Thanks!

oblique lagoon
#

OoO

#

wow

wind hedge
#

Is there an EH equivalent of a theorical "WeaponAimed" EH already in the game? I am trying to detect if an Ai unit is about to fire and prevent it if its suppression levels are too high in order to emulate "fear" and perhaps also forcing it to take cover, currently they behave like terminators too much when fired upon

warm hedge
#

Not sure if it works as KK's note suggests, but it is an old note as well

wind hedge
wind hedge
meager granite
#

Fired event handler, _this select 6 is the bullet, do something like:

_shot setVelocity (velocity _shot vectorAdd [-10 + random 20, -10 + random 20, -10 + random 20]);
thorny radish
#

I know how to make white and blacklists for ace arsenals using class names but is it possible to do it for a whole mod? Like if I only want to whitelist RHS and CUP can I do that without having to whitelist each individual item from those mods?

wind hedge
# meager granite `Fired` event handler, `_this select 6` is the bullet, do something like: ```sqf...

Good alternative, I already do that to prevent the static MGs from being laser accurate when manned by Ai... yet having an EH specifically for weaponAimed would be far more performance friendly since a unit takes perhaps a second to aim while in the same second it can fire several (docens) of bullets all running that code. Currently in Arma, Ai firing already eats lots of FPSs even without a firedManEH on the units

#

We have WeaponDeployed and WeaponRested Event Handlers but no WeaponsAimed 😢

meager granite
#

What was the command to have hints visible when viewing through a camera?

warm hedge
#

showHUD?

meager granite
compact warren
#

Hey, any ideas why ctrl is not rotating?

with uiNamespace do 
{ 
 ctrl = findDisplay 46 ctrlCreate ["ctrlStaticBackground", -1]; 
 ctrl ctrlSetPosition [0.5,0.5,0.1,0.5]; 
 ctrl ctrlSetBackgroundColor [0, 0, 0, 1]; 
 ctrl ctrlCommit 0; 
 angle = 0; 
 onEachFrame 
 { 
  with uiNamespace do 
  { 
   if (angle > 359) then {angle = 0}; 
   ctrl ctrlSetAngle [angle, 0.5, 0.5]; 
   angle = angle + 1; 
  }; 
 }; 
};

cosmic lichen
#

ctrlCommit is missing I guess Seem to not be the case if 4th param is not set

#

Also, keep in mind, depending on FPS the control will rotate faster/slower

south swan
#

well, if it's ctrl - it shouldn't go into local scope tanking

cosmic lichen
#

Forget that. I messed it up

#

The issue is that ctrlSetAngle only works on images or active text

#
with uiNamespace do 
{ 
 ctrl = findDisplay 46 ctrlCreate ["ctrlStaticPicture", -1]; 
 ctrl ctrlSetPosition [0.5,0.5,0.1,0.5]; 
 ctrl ctrlSetBackgroundColor [0, 0, 0, 1]; 
 ctrl ctrlSetText "a3\3den\data\attributes\loiterdirection\ccw_ca.paa";
 ctrl ctrlCommit 0; 
 angle = 0; 
 onEachFrame 
 { 
  with uiNamespace do 
  { 
   if (angle > 359) then {angle = 0}; 
   systemChat str ctrl;
   ctrl ctrlSetAngle [angle, 0.5, 0.5]; 
   angle = angle + 1; 
   ctrl ctrlCommit 0;
  }; 
 }; 
};
#

This works.

serene sentinel
#

Can someone help. I'm spawning different type of vehicles from array and want to check if is there place for gunner or commander in this vehicle then spawn them too. If not spawn only driver. Can't find want parametr i need to check in config file to find available crew seats in vehicle?

hallow mortar
serene sentinel
#

@hallow mortar Yeah, already taking a look at this command in wiki. I think it must help

sharp grotto
serene sentinel
#

interesting , but emptyPositions is closer to my objective, i think.

serene sentinel
#
[] spawn fnc_spawnVehicle; 
 
fnc_spawnVehicle = { 
_newGroup = createGroup west;    
private _pos = [getpos UPS_heli, 0, 6500, 0, 0, 0, 0] call BIS_fnc_findSafePos;
_VehicleClass = ["UK3CB_GAF_B_BRDM2","UK3CB_GAF_B_BRDM2_ATGM","UK3CB_GAF_B_Offroad_HMG","UK3CB_GAF_B_UAZ_AGS30","UK3CB_GAF_B_UAZ_MG","UK3CB_GAF_B_Ural_Zu23","UK3CB_GAF_B_Gaz66_ZU23"] selectRandomWeighted [14.28,14.28,14.28,14.28,14.28,14.28,14.28]; 
_veh = _VehicleClass createVehicle _pos;
_crewman1 = _newGroup createUnit ["UK3CB_GAF_B_RIF_1", _pos, [], 0, "FORM"];
[_crewman1, "kit_GAF_RIFLEMAN"] spawn dzn_fnc_gear_assignKit;
_crewman1 moveindriver _veh;
nul=[_veh,'UPS_marker'] execVM 'ups.sqf'
};
_commanderplace = _veh emptyPositions "Commander";
_gunnerplace = _veh emptyPositions "Gunner";
if (_commanderplace > 0) then { 
    _crewman2 = _newGroup createUnit ["UK3CB_GAF_B_RIF_1", _pos, [], 0, "FORM"];
    [_crewman2, "kit_GAF_RIFLEMAN"] spawn dzn_fnc_gear_assignKit;
    _crewman2 moveincommander _veh;
} else { 
};
if (_gunnerplace > 0) then { 
    _crewman3 = _newGroup createUnit ["UK3CB_GAF_B_RIF_1", _pos, [], 0, "FORM"];
    [_crewman3, "kit_GAF_RIFLEMAN"] spawn dzn_fnc_gear_assignKit;
    _crewman3 moveingunner _veh;
} else { 
};

Spawning only vehicle and driver 😦 What's wrong with it?

digital hollow
#

Does createVehicleCrew not do what you want?

tough abyss
#

given a few tags etc look custom so idk if you made this seperately

serene sentinel
#

no, it's written by me 😄

tough abyss
serene sentinel
#

my script abilities is very bad, so....

tough abyss
tough abyss
serene sentinel
tough abyss
serene sentinel
#

i want script to check if is there an commander or gunners place in spawned vehicle, then spawn customized unit in it

#

if vehicle have only driver place then only driver spawns

tough abyss
tough abyss
serene sentinel
#

Ok. I am not checking driver's seat in this script, it spawns directly

#

May be that is the reason that only driver spawns

tough abyss
digital hollow
#

Is there a way to get skeleton bone names?

ocean zenith
#

Hey so im sorta new to the whole scripting thing for arma 3, I have messed with functions before and have experience with scripting in Fallout I have an idea on something I want to do but I am wondering if I can get guidance on how to create variables such integers, refs and floats etc with this language. Maybe a wiki of some sort with the core structure of the language?

kindred zephyr
#

Hello fellas, when testing with multiple Arma instances on the same PC, does every Player object return the host only? Looks like im have some "fake" locality issues.

granite sky
#

You know the player object isn't immediately client-local in MP?

#

They're initially created on the server and then control is passed to the client machine.

#

Shouldn't matter whether they're on the same PC or not.

grand moat
#

Does anyone know how I could create a health bar for an enemy ship?

kindred zephyr
#

do you have any suggestion on how to wait for the transfer to be done?

Im having some issues since most of the code im working with is supposed to be run locally but seems to be at fault when the transfer happens.
I have already tested the code itself on only local units/player itself and works perfectly

hallow mortar
#

waitUntil local player?

kindred zephyr
# hallow mortar waitUntil local player?

turns out my problem is much more complex that just locality itself. HitPart doesn't seem to behave nice on remote units unless the shooter also has the event applied to the remote unit.

ornate whale
#

What is the best approach to make cutscenes in MP? I suppose I may run into problems with JIP, late joins, etc. So some parts may broke, collide, or just not play at all mid game.

hallow mortar
#

Land_Military_ID_Card_01_F is likely to be the name of the Editor-placeable container that holds the item, not the inventory item itself

#

One way is to place the container, inspect it in the Config Viewer, and check its TransportItems/TransportMagazines subclass.

#

However, in this case, that won't work, because Land_Military_ID_Card_01_F is not a container for an inventory item - it's just a prop. It's not interactive and doesn't contain anything.

#

There are CSAT ID card things that contain inventory items, but they're not visible in the Editor. You can find them in the Config Viewer under CfgVehicles (container) and CfgWeapons (item).
The container classname and item classname, respectively, are:
Item_CSAToperatorAccesCard_01 // Csat_Id_01
There are 5 distinct types, just change the numbers from 01 ... 05

#

The Item_ prefix is BI's (inconsistent) convention for indicating that it's a vehicle that's for containing an item.

fair drum
#

Emphasis on inconsistent

still schooner
#

how do i make a npc with a automatic rifle shoot semi automatic?

hallow mortar
#

If you want something that is clearly ID but not CSAT-specific, there is Wallet_ID

#

Keys

#

often used to unlock doors, not faction-specific :P

grizzled cliff
#

function(_test) { player sideChat format["t: %1", _test]; }("hello world");

#

function keyword added to carma

split nebula
#

good morning, anybody tried these yet? "Added: Extended scripting commands getDir, getPos, and new commands getRelDir, getRelPos" from the devbranch changelog

#

nvm got the info i needed from the wiki :)

meager granite
#

Huh, turns out that damage sent to crashed\frozen player is ignored if their client times out and ownership transfers to server

#
  1. Player 2 freezes and crashes
  2. Player 1 shoots Player 2
  3. ... is losing connection
  4. Player 2 disconnects, P2'unit ownership goes to Player 1
  5. P2'unit is undamaged
south swan
#

inb4 shooting that same unit again after ownership transfer applies cumulative damage, including what was caused in step 2.

meager granite
#

I guess if Player 2 didn't crash and eventually regained connected the damage would still arrive to them

south swan
#

or would be lost in non-guaranteed network depths

#

or in guaranteed that are considered to be "sent already, why bother resending?" 🙃

meager granite
#

Tried re-connecting before previous client drops, you get "connecting failed"

fair drum
#

@meager granite what have you been working on recently? Been seeing a lot of damage questions/testing from you recently.

meager granite
real tartan
fair drum
#

I believe this is the apex one

kindred zephyr
#

Is there an explanation/reason of why hitPart only fires on the shooter pc but not on target pc?

It's kinda counter intuitive to have to set up the handler to the object on each shooter pc instead of just setting it to the target you are gonna monitor and do something with that info.
Wouldn't it make sense to have 2 versions of it, one for shooter and one for target is that the case?

I know handleDamage kinda serves a similar purpose (beside its damage handling abilities duh) but it's a little problematic to have the info for detailed selection impacts on hitPart but not handleDamage, specially considering hD returns the hitpoint impact 3 times on different variables.

south swan
#

i assume it's because bullet damage calculations are done on shooter's machine only 🤷‍♂️

meager granite
#

Wish there was HandleDamage on shooter side too

#

HandlePreDamage or something

granite sky
#

Yeah, it's just how the engine works. Arma has shooter-side hit detection and object-owner-side damage.

grizzled cliff
#

more suga

kindred zephyr
#

well, if such is the case then I will have to either figure out how custom hitpoints are being identified by the likes of ACE or live my life with network spamming until I figure out the previous. Thanks for the insight guys

brittle badge
#

I have a problem that I need help with. The point is that I created a warlords scenario and also a custom asset list. The basic AI skill is 70% but I want the AI ​​skill to vary depending on the unit. For example, the sniper should have a higher skill than the normal shooter. What code do I have to write in the description.ext or other file for this to work and above all HOW DOES IT WORK (I have 14,000 hours in Arma 3) please help.

kindred zephyr
south swan
#

place a fake hitpoint deep into the damage tree => log every incoming damage until fake hitpoint gets hit => sort by damage number => apply damage according to most damaged hitpoints => clear the queue, wait for the next dumpsterfire to occur

granite sky
#

I assume the fake hitpoint has a dependency on all the others so it's guaranteed to fire.

#

The real spanner in the works here is the two shooter-side handleDamage calls.

#

Possibly ACE just hopes that they don't interfere.

#

In theory you can have two shots with interleaved handleDamage calls, because the shooter-side and target-side calls hit in different frames.

south swan
#

inb4 fake damage calls don't inherit fake hitpoint and don't fire it

granite sky
#

I'd be surprised if they did given that they only fire hitHead and general damage.

#

If they took any notice of hitpoint dependencies then they'd also fire incapacitated, but IIRC they don't.

south swan
#

magic derpWolf

kindred zephyr
#

they do #structural instead of body or incapacitated

granite sky
#

that's just a translation of the ""

#

Kinda surprised that it works because the HitHead that normally fires is shooter-side...

kindred zephyr
#

ah wait a minute

class HitLeftArm: HitHands {\
        material = -1;\
        name = "hand_l";\
        radius = 0.08;\
        visual = "injury_hands";\
        minimalHit = 0.01;\
    };\

They are just using the selection to know where the hitpoint is?

granite sky
#

That's the standard relationship between selections and hitpoints, isn't it?

#

Vanilla behaviour has single hitpoint for both left and right arms.

#

(and another single hitpoint for legs)

kindred zephyr
#

so by just defining a new hit point and using the selection as reference they are able to get the info from handle damage itself?

round scroll
#

nice, will we see named arguments as well? :)

granite sky
#

apparently.

kindred zephyr
#

its that the reason of why armor breaks though? or is that other issue regarding the ballistics component?

granite sky
#

You mean units being nearly invulnerable to body shots?

kindred zephyr
#

ye

granite sky
#

It's kinda working as intended :P

kindred zephyr
#

i would assume you have to set new passthrough and armor values for these additional hitpoints too unless they have a way to just inherit the arms and leg armor values?

granite sky
#

hmm, not sure if they have a hack for adding arm/leg armour back in. It's fairly rare in common Arma mods.

#

@brittle badge In script terms it's just a matter of calling setSkill on your AI after spawning it.

#

but that's not something you do in description.ext.

#

Warlords has dynamic unit spawning so you'd need to hook that.

brittle badge
#

thanks but how my friend

kindred zephyr
granite sky
#

You would need to read the Warlords code and figure out where it's creating units.

#

well, you could hook entityCreated I guess...

#

but that's ugly and may collide.

brittle badge
#

or by req?

#

_setunitskill?

granite sky
#

I don't know, that's custom Warlords config.

#

May or may not have skill-setting capability.

brittle badge
granite sky
#

Nope.

grizzled cliff
#

possibly

#

though probably not soon

fair drum
#

@brittle badge you can create a event handler for "EntityCreated" then filter by class and adjust skill, however, a quick scan through warlords code shows that they change the skill, like when a place is on defense, so that would overwrite whatever you did anyways

#

when sectors are created, they add random skill to the units as well:

for [{_i = 0}, {_i < _garrisonTotal}, {_i = _i + 1}] do {
    if (_i < _spawnPosArrCnt) then {
        _spawnPos = _spawnPosArr # floor random _spawnPosArrCnt;
        _j = _j + 1;
    } else {
        _spawnPos = [_center, random 50, random 360] call BIS_fnc_relPos;
    };
    _newGrp = createGroup [_side, TRUE];
    while {count units _newGrp < 8} do {
        _newUnit = _newGrp createUnit [_unitArr # floor random _unitArrCnt, _spawnPos, [], 10, "FORM"];
        _newUnit setSkill (0.2 + random 0.3);
    };
...
...
...
serene sentinel
#
_turretplace = _veh emptyPositions "Turret";
_turretPaths = allTurrets [_veh, false];
while {_turretplace > 0} do { 
    _crewman4 = _newGroup createUnit ["T_cdf_TTsKO_pilot", _pos, [], 0, "FORM"];
    [_crewman4, "kit_CDF2_pilot"] spawn dzn_fnc_gear_assignKit;
    _crewman4 moveInTurret [_veh, [0, 0]];
};

What can i put here instead of [0, 0] to make crew spawn in all free turrets?

jolly oxide
#

Hello! Any good tutorial about how to make a script with the function like the RCO sight and how to implement? Trying to find at YT but it always shows me mods recommendations and how to use it in game 😦

hallow mortar
digital hollow
sterile arch
#

Can anyone point me in the direction of a simple AI respawn script to respawn a few groups of enemies with a customized loadout (including shoulder insignia)?

royal spruce
#

wish the spectrum device functions from the contact pbos weren't exclusive to the contact branch

meager granite
meager granite
#

Doesn't it mean it works in vanilla but doesn't in Contact? 🤔

dusk gust
#

^

royal spruce
#

(i think)\

dusk gust
#

Iirc the object is in the base game, but the scripts you describe arent loaded unless contact it

#

Is*

meager granite
#

I'm 100% sure I tested these functions without contact

#

As in in normal game (with Contact bought though)

serene sentinel
#

@digital hollow yeah, your variant works, but i can't assign unitclass to spawn

dusk gust
digital hollow
serene sentinel
#

@digital hollow not so much, only unit have different identity types

dusk gust
meager granite
#

Honestly strange why these functions aren't alongside the spectrum device

hallow mortar
#

There are quite a few functions and other things in Contact Optional that I feel really should come to Contact Platform. Antenna stuff, HUD compass, EMP'd vehicle and optic variants, BFAs.... but a dev said very recently that nothing else is going to be brought over.

serene sentinel
#

Is there any command that counts not in vehicle units in group?

hallow mortar
#

There's no command specifically for that, but it's a pretty easy check to make.

_number = (units _group) count {vehicle _x == _x};```
#

I'm sorry, that's backwards

#
_number = {vehicle _x == _x} count (units _group);```
serene sentinel
#

Thanks, will check it out

hallow mortar
#

For an array of references to the units in question, you can use select, which is that way round:

_array = (units _group) select {vehicle _x == _x};```
#

The world would be a better place if the array/condition syntaxes for count and select were the same shape :U

hushed tendon
#

Is there a way to tell if a classname is an optic, bipod, muzzle? I'm trying to scan through CfgWeapons and get only those items

#

I feel like there is a command for this but I can't find it

hallow mortar
#

I think the item type number (in its itemInfo subclass? maybe?) determines what it is.

dusk gust
hallow mortar
#

isKindOf isn't a completely reliable way of doing it. There isn't a base flashlight class that all flashlights are guaranteed to inherit from. You could have a unique flashlight class that only inherits from ItemCore - most vanilla flashlights are like this, even. isKindOf would not tell you that's a flashlight unless you had specified its own classname as a flashlight class to check against.
* same for other accessory types

#

So you can use isKindOf if you already know all the types of accessories you want to look for, but it's not a good way of doing an open-ended search.

#

It looks like siderail accessories are type 301, muzzle devices are type 101, optics are type 201, and bipods are type 302.

hushed tendon
hallow mortar
#

An item's type is in its CfgWeapons entry, in its ItemInfo subclass

#

Make sure you have Leopard20's Advanced Developer Tools installed for a much nicer config browser

hushed tendon
hushed tendon
hallow mortar
#

That's the type listed in the main config class. You need to look in the itemInfo subclass.

hushed tendon
hallow mortar
#

It is. Once you've selected the item in the left panel of the config viewer, you should see an expanded list of its subclasses, also in the left panel. itemInfo is one of those.

hushed tendon
#

Oh I see

#

I was only viewing it from the CfgWeapons perspective and not actually going into the class config view

#

Thx for the help NikkoJT and Fraali meowheart

serene sentinel
#
_NonCargoUnits = {vehicle _x == _x} count (units _newGroup);
if (_NonCargoUnits > 0) then { 
    _veh2 = _VehicleClass createVehicle _pos;
    {_x moveinany _veh2} foreach _NonCargoUnits;
} else { 
};

@hallow mortar This not working, seems because _NonCargoUnits is number. Is there any chance to make this work?

hallow mortar
#

You need a for, not a forEach

#
for "_i" from 1 to _nonCargoUnits do { ...```
serene sentinel
#

Ok

serene sentinel
#

@hallow mortar

_NonCargoUnits = {vehicle _x == _x} count (units _newGroup);
if (_NonCargoUnits > 0) then {
    _veh2 = _VehicleClass createVehicle _pos;
    for "_i" from 1 to _nonCargoUnits do {this moveInAny _veh2};
} else { 
};

Also don't want to work. Swears at "this" in {this moveInAny _veh2};

hallow mortar
#

Okay, no, hold on, this isn't what I thought you were doing

hallow mortar
serene sentinel
#

@hallow mortar it's all working now. Thank you very much 🙂

wary needle
#

anyone know how to muffle sounds. i am trying to simulate a less dense atmosphere and i want to add an effect of muffledness. i am using ace btw, if that makes a diffrence

kindred zephyr
young current
#

doesnt ace have earplugs. how does that work?

granite sky
#

fadeSound is the core command I think. That is just volume though.

blazing loom
#
systemChat "All Players Ready";```
having an error with this, how do i do **or** instead of using || ?
dusk gust
blazing loom
#

its saying expecting true or false when i tried or. The force players ready is a thing the team leader can do and that starts the mission but the RPT isnt liking it.

systemChat "Al>
   Error position: <|| force_players_ready)}; ```
warm hedge
#

forEach returns nothing so that's why

blazing loom
#

could i do for allPlayers instead of forEach?

#

its to fix the day of the rangers (black hawk down coop) mission, author hasnt been online for ages and im not sure how to fix the error

warm hedge
#

No. You need a boolean after all

#

You want to check all players are ready right?

blazing loom
#

correct, and i think the || force_players_ready is so teamleader can force all players ready

warm hedge
#

You can have allPlayers findIf {_x getVariable ["ready", false]} == -1

#

Not tested

blazing loom
#

Thanks! I'll give that a try and see what RPT says

warm hedge
#

Hmm I think I missed one, probably != instead of ==

blazing loom
#

getting this error now, am I writing it correctly?

systemChat "All Players Ready";
>
14:52:24   Error position: <= -1;
systemChat "All Players Ready";
>
14:52:24   Error Invalid number in expression
14:52:24 File mpmissions\__cur_mp.Mog\arsenalstart.sqf..., line 22```
ornate whale
tulip ridge
blazing loom
warm hedge
#

findIf already requires boolean and boolean == boolean is unnecessary

ornate whale
warm hedge
#

Hence I said !=

ornate whale
# warm hedge Hence I said !=

But findIf looks for the first element which meets the condition, that is why u need it inside. Otherwise u could get a false positive result. You need to look for the first who is not ready.

blazing loom
#

getting this error

systemChat "All Players Ready";
>
15:07:01   Error position: <= -1;
systemChat "All Players Ready";
>
15:07:01   Error Invalid number in expression
15:07:01 File mpmissions\__cur_mp.Mog\arsenalstart.sqf..., line 22```
ornate whale
blazing loom
ornate whale
blazing loom
brittle badge
fair drum
brittle badge
#

how to put it in? /wehre

fair drum
#

I'm telling you that in multiple places, BI changes the ai skill multiple times. So anything you do, it's not going to stick and gets over written.

finite bone
#

If I want to make an AI stay at one spot but still turn around, throw grenades, and shoot, do i turn off Path or Movement in abilities?

finite bone
#

cool thanks

hazy salmon
#

Hi, im using a spawn Script wich works with markers and uses getMarkerPos as a function to get the spawn postition since getMarkerPos always returns 0 for the z coordinate it doesnt work on roofs or the aircraft carrier. is there an easy way to fix this or do i need to work with obejects and getPosasl

south swan
hallow mortar
# south swan <https://community.bistudio.com/wiki/getMarkerPos> 😮

Note that that only works for script-created markers that actually have a Z coordinate to preserve. Editor markers are always placed at ground or sea level.
If you want Editor placement and 3D placement, it might be better to use an invisible object rather than a marker as your reference.

hazy salmon
hallow mortar
#

Well you created it at [0,0,0] (the zero coordinates of the map, one of the corners) and never moved it. That will definitely result in getting a 0 Z coordinate when you check its position.

hazy salmon
#

Yeah I know that was just the template

#

I don’t got the script on my phone only the template, but I replaced it with the correct coordinates and the debug console still shows “0” for z

velvet knoll
#

Hey all, attempting to use the libertad horse mod for my units deployment. Recreating TF Dagger. Only issue is they dont have any carrying capacity. Im attempting to script in an inventory for the horse, anyone got a good starting point?

rich frost
#

If i want to disable a trigger locally, how would i go about that? - mainly after the trigger has been used to improve performance

ornate whale
willow hound
#

No need, you can use enableSimulation to disable it temporarily or deleteVehicle for a permanent solution.

#

Maybe deleteVehicleLocal; I'm not sure if deleteVehicle will delete the trigger globally. Usually everything about triggers is local, but this may be an exception, so you'd have to test that.

south swan
#

inb4 _trg setTriggerActivation ["NONE", "PRESENT", true]; _trg setTriggerInterval 1e13; blobcloseenjoy

burnt cobalt
#

does anybody know where for example Virtual Arsenal takes the addon-logo for each weapon from? I tried using the config's 'dlc' property, running it through cfgMods to get the picture, but that only works for a handful of addons. I also tried BIS_fnc_weaponAddon but it's very heavy and also did not get me anywhere. Any ideas?

meager granite
#

Ticket about fake HandleDamage fires that affect non-MP compatible unit bleeding and something else I have no idea about

cosmic lichen
# burnt cobalt does anybody know where for example Virtual Arsenal takes the addon-logo for eac...
params [["_config", configNull]];

//Get the DLC, make sure it's a DLC and was not modified by a mod (CBA, ACE)
private _addonClass = "";
private _sourceConfigs = configSourceAddonList _config;

//Exit if there are no source addons
if (_sourceConfigs isEqualTo []) exitWith {[]};

private _mods = configsourcemodlist (configfile >> "CfgPatches" >> _sourceConfigs # 0);

//Exit if there are no mods
if (_mods isEqualTo []) exitWith {[]};

_addonClass = _mods # 0;

//Exit if class name is empty (Vanilla Arma 3)
if (_addonClass == "") exitWith {[]};

//Return class, name and image of the addon
[_addonClass, modParams [_addonClass, ["name"]] # 0, modParams [_addonClass, ["logoSmall"]] # 0]

Something like this works

brittle badge
#

and this?

exotic flame
#

Just to be sure on the say3D command wiki page, i read "local effect". So in order to play the sound on multiple computer i have to remoteExec it ?

exotic flame
# winter rose yup

Thanks. I think many mod makers didn't understand that and are unnecessarily asking the server to perform tasks when it shouldn't have to

digital hollow
burnt cobalt
#

@cosmic lichen amazing, thank you!

velvet knoll
#

The issue then is - these horses will be in a vehicle spawner of sorts - meaning they will get spawned in by the players. So I would need to spawn a box everytime the horse is created as well.. i think

digital hollow
manic kettle
velvet knoll
drowsy geyser
#

Is there a way to prevent a player from turning left/right with the mouse? I can disable it from the control settings if I remove the "Mouse Left"/"Mouse Right" entry
unfortunatly the below does not work.

[] spawn
{
    waitUntil {!isNull findDisplay 46};
    (findDisplay 46) displayAddEventHandler ["MouseMoving",
    {
         if    (inputAction "lookLeft" > 0 || inputAction "lookRight" > 0) then
         {
            true
         };
    }];
};
meager granite
#

attach the player

little raptor
#

that also prevents him from aiming up/down iirc

#

setVelocityTransformation every frame does the trick

meager granite
digital hollow
#

prevent turning, not aiming, so it's my favourite: put player in empty ffv vehicle.

granite fog
#

question about displayAddEventHandler

 Code - the code which gets executed when event is triggered. Returning true in event handler code will override default engine handling for keyboard events.

do we have same alternative for engine handling for mouse events ? Like if i want to disable "fire" action for player until something not happend

drifting sky
#

For use with the WeaponRested event handler, is there any way to determine how a weapon is rested? If it is on the ground, or on (top) of a wall, or rested sideways against a wall?

fair drum
granite fog
pulsar bluff
sullen sigil
#

i also did it in my burst pbo but i cant actually remember how

#

oh yeah

#

you do it with the condition

#

if condition is true then you dont block it if condition is false then you block it

teal flare
#

Is there any suitable eventhandler or way of triggering a script when a curator remote controls a unit?

#

I need to immediately apply code to remote controlled units, and don't want to constantly check for if a unit is being remote controlled for performance reasons

sullen sigil
#

checking if unit is being remote controlled should be fairly cheap after 2.14

#

havent tested performance of it yet but you can with the little speedometer icon in debug console, will return how long it took to execute on average with 1000 cycles

unreal pulsar
#

Anyone on that can give me a small hand. Small idea I wasn't sure if it was possible

#

Just wondering if you can move unit from the spot you pick on radio. Sorry to bother everyone still learning

digital hollow
unreal pulsar
#

Like I want to use my radio to call a truck with supplies to a point I choose in game

digital hollow
#

That's set up in editor with the Supports modules.

unreal pulsar
#

so watch the support modules video again. Thank you

#

Small question is there a place to look for spawning in reinforcements for bases so I don't have to bother you guys. Have had trouble finding any video or anything 😞

digital hollow
#

Again, lots of ways to interpret that. Try to give more details in #arma3_editor, more appropriate channel unless you're asing about scripting.

unreal pulsar
#

My bad I thought I would need a script to get them to move to where I radioed them. The support modules are for drop in not control over it. I'll try a different way sorry about this

shell panther
#

Im having issues adding a script, and uploading a custom mission file to my server. Would anyone here be willing to help out? I can pay you for your time and expertise.

open hollow
#

is posible to make a misile from AA to lock on an object ?

#

im trying to do something like an iron dome basically

#

i dont want to make it functional, just an ambient stuff

meager granite
#

I wonder if we had something like STRING += NUMBER it would be faster than usual assignment?

#
"_var" += 10;
```is much uglier than

_var = _var + 10;

south swan
#

cringe

carmine sand
#

Does such work with the attachTo for a animated Object?

(_object is defined)

private _turret01 = "TG_Turret01" createVehicleLocal (getPos _object); _turret01 attachTo [_object,_object selectionposition "TG_Turret_Position_01", "TG_Turret_Position_01"];

TG_Turret_Position_01 is a memory point in a house which has a animated part

In cfgSkeletons TG_Turret_Position_01 is connected to the animated part of that house.

Taken the example of the attachTo with Usti hlavne, Usti hlavne is also connected with selectionname mainGun

player attachTo [tank, [0, -1, 0], "Usti hlavne"];

but instead of using the xyz coords id like to use the selectionposition

warm hedge
#

attachTo should work regardless which object is. But if that is a house, which means slow simulation object, will make the attached object slow too.
Also, I do believe using [0,0,0] for a bone attaching, that probably should mean the first point of the desired memory

still forum
still forum
carmine sand
# warm hedge `attachTo` should work regardless which object is. But if that is a *house*, whi...

These 0,0,0 are these xyz coords and the house is a bigger one and id like to use predefined memory points, so id like to use the selectionposition instead of the [0,0,0]

So im not sure if that works like the example is:

player attachTo [tank, [0, -1, 0], "Usti hlavne"];

And my variant would be s example like:

player attachTo [tank, selectionposition "Usti hlavne", "Usti hlavne"];

Last Usti hlavne is for attaching to a animated

warm hedge
#

Hmm I think I haven't messed around with attachTo that deep

carmine sand
warm hedge
#

Yeah the rotation to the bone is relatively new (a few years ago)
And about your last sentence, not sure what it does mean

carmine sand
#

Id like to make a turret class and a tank class not getting moveable and ive attached it to a invisible house class i did so its just at fixed position all the time, doesnt mind elevation and such, like a house just stays there.

But the AI turret does weird movements like 1fps moves kekw2 , if im the gunner it works perfectly fine

warm hedge
#

Yeah 1 FPS is what I meant in

a house, which means slow simulation object, will make the attached object slow too.

carmine sand
#

So im looking for a solution that is also keeping its fixed position but doesnt slow down the AI in turret movements

#

Turret attachTo fake turret while fake turret is attached to house so the real turret is not attached to the house directly kekw2 kekw2 kekw2

hallow mortar
#

You can attach it to something with a higher sim rate with no house involved. Just need to hide it somewhere no one's gonna knock it over

carmine sand
#

Yeah but what kind of class does have a higher sim rate

#

Even the vanilla turrets you can move around with a tank and flip them over etc. Ive tried to increase mass aswell but still you can flip and sometimes you can send them to orbit

hallow mortar
hallow mortar
still forum
#

Sad

#

There was that thing recently where I wanted to change a thing to only happen in new eden missions, forgot what it was 🙃

south swan
#

something something pre-init unit variables to objNull, so people don't need to check for isNil "playerSlot1" for empty player slots

hallow mortar
south swan
#

especially when 3d placement in editor is only really viable for objects blobdoggoshruggoogly

hallow mortar
#

I remember words (from Dedmen?) about maybe getting 3D marker visualisation in the Editor, so it'd be cool to get access to the third dimension alongside that. Only if doable though, obviously.

still forum
#

Ah yes thanks.
I wanted to add creationDate and creation game version into mission.sqm for that.
From the initial first creation of the mission.sqm, to make it only apply to new missions

#

oof yeah that was a long time ago 😄

cosmic lichen
#

Also that markers with alpha 0 are also invisible in the editor is a pain.

errant jay
#

relating to https://community.bistudio.com/wiki/BIS_fnc_initIntelObject;

i have everything working with no problems, but does anyone know if its possible so that when the intel is picked up, the map interface would not open up? or just for the one picking it up?

currently it just pops the map interface up for everyone

my current script;
https://pastebin.com/MqYhJBd9

cosmic lichen
#

Just copy the function and remove the open map part.

errant jay
#

unfortunately, i don't know which part is that

tiny rampart
#

Not only it's outdated but also the result differs between them

ivory lake
#

its not a function its a scripting command

tiny rampart
ivory lake
#

No

pulsar bluff
#

_logic = (createGroup [sideLogic,TRUE]) createUnit ['Logic',[-1000,-1000,500],[],0,'CAN_COLLIDE'];

#

_turret attachTo [_logic]

digital hollow
digital hollow
errant jay
digital hollow
#

it's in line 102

errant jay
digital hollow
errant jay
#

that explains it, thanks

stark fjord
#

Questionoid about setObjectScale, since its global effect, it only has to be set where object is local and its then broadcast to all clients right?

sullen sigil
#

if local args yes

stark fjord
#

Great, now, that command doesnt play well with simulated stuff that arent type of house.

But if you ran it locally on each client, on each frame, but object is remote, would it still have local effect, or just straight up ignored.

And before someone mentiones the evil word preformance, i dont care about it, i think tiny rambo is worth -30 fps

sullen sigil
#

sometimes

#

ive already tried it

#

doesnt work if client isnt server

stark fjord
#

Yeah i noticed i works in sp/listen server, but not on DS

sullen sigil
#

havent tested lan or whatever but would imagine its the same

#

just if client isnt the server it dont work

stark fjord
#

So i guess thats a no for tiny rambo 😦

#

Oh btw, vest attached sidearm doesnt scale, hence small rambo with big (micro) uzi

sullen sigil
#

is that attached with attachto or something

#

i never ran into that problem myself

stark fjord
#

no, you know how you have certain vests with holsters?

sullen sigil
#

yes

stark fjord
#

That

sullen sigil
stark fjord
#

yeah i just noticed, but for me it does that, modded or unmodded

sullen sigil
#

odd

#

either way dedmen hates me as is for height matters so doubt it'll be "fixed"

stark fjord
#

Well anyways, ill go with backup idea of combined arms in huge house op

golden verge
#

is there a way to get a script to read marker names?
idea is to place a marker on the map and name it for example "hunter" then it be deleted and spawn a hunter on the marker location

golden verge
#

im struggling with trying to read infomation from "markerText" and getting that to activate a script judging by the name

opal zephyr
#

What part are you struggling on?

#

'markerText' should give you the name that the user put for the marker

golden verge
#

yes, how do i get that text say "hunter" to activate a script spawning said hunter

#

somthing like if markertext = hunter then do the thing?

opal zephyr
#

Ya pretty much. If you want to have it happen on mission start then you could put it in an init script

golden verge
#

yea i was looking for it to happen anytime during the mission

opal zephyr
#

Ah

golden verge
#

i wasnt sure if the init would be the best place for it and is repeatable

opal zephyr
#

If you have lots of users being able to do it then you will have to ensure they type out the name correctly for it to spawn

golden verge
#

thats an option but would like to have just one person doing it and ill write somthing that allows it to enable everyone

opal zephyr
#

Are you looking for it to happen only for curators? Or all users

golden verge
#

well its a normal mission no zeus or anything but just one player (admin) or all players as an option

opal zephyr
#

Ah ok

golden verge
#

but not worried about that well say one player for now

opal zephyr
#

I dont know if theres an event handler for map markers for non curators

#

If there is then it would be best to use that. Otherwise you could do it on a loop or you could do it on a map closed event (im pretty sure there is something for this)

opal zephyr
#

Ah perfect there you go

golden verge
#

😮

opal zephyr
#

Thanks artemoz, im on mobile rn and wikis are hard lol

tulip ridge
#

Is there anyway to access the arguments passed to an addAction in its condition?

golden verge
#

it would have to be on map closed tho right? cause if you make the marker wont the event handler activate before i could name it

opal zephyr
#

No, the event happens after the name and everything is added and you press ok

golden verge
#

ooohhh alright

#

then just have the marker string read the text

opal zephyr
#

The EH also has a "owner" variable so you can check that if you want only certain users to be able to do it

#

Ya you wouldn't have to use markerText with this solution

golden verge
#

how so? im lost on that

#
addMissionEventHandler ["MarkerCreated", {
    params ["_marker", "_channelNumber", "_owner", "_local"];
}];
#

thats what it gives out

#

so id just have a ton of if statments depending on all the vehicles id want to be able to spawn

south swan
#

Imagine Ctri-drawing on the map that spawns more and more Hunters as you go 🙃

golden verge
#

oh my

south swan
tulip ridge
opal zephyr
golden verge
#

yea to make it user friendly im having "hunter", "hunterGMG" etc

opal zephyr
south swan
hallow mortar
south swan
#

Doesn't seem so

opal zephyr
#

Oh wait you want access to it in the condition not the code

#

Misunderstood the wording, sorry

hallow mortar
#

But you could simulate it by doing setVariable/getVariable on the object the action is added to

opal zephyr
#

@golden verge Take a look at cases, you might find it more efficient then a bunch of if statements

golden verge
#

10-4 thank you for all the help

tulip ridge
# south swan Sounds like "no" then, save stuff as a separate setVariable on the object or som...

Yeah I trying to think of some way to get around it, but I'm doing it in a forEach
Whole thing is basically just a box with some actions on it to give players a weapon and magazines for it, but I only want certain guns to appear based on a player variable

params [["_object", objNull, [objNull]]];
if (isNull _object) exitWith {};

{
    _object addAction
    [
        _x,
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            _arguments params ["_weapon"];
            [_weapon] call BNAKC_fnc_grabWeapon;
        },
        [_x],
        _forEachIndex,
        false,
        false,
        "",
        "true" /* Should check if _weapon is available in a variable set on the player */
    ];
} forEach ["MX", "Sniper"/*, etc. etc.*/];
opal zephyr
# south swan Inb4 hashMap

Ya but you'd still have to have a ton of code filling said hashmap, it will end up being the same amount of code probably, just more efficient when the eh is called. Eh I guess you're right then

south swan
tulip ridge
#

So like after the addAction, assign a variable to the object using the action id with whatever _x is?

south swan
#

With whatever addAction returned

tulip ridge
#

Yeah it returns the id

#

Good idea, I'll give that a shot

south swan
#

Another take would be format-ing the parameter into the condition when adding action 🙃

tulip ridge
#

?

south swan
#

format ["[%1, player] call MUH_check_dat", _x] instead of "true" or whatever condition

#

Basically, create a proper string condition once when adding an action 🤷‍♂️

tulip ridge
#

The "🙃" made me think it was going to be some cursed thing like formatting the entire addAction or something

formal nacelle
#

hi guys, trying to figure out how to use attachto on a tank turret and have the objects rotate with it, i understand its using setVectorDirAndUp but my tiny brain cannot process how to work that

hallow mortar
#

You need to find the bone name for the turret, and use attachTo's additional parameters to attach to that specifically, and turn on following bone rotation

south swan
#

Or maybe search this channel for word "eventually", i remember making that jole when similar problem was solved here

formal nacelle
hallow mortar
#

Try "mainTurret"

formal nacelle
#

alright let me give that a go

formal nacelle
#

alright, so i've figured out everything but the offset, how would i find that?
config looks like this atm

hallow mortar
#

Using mainTurret like that is only correct if the variable name of the vehicle you're attaching to is mainTurret. It does not have to be - that was a suggestion for what to use as the bone name (which you currently have as "otocvez"), not what the vehicle needs to be called.

#

The offset is the position the attached object will be placed at, relative to the object (or bone/selection) it's attached to. Since this is entirely up to you, the offset is usually found by trial and error.

formal nacelle
#

yeah that was a mistake lol

#

appreciate help

zealous heath
#

Anyone know how to make it so that when acion "open" is executed with this code

_term = _this select 0;
[_term,['Terminal_source','Terminal_source_sound'],100,1] call bis_fnc_LinkTerminal_Animations},nil,1.5,true,true,"","_target animationSourcePhase 'Terminal_source' == 0",5,false,"",""];

this addAction ["Close", {
_term = _this select 0;
[_term,['Terminal_source','Terminal_source_sound'],0,1] call bis_fnc_LinkTerminal_Animations},nil,1.5,true,true,"","_target animationSourcePhase 'Terminal_source' == 100",5,false,"",""]```

it triggers a "hack laptop"? and what to put into said laptop to complete the task?
queen cargo
#

@round scroll use OOS for that
(that and type safety)

#
{
    static void foobar(string s)
    {
        SQF diag_log(s);
    }
}```
formal nacelle
digital hollow
formal nacelle
#

oh wow, let me see if i can get that working

kindred zephyr
#

is there a way to know if a player is clmibing up a ladder besides getting the animations?

formal nacelle
digital hollow
formal nacelle
#

alright, i'll see if i can figure it out

limber thunder
#

Can anyone tell me how to query different variables with one logical operator?

if (_GameTime == 0) then {
        if (_check1, _check2, _check3, _check4 && true) then {
            hint "1";
        } else {
            
            hint "2";
        };

I want that "_check1, _check2, _check3, _check4" must be true

formal nacelle
stable dune
# limber thunder Can anyone tell me how to query different variables with one logical operator? ...

if (_check1 && {
    _check2 && {
    _check3 && {
    _check4}}}) then {
    // here your code if all true.    
};  

from wiki
Lazy Evaluation
In SQF the following code will evaluate every single condition, even if one fails:

if (a && b && c) then {};
//Even if a returns false (and thus the entire Boolean expression can no longer become true), b and c will still be executed and evaluated regardless.

To avoid this behaviour, one can either imbricate if statements or use lazy evaluation. The latter is done like so:

if (a && { b && { c } }) then {};
//In the example above, condition evaluation stops once any condition evaluates to false.

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

formal nacelle
#

@digital hollow also,where is script_component.hpp? missing that it seems, crashes without it

digital hollow
#

oops, just remove that line

formal nacelle
formal nacelle
burnt elbow
#

As an entirely amateur scripter, what is the best process for inputting default server loadouts into an ACE arsenal?

tulip ridge
#

Make the loadouts in eden and save them to the mission (default loadouts tab)

burnt elbow
#

Would they be tied to the arsenal if i subsequently saved it to an editor composition?

#

or would i have to repeat the process every time i put it into the mission?

fair drum
#

repeat

burnt elbow
#

womp

#

so yea, i would have to export the loadouts, and then script them into the editor object to make them available as server loadouts

#

whats the most expedient way to do that

#

I already have a script for accessing the ACE and BIS arsenals as a drop down menu

#

also im interested in being able to blacklist unneeded items from the arsenal to keep it from being overcrowded with a bunch of junk

opal zephyr
#

@burnt elbow The most effecient and scalable way would be to use the leverage the existing Ace Arsenal scrip framework. In this case, the ace_arsenal_fnc_addDefaultLoadout function

burnt elbow
#

awesome, i will see what i can get worked in, thank you

opal zephyr
#

It should also add the loadout to all arsenals by itself if you check the third parameter as true

#

I think in your case it will be as simple as:

["Name of Loadout", PASTE THE EXPORTED LOADOUT HERE, true] call ace_arsenal_fnc_addDefaultLoadout

and utilize that in a init script on the mission

#

(shitf+lmb on the export button will copy the loadout to your clipboard)

burnt elbow
#

does each loadout need a separate array?

#

the bane of my existance is trying to figure out what needs brackets.

tulip ridge
burnt elbow
#

sick. aight thanks gents, lets see how badly i can mess this up

tulip ridge
quartz blade
#

What's up guys, could someone help me? I'm trying to set up a trigger to play the "Halt" gesture when activated and when it stops, it should play an environment animation. I've tried doing it this way for the trigger:

 params[ "_unit", "_anim" ]; 
  
 if ( _anim == "Acts_PercMstpSlowWrflDnon_handup1b" ) then { 
  _unit playGesture "Acts_PercMstpSlowWrflDnon_handup1b"; 
 }; 
}]; man1 dowatch player;```
#

And this for the Deactivation:

 params[ "_unit", "_anim" ]; 
  
 if ( _anim == "Acts_PercMstpSlowWrflDnon_handup1b" ) then { 
  _unit playMove "HubStanding_idle2"; 
 }; 
}]; man1 dowatch player;```
#

It plays the animation but it doesn't stay in it

#

Do you have an idea on what is wrong?

fleet sand
#

Also i have a question is there a way for me to detect player created markers ?

fleet sand
quartz blade
#

I want the Halt Gesture stay until I exit the trigger area

#

And after I exit the area, it should play the hubStandingIdle animation

devout geode
#

Is there a way to make a arsenal with limited quanity of items?

ornate whale
spare vector
#

Does anyone know if its possible / how to add a cooldown to a custom ace self interact

_supplydrop = ["SUPPLY DROP","CALL SUPPLY DROP","\a3\ui_f\data\igui\cfg\simpletasks\types\Container_ca.paa",{execVM "scripts\supplydrop.sqf"},{true}] call ace_interact_menu_fnc_createAction;
[squadleader, 1, ["ACE_SelfActions"], _supplydrop] call ace_interact_menu_fnc_addActionToObject;
devout geode
opal zephyr
meager granite
#

Looks like EntityCreated is executed before variable namespace is copied for respawned unit, but only for remote units.

#
testunit setVariable ["testvar", 123];

... death and respawn ...

addMissionEventHandler ["EntityCreated", {
    diag_log ["111", (_this getVariable "testvar")];
    _this setVariable ["testvar", 321];
    diag_log ["222", (_this getVariable "testvar")];
    _this spawn {
        diag_log ["333", (_this getVariable "testvar")];
        sleep 0.1;
        diag_log ["444", (_this getVariable "testvar")];
    };
};
```produces log:

13:29:47 ["111",<null>]
13:29:47 ["222",321]
13:29:47 ["333",321]
13:29:47 ["444",123]

#

Same but with local unit (player):

13:35:15 ["111",123]
13:35:15 ["222",321]
13:35:15 ["333",321]
13:35:15 ["444",321]
gleaming forge
#

I am getting the following error on start and it is preventing the mission from generating, but I cannot find the root cause:

KPLIB_b_inf_classes             = KPLIB_b_infantry                  apply >
Error position: <KPLIB_b_infantry                  apply >
Error append: Undefined variable in expression: kplib_b_infantry```
#

This is what's in the script it's referencing

#
    Fetch arrays with only classnames from the blufor preset build arrays
    Beware that all classnames are converted to lowercase. Important for e.g. `in` checks, as it's case-sensitive.
*/
KPLIB_b_inf_classes             = KPLIB_b_infantry                  apply {toLowerANSI (_x select 0)};
KPLIB_b_light_classes           = KPLIB_b_vehLight                  apply {toLowerANSI (_x select 0)};
KPLIB_b_heavy_classes           = KPLIB_b_vehHeavy                  apply {toLowerANSI (_x select 0)};
KPLIB_b_air_classes             = KPLIB_b_vehAir                    apply {toLowerANSI (_x select 0)};
KPLIB_b_static_classes          = KPLIB_b_vehStatic                 apply {toLowerANSI (_x select 0)};
KPLIB_b_deco_classes            = KPLIB_b_objectsDeco               apply {toLowerANSI (_x select 0)};
KPLIB_b_support_classes         = KPLIB_b_vehSupport                apply {toLowerANSI (_x select 0)};
KPLIB_transport_classes         = KPLIB_transportConfigs            apply {toLowerANSI (_x select 0)};

KPLIB_b_inf_classes append (KPLIB_b_squadLight + KPLIB_b_squadInf + KPLIB_b_squadAT + KPLIB_b_squadAA + KPLIB_b_squadRecon + KPLIB_b_squadPara);
KPLIB_b_inf_classes             = KPLIB_b_inf_classes               apply {toLowerANSI _x};
KPLIB_b_inf_classes             = KPLIB_b_inf_classes               arrayIntersect KPLIB_b_inf_classes;```
#

This is the array's I have set in the custom.sqf for the classes

#

Any help would be muchly appreciated

thorny gull
#

is anyone availible to help me with a bit of scripting, I have been at this for an hour and I cannot get this line to work

south swan
#

don't ask to ask, just state your question, please blobdoggoshruggoogly

south swan
south swan
gleaming forge
#

@trim sonnet ^

keen stream
queen cargo
#

thats no locality issue ..

#

thats two buildings in one

meager granite
#

@still forum Should I make a ticket about EntityCreated var space issue on remote entities?

still forum
#

No won't fix.
But we should note it on wiki

meager granite
#

Done

keen stream
#

Super Secure!

#

This would be a cool building to have with a joint-op. Endless doors and randomly new closed doors causing you to get stuck forever.

#

whuahahaha!

tiny rampart
#

How expensive is an value in array operation in sqf? O(n)?

meager granite
pulsar bluff
#

strange

meager granite
meager granite
#

But yeah its O(n)

#

key in hashmap is pretty much O(1), I think

tiny rampart
#

Ye, makes sense

meager granite
little raptor
#

ah yeah that's not really fixable as Dedmen said

meager granite
#

Strange why it isn't

meager granite
#

@little raptor Did you have a chance to look at shooter client side HandleDamage fires? Would be a great improvement to fix this mess, even if its been there for 10 years.

little raptor
#

nope didn't get a chance

kindred zephyr
#

is there a way to modify how incapacitated status return someone to life?

I know the function lets you revive in "multiple" states, but is there a way to code the revival only (meaning as only removes the "invisibility" and allows you to move again)

tulip ridge
#

time will never be greater than serverTime correct? (in the case of a client connected to a server)
Was writing some code and then remembered that serverTime is 0 in SP, so I was going to do like _currentTime = time max serverTime, so that it'll work in SP and MP, as well as be synced correctly in MP

still forum
#

Extensions are usually chatted in #arma3_tools
Can't give any time estimate. Is your Extension open source?

opal zephyr
# quartz blade Anyone?

Perhaps animdone doesnt trigger for gestures. Since its the same gesture all the time, you could just use a sleep and then play it again. But I don't know if your desired affect of them holding their hand up forever will work, every loop it might just lower it and then raise it again

quartz blade
#

So there is no way to make it hold right?

opal zephyr
#

I don't know, I havnt tested it. Try playing the gesture and then playing it again halfway through, and see if it holds or if it resets

opal zephyr
#

just use the code editor in the esc menu

still forum
#

I don't know your side, don't know how long it takes

#

sounds right

formal nacelle
limber thunder
#
playSound3D [getMissionPath "sounds\Ping_2.ogg", radio1, false, nil, 5, 1, 0, 0, false];

Can someone tell me why I get an error message with: "0 elements provided 3 expected"? I have 3 elements in the sound folder but I don't know why it can't run.

south swan
#

try [0,0,0] for position instead of nil blobdoggoshruggoogly

limber thunder
#

Okay, now the error message is gone, but I don't hear anything. Do you know if I need to define the sound in the descirption.ext?

south swan
#

tanking let me actually read the doc

#

ah

soundSource: Object - the object emitting the sound. If soundPosition below is specified this parameter is ignored
...
soundPosition: Array format PositionASL - (Optional, default [0,0,0]) position for sound emitter, overrides soundSource

If a following parameter has to be used, simply use getPosASL _soundSource for soundPosition instead of _soundSource for soundSource.

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

fair drum
#

I believe Lou told me a while ago that only functions can be passed nil and that when engine commands say default or optional on the wiki it doesn't mean you can just put nil

split scarab
#

How can I delete all 'Smoke Modules' within a Trigger area?
Or even list all objects within the Trigger area

opal zephyr
split scarab
#

Hmm no, doesn't list the objects in chat for some reason

opal zephyr
#

Multiple things wrong there

#

Im on mobile rn so I cant format it correctly. But look at the wiki page for inAreaArray and remoteExec

#

InAreaArray requires you to give it a trigger to be checked

split scarab
#

Ah I see

#

Will do thanks

#

I can use 'thisTrigger' right?

quartz blade
opal zephyr
opal zephyr
split scarab
opal zephyr
#

Havnt used triggers in awhile

quartz blade
split scarab
# opal zephyr Sorry, ya thats fine

Ah think I know the issue, Smoke Modules aren't an object so they aren't listed in allObjects.. but I can't find another array like that, that will have the modules inside

opal zephyr
#

Hm

split scarab
#

The idea is basically when a unit gets within the trigger it deletes the smoke module within the trigger

#

But I was having trouble figuring out what the name or class name of the smoke module was so I wanted to list everything so I could find it

opal zephyr
#

Are you placing the smoke module in 3den?

split scarab
#

Yeah

#

Was hoping to avoid giving a variable name to all the smoke modules where I want to do this

opal zephyr
#

Ok so inAreaArray should be working

#

Game Logic is considered an object

split scarab
#

Just closed the game but this was basically what I had

_objects = allObjects inAreaArray thisTrigger;
{ 
   hint _x
} forEach _objects;
#

if I changed allObjects to allUnits then it worked and printed my name

opal zephyr
#

allObjects doesnt work like that

#

Check the wiki page, it needs a number before and after it defining what type of objects

#

You could also try using entities

ornate whale
#

Do you have any tips how to make missions more randomized, like changing unit placement, dynamic unit spawning, changing building layouts, etc.? I am trying to figure out the best approach of doing these things to make my mission more dynamic and re-playable.