#arma3_scripting

1 messages ยท Page 214 of 1

pallid palm
#

did you mean something like this ?```sqf
_spawnpos = [_pos, 20, (random 360)] call BIS_fnc_relPos;

modern plank
#

Not very convenient.

modern plank
pallid palm
#

ok cool

hallow mortar
#

Use getRelPos instead of bis_fnc_relPos

proven charm
hallow mortar
modern plank
#

ya all good ๐Ÿ™‚

pallid palm
#

how to wright that @hallow mortar

hallow mortar
#

I imagine if you read the documentation it might tell you

pallid palm
#

oh shit ok lol

hallow mortar
#

This is wrong for other reasons too, but one quickly identifiable way it's wrong is that there are no commands with only a left argument. Commands that only have one argument (unary commands) always have it on the right.

#

Please read the first 7 words of my previous message, and all of the message before that

pallid palm
#

ok

#

yeah now im really lost the documentation is not clr to me

hallow mortar
#

Every command page includes a Syntax section, which clearly lays out the position and type of the required arguments. For some commands it can be complicated because they have many arguments in nested arrays.

getRelPos is not one of those commands. Its Syntax section is quite simple. There are a total of 3 arguments, all with very clear names.

pallid palm
#

oh i see now ok

hallow mortar
# hallow mortar Expansion: same as `getRelPos` except it returns AGLS rather than AGL

@modern plank sorry, I was slightly wrong here. getRelPos has other differences from the getPos alt syntax. It can only work with an object as reference, not a position, and it uses a relative bearing rather than absolute. Those are probably more important differences than the slight difference in return format :U I apologise for getting that wrong.

pallid palm
#

i was thinking that: but what do i know ๐Ÿ™‚

modern plank
split ruin
#

@pallid palm did you manage to make heli transport support to land on a carrier?

pallid palm
#

well yeah kinda did but its more like a hard landing thing i had to remove the fuel at the right time to get it to kinda crash land : but not what i wanted ๐Ÿ™‚

#

lol

#

im still trying stuff tho i may get it ill let you know

#

see i was trying to make the heli land on the front of a Destroyer ๐Ÿ™‚

split ruin
#

AI piloted heli does autorotation on a carrier wow ๐Ÿ˜†

pallid palm
#

yeah that can work ๐Ÿ™‚

#

im also useing my chopper command scripts to make this all happen ๐Ÿ™‚

#

but i bet it will be way easyer to land on the back of the Destroyer or carrier ๐Ÿ™‚

#

using alt key to raise or lower the pad can help lots

split ruin
#

I used alt to change pads position vertically and its on the deck technically but AI does not detect it at all and is just hovering

pallid palm
#

yeah i found that chopper does not hover where you need it to over water

#

it falls short of the pad over water

#

wounder why that is

hallow mortar
pallid palm
#

@split ruin so in my chopper command it allows you to take over the controls from the Co-pilot seat and land the chopper your self: and then release the controls after you land the chopper: and then your free to call the chopper at anytime after that

#

so the chopper will pick you up anywhere on the map and fly you to the carrier: even on water extraction: then make sure your in the Co-pilot seat: so you can land the chopper: but insertion from the carrier can be funny only caz the chopper wont land back on carrier after insertion

#

if there is no one in the Co-pilot seat to land the chopper

#

so thats the part im working on now

#

oh and btw i just came up with a: Awsome Diver under water patrol script: can be set to any depth for the divers to swim at: and they patrol at that depth: and if they see you they Attack you its cool ๐Ÿ™‚

#

btw over land the chopper command works perfect or hover over water @split ruin would you like a demo mission of my chopper command

thin fox
pallid palm
#

oh nice

versed ledge
#

I spent the last month messing with helicopters landing on ships. It was primarily using simplex support but also alive and ai with waypoints. Nothing seemed to work consistently until I tried using deformer to flatten an area to place the fleet. Placing all the ships above a flat spot 25m deep below the surface did it. They work consistently for me now.

split ruin
#

@pallid palm actually that diver script is something I can use it in the upcoming mission if you care to share ๐Ÿป

hushed turtle
#

I just found out that remoteExec and remoteExecCall were added in version 1.50. How did people even scripted multiplayer before? ๐Ÿ˜†

shy siren
#

i want to make a script that finds entities in the mission minus modules, ai, turrets, drones and submarines. this is what i have so far but i can't figure out the class name for turrets, drones, and submarines. any ideas or common name lists for the iskindof command?
entities [[], ["Logic","Man"], false ,true]; // returns [helo,car,quad,boat,arty,apc,antiair,tank,drone,sub,turret,plane]

hallow mortar
granite sky
#

I would guess that BIS_fnc_MP worked with public variable event handlers as the underlying mechanic.

hallow mortar
#

Well, we can find out, it's still in the game (do not take this to mean you should use it)

#

Nope, they've replaced the contents with a remoteExec implementation

hushed turtle
#

I guess way more logic had to run on all machines in older titles, compared to how now, you can just run most of it on the server and then just tell clients what to do.

hushed turtle
#

publicVariable is a thing since OFP and public variable EH since Arma 1. So you could execute function based on variable change for example

proven charm
#

i think BIS_fnc_MP was arma 2

split ruin
#

any script way to mute players characters, they always hint where enemies and vehicles are and are very annoying ๐Ÿคข

tulip ridge
#

setSpeaker(?) to NoVoice

thin fox
molten yacht
#

Does anyone have a script lying around for adding a damage handler to a thing that only allows certain weapons to damage it?

#

I'd like to harden these SAM sites against anything that isn't a demo charge.

molten yacht
#

Yes, that's the documentation there, which is not what I asked about.

#

I wondered if someone already had one I could modify to avoid needing to go from scratch and make from-scratch mistakes.

granite sky
#

Well, your first hurdle is defining a demo charge.

#

Because Arma doesn't :P

#

We're currently using getText (_ammoCfg / "mineTrigger") == "remotetrigger" but that might not work for some ACE-specific charges.

tulip ridge
#

Should be >>, / is slower for whatever reason

granite sky
#

more valid inputs, so I guess that makes sense

#

Oddly enough, everything else in this file uses >> and I'm fairly sure I wrote all of it :P

molten yacht
#

hmm

molten yacht
#

Because I also have the luxury of defining the arsenals.

tulip ridge
#

You could just check the type of the projectile, which would be the CfgAmmo class

pallid palm
#

@split ruin oh sure m8 i can send you the Diver patrol script

#

i'll put all the where how/s and how do's: in the top of the script then ill send it to you ok m8

pallid palm
#

@molten yacht```sqf
// here you go m8: If I Remember Correctly
this addEventHandler ["HandleDamage",{
((_this select 4) == "SatchelCharge_Remote_Ammo")
}];

molten yacht
#

Thanks, I'll try that.

edgy dune
#

not sure where to put this, but wat was the video setting to change when using BIS_fnc_exportEditorPreviews to not cause image preview screenshot from being so bright?

edgy dune
#

wat a weird thing to do I keep forgetting about that lol

#

ty

split ruin
#

vehicles paradrop script attempt ... it moves the player but not his vehicle

_veh addAction
[
    "<t color='#FF80FF'>Paradrop Vehicle</t>",
{
    params ["_target", "_caller", "_actionId", "_arguments"];
    openMap true;
    onMapSingleClick "
    openMap false;
    [(objectParent _caller),1500,_pos] call BIS_fnc_setHeight;
    onMapSingleClick '';";
},nil,3,true,true,"","true",3,false,"",""
];
haughty hare
proven charm
#

@kiba that's weird because _caller shouldnt be available in onMapSingleClick ?

stable dune
proven charm
#

that explains why player moves

stable dune
#
this addAction
[
    "<t color='#FF80FF'>Paradrop Vehicle</t>",
{
    params ["_target", "_caller", "_actionId", "_arguments"];
    openMap true;
    onMapSingleClick "
    systemChat format ['in map single click player veh pos :%1' , getPosATL objectParent player];
    openMap false;
    [objectParent player,1500,_pos] call BIS_fnc_setHeight;
systemChat format ['in map single click player veh pos :%1' , getPosATL objectParent player];

    onMapSingleClick '';";
},nil,3,true,true,"","true",3,false,"",""
];
#

You can use in addaction -> player , because addaction statement is local and player is local.

split ruin
#

@proven charm now its working ... I have the vehicle dropped from needed height

_veh addAction
[
    "<t color='#FF80FF'>Paradrop Vehicle</t>",
  {
    params ["_target", "_caller", "_actionId", "_arguments"];
    openMap true;
    onMapSingleClick
    "
        openMap false;
        [vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
        onMapSingleClick '';
    ";
  },nil,3,true,true,"","true",3,false,"",""
];

now I need the parachute part ๐Ÿ˜‚

#

gives "expected bool" error ๐Ÿ˜ญ

_veh addAction
[
    "<t color='#FF80FF'>Paradrop Vehicle</t>",
  {
    params ["_target", "_caller", "_actionId", "_arguments"];
    openMap true;
    onMapSingleClick
    "
        openMap false;
        [vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
        onMapSingleClick '';
        _chute = createVehicle ['B_Parachute_02_F', (getPosATL   (vehicle player)), [], 0, 'FLY'];
        _veh attachTo [_chute, [0, 0, -1.3]];
        waitUntil { sleep 1; isTouchingGround (vehicle player)};
        detach _veh;
    ";
  },nil,3,true,true,"","true",3,false,"",""
];
proven charm
#

dunno but, _veh defined? waitUntil allowed there?

split ruin
#

@proven charm yeah, now its working until the waitUntil part, it doesn't want to allow it in this context, I need condition to detach the parachute ...

_veh addAction
[
    "<t color='#FF80FF'>Paradrop Vehicle</t>",
  {
    params ["_target", "_caller", "_actionId", "_arguments"];
    openMap true;
    onMapSingleClick
    "
        openMap false;
        [vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
        _chute = createVehicle ['B_Parachute_02_F', (getPosATL (vehicle player)), [], 0, 'FLY'];
        (vehicle player) attachTo [_chute, [0, 0, -1.3]];
        waitUntil { sleep 1; isTouchingGround (vehicle player)};
        detach (vehicle player);
        onMapSingleClick '';
    ";
  },nil,3,true,true,"","true",3,false,"",""
];
knotty totem
#

does using a server profile name space to store mass data (like ingame report with variables hosting an array) can cause performance issue?

knotty totem
warm hedge
#

Unless you intensely save/load every frames/seconds etc, no, just store it won't do any performance issue

knotty totem
#

sounds great, edited for privacy reasons
So it won't have issue?

split ruin
#

now its working perfectly, thanks @knotty totem and @proven charm ๐Ÿฅณ

_veh addAction
[
    "<t color='#FF80FF'>Paradrop Vehicle</t>",
  {
    params ["_target", "_caller", "_actionId", "_arguments"];
    openMap true;
    onMapSingleClick
    "
        openMap false;
        [vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
        chute = createVehicle ['B_Parachute_02_F', (getPosATL (vehicle player)), [], 0, 'FLY'];
        (vehicle player) attachTo [chute, [0, 0, -1.3]];
        _handleParadrop = 0 spawn
        {
            waitUntil {(position (vehicle player) select 2) < 0.5 || isNull chute};
            detach (vehicle player);
        };
        onMapSingleClick '';
    ";
  },nil,3,true,true,"","true",3,false,"",""
];
warm hedge
knotty totem
proven charm
#

I use missionProfileNamespace to save my mission and havent got issues. I used profilenamespace first but changed it

warm hedge
#

Technically, if it does, you can easily observe it by having intense amount of garbage data into profileNamespace even in SP

hallow mortar
serene olive
#

I want to part of the map (incuding a marker) on a Screen ("Land_TripodScreen_01_large_F").
I want to center it around a moving object (e.g. a car to follow)

Is this even possible?

tulip ridge
#

UI on Tex

finite bone
#

This is a POC that was posted couple of years ago. Works great in single-player but in MP, it will be a slideshow for everyone looking at the map, (if you look somewhere else, it will be fine)

if (!isNil "mapboard_1") then { deleteVehicle mapboard_1 };
mapboard_1 = createVehicle ["Land_MapBoard_F", [19986.6, 16985.5, 10], [], 0, "CAN_COLLIDE"];
mapboard_1 setPosASL [19986.6, 16985.5, 3.9];
mapboard_1 setDir 180;
publicVariable "mapboard_1";
mapcenter_1 = [10641.9, 9292.85, 0];
publicVariable "mapcenter_1";
{
    mapboard_1 enableSimulation false;
    mapboardtexture_1 = "map";
    mapboard_1 setObjectTexture [0, format["#(rgb,2048,2048,1)ui('RscDisplayEmpty','%1')", mapboardtexture_1]];
    onEachFrame {
        private _displays = [
                findDisplay mapboardtexture_1
        ];
        if ( _displays findIf { isNull _x } < 0 ) then {
            mapdisplay_1 = _displays;
            {
                private _map = _x ctrlCreate ["RscMapControl", -1];
                _map ctrlMapSetPosition [0.2, 0.2, 0.6, 0.6];
                _map ctrlMapAnimAdd [0, 0.1, mapcenter_1];
                ctrlMapAnimCommit _map;
                _x setVariable ["map_1", _map];
                private _marker_color = (["ColorBlack", "ColorGrey", "ColorRed", "ColorBrown", "ColorOrange", "ColorYellow", "ColorKhaki", "ColorGreen", "ColorBlue", "ColorPink", "ColorWhite", "ColorWEST", "ColorEAST", "ColorGUER", "ColorCIV", "ColorUNKNOWN", "colorBLUFOR", "colorOPFOR", "colorIndependent", "colorCivilian", "Color1_FD_F", "Color2_FD_F", "Color3_FD_F", "Color4_FD_F", "Color5_FD_F", "Color6_FD_F", "ColorHBarrier", "ColorHungar", "ColorCargo", "ColorHighway", "ColorMainCity", "ColorDirtRural", "ColorSlumBlue", "ColorSlumBlack", "ColorHedge", "ColorTankRust", "ColorWoodenPlankPine", "ColorWoodenPlankKauri", "ColorWallCityOrIndustrial", "ColorWallVillage", "ColorShed", "ColorShedTanoa"] select (_forEachIndex % 43));
                _map setVariable ["color", getArray(configFile >> "CfgMarkerColors" >> _marker_color >> "color")];
                displayUpdate _x;
            } forEach mapdisplay_1;
            onEachFrame {
                {
                    private _map = _x getVariable "map_1";
                    _map ctrlMapAnimAdd [0, 0.1, mapcenter_1];
                    ctrlMapAnimCommit _map;
                    displayUpdate _x;
                } forEach mapdisplay_1;
            };
        };
    };
} remoteExec ["call", [0,-2] select isDedicated, mapboard_1];
tulip ridge
# serene olive I want to part of the map (incuding a marker) on a Screen ("Land_TripodScreen_01...

Stripped down version of some UI to Tex stuff from my mod

if (isNull (findDisplay "YourPrefix_mapDisplayScreen") then {
    _object setObjectTexture ["screenCamoName", "#(rgb,1024,1024,1)ui('MapDisplayClassName','YourPrefix_mapDisplayScreen','ca')"];
};

// Seems to take four frames to create display for local units, and six for remote
[{
    !isNull (findDisplay "YourPrefix_mapDisplayScreen");
}, {
    params ["_object"];

    private _display = findDisplay "YourPrefix_mapDisplayScreen";
    displayUpdate _display; // Updates display on the texture
}, _object] call CBA_fnc_waitUntilAndExecute;
tulip ridge
finite bone
#

Its only a PoC based loosely on some vivid imagination kmao but worked great

serene olive
granite sky
serene olive
#

@tulip ridge @finite bone : I merged both of your code for a proof of concept.
This is nearly ok (I just need to figure our some resolution issues):

params["_screenObject","_centerObject"];

// For testing override functions params with cursorTarget and player
_screenObject = cursorTarget;
_centerObject = player;

_mapCenter = getPosATL _centerObject;
_mapTexture = "Screen_0_Texture";
_screenObject setObjectTexture ["Screen_0", format["#(rgb,2048,2048,1)ui('RscDisplayEmpty','%1')", _mapTexture]];

[{
    params ["_mapTexture","_mapCenter"];
    ! isNull (findDisplay _mapTexture);
},{
    params ["_mapTexture","_mapCenter"];
    private _display = findDisplay _mapTexture;
    private _map = _display ctrlCreate ["RscMapControl", -1];
    _map ctrlMapSetPosition [0.2, 0.2, 0.6, 0.6];
    _map ctrlMapAnimAdd [0, 0.1, _mapCenter];
    ctrlMapAnimCommit _map;
    displayUpdate _display;
},
[_mapTexture, _mapCenter]] call CBA_fnc_waitUntilAndExecute;
river plaza
#

Can anyone help me with why my pbo isnt loading OGGs

#

but when i do

if (fileExists "sounds/AnNirana.ogg") then { hint "VFS: OGG exists"; } else { hint "VFS: OGG MISSING"; };

it says its missing

#

they are all vorbis

stable dune
#

if you are looking from xx mod ->
you need use prefix , assume yours is QamarSounds ->

fileExists "QamarSounds\sounds\AnNirana.ogg"
#

And which program do you use to pack your mod?

river plaza
#

arma 3 tools

river plaza
#

does \ or / matter?

#

its loading the classes too because i've ran a check for that. Its just the OGG's

#

CURRENT

class SuratAlMaun {
        name = "SuratAlMaun";
        sound[] = {"sounds/SuratAlMaun.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };```
Will this fix it below?
```cpp
class SuratAlMaun {
        name = "SuratAlMaun";
        sound[] = {"QamarSounds\sounds\SuratAlMaun.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };```
tidal iron
river plaza
tidal iron
river plaza
#

so absolute path is just putting a \ in front?
Sorry for my ignorance im very new to this. First mod

river plaza
#

ok

river plaza
tidal iron
river plaza
#

yea under zeus

#

the play sound module

tidal iron
# river plaza the play sound module

I am sorry, I am not familiar with zeus modding, but probably it has to be listed in some configuration of zeus, probably extend its configuration in your mod.

river plaza
#
class CfgSounds {
    sounds[] = {};

    class AnaMaradun {
        name = "AnaMaradun";
        sound[] = {"QamarSounds\sounds\AnaMaradun.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class AhmedTahoun {
        name = "AhmedTahoun";
        sound[] = {"QamarSounds\sounds\AhmedTahoun.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class BaqayaalMajd {
        name = "BaqayaalMajd";
        sound[] = {"QamarSounds\sounds\BaqayaalMajd.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class ElDjihad {
        name = "ElDjihad";
        sound[] = {"QamarSounds\sounds\ElDjihad.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class AnNirana {
        name = "AnNirana";
        sound[] = {"QamarSounds\sounds\AnNirana.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class AlAraf {
        name = "AlAraf";
        sound[] = {"QamarSounds\sounds\AlAraf.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class Surah47 {
        name = "Surah47";
        sound[] = {"QamarSounds\sounds\Surah47.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class SuratAlMaun {
        name = "SuratAlMaun";
        sound[] = {"QamarSounds\sounds\SuratAlMaun.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };

    class JihadKi {
        name = "JihadKi";
        sound[] = {"QamarSounds\sounds\JihadKi.ogg", 1, 1};
        titles[] = {};
        soundClass = "Qamar";
    };
};```

I thought thats what this did as its the sound class instead of the music class
modern plank
#

Hello, looking for a side teleportation respecting squads, to have something like in the drawing. I know how to do it manually, but is there any function doing a similar thing? Cause I guess we all have the same needs, here for mass teleportation. Not to reinvent the wheel.

hazy temple
#

How do i make so this works with _KeyDown instead of _actionText ? Want to bind it to the "9" key on the keyboard.

#

_actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};

#

This is the hole file

pallid palm
#

something like this maybe ?

#
if (!hasInterface) exitWith {};
//Micro-optimization
private _player = player;

{_player setPosATL (getMarkerPos "Homebase")} forEach nearestObjects [_player,[],2];
//ok hows that lol
#

not tested

fair drum
#

!quote 5

lyric schoonerBOT
modern plank
errant jasper
#

There is no reason to have the forEach, either.

modern plank
#

The crappy implementation but written in one shot and working fine is that shit:

#

I have all my groups regouped behind the TV, the SL separated... all moved on a simple marker. (A few items are generated with BIS_fnc_objectsMapper). Tested with all AI, but in the end only humans groups will be TP.

pallid palm
#

ok hmmm

warm hedge
#

Small nitpicks:
_all_groups = nil is dangerous (not really) if it fails to initialize anyways. I guess [] is better so forEach won't complain
% 360 is not needed in this context
_forEachIndex can be your friend if you use it properly

hazy temple
#

Like this?

#

_keyDown = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"};
player addAction [_keyDown, CHVD_fnc_openDialog, [], -99, false, true];
player addEventHandler ["KeyDown", "if (_this select 1 == 10) then player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]"];

warm hedge
#
  1. What is redactor
  2. Deoends on the vehicle model. Some have one, some don't
haughty hare
warm hedge
#

It is Eden Editor, not redactor. Use the correct term to ask.

  1. What is wrong with that composition that already is a part of Eden Editor?
  2. animationNames command and check animationSources config class to check potential animations
haughty hare
haughty hare
warm hedge
#

So you want to preview while you are in Eden Editor, that is the question, not how to apply in game

vagrant cedar
#

@haughty hare have you looked at deformer? If there is a lot of area that needs to be changed then I think that might be a better option for you

haughty hare
vagrant cedar
hushed turtle
#

There is something really strange about radius of addWaypoint command. On Virtual Reality terrain with no objects around, it does produce good results, but in towns... that's something man.

Take a look at a following code. I would expect this to evenly distribute all the 1000 waypoints in 300 metres radius. Instead it seems to put waypoints in some places and in some just doesn't, even on multiple runs. Sending La Trinite from Malden 2035 and Camp Rogain from Stratis on screenshots as examples.

for "_i" from 0 to 999 do
    { group player addWaypoint [ player, 300 ]; };

I'm better of counting waypoint's position in radius myself:

for "_i" from 0 to 999 do
{
   private _pos = player getPos [ random 300, random 360 ];
   group player addWaypoint [ _pos, 0 ];
};

Only advantage of addWaypoint's algorithm is not putting these waypoints in sea.

I've kinda learned this the hard way, since I was using Seek and Destroy waypoint, which by itself makes units to move within radius, it took me quite some time to realise this.

hushed turtle
#

The example in middle on the first picture looks great. I might update my function to behave just like that.

#

I thought example on the left would be even distribution

proven charm
granite sky
hushed turtle
#

Yeah, I've just changed it in my function

granite sky
#

Oh, Hypoxic answered the same thing :P

serene olive
dim token
#

Hi folks. I'm struggling with timing issues around player object initialization. Other than XEH init handlers, what's the earliest place to hook into (player) objects? JIP queued stuff seems to run before initPlayerLocal.sqf but not reliably AFAIK.

frail skiff
#

Hallo, had a question about unitPlay. I've recorded a tank moving around at 100 FPS and got around 60 after lag reduced the quality of the recording.

I've pre-processed the data in init.sqf using

movementData = call compile preprocessFile "tankMov.sqf";

Playing it back however, the tank still jitters quite a bit, though it's not as bad as if I were to play the whole recording without pre-processing it

Is there a way to reduce the stutter/jitter further? Thanks in advance

elfin turtle
#

I'm publishing to the workshop. It requires several addons. How do I make it require those addons in the workshop

tulip ridge
#

Not sure if publisher has a way to set required mods

elfin turtle
#

Some PBO files were included outside of addons folder

#

IDK what this means

#

It's an AU Extender

indigo snow
#

their init fields are ran pretty early

granite sky
#

Antistasi extenders were a mistake :/

elfin turtle
#

Sorry what?

granite sky
#

You shouldn't have PBOs outside the addons folder. I don't know why you have PBOs outside the addons folder. I think the correct channel for Publisher is #arma3_tools anyway.

#

But the general problem with Antistasi extenders is that we made it look like you could create an Arma mod without knowing how to create an Arma mod :P

#

this is not actually true.

elfin turtle
#

Huh

#

What

#

IDK even know what's going on?

#

What are you even saying?

blissful current
#

Thoughts on organization, folder structure, etc?

winter rose
#

all good, but # - name.sqf/txt, dafuq? ๐Ÿ˜„

blissful current
#

I put the # there to order those from top to bottom, sorted by importance.

#

I have my to-do list which helps me stay on track. I like it in VScode because it's easy to see at a glance but I also hate it for some reasons. For example, I have to manually hit return to start a new line instead of it automatically doing it in google docs.

modern plank
#

Short one: How to find the index of an element into an Array ? I would like something like (groups (player side)) indexOf (group player) to know that the the player group is the 3rd one for example. (I guess groups returns always the elements in the same order).

tulip ridge
modern plank
#

thank you, this one doesn't want to stay in my mind!

hushed turtle
dim token
#

Can you set the init field without editing the mission, just out of curiosity? TBH, I hadn't considered just adding to the init field in the mission but now that you've said it, that is the easiest thing to do.

hallow mortar
#

The "automatic new line" in Google Docs isn't a real new line, it's just visually constraining the line (wrapping) to fit the width of the document. If you paste the same line into an environment with no width restrictions, you'll see it's still actually all the same line (no newline character)

queen cargo
hallow mortar
#

Google Docs is designed for making documents that can be printed on paper, or look like they're on paper, so it follows paper restrictions. Code has no such restrictions, and since the presence of a real new line can be actually important for parsing (not so much in SQF but in some languages), code editors typically don't do wrapping.

hushed turtle
#

I have wrapping in .md files, but that maybe because I have Markdown All in One extension

errant jasper
#

For real code, typically there is a formatter to rearrange lines, often to max column width, and using visual wrapping could even perhaps be misleading.
But for text-primary formats like markdown it make sense to wrap IMO.

queen cargo
#

๐Ÿ˜ƒ

dim token
#

I'm familiar with the contents of that link. So there are no techniques beyond either XEH init handler and init field to initialize objects before JIP queue is processed?

blissful current
#

Is there any difference performance-wise between these?

remoteExec ["FoxClub_fnc_deleteAchievementTriggers", 2];
remoteExec ["FoxClub_fnc_delAchieveTrigs", 2];

One is easier for me to read, but I don't want to negatively affect anything.

hallow mortar
#

Technically there is a small performance effect from longer names. But it is very small, you'd have to be going much bigger for it to be worth caring about.

blissful current
#

deleteVehicle is a GA, so why do I have to use remoteExec like my previous post to delete some server-only triggers?

hallow mortar
#

A server-only trigger only exists on the server. Other machines don't know it exists and have no reference to it.

blissful current
#

But the trigger is stored in a global variable:

deleteVehicle trgCompleteTaskPerfect;

So even the client sees the variable, so it should be able to delete it, no? When I check what it contains, it doesn't go from empty detector to objNull unless I remoteExec it.

hallow mortar
#
  • Global scope variables aren't necessarily network global variables. Global scope just means every script on the machine can access it.
  • Even if a variable is network global, it can still contain things that aren't necessarily valid on every machine
blissful current
#

Ah, so when I create the trigger on the server like this:

trgCompleteTaskPerfect = createTrigger [
    "EmptyDetector", // type
    objNull, // position
    false // makes global
];

Even though it is global scope the client doesn't see it. So deleteVehicle trgCompleteTaskPerfect; from the client does nothing?

thin fox
#

Like Nikko said, in that example, only the server "knows" that variable

#

unless you publish it to the clients as well

hallow mortar
#

In this case, publishing it to the clients may not be enough, because it's a server-only trigger, and trying to tell other machines about an object reference that doesn't exist for them might not go well

winter rose
#

in that case (if you publicVariable it), the variable is objNull on clients, iirc

blissful current
winter rose
#

one thousand and one

jade abyss
#

init.sqs <-- what? Is realy someone that kind of masochist to still use that?

queen cargo
#

it still exists

hallow mortar
queen cargo
#

and there are still ppl in here who do SQS

jade abyss
#

Oh boy

queen cargo
#

also ... to get in front of the sqf

#

there is no other way ๐Ÿ˜ƒ

jade abyss
#

๐Ÿ˜„

thin fox
jade abyss
#

RemoteExec: scheduled enviroment or un-scheduled?

still forum
#

scheduled, RemoteExecCall unscheduled

jade abyss
#

thx4Info

jade abyss
#

@queen cargo Yeah, found that later also. Thx anyway

dim token
#

Is there any reason to use BIS_fnc_MP now that remoteExec and remoteExecCall are available? As I understand it, the former is just a wrapper around the latter now.

queen cargo
#

yes

#

if you got old scripts and are too lazy to upgrade em

#

then you should continue using BIS_fnc_MP

#

in all other cases: no

dim token
#

I should have clarified, when writing new scripts ๐Ÿ˜›

queen cargo
#

and due to the fact that you never touched the old scripts when youre lazy: no you should never ever use BIS_fnc_MP again

dim token
#

๐Ÿ‘

placid root
#

haha since a are right at the subject :[{ hint "This hint is really strangely executed." },"BIS_fnc_spawn",_player] call BIS_fnc_MP; is senceless if _player == player am i right?

queen cargo
#

why should it be senseless?

placid root
#

ok the i didn't get it quite right. is spawns a hint where player is local?

dim token
#

It looks like it to me @placid root, but I'm still somewhat noob.

queen cargo
#

actually, it should spawn the code in a scheduled env

#

thus thats equal to _this spawn {_this spawn {...}}

placid root
#

but since the player runs the code anyway i can just replace it with a hint can't i?

dim token
#

I think the take away is that if you're passing an arbitrary code block for remote execution, you have to wrap it with a function, but if it's an existing command or function, you don't need the extra spawned environment.

#

So in your example, you could just call hint directly.

opal ember
#

Does anyone know how I can move a unit that I created using create3DENEntity into a vehicle that also has been created using create3DENEntity?
I'm trying for hours now and nothing works.

warm hedge
#

Well, just drag and drop? Otherwise you are doing something wrong

opal ember
#

okay I notice I forgot to mention that I need to do it using a script (i'm creating a mod that needs that)

warm hedge
#

Now that's a good question ๐Ÿค”

opal ember
#

In Zeus it would just be moveInDriver but that does not seem to work in Eden

placid root
#

i am just looking through the code of http://www.armaholic.com/page.php?id=30336 and i am wondering about the execution, since every command is run by the player and remoteExecuted where the player is local. so it seems to me the remoteExec is sensless

#

or bis_fnc_mp in this script

#

(well not every, but a lot of them)

queen cargo
placid root
#

always a pleasure chatting with you x39 ๐Ÿ˜—

queen cargo
#

Kind of my job ๐Ÿ˜„

placid root
#

just thought maybe i missed something obious.

dim token
#

Would have to dig into it to comment further, but maybe it was an issue where the script with the remoteExec calls wasn't only being executed in the same locality as that targetted by the remoteExec.

jade abyss
#

@queen cargo
if you got old scripts and are too lazy to upgrade em <--- Also not rly needed, since it will (or is already?) implemented for the bis_fnc_mp)

queen cargo
#

and due to the fact that you never touched the old scripts when youre lazy: no you should never ever use BIS_fnc_MP again
@jade abyss

jade abyss
#

remoteExec == bis_fnc_MP

#

(again: Not so sure if already in or not, haven't checked it yet)

#

backwards compatibleblebleble

proven charm
#

no incapacitatedState EH? ๐Ÿค”

hushed turtle
#

Let's say I want to get class of whatever unit I want. For example NATO pacific sniper. Can I somehow reach by something like: "blufor -> nato -> pacific -> specials -> sniper" or do I just have to know his class?

warm hedge
#

Why you have to know the class is one question

#

And... no, that's not usually how it works

hushed turtle
#

To spawn him. I guess the only way, is to save classes I want to use in array or hashmap

proven charm
rain void
#

how to delete customWaypointPosition? frogthinking

proven charm
warm hedge
#

You can't, AFAIK

#

As you can't even set it via a command

rain void
#

And what is responsible for displaying it on the map? Can it be completely removed from the map?

warm hedge
#

Engine has the responsibility. I don't think we can mess with it

winter rose
#

force a difficulty setting

warm hedge
#

Mmmmaybe

proven charm
#

maybe its a control?

hushed turtle
#

Group doesn't even need any waypoints, if any player is leader

proven charm
primal trench
#

How do I return a list of config items that start with a certain prefix?

proven charm
#

like this ```
"((configname _x) select [0,3] ) == 'O_A' " configClasses (configFile >> "CfgVehicles")

primal trench
#

That'll pull all O_A_ config classes from cfgVehicles?

proven charm
#

it should

rain void
#

it faster

"(configName _x find 'B_') isEqualTo 0" configClasses (configFile >> "CfgVehicles");
still forum
still forum
tulip ridge
queen cargo
#

im a ghost ๐Ÿ‘ป

jade abyss
#

๐Ÿ˜„

#

Saved for eternity!

tough abyss
#

AHHHHH DSCHA!

#

lol

jade abyss
#

๐Ÿ˜„

tough abyss
#

I just read that after I finished deleting them all ๐Ÿ˜ข

#

bahaha

jade abyss
#

hehe

tough abyss
#

compatiblebleblebleble?

#

new world?

#

or new engine command from BIS?

#

Kappa

jade abyss
#

Yeah

tough abyss
#

word*

still forum
# hushed turtle There is something really strange about `radius` of `addWaypoint` command. On Vi...

I finally found what we use PaperCar for! XD
It basically does a findFreePosition, that would fit a paper car.
A car doesn't fit inbetween buildings.

The search is based on grid cells, and then within the cells.

It tries to avoid water, deep water fullyblocked, shallow water might be acceptible.
It skips cells that are "full of objects", for that it sums the area of the buildings and objects, and if larger than 90% then its "full", but only if the full cell doesn't have any roads.

Gradient is blocked, gradient greater than 6... uh ๐Ÿคท

So some of the town cells will probably be excluded because too full.
Your first image is probably "too steep"
The rest will be due to not being able to find a spot that fits a car.

#

(That might be able to go onto the wiki page)

#

findEmptyPosition command with default vehicle type would simulate the "within cells" search.
It's missing the exclusion criteria for water/full/gradient though

hushed turtle
#

In Camp Maxwell it was even more ridiculous, since 200 m radius would result in placing all waypoints at the same spot right next to me. Same in jungle on Cam Lao Nam, 300m radius and all waypoints were right next to me ๐Ÿ˜†

#

Wiki page update would be appreciated. Who would expect behaviour like that?

#

I guess it's pretty good for land vehicles though

#

Since it finds position where vehicle can drive

smoky frost
#

Good morning/afternoon/night.
I want to change factions in Liberation but i don't seem to find the mission folder, i see through Arma files and user files but the mission folder is not there or no files

smoky frost
foggy stratus
#

When player throws a grenade, the top action in action list becomes active and displays at center of screen. Is that normal? It's distracting, and actions should only appear if using scroll wheel. What causes that, and how do I prevent it?

granite sky
#

These are player actions that are always visible, or what?

foggy stratus
#

Player actions, and its an action my mod has created for player. I'm going to set its priority down to see if it stops happening, because after this action performed and it disappears I throw more grenades and the other actions in action menu do not pop up in the center.

#

SOLVED: It was created by Hold Acton, and I need to set "BOOL - show on screen" to false.

tidal idol
#

Are there any recommendations for/against putting a function call in a condition for a userAction? I'm looking to replace a condition = "player == this turretUnit [-1] && BigMessOfCode"; with a condition = "player == this turretUnit [-1] && [this turretUnit [-1]] call MyFunctionTag"; assuming my function returns a true/false

warm hedge
#

As you might already guessed a condition is just an SQF, so no, there is no (at least significant) downside

old owl
#

Never used a userAction but if it works the same as the addAction command the only real draw side I can think of is that you could potentially be negatively impacting client performance as the condition is ran on every frame. For the sake of any ol object probably won't matter if what you're calling isn't an intensive script but if you're running that on the player then it'll be running every frame all the time

tulip ridge
#

Most function calls in conditions can be lazy eval'd

#

The times I've bothered to check the perf it's always been better to lazy eval

old owl
#

This is kinda more nitpicky and doubt it matters but could also probably use preprocessor to toString your function and use that for the condition. Then use Darts suggestion to lazy eval to reduce checked code

#

Oh wait

#

Seeing you have a condition before that function- I guess better to just lazy eval that as Dart was meaning- missed that- no need to toString

tulip ridge
#

Why would you use toString, it's config

old owl
#

My thought was to avoid the usage of call of the function on every frame. I didn't realize he had a condition before that- doing lazy eval with that as you mentioned would be better. On my phone so just didn't see it yap

tulip ridge
#

What do you think that would resolve?

Using call every frame isn't the issue, it'd be checks in the function itself that would be the issue if there was a perf hit from running the code

old owl
#

I'm aware that's why I said in combination and that it was nitpicky. Really was just thinking out loud. Thought process was:

toString TAG_fnc_functionName

Is faster then:

"call TAG_fnc_functionName"
granite sky
#

No-parameters call is very quick. Parameters version is a bit slower. Note that using CfgFunctions by default adds a lot of extra boilerplate to the function (scriptname etc) that you might want to disable.

old owl
#

Hadn't thought of that- also true catnod

tulip ridge
granite sky
#

Whether it's worth worrying about is another matter. UserActions and addActions likely don't touch the condition unless you're looking at or crewing the object.

tulip ridge
#

They still run when not looking at it / crewed

old owl
#

I really need to look into CBA sometime. You guys always make it sound super great and useful when you guys talk about it. A lot of cases where I could probably be using it to do things better

tulip ridge
#

I'm not sure what the exact cut off is, but I remember seeing it run way more often than I'd expect it to when debugging stuff

old owl
#

I think alike triggers an action only evaluates the condition within the given distance of the object. That or it is a static 50m. Can't remember

pallid palm
#

Vanilla is better ๐Ÿ™‚ ๐Ÿ™‚ ๐Ÿ™‚ lol No i just like no mods that's all ๐Ÿ™‚

#

so i just got this part right in the crate init of a Supply Drop Support module```sqf
_this addAction ["<t color='#ff1111'>BIS Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal},"",1,false,true,"","(_target distance _this) < 5"];

#

im happy now ๐Ÿ™‚

#

WooHoo ๐Ÿ™‚

#

What a Awsome Game Arma 3, i love it

hazy temple
#

Can i use this in multiplayer to increase the recoil?

#

setUnitRecoilCoefficient

still forum
tough abyss
#

Yes

#

must be run locally

tidal idol
#

Does that still allow params? I still need some way to pass the player to the function.

But come to think of it, its probably a good idea to make sure the condition and function has good short-circuits.

warm hedge
#

What is that in this context

still forum
#
condition = "player == this turretUnit [-1] && {alive this}";

and

MyFunctionTag = {alive this};
condition = "player == this turretUnit [-1] && MyFunctionTag";

is the same thing

tidal idol
#

So if I want to reference the player in the function, since its established that the player is a turretUnit of vehicle this, I could put _unit = this turretUnit [-1]; as the first line of code in yhe function and proceed as normal from there?

#

Or could I put player directly?

On second look, I see that the function call is basically a paste-in block of code.

finite bone
#

I read somewhere (probably in the BIKI) that call executed inside a spawn is still a scheduled function that can be paused using sleep? Or am I spouting shit?

still forum
still forum
finite bone
still forum
finite bone
#

Ah legallydistinctkekw

hazy temple
#

Could you give me an example on how to write the code? and should i put it in the initPlayerLocal.sqf then?

#

@tough abyss

#

I'm sorry, new to arma 3 scripting

hushed turtle
#

What the easist way to calculate terrain slope in degress? Direction of slope doesn't matter, just slope angle from horizontal line

granite sky
#

acos (surfaceNormal _pos # 2)

blissful current
#

Is it possible to make your own revive mechanic. The base game appears to be a holdAction to revive downed units. Could one replace that with their own holdAction that revives units?

granite sky
#

Yes.

#

There are at least half a dozen revive systems around.

blissful current
#

I'm guessing the first step would be to select the disable option here:
But that would probably just make units skipped the downed step and go straight to dead.

hallow mortar
#

Yes, you'd need to have your own handleDamage EH to prevent that and make your own downed state

ruby spoke
#

Is it possible to return which face the player object is using? Lol it's a weird question but I want to create a dialog that has the player's face/head displayed, sort of like most gmod life servers.

crimson lion
#

This is like... halfway between config and scripting, sorry: I am setting up a custom attribute for a thing in 3den and I have this expression. I don't know how many quotes deep I can nest them, I need like 4 layers:

expression="private _nameplateText = format ["#(rgb,1024,256,3)text(1,1,""RobotoCondensed"",0.3,""#ffffff"",""#000000"",""%1"")",_value];_this setObjectTexture [0,_nameplateText];";
#

Nvm! Why work harder when you can expression="[_this,_value] call bro_fnc_textureIt;";

blissful current
pallid palm
#

Hello All: so is there away to stop my team of players from Speaking ```sqf
{_x setSpeaker "NoVoice"} forEach units _player;

#

how would i go about doing that

#

maybe i should do player

blissful current
#

Do you mean the radio speak from your group? Like, "man. 200. meters", etc?

pallid palm
#

yeah like man man. 200. meters", etc?

blissful current
granite sky
#

setSpeaker "NoVoice" is fine if you want to kill all chat, IIRC

pallid palm
#

yes i use both of them and it stops my guys from talking but i want enemy Ai to keep talking

#

everytime i stop my guys frome talking the enemy Ai do also

#

and i want enemy Ai to keep talking

granite sky
#

Best bet is probably just to put [player, "NoVoice"] remoteExec ["setSpeaker", 0, true] in your initPlayerLocal.

pallid palm
#

ahhh coool

blissful current
pallid palm
#

thx @granite sky

granite sky
#

@blissful current I wouldn't know without reading it. Maybe they throw some sort of events.

#

Otherwise you can't directly overwrite a compileFinal'd function, but what you can do is patch your own function path into config.

#

And then it'll run your code instead for that function call.

blissful current
#

Hmm I dont want to replace what they have since who knows what I'd break by removing it. But just adding some would work if that's possible.

blissful current
#

I found a function for health effect but not for the holdaction that does reviving.

blissful current
#

How do you make this button (parameters)? In my mission I have my options on a object and players can interact with it to change things. But if I could put them in this button that would be pretty slick.

tough abyss
#

I thibk it has to do with identity but not sure and not on th pc atm.

placid root
#

@ruby spoke , well it is possible to get the users color selection (porfile/hub color and stuff)by some configpath thingy. i saw it when i was looking through the Rsc in the configviewer. if it is possible to get these i am quite sure you can get the players face the same way. just dig through some Rsc and you will propably find something

ruby spoke
#

okay, thanks. Which config is it in particular? @placid root

hushed turtle
placid root
#

forgot the name but there a lot of Rcs like "RscButtonMenuCancel" or "RscButtonMenuOK" just go through dem and in some onload stuff you will find something with profilecolor bla. sorry for beeing so vage can't start up arma atm

modern plank
#

Any scripts to generate road civilian traffic between towns?

cosmic lichen
#

If it's a mission specific function then you can give it any name you want as only you will be able to call it.

hushed turtle
#

I call BIS function which calls other BIS function and I let's say I want my version of the second one. So only way is to have own version of both.

placid root
#

e.g. the hud color can be changed by userpreferences. so try to find the rsc for the hud

cosmic lichen
#

Yes. There is nothing wrong with that.

formal grail
hushed turtle
#

I'm not saying there is something wrong. I was just curious. ๐Ÿ˜€

placid root
#

i am off to bed. good luck

#

and when you find a way this will help you to display it alongside with propably setFace.

queen cargo
#

btw. anybody knows a simple way to prevent units from trying to get into formations?
need them to work as individuals ...

proven charm
#

a math question, if you have 4 tv screens in row and you want to give them number from 1 to 4 from left to right , how do you do that?

warm hedge
#

Well, in what context? Does the number really matter to this usecase?

proven charm
#

i want to give each screen a camera so screen # 1 gets camera 1 etc

#

but the screen should be in left to right order

warm hedge
#

You have four TV objects, you have four cameras, but they are not named (yet)?

proven charm
#

no not named

#

just need to know which screen access which camera so left screen would be assigned to cam 1 and the next screen to camera 2 etc

hushed turtle
#

setVariable?

warm hedge
#

I genurely cannot understand why that could be a case actually

#

Why you can't just hardcode it?

old owl
#

On phone so apologies for any bad formatting

sage marsh
#

Is there a way to make ambient sounds go silence (bird chirping and ambient animals) but keep the wind sounds?

#

I know EnableEnvironment [false, false];

Does it but it makes the wind sounds gone too

old owl
sage marsh
#

Welp

#

I guess Mars will have bird chirping then

proven charm
#

maybe im not good explaining XD

old owl
thin pine
#

Ungroup em ๐Ÿ˜‰

hallow mortar
#

If you don't have control over the placement of the screens, it's going to be a real mess to detect them, find their relative positions, and sort them by that ๐Ÿค”

#

If possible, I'd suggest creating them by script, so you have control over their positions and the order they're created in and can store that information for use with the cameras.

proven charm
#

@hallow mortar they are created via composition, so cant manage the order too much

hallow mortar
#

If they're a composition and you're OK with the composition only working in the Editor or on servers that allow compositions to execute scripts, you could use setVariable in each screen's init field to have them identify themselves (or have each one separately initialise its own camera feed with the correct camera)

#

If you want the composition to work with Zeus placement on servers that don't allow compositions to execute code... you're screwed

proven charm
#

i think the compositions work/are allowed if server runs the script... in my case the comp is just CCTV room in the base. not using zeus

hallow mortar
#

If it's placed in the Editor, there are no restrictions. The settings for compositions executing code only apply to Zeus placement.

proven charm
#

its placed once mission starts. there maybe newer eden compo system that im not using

queen cargo
#

ha ha ...

#

funny boy ...

#

at some point you will run out of groups due to the fact that there is a total maximum of groups in ArmA

hallow mortar
#

wh...how are you placing this composition? You say it's not using Zeus, but you also say it's "once mission starts" so presumably not placed in the Editor. But those are the two ways you can place a composition.

proven charm
#

im using the old objectMapper/grabber scripts

hallow mortar
#

Okay, so not a composition then :U

proven charm
#

i have always called them compositions ๐Ÿ™‚

hallow mortar
#

A composition is an actual specific thing and the difference does matter

proven charm
#

ok

#

snippet from the mapper script: ```sqf
//See if an object array, specific composition class or tag array was given.
private ["_cfgObjectComps", "_script"];
_cfgObjectComps = configFile >> "CfgObjectCompositions";

hallow mortar
#

This functionality isn't documented on the wiki so I would need to look at it in full later, but that looks like the function is also capable of loading an actual composition from config, in addition to the documented method of creating an array from existing objects

proven charm
#

yep

#

ive used it since A2

hallow mortar
#

Using object init fields to either set variables or individually initialise camera feeds is still the way to go. Have the left screen's init activate the left camera, etc. or have the left screen's init set a variable identifying it as the left screen, etc.

proven charm
#

that would work, just not with compo

hallow mortar
#

Why not? The mapper function supports init commands

proven charm
#

oh right, Im actually looking at my modified version, for some reason i dropped init support or something

#

well thanks for the pointers NikkoJT, I could add back the init storing if I choose to go this route

blissful current
formal grail
#

We also do custom respawn handling, so basically every second after you're incap, we set your respawn timer to be -1s. That way people can't just respawn to skip their respawn timer.

#

And make sure to switch camera back to player if you have cameras/uavs

hallow mortar
granite sky
hushed turtle
#

R3vo said it's not possible praise_the_sun

formal grail
# hallow mortar Why not just turn off the respawn button?

Wanted people to be able to respawn by pressing the button.
Managing the respawn timer isn't actually that complex. I just remembered, the hardest part is getting AI in each players' group to behave. When you go unconscious (we set the incapacitated player to unconscious which hard locks them from actions etc), AI in your group will take over and start issuing commands.

blissful current
#

How can I find the correct structure in description.ext for this file: a3\functions_f_mp_mark\revive\fn_reviveonstate.sqf
For example I just tried this without any luck:


class CfgFunctions
{
    class A3
    {
        class Revive
        {
            class reviveOnState
            {
                file = "functions\fn_reviveOnState.sqf";
            };
        };
    };
};
#

Basically, I want to overwrite that file with my own code. I've been able to do this with the SOG CDLC functions, using the same method. But this time it's not working and I suspect I am using the wrong path in description.ext

formal grail
#

If you are overriding BIS_fnc_reviveOnState, your first level should be BIS, not A3. I'm not sure if overriding the bis functions with the function library works at all but if anything you'll want to try that. The second level doesn't matter. The third looks right.

tulip ridge
#

You can't overwrite config functions from a mission

blissful current
#

I can do this with a CDLC function. Maybe the base game is different in some way?

tulip ridge
#

BIS_ functions are protected iirc (though you can still just modify the config with a separate mod)

blissful current
hushed turtle
granite sky
blissful current
granite sky
#

yeah

hallow mortar
blissful current
#

So now, my job is to insert my convo function into BI's revive system. I placed a hint in there so I should be able to get that to work. I'm not sure if it will accept _caller/_target, but I'll try.

I also get an error on death related to fn_holdActionRemove.sqf. So I wonder if I need to intercept that one as well.

hushed turtle
#

There may be file included, which you don't have

blissful current
#

I did copy/paste 3 include files into my functions folder which cleared up the other errors.

hushed turtle
#

I see, so it should technicaly work then

blissful current
#

And those files have their own include but I dont get errors on mission load so maybe that is working ok

hushed turtle
kind hatch
#

Hello, can someone help me finish writing the ORBAT for Task Force Aegis or explain to me how I need to write the rest? class CfgORBAT
{
class AKO
{
id = 0;
idType = 0;
type = "Infantry";
side = "West";
size = "Company";
commander = "Johnson";
commanderRank = "Captain";
text = "Alpha Kompanie";
textShort = "A KO";
description = "";

    class 1Z
    {
    id = 0;
    idType = 0;
    type = "Infantry";
    side = "West";
    size = "Platoon";
    commander = "Robinson";
    commanderRank = "Lieutenant";
    text = "1.Zug";
    textShort = "1.Zug";
    description = "";
    };

    class 2Z
    {
    id = 0;
    idType = 0;
    type = "Infantry";
    side = "West";
    size = "Platoon";
    commander = "Edwards";
    commanderRank = "Lieutenant";
    text = "2.Zug";
    textShort = "2.Zug";
    description = "";
    };

    class 3Z
    {
    id = 0;
    idType = 0;
    type = "Infantry";
    side = "West";
    size = "Platoon";
    commander = "Phillips";
    commanderRank = "Lieutenant";
    text = "3.Zug";
    textShort = "3.Zug";
    description = "";
    };

    class 4Z
    {
    id = 0;
    idType = 0;
    type = "Infantry";
    side = "West";
    size = "Platoon";
    commander = "Burr";
    commanderRank = "Lieutenant";
    text = "4.Zug";
    textShort = "4.Zug";
    description = "";
    };

};
}

blissful current
# hushed turtle 3 files? I see 4 being included from the same folder

My mistake. Yes there are 4 included. I went ahead and put those in my functions folder and also intercepted the file that was throwing the error on death (fn_holdActionRemove.sqf). I still the the error, so I blocked out the intercepted files in description.ext to see if that is the issue and I still get the error. So now I'm restarting the game to see if I need to do that after changes I've made.

After restarting and disabling the revive in eden editor I still get the error pointing to that file. So it might not be related to my messing around with this stuff.

From the console I do player setdamage 1;

#

Maybe this is an error I have always had but it's just showing its head now as a coincidence.

winter rose
blissful current
hushed turtle
#

Overwriting from mission doesn't work for me. Dunno how have you achieved that

blissful current
#

Show me your description.ext

hushed turtle
blissful current
#

I'm asking what your goal is because I'm using a different file.

hushed turtle
#

I've tried this one

blissful current
#

What do you aim to do?

hushed turtle
#

Nothing I just wanted to try to overwrite a function, based on what you've said

#

I thought it could be handy one day

blissful current
#

Ah okay, then I'll just show you what I did and you can play around.

#
class CfgFunctions
{
    class bis
    {
        class Revive
        {
            class reviveOnState
            {
                file = "functions\fn_reviveOnState.sqf";
            };
        };
};

In my funcitons folder are fn_reviveOnState.sqf plus the 4 include files.

#

At the top of reviveonstate put a hint. Then play in multiplayer and kill a client and the hint will pop up. Bingo!

#

I'm injecting my convo function into the holdAction for reviving. It already accepts _caller and _target! So I think this is going to work. Progress at the very least.

hushed turtle
#

I've tried to call it from debug console

blissful current
#

I gotta head out to work but I can help when I return in a few hours.

radiant lark
#

Is there a way to hook commands in such a way that I can control the use of them?
Just like normal hooking, you hook a command from your SQF and everytime somebody calls that command, it executes whatever code you specified, including the original command if you want to

#

I think it'd make up for cool things

radiant lark
#

I've also read somewhere (I think on this discord) that the game executes those commands as well, so yeah, I think it could make a good feature

hushed turtle
#

You could create a function which does something prior to calling the command

radiant lark
#

Yeah, well, my idea is to try and defeat cheaters from executing commands (even tho they could bypass those hooks too, just adds a layer to it). And it would also be helpful to add more functionality in case the game (regardless of my server and scripts) actually calls those commands

hushed turtle
#

Commands can be banned for remote execution

old owl
radiant lark
#

I have thought about something, will take a deep look into my idea and hopefully I can make it not need any mods

blissful current
#

@hushed turtle Did you get it working? Want some help?

hushed turtle
#

No, it's ok. It doesn't matter

pallid palm
#

Jouklik don't need much help: he's Awsome imho ๐Ÿ™‚

#

holy shit i was just working on a enemy script i made: and now i made them basterds even better: they act like real now: lol its Awsome fun ๐Ÿ™‚

#

i made them dive on the ground if you shoot your weapon or any explotion happends: and they pop up to kneeling to see what's going on: lol looks so cool:

#

then they sneek around and investigate: and if they don't know what happend they start shooting like hell all over lol so cool lol ๐Ÿ™‚

#

Arma 3 is So Cool ๐Ÿ™‚

#

i did have it where they just bum rush you: like the whole enemy team: but that was way to hard: lol

tidal idol
#

What could be causing this block of code to silent fail (no error message)?
The commented version is hardcoded one level down and works fine returning true as intended if the player has proper headgear on.
Is it because the exitWith is exiting the block of code insdie curly braces and not the function itself?

hallow spear
#

How does the gane know what addaction to add when looking at vehicles? Sometimes get in driver is first, sometimes passenger. Is there anyway to execute "do top available action"?

tulip ridge
#

Also you can just use findIf > -1

tidal idol
#

Awesome, working version attached for anyone who stumbles across this.

native hemlock
#

They are sorted by the "priority" parameter and if they have the same priority the newer one is at the bottom

#
 (optional): Number - Priority value of the action. Actions will be arranged in descending order according to this value. Every game action has a preset priority value. Value can be negative or decimal fraction. Actions with same values will be arranged in order which they were made, newest at the bottom. The bigger the number the higher the action will be positioned on the menu. Typical range is 0 (low priority. Eg: 'Get out') to 6 (high priority. Eg: 'Auto-hover on'). Default value: 1.5
fading gorge
#

that's for custom addactions, i think matey is asking about the un-modded vanilla actions like "get in as passenger"

hallow spear
#

Yea im trying to check out how vanilla vehicles handle the get in actions. Or to run code that does what ever highest priority addaction is

native hemlock
#

I'm not sure about running the highest priority one though

proven charm
#

this is what I have for arranging composition objects in sequence. In objects init field (The code part is saved in the composition): ```sqf
this setvariable ["init",{ [_this,4] call setobjectSequence; }]; // This object is #4

tulip ridge
hallow spear
#

Thanks for the info, I'll check it out.

frail dune
#

Hey, guys. I'm currently having an issue with TFAR. I've posted in the TFAR thread as well, but I don't want to bother nkey more than I already have. What I'm looking to do is place a radio backpack on the ground, and set the radio to speaker and the frequency to 70. I've got all the functions and pieces I need, but I'm not sure how to put it together. So far I've tried naming the radio backpack "speakerradio", and putting this in the init line: [speakerradio, "radio_settings", "70.00"] call TFAR_fnc_setLrFrequency;
[speakerradio, "radio_settings"] call TFAR_fnc_setLrSpeakers;

#

So if I understood it correctly the backpack goes into a weaponHolder, and I need to use the everyBackpack function. Would I need to make an sqf and do "everyBackpack _WeaponHolder"?

hushed turtle
#

Are config classes "BulletCore" and "BulletBase" good for checking if ammo is bullet?

hushed turtle
#

I wanted projectile type, not magazine

proven charm
#

oh sorry

thin fox
blissful current
#

Can a module be added through the server params settings? For example, if I wanted have the option to use the SOG Advanced Revive module, I can easily make the setting show up in the param but how would I call it since the only way I know how is to drop the module down in the editor.

I assume that the module is just a UI wrapper for a function call or something.

#

So presumably I could find the name of that function and call it in initServer.sqf?

fair drum
#

That is completely based on how the module is setup internally.

#

The things you can customize are stored in variable namespace of the module object. Sometimes they have it set up that it's not compatible with a direct call.

tulip ridge
#

You could also just create the module object and call it

exotic gyro
#

...But I cannot imagine someone not inheriting from at least BulletCore

foggy stratus
#

How can I check if a unit's primary weapons is capable of automatic fire?

tulip ridge
#

Wrote this on my phone, might have formatting issues

private _weaponConfig = configFile >> "CfgWeapons" >> currentWeapon player; (getArray (_weaponConfig >> "modes")) findIf { getNumber (_weaponConfig >> _x >> "autofire") == 1 } > -1; // true if there's a full auto mode
foggy stratus
tulip ridge
#

Oh needs parentheses before _weaponConfig and after "modes"

foggy stratus
#

I'm doing the following in console, and showing the isAuto result var:

#

private _weaponConfig = configFile >> "CfgWeapons" >> currentWeapon player; isauto=(getArray (_weaponConfig >> "modes")) findIf { getNumber (_weaponConfig >> _x >> "autofire") == 1 } > -1;

#

And its returning true for shotguns and m79 grenade launchers which aren't full auto... unfortunately

tulip ridge
#

Could also check if showToPlayer is 1, I think that's the property at least

foggy stratus
#

I appreciate the help. I've done config modes checks on these weapons and they all return FullAuto in the array. I don't know if that is a Prairie fire thing or true for all Arma weapons or not.

foggy stratus
#

When I do this command on player who has an M79 (which is obviously not an automatic weapon)
modes = getArray (configFile >> "CfgWeapons" >> primaryWeapon player >> "modes");
modes array has these values:
["Single","FullAuto","AICQB","AIClose","AIMedium","AIFar","AIOpticmode1","AIOpticmode2"]

granite sky
#

Which mod's M79 is that?

#

I would guess the trouble is that weapons with a 1-round magazine could have fullAuto set and it wouldn't hurt.

#

And modders are usually like "if it works then it's fine"

foggy stratus
#

I may resort to a blacklist of PF known non-auto weapons, which sux

granite sky
#

Are these single-barrel shotguns?

foggy stratus
#

pump action single barrel

granite sky
#

curious. I wonder how that works.

#

I guess if you hold the fire button down it'll fire again after the rack animation.

foggy stratus
#

One does that...it's called slam firing. But the other does not have that feature. But obviously M79 must be broken open and reloaded.

#

I'm gonna check bolt action rifles now...

granite sky
#

Bolt actions are normally another special case because they don't work the bolt until you release the trigger. Not sure what the config is for that.

foggy stratus
#

Interesting. Bolt Action rifle did not contain "FullAuto" in modes list, but M79 grenade launcher does.

#

For my simple needs, I need to find the unit with greatest firepower in my squad to pick for a specific purpose. So I think I will check mag capacity instead.

granite sky
#

mag cap * hit value maybe.

#

but plain cap is probably fine for most cases.

foggy stratus
#

thx

hushed turtle
pallid palm
#

hello all: so if i'm hosting: is my player considered (local player) and the server at the same time

proven charm
#

Yes

pallid palm
#

oh nice thats Awsome

#

thx m8 @proven charm you see what i did there: rhyme ๐Ÿ™‚

#

get it m8 GenCoder8 ๐Ÿ™‚

proven charm
#

sorry?

pallid palm
#

like a rhyme you know like in a song

#

like money and funny rhyme

proven charm
#

not sure i follow ๐Ÿ˜‰

hallow mortar
#

rhyme

pallid palm
#

yes ok sorry yes

#

thx Nikko

proven charm
#

ya it rhymes a bit ๐Ÿ™‚

pallid palm
#

lol ok lol ๐Ÿ™‚

#

i'm just in a happy mood ๐Ÿ™‚

#

as always ๐Ÿ™‚

#

So i have this Special reload script that i made: and i want to run it on any player that Activates the radio trigger in a Hosted server

and i have in the radio trigger in the Condition (local player)

and in the OnActiveation i have [player] call SFA_fnc_playerReload;

so would that work correctly

#

it works on the host: but i'm not sure it will work on any player that Activates the radio trigger

#

i did not have a chance to test it with all players yet

#

any coments or ideas or even giving me hell is ok ๐Ÿ™‚

proven charm
#

i dont use triggers but if the trigger is activated via selecting the radio thing then I dont think your condition makes sense or has any effect

#

i think you dont need a condition if its radio

pallid palm
#

hmmm

#

interesting

proven charm
#

(local player) is always true in client and has no effect on dedi server

pallid palm
#

copy that

#

so i only host but its good to know if it would work on ded server also

#

so maby i should script a radio trigger on the clients mach

proven charm
#

i think radio triggers can only be activated by client

pallid palm
#

ah nice thats cool

#

ok ill try some stuff thx m8 @proven charm

fading gorge
#

maybe something like

#

firstBackpack theWeaponHolder

#

(why can't I press enter to send a message after doing ''' for code?)

#

(i know it's not actually ''' but if i type the correct symbol i can't send the message)

modern plank
#

Hello, small issue with setFace, just want an AI with a tatoo.

I have this in my description.ext:

class CfgFaces {
    class Default;
    class Man_A3: Default {
        class WhiteHead_01;
        class FynnHead: WhiteHead_01 {
            displayName = "Fynn Face";
            texture = "img\Fynn.paa";
        };
    };
};

But the setFace fails with:

16:18:14 Error: Error during SetFace - class CfgFaces.Man_A3.FynnHead not found
16:18:14 Error: Error during SetFace - class CfgFaces.Man_A3.FynnHead not found```

It does work with a vanilla class like `Miller`. Any idea?
winter rose
#

You can only define new faces in mods

#

@modern plank ^

#

(also your first script line makes no sense)

tulip ridge
#

They know how to do it, they're trying to add faces in a mission, which you can't

hushed turtle
#

ACE delays kill of weapon caches, since it does munition exploding sequence. Is there any event handler to catche this? Because of that "Killed" EH is delayed.

hallow mortar
#

ACE provides the ace_cookoff_cookOffBox CBA event which fires when the cookoff starts

tulip ridge
#

It's emitted on all machines as well

#

Should also note that if you want whatever you're making to work the same with and without ace cookoff, you'll probably want to listen to both killed and cookOffBox

hushed turtle
#

I don't understand CBA events at all. I don't see anywhere explained what event is local or global.

modern plank
tulip ridge
hushed turtle
#

I will check if ACE is loaded and use correct EH based on that

pallid palm
#

ok

tulip ridge
#

CBA events are just like BI's scripted event handlers but way easier for networking (i.e. telling a server / client to do something)

hushed turtle
#

And this cookOffBox fires on all right?

#

Even if add it on one machine?

drowsy geyser
#

how can i disable the black background if mouse hovers above a button, is it possible?

0 spawn 
{ 
    disableSerialization; 
    waituntil {!isnull (finddisplay 46)}; 
    private _display = findDisplay 46 createDisplay "RscDisplayEmpty";

    private _para_playButton = _display ctrlCreate ["RscButton", -1];
    _para_playButton ctrlSetPosition [0.45 * safezoneW + safezoneX, 0.75 * safezoneH + safezoneY, 0.1 * safezoneW, 0.1 * safezoneH]; 
    _para_playButton ctrlSetTextColor [1, 1, 1, 1];
    _para_playButton ctrlSetBackgroundColor [0, 0, 0, 0];
    _para_playButton ctrlSetText "S T A R T";
    _para_playButton ctrlSetFontHeight 0.1;
    _para_playButton ctrlSetFont "PuristaMedium";
    _para_playButton ctrlCommit 0;
    _para_playButton ctrlAddEventHandler ["ButtonClick",
    { 
        params ["_ctrl"];
        _display = ctrlParent _ctrl;
        _display spawn
        {
            _this closeDisplay 1; 
        };
    }]; 
};
split ruin
#

is BIS_fnc_taskPatrol working for boats ?

//not working boats are static
[_boatgrp, position (leader _boatgrp), 300] call BIS_fnc_taskPatrol;
#

maybe PosASL needs to be used ?

hushed turtle
#

Commands usually expect Position AGL

#

Which is same as ASL when above sea

#

I don't see where I can specify to which object I want to add CBA EH. Do I have to add it for everyone and then check if _object in EH is same as some global var?

proven charm
tulip ridge
#

You need to add the event handler wherever you want the code to run

split ruin
#

@hushed turtle this make them patrol just fine

[_boatgrp, getPosASL (leader _boatgrp), 300] call BIS_fnc_taskPatrol;
tulip ridge
#

Like I said, they're like BI's scripted event handlers (but better)

hushed turtle
#

Description of cookOffBox says global, so I guess that just means it can execute on all machines? Meaning will execute everywhere where I add an event

#

I don't know BI's scripted EHs

tulip ridge
hushed turtle
#

Thanks for advice. I understand it better now.

drowsy geyser
split ruin
#

I wonder if in case of 0 there will be no code execution or will do one iteration?

private _rn = selectRandom [0,1,2];
for "_i" from 0 to _rn do
{bla-bla};
hushed turtle
#

In for? There will be one

stable dune
#

It will do it once

proven charm
pallid palm
#

holy shit guys: i'm just starting to get a little better at this stuff: thx so much for all your help: (you all know who you are that helped Me) WooHoo ๐Ÿ™‚

#

i just made a Awsome destroy Cache Script: and i think its a Master piece ๐Ÿ™‚

#

it choses a random marker on the map : markers are placed for control of locations: spawns the cache at that marker then moves the box to a random house pos and spawns enemy: and sets AO and Pint Point markers : which can be turned off in the params In the Discription.ext if wanted

#

thx so much guys im lovin it ๐Ÿ™‚

#

i even put comments in for any one that want to read them ๐Ÿ™‚

serene olive
#

I try to figure out what is the "better" way of propagating data to all client: global variables vs CBA EventHandlers
Context: I want to implement some way to disable/enable BFT.

Using global variables:

// fnc_disableBFT.sqf
params ["_bftObject"];
// propagate new state as a global variable on the _bftObject
_bftObject setVariable ["CTAB_Has_BFT_Enabled", false, true];
// set last known position etc. as a global variable on the _bftObject
_bftObject setVariable ["CTAB_Last_Known_Tracking", [(getPosASL _bftObject),(getDir _bftObject), (direction _bftObject), (mapGridPosition _bftObject)], true];
// fnc_enableBFT.sqf
params ["_bftObject"];
// propagate new state as a global variable on the _bftObject
_bftObject setVariable ["CTAB_Has_BFT_Enabled", true, true];

Using CBA Eventshandlers

// disable BFT EventHandler
["CTAB_Disable_BFT", {
    params ["_bftObject", "_lastKnownTracking];
    // set new state local only
    _bftObject setVariable ["CTAB_Has_BFT_Enabled", false];
    // set last known position etc. as a local variable on the _bftObject
    _bftObject setVariable ["CTAB_Last_Known_Tracking", _lastKnownTracking];
] call CBA_fnc_addEventHandler;
// disable BFT via Event
["CTAB_Disable_BFT", [player, [(getPosASL player),(getDir player), (direction player), (mapGridPosition player)]] call CBA_fnc_globalEvent;
// enable BFT EventHandler
["CTAB_Enable_BFT", {
    params ["_bftObject"];
    // set new state local only
    _bftObject setVariable ["CTAB_Has_BFT_Enabled", true];
] call CBA_fnc_addEventHandler;
// enable BFT via Event
["CTAB_Enable_BFT", [player] call CBA_fnc_globalEvent;

Question:

  • What is the preferred way for better performance?
  • Is there event a significant performance improvement?
pallid palm
#

you can test it right ?

serene olive
#

Mh never did it - where do I start learning performance measurements?

pallid palm
#

in the umm: shit i forget what its called now damit

serene olive
#

wiki?

pallid palm
#

you know when you hit Esc in game

serene olive
#

Debug Console?

pallid palm
#

yeah thats it

#

iirc

#

bb im going to the store

tulip ridge
serene olive
#

Evaluation is (just a random example from within the code):

// current position
_veh = vehicle cTab_player;
_playerPos = getPosASL _veh;
_heading = direction _veh;
_lastKnownPosition = [_veh] call cTab_fnc_getBftLastKnownTracking;
if (!(_lastKnownPosition select 0)) then {
    _playerPos = _lastKnownPosition select 2;
    // only position is disable so no: _heading = _lastKnownPosition select 4;
};

[_cntrlScreen,false] call cTab_fnc_drawUserMarkers;
tulip ridge
#

Then there's just no point in using CBA event handlers there
The enable one is literally just setting a var to true

#

Also should really just use camelCase for those variable names and not make them "sentence-case"-esque

CTAB_Has_BFT_Enabled     -> CTAB_bft_enabled
CTAB_Last_Known_Tracking -> CTAB_bft_lastKnownPosition
split ruin
#

I still have problem with BIS_fnc_taskPatrol and boats ๐Ÿ˜”
it keeps finding positions on land instead of sea and on top of that it finds positions with much bigger distance than set in the function ...

[_boatgrp, getPosASL (leader _boatgrp), 300] call BIS_fnc_taskPatrol;
granite sky
#

Rewrite the function so that it works as desired then?

split ruin
#

good idea actually ... but too much work ๐Ÿ˜ตโ€๐Ÿ’ซ

split ruin
#

couple of waypoints do the work

#
private _pos1 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
    private _wp1 = _boatgrp addWaypoint [_pos1,0];
    _wp1 setWaypointType "SAD";

    private _pos2 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
    private _wp2 = _boatgrp addWaypoint [_pos2,0];
    _wp2 setWaypointType "SAD";

    private _pos3 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
    private _wp3 = _boatgrp addWaypoint [_pos3,0];
    _wp3 setWaypointType "SAD";

    private _pos4 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
    private _wp4 = _boatgrp addWaypoint [_pos4,0];
    _wp4 setWaypointType "SAD";

    private _pos5 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
    private _wp5 = _boatgrp addWaypoint [_pos5,0];
    _wp5 setWaypointType "SAD";

    private _pos6 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
    private _wp6 = _boatgrp addWaypoint [_pos6,0];
    _wp6 setWaypointType "SAD";

    private _pos7 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
    private _wp7 = _boatgrp addWaypoint [_pos7,0];
    _wp7 setWaypointType "CYCLE";
pallid palm
#

@split ruin why not just use LV patrols they work great

#

i could send you the folder if you like

#

or you can edit the Diver patrol script i sent you m8

old owl
#

Maybe I am misunderstanding the tone but #arma3_scripting and the entire Discord is supposed to be drama free. If I am being real though I don't really see where Scotty said anything to really instigate either. Dude's just wanting to learn, which is what this channel alike others are here for. Plus we're all friends here catnod!!

warped thicket
#

Shift-enter

granite sky
#

well, it's plausible enough if you have west instead of east in the second one. Formatting though :/

#

Not sure if getUnitLoadout in a Killed EH works as expected because units drop their weapons on death. Would need testing.

proven charm
#

is it not possible to get the objects init field via script? right now im using setVariable in the init field to make my own init code for composition object

split ruin
#

@pallid palm I made a boat mission, divers will come in the next one, thanks for the script again ๐Ÿป

clever turtle
#

Cleaned up, seems like a bot wave again ๐Ÿ˜‰

split ruin
#

how to get the player who activated a radio trigger?

proven charm
#

you mean like "Radio alpha" ?

split ruin
#

yes, the problem is its executing the code to everyone and I need it only for the player who actually activated the trigger aka where player is local

#

how to chek if object is local ?

hushed turtle
#

local _object

proven charm
#

not good with triggers ๐Ÿ™

split ruin
#

they are very dark and undocumented area

hushed turtle
#

Trigger has thisList array, doesn't it?

#

So I guess it would containt player who activated the radio. Hopefully only him

#

So: local (thisList #0)

split ruin
#

yes, now I will get

_player = thisList select 0;
if (!local _player) exitWith {};

hope this will make the code run only to the guy actually activating the trigger ...

proven charm
#

im getting empty thislist

hushed turtle
#

Well that's bad meowsweats

split ruin
#

๐Ÿ˜ญ

clever turtle
#

Spambot wave with bitcoin spam ๐Ÿ˜ฎโ€๐Ÿ’จ

split ruin
#

@hushed turtle , @proven charm I run the code just fine, no errors but need more MP testing

hushed turtle
#

I'm getting empty thisList too

proven charm
#

you want only one player to be able to use the radio trigger?

split ruin
#

no, I just want the activation code to be executed on the machine of the player who activated it, nowhere else, not on server or other clients

hushed turtle
#

You may need to script this instead

#

I never created scripted radio though

proven charm
split ruin
#

already full ๐Ÿ˜‚

#

I put there admin stuff like return to base, end session, activate next mission, etc

hallow mortar
#

You could consider making a briefing tab instead

proven charm
#

or use submenus

cobalt path
#

Question, so I want to script a thing, where when you press a button, that menu on the left side of your screen opens and you can select 1-9 an option and than do a hand signal and everyone around you gets a hint. (like SOG)
I WILL script it myself. Issue is I dont know where to start as I have no idea how that thing is even called, so I could look up on wiki xd

hushed turtle
#

Do you mean radio?

#

From command menu?

pallid palm
#

@hot sapphire dude wtf man sheees: i only host mission No Ded server

exotic gyro
tepid vigil
#

How can I get the velocity of a projectile during flight? I have the following code but it keeps printing out only the initial velocity of the projectile instead of the real velocity, as in the reported velocity does not change at all during flight

Edit: I think the problem was the while-loop reaching the 10k iteration limit, was fixed by spawning the while-loop and adding a 0.1 second delay per iteration

player addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    systemChat "Projectile fired";
    systemChat str _ammo;    
    while {!isNull _projectile} do {
        hintSilent str vectorMagnitude (velocity _projectile);
    };
}];
pallid palm
#

Do you have a OnPlayerRespawn.sqf you can restore loadOuts there

#

ok cool

pallid palm
#

i'm not sure how to use this but this is what i found

#
//Local Execution:
_tr1 = createTrigger ["EmptyDetector", getPos player]; //(Creates it on the player's machine)
_tr1 setTriggerActivation ["Alpha", "PRESENT", false]; //(Sets it to be activated by "Radio Alpha")
_tr1 setTriggerStatements ["this", " hint 'You activated the local trigger' ", ""];
//(The condition this means "this trigger/player") is activating it,
//so the code runs only on that player's machine.

//ServerSide Actions (Optional):
//If the radio activation needs to trigger something global (like a task for everyone)
//the local onActivation code needs to call a server function using 
_tr1 remoteExec ["yourServerFunction", 0]; //(0 means server)
#

i'm still afraid to try it ๐Ÿ™‚ cuz im not sure

proven charm
#

it doesnt set the locality value tho (in createTrigger ) (But IDK if thats needed)

pallid palm
#

so if the radio trigger is created on the players mach then it would be local to that player: yes ?

hushed turtle
#

it's global by default

pallid palm
#

im not sure i understand

#

the part i dont understand is that a radio trigger has no radius so we can't use thislist

hushed turtle
#

Yeah, maybe that's why thisList is empty when trriger is activated by radio

pallid palm
#

roger that

#

i'm still trying to do what Kiba was talking about: like getting the player that called the radio trigger

#

and only have that player Activate the script

hushed turtle
#
_tr1 = createTrigger ["EmptyDetector", getPos player, false]; // Creates local trigger, wow
pallid palm
#

on the players mach right ?

#

on each players mach ?

hushed turtle
#

He wanted trigger for all player, but somehow catch who activated it

thin fox
pallid palm
#

yeah i can only seem to get a radio trigger to work on all players or just the host player

hushed turtle
#

By this he can track who activated it, but if one player activates it, the radio won't just disappear from other player's machines. Since those wound be separate triggers. He would have to remove them for other players manually, if he wants only first player to able to activate it

pallid palm
#
// To make it only activate once and disappear from the menu:
_radioTrigger setTriggerStatements ["this", "hint 'Local Radio Alpha Activated!';


_radioTrigger setTriggerStatements ["this", "", ""];

_radioTrigger setTriggerActivation [player, "NONE", false];", ""];
//By making the trigger local and using this
//the action runs only on the machine of the player who selected the radio option
//making it perfect for specific player interactions in multiplayer.
#

again im afraid to try this ๐Ÿ™‚

thin fox
#

I am too

pallid palm
#

lol he he

proven charm
#

setTriggerStatements cannot be set twice ๐Ÿค”

hushed turtle
#

What is that second line with \"\" even doing?

pallid palm
#

im not sure m8 im just a newbe

thin fox
#

the first syntax is missing "

#

ah, I see what you tried to do

pallid palm
#

im hoping you guys can figure it out and tell me what im doing ๐Ÿ™‚

thin fox
#

but I don't undestand those \

pallid palm
#

yeah im not sure what thats for myself ๐Ÿ™‚

#

but if i get this stuff to work, i don't want the radio triggers to go away, i want them to stay on the players mach, and set the radio triggers to repete

hallow mortar
#

It looks like those are meant to escape the " because those are syntax-relevant characters in whatever context this was written in. Where did you get this?

pallid palm
#

i can't remeber i think it was on the wiki

#

i was just grabing stuff to try to figure it all out

#

but im not sure where i got it really

hallow mortar
#

Seems likely. I think " means stuff in wiki markdown. It should've been invisible to the reader but oh well, it's not always done right.

#

I'd strongly recommend that you read and understand the code before pasting it and telling other people to use it, though.

pallid palm
#

oh sorry i did not tell others to use it: was hoping they could figure it all out for me: from what i found

#

right now: i can only have radio triggers work on all players: or only the host player

#

so like Kiba was saying: i would like to target just the player that Activated the radio trigger

#

but i don't know how to do that yet: ๐Ÿ™‚

split ruin
winter rose
#

wat

pallid palm
#

did you try it does it work ?

split ruin
#

I tried

_player = thisList select 0; 
if (!local _player) exitWith {};

seems to work, no errors but need testing in real MP

pallid palm
#

ok cool thx m8

#

i'll try it and i'll let you know

#

w8 a min there's no thislist on a radio trigger

#

a radio trigger has no radius

#

players can not be in a radio trigger

#

they can only Activate a radio trigger

split ruin
#

thisList is whoever activates the trigger's condition

pallid palm
#

oh hmmm ok i'll try it

#

lol now you got me thinking lol

#

really i think we must

#

i think what i must do is: if the player Activates the radio trigger on the server: then i must send the info to the players mach: then back to the server: to get only that player to Activate the code

#

or something like that

#

in a hosted server

split ruin
#

Its simpler ... the code is executed on every client but the server (or only on server if you checked server only). We need the code to be executed only on one client that activated the radio trigger and since there is not such option we just exit the code on every one else client but one. Its the same idea like

if (!isServer) exitWith {};

but condition is the player object should be **local ** to player's machine
or it "owns" this unit

pallid palm
#

hmmm ok m8 i'll try it and see what happends

split ruin
#

I already test it and work without errors and the radio trigger works too
I need Saturday to come faster so I can check when we play MP

pallid palm
#

same here m8 ๐Ÿ™‚

#

so in the condition of the radio trigger i put ?

split ruin
#

I suspect if you use player command it already selects the local player, that's why @winter rose reacted

#

@pallid palm yesh in the beginning

#

then you put your code

pallid palm
#

copy

#

hmmm i'm not sure i understand: cuz all players are local, i'm not sure whats hmmm happening here

#

in the onActivation of the radio trigger i have ```sqf
[] spawn SFA_fnc_playerDoWhatever;

#

i'm almost sure that

#
_player = thisList select 0; 
if (!local _player) exitWith {};
#

is only working on the host player

fair drum
pallid palm
#

copy that

hushed turtle
pallid palm
#

yeah radio triggers are funny knida

#

i'll get it right some day

#

or one day

#

there is 1 sure way to do this: is to make a radio trigger for each player on the server: but i don't want to do that

#

cuz my chopper command uses 5 radio triggers

hushed turtle
#

Isn't possible to create radio using purely scripting anyway? Like completely avoiding triggers, even scripted ones?

pallid palm
#

by gorge i think i got it Woohoo

#

we will see i'll let you know Woohoo ๐Ÿ™‚

#

this is what iv come up with

#
//Scripting with remoteExec

//Global Trigger:
//Place one radio trigger in the editor that all players can activate (e.g., Radio Alpha).

//Server-Side Script:
//Have the trigger call a script (e.g., DoWhatEver.sqf) on the Server.
//remoteExec in Script:
//Inside DoWhatEver.sqf, use remoteExec to run code on the specific client who activated it. 

// In the global radio trigger's "On Activation" field
[player] remoteExec ["DoWhatEver", 2]; // Send the activating player to server (2)

//in my case i use
[player] remoteExec ["SFA_fnc_DoWhatEver", 2];

//  In a separate file,    DoWhatEver.sqf
// This code runs on the server, receiving the player who activated it
params ["_activatingPlayer"];

// Then use remoteExec to run a *local* command back to that player's machine
_activatingPlayer = _activatingPlayer; // Ensure it's the actual player object
_activatingPlayer remoteExec ["my Local effect", _activatingPlayer];

//Key Concepts
//player Variable:
//In a trigger's local script (or remoteExec target)
//player refers to the unit on that specific machine

//Trigger Locality:
//Standard radio triggers activate globally in multiplayer
//but their On Activation code runs locally on each client, which can be tricky
#

by gorge i think i got it Woohoo

hushed turtle
#

How do you know who activated it?

pallid palm
#

well atm i just have this in the condition

#

but i may need to change that

#

like maybe local player

#

or player == player or something like that

#

im still trying to get it better

#

i have this in the coditiond and it seems to work

#

but need to test it on hosted server soon

#

but i kinda knew we had to send info back to the players mach. anyway

#

so do i get a pat on the back for that ๐Ÿ™‚ lol

#

he he

#

just kidding ๐Ÿ™‚

granite sky
#

It's kind of a standard pattern :P

#

You can use remoteExecutedOwner instead of sending the player, but that doesn't work if the originating client was a headless client.

pallid palm
#

copy that thx m8

granite sky
#

oh yeah, also doesn't work in SP. So I'd generally avoid it.

pallid palm
#

i found it works in SP

#

but i may be just luckey im still trying to get it all together

#

the script that i run is only 9 lines

#

but you know me im trying to learn as much as i can

#

at my age i don't have a life time left ๐Ÿ™‚

granite sky
#

I guess it'll return 0 in SP which kinda works as long as you're only using it as a remoteExec target.

pallid palm
#

roger that

#

thats a roger

#

its so much fun tryin to get this stuff to work

#

for me anyway

pliant dagger
#
if (behavior Target_Contact == "Combat") then {titleText ["You spooked the contact", "PLAIN"];};
#

I haven't scripted in a while and feel like a legit idiot

#

I'm using this as the condition for a trigger and it kind-of makes sense to me but I can't figure out what's the problem

#

would anyone be able to help?

tulip ridge
#

Well behavior isn't a command is your first issue Nevermind, seems like its just not highlighted for some reason. I was thinking of combatMode

#

If you're trying to use some AI garbage, don't.

ocean pelican
#

damn.

pliant dagger
tulip ridge
granite sky
#

hmm. Does behavior work? I thought it was just the english spelling.

#

Of course setMarkerColor is American spelling.

tulip ridge
#

I copy/pasted from their code

pliant dagger
drowsy geyser
#

Is it possible to drag a dead body?

tulip ridge
drowsy geyser
#

Is there a workaround?

tulip ridge
#

A workaround for what?
There's no dragging anything in vanilla

#

It's not a feature

granite sky
#

There are however animations for it, so it's not hugely difficult to implement. At least for the live ones.

tulip ridge
#

Yeah
ACE has the most commonly used carrying/dragging, which yes does allow dragging dead bodies

granite sky
#

I vaguely recall some recent change that might have allowed dragging corpses? Not sure how that'd work though.

warm hedge
#

I've ever tried addForce workaround. It was messy solution but it I polish it it maybe would shine like a good solution

tulip ridge
#

ACE just uses a dummy unit that you drag instead, and just swaps them on drag start/end

granite sky
#

yeah that makes sense.

old owl
#

I mean probably as easy as just setting actions, animations and attachTo right? I think KOTH does it in Vanilla iirc?

warm hedge
granite sky
#

For AI dragging we attach the AI unit in the dragging position to an invisible one that's walking normally.

drowsy geyser
#

So i could attach a dead body or has to be a living body?

granite sky
#

Whatever ACE does is usually the best way :P

#

They have a lot of experience in weird hacks.

tough abyss
#

Hey guys, looking for a scripter for my project - anyone looking to join a project ?

drowsy geyser
#

I guess i will setUnconscious the unit and drag him, thats the safest way

#

Using the animations too

signal flume
#

Wow you guys are everywhere!!

#

Howdy hi

tough abyss
#

need to be ๐Ÿ˜‰

signal flume
#

๐Ÿ˜ƒ

tough abyss
#

its passion, i'd make love to it if i could :p

pallid palm
#

there is one kind-a dragging in vanilla:

#

Dragging your feet the next day from Coding all night ๐Ÿ™‚

#

just a little joke ๐Ÿ™‚

#

Hay make sure you guys are eating right: good food and stuff: we don't want to lose anyone: we need you guys so much ๐Ÿ™‚

#

well i need you guys so much ๐Ÿ™‚

manic sigil
#

Man, I just cant get this sound to work...

Filed under root folder \ sounds, as 'IncomingAlarm.ogg', with

class CfgSounds
{
    sounds[] = {};
    class incomingalarm {
        name="incomingalarm";
        sound[]={"sounds\IncomingAlarm.ogg",1,1};
        titles[]={};
        };    
};

in description.ext.

manic sigil
#

Yeah, that's the file name and extension. using

playSound "incomingalarm";

Just produces the 'Sound IncomingAlarm not found' error popup.

#

Debugbox, trigger, doesn't matter.

pallid palm
#
saving = 0;
//thx Lou Now i got this right

class CfgSounds
{
    sounds[] = {};
    class Cool
    {
        name = "Cool";
        sound[] = {"sound\Cool.ogg", db+10, 1};
        titles[] = {};
    };
};
```ok i fixed it Lou  thx Mate
winter rose
#

iirc (but maybe I'm wrong), the game looks by default in the /Sounds/ dir, I may be terribly wrong ofc

winter rose
pallid palm
#

copy that

manic sigil
#

Hrn, I may be unfortunately on to something; I stripped out that section and made a blank VR map scenario, threw it into it's description.ext and copied over the Sounds folder, and it worked.

I'm working with my Arma group's mission framework, maybe they did something wonky that redirects where it's looking. I'll have to bug them directly :/

manic sigil
#

... actually, now that I reopened it, I'm seeing the issue ๐Ÿคฆโ€โ™‚๏ธ

#

They have a whole paragraph explaining how to use the section for new missionmakers, but forgot to mention they comment-blocked it all out.

pallid palm
#

Lou what do you mean: use quotes please ?

winter rose
pallid palm
#

oh hmmm

#

why does it work without quotes hmmm

#

thats funny

winter rose
#

because the engine tries to fix your mistakes
make it not

pallid palm
#

ok cool thx m8 Awsome

#

oh and thx to the engine ๐Ÿ™‚

pallid palm
#

hay @winter rose do i need a forward slash also / ?

#

or em i being nutty ๐Ÿ™‚

winter rose
#

I don't remember if A3 supports forward slashes, it should do both

pallid palm
#

was thinking cuz its a config file

#

it does Both ๐Ÿ™‚ people say no: only back slash \

ancient kestrel
#

Hello, can someone help me?
I am trying to make SP mission in Editor and faced a problem: I can't understand how to make unit speak in chat, like with his name and text.
I searched how do it, and sadly it seems impossible to do through modules. I placed a trigger and wrote this in In Act field:
unit1 sidechat "text";
sleep 5;
unit sidechat "text";
It gives error 'Suspending not allowed in this context'. How can I make unit speak without messing with code in mission folder outside the game, is it even possible? And I don't understand how to force his name to be visible, it only gives 'Alpha (Alpha 1) "text"'.

warm hedge
#

Also no to crosspost, thanks

ancient kestrel
hallow mortar
#

The second part of your question: using sideChat, you can't make the unit's name appear. Built-in channels like Side have their own rules for what callsign is displayed, and in the case of sideChat, for AI it's only their group ID. You can either set the group ID to be what you want (setGroupID/Global) or create a custom channel with whatever callsign suits you.

pallid palm
#
// which is correct in the  description.ext ?
enableSaving = [false, false];

enableSaving = {false, false};
#

im not sure

warm hedge
pallid palm
#

hallucinating yourself what does this mean

winter rose
#

whenever there is doubt, see the doc please

ancient kestrel
pallid palm
#

ok thx you could of just showed the wiki: insted of being nutty don't you think

#

but i see some people have personal things going on: be that as it may thx any way

warm hedge
#

I actually showed you one of the wiki article

pallid palm
#

yeah and thats good thx

ancient kestrel
#

@warm hedge @hallow mortar
Sorry for a ping, but I don't really understand how to use "spawn".
I don't know anything about how to code, thought it will be easier to learn how to make missions.
Can you help me and tell how to properly make units speak in chat, please? Google doesn't help at all.

hallow mortar
#

There are two contexts for executing SQF code in Arma 3. Unscheduled, and scheduled. Unscheduled code is executed right now, in the current simulation frame. It's not managed by the script performance manager (the scheduler) and cannot be delayed. This makes it good for time-sensitive applications, but it also means slow code can result in slow frames, and you can't use suspension like sleep. Trigger code fields are unscheduled.

spawn is used to create a new scheduled thread. The thread is managed by the scheduler, and is allocated a per-frame time budget. If it exceeds the budget it can be delayed to the next frame. Because the scheduler is able to delay and resume threads, scheduled code can use suspension like sleep.

#

Because you're in an unscheduled context and you want to use suspension, you should use spawn to create a new scheduled thread to execute your code in.

hallow mortar
ancient kestrel
pallid palm
#

oh i see thx Nikko

hallow mortar
#
_arguments spawn _code```
Your code doesn't require any arguments, so that can be `0`. Your code is...your code, so we slap that in there. So:
```sqf
0 spawn {
    unit1 sideChat "something";
    sleep 5;
    unit2 sideChat "something else";
};```
ancient kestrel
hallow mortar
#

"arguments" is just the technical term for "information that needs to be given". Sometimes it's also called "parameters". In the case of spawn and call, it's anything you want to make specifically available to the new code. It's a good way of making one piece of code that can accept dynamic inputs, instead of hard-coding specific references.

ancient kestrel
#

And I still don't understand how to make units actual names displayed instead of their group name...
Tried to create custom channel - seems to be too complicated and I was immediately scared. And I can't understand what is 'group ID' and how it works.

hallow mortar
#

The brackets are used to indicate a Code data type. It's like putting a piece of code in an envelope so it can be manipulated and passed around before being given to a command like spawn, which opens the envelope and reads the code to execute it.

ancient kestrel
hallow mortar
#

Working with custom channels is a little complex, but those are your choices: make a custom channel, or keep using Side chat and change the group's callsign.

ancient kestrel
signal flume
#

Anyone else having issue with their C# ?

#

Just got back into plugin creation a week ago and been chipping away at something which I been thinkin of

#

Tried a simle hello world, nay say

turbid frost
#

Quick question regarding the Arma3 scheduler.

When a script runs in a scheduled environment, it says it can run for a max of 3ms before it gets interrupted...

Whenever the scheduler decides to run the script again, does it resume from previous line where it stopped? what's the actual behaviour and how does it affect script semantics?

granite sky
#

Yeah, it resumes exactly from where it was.

#

I'm not sure what exact scheduler break rules are. Loops can certainly be interrupted halfway.

ruby spoke
#

Is there any way to return all variables attached to a certain namespace? eg. profileNamespace

turbid frost
# granite sky I'm not sure what exact scheduler break rules are. Loops can certainly be interr...

Alright, I was reading through Advanced Equipment github repository (the ArmaOS mod if you know what I'm talking about) and a user opened a pull request where he proposes a revamped version

In said revamped version he basically implements a way to do mutexes, but in theory they can't work because the scheduler at any point can interrupt the current "thread" and in doing so breaking atomicity.

Thanks for your answer

p.s. I'd like to provide you with a link but I was blocked by automod ๐Ÿ™

granite sky
#

It's not "at any point" and you can make substantial expressions that are atomic

#

even without using isNil {}

#

But the atomicity is not documented.

old owl
#

I get it, better to try and understand then throw something at a wall and make it stick but like... come on dude ๐Ÿ˜ฆ

silent comet
#

Is there anyway to trigger the Zeus' atomic bomb through a trigger or is the module the only way?

radiant lark
#

Typical italian crashout ngl

#

Specially coming from naples

#

Damn dude I have read the whole lore

hallow mortar
#

The atomic bomb module is added by a mod btw, either Zeus Enhanced or Ares/Achilles. You should be able to find it in the Functions viewer under that mod's category, or you can look up the mod on Github and read the code there.

placid root
#

lol too lazy to google "all variables arma 3"

hollow pilot
#

hallaucinates?, don't you think ur going a bit far here? this is a channel for arma 3 scripting not for throwing mockery or insults mate

#

just keep things civil

radiant lark
#

Tbh I just thought the community (including @warm hedge) would have more love for veterans.

cyan dust
#

Why don't you f off of him then? thonk
I don't care how 'correct' he is, he means good and tries to help others. That counts.

warm hedge
#

I need to admit I made an unnecessary hostility and results a series of clutter which should not take place in this channel (nor anywhere this server actually). I can try to justify myself but I should not for reasons, <@&105621371547045888> may act if I needed to be punished. For the record I'll leave it for now and I for one will not moderate myself since it's going to be extremely unfair, but moderators may, so please don't put more replies to the tree

queen cargo
#

@tough abyss i cannot imagine of any system capable of holding a ton of units with different groups to prevent em from clunching
right now ... i try some weirdo combination with doStop and various other commands ... it kinda works ... however ... they rly just stand aroudn right now which is kind of expected as i ordered them to "do Stop" ...
i hate arma sometimes

winter rose
#

anyway POLPOX is right here, let's not make it X vs Y โ€“ this channel is about helping and sharing, modding is about helping and sharing, and I recommend everyone reading and abiding by @old owl's message: #arma3_scripting message

lime rapids
#

quick sanity check, if you remotexec an addaction does it effect hide on use paramater functionality?

hollow pilot
#

@lime rapids not at all it should function just as it is, though be careful with remoteexec