#arma3_scripting

1 messages Β· Page 120 of 1

meager granite
#

you're doing something wrong then

steady minnow
#

I am creating an anomaly module at the player's position, from Diwako's STALKER-like anomalies mod.There are function calls in the description to create various anomalies.But I need my own script.I created an anomaly using my script, but it is not deleted in the usual way.As I understand it, everything is tied to functions, which is probably why the usual way of deleting modules does not work.

#
[_pos] call anomaly_fnc_createMeatgrinder; //Meatgrinder
[_pos] call anomaly_fnc_createElectra; // Electra
[_pos] call anomaly_fnc_createSpringboard; //Springboard
[_pos] call anomaly_fnc_createBurner; //Burner
[_pos] call anomaly_fnc_createFruitPunch; //Fruit Punch
[_pos, _id] call anomaly_fnc_createTeleport //Teleport, _id is used to link teleports with matching _id's
[_position(pos ATL!), _radius(number), _isRectangle(Boolean)] call anomaly_fnc_createFog // create fog anomaly
[[[_pos, _radiusA, _radusB, _andlge, _isRectangle]],_howManySpringboards,_howManyElectras,_howManyBurners,_howManyMeatGrΓ­nders] call anomaly_fnc_createAnomalyField // create anomaly field with randomly placed anomalies

It's in the description of the mod

meager granite
#

Likely module itself creates\spawns more things, you'll need to look into module code to figure it out

proven charm
steady minnow
#

Thanks everyone.I solved everything with the help of functions."And the Casket just opened."

tiny wadi
#
waitUntil {time > 0};
_EHDisconnect = addMissionEventHandler ["HandleDisconnect",{diag_log "test"}];```
#

Any idea why this isnt being fired?

proven charm
#

how often is the KnowsAboutChanged event supposed to be called? I had some code in eachFrame that I moved to KnowsAboutChanged but it doesn't seem to trigger too often

novel basin
#

Good morning

I'm currently making a script and I need to update the angle of an image based on the user's mouse position.

For the moment, I have searched and combined getMousePosition, ctrlSetAngle and a while but nothing conclusive...

The goal would be for the image to change angle depending on the user's mouse rotation.

Thanks in advance πŸ˜‰

novel basin
#

ah okay thks
"rotation" mean that i want update angle of my picture when mouse moving depending on X and Y axis

proven charm
#

ok, you can count the mouse movement using that event by saving the current position and then subtracting the new position from that

novel basin
#

Yeah i tried this but no work 😦

proven charm
novel basin
#

its not follow correctly the mouse

#

i tried with ctrlSetAngle to modify angle

maiden warren
#

This is what I had in mind when I was talking about animating paa's. The 'AnimatePAA' that was linked here is too complicated imho. This function is only about 30 lines of code. It's only a matter of converting gifs or videos to paa frames. Works on anything I've tested so far and works as intented ^^.

https://streamable.com/jop2l3

warm hedge
novel basin
warm hedge
#

In this case, your mouse is located somewhere in top-right?

#

Or just move mouse left/right to rotate left/right?

novel basin
novel basin
warm hedge
#

I meant, your mouse supposed to be in top-right if the lockpick is facing there?

novel basin
#

yes

maiden warren
#

@novel basin maybe KK's blog can help you?

warm hedge
#

I can recommend to use getDir command even though it is not really meant to be used in this way, but like, basicallysqf [0.5,0.5] getDir getMousePosition

#

[0.5,0.5] is the center of the screen, aka your axis of the lockpick

novel basin
#

so it will update the dir of the picture like the dir of the mouse ?

novel basin
warm hedge
#

If that's what you mean, tho

novel basin
#

ok now its almost work

On the screen, the cursor are at the opposite of the picture X)

warm hedge
#

Just +180

novel basin
#

amazing, thks !

#

πŸ’ͺ

fair drum
sullen sigil
#

i would have something like that as a mod rather than contain it all in mission file tbh

fair drum
#

Yeah cause sending that for a mission download would suuuuuck lol

#

It does look pretty tho

hallow mortar
restive sonnet
#

hey. I know it is wrong channel but I dont know where to ask. I dont get stable 60 fps even if I go 1080p. I can play with 4k and still get 45 fps +-. What is causing this?

hallow mortar
#

You want #arma3_troubleshooting .
There are a lot of things in Arma that can drain frame rate. Graphically, view distance is a big one. Other killers are the complexity of the local environment (e.g. dense urban), or having large numbers of AI or scripts running.

sullen sigil
#

(and bad mods)

maiden warren
#

Having couple of smaller ones doesn't really affect the size that much. Average folder with the anims are like 5mb. The suv is about 30mb but it's a huge texture as is..

maiden warren
sullen sigil
#

yes i would recommend against reading more than 5 images from the mission file tbh

maiden warren
#

I agree. This was done purely for testing purposes though.

tender fossil
#

Is there any de facto standard solution for offloading AIs to headless client? Its license should allow republishing the scripts as part of another gamemode/mission. I'm using Werthles' mod/script right now but seeing that it's been updated a while ago, not sure whether it's the most appropriate tool nowadays (+ the licensing stuff)

#

Mostly for handling the possible corner cases that seem to be plenty (or used to be at least)

fair drum
little raptor
#

lots of things meowsweats

fair drum
#

Sorry, waking up a day late to open presents.

knotty gyro
#

So this is where I ask script related questions?

knotty gyro
#

Ok great. so....
I'm trying to pass an addAction to a scripted object, but since setVehicleInit was taken out of A3 I'm stumped as how to go about it. This is my latest attempt, which generates no errors, but doesn't add the action... Maybe some pointers in the right direction?

_pos = getpos (_this select 0);
deleteVehicle (_this select 0);
sleep 0.2;

private _d = "B_Slingload_01_repair_F" createVehicle _pos;
private _scr = "this addAction ['<t color='#FF0000'>Deploy container</t>','s\deployContainer.sqf'];";

[[_d,_scr]] remoteExec ["setVehicleInit"];

hint "Container packed up";

It's been more than 10 years since I scripted last, so bear with me πŸ™‚

#

Im calling the script with:```sqf
this addAction ["<t color='#FF0000'>Pack up container</t>","s\undeployContainer.sqf"];

#

from the object init in the editor

fair drum
#

If no one gets back to you by the time I'm out of work I'll help.

knotty gyro
#

thanks! Appreciated

dreamy kestrel
sullen sigil
sullen sigil
grizzled cliff
#

actually i guess those are right! :P

abstract bay
#

Description.ext: ```class CfgFunctions
{
class Spawn
{

    class Nato

    {
        class variableNatopreInit{file = "natospawn.sqf"; preInit = 1;};

        };

    class Csat

    {
        class variableCsatpreInit{file = "csatspawn.sqf"; preInit = 1;};

        };

    }

}

};natospawn.sqf 0 spawn {

--1--

    sleep 5;          

_grp1 = "B_T_APC_Wheeled_01_atgm_lxWS" createVehicle getMarkerPos "spawnvehicles";
createVehicleCrew _grp1;
{
_x setSkill ["general", 0.6];
_x setObjectTexture ["clan", "\a3\missions_f_epa\data\img\orbat\b_111_texture_ca.paa"];
}
foreach units _grp1;
_grp1 setGroupId ["Armored Lions 102th"];
_grp1 setObjectTexture ["clan", "\a3\missions_f_epa\data\img\orbat\b_111_texture_ca.paa"];
addMissionEventHandler ["Loaded", {_grp1 setObjectTexture ["clan", "\a3\missions_f_epa\data\img\orbat\b_111_texture_ca.paa"]}];
[
_grp1,
["Olive",1],
["showBags",1,"showCamonetHull",0,"showCamonetTurret",0,"showSLATHull",1,"showSLATTurret",1]
] call BIS_fnc_initVehicle;

};```

#

I hope this is clearer now. If you need additional information, feel free to ask

hallow mortar
#

You've put the part that adds the Loaded EH after a sleep 5. This means that although the function starts during pre-init, everything in it is delayed until 5 seconds after mission start.
To actually add the event handler during the pre-init phase, you need to do it before any suspension.

fair drum
# knotty gyro Ok great. so.... I'm trying to pass an addAction to a scripted object, but since...

You don't have to use setVehicleInit at all. You use the parameters that addAction gives you to feed them to your function (make a function for this, not a script file), for example:

/*
    MrB_fnc_containerDeployment
*/

params [
    ["_vehicle", objNull, [objNull]],
    ["_state", "pack", [""]]
];

switch _state do {

    case "pack": {
        _vehicle addAction [
            "<t color='#FF0000'>Pack Up Container</t>",
            {
                params ["_vehicle"];
                private _vehiclePos = getPosATL _vehicle;
                deleteVehicle _vehicle;

                private _newVeh = "B_Slingload_01_repair_F" createVehicle _vehiclePos;
                [_newVeh, "unpack"] remoteExec ["MrB_fnc_containerDeployment"];
            },
            nil, 1.5, true, true, "", "true", 5, false
        ];
    };

    case "unpack": {
        _vehicle addAction [
            "<t color='#FF0000'>Unpack Container</t>",
            {
                params ["_vehicle"];
                private _vehiclePos = getPosATL _vehicle;
                deleteVehicle _vehicle;

                private _newVeh = "SomeContainerClassHere" createVehicle _vehiclePos;
                [_newVeh, "pack"] remoteExec ["MrB_fnc_containerDeployment"];
            },
            nil, 1.5, true, true, "", "true", 5, false
        ];
    };
};

note "SomeContainerClassHere" needs to be changed to what you want.

to start put in init:

if (isServer) then { [this, "pack"] call MrB_fnc_containerDeployment };

Load your function into the game by using the function library:
https://community.bistudio.com/wiki/Arma_3:_Functions_Library

So that it exists on all machines.

knotty gyro
#

Need to test it tomorrow though, very late here

round scroll
#

maybe ` ["scriptname"] remoteExec ["execVM"];

spark turret
#

hello, i have a mod that i published on steam, and i signed it with some bohemia tool (dont quite remember the process).
there is a .bisign file in my repo thats also included in the published mod as far as i can tell.
People on steam are asking for a .bikey, is that a different thing?
am kinda lost because i havent hosted dedicated in years
(also there is no pure mods channel so i use this one πŸ™‚ )

#

nevermind, i have the bikey from the signing process but never published it.

little raptor
#

Google "asymmetric encryption"

spark turret
#

yeah just found a post explaining it, thx

#

just copy/pasted the public key into the mod folder and published as update πŸ‘
Hope that works, to lazy to test

cosmic lichen
#

Anyone knows a way to enable dynamic simulation for mines?

#

Checking the checkbox in editor has no effect and using enableDynamicSimulationon a mine created with createMine doesn't work as well

cosmic lichen
#

Yeah, but that's static, not dynamic

proven charm
#

sorry? it worked for mines in my mission

cosmic lichen
#

How did you do it?

proven charm
#

_mine enableSimulationGlobal false;

cosmic lichen
#

Yes, that works. But that's still static. I wanna use Dynamic Simulation to activate them on AI/player presence

proven charm
#

ok

#

i use trigger to activate the mines when enemy is near them

cosmic lichen
#

Yeah, that would work. But I use no triggers

#

I wonder if mines were not implemented for dynamic simulation.

fair drum
cobalt path
#

any idea why this might not be working? I placed it into initplayerlocal

while {true} do 
{
    if (Alive Player) then 
    {
        profileNamespace setVariable ["ptlme_loadout_01", (getUnitLoadout player)];
        saveProfileNamespace;
    };
    Sleep 60;
};
#

as in

[]spawn
{
    Sleep 5;
    _playerLoadout = profileNamespace getVariable ["ptlme_loadout_01", []];
    player setUnitLoadout _playerLoadout;
};

does not apply the loadout, so I assume it doesnt save properly into the variable

#

Okay so when I was in the mission I executed just

profileNamespace setVariable ["ptlme_loadout_01", (getUnitLoadout player)];
saveProfileNamespace;

than

_playerLoadout = profileNamespace getVariable ["ptlme_loadout_01", []];
player setUnitLoadout _playerLoadout;

and it worked
But once I restarted the mission and went back in, it didnt load anymore. As in now I know that "ptlme_loadout_01" should be diver loadout, but it doesnt seem apply it after 5 seconds

sullen sigil
#

chsnge while true to while alive player

#

and get rid of the if

#

iirc player must be lowercase but thats only going off some sqf linters

cobalt path
#

okay one moment

#

ohhh okay

#

After 5 seconds it reapplies the same loadout I currently have

warm hedge
#

SQF commands are case insensitive

cobalt path
#

I know how to fix that one issue, one moment

sullen sigil
cobalt path
#

does anyone know when does command from the initplayerlocal execute? is it when you join the server, or when you respawn etc?

sullen sigil
#

ill try later

sullen sigil
#

but it only runs once when you join the server

cobalt path
#

nono I understand the onrespawn sqf thingy cuz it executes as you respawn, but what about initplayerlocal

cobalt path
#

okay, I think the issue might be that it saves the loadout that the "playable" characters have, and than just reapplies it after player respawns. Essentially keeping their "default" outfit

#

I am testing, did some changes and it works, but I will stay in respawn screen for longer to see if that is actually the case

sullen sigil
#

put systemChat str _playerLoadout in the respawn handler and see

cobalt path
#

yup it definitely does save default loadout if you stay in respawn screen too long

#

cant I just put the save script in respawn sqf?

#

No, than it will keep stacking everytime player dies

harsh sedge
#

Is the save block just that while loop in the init file?

cobalt path
#

ye

#

it executes too early

#

I need to run a check to only execute it once player respawns and do it only ones. And now that I think of it, if player dies, and goes back to respawn menu, it might set default loadout again, or maybe not if they take too long

harsh sedge
#

If the auto-save is supposed to run throughout the mission, why not spawn the loop so initPlayerLocal can finish?

#

I don't know if that leads to unexpected behavior, but that would allow that init file to finish.

cobalt path
#

Its already looped, every 60s. I am thinking this. I will put respawn event handler, but how do I run a check to see if the script is already running, so it executes on respawn, but doesnt execute again and again every time player respawns in the same mission.

harsh sedge
#

You could insert a flag in the uinamespace.

sullen sigil
cobalt path
sullen sigil
#

check if alive player is true in respawn screen then

harsh sedge
#

What I tried to implement in my loadout solutions is setting the save on an inventoryclosed EH and a reloaded EH.

#

Two moments where a loadout is most likely to change

#

I'm still trying to figure out how to handle for things likeACE that allow you to do things outside the inventory screen

cobalt path
#

Actually easier solution, is there a way to force respawn? So I would force a player to essentially spawn before the script gets executed

cobalt path
harsh sedge
#

I think there is a setting that does that in Description.ext

little raptor
cosmic lichen
#

Perhaps, idk

little raptor
#

but afaik dynamic simulation works on "dynamic" (fast) objects

#

ok nvm the code checks for a base type that mines don't inherit from, so yeah it won't work on mines

cosmic lichen
#

Good to know as mines have the dynamic simulation attribute πŸ˜„

steady minnow
#

Hello everyone.Tell me, who understands how you can set the direction of flight of an object so that when you press the button, the object flies in the direction where the player is looking? Using the command :

OBJ setVelocity [20,0, 2];
proven charm
#
_dir = getDir player;
_speed = 200; 
OBJ setVelocity [_speed * (sin _dir), _speed * (cos _dir), 0];
``` @steady minnow - that I think πŸ˜„
little raptor
#
obj setVelocity (getCameraViewDirection player vectorMultiply 20)
little raptor
proven charm
#

Leos solution gets z too which maybe wanted?

steady minnow
#

Thank you, you are the best, it works

sullen sigil
#

alternatively modelspace commands also exist

little raptor
#

in this case world space makes more sense

sullen sigil
#

ya as i assume they want to be able to have a jump upwards or something

knotty gyro
# fair drum You don't have to use `setVehicleInit` at all. You use the parameters that `addA...

So this is what I get:
19:21:45 Error context ["_vehicle", objNull, [objNull]],["_state", "pack", [""]]];
19:21:45 Warning Message: File C:\Users\xxxxx\Documents\Arma 3 - Other Profiles\xxxxx\missions\Tanoa_assault_1.Tanoa\description.ext, line 21: '/CfgFunctions.params': '[' encountered instead of '='
19:21:45 Warning Message: Config : some input after EndOfFile.
19:21:45 Error context isServer) then { [this, "pack"] call MrB_fnc_containerDeployment };
19:21:45 Warning Message: File C:\Users\xxxxx\Documents\Arma 3 - Other Profiles\xxxxx\missions\Tanoa_assault_1.Tanoa\mission.sqm, line 0: '.if': '(' encountered instead of '='
19:21:45 Warning Message: Config : some input after EndOfFile.
19:21:45 Class destroyed with lock count 1

hallow mortar
#

Did you put the function code directly into description.ext?
(because that would be wrong)

#

What you need to put into description.ext CfgFunctions is a config structure, that tells the game which .sqf file to look in to find the function code.

storm crystal
#

I don't really know where to ask this but would anyone know how to make that it choose a random number between 1 & 5 so that it shows a different image?

#
class CfgPatches 
{
    class aftrmth_loading_screen
    {
        units[]={};
        weapons[]={};
        requiredVersion = 0.1;
        requiredAddons[] = {"A3_Characters_F", "A3_Weapons_F", "A3_Data_F", "A3_Anims_F", "A3_UI_F"};
    };
};

class RscStandardDisplay;
class RscPicture;
class RscButton;
class RscDisplayConfigure 
{
    enableDisplay=1;
};

class RscDisplayMain : RscStandardDisplay 
{
    idd = 0;
    idc = 1;
    enableDisplay = 1;
    
    class controlsBackground 
    {
        class LoadingPic : RscPicture 
        {
            idc = 1;
            x = SafeZoneX;
            y = SafeZoneY;
            h = SafeZoneH;
            w = SafeZoneW;
            text = "aftrmth_loading_screen\images\desk"+str(floor(random 5))+".paa";
        };
    };

    class RscActiveText;
    class RscActivePicture : RscActiveText
    {
        style = 48;
        color[] = {0,0,0,0};
        colorActive[] = {0,0,0,0};
    };
    ```
#
    class Spotlight {};
    
    class controls {
        class Spotlight1 {};
        class Spotlight2 {};
        class Spotlight3 {};
        class BackgroundSpotlightRight {};
        class BackgroundSpotlightLeft {};
        class BackgroundSpotlight {};
        class B_Credits {};    
        
        class ConnectServer : RscButton 
        {
            idc = -1;
            text = "                                                                        Connect to Fallout:NV RP";
            style = 3;
            onbuttonclick = "connectToServer ['*/IP/*', /*PORT*/, '852']";
            soundEnter[]={"",0.30000001,1};
            soundPush[]={"",0.69999999,1};
            colorBackground[] = {1.08,0.21,0.2,1};
            colorText[] = {0,0,0,1};
            font = "PuristaMedium";
            colorBackgroundActive[] = {1.08,0.21,0.2,0.4};
            x = "0.4 * safezoneW + safezoneX";
            y = "0.2 * safezoneH + safezoneY";
            w = "0.20625 * safezoneW";
            h = "0.033 * safezoneH";
        };
    };

    class controlsBackground 
    {
        class LoadingPic : RscPicture 
        {
            idc = 1;
            x = SafeZoneX;
            y = SafeZoneY;
            h = SafeZoneH;
            w = SafeZoneW;
            text = "aftrmth_loading_screen\images\desk"+str(floor(random 5))+".paa";
        };
    };
};
granite sky
#

I'm not sure that's possible directly in text.

little raptor
granite sky
#

You'd need an onLoad script or similar.

#

Also watch out with floor(random 5). It may very occasionally roll 5 rather than 0-4.

storm crystal
#

what would work the best for real random?

granite sky
#

You can cap it with min for safety.

#

or use selectRandom [0,1,2,3,4] :P

storm crystal
#

ooh ty!

fair drum
tender fossil
#

Also speaking of CfgFunctions, I should finally fix some of the horror/hacky code I managed to write in the CfgFunctions generator VSC extension, plus noticed some bugs too

dreamy kestrel
#

Q: about compileFinal as it relates to HASHMAP and setVariable... I tried setting a missionNamespace variable with such a compileFinal value, and got the following log, but I'm not sure I understand what it means.

17:49:54 Attempt to override final function - my_arsenal_configitems

Meaning what, exactly, and is there anything I should do to remediate the attempt. i.e. attempted and what, success? Go pound sand? Not really clear what the outlook, disposition, etc, is, toward the outcome.

dreamy kestrel
# tender sable Can you post your test code?

I think I see what's going on.

  1. uiNamespace in which I am setting the var is rather sticky between sessions, correct? that is, state is sustained between missions starting.
  2. yeah, echoing the responses, I see that it failed. but the message is ambiguous, IMO.
little raptor
#

the message is ambiguous,
you can't override final functions. period.
the message is there to tell you that someone is doing something illegal

dreamy kestrel
#

of course, I understand it is illegal to do so. but I did not see the yellow warning lights that accompanied the message. or even a hint of whether it should be considered success or failure. anywho.. I understand, thanks...

dreamy kestrel
#

Q: HASHMAPS, insert, I think there be typos in the docs, can anyone confirm?
the form says along the lines hashMap insert [splitArray, [keysAndValues]] i.e. true, [[key1, key2, ...], [value1, value2, ...]]

_map insert [true, [_keys, _values]];

however, my log is claiming something a bit different:

_throwList insert [true, [_muzzleMagConfigNames, []>
20:52:46   Error position: <insert [true, [_muzzleMagConfigNames, []>
20:52:46   Error 2 elements provided, 3 expected

which suggests it should be closer to:

_map insert [true, _keys, _values];

yes, no, maybe?

warm hedge
#

Syntax 4 right?

#

What are _map, _keys, _values?

dreamy kestrel
#

_map is a HASHMAP, _keys are an array of STRING, and _values as indicated, [], the intent of which is for values to be nil throughout.

hallow mortar
#

Make sure _map is actually a hashmap and not a normal array. If it is an array then the game could be trying to use syntax 1

dreamy kestrel
#

it is.

warm hedge
#

Can we check your entire code?

dreamy kestrel
#

_map insert [true, _keys, []] seems to work. it is a typo in the docs. note, should NOT repeat NOT be:

_map insert [true, [_keys, []]];
//                 ^         ^
#

drop the outer keys values brackets.

hallow mortar
#

I'm dubious of whether assigning nil values to the keys is of any use as a test, because trying to retrieve a value will return nil if it was successfully set and if it failed and there's no key with that name.

dreamy kestrel
#

or check it if you like, minimum cases:

_map = createhashmap;
_map insert [true, [1, 2, 3], []];
keys _map; // [1, 2, 3]

contrasted with:

_map = createhashmap;
_map insert [true, [[1, 2, 3], []]]; // error, verify RPT

I also have it on somewhat good authority that the stated objectives, nil for values, does indeed work as expected.
https://github.com/acemod/ACE3/blob/master/addons/arsenal/functions/fnc_scanConfig.sqf#L148

GitHub

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

warm hedge
#

Hmm, I'll check later or, are you available to check rn @winter rose

dreamy kestrel
#

no rush here, I have a sense how to proceed with it. thought you should know, squaring the trapezoid corners with the docs. 🍻

winter rose
tender sable
warm hedge
sullen sigil
#

they outlawed sleeping in france in 1875

winter rose
#

πŸ›οΈ .zZ .zZ .zZ

sullen sigil
#

incroyable!

obtuse palm
#

Does anyone know how to script for a rp server on Arma?

obtuse palm
#

In case I am not available

meager granite
ruby bronze
#

isTouchingGround player && player in thisList as a trigger condition works in editor preview but not on dedicated server. Anyone know what to do about it?

obtuse palm
#

Do Arma rp servers cost money or any server that requires hosting?

obtuse palm
#

Can someone pls dm me

meager granite
#

Dedicated servers controls no unit, thus player return null

#

so your condition is never true

#

Also isTouchingGround is very unreliable for remote entities, so you can't reliably check that from dedi side either

ruby bronze
#

Damn, what do you recommend as an alternative?

meager granite
#

I don't use triggers to tell you how it can be setup better

#

Since you're checking for player, you can send some kind of notification to server once trigger activates

#

On Activation:

[[player, thisTrigger], {
    params ["_player", "_trigger"];
    diag_log format ["Player %1 just activated the trigger %2", _player, _trigger];
}] remoteExecCall ["call", 2];
#

This will send arguments with your player and trigger object and code to execute to server

#

But its far from ideal because you're sending entire function each time you activate the trigger to server, its better have functions ready beforehand and just call them

#

init.sqf:

myCoolTriggerActivationFunction = {
    params ["_player", "_trigger"];
    diag_log format ["Player %1 just activated the trigger %2", _player, _trigger];
};

On Activation:

[player, thisTrigger] remoteExecCall ["myCoolTriggerActivationFunction", 2];
#

You can have another function in the similar manner for deactivation

#

And run same code in several triggers with trigger passed into function as argument so you can check which one was triggered on dedicated server exactly

#

Hope this made sense

ruby bronze
#

It does, thank you! I'll give it a try

lone glade
#

use BIS_fnc_call

proven charm
#

interesting that when KnowsAboutChanged triggers the unit/group may not have any targets ```sqf
// Placed on unit
(group this) addEventHandler ["KnowsAboutChanged",
{
params ["_group", "_targetUnit", "_newKnowsAbout", "_oldKnowsAbout"];

private _unit = (units _group) # 0;

private _targets1 = (_unit nearTargets 1000000) select { (_x # 2) != (side _group) };

private _targets2 = (_unit targets [true, 1000000]) select { (side _x) != (side _group) };

systemchat format ["knows changed %1 %2", count _targets1, count _targets2]; // Prints zeros

}];

proven charm
#

would need EH that triggers on new targets

sullen sigil
#

you can just do a targets check its not too expensive

#

or monitor targets for new ones

proven charm
hallow mortar
#

You can do it in the EH. Save the value from the previous firing and compare it (or just count it). No loop needed.

proven charm
sullen sigil
#

value = nil

#

easy

#

and dont avoid loops

#

people only avoid loops if they code badly

proven charm
#

or have... long loops πŸ™‚

hallow mortar
#

"no targets" is just one of the things you would check for

proven charm
hallow mortar
#

So where does the loop come in then?

proven charm
#

now I would like to optimize

hallow mortar
#

Okay, see, I was confused by the connection you made between "do a target check" and "want to avoid loops"

proven charm
#

ah ok , np

sullen sigil
hallow mortar
#

Just start the EH with a check that counts targets or compares current targets to the saved value from last time. If it's 0 or no new targets were added, exitWith

proven charm
sullen sigil
#

a looping targets check isnt expensive hmmyes

proven charm
#

now I have EachFrame EH that does the thing

limber panther
#

Hello folks, just a quick question please. When i open atributes of any object in editor, i can enter X, Y and Z coordinates and therefore set the location of that object. Let's say i would like to do that by a script and be able to enter the very same numbers to the script just like i would do it in atributes in order to reach the exactly same location. Especially the correct height. My question is, are those coordinates in atributes in ATL, ASL, ASLW or AGL? I guess it's ATL but i'm not sure. Thanks

proven charm
#

ATL

limber panther
proven charm
#

yep

limber panther
sullen sigil
#

whats the size limit on hashmaps

#

i forget

little raptor
#

there is no limit

granite sky
#

hmm. They didn't inherit the array-size limitation?

sharp valve
#

Hey, how don i call a function and skip a few optional parameter?
[UNIT, ROPE_LENGTH, ANCHOR_POSITION, RAPPEL_DIRECTION] spawn AUR_Rappel_Unit;
I only want to provide UNIT and RAPPE_DIRECTION, and yes ROPE_LENGTH, ANCHOR_POSITION, RAPPEL_DIRECTION are optionals

#

To my understanding doing [UNIT, vectorDir UNIT] would not work?

granite sky
#

Correct, because it'd interpret vectorDir UNIT as the rope length.

#

you need to do [UNIT, nil, nil, vectorDir UNIT]

sullen sigil
#

time to use a hashmap as a database πŸ‘½

fair drum
#

Like to move an object around the editor using a script

cold mica
#

Is there a way to get unit loadouts of playable units in an MP environment?
In other words, I have a bunch of playable units and most of them will not be filled. However, I want to automatically get ALL of their loadouts into a list.

This is what I have tried:

private _playersLoadouts = [];
{
    // Collect all units loadouts into a single list
    _playersLoadouts pushBack (getUnitLoadout _x);
}forEach (playableUnits + switchableUnits);

While this works in SP when all playableUnits exist, it doesnt work in MP unless players select those units. Is there a way to collect loadouts on playableUnits that aren't selected by players at mission init?

opal zephyr
#

Units that arent selected and arent set to be filled with ai are not spawned and therefore do not exist. So they can't be referenced

cold mica
#

Is there a workaround for this? I'd like to collect the units' loadouts automatically to add them to the arsenal later. I can't do that if the units do not exist.

opal zephyr
#

Are you defining the units loadout in the editor?

cold mica
#

Yes I am

opal zephyr
#

Would it be too much to just copy those loadouts manually and then load them later?

cold mica
#

I have that written out and it works exactly as you described. I just want to see if there is a workaround that automates this.

opal zephyr
#

You might be able to have it get the units loadouts in the editor, but I am not familiar with how that would work

cold mica
#

I was thinking of that, I could write something that runs in the editor. However, I do not know how to save data so that it appears in a dedicated MP server.

opal zephyr
#

You could maybe attach it to an object or to the missionnamespace

cold mica
#

Maybe, but it might not persist if I export the mission file.

opal zephyr
#

You're right, it might not unfortunately :(

#

You could have ai set to fill those characters and have script delete them or something after you pull their uniform data maybe

dreamy kestrel
#

Q: about unit animations, "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon" is the "surrendering" animation? hands behind head? if so, not sure I understand that from the description "Puts hands behind his head and back". thanks...

opal zephyr
#

You can check which animation it is using switchMove or similar commands on a unit

#

Or find it in the animation viewer

dreamy kestrel
#

animation viewer? thanks I'll check it out...

opal zephyr
#

Ya its built into arma, it should be under the tools tab in editor

keen rain
#

Genuine question:
I've seen a lot of usage of .sqf via the eden editor but can it be done outside of it? (For example in a Zeus mission or while playing?)

abstract bay
fair drum
frigid smelt
#

I have my CfgFunctions defined as such:

class CfgFunctions
{
    class UL 
    {
        tag = "UL";
        
        class Spawning
        {
            file = "Core\Modules\Spawning";

            class createSpawnDialog {};
            class spawnPlayer {};
        };
    };
};

But when I start my server, I'm getting this message spammed and the server appears to repeatedly re-initalize the mission.
Warning Message: Script Core\Modules\Spawning\fn_createSpawnDialog.sqf not found
Warning Message: Script Core\Modules\Spawning\fn_spawnPlayer.sqf not found

Seems like its not using the tag for some reason.

grizzled cliff
#

omg i thought i was going crazy... ok pro pro tip for sqf memory searchers, look for sqf functions with only ONE function type :P

frigid smelt
#

Oh the function files have to start with fn_ for some dumb reason.So janky lol

grizzled cliff
#

i was searching for random in the dev branch, and they added the new form of random

frank fiber
#

any idea how to set like an area as a trigger for ace arsenal? like being able to walk into a room and scroll wheel to open the arsenal? (not sure if to post here or misson makers)

#

like how would I remove this

player addAction
["<img size='1.3' image='\a3\ui_f\data\IGUI\Cfg\Actions\reammo_ca'/> <t color='#FF4821' size='1.25'>Arsenal</t>",
{[_this select 0, player, true] call ace_arsenal_fnc_openBox},nil,2,true,true,"","true",10,false,"",""];

fair drum
#

oh it looks you already have that

#
// Activation
private _handle = player addaction [/*stuff*/];
player setVariable ["arsenal_open_handle", _handle];

// Deactivation
private _handle = player getVariable ["arsenal_open_handle", -1];
player removeAction _handle;
frank fiber
fair drum
jade imp
#

We figured it out, thank you πŸ™

hardy valve
#

Hello I am having an issue with a modded mission on a server. In singleplayer instance, the mission does not begin until the mods have loaded. But when placed on server, loading screen dissapears then the screen is black whilst the mods load. I suspect "BIS_fnc_activateAddons" may be related. It says it only initializes on mission start. I've set the mission to only start when a player has joined, and sure enough the first player joining doesnt get this black screen. It does this in SP, one screen ends and another appears, and when its complete the mission is started. But on MP you spend the exact same amount in the black screen instead of a second loading screen.

My question, is it possible to use a script to extend players loading screen until this process is completed for them locally once the addons have initialized..

fair drum
hardy valve
#

The duration of the black screen differs. Less mods, less time. More mods, more time.

Now, when in SP, same mission, instead of a black screen, a second vanilla loading screen appears.. and does not go away until mods have loaded. Without mods, this second screen is extremely quick like less than a second

#

When starting in the editor, it will behave different, and will display a message about "BIS_fnc_activateAddons"

fair drum
#

and the message?

hardy valve
#

Ill check it again but its something about not being in singleplayer. This doesnt show up outside the editor and its a little yellow text message and not an error and doesnt show in the RPT

#

But it led me to research BIS_fnc_activateAddons and I saw that it only happens at mission start.. then tested around and I see that it may be related. I dont know much about JIP and all that stuff

#

Because the missions not starting for the player I think instead of a neat nice looking loading screen it just puts you into a black screen

fair drum
#

it sounds to me like a particular mod is doing it or poor scripting. there is too much to unpack. does it happen in other missions or just this mission?

hardy valve
#

Happens in any mission that is persistent and someone joins after mission start. I thought it was a mod but I actually tested removing all mods.. then slowly added more, and game start time and this black screen time both increased with the amount of mods loaded

#

If the mission starts with all players, nobody has the issue, they get a second loading screen

#

I may need to just live with it lol

#

Granted it is obviously related to mods in general, but not a particular mod

outer berry
#
if (!(_objHit == _hitter)) then {
        if (_objHit getVariable 'Fighter_Health' <= 0) exitWith {
            _objHit removeAllEventHandlers "HandleDamage";
            _objHit setDamage 1;
        };
#

if (!(_objHit == _hitter)) then {
if (_objHit getVaria>
Error position: <== _hitter)) then {
if (_objHit getVaria>
Error Generic error in expression

#

this is the error im getting im lost

warm hedge
#

Post your context please

outer berry
#

what context it is there

warm hedge
#

Everything

#

Your intention, how it is called, environment, etc

outer berry
#

so I shot the unit and when I shot the unit I got that error

keen rain
fair drum
fair drum
keen rain
#

Thank you!

unreal hornet
#

I'm trying to make a detector for an ACE action where, when the action is triggered, a trigger condition in the mission is met and removes the action. The trouble I'm having is detecting when the action gets triggered and removing the action. Here is my script.

_actionDetector = 0; //This is the variable I want incremented
_actionRoot = ["unlockNuke0","Unlock 3VB3 Shellrack","x\zen\addons\modules\ui\nuke_ca.paa",{nil},{true}] call ace_interact_menu_fnc_createAction; 
[artyVeh, 1, ["ACE_SelfActions"], _actionRoot] call ace_interact_menu_fnc_addActionToObject; //This adds the parent action to the vehicle

_action = ["unlockNuke1","Confirm Nuclear Authorization","z\ace\addons\vehiclelock\ui\key_menuicon_ca.paa",{
    artyVeh addMagazine ["rhs_mag_atomic_2a33",1]; //Script being run when the action is triggered
    _actionDetector = _actionDetector + 1; //This is the variable I want incremented
},{true},{},[], [0,0,0], 1] call ace_interact_menu_fnc_createAction;
[artyVeh, 1, ["ACE_SelfActions","unlockNuke0"], _action] call ace_interact_menu_fnc_addActionToObject; //This adds the childAction "unlockNuke1" to the parentAction "unlockNuke0"

How to I make this variable more "Global" in that the trigger condition can see it and then make the trigger effect something like this?

[artyVeh,1,["ACE_SelfActions","unlockNuke0"]] call ace_interact_menu_fnc_removeActionFromObject; //remove parentAction
[artyVeh,1,["ACE_SelfActions","unlockNuke0","unlockNuke1"]] call ace_interact_menu_fnc_removeActionFromObject; //remove childAction from parentAction

I don't even know if this is correct form to remove an action that has a parent. Any help is GREATLY appreciated.

keen rain
#

Dumb question: Anyone knows how to change Text Color ?

fair drum
keen rain
tough abyss
#

Added: New command selectRandom which returns a random element of a given array
Tweaked: The random command now accepts an array as alternate syntax to support Gaussian distribution

Bohemia Interactive Forums

Page 34 of 34 - Development Branch Changelog - posted in ARMA 3 - DEVELOPMENT BRANCH: 17-11-2015
There will not be an update on this day due to a Czech national holiday.

hallow mortar
#

I'm not sure Tasks support custom text formatting

#

Normally you would use Structured Text, but task commands only take String for their text stuff, and I don't think that gets parsed into Structured Text either

keen rain
#

Thank you! That worked

tough abyss
#

But still no new/updated str command that escape quotations in strings

open hollow
#

and if you want to share it to all players and server use publicvariable "varname"

unreal hornet
unreal hornet
#

ok, I'll continue and report results. Any ideas with the removal of the ACE actions?

dreamy kestrel
#

is there really no way to set a unit side? particularly once the setCaptive thingy has taken effect?
causing vehicles to be taken over civilian, especially once loaded.
this in spite of the fact he is in my group (opfor).

unreal hornet
# open hollow its practily the same

okay so using the SetVariable in the ACE action SQF and the GetVariable in the Trigger has worked along with the ACE action removal in the trigger effect. Thank you!

dreamy kestrel
fair drum
#

Or you can move the captive unit to the players group

#

Or make the captive unit join a new group on the friendly side

#

Or possibly, unlock the vehicle fully instead of leaving it on default?

dreamy kestrel
#

NSWYM unlock vehicle fully? I scanned the locked, lockedDriver, for instance, and the vehicle is definitely unlocked in both cases, with captive (civilian) unit loaded.

#

next I guess will try forcing the issue moveIn... but I suspect will be met with a hard no in that instance as well. along similar lines as with the ACE Get In actions, was a no-op, effectively, did nothing, or was blocked somehow.

hallow mortar
dreamy kestrel
#

tried, I can at least moveInDriver so there's that

#

but the action menu actions for any of the vehicle positions goes away.

#

as a workaround could probably introduce a menu item.

#

although still a bit odd that for ACE Get In is a bit more casual in its response, and also blocks, a no-op.

#
// _x being the vehicle
[locked _x, lockedDriver _x]; // [1, false]

cleared the locking, _x lock 0, but still cannot get in.

#

once in, I can negotiate the positions freely. just cannot get in the first time without an assist.

sullen sigil
#

is there a way to programmatically check player is aiming (rather than weapon lowered from combat pace/double tap ctrl etc) or make player aim

dreamy kestrel
hallow mortar
# dreamy kestrel to clarify, 1. player led group, not AI led group. 1. unit is _captured_ from ha...

player led group, not AI led group
Yes, but that doesn't necessarily mean there can't be inconsistencies or things having unexpected effects. We've already established that this is not the problem, since the vehicle is in state 0 anyway, but it was a potential issue that was worth exploring.
unit is captured from hands over head (surrendering) to hands behind back, so any notion of unit commands is a non-sequitur.
The animation a unit is in doesn't have any connection to what commands it can give. The "surrendered" state does not exist in vanilla, only setCaptive, which doesn't affect the AI's behaviour. Any such state is scripted by a third-party mod, and could therefore have unknown loopholes, side effects, or elements that remain under the control of the engine, which has no concept of a captured unit.

pliant temple
#

Anybody know how to make an object an inventory in game like in the init

dreamy kestrel
meager granite
frigid smelt
#

On client side I have initPlayerLocal.sqf which I know is triggering as all diag_log statements are provided.

diag_log "Player Initializing....";

if (hasInterface) then
{
    waitUntil {!isNull player};
    //private _playerInfo = getUserInfo getPlayerID player;

    [] call UL_fnc_createSpawnDialog;
    [  ] remoteExec [ "UL_fnc_initPlayerServer", 2 ];

    diag_log "createSpawnDialog called";
};

I have fn_initOaterServer.sqf on the server side in the "Modules" diectory with just this code.

"Hello" remoteExec ["hint"];
"Hello" remoteExec ["diag_log"];
diag_log "Testing";

In my description.ext in CfgRemoteExec > Functions
class UL_fnc_initPlayerServer { allowedTargets = 2; };

On my server in config.cpp I have

class CfgFunctions
{
    class UL 
    {
        tag = "UL";

        class Modules
        {
            file = "Modules";

            class initPlayerServer {};
        };
    };
};

I tried messing with file var, with different paths based on code I was seeing online with no luck.

I'm probably doing something dumb here but I can't get initPlayerServer to trigger. I know there's a file I can use for that, but right now I'm just trying to figure out how to call server functions from client.

granite sky
#

Is this a mission or a mod?

#

And you mean it's in modules\fn_initPlayerServer.sqf, not functions\modules\fn_initPlayerServer.sqf?

frigid smelt
#

Mission; has the client mission and a server side component, which might be considered a mod? not entirely sure, it's not meant to provide a dependency though. Think Altis Life.

Correct, I didn't think the functions directory was a requirement, but it's possible I missed that in the documentation that's kinda everywhere. It works without functions directory on client, assumed it would work fine on the server side too, could be wrong.

granite sky
#

Well, you're not using CfgFunctions for the client function.

#

This was a typo, right:

I have fn_initOaterServer.sqf on the server side in the "Modules" diectory with just this code.

#

Separate "server side component" sure sounds like a mod to me.

#

In which case you need to figure out prefixes.

frigid smelt
#

This is what I have in client side

class CfgFunctions
{
    class UL 
    {
        tag = "UL";
        
        class Spawning
        {
            file = "Core\Modules\Spawning";

            class createSpawnDialog {};
            class spawnPlayer {};
        };
    };
};

class CfgRemoteExec
{
    class Functions
    {
        mode = 1;
        jip = 0;

        class BIS_fnc_effectKilledAirDestruction    { allowedTargets = 0; jip = 0; };
        class BIS_fnc_effectKilledSecondaries        { allowedTargets = 0; jip = 0; };
        class BIS_fnc_fire                            { allowedTargets = 0; jip = 0; };
        class BIS_fnc_objectVar                        { allowedTargets = 0; jip = 0; };
        class BIS_fnc_setCustomSoundController        { allowedTargets = 0; jip = 0; };
        class BIS_fnc_debugConsoleExec                { allowedTargets = 0; };

        class UL_fnc_initPlayerServer                { allowedTargets = 2; };
    };
};

Wasn't sure I needed to define a server function in CfgFunctions.

frigid smelt
granite sky
#

You need to figure out whether you're writing a mod or not anyway.

frigid smelt
granite sky
#

How many PBOs do you have?

frigid smelt
#

2, the mission PBO and server PBO, which I guess is the mod in this case, used by the server, but not distributed to clients.

granite sky
#

How are you loading the server PBO?

frigid smelt
#

It's in the root folder of the server in folder @UL.Server/addons/UL.Server.pbo
Loaded through -serverMod=@extDB3;@UL.Server

granite sky
#

yeah, that's definitely a mod.

#

What's the prefix of the PBO?

frigid smelt
#

UL.Server? prefix in this context just refers to the name of the PBO?
The clients is UL.Altis

granite sky
#

Prefix is the virtual filesystem path of the PBO. It's an attribute set on the PBO by your build tool.

frigid smelt
#

Alright guessing I'm missing that because I'm using PBOConsole.exe to pack as part of a powershell script, and I just run
& $pboManagerPath "-pack" "$serverSourceFolder" "$serverOutputFolder\UL.Server.pbo"

granite sky
#

Yeah I don't know that build tool.

#

There is apparently a default prefix but it's not documented anywhere.

frigid smelt
#

Alright, that could be the entirety of my problem, not sure if PBOManager has that option. I have to leave shortly, but I'll go through that documentation and make sure everything is setup correctly before I bug anyone else.
Thank you, saved me from a massive headache.

granite sky
#

Once you figure out how to set the prefix, you'll need to update your CfgFunctions file parameters to include it.

#

Otherwise it won't know where the files are.

frigid smelt
manic kettle
#

I hear people say hemtt is better but honestly it's like 1000 miles over my head

manic kettle
#

Seems complicated to me, maybe I'm just the dum

keen rain
#

Kinda looking for a simple way to do a Zeus Enhanced Task of when players gets close to an area a task popup appears...

Also does anyone knows how to clear out tasks or make tasks that pop ups but aren't assigned in tasks board when players open their map?

fair drum
keen rain
#

Can you do that in an antistasi mission with progress already made?

I suppose you can just take the map data?

fair drum
#

its more complicated than that. didn't know you were modifying an already existing mission

keen rain
#

My fault. I just really like of making "antistasi" more than it is by default you know

onyx bolt
#

HI All,
want time to pass faster at night. It's started to pass faster but not switching back to normal after 6:30 a.m. What I'm doing wrong?
init.sqf
[] call compileScript ["core\time_cycle.sqf"];

core\time_cycle.sqf
if (!isServer) exitWith {};
while {true} do
{
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20 //for night time
}
else
{
setTimeMultiplier 1 //for day time
};
sleep 120;
};

opal zephyr
#

That looks correct, does your actual code have semicolons after the setTimeMultiplier code?

onyx bolt
#

no. it's copied as is

opal zephyr
#

oh, add semicolons then

onyx bolt
#

setTimeMultiplier 20; ?

opal zephyr
#

yes

onyx bolt
#

thx. will try

onyx bolt
#

now it's not switching to faster time at 17:30
if (!isServer) exitWith {};
while {true} do
{
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20; //for night time
}
else
{
setTimeMultiplier 1; //for day time
};
sleep 120;
};

hallow mortar
#

Add a systemChat str daytime before the if so you can see what time it's detecting

onyx bolt
#

@hallow mortar executed dayTime throuth debug console - 18.0853

hallow mortar
#

I'd like you to do it as part of the loop script, so that we know what time it is at the moment the loop happens, and so there's a clear indicator the loop is running at all

onyx bolt
#

not sure where exactly to add it

opal zephyr
#

just put it before the first if statement

onyx bolt
#

7:38:49 Error in expression < 20;
}
else
{
setTimeMultiplier 1;
};
sleep 120;
};>
7:38:49 Error position: <sleep 120;
};>
7:38:49 Error Suspending not allowed in this context
7:38:49 File mpmissions__cur_mp.takistan\core\time_cycle.sqf..., line 13

systemChat str daytime;
if (!isServer) exitWith {};
while {true} do
{
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20; //for night time
}
else
{
setTimeMultiplier 1; //for day time
};
sleep 120;
};

sharp grotto
# onyx bolt 7:38:49 Error in expression < 20; } else { setTimeMultiplier 1; }; sleep 120; ...

Need to either to spawn the time_cycle function like this 0 spawn time_cycle instead of calling it.
Read here why: https://community.bistudio.com/wiki/Scheduler

Or wrap it inside a spawn

0 spawn {
  systemChat str daytime;
  if (!isServer) exitWith {};
  while {true} do
  {
      if (daytime >= 17.5 || daytime < 6.5) then
      {
          setTimeMultiplier 20; //for night time
      }
      else
      {
          setTimeMultiplier 1; //for day time
      };
      sleep 120;
  }; 
};
hallow mortar
#
  • this is being done with an external script file so just use execVM instead of call compile, for making it scheduled
  • HOWEVER, the call compile is being done in init.sqf, which is scheduled, so suspending is allowed and this error doesn't make sense
#

About the position of the systemChat, that's my mistake for not being precise. It should be after the while {true} but before the if (dayTime >= ..., that is, inside the loop but before the condition that depends on it being a certain time.

hallow mortar
onyx bolt
#

just put on server. working like a charm. thank you guys!

#

executed from init.sqf with execVM "core\time_cycle.sqf";
time_cycle.sqf
if (!isServer) exitWith {};
while {true} do
{
systemChat str daytime;
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20; //for night time
}
else
{
setTimeMultiplier 1; //for day time
};
sleep 120;
};
still no chat messages with daytime but it's not a problem since all is working

hallow mortar
#

You won't see the chat message when running on an actual server, because the code is running only on the server, so only the server sees the message. So if it's working, you can remove that line for a small performance saving.

However, this should have worked in local testing or not at all. There's nothing about it that should work differently (in terms of what matters for the problem) between local and DS.

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
willow shore
tough abyss
#

For the god sake I don't know what to do with these damn ORBAT Groups

#

What does not work

#

class CfgORBAT
{
class 2ndDivision
{
id = 2;
idType = 0;
side = "West";
size = "Company";
type = "Infantry";
commander = "Baller";
commanderRank = "Major";
text = "%1 %2 %3";
textShort = "%1 %3";
color[] = {0,0,1,1};
assets[] = {{"B_MRAP_01_F", 1},{"B_Plane_Fighter_01_F",2}};

    class 1stSquad
    {
        id = 1;
        idType = 0;
        side = "West";
        size = "Squad";
        type = "Infantry";
        commander = "Caos";
        commanderRank = "Lieutenant";
        text = "%1 %2 %3";
        textShort = "%1 %3";
        color[] = {0,0,1,1};
        assets[] = {{"B_MRAP_01_F", 1},{"B_Plane_Fighter_01_F",2}};
    };
};

};

#

//PATH

missionConfigFile >> "CfgORBAT" >> "2ndDivision" >> "1stSquad"

//Ceiling
missionConfigFile >> "CfgORBAT" >> "2ndDivision"

#

It's a ORBAT Config from some Bohemia Forum but it does not work for me neither

#

I still have no class found error

#

And, yes I have correct file expansion EXT

warm hedge
#
  1. description.ext for sure?
  2. Reloaded (or save) your mission?
tough abyss
warm hedge
#

You can name what whatever?

tough abyss
#

Someone

warm hedge
#

You cannot. description.ext. Either you misread the guide or he doesn't know what he said

#

Case insensitive AFAIK though

warm hedge
#

Honestly this guide just makes me confused

tough abyss
warm hedge
#

Know what? I know what description.ext is but I don't know what this guide tries to tell

tough abyss
warm hedge
tough abyss
warm hedge
#

I'm not repling to you

tough abyss
#

Oh ye

#

Lol

#

Nvm

willow shore
tough abyss
#

Anyways am out

#

Yes, I know I made many mistakes I don't think after fighting with those damn ORBAT Groups

chrome hinge
#

Is there a way to detect waypoint being created with high command?

fallen crow
#

Hi, i have a house with many doors like 10 doors. how i can desactivate only the doors 1 2 and 3.. ItΒ΄s posible? only with INIT ?

proven charm
#

actually the arg was 1 not true (edited above)

fallen crow
#

but, where i spesificate the doors 1 , 2 and 3 ?

proven charm
fallen crow
#

so, only need remplace _doorIndex with 1,2,3?

proven charm
#

yes

fallen crow
#

i go to try.

hallow mortar
#
for "_i" from 1 to 3 do {
   _bldg setVariable [format["bis_disabled_Door_%1",_i], 1, true];
};```
proven charm
#

and _bldg is the building object

fallen crow
#

not men

#

the doors open

#

😦

hushed tendon
#

Just trying to confirm my thinking is correct with locality. I usually use the code below for objects I'm trying to increase their size in MP but if I'm ticking the local attribute on the object I should remove the if statement right?

if(isServer)then{
_obj = [this] call BIS_fnc_replaceWithSimpleObject;
_obj setObjectScale 3;
};
hallow mortar
#

Probably yes, otherwise only the server's local copy of the object will be converted to a simple object and scaled

hushed tendon
#

but it's creating the object for each player locally so the init would also run for that local object right?

hallow mortar
#

Yes, but the isServer check would fail for any machine other than the server, so nothing would happen to the clients' local copy of the object

hushed tendon
#

yeah that's why I was going to remove the if statement for the local objects

tough abyss
willow shore
#

Am I misunderstanding the structure of custom modules, essentially I have a script that currently is activated by a trigger, but I would like to make it all into just a single module so its easier for my friends to use. To achieve this I need to define a module, than a module function (which contains the script)?

#

Its especially hard since with a trigger you can just do simple things like thisTrigger getPos to get the trigger location, but with modules you have to define it in the attributes (somehow) then pass it to the module function? If anyone has any non-BI sources that explains this stuff, that'd be greatly appreciated.

proven charm
willow shore
#

actually ignore what I said, figured it out.

fallen crow
#

the door open has well

#

this setVariable [format["bis_disabled_Door_%1",1], 1, true];
this setVariable [format["bis_disabled_Door_%1",2], 1, true];
this setVariable [format["bis_disabled_Door_%1",3], 1, true];

#

the door 1 2 and 3 still open

proven charm
#

maybe its custom building that does not support the bis_disabledDoor variable?

#

wait, its supposed to be "bis_disabled_Door_%1"

#

not "bis_disabled_Door%1"

#

ugh this chat changes the name

#
bis_disabled_Door_%1
#

that one ^^

winter rose
#

\_ needs escape yes

proven charm
#

or code tag

crude barn
#

If a mod isn’t working on a dedicated server, is it possible to configure the server itself to make it dedicated server compatible?

winter rose
#

no

sharp grotto
# fallen crow this setVariable [format["bis_disabled_Door_%1",1], 1, true]; this setVariable ...
// Function
fnc_LockDoors = {
    params ["_Building","_DoorsToLock"];
    if(_DoorsToLock IsEqualTo [0]) then
    {
        private _doorCount = getNumber (configFile >> "cfgVehicles" >> typeOf _Building >> "numberOfDoors");
        for "_i" from 1 to _doorCount do {_Building setVariable[format["bis_disabled_Door_%1",_i],1,true]};
    } else
    {
        {_Building setVariable[format["bis_disabled_Door_%1",_x],1,true]} foreach _DoorsToLock;
    };
    true
};

// Call the function with the _Building defined (Will lock door 1,2 and 3). 
[_Building,[1,2,3]] call fnc_LockDoors;

// This would look all doors
[_Building,[0]] call fnc_LockDoors;

But as already mentioned here some mod building miss something for it to work properly.

velvet wave
#

anyone know if it's possible to get a video to loop seamlessly, I have a video playing on a loop atm but it just snaps to black for a third of a second before the next loop starts.

willow shore
#

Could someone clarify the difference between arguments and attributes in the module framework

fair drum
willow shore
#

And best way to retrieve an attribute value is with getVariable right

fair drum
fair drum
# velvet wave yes

looking through the function, it doesn't have some sort of return for the ctrl, nor does it have a scripted event handler you can work off of when it detects the video is done. you'll probably have to write your own in your own way

warm swallow
#

if i want to convert execVM'd script to function, i would spawn the script, right?

warm hedge
#

If you want to run in scheduled, yes

somber radish
#

Anyone got a quick solution to turn off collision damage?
I am trying to have vehicles be unharmed when crashing into walls, and have infantry not die by being crashed into by vehicles

left iron
#

so question for yall: im running this script in itemList.sqf in the root menu of the MP mission im making:

// Define the item sets
_itemSets = [
["rhs_weap_aks74u", 3, "rhs_30Rnd_545x39_7N6M_AK"],
["rhs_weap_akmn", 3, "rhs_30Rnd_762x39mm_bakelite"],
["arifle_Mk20_plain_f", 3, "30Rnd_556x45_Stanag"],
["rhs_weap_g36c", 3, "rhssaf_30rnd_556x45_Tracers_G36"],
["rhs_weap_hk416d145", 3, "rhs_mag_30Rnd_556x45_Mk318_Stanag"],
["rhs_weap_m14", 3, "rhsusf_20Rnd_762x51_m62_Mag"],
["rhs_weap_m249_light_S", 3, "rhsusf_100Rnd_556x45_mixed_soft_pouch"],
["rhs_weap_M590_8RD", 5, "rhsusf_5rnd_00Buck"],
["SMG_05_F", 3, "30Rnd_9x21_Mag_SMG_03_Tracer_Red"],
["rhsusf_weap_glock17g4", 3, "rhsusf_mag_17Rnd_9x19_JHP"],
["hgun_Pistol_heavy_01_F", 3, "11Rnd_45ACP_Mag"],
["hgun_Pistol_01_F", 4, "10Rnd_9x21_Mag"],
["launch_RPG7_F", 2, "RHS_rpg7_TBH7V_mag"]
];

// Randomly choose an item set
_selectedSet = _itemSets select (floor(random(count _itemSets)));

// Spawn the selected item set
_unit = createUnit [_selectedSet select 0, getMarkerPos "marker_0", [], 0, "NONE"];

// Add magazines to the spawned unit
{
_unit addMagazineCargoGlobal [_x select 2, _x select 1];
} forEach _selectedSet;

This script is meant to select a random weapon+ammo set from the list, and then spawn it in game.

When itemList.sqf is called in game (eventually it will be tied to a trigger) arma says line 22
(_unit = createUnit [_selectedSet select 0, getMarkerPos "marker_0", [], 0, "NONE"];) is missing a semi colon. Do any of you know what the issue might be here?

#

i have also tried running this directly on a trigger in game (in the activation box) however im getting the same error, and the wiki says the in game triggers dont read "//" as comments

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
warm hedge
#

Please format so we can understand which is the code easily

left iron
#

im doing something wrong because pressing enter just adds more whitespace and doesnt post it

warm hedge
#

Just click outside of your code so you're good

left iron
#

its not often im too stupid to understand something but clearly this is one of those times. the only place on my entire screen where clicking on it and then pressing enter does NOT make more whitespace in the code is my task bar. if i press my task bar nothing happens at all when i press enter.

warm hedge
#

Task bar? I didn't mentioned about anything about it

left iron
#

you said click outside of the code

warm hedge
#

Not Discord, code

#
hint "your code";
// comment out
left iron
#

there it is, i see the problem (i think)

#
// 
// Define the item sets
_itemSets = [
    ["rhs_weap_aks74u", 3, "rhs_30Rnd_545x39_7N6M_AK"],
    ["rhs_weap_akmn", 3, "rhs_30Rnd_762x39mm_bakelite"],
    ["arifle_Mk20_plain_f", 3, "30Rnd_556x45_Stanag"],
    ["rhs_weap_g36c", 3, "rhssaf_30rnd_556x45_Tracers_G36"],
    ["rhs_weap_hk416d145", 3, "rhs_mag_30Rnd_556x45_Mk318_Stanag"],
    ["rhs_weap_m14", 3, "rhsusf_20Rnd_762x51_m62_Mag"],
    ["rhs_weap_m249_light_S", 3, "rhsusf_100Rnd_556x45_mixed_soft_pouch"],
    ["rhs_weap_M590_8RD", 5, "rhsusf_5rnd_00Buck"],
    ["SMG_05_F", 3, "30Rnd_9x21_Mag_SMG_03_Tracer_Red"],
    ["rhsusf_weap_glock17g4", 3, "rhsusf_mag_17Rnd_9x19_JHP"],
    ["hgun_Pistol_heavy_01_F", 3, "11Rnd_45ACP_Mag"],
    ["hgun_Pistol_01_F", 4, "10Rnd_9x21_Mag"],
    ["launch_RPG7_F", 2, "RHS_rpg7_TBH7V_mag"]
];

// Randomly choose an item set
_selectedSet = _itemSets select (floor(random(count _itemSets)));

// Spawn the selected item set
_unit = createUnit [_selectedSet select 0, getMarkerPos "marker_0", [], 0, "NONE"];

// Add magazines to the spawned unit
{
    _unit addMagazineCargoGlobal [_x select 2, _x select 1];
} forEach _selectedSet;
#

those are "`"s not "."s

warm hedge
#

Okay so...

  1. selectRandom _itemSets; is enough to select one element of an array
  2. createUnit is not the command to make a weapon holder, it is for an AI unit
  3. forEach _selectedSet isn't a proper way to do in this case, it iterates _selectedSet's each element, in this case "rhs_weap_aks74u", 3, "rhs_30Rnd_545x39_7N6M_AK", not your array
  4. So instead of forEach'ing, just _selectedSet select 0 or so
  5. However I recommend to use addWeaponWithAttachmentsCargoGlobal, and use "WeaponHolder_Single_F" with createVehicle
left iron
#

so i kind of understand the first part, and can work that one out. what does weaponholder+create vehicle do in this instance?

#

actually, the second part creates the box/bag whatever and "addWeaponWithAttachmentsCargoGlobal" populates it with stuff from the array?

warm hedge
#

Ah hmm, I misunderstood a bit of the intention there

#

But my understand is this:```sqf
private _itemSets = ["arifle_MX_F",3,"30Rnd_65x39_caseless_mag"];
private _groundHolder = createVehicle ["GroundWeaponHolder_Scripted",getPosATL player,[],0,"CAN_COLLIDE"];

private _magazineCount = getNumber (configFile >> "CfgMagazines" >> (_itemSets#2) >> "ammo");
_groundHolder addWeaponWithAttachmentsCargoGlobal [[_itemSets#0, "", "", "", [(_itemSets#2),_magazineCount], [], ""], 1];
_groundHolder addMagazineCargoGlobal [(_itemSets#2),(_itemSets#1)];```

hallow mortar
#

I wouldn't bother getting the ammo count from the magazine config tbh. Just set it to like 500 or something, it will only add up to the max capacity

dreamy kestrel
#

I am trying to find the "Get in" action IDs for a vehicle, looking at it, cursorobject, but it does not appear to have any.
are those instead added to player?
or possibly are they configuration based?
trying to find info about each of them, specifically for iconagraphy, paths and such.

hallow mortar
#

Some actions, like Get In, are engine-controlled and don't have IDs.

dreamy kestrel
#

hrm... where might I find the icons?

hallow mortar
dreamy kestrel
#

like specifically I want the "Get in commander" icon.

#

the + with two rings

#

if I have to screen shot it I will, but I hate to do that if there is a resource I can leverage.

dreamy kestrel
#

now we cooking with some oil getingunner_ca.paa...

dreamy kestrel
round plinth
#

Anyone able to help me with some script stuff?

round plinth
#

Ill elaborate on my problem:
Im in a server that runs several scripts that seem to clash together. Im not entierly sure how to fix it (If Possible)
TThe scripts that seem to clash is: "taw_vd." "RifleTargets" And "Fawks Medical".

anyone know an easy way to fix this? Its with the "cfgfunctions" between Fawks and Rifle targets and "Defines" between Fawks and Taw

fair drum
round plinth
#

Thanks for the feed back tho

red shale
#

hey all, i am trying to create a sub scroll menu any idea on how i do that

warm hedge
#

What is a sub scroll menu

hallow mortar
#

I suspect the idea is a sub-menu off the action menu, similar to sub-menus in e.g. the Windows context menu.
If that is the idea then the answer is "you don't"; there is no proper way of doing such a thing, and trying to manually build your own is a bad idea

red shale
#

Damm ok

hasty pond
queen cargo
#

correct me if im wrong but ... that what youre showing there is not CBAs flexi menu

#

that should be the normal menu of tactical battlefield

#

poor quality but ... still

#

first img i could find

fallen crow
#

thanks for share all that

livid belfry
#

Happy new year to all, so i created a SP misson for my self. but i cant work out the what the scrip is to preload RHS water and fuel jerry cans as ace cargo, just to save me having to load them manually every time i restart after a edit.

i know there is this -
["ACE_Wheel", cursorObject] call ace_cargo_fnc_loadItem

so for a jerrycan it be
["rhsusf_props_ScepterMWC_D" , cursorObject] call ace_cargo_fnc_loadItem in the vehicle init?

if i wanted say 8 then would it be
["rhsusf_props_ScepterMWC_D, 8" , cursorObject] call ace_cargo_fnc_loadItem in the vehicle init?

i do not really understand how it work

many thanks

hallow mortar
#

ace_cargo_fnc_loadItem does not have a quantity parameter, and can only do one object at a time. If you want to do multiple, use a for loop:

for "_i" from 1 to 8 do {
  ["rhsusf_props_ScepterMWC_D", _vehicle] call ace_cargo_fnc_loadItem
};```
(If it did have a quantity parameter, it would _not_ be provided as part of the classname string.)

`cursorObject` is not the appropriate command to use to find the target vehicle. `cursorObject` returns the object the local player's cursor (roughly centre screen) is currently over. That would be fine if you wanted to add something to the vehicle you're looking at, but it's no good for an init field.
In an object init field, the special variable `this` contains a reference to the object the init field belongs to, so use that instead.

Note that object init fields are run on every machine, when the mission starts or when they join the game. You'll want to ensure your code only runs once, at the start, instead of running as many times as there are connected machines, and again when someone joins. A sensible way to do this is to ensure all machines apart from the server ignore it.
```sqf
if isServer then {
  for "_i" from 1 to 8 do {
    ["rhsusf_props_ScepterMWC_D", this] call ace_cargo_fnc_loadItem
  };
};```
livid belfry
#

@hallow mortar amazing thank you so much for the help

hallow mortar
#

actually the server-only stuff doesn't matter if it's SP, since there will only ever be one machine connected. It doesn't hurt though, so you can leave it in in case you want to play co-op in the future.

livid belfry
#

thanks

hasty pond
#

I looked at cba's files and saw the graphics there

lone glade
#

It's the same type of menu, just the appearance that changes a bit.

hasty pond
#

Could be, but I have no idea how to script that menu in

sullen sigil
lone glade
#

No idea either never looked at the code, if it's the ace type of menu instead call me.

nocturne bluff
#

read the docs?

hasty pond
#

I have read the docs, but they don't really help that much

nocturne bluff
#

Use reverse engineering then

#

try try try

sullen sigil
#

main problem is just the "combat pace" thing

hasty pond
#

Yeah, I was just wondering if anyone here knew about it so I could take the easy road

sullen sigil
#

most getters (stance etc) dont consider that

nocturne bluff
#

I think the docs are rather clear on it

dreamy kestrel
# proven charm need more info? https://community.bistudio.com/wiki/Arma_3:_Communication_Menu

the icons are not showing up in the menu like I would expect. instead an icon is drawing center screen. and it is not the one that I am providing.
the icons I want are:

\a3\ui_f\data\igui\cfg\actions\getinpilot_ca.paa
\a3\ui_f\data\igui\cfg\actions\getindriver_ca.paa
\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa
\a3\ui_f\data\igui\cfg\actions\getincargo_ca.paa

as I initially stated, my goal is to present in a commanding menu the same icons that appear in the actions.

dreamy kestrel
proven charm
dreamy kestrel
#

strange, dunno.
I left that false for now, still no icons however, being rendered in the commanding menu. are there size restrictions on the icons? i.e. they should be 32x? or 16x? I think these may be 64x, which are fine for the action menus.

dreamy kestrel
#

both appear to be 64x

proven charm
dreamy kestrel
#

I mean I 'could', but like I said, they are both 64x.

#

what else do I need to convey for icons?

tender fossil
#

What am I doing wrong here? I'm using KK's neat function that combines findEmptyPosition and isFlatEmpty.
Calling code: sqf _finalPos = [[_tempPos],[50,-1,-1,1,0,false,objNull]] call PEAK_fnc_AI_isFlatEmpty; PEAK_fnc_AI_isFlatEmpty: ```sqf
params ["_pos", "_params"];

_pos = _pos findEmptyPosition [0, _params select 0];

if (_pos isEqualTo []) exitWith {[]};

_params = +_params;
_params set [0, -1];
_pos = _pos isFlatEmpty _params;

if (_pos isEqualTo []) exitWith {[]};

_pos;

`findEmptyPosition` (in the fnc) always returns an empty array, but I can't find the source of the error. (`_tempPos` is properly defined also according to debugger, and I'm testing in VR)
proven charm
tender fossil
dreamy kestrel
# proven charm like ``` "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\artillery_ca.paa" ``` for exam...

from my log, these were the commanding menus I constructed. can be 1+ such chained menus, depending on how specialized the vehicle positions may be.

[
  ["Get in transport...",false]
  , ["Driver",[2],"",-5,[["expression","[player, [0, 0]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getindriver_ca.paa"]
  , ["Passenger (Left Seat 2)",[3],"",-5,[["expression","[player, [0, 1]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
  , ["Passenger (Right Seat 2)",[4],"",-5,[["expression","[player, [0, 2]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
  , ["Passenger (Right Seat 1)",[5],"",-5,[["expression","[player, [0, 3]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
  , ["Passenger (Right Seat 3)",[6],"",-5,[["expression","[player, [0, 4]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
  , ["Passenger (Left Seat 3)",[7],"",-5,[["expression","[player, [0, 5]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
  , ["Gunner",[8],"",-5,[["expression","[player, [0, 6]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
  , ["Abort",[1],"",-5,[["expression","[] call MY_fnc_captiveUI_hideEscortGetInTransportMenu"]],"1","1","\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"]
]
#

the menu does present, and the choices do function correctly. just the icons are not cooperating.

#

I can do a smoke test,

fileExists '\a3\ui_f\data\igui\cfg\actions\getindriver_ca.paa' // true

so I am reasonably confident that the files do exist.
I cannot imagine, is it something dumb like commanding menus is treating icon paths as case sensitive? that would be dumb...

#

which and for grins, responding to your suggestion, threw in the iconcursorsupport_ca.paa for good measure.

#

no joy in any of these, no icons are showing

little raptor
#

If you want to show icons next to items, use structured texts

dreamy kestrel
little raptor
#

That's different

#

Those icons don't come from commanding menus

#

They're always there (support icons)

dreamy kestrel
#

bear with me one sec while I screen shot with icons true

hallow mortar
#

It looks like those are from the CfgCommunicationMenu config-based top-level menus. Note how they have two icon types (icon and cursor properties), while the function-based submenu, which you're using, only has the cursor icon.

dreamy kestrel
#

this is what I get.

  1. the icons do not render in the menu, but if the workaround is structured text, fair enough, so be it.
  2. but furthermore, consistent with the claim, the icon is at the cursor position center screen, but those are not what I spec, literally from the array above.
    https://pasteboard.co/I2B7vOu610Vw.png

Simple and lightning fast image sharing. Upload clipboard images with Copy & Paste and image files with Drag & Drop

#

and for that matter, why mention this note in the docs at all, if that is not what is happening...

// icon path: The path to the texture of the cursor, that should be used on this menuitem.
cosmic lichen
#

Please post in wiki channel what should be changed.

little raptor
#

Maybe your paths are wrong

#

I know that it does work because I've used it before myself

dreamy kestrel
#

oh wait a sec silly me... might have a typo in there...

fair drum
dreamy kestrel
#

yes. in and of itself I can structure

_t = text 'test';
_t setattributes ['valign', 'middle'];
_i = image '\a3\ui_f\data\igui\cfg\actions\getincargo_ca.paa';
_i setattributes ['valign', 'middle'];
hint (composetext [_t, _i])

that works. working on a rinse repeat use case...

hasty pond
#

Maybe I am just an idiot.

limber panther
#

Hello!
Players on my server can open a dialog window after pressing a button. A window shows up and among other things, there's also a button that can be clicked. When a player clicks this button, it executes this: sqf ExecVm 'cams\startfeed.sqf' And inside that .sqf file (among other things) i have this line: sqf _camera setGroupIdGlobal ["CCTV %1", name player]; It is supposed to name an UAV drone as CCTV and name of the player who clicked the button. But it just gives the drone name CCTV and no name so i suppose i defined name player incorrectly. Can someone suggest me a correct solution to this please? Thank you.

fair drum
round plinth
fair drum
limber panther
# fair drum Post the whole file. Use pastebin if needed

understood, this whole thing works perfectly fine, it just doesn't give the UAV the correct name, however it does name it as CCTV at least, just the players name is missing, here: ```sqf
_camera = player getVariable ["fw_cam_operator", objNull];
if (!isNull _camera) then {
deleteVehicle _camera;
};

private _camera = createVehicle ["B_UAV_01_F", [2122.586,4555.780,38.408], [], 0, "CAN_COLLIDE"];
createVehicleCrew _camera;
_camera setVectorDirAndUp [[1,0,0], [0,0,1]];
_camera allowDamage false;
[_camera, true] remoteExec ["hideObjectGlobal", 2];
_camera setFuel 0;
_camera setGroupIdGlobal ["CCTV %1", name player];
player setvariable["fw_cam_operator",_camera,true];

round plinth
cosmic lichen
#

I don't see CfgFunctions twice.in the files that you posted.

round plinth
#

Exactly

fair drum
round plinth
fair drum
#

that's your problem

hallow mortar
#

Have a look at line 20 and at line 28

cosmic lichen
#

CfgFunctions is twice in there

fair drum
#

its actually... 3 times from 20 to 24, then 1 more time in 28 i think

cosmic lichen
#

I depends what's in the defines

#

The naming is questionable

#

As it suggests all these files have CfgFunctions in it

round plinth
#

How can i fix it?

cosmic lichen
#

The includes most likely need to be within CfgFunctions {...}

fair drum
#

controversial opinion:

just so you can see the structure of things, try not using #include at all, and put everything exposed in the description.ext. when you understand the structure, then start to go back and do includes

round plinth
#

But the problem started when Fawks got added

warm hedge
#

But? But the issue is mostly because you're confused what is and does #include

hallow mortar
# round plinth But the problem started when Fawks got added

Line 28 in the description.ext you posted is using #include to bring in a CfgFunctions definition from a separate file. However, CfgFunctions has already been defined a few lines earlier, so this creates a duplicate.
You need to go and find out what is happening in configs\CfgFunctions.hpp, because the contents of that file is being directly placed into description.ext as if it was typed there in full.

round plinth
#

Ah

warm hedge
#

tldr: #include does only dumb copy and paste

round plinth
#

I dont get how to fix it πŸ˜…

hallow mortar
# round plinth I dont get how to fix it πŸ˜…
  • configs\CfgFunctions.hpp will start with a line that has class CfgFunctions { and end with a line that has };. Remove those
  • move #include "configs\CfgFunctions.hpp" to a line inside the class CfgFunctions { in description.ext, for example directly below the #include "RifleTargets\cfgfunctions.hpp" line
round plinth
round plinth
limber panther
little raptor
#

or I guess:

_camera setGroupIdGlobal ["CCTV %keyword1", name player];
hallow mortar
round plinth
hallow mortar
#

Change it back, then go ask for help deconflicting your configs in #arma3_config . You will probably need to show them the contents of the files.

limber panther
#

thank you @little raptor , i appreciate it, i'll test it and will let you know, also happy new year! πŸ₯³ (it's already after midnight here)

hasty pond
leaden summit
#

Just working on an S-Vest script and looking for an explosive somewhere between M_PG_AT and R_60mm_HE
Anyone know off hand of one?

fair drum
#

certainly my favorite

#

for hud stuff, I like the mission event handler "draw3D"

#

instead of CBA each frame

#

client - server model is good, but keep UI, sounds, etc local on the client

#

use hemtt and build with dev

#

if you are making something modular, the CBA/ACE addon organization is pretty nice. if not, as long as your PBOPREFIX is correct, you can do whatever you want

sullen sigil
#

draw3d event handler

#

oh hypoxic already said

fair drum
#

marker positions each frame over network?

limber panther
leaden summit
#

Just learning how to put modules together and this is part of my config ```sqf
class nzf_svest_explosion : Combo
{
displayName = "Explosion Size";
tooltip = "Size of explosion";
property = "nzf_Module_hvt_svest_explosion";
defaultValue = "M_PG_AT";
class Values
{
class small_boom { name = "Small"; value = "M_PG_AT"; };
class medium_boom { name = "Medium"; value = "IEDUrbanSmall_Remote_Ammo"; };
class large_boom { name = "Large"; value = "R_60mm_HE"; };
};
};

What am I doing wrong?
leaden summit
#

Everything seemed to work fine, the classnames get passed etc, could that really be what's stopping the default working?

fair drum
#

possibly. trying doing string in string for default your way """M_PG_AT"""

#

but i still like using numbers instead

leaden summit
#

Yeah I had that initally, no joy.
Maybe I'll rewrite it to use numbers, seems silly if that's the case though

leaden summit
#

Yeah, just seems silly because then I have to convert from the number to classnames once it's passed to the function.

#

That does work, guess I'll have to roll with that then, thanks

hasty pond
#

Seems like my problem is only that I can't get fleximenu to load up any other rsc

proven charm
#

can you get the view distance that is saved to user profile? i dont want to use viewDistance command because that may changed by scripts

proven charm
warm hedge
#

I haven't messed with this so can't say it does what you need

proven charm
#

it is

warm hedge
#

Good

vapid scarab
hallow mortar
#

No, bring that emoji back, but make it B I G G E R

vapid scarab
#

I can check my examples later, but im at work rn😭😴

#

lmao

raw iris
#

Hey there people of scripts, I found a script in this channel which worked great for what I'm trying to do but I had to execute it in the local console thingy for it to work. I would like it to work for everyone always on a map/server
Here is the code:

[missionNamespace, "arsenalClosed", { 
    missionNamespace setVariable ["Saved_Loadout", getUnitLoadout player]; 
    hint "Selected gear saved!"; 
    }] call BIS_fnc_addScriptedEventHandler; 
 
    player addEventHandler ["Respawn",{ 
        [player] spawn { 
                params ["_player"]; 
                waitUntil {sleep .2; alive _player}; 
                _player setUnitLoadout (missionNamespace getVariable ["Saved_Loadout",[]]); 
        }; 
}]```
meager granite
#

Looks like you missed part of it

raw iris
meager granite
#

call BIS_fnc_addScriptedEventHandler at the end probably

meager granite
#

not sure how you had it working in console to be honest

#

unless you executed something else

raw iris
#

I hit the execute locally button

meager granite
#

or only the bit inside curly brackets

#

anyway, adding it into init.sqf probably should be enough

#

with that bit that I posted

raw iris
#

Ok, so it should look like this?

    missionNamespace setVariable ["Saved_Loadout", getUnitLoadout player]; 
    hint "Selected gear saved!"; 
    }] call BIS_fnc_addScriptedEventHandler; 
 
    player addEventHandler ["Respawn",{ 
        [player] spawn { 
                params ["_player"]; 
                waitUntil {sleep .2; alive _player}; 
                _player setUnitLoadout (missionNamespace getVariable ["Saved_Loadout",[]]); 
        }; 
call BIS_fnc_addScriptedEventHandler
}]```
meager granite
#

Oh wait, your indentation confused me, you already have BIS_fnc_addScriptedEventHandler there in the middle

#

your code is fine

#

The original one

raw iris
#

Ok ok

meager granite
#
[missionNamespace, "arsenalClosed", { 
    missionNamespace setVariable ["Saved_Loadout", getUnitLoadout player]; 
    hint "Selected gear saved!"; 
}] call BIS_fnc_addScriptedEventHandler; 
 
player addEventHandler ["Respawn",{ 
        [player] spawn { 
                params ["_player"]; 
                waitUntil {sleep .2; alive _player}; 
                _player setUnitLoadout (missionNamespace getVariable ["Saved_Loadout",[]]); 
        }; 
}];
#

This is how it should've looked

raw iris
#

How you make it colored? lol

meager granite
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
meager granite
#

Wrap it all inside a

0 spawn {
    waitUntil{player == player};
    ...code here...
};
```and put in `init.sqf`
raw iris
#

Ok, now where do I find init.sqf?

meager granite
#

in the root of your mission

#

if it doesn't exist, create it

#

otherwise just add the code at the top before everything else

#

You probably can create some logic entity and put the code into its Init field too

#

if you're only working with the editor

raw iris
#

Ok, I do not have one. I had another sqf when I tried something else before but I am not sure that wone works properly as I just made a txt and made it into .sqf and then also edit it with notepad, is that good?

meager granite
#

Should be

#

Just make sure you have extensions visible so Windows doesn't save it as init.sqf.txt

raw iris
#

Yea I do

#

Gonna test it now

#

@meager granite It working! Thank you so much for the help this has been bothering me for a year lol I really appreciate it

sullen sigil
#

is there a way to make particles remain relative to player? trying to do accurate jetpack particle effects

#

think similar to the thermal blur on planes or w/e

dreamy kestrel
sullen sigil
#

like how jetpack fire is relative to the person who is jetpacking hmmyes

dreamy kestrel
#

as long as you have the objects, player, backpack, etc, you can attach the particles to the source to your heart's content.

sullen sigil
#

yes

#

i have done that

#

the particles do not maintain a velocity relative to the player

dreamy kestrel
#

just have to tinker until it feels right

#

if you care to maybe share the snippet that is configuring your particles

sullen sigil
#

the entire problem is making the particles inherit the velocity of their emitter

#

i am fully aware of the parameters of the command

#

this goes beyond that

sullen sigil
#

this isnt a my code isnt working problem

#

its a how do i do it problem

dreamy kestrel
#

no one can help you if you are not willing to share at least that snippet, how the source is being configured, etc.

#

my two cents, FWIW... best of luck

sullen sigil
#

snippet doesnt matter

#

because its not about what the code is doing

#

its about what needs to be done

dreamy kestrel
#

right but that is your baseline, and evidently something does need adjustment, but from what?

#

anyway leaving it with share your code.

chrome hinge
#

Anyone got tried and true script for making fixed wing aircraft fire gun to a spot?
The aircraft is sort of a mission objective so it cannot be cas module. I have tried dowatch and fireAtTarget examples but i dont seem to be getting them to work

granite sky
#

Yes but it's insanely complicated :P

little raptor
#

well you can script a simple version πŸ˜…

granite sky
#

Basic principle is to point the plane in roughly the right direction and then correct the projectiles with a Fired EH

#

There's some very fancy maths for the gravity adjustment but you could fudge that if you know the range and weapon beforehand.

little raptor
#

it's not just gravity but drag too

granite sky
#

yes.

#

That's why it's fancy :P

azure fern
#

I recently wrote a message about Arma 3: "Is it possible to make a system that processes node js based http requests in real time in Arma 3? For example, xxx:3031/car will run the car.sqf file when the command is entered?
or will exec the car.sqf " For this, I worked a little on the script that will make the connection to node.js. However, I am missing the command in the car.sqf file or how to read this command and how Arma will get information about this .dll. For this, Can anyone write an example script to guide me?

(I don't have much coding skills).

chrome hinge
granite sky
#

It's in Antistasi's CAS code. Not very readable though because there's a lot of other shit in there.

chrome hinge
#

ah alright

granite sky
#

plus it's two-coder frankenstein

chrome hinge
#

ok, then its probably over my head

little raptor
# azure fern I recently wrote a message about Arma 3: "Is it possible to make a system that p...

you should use the Unmanaged Exports package to export these:

//--- Called by Engine on extension load 
    __declspec (dllexport) void __stdcall RVExtensionVersion(char *output, int outputSize);
    //--- STRING callExtension STRING
    __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function);
    //--- STRING callExtension ARRAY
    __declspec (dllexport) int __stdcall RVExtensionArgs(char *output, int outputSize, const char *function, const char **argv, int argc);
    //--- Extension Callback
    __declspec (dllexport) void __stdcall RVExtensionRegisterCallback(int(*callbackProc)(char const *name, char const *function, char const *data));
    //--- Engine passed context [steamID, fileSource, missionSourceName, serverName] since Arma 3 v2.11
    __declspec (dllexport) void __stdcall RVExtensionContext(const char **argv, int argc);
```(see https://community.bistudio.com/wiki/Extensions for C# version)

what you need here is the extension callback.

when you receive a POST message, call that callback, which will trigger this event handler:
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#ExtensionCallback
```sqf
addMissionEventHandler ["ExtensionCallback", {
    params ["_name", "_function", "_data"];
}];

and there you can parse the message and for example exec a script

on the SQF side you just need to do callExtension to start listening on an IPEndPoint (or the HttpListener you've done), and also register the "ExtensionCallback" event handler

chrome hinge
#

maybe i just lock the planes direction when it points at target with setdir and make it sweep the gun

azure fern
little raptor
#

the car.sqf in the .dll be read?
it doesn't get read in the dll. the dll just receives the message, and sends it to SQF (via the extension callback)

azure fern
#

sorry for my bad eng

#

How to run the car.sqf file in the mission.pbo file.

#

I'm really bad at scripting.

little raptor
#

here's some pseudo code for example:

this part is from that Extensions wiki page:

public static ExtensionCallback callback;
public delegate int ExtensionCallback([MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string function, [MarshalAs(UnmanagedType.LPStr)] string data);

#if WIN64
        [DllExport("RVExtensionRegisterCallback", CallingConvention = CallingConvention.Winapi)]
#else
        [DllExport("_RVExtensionRegisterCallback@4", CallingConvention = CallingConvention.Winapi)]
#endif
        public static void RVExtensionRegisterCallback([MarshalAs(UnmanagedType.FunctionPtr)] ExtensionCallback func)
        {
            callback = func; // save the callback that Arma gives you, to call it later
        }
                

this part is from your code


if (urlSplit[0].Length > 0)
                        {
                            string cmd = urlSplit[0];
                            string username = parsedPostData["username"] ?? "";
                            string custom = "";

                            if (urlSplit.Length == 2)
                            {
                                custom = urlSplit[1].Trim();
                            }
                            // call the callback (this is just an example and you should validate the data, etc.)
                            callback("myextension", cmd, custom);

....

and in SQF, you execute this code once to register the event handler:

addMissionEventHandler ["ExtensionCallback", {
  params ["_name", "_function", "_data"];
  if (_name != "myextension") exitWith {}; // only handle messages from your own extension
  switch (_function) do
  {
    case "execVM": {execVM _data}; // assuming _data was "car.sqf"
  };
}];
azure fern
# little raptor here's some pseudo code for example: this part is from that Extensions wiki pag...

I'll try it now. I found an example of the system I want to build, but it was made for GTA 5. If you want to check it out: https://github.com/smeysu/GTA5-TikTok-Integration

GitHub

GTA5 Plugin to control GTA5 via Webhook events from TikTok LIVE. - GitHub - smeysu/GTA5-TikTok-Integration: GTA5 Plugin to control GTA5 via Webhook events from TikTok LIVE.

leaden summit
# vapid scarab Hey. Iirc, the inheritance for a combobox isnt complete. You need to set a contr...

Aweseome, I got it under the class for the Combo they all have sqf defaultValue = "''"; expression = "_this setVariable ['%s',_value,true];"; and then in the values I had to add a default "key" for want of a better term, so that looks like```sqf
class Values
{
class small_boom {default = 1; name = "Small"; value = "M_PG_AT"; };
class medium_boom {default = 0; name = "Medium"; value = "IEDUrbanSmall_Remote_Ammo"; };
class large_boom {default = 0; name = "Large"; value = "R_60mm_HE"; };
};


Thanks for the push
azure fern
hasty pond
#

I figured it out, thanks and sorry!

indigo snow
#

well what was it then?

azure fern
#

If I did it right the links were with the script like

little raptor
#

no. it's wrong

crude barn
#

Hey, I’m relatively new to sqf, but I’m posting here because I want to know how I can make johnnyboy’s SOG AI mod run properly on a dedicated server? I’m running my mission on a dedicated server mainly just to get a decent framerate in my ALiVE mission. From my tests, some of the AI functions of the mod work (ordering troops to get in craters/helis, placing mines, burning huts), but all of the wheel commands do not. I looked at the scripts and found one script that I think is responsible for the wheel commands. My guess is that they are getting sent to the server and not replicated back on my client or something like that? So I guess the question would be is it possible to use remoteExec to make the command wheel function on the server?

bleak smelt
#

call compileScript ["trackerCustom.sqf"];

[Area1, vet_fnc_customizeTrackerLoadout] call vet_fnc_onTrackerSpawn;
[Area2, vet_fnc_customizeTrackerLoadout] call vet_fnc_onTrackerSpawn;


``` the [Area1, vet_fnc_customizeTrackerLoadout] call vet_fnc_onTrackerSpawn; works but the second area doesnt
#

do I need a comma or something?

proper niche
#

Does anyone know if it is possible to use setObjectMaterial on armed remote explosives? I am trying to give one a flashing emmisive selection

meager granite
meager granite
#

You'll probably need a dummy object just for effect or something

meager granite
#

yeah, this function is an infinite loop

#

your first call to it ends up with thread doing an infinite loop

bleak smelt
#

how do I set up multiple areas?

meager granite
#

spawn it instead, so its a separate thread with that infinite loop

bleak smelt
#

oooh

#

so

#

call compileScript ["trackerCustom.sqf"];

[Area1, vet_fnc_customizeTrackerLoadout] spawn vet_fnc_onTrackerSpawn;

meager granite
#

yeah

bleak smelt
#

call compileScript ["trackerCustom.sqf"];

[Area1, vet_fnc_customizeTrackerLoadout] spawn vet_fnc_onTrackerSpawn;
[Area2, vet_fnc_customizeTrackerLoadout] spawn vet_fnc_onTrackerSpawn;



#

this better?

left iron
#

im trying to write a script to detect how many buildings are within a trigger area and output the number with a hint once the player enters the area. im very very new at this so it obviously is not working. Here is the script:

{(_this buildingPos [-1] (count [_this]))};
    hint str _this;    
#

im refining the code as i realized that was structured poorly, how would yall tackle this though?

meager granite
#

What is _this?

left iron
#

a trigger covering the area id like it to consider

#

ive also tried "this" with no quotes and i get thrown an uninitialized variable error

#

which is where im at currently, ive moved the code around a bit to :

_buildingsInTown = _this buildingPos [-1]; 
count [_buildingsInTown];
    hint str _buildingsInTown;    

but im still getting the uninitialized variable error for line 1

meager granite
#

Is this a ChatGPT code or something?

left iron
#

no, this is code straight from the mind of a person whos been trying to learn SQF for 3 days

meager granite
#

buildingPos returns certain position or all positions inside a provided building, you don't need it here

#

How do you call your function and where from?

left iron
#

a triggers "on activation: field, right now its sitting right next to where the spawn is for easy testing but eventually these triggers will be copied and pasted all over the towns on the playable map

#

the triggers sits encompassing a town, with "bluefor" and "present" as activation conditions. the on activation field calls the SQF to count the buildings

#

you might be on the money with terrainObjects, ill have to list the type but that might actually give me better control over whats considered

meager granite
#

What's your activation field code exactly?

left iron
#

execVM "townRecog.sqf";

meager granite
#

What are the arguments for execVM?

#

oh wait you can call it without arguments unlike spawn

#

Anyway, triggers are ancient thing and they have a local variable thisTrigger (without the _) for the trigger, not _this

#

You need to pass the trigger that is starting the script as argument

#
[thisTrigger] execVM "townRecog.sqf"
#

Then inside the script you can get the trigger entity with:

params ["_trigger"];
#

Since nearestTerrainObjects only accepts radius and not a more complex shape like a trigger's rectangle or an ellipse, to account for trigger being a rectangle, you'll need to calculate hypotenuse of trigger sides

#

And then narrow down the results to precisely area of the trigger with inAreaArray

#
params ["_trigger"];
triggerArea _trigger params ["_a", "_b"];
private _hypo = sqrt(_a*_a + _b*_b);
private _buildings_near = nearestTerrainObjects [getPos _trigger, ["BUILDING", "HOUSE"], _hypo, false];
private _buildings_trigger = _buildings_near inAreaArray _trigger;
granite sky
#

buildingPos is useful for filtering because Arma sucks at classifying objects, but yeah, nearestTerrainObjects first.

meager granite
#

Then you can do your hint:

hint format ["Buildings in this trigger: %1", count _buildings_trigger];
left iron
#

🀯 ok, ive definately got more stuff to google now, thank you guys

meager granite
#

Just checked and cargo containers have "HOUSE" type

#

So you'll probably want more checks if you want real houses in that array

left iron
#

@meager granite nearestTerrainObjects was the ticket. It’s all very tidy now thank you very much!

granite sky
#

Note that nearestTerrainObjects only picks up objects that are built into the map (mission objects don't count). Hopefully doesn't matter for your use case.

left iron
#

It shouldn’t, this particular instance is meant for areas that the players have not modified extensively. Eventually I’ll build this script out into a system that detects when a player enters an area (right now it’s ~50m blocks) and it will spawn loot off a randomized list as well as control enemy spawning (zombies) on a leveled basis depending on some external variables.

Basically I’ll use this part for Indian country, and I’ll use a different script for player controlled areas that have seen more extensive modification.

meager granite
#

You want to cache your found building into a trigger then as these object lookup commands are relatively expensive

#

Look into setVariable/getVariable

azure fern
clever turtle
#

@burnt grove this discord is English only, see the #rules πŸ˜‰

burnt grove
#

sorry 1 min

#

Hi all!
I want to combine the method of equipping units as in this mission https://file.io/sm3u7rubycsC with DUWS_X
DUWS_X has factions/config/*.sqf
blufor_SOLDIER_LAT_X = "UK3CB_CW_US_B_LATE_LAT"; //initHQ\fnc_HQguards, supports\fnc_paradrop
blufor_SOLDIER_GL_X = "UK3CB_CW_US_B_LATE_GL"; //initHQ\fnc_HQguards, supports\fnc_paradrop

#

In a mission, equipment is initialized from mission.sqm : init="call{[this, ""WEST"", ""YKS""] call Serp_unitprocessor;}";
Any ideas on how to implement this?

shut flower
#

Is here somebody that could pass me the idd of the mp chat? I'm tired of searching in the config viewer :D

patent sparrow
#

Hello and best wishes to all for the new year. Does anyone know how it is possible to edit these sections? Posting a multiplayer mod, I noticed that the description at the bottom carried the text on the Steam page.
https://imgur.com/jNNpyAl

warm hedge
#

What do you mean by carried the text on?

#

And A Multiplayer Mod, what do you mean?

analog mulch
#

Hi
Made custom loadouts for my team and an empty ammo crate. I need the ammo crate to contain a set number of only the weapons and items of the player load outs and nothing else

winter rose
#

or do you want the crate's content to be specific per player

analog mulch
#

No the crate is for everyone

analog mulch
#

Plus takes a wee bit time

winter rose
#

ah well, then you can check 1s after mission start the loadout of everyone and add in this order yes πŸ™‚

patent sparrow
#

I see it happens for other released mods as well, however I guess there is a way to put a description there

patent sparrow
#

Thanks ampersand, so I have to use Config.cpp

#

since there is nothing missing in the Description.ext in this regard

warm hedge
#

After all we would want to check out how is your config

digital hollow
patent sparrow
#

https://imgur.com/a2R5DGj
this is the specific part, until it was released on Steam it worked well, it showed up with text and pictures intended etc. Then it took on the appearance mentioned

warm hedge
patent sparrow
#

this is what it looks like there with bbcode

warm hedge
#

Can you show which is your Workshop item?

warm hedge
#

Oh so it is a scenario not a Mod

patent sparrow
#

Yeah sorry for calling it mod

warm hedge
#

Then it can't be helped

#

It is a whacky Engine implementation

patent sparrow
#

I see. Thanks anyway, I appreciate. I think I have seen so far, among the downloaded scenarios, only Anistati not having the same text as Steam in the Mission Summary

#

so I was wondering if there was a known solution, thanks again

warm hedge
#

Mmmmmaybe I'm misrecalling smth but, for example, which mission doesn't have this issue?

patent sparrow
#

they are actually different πŸ€·πŸ»β€β™‚οΈ

warm hedge
#

No it is the same

#

Maybe some part is cut out for whatever reason, but it is essentially the same issue with you

patent sparrow
#

hmm

#

it's not a big deal anyway, it was more of a curiosity of mine

#

πŸ™„

warm hedge
#

And they didn't fixed this for a decade smh

sharp skiff
#

how can i get the output from
hint str weaponsItems player;
to be logged as a copyable output in the ingame console?(executed in game/mission of course

warm hedge
#

Just weaponsItems player in Debug Console

sharp skiff
#

now i feel dumb! Thx @warm hedge

formal stirrup
#

could also replace hint with copyToClipboard

candid sun
#

24 i believe

sharp skiff
#

even better thx!

near blade
#

Hey ive got a question my script is not working can anyone help me figure out the issue ?

    if (cursorTarget == player) then {
        hint "Player was frozen" && ccursorTarget player
disableUserInput true;
    } else {
        hint "There are no players";
    }
}];
hallow mortar
#

Well, ccursorTarget for one thing

#

But also, it seems unlikely that the player's cursorTarget will ever be...themselves

granite sky
#

yeah I don't know what this is trying to do. maybe isPlayer cursorTarget as the condition, but then you'd need to remoteExec the disableUserInput.

near blade
#

Yeah its not working i don't know how to use the function disableUserInput Theres not to much of it on the wiki

hallow mortar
#

(cursorTarget returns the cursor target of the local machine, and player returns the player unit of the local machine, so you're checking whether the player who did the action is targeting themselves)

near blade
hallow mortar
#

disableUserInput disables input on the machine where it's executed. As the Syntax section describes, it does not accept a target unit to affect.

near blade
#

Cause i wanna make that freeze the player targeted

hallow mortar
#

That's also not how && works. It's a comparison operator for checking whether two things are both true.
I'd suggest doing something a bit more like this:

player addAction [
  "Freeze targeted player",
  {
    params ["_target"];
    [true] remoteExec ["disableUserInput",_target];
    hint format ["%1 was frozen",name _target];
  },
  nil,
  0,
  true,
  true,
  "",
  "(isPlayer cursorObject) && {(_this distance cursorObject) < 500}",
  0,
  false
];
  • only shows the action if the cursor is over a player within 500 metres
  • remoteExecs the disableUserInput to the targeted player's machine
  • displays a hint showing who you froze
    I recommend looking up all the commands used, and carefully reading their documentation to get an idea of how and why this works.
near blade
#

Im gona check the docs and thanks for your time πŸ™‚

hallow mortar
#

That error isn't from the code I posted. You have some other code running somewhere and that code is wrong.

near blade
#

Not displaying the addaction i don't really get it why no error and not displaying

hallow mortar
#

It kind of looks like you're testing in singleplayer.
In singleplayer, nothing you put your cursor over will ever be a player, because there are no other players, so the action won't be shown.

near blade
#

even if not looking at player i wan't the addaction be displayed cause im doing admin menu and like when you activate it all those action would spawn and be removed when disabled

#

Still not working in multiplayer

hallow mortar
# near blade even if not looking at player i wan't the addaction be displayed cause im doing ...

That can be done, I guess.......but why bother showing the action when not looking at a player, if that means nothing will happen when you use it?
BTW, the action showing/not showing because of its condition, is completely separate from the action existing. You can have an action that only shows itself when looking at a player and is added/removed by an admin menu. Both of those things are possible at the same time.

hallow mortar
near blade
#

nope i don't have another person to test on

hallow mortar
#

Well funnily enough, an action that checks whether you're looking at a player doesn't work if you're not looking at a player. So not really a surprise (or a bug) that it's not working, is it?

near blade
#

kinda

knotty gyro
serene sentinel
#

Can someone help. Trying to find if unit have weapon with GL and if there is some explosive shells in the box then give it to unit.....

params ["_unit", "_container"];

_gun_cfg = configFile >> "CfgWeapons" >> _x;
_muzzles = getArray (_gun_cfg >> "muzzles") - ["this", "safe"];
if (count muzzles == 0) exitWith {};

_underbarrel_cls = _muzzles select 0;
_gls = _muzzles select { getText (_gun_cfg >> _x >> "cursorAim") == "gl" };
if (_gls isEqualTo []) exitWith {};
{
_compat_mags = compatibleMagazines _gls;
_HE_compat_mags = {getNumber (configfile >> "CfgAmmo" >> _x >> "indirectHit") > 0};
_GLinbox = (weaponCargo _container) arrayIntersect (_HE_compat_mags );
} forEach _gls; 
_GL = if ((count _GLinbox) > 0) then { selectrandom _GLinbox } else { "" };

Of course, something goes wrong

stable dune
dreamy kestrel
#

Q: about 'releasing' a captive _unit (true) back into the wild, as it were.
I've done that, and subsequently recruited the unit into my group, but he is unresponsive to unit commands.
is there anything else about the unit that I must clear, _unit setCaptive false, for instance, that would free him up to follow commands?
thanks...

granite sky
#

setCaptive doesn't alter their ability to respond to commands.

#

Normally you need several additional commands to make a unit act like a surrendered unit, if that's what you're talking about.

#

setCaptive just sets their side.

dreamy kestrel
granite sky
#

I don't know what "recruiting" means in context.

dreamy kestrel
#

in ARMA terms, simply joining the unit to my group

granite sky
#

Are they the same side as you and the group?

dreamy kestrel
#

they are civilian, but IIRC this has never been a problem before, would respond to commands in other mission scenarios...

#

but I can try a same side unit as well

#

nope that's not working either, but the same blufor unit was also passing through the captive state, so in effect was also civilian.

#

hmm okay so I have created some units, civilian, blufor, apart from everything, they are responsive...
not sure what I did to cause the other units to be unresponsive however.

#

could be something, they have a blue slash in their unit signal. as does mine.

#

I suspect, if I can understand what that is, and undo it, then it will probably be fine

dreamy kestrel
#

no worries if anyone has can some light be shed on what that is please thanks...

#

thinking unit behavior maybe, or combat mode?

#

what effect does setting the animation have on unit commands? playing a move? switching move? and how to clear that aspect?

tired nimbus
#

Hello, does anyone have an easy script that allows me to spawn random loot in crates? I'm working on a custom mission in Eden and it in part relies on a looting aspect, I don't want to manually place loot down. Any help is appreciated

dreamy kestrel
abstract bay
#

Will attachTo help keeping a logo on vehicle?

dreamy kestrel
robust brook
#

But if you really wanted to you could attachTo a 1x1 picture object and setObjText

queen cargo
viral birch
#

I am trying to customize vehicle speeds for my community. I see that maxspeed governs what the vehicle tops out at, but what governs offroad vs onroad speeds, acceleration, etc.?

fair drum
viral birch
left iron
#

im trying to create triggers using the createTrigger command but i suspect im doing it wrong, as all the next step that relies on the trigger does not execute. the code im using is this:

{

        _lootTrigger = createTrigger [(str (random 9000)), getPos _x];
        "Sign_Arrow_F" createVehicle getPos _x;
        _triggerStatement = setTriggerStatements [_x, execVM "itemList.sqf", hint "trigger off"];
        


    }forEach _buildings;
#

am i using the wrong name for it?

#

also _buildings is a valid array containing building locations. I was able to test this by placing markers on all the _buildings locations.

granite sky
#

The blue hashmarks are just combat behaviour STEALTH, IIRC

#

It's on the 7 menu for commanding.

dreamy kestrel
granite sky
#

shrugs

#

just undo whatever you did to the buggers :P

dreamy kestrel
#

wish I knew exactly what that was, other than the things covered here. nothing that I can think of.

meager granite
left iron
#

also was the problem, youre at least half the answer to most of my scripting problems lol

#

@meager granite i have a set of arrays within an array. i pull random arrays out of the set using select, and i have observed each array being pulled at least once successfully. Neither the array nor the set changes, but after every 15 or so (not a precise or consitent number) calls select fails to select an array at all, what might cause that failure?

granite sky
#

you're not using selectRandom?

left iron
#

i am but further down the chain, ill post it

#
_randomSetNF = _itemSets select {_num=round(random[1,2,5]); 
#
(_x select 3)isEqualTo _num;};
_randomSet = selectRandom _randomSetNF;
#

those are the next two line

#

s

#

_itemSets is the large array that contains the sets

outer berry
#

any tips on how to get a unit to move and path on its own ?

#

I never done scripting but I am trying to get my unit with a rifle to move and fight the players but when they see my player it looks and shoots but does not chase

hallow mortar
left iron
#

yup, everything in the array is weighted 1-5 hence the additional layer of select, and each number has at least one array associated with it

#

ill post the array set if you need

granite sky
#

well, how large is it?

left iron
#

13 arrays in the set

#
 ["arifle_AKS_F", 3, "30Rnd_545x39_Mag_Tracer_F",2], 
    ["rhs_weap_akmn", 3, "rhs_30Rnd_762x39mm_bakelite",3],  
    ["arifle_Mk20_plain_f", 3, "30Rnd_556x45_Stanag",3],  
    ["rhs_weap_g36c", 3, "rhssaf_30rnd_556x45_Tracers_G36",3],  
    ["rhs_weap_hk416d145", 3, "rhs_mag_30Rnd_556x45_Mk318_Stanag",3],  
    ["rhs_weap_m14", 3, "rhsusf_20Rnd_762x51_m62_Mag", 4], 
    ["rhs_weap_m249_light_S", 3, "rhsusf_100Rnd_556x45_mixed_soft_pouch",5], 
    ["rhs_weap_M590_8RD", 5, "rhsusf_5rnd_00Buck",2],  
    ["SMG_05_F", 3, "30Rnd_9x21_Mag_SMG_02_Tracer_Red",2], 
    ["rhsusf_weap_glock17g4", 3, "rhsusf_mag_17Rnd_9x19_JHP",1], 
    ["hgun_Pistol_heavy_01_F", 3, "11Rnd_45ACP_Mag",1],  
    ["hgun_Pistol_01_F", 4, "10Rnd_9x21_Mag",1], 
    ["launch_RPG7_F", 2, "RPG7_F",5] 
granite sky
#

I don't understand how that correspends with your code.

left iron
#

thats initialized as _itemSets,

granite sky
#

oh wait, I see.

left iron
#

_randomSetNF selects a weight which gives me a smaller list of pssible arrays

#

_random set pulls from that to give me a randomized item

#

and then spawns a box and spits that array into a box for a player to pick up

hallow mortar
#

Just out of curiosity, if you want weighting, why not selectRandomWeighted?

left iron
#

the correct answer is ill google that, but the real answer is because ive been doing this for 4 or 5 days now and didnt know it existed

#

ill reevaluate how it could fit in though

granite sky
#

And _itemSets is invariant? you're not deleting elements from it?

left iron
#

its not accessed by anything other than _randomSetNF

#

which in turn is only accessed by _randomSet

#

the array its self is static

granite sky
#

oh I see. This is very weird code ;P

left iron
#

haha it could prob be better but its written in a way where i mostly understand it

granite sky
#

It's not guaranteed that _randomSetNF has anything in it.

left iron
#

yea, i added a small patch to fix that, but i dont understand why it wouldnt have something in it if were rounding its selection

granite sky
#

I'm not sure you realise what select does.

#

The code inside the select is run once for each element in the array.

#

If it returns true, that element is included in the output array.

left iron
#

youre right, im not seeing the disconnect

granite sky
#

I think what you're trying to do is just this:

_num = round random [1,2,5];
_randomSetNF = _itemSets select { (_x select 3) == _num };
#

With your version it can just miss on every element if the RNG falls right.

#

Or alternatively, hit on every element.

#

(very unlikely)

left iron
#

how can it come up empty when its given a choice of 5 possible numbers and told to pick between them then round the number?

#

which i think it the heart of my question, i dont understand how that works

granite sky
#

It's checking that value against the current element each time.

left iron
#

alright, im gonna pray on this and do some more googling, thank you for your help!

granite sky
#

God no, just work it through on paper.

#

Consider a trivial array with two elements.

hallow mortar
#

It's re-rolling the value for each element in the array, so which number would result in a hit is different for each element it checks. First element needs a 1 to hit. Second element needs a 3 to hit. ... And because random, they could all be misses.

What you need is to roll once and use the same value for checking every element.

granite sky
#

Run this several times in the debug console. It can generate any of four results: [0, 1], [0], [1], []

_test = [0, 1];
_test select { _num = round random 1; _x == _num };