#arma3_scripting

1 messages · Page 658 of 1

little raptor
#

also, don't use name _x for marker names meowsweats

wind hedge
#

😅

little raptor
#

mrkNull = ""

#

empty string

#

(as I said, markers are strings)

wind hedge
#

I mean _marker = mrkNull;, instead of ""

cosmic lichen
#

no

#

marker is just a string

little raptor
#

makes zero sense

wind hedge
#

ok got it

#

but when the marker exists... it is still just a string?

little raptor
#

yes

cosmic lichen
#

yes

wind hedge
#

okok

#

testing now

little raptor
wind hedge
#

why is wrong to use name _x for the marker name? I want just one marker per contact... that way if the old marker hasn't been deleted yet the new one won't be created...

winter rose
#

_marker is the marker's name

cosmic lichen
wind hedge
#

I don't mean in _marker but here:

#

_contactName = name _x;
_marker = createMarkerLocal [_contactName, getPosWorld _x];

cosmic lichen
#

That's why it is wrong

#

nvm

wind hedge
#

Ok what is the best way to give the marker a random name?

cosmic lichen
#

I thought _x was the marker

wind hedge
#

_x is a unit or an agent for the script

little raptor
#

@wind hedge just use str _x

#

not name _x

wind hedge
#

ok perfect!

#

Thanks

#

str agent _x;

#

works too?

little raptor
#

yeah

#

in fact it must be an object

#

also it might be a good idea to remove the vehicleVarName meowsweats
then set it back

spark turret
#

anyone got a good class for a CAS bomb to spawn and explode?

cosmic lichen
#
{
    private _target = leader _x;
    if (expectedDestination _target # 1 != "DoNotPlan" && alive _target) then
    {
      _target spawn
      {
        scriptName 'ENH_Attribute_DebugPath';
        private _arrow = objNull;
        private _arrowColour = format ['#(rgb,8,8,3)color(%1,%2,%3,1)', random(1), random(1), random(1)];
        private _path = [];
        private _marker = createMarker [format ['ENH_DebugPath_%1', str _this], _this];
        _marker setMarkerShape "polyline";
        _marker setMarkerColor configName selectRandom ("true" configClasses (configFile >> "CfgMarkerColors"));

        private _posOld = getPos _this;

        while {alive _this} do
        {
          if ((_this distance _posOld) > 20) then
          {
            if (GETVALUE("DebugPath") > 1) then
            {
              _arrow = createVehicle ['Sign_Arrow_Direction_Blue_F', position _this, [], 0, 'CAN_COLLIDE'];
              _arrow setObjectTexture [0, _arrowColour];
              sleep 0.2;
              _arrow setDir (_arrow getDir _this);
            };
          _path append [getPos _this # 0, getPos _this # 1];
          _posOld = getPos _this;
          if (count _path > 3) then {_marker setMarkerPolyline _path};
          if (count _path == 500) then {_path deleteRange [0, 2]};
          sleep 0.2;
          };
        };
      };
    };
  } forEach allGroups;```

I am looking for suggestions to make this a bit faster. Any ideas?
little raptor
still forum
#

("true" configClasses (configFile >> "CfgMarkerColors")); don't do that for every group, do it once before the loop

cosmic lichen
#

Faster was not the right word I guess. Less performance heavy? 😬

still forum
#

don't create vehicles

cosmic lichen
#

ohhh

#

simple objects might be way faster

little raptor
#

but don't explode meowsweats

#

and can't "fly"

cosmic lichen
#

They don't have to

little raptor
cosmic lichen
#

hmm looks like the vehicles aren't the issue

#

THe polymarkers maybe 🤔

spark turret
#

well my bombs just wont spawn:
"Bo_Mk82 " createVehicle ((getPos _plane) vectorAdd [0,0,-10]);

#

positions are all correct and debugged

little raptor
#

you think? 🤣

#

I think I've mentioned that a million times on this channel notlikemeow

spark turret
#

?

#

its all ASL

spark turret
#

that was just for debugging, i have an array of positions

#

they have the correct ASL height

spark turret
#

it returns null object as my bomb

#

uh space

#

oh ffs

#

okay now they are spawned, says 6270932Bombs_01_fls.p3d. but the bomb doesnt show up on my zeus and has no impact.

#
        {
            [_x,str _forEachIndex] call _createDBMarker;
            systemChat str ["bombpos: ",str _x];
            _bomb = "Bo_GBU12_LGB" createVehicle (_x vectorAdd [0,0,10]);
            {
                _x addCuratorEditableObjects [[_bomb], true];    
            } forEach allCurators;
            sleep random 0.5;
            systemChat str _bomb;
        } forEach _bombPosArr;
little raptor
#

doesnt show up on my zeus

#

you can't edit bombs meowsweats (afaik)

spark turret
#

yeah positions are ASL

little raptor
#

then use setPosASL

spark turret
#

on the bombs?

little raptor
#

yes

spark turret
#

well i tried spawning quadbikes instead, and that worked

little raptor
spark turret
#

OH YEAH

#

setPos asl worked!

#

oh thats sick. gonna commit a whole lot of warcrimes punitive expeditions now

finite sail
#

oh no, thats not what you asked

#

soz

cosmic lichen
#

Read the examples

#

yes, but the last "," has to be removed

#

yes

#

Which I wrote years ago

#

Exactly

hallow mortar
#

The answer to the original problem with sideChat is to set the characters' group callsigns with setGroupID, since the cause of the problem is sideChat displaying only the group callsign when used on AI

#

And don't forget to properly broadcast commands if this is a multiplayer mission, otherwise only the server will see the messages, have the right callsigns etc.

#

The above example will show the subtitles for whichever client the script is run on, so you need to either run the script on all clients (carefully) or remoteExec the function call (carefully)

#

This use of setGroupID is one of the few cases where you can safely use the unit's init field, but don't make a habit of it

cosmic lichen
#
speaker_1 setGroupId ["Cpt. Miller"];  
speaker_1 sideChat "Hello ladies!"
#

speaker_1 is the variable name of an object (some unit)

hallow mortar
#

Reading back through, it looks like this is all going in a script activated by a trigger. That's good.
For best locality control, put all of this in that script file, make the trigger Server Only, and have the trigger broadcast the script to all clients e.g.

[[],"talk2.sqf"] remoteExec ["execVM"]```
then anything in the script will be run for every client without worrying about further remoteExecs
#

(do not do this if your script contains other commands that already have Global effects; their effects will be duplicated by the number of connected clients)

opal ibex
#

Am i blind or is there no way to access a backpack inventory that is not on a unit?

winter rose
#

…scripting-wise, sorry 😅

opal ibex
#

Yeah, i need it via a script. I can get a weapons loadout with weaponsItemsCargo but on a backpack i can only get its classname and not what it has inside

wind hedge
#

@little raptor @cosmic lichen The motion Scanner script is working like a champ! Thank you guys! The markers even have pseudo animation like I wanted, looks quite like the one from aliens... https://i.ibb.co/X2Pms92/Motion-Scanner1.jpg

wind hedge
#
vShowAllyOnMap = {
    findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
        _display = _this#0;
        if ((visibleMap OR visibleGPS) && diag_fps > 15) then {
            {
                _icon = getText (configfile >> 'CfgVehicles' >> typeof _x >> 'icon');
                _display drawIcon [
                    _icon,
                    [0,0,1,1],
                    getPosVisual _x,
                    24,
                    24,
                    getDirVisual _x,
                    name _x,
                    1,
                    0.03,
                    'PuristaMedium',
                    'right'
                ];
            } forEach (units (side player) select {isFormationLeader _x OR group player isEqualTo group _x});
        };
    }];
};
#

👆 Any Idea why this shows icons correctly on the map but not on the GPS mini map

#

I am guessing it has to do with findDisplay 12 displayCtrl 51 ctrlAddEventHandler

distant oyster
#

the map and the gps are different displays and therefore different controls as well

little raptor
#

@wind hedge Also don't use getPosVisual meowsweats

dusky pier
#

Hi, i making mission with enemy AI, and have problem with them.

When player enter AI base - they don't see player before being attacked.

Is possible to somehow scan radius and mark player as target for them?

dusky pier
#

@little raptor ty

tough abyss
#

Probably a long shot but is it possible stop the ai from taking a certain stance, lets say prone, but still allow them to switch between the other 2, crouch/standing

little raptor
tough abyss
#

nah im talking enemy ai? like i want them to be standing around guarding some where but if they go in combat mode there not locked to a single stance

#

while avoiding prone

#

tired of ai going prone behind sand bags when they could be crouched and watching the door way

#

but at the same time it is posible for the player to get there undetected so it dosnt make sense for them to be crouching already

winter rose
#

maybe a tweak between setUnitPos and setUnitPosWeak, but there is (unfortunately in that case) no "minUnitPos"

wind hedge
little raptor
#

use another visual variant

#

like getPosASLVisual or getPosWorldVisual

tough abyss
#

hmm thats annoying and seems like an oversight

#

not related to your post leopard20

little raptor
tough abyss
#

hmmm i suppose il just have to work around it then and have the guards be static and disable their move animations and have a trigger that switches them to the appropriate alerted stance

wind hedge
#
vPreventAiProne = {
    params ["_aiUnit"];
    _aiUnit addEventHandler ["AnimStateChanged", {

        if (isNil "AiAnimStateChangedTimeOut") then {AiAnimStateChangedTimeOut = time;}; //Prevents EH Spam
        if (time < AiAnimStateChangedTimeOut) exitWith {}; //Prevents EH Spam
        AiAnimStateChangedTimeOut = time + 5; //Prevents EH Spam
    
        params ["_unit", "_anim"];
        private _onFoot = isNull (objectParent _unit); // check for vehicle
        if (!_onFoot) exitWith {};     // no further action if unit in vehicle    
        
        if (stance _unit isEqualTo "PRONE" && !(isPlayer (leader group _unit))) then {_unit disableAi "WEAPONAIM";} else {_unit enableAi "WEAPONAIM";};
        if (canStand _unit && !(isPlayer (leader group _unit))) then {
            if ((behaviour _unit in ["AWARE","COMBAT"]) && stance _unit isEqualTo "PRONE" && speed _unit < 1) then {
            [_unit, "MIDDLE"] remoteExec ["setUnitPos", _unit];
            } else {
            [_unit, "UP"] remoteExec ["setUnitPos", _unit];
            if (speed _unit > 1) then {[_unit, "UP"] remoteExec ["setUnitPos", _unit]; [{params ["_unit"]; [_unit, "AUTO"] remoteExec ["setUnitPos", _unit];},_unit,4] call CBA_fnc_waitAndExecute;};
            };
        };
    }];
}; ```
#

What I use, Leopards' probably better thou

wind hedge
little raptor
#

yes

tough abyss
#

will assign turret make the unit its assigning to the turret move to get on a turret

wind hedge
#
vShowAllyOnGPS = {
    waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])};
    private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];

    // Controls
    private _miniMapControlGroup = _display displayCtrl 13301;
    private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;

    _miniMap ctrlAddEventHandler ["Draw", {
        _display = _this#0;
        if ((visibleGPS) && diag_fps > 15) then {
            {
                _icon = getText (configfile >> 'CfgVehicles' >> typeof _x >> 'icon');
                _display drawIcon [
                    _icon,
                    [0,0,1,1],
                    getPosWorld _x,
                    24,
                    24,
                    getDirVisual _x,
                    name _x,
                    1,
                    0.03,
                    'PuristaMedium',
                    'right'
                ];
            } forEach (units (group player));
        };
    }];
};
#

👆 Not working, no errors... don't know why, the map version works perfect but this one for the GPS mini map does not...

#

👆 It seems you can draw icons on the GPS mini map

worthy willow
#

@wind hedge how are you execing your code?

wind hedge
#

[{[] call vShowAllyOnGPS;},[],(10 + random 10)] call CBA_fnc_waitAndExecute;

quaint maple
#

sorry to intrude im extreamly new to arma but do to my situation im gonna have to do alot of self scripting i was wondering if anyone had advice for a beginner

little raptor
wind hedge
#

I can't overuse spawn and can't overuse CBA_fnc_waitAndExecute 😦

little raptor
quaint maple
#

please and thanks

winter rose
quaint maple
#

thank you

fresh wyvern
#

Hi, any one who knows why this creates:
1 "B_helipilot_F" driver
1 "B_helicrew_F" commander and
2 "B_helicrew_F" gunners?
(and two "B_helicrew_F" passengers..)

_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle(player modelToWorld [8,0,0]); 
 
[_veh, ["B_helicrew_F", 2,3,4,5,6], false, true, false] call BIS_fnc_initVehicleCrew;

What I am trying to figure out is how to make the driver not apperar.

willow hound
fair drum
#

anyone got any good videos on doing an animated opening with bis_fnc_animatedOpening?

fresh wyvern
wind hedge
#

so, if I add this to description.ext it does draw on the GPS mini map (requires CBA)

#
class Extended_DisplayLoad_EventHandlers {
    class RscCustomInfoMiniMap {
        VAL_DrawGPS = "\
            params ['_display'];\
            private _control = _display displayCtrl 101;\
            _control ctrlAddEventHandler ['Draw', {systemChat str diag_frameNo}];\
        ";
    };
}; ```
#

I just don't know how to run my custom fnc instead of {systemChat str diag_frameNo}

smoky verge
#

how can I rotate an object with a set amount of force akin to setVelocity?

pine solstice
#

wonder is some kind person could help me with a mission param i am trying to make

_pos = getMarkerPos "mrk1";
 
for "_i" from 0 to PARAMS_SquadsPatrol do 
{
        _randomPos = [[[getMarkerPos "mrk1", 50]],["water"]] call BIS_fnc_randomPos;
        _spawnGroup = [_randomPos, EAST, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_fnc_spawnGroup;
   
       [_spawnGroup, _pos, 50] call Bis_fnc_taskPatrol;
 };

the error i am getting

_randomPos = [[[getMarkerPos "mrk1", 50]],["water"]] call BIS_fnc_randomP>
21:40:11   Error position: <]],["water"]] call BIS_fnc_randomP>
21:40:11   Error Missing ]
21:40:11 File C:\Users\gaffe\Documents\Arma 3 - Other Profiles\Gaffey\missions\SAS OP VIROLAHTI\TEST.Stratis\sidemissions\side2.sqf..., line 39
surreal peak
#

[[getMarkerPos "mrk1", 50]] why is that double bracketed?

pine solstice
#

_randomPosAroundPlayer = [[[position player, 50]],[]] call BIS_fnc_randomPos;

i was gong off BIS wiki and and i use to use a simple thing

naive needle
#

For the Dynamic Simulation, when a player is near vehicle for example, does it activate the simulation only for him or for all players on the server ?

willow hound
willow hound
willow hound
wind hedge
naive needle
#

@winter rose ty

fresh wyvern
#

Is there perhaps a way to delete driver AI via a script?

winter rose
#

Yes, veh deleteVehicleCrew driver veh

smoky verge
#

anyone ever had issues with addTorque?
it seems to not apply sometimes

fresh wyvern
smoky verge
#

I'm at extremely low values, it seems that after 0,09 it doesn't apply

willow hound
#

Well it does some PhysX thing 🤷‍♂️

#

So I suppose if the game engine or PhysX decide that the applied force is not sufficient, no movement happens

fresh wyvern
winter rose
#

if we are talking about broken vehicles

fresh wyvern
winter rose
#

that might be an AI mod thing

wind hedge
#

what is the smartest way to do this: forEach ((units group player)-player);

#

selecting all units part of a group without the player calling the fnc

winter rose
#

forEach (units player - [player])

wind hedge
#

Thanks!`

still forum
little raptor
still forum
#

you can have thousands of waitAndExecute and they won't need any more performance than just having one

#

except if their wait is over of course

#

wheras sleep will check everytime as often as it can if the sleep is over

little raptor
#

you're a dev now 😅

winter rose
#

"I would like a crate of optimisation, please!"

limber panther
#

hello! Can someone help? In editor i unchecked receiving damage in vehicle atributes but the vehicle still gets damage - flat tires, demaged engine etc. Is there a script that would prevent a vehicle from taking damage?

winter rose
limber panther
#

that's right

#

so... there's no way to prevent a specific vehicle from taking damage?

winter rose
#

myVeh allowDamage false

#

should do, but I can't guarantee a mod won't interfere as well

little raptor
#

same difference

idle jungle
#
missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player]```

is this a local or global command? 

i.e. can this script pickup a player who remote controls a unit on the server
little raptor
#

no

limber panther
winter rose
#

that's what the tickbox does, so you might have to delay it

#

as for the SQF highlight, see the pinned message about it 😉

limber panther
#

i don't get it, never mind, also may i ask how to set game difficulty on a dedicted server?

idle jungle
#

arma profile

#

on the server

limber panther
little raptor
# still forum wheras sleep will check everytime as often as it can if the sleep is over

Is this what you mean?

{
        if (_x select 0 > CBA_missionTime) exitWith {};

        (_x select 2) call (_x select 1);

        // Mark the element for deletion so it's not executed ever again
        GVAR(waitAndExecArray) set [_forEachIndex, objNull];
        _delete = true;
    } forEach GVAR(waitAndExecArray);

it sorts the array and exits once it matches a script that hasn't reached it's time

#

then optimize it meowsweats
I guess you can't optimize it after all 😛

agile pumice
#

Is there a specific discord for ACE scripting?

slim oyster
#

There is an ace slack

agile pumice
#

Alright, I'll look into it

agile pumice
#

I'm having a bit of trouble with the whole worldtomodel thing, I'm getting the position using this:

player worldToModel ASLToAGL getPosASL (vehicle player)``` but the position renders in a different place from where I expect it to be
#

For example,

addMissionEventHandler ["Draw3D", {
  _posDriver = [0.0151367,0.603027,-0.756775]; //player worldToModel ASLToAGL getPosASL (vehicle player)
  _posCargo = [0.00183105,0.731201,-0.841608]; //player worldToModel ASLToAGL getPosASL (vehicle player)
  _color = [1,1,1,1];
  _worldPosDriver = atv modelToWorld _posDriver;
  _worldPosCargo = atv modelToWorld _posCargo;
  drawIcon3D ["a3\ui_f\data\igui\rscingameui\rscunitinfo\role_driver_ca.paa", _color, _worldPosDriver, 1, 1, 0, "Sit Here (driver)", 1, 0.05, "TahomaB"];
  drawIcon3D ["a3\ui_f\data\igui\rscingameui\rscunitinfo\role_cargo_ca.paa", _color, _worldPosCargo, 1, 1, 0, "Sit Here (passenger)", 1, 0.05, "TahomaB"];
}];

``` the passenger position shows in front of the driver position for the quad bike
little raptor
#

_posDriver = [0.0151367,0.603027,-0.756775]; //player worldToModel ASLToAGL getPosASL (vehicle player)
_posCargo = [0.00183105,0.731201,-0.841608]; //player worldToModel ASLToAGL getPosASL (vehicle player)

#

both are in front of the model

#

what'd you expect?

agile pumice
#

I just figured it out before I checked your reply, I should have defined the position using (vehicle player) worldToModel (position player)

hushed tendon
little raptor
hushed tendon
#

oh

#

Thanks

still forum
agile pumice
#

How do you override an eventhandler with a boolean again? say I want to write my own exit function for the getout event handler and cancel the default event?

still forum
#

not every eventhandler supports that

#

only a few specific ones

agile pumice
#

ah, okay thanks

idle jungle
#

Is anyone else having the issue
When using setUnitCombatMode "BLUE";
on a group, when under fire the group leader is giving the open fire command taking them out of BLUE

#

I believe it happens on blue green and white

#

Gonna make a repo mission and open a ticket :)

#

would it be under AI Issues or Scripting (when making bug report)

idle jungle
#

also trying Also trying
disableAI "WEAPONAIM" and or
"AUTOTARGET" and or
"AUTOCOMBAT"

Does nothing as well

agile pumice
#

It seems when I define a cfgSounds class in my mission file, I have to link the sound path also from the mission file, is there a way around this?

west grove
#

hm can i change the vehicle texture style based on the defined TextureSources or do i have to setObjectTexture everything myself?

west grove
#

nice, exactly what i need. thanks

kindred blaze
#

Tried googling my ass off, could only find older mods/scripts. Anyone knows of a decent lootspawner script that has different lootspawns for Military/Civillian/Industrial etc?

little raptor
#

Or maybe you could write it like CBA meowsweats

#

(sort only if new scripts added)

idle jungle
#

no mate

#

uploaded a ticket with a simple repro

spark turret
#

i assume you want crates with different stuff in it?

kindred blaze
#

What I want is a loot spawner that spawns loose loot inside buildings. Military buildings with a higher chance of military loot, Civillian items inside Civillian buildings etc. I've seen a few ready scripts, but they're so old. Do you know if scripts get "out of Date". Or could I possibly use an old one?

#

Imagine dayz kind of loot. I'd love to try and make one myself, but really don't know how to, and I cant seem to find a good tutorial on building a lootspawner script

spark turret
#

scripts dont really outdate. arma has 100% backwards compatibilty

kindred blaze
#

Ahh, Allright. I guess I'll just try a few different ones then and see if they work

spark turret
#

idk about positions in houses but bis_fnc_findSafePos is great for finding a position free of objects to place a lootcrate at. only works outside of houses tho

#

but houses have positions for the AI to stand at, maybe you could use that.

#

other than that its just building an array template for what kind of loot to but in a crate, and then randomly select from that.

kindred blaze
#

Sounds reasonable, I'll have to look up a few tutorials first tho, I've done some simple scripting, but I think I'd have to practice and learn more before I venture deeper. Thanks for the help! I'll start by downloading some made scripts and then I'll try to edit them to my liking. I highly appreciate your help

spark turret
#

np

#

i built a weighted lootspawner for another game, so if you need help with that, just ping me

kindred blaze
#

Will do, appreciate it 😁

little raptor
glossy pine
#

the locality of a vehicle changes if you get in as a driver only, or also if you get in as a passenger?

little raptor
#

I think passenger too. But not 100% sure

idle jungle
spark turret
#

iirc, in arma 2 you could order an airstrike or similar, it would wait for you to click on the map and then use that position. any idea how thats done?
is there a "playerclicked on map EH" or similar?

little raptor
#

yes

#

onMapSingleClick

#

use with bis_fnc_addStackedEventHandler

spark turret
#

oh boy, two new things. thats gonna take a bit to figure out

spark turret
#

i mean the easy way out would be to tell the player to create a marker called "target" and then use that 🤔

little raptor
spark turret
#

i wanna use my own airstrike, im only interested in the calling action

idle jungle
#

Re: the setunitcombatmode thing
I did try it on 2 out of the 4 units in a group but the leader still over rites the never fire command in BLUE

spark turret
#

that shouldnt happen afaik

#

are you sure your script command is effective? did you make sure the untis combatmode is actually changed?

#

also, combatmode is effective for the whole group, not single units

little raptor
#

I just tested it

#

Seems to be a valid issue

spark turret
#

oh what

idle jungle
fresh wyvern
#

Anyone who knows how to ad a squad of B_CTRG_Soldier_JTAC_tna_F to the cargo seats of the helicopter?
Using BIS_fnc_initVehicleCrew to place "cargo" seems to remove the already placed crew and instead add the B_CTRG_Soldier_JTAC_tna_F to the pilot seat.

_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);  
createVehicleCrew _veh;
_veh deleteVehicleCrew driver _veh; 
[_veh, ["B_CTRG_Soldier_JTAC_tna_F", "cargo"], true, true, false] call BIS_fnc_initVehicleCrew;
_veh setUnloadInCombat [true, false];
_dirP = getDir player;
_veh setDir _dirP 
little raptor
fresh wyvern
# little raptor create the soldiers then use moveInCargo

Where do I go wrong? I don't get the B_CTRG_Soldier_JTAC_tna_F to enter the vehicle.

_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);  
createVehicleCrew _veh;
_veh deleteVehicleCrew driver _veh; 
_cargo = "B_CTRG_Soldier_JTAC_tna_F" createVehicle (player modelToWorld [8,0,0]);
_cargo moveInCargo [_veh, 5];
_veh setUnloadInCombat [true, false];
_dirP = getDir player;
_veh setDir _dirP 

I've also tied with:

_cargo = "B_CTRG_Soldier_JTAC_tna_F"
_cargo moveInCargo _veh;
little raptor
#

Also I don't think moveInCargo takes indices

#

it's moveInCargoIndex afaicr

fresh wyvern
dreamy kestrel
#

Q: re: hashmap, new with recent A3 updates... it kinda wants to behave like an associative array, correct, but it is not an "ARRAY" per se, rather a "HASHMAP". can I "test" whether I "have" one? i.e. isNull?

#

also, once I have createHashMap is there a way to dispose of it, if necessary? i.e. deleteHashMap, or it is a memory hole at that point, use a singleton, etc, wisely?

fresh wyvern
#

Hi, anyone who know how to make the unit actually spawn in the cargo of the helicopter an not spawn running around outside?

_veh = "B_CTRG_Heli_Transport_01_tropic_F"createVehicle (player modelToWorld [8,0,0]);  
_unit = "B_CTRG_Soldier_JTAC_tna_F" createUnit [getPos _veh, group player];  
_unit moveInCargo [_veh];
hallow mortar
#

If the helicopter belongs to the player's group, there is a parameter for createUnit that creates the unit in its group's vehicle's cargo

#

I don't see any reason why moveInCargo wouldn't work. Just to be safe, try remoteExec'ing it using _unit as the locality argument

[_unit,_veh] remoteExec ["moveInCargo",_unit]```
#

And moveInCargo does accept indexes according to its wiki page

fresh wyvern
#

Is there any difference if the helicopter does not at present moment got the player in it?

hallow mortar
#

If it doesn't have any members of the group in it, it probably won't be considered to be "the group's vehicle", so the parameter for createUnit won't work

#

shouldn't make any difference for moveInCargo

drowsy axle
#

How can I know when the Arsenal display has been closed?

hallow mortar
#

What kind of error?

queen cargo
#

testing wether you have one can be done, like with many things, using typeName or isEqualType

hallow mortar
dreamy kestrel
#

@queen cargo appreciate the response. I guess I'll get creative using the usual tricks, because hash maps do not respond in quite the same way I am finding. but that's fine, for what it is.

queen cargo
#

mhh?

#

hashmaps are essentially normal objects in a lighter way

#

allowing custom namespaces without creating (and later then destroying) location objects eg.

fresh wyvern
hallow mortar
#

You're missing an underscore in front of unit

drowsy axle
fresh wyvern
hallow mortar
#

; at the end?

fresh wyvern
hallow mortar
# fresh wyvern it is there in game. Get same error.

Refer to "Alternate Syntax" here: https://community.bistudio.com/wiki/createUnit
createUnit is not returning a unit reference, which breaks moveInCargo.
Format like this:

"B_CTRG_Soldier_JTAC_tna_F" createUnit [_veh, group player,"this moveInCargo (nearestObject [this,""B_CTRG_Heli_Transport_01_tropic_F""])"]; ```
or use the first syntax of `createUnit` to return a valid unit reference:
```sqf
_unit = (group player) createUnit ["B_CTRG_Soldier_JTAC_tna_F",_veh];
_unit moveInCargo _veh;```
fresh wyvern
distant oyster
warm blaze
#

how to diag_log long string ?

cosmic lichen
#

diag_log _longString ?

#

@warm blaze

warm blaze
#

I have a string var with more than 255 chars

#

I would like to diag_log its value

#

but it prints only part of value in log file

#

using BIS_fnc_objectsGrabber to generate long string

cosmic lichen
#

Guess you have to split it up

warm blaze
#

copyToClipboard is the answer

cosmic lichen
#

Oh you want to copy it. Why didn't you say so

#

There is also a Uig in Eden Editor you can use.

#

display3DenCopy

still forum
cold pebble
#

Hi all, is there a eventhandler or a decent way to detect when a waypoint has been completed?

winter rose
cold pebble
winter rose
#

what is the use case?

cold pebble
#

Wanting some ambient civs to go around, once the waypoint is done gonna delete and give it a new one depending on where the players now are

winter rose
#

waitUntil { speed _myCivilian == 0 }; 😄
or waitUntil { unitReady _myCivilian };

#

or set WP statement to generate a new WP, directly

#

unlimited poweeer waypoooints!

cold pebble
#

speed could be a false positive tho 😛 If speed is 0 the AI might've used its big brain and crashed into a rock and got stuck

winter rose
#

true, it was a joke 😁

cold pebble
#

Fairs ;P

winter rose
#

add waypoint once
set trigger statement that

  • on execution: add waypoint with a statement that creates another waypoint with waypoint creation, etc
cold pebble
#

Triggers 😢

winter rose
#

you can link triggers to waypoints via script

cold pebble
#

_waypoint setWaypointStatements ["TRUE", _onComplete]; CBA seems to do this

#

So maybe thats the best way

agile pumice
#

how do you correctly define an array using #define? Do I need to wrap the array in parenthesis?

#define USAF_C130J_CARGOPOS1 [-1.50635,8.58154,1.83895]```
hallow mortar
cold pebble
#

Not an ideal solution, I was hoping for event based as I'm planning on having a decent amount of civs out at one

spark turret
#

where is the code of an ace action run when called by a player?

#

only on the client that activates the action?

queen cargo
still forum
#
 
BAR
regal night
#

Super noob question, how would I exclude the group leader from this? grpblue=group this;{dostop _x} foreach units grpblue;

#

oops wrong one.

winter rose
regal night
winter rose
tough abyss
#

how do i post uhm, script format? here

queen cargo
winter rose
still forum
#

!sqf

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
winter rose
#

weeeh, it werkz!

tough abyss
#

So, I'm trying to add "infinite seats" to a vehicle, perse, with the attachTo, issue i'm having is that the second "exit vehicle" addAction isn't really working here is the code sqf if (isServer) then { [vehicle1, ["Get in moron", {remoteExec [player attachTo [vehicle1, [0, 0, 0]],0];remoteExec[player setDir 180,0];remoteExec[player switchMove "InBaseMoves_SittingRifle2",0]; [vehicle1, ["Hop outa dah truck", {remoteExec [player attachTo [vehicle1, [0, -3, 0]],0];remoteExec[player switchMove "",0]}, [], 1.5, false, false, "", "true", 5, false, "", "" ]] remoteExec ["addAction",0];}, [], 1.5, false, false, "", "true", 5, false, "", "" ]] remoteExec ["addAction",0]; };

winter rose
#

remoteExec [player attachTo [vehicle1, [0, 0, 0]],0];
not how remoteExec works meowsweats

plush oriole
#

autonomous/drone turrets seem to have this weird extra fake recoil

#

like it fires a shot then moves up in the air slightly as if it's pretending to have recoil

#

then wobbles back down again and misses

tough abyss
#

remoteExec [attachTo [vehicle1, [0, 0, 0]],player,0];?

plush oriole
#

and there's zero recoil when actually controlling the turret

regal night
plush oriole
#

Do turrets like the mk30a have recoil that isn't applied when a player is controlling them?

tough abyss
#

for targets can I put player

#

or is it only a numerical value

spark turret
#

is there a way to get a full "loadout" array of a cargo container?

#

i dont see how i could get a full backpack inside the container

winter rose
tough abyss
#

Ok I understand the function parameters, but like, where would I put the [vehicle1, [0, 0, 0]] I'm assuming not inside the quotation marks

#

like for example

#
[remoteExec ["attachTo [vehicle1, [0, 0, 0]]",player,true]
spark turret
#

params go in front of the remoteexec

tough abyss
#

I understand it needs to be in this format - ```sqf
remoteExec ["attachTo",player,true]

spark turret
#

[myparams] remoteExec ["myfunction",target,fajtfah]

#
    params remoteExec [functionName, targets, JIP]```
tough abyss
#

so just like ```sqf
[[vehicle1, [0, 0, 0]]remoteExec ["attachTo",player,true]

winter rose
#

Almost

#

btw, why do you want to remoteExec that? 🤨 attachTo has a global effect

tough abyss
#

well, on a mp server, I want everyone to be able to see that player attached to the vehicle

#

i'm combining it with addAction

#

I thought everything is local until I use remoteExec

winter rose
#

nope, some commands have global effect (see eG icon on the wiki)

tough abyss
#

Man sqf hurts my head

winter rose
#

just imagine setDamage
it has a global argument (you can setDamage to an AI managed by the server)
and the effect is global (everyone of course will see the unit dead)

tough abyss
#

can you link me the wiki so I can learn all this

#

if there even is a specific wiki on locality, I haven't found one .

tough abyss
#

Thank you.

spark turret
tough abyss
#

ah. thanks!

spark turret
#

okay, so i was able to clone backpacks inside crates. everyBackpack gives you a reference to the loaded backpacks, so i get an array of all backpacks in the original, add empty backpacks into the clone crate, get a reference to them and then fill them with the same items the original backpack has. freaking recursion!

but only backpacks are noticed as containers, vests and uniforms are not.

toxic dirge
#

if I do

fnc_blah_blah = {code here}; publicVariable "fnc_blah_blah";

can I

[] remoteExec ["fnc_blah_blah",0];
winter rose
#

unsure
but also very bad practice

#

1/ network usage
2/ security

spark turret
#

dedmen gets really angry if you start sending functions over network

#

just declare them as functions in description ext

winter rose
#

don't anger our Dedmen - we only have one

tough abyss
#

so I am almost done. However I was wondering If I could make a similar script and make a possibilty to randomise say for example, between A G3A3 with attachments, AKMS with attachments etc. Is this possible? To be simple, randomise weapons with attachments. ```sqf
// Check to see if we randomize Weapon
private _weaponProbability = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "randomWeaponProbability");

if (random 100 < _weaponProbability) then { 
    {_unit removeMagazines _x} forEach ((magazines _unit apply {toLowerANSI _x}) arrayIntersect ([primaryWeapon _unit] call BIS_fnc_compatibleMagazines));

    
    private _weaponClass = primaryWeapon _unit; _unit removeWeapon _weaponClass; 
    {
        private _cat = format ["%1List",_x];
        if (count  (getArray(configFile >> "CfgVehicles" >> typeOf _unit >> _cat))>0) then {
            [_unit, _x] call FUNC(randomizeWeapon);
        };
    } foreach WEAPON_CATEGORIES;
};

};

pseudo shadow
#

is there any function that detects zeus pings?

spark turret
#
onZeusPinged {[getPos _pinger] call bis_fnc_zeuslightning;}
pseudo shadow
#

🙏

#

like same as th ekeybind?

cosmic lichen
pseudo shadow
#

oh oh yes yes yes this is what i'm looking for

#

🙏

#

bless you

#

totally unrelated, what would be the best way to find if someone did x eventhandler in y seconds? maybe (totally unrelated) 5 zeus pings in 2 seconds.
I was thinking some sort of simultaneous calls, and if it's less than 5 pings, it'll just exitwith{}

spark turret
#

i remember there was a biki page about performance listing how many objects of different types you could spawn with reasonable fps. anyone got the link? cant find it.

languid oyster
winter karma
#

Hi, I am looking for the name of a action command, specifly the autopilot landing one. My goal is once a airplane reaches a waypoint it autmaticly starts the horizontal landing, its the blackfish. What is the name for said action?

cosmic lichen
tough abyss
willow hound
#

Not sure if I understand the realtion between that code and your question

little raptor
winter rose
manic sigil
#

Is it possible to use the moduleordnance and it's variants without the random radio callout, just to simplify scenic artillery?

willow hound
#

You could take the source code of BIS_fnc_moduleProjectile and modify it according to your needs.

manic sigil
#

I think I got it working, just kept the targets far enough away that the radio callout doesn't proc.

real tartan
#

looking for improvements or alternatives. constructive criticism welcomed

BIS_fnc_taskParentExists = {
    params ["_taskID"];

    if (count _taskID > 1) exitWith
    {
        private _parent = _taskID call BIS_fnc_taskParent;

        _parent call BIS_fnc_taskExists
    };

    true
};
little raptor
#

what's there to improve?!

#

anyway:

#
BIS_fnc_taskParentExists = {
    params ["_taskID"];

    count _taskID <= 1 || 
    {
        (_taskID call BIS_fnc_taskParent) call BIS_fnc_taskExists
    }
};
#

and it's only marginally faster

#

(also not sure if your code is valid at all; why do you count taskID?)

real tartan
#

taskId can be ["task_4"] (parent) or ["task_4_1", "task_4"] (child)

little raptor
#

ok

#

then why don't you just pass that and use _this?

willow hound
#

Why BIS tag for a non-BIS function? 😋

real tartan
quasi sedge
#

Some way to optimize performance on this one?

_1 = Tochka_1 spawn {
    _ZAPUSK1 = _this; 
    sleep 8100;
    _ZAPUSK1 lockTurret [[0],false]; 
};
_2 = Tochka_2 spawn {
    _ZAPUSK2 = _this;
    sleep 8100;
    _ZAPUSK2 lockTurret [[0],false];
};
_3 = Tochka_3 spawn {
    _ZAPUSK3 = _this;
    sleep 8100;    
    _ZAPUSK3 lockTurret [[0],false];
};
_4 = Tochka_4 spawn {
    _ZAPUSK4 = _this;
    sleep 8100;    
    _ZAPUSK4 lockTurret [[0],false];
};
_5 = Tochka_5 spawn {
    _ZAPUSK5 = _this;
    sleep 8100;    
    _ZAPUSK5 lockTurret [[0],false];
};
_6 = Tochka_6 spawn {
    _ZAPUSK6 = _this;
    sleep 8100;    
    _ZAPUSK6 lockTurret [[0],false];
};
winter rose
#

hell yeah

#
[] spawn {
  sleep 8100;
  { _x lockTurret [[0], false] } forEach [Tochka_1, Tochka_2, Tochka_3, Tochka_4, Tochka_5, Tochka_6];
};
#

@quasi sedge ↑

quasi sedge
little raptor
#

sleep 8100;
meowsweats

cosmic lichen
#

command should fail silently

quasi sedge
winter rose
#

aka 2h15 minutes

surreal peak
quasi sedge
#

10900k on the way

surreal peak
#

Holy sh*t, you actually manage to get 240 people on at once?

surreal peak
#

Christ live, in FNF (Friday Night Fights) They had some issues with having 140 people and had to limit at 124. You have some insane servers and internet speeds for it

quasi sedge
#

answer is zero Ai, max optimized scripts and mods

winter rose
#

just so everyone can see!

surreal peak
#

Yeah FNF had the zero AI, just had some netcode issues. Likely to be server/ mods not being 100% optimised

#

That is completly insane

quasi sedge
#

also dedicated host must be ddos protected derpWolf

surreal peak
#

If you dont mind me asking, what are the server costs like?

quasi sedge
#

200 usd/m for upcoming 10900k, half of that for 7700k

surreal peak
#

Well all I can do is tip my hat to you because that is amazing

cosmic lichen
#

Might even run better with recent bandwidth changes 😛

quasi sedge
#

Big thanks, wonder if 240 will work flawlessly on 6 more cores

#

Also we tried linux server, 80 players and server fps was like 10(On 7700k 3 weeks ago~)

quartz coyote
#

Does anyone know if **setGroupIdGlobal **or **setGroupId **need to be executed on each player respawn in a MP game ?

spark turret
#

setGroupID has local effect, setGroupIDGlobal has global effect

#

as stated in the docu

hot kernel
#

any ideas about how to access rain occlusion data via script? I was about to use line intersect to determine if player is "inside" but it seems to me this information should be available already (in rain occlusion)?

little raptor
little raptor
agile flower
#

Sorry for the delay, global exec of playSound3D [getMissionPath "sound\SuspiciousMinds.ogg", radio1, false, getPOSASL Radio1, 2, 1, 25]; works on dedi

keen sorrel
#

Trying to delete units after a UnitPlay function completes. Tried making it activate on a trigger that I timed manually with how long it takes to complete the action. Only thing is, the trigger is deleting the units upon activation rather than waiting for the countdown.

spark turret
#

your trigger is probably set up wrong

#

also thats a very janky approach to a complex thing, so should probably not over use it.

#

if you want a delayed action after a trigger activates, you can spawn code with a sleep command in the tirggers onActivation

#
[yourParamstheSpawnedCodeNeeds] spawn {
sleep 10; //sleeps 10 seconds
doSomeCoolStuff();
};

! triggers dont like comments, delete them before use
#

i know nothing about animations, but have you made sure theres no eventhandler/similar which runs code after the animation completed?

keen sorrel
#

all that's in the UnitPlay script is just the flight path. i don't have anything to say when the animation is completed.

spark turret
#

aaaaaaah youre talking about unitCapture, not animations

keen sorrel
#

ye

spark turret
#

well i dont know anything about that either 😂 but the trigger delayed code holds up

keen sorrel
#

so would I spawn this code with an execVM?

spark turret
#

the delete code for onTriggerActivation?

keen sorrel
#

ye, or would it be in the trigger itself?

#

cuz at the moment the way my trigger is set, is radio alpha with a 5 minute timer to then delete the crew and vehicle once the time is met.

spark turret
#

it can go in the trigger itself. spawn is like a script, without a file

keen sorrel
#

so what is "yourParams..."?

spark turret
#

the trigger gives you a reference to what triggered it, "thisList". if you spawn code, it doesnt have any variables it knows, so you have to give them to the spawned code.
so if you want to delete all units known to the trigger you do:

onActivation:
[thisList] spawn {
  params ["_unitsToKill"]; //parses the magic _this Variable into the usable _unitsToKill var
{
  deleteVehicle _x;
} forEach _unitsToKill;
};
keen sorrel
#
 sleep 10;
   {v1 deleteVehicleCrew _x} forEach crew v1;  deleteVehicle v1;  
   {v2 deleteVehicleCrew _x} forEach crew v2;  deleteVehicle v2;  
   {v3 deleteVehicleCrew _x} forEach crew v3;  deleteVehicle v3;  
   {v4 deleteVehicleCrew _x} forEach crew v4;  deleteVehicle v4;
};```
spark turret
#

ah yeah, if you got global varialbes, you dont need to pass anything.

keen sorrel
#

this is what i have in the onActivation

spark turret
#

yeah that should work. maybe it wants an empty array as input params, probably not:

[] spawn {
 sleep 10;
   {v1 deleteVehicleCrew _x} forEach crew v1;  deleteVehicle v1;  
   {v2 deleteVehicleCrew _x} forEach crew v2;  deleteVehicle v2;  
   {v3 deleteVehicleCrew _x} forEach crew v3;  deleteVehicle v3;  
   {v4 deleteVehicleCrew _x} forEach crew v4;  deleteVehicle v4;
};
keen sorrel
#

also just outta curiosity, how do you get the text to use colors like that?

spark turret
#

three ` + sqf

keen sorrel
#

gotcha, alright, gonna quickly test that code.

#

alright, looks like it works with the 10 seconds. now to see if it works on the full time or if it's gonna go poopy mode

spark turret
#

btw: prettier:

[] spawn {
 sleep 10;
{
  _vx = _x;
  {_vs deleteVehicleCrew _x} forEach crew _vx;
  deleteVehicle _vx;
} foreach [v1,v2,v3,v4]
};
#

nested forloop

keen sorrel
#

ah nice. i'm not that experienced with coding

spark turret
#

thats fine.

#

everybody gotta start somewhere

keen sorrel
#

does this run better or does it just look nicer

spark turret
#

pfew well i dont know how the compiler reduces it, but i would assume its also faster. dont quote me tho

keen sorrel
#

anyway, thanks for the help my guy. i was growing insane thinking i'd have to do some really cheap workaround.

spark turret
#

lol np

fair drum
#

possible to limit the charge selection in artillery? say I want to limit it to charge 0 so it limits range you can fire

spark turret
#

Probably easier to make a breakout condition.
If (_target distance2d _arty > 5000) exitWith {nope}

still forum
#

Thats a N-ary vector though

spark turret
#

sorry?

winter rose
spark turret
#

i finally managed to clone every item in my crate, including nested containers with items themselves. now onto figuring out how ace stores cargo, so i can clone that as well

#

theres was an invite link pinned somewhere to the ace discord?

winter rose
spark turret
#

whats a slack

#

damn im old

winter rose
#

it's a web/chat like Discord, bit more "professional"

spark turret
#

no animated pepe emojiis?

winter rose
#

still can I think 😁

#

(I should try at work)

cerulean cloak
#

What does the "Hack UAV" interaction do specifically to convert the UAV to the side of the hacker?

winter rose
#

maybe join the UAV's AI to a new (friendly) group, but I don't know for sure

cerulean cloak
#

Ok, thanks. I'm wanting to try and replicate the drone hacking feature seen with the EMSPEC device in the Contact campaign.

fair drum
#

using setAccTime and setAnimSpeedCoef can result in some pretty interesting sudo bullet time / light speed running effect

karmic flax
#

how do I get the weapons of a vehicle from the classname alone? Say I want to get the weapon(s) of "B_GMG_01_high_F", according to the config its weapon is fakeweapon

#

I want some way to get "GMG_20mm" which is the actual weapon of that vehicle

#

how can I get a command to return "GMG_20mm" or whatever weapons a vehicle has, I tried
getArray(configFile >> "cfgVehicles" >> "B_GMG_01_high_F" >> 'Weapons'); which returns ["FakeWeapon"]

slim oyster
#

you want to search the turrets

#
getArray(configFile >> "cfgVehicles" >> "B_GMG_01_high_F" >> "Turrets" >> "MainTurret" >> "Weapons")
#

but isnt there a turrets function?

karmic flax
#

thanks!

#

I tried some of the other scripting commands but they all seemed to take actual vehicles, not the config names

karmic flax
#

Oh cool, thanks again!

languid oyster
# hot kernel any ideas about how to access rain occlusion data via script? I was about to use...

Some time ago, I have done a script to check, whether a position is inside of a building.
||```sqf
/*
File: fn_insideBuilding.sqf
Author: Nicoman35
Date: 2020-11-19
Last Update: 2020-11-19
License: MIT License - http://www.opensource.org/licenses/MIT

Description:
    Checks, wether given reference position is inside of a building.

Parameter(s):
    _refPos        - Given reference position    [ARRAY, defaults to []]

Returns:
    Building, if the reference position lies inside a buildig. ObjNull, if reference position does not lie inside a building. [OBJECT]

*/

params [
["_refPos", []]
];

if (count _refPos == 0) exitWith {false};

lineIntersectsSurfaces [_refPos, _refPos vectorAdd [0, 0, 50], objNull, objNull, false, 1, "GEOM", "FIRE"] select 0 params ["","","","_building"];
if (isNil {_building}) exitWith {objNull};
if (_building isKindOf "House") exitWith {_building};
private _wallScore = 0;
private _directionsToCheck = [[2,0,1],[0,2,1],[-2,0,1],[0,-2,1],[2,2,1],[-2,2,1],[-2,-2,1],[-2,2,1]];
{
lineIntersectsSurfaces [_refPos, _refPos vectorAdd _x, objNull, objNull, false, 1, "GEOM", "FIRE"] select 0 params ["","","","_building"];
if (!isNil {_building} && _building isKindOf "House") then {
_wallScore = _wallScore + 1;
}
} foreach _directionsToCheck;
if (_wallScore > 7) exitWith {_building}; // found at least 4 walls nearby

objNull

still forum
slim oyster
#

50m height check for ceiling?

#

Arent the intersect commands dependent on distance for performance, or does it not matter much since it will return the object once it detects it?

pulsar bluff
#

its abig house

#

If its for use in vanilla, there aren't actually that many building models, so you could check them manually

#

saving fps

#

like Altis i think has only 6 base models

slim oyster
#

One of the a2 industrial buildings maybe? But I'm not sure i would want to consider a unit "inside" a building based on being 40metres under an industrial pipe

#

I would start with the other direction, the floor

languid oyster
#

As a copy and paste noob, I take what works. And that approach worked for me. But improvement proposals very welcome. Floor checks give me false positives on dock structures and alike.

#

But I could surely reduce the 50 m to 20 m

spark turret
#

Hm buildings have a boundingbox ("bbr;"), you could maybe try to check if the position is inside this building

turbid frost
#

I've recently got into arma 3 scripting and I am facing an issue. How do I pass an argument to a function? Might sound like a stupid question but I don't understand what to do by looking at the wiki.

tgtCounter = {
params["_tgt"];
_tgtHits=0;
_animStatus= _tgt animationPhase "Terc";
if (_animStatus==0) then {
_tgtHits=_tgtHits+1;
};
hint format ["Line 1.1 Hits: %1",_tgtHits]; //just for debugging
};

tgt11 addEventHandler["hitPart",{[]spawn tgtCounter}]; <-- right here what am I supposed to do?

spark turret
slim oyster
#

@languid oyster i mean floor first in order to stop a 50m check when they arent in a building

spark turret
turbid frost
#

alright, thank you let me try

#

it works, thank you.

true frigate
#
_ship = [
"Land_Destroyer_01_hull_01_F",
"Land_Destroyer_01_hull_02_F",
"Land_Destroyer_01_hull_03_F",
"Land_Destroyer_01_hull_04_F",
"Land_Destroyer_01_interior_01_F",
"Land_Destroyer_01_interior_02_F",
"Land_Destroyer_01_interior_03_F"
];  
{
_capS = ShipCap;
    {setVectorUp 0,0,-1} forEach _capS;
} forEach _ship;```
#

apparently im missing a ; here

#

cant tell where :/

#

this is just simply trying to turn a ship (with variableName ShipCap) upside down

still forum
still forum
true frigate
#

The problem is, the ship is made of multiple parts. Im not sure if im selecting them right

#

Ive just realised this method probably wont work. Where's Lou when you need him 🤣

little raptor
#

using nearestObjects

true frigate
#

ive only ever used nearObjects, this one should be fun 😄

little raptor
languid oyster
#

@true frigate your missing _x inside foreach

{_x setVectorUp 0,0,-1} forEach _capS;
#

In the outer for each also

languid oyster
#

meowsweats?

true frigate
#

uh oh

#

oh no

#

i see it

languid oyster
#

good

copper raven
#

doesn't the pos update function or whatever apply it properly to every other part?

true frigate
#

But i dont know what you mean by in the outer foreach?

copper raven
#

(after you setVectorUp the center ship obj)

true frigate
#
"Land_Destroyer_01_hull_01_F",
"Land_Destroyer_01_hull_02_F",
"Land_Destroyer_01_hull_03_F",
"Land_Destroyer_01_hull_04_F",
"Land_Destroyer_01_interior_01_F",
"Land_Destroyer_01_interior_02_F",
"Land_Destroyer_01_interior_03_F"
];  
{
_cap = ShipCap;
    {_x setVectorUp 0,0,-1} forEach _cap;
} forEach _ship;```
little raptor
true frigate
#

This is what ive gotten now. added one _x but i dont know what you mean by the outer

languid oyster
#

yes, and what is with forEach _ship? This is the outer forEach

#

you got two nested forEach

little raptor
#

_x setVectorUp [0,0,-1] @languid oyster @true frigate

true frigate
#

everything in the stated list above. I thought it would look at those, and only make changes to parts that had both those object names AND were parts of the ShipCap Variable Object

languid oyster
#

Oh no. See? Leo is better than me.

true frigate
#

I do not spot it...

#

should i?

languid oyster
#

WAAH

true frigate
#

oh

little raptor
#

@true frigate as I told you just use nearestObjects

_ship = [
"Land_Destroyer_01_hull_01_F",
"Land_Destroyer_01_hull_02_F",
"Land_Destroyer_01_hull_03_F",
"Land_Destroyer_01_hull_04_F",
"Land_Destroyer_01_interior_01_F",
"Land_Destroyer_01_interior_02_F",
"Land_Destroyer_01_interior_03_F"
];
_shipParts = nearestObjects [ShipCap, _ship, 300];
{
  _x setVectorUp [0,0,-1];
} forEach _shipParts;
true frigate
#

oh no...

little raptor
#

also a tip

#

it won't work

#

just telling you beforehand

true frigate
#

how come?

little raptor
#

I'm expecting the positions to be messed up

#

Not 100% sure

rancid mulch
#

you're turning every part around his own axis. not around the "boats axis" which does not exist because of the multiple parts

true frigate
#

i see. that might cause some issues

#

well, if it does, at least we all get a good laugh 😄

#

at both my stupidity, and the boat being completely f*cked

#

Well the water is a tad shallow and there are a few parts i missed but IT WORKS

winter rose
#

\o/

agile flower
#

Lou, stupid question

#

I was the guy with the radio script the other day

#

I’m stuck with localisation

#

If I put it in init, the script runs for every player, so the radio plays multiple times.

#

If I put it in initserver, nothing happens, same result as using the server debug option.

#

Where do I put code if I just want the server to run it? On the object?

little raptor
#

then put it in initPlayerLocal

agile flower
#

I think I’ve tested that, same result as in init

little raptor
#

(not sure what your script is at all blobdoggoshruggoogly )

agile flower
#

I’m using playsound3d, which has a global effect

#

So I have a couple of case statements, and then playsound3D

little raptor
#

playSound3D is bad

#

don't use it

#

not JIP compatible

#

global

#

can't stop

#

consider using say3D instead

agile flower
#

Should I use say3D instead

#

Sound

#

Thanks

surreal peak
#

Why can I use Playsound3D with dog3.wss but not Say3D?

playSound3D ["A3\Sounds_F\ambient\animals\dog3.wss", _dog, false, getPosASL _dog, 15, 0.5, 100];
_dog Say3D "dog3.wss";
//or
_dog Say3D "A3\Sounds_F\ambient\animals\dog3.wss";
little raptor
true frigate
#

Why in the hell was this working and now its saying 0 elements provided, 3 expected

little raptor
true frigate
#

Oh my god, im an idiot, i renamed the variable

#

🤦‍♂️

surreal peak
surreal peak
#

Doesnt that require access to desc.ext

little raptor
#

just add it to description.ext for your mission

surreal peak
#

Premade templates for like 20 maps. I cant really ask admins to do that just for a script ill run not very often 😄

surreal peak
#

Fair 😄

finite jackal
#

Has anyone used setObjectScale on something like UserTexture10m_F with a custom texture applied? Does the image scale with nearest neighbor, bilinear, some other form?

winter rose
#

I would say stretch, the Arma way\® 😄

still forum
#

whatever directx does

finite jackal
#

Now add vulkan and tell me what it does

winter rose
#

no u

wind hedge
#

Can someone point me to the malaria faces introduced by oldman... [_unit,"PersianHead_A3_01"]remoteExec["setFace",0,true];

plush oriole
#

Does attachTo not work on the large static ships?

little raptor
plush oriole
#

ah so the editor placed one is just an attachment point to spawn the rest of them?

little raptor
#

sort of

plush oriole
#

does 'setvectorup' here represent whatever transformation you want to do to the ship

little raptor
#

yeah

#

it's just what someone else wanted to do

#

namely capsize the ship

#

the important part is how to get the ship parts

#

also this is only for USS Destroyer

agile flower
#

happy with the case to pick the song

#

now I'm getting a "error generic error in expression" on lines that are "sleep x amount;"

#

script runs in local debug

#

but complains

#

doesnt run at all in init

little raptor
agile flower
#

okay

#

makes sense

little raptor
#

doesnt run at all in init
you shouldn't use init

agile flower
#

initplayerlocal?

little raptor
agile flower
#

I'm not sure I can be arsed

#

the amount of man hours I've sunk into this is insane lol

hollow lantern
#

can the array returned by https://community.bistudio.com/wiki/fullCrew be modified? I only needs units, not the other stuff. So I would only need a single array. Or is there a more efficient way to return the cargo units ?

distant oyster
hollow lantern
#

it does not, according to the wiki crew can't be narrowed down to cargo only.

#

so a driver or gunner is crew too

#

yup, just tested it, it will return a single array of all vehicle occupants

spark turret
#

how can i assign waypoints to a UAV?

#

since i cant get a pilot -> group -> add waypoint?

#

ah wait it does return a pilot using currentPilot. nvm

little raptor
spark turret
#

why is that?

little raptor
#

because the driver takes orders from the effectiveCommander

spark turret
#

aha okay

#

since we re at it, how do i tell the drone to fire a missile at something?

little raptor
#

maybe fireAtTarget?

#

yeah

spark turret
#

okay ill test it out. never sure in arma if theres maybe a better, hidden command

little raptor
spark turret
#

how would i do that? fired EH + setMissileTarget?

little raptor
spark turret
#

yeah the drone doesnt lock the target for the hellfire. it just fired straight ahead

distant oyster
little raptor
hollow lantern
spark turret
#

okay this is dumb and unnecessarily complicated. ill just cheese it.

#

spawn in a missile 10m below aircraft, point towards player, set missiletarget pos-

spark turret
#

hell i cant get the missile to fly where i want it to. tried different types of missiles, no success. using "Missile_AGM_02_F" atm

distant oyster
#

is it possible to pass nil as a value to a command to get the default parameters, eg:

"MIS_fnc_restrictAreaFSM_warningLayer" cutText [
    format ["WARNING! ENTERING RESTRICTED AREA!<br/>test"],
    "PLAIN",
    nil,
    nil,
    true
];
``` i only want the structured text parameter. I tested it and it works but who knows, maybe this is an exception or the engine is suffering silently
spark turret
fair drum
#

I should be using kb tell over say3d shouldn't I

little raptor
cerulean cloak
#

Does sleep suspend all scripts or just the one it was called in?

little raptor
cerulean cloak
#

I don't know but it feels like that's what's happening to me. Must be the fade effect thing then?

little raptor
#

It depends how you code is set up

#

Sleep only suspends the script at the position you put it

cerulean cloak
#

blkh_1 engineon true;
rec = [] spawn MypathA;
blkh_2 engineon true;
rec = [] spawn MypathB;
blkh_3 engineon true;
rec = [] spawn MypathC;
blkh_4 engineon true;
rec = [] spawn MypathD;

sleep 10;

[0] spawn BIS_fnc_fadeEffect;
sleep 20;
skiptime 2;
[1] spawn BIS_fnc_fadeEffect;

titletext ["<t size='3.0'>2 Hours Later</t>","PLAIN",-1,false,true];

I've got this running and when the fade effect starts the unitplay stops too.

little raptor
#

what's the problem again?

cerulean cloak
#

The unitplay stops moving when the fade starts

little raptor
#

what unit play?

cerulean cloak
#
blkh_1 engineon true;
rec = [] spawn MypathA;
blkh_2 engineon true;
rec = [] spawn MypathB;
blkh_3 engineon true;
rec = [] spawn MypathC;
blkh_4 engineon true;
rec = [] spawn MypathD;

The unitplay called by that part.

little raptor
#

You probably have way too many spawns

#

@cerulean cloak are you sure that code is scheduled?

cerulean cloak
#

No, what does that mean?

little raptor
#

I mean did you spawn or execVM it?

cerulean cloak
#

execVM

little raptor
#
  • start unit play
#
  • wait 10 seconds
#
  • fade
agile pumice
#

Is there a way to disable the automatic falling pose when the player is at a certain altitude?

little raptor
#

I don't think so blobdoggoshruggoogly

cerulean cloak
#

Yeah, intent is
-Start unitplays
-Wait 10s
-Fade out
-Wait 20s
-Skip 2 hours
-Fade in
-Text

little raptor
#

@cerulean cloak those "paths" are for separate vehicles?

cerulean cloak
#

Yes

little raptor
#

@cerulean cloak I'm not sure if I fully understand the problem. Can you show a video or something?

cerulean cloak
#

Hop in a voice channel and I'll screenshare

#

Can you see my screen ok? @little raptor

little raptor
#

@cerulean cloak ok got it

#

So you expect the helicopters to be fully started and in the air?

cerulean cloak
#

yeah, but I think I might just have been impatient.

little raptor
#

So this is a single player scenario?

cerulean cloak
#

20s feels a lot longer just staring at black.

little raptor
#

@cerulean cloak also, about your unit plays

#

did you record them from the landing pad?

cerulean cloak
#

Yeah

little raptor
#

ok

#

unfortunately that's not gonna work

cerulean cloak
#

Oh?

little raptor
#

I recommend you try of these:

  1. Either use time acceleration during the fade out
  2. Record the unit play from the fade in part
#

where you expect the helis to be

#

I personally recommend the 2nd one

#

to put the helis in the air use this command : setVehiclePosition

#

set position mode to "FLY"

cerulean cloak
#

Ok, it seems to be fine after all. 20s of a delay just wasn't long enough for the helis to get away from the airbase.

#

Sorry for all that.

fair drum
#

do the CBA event handlers use the same params as the BIS ones for the code block?

little raptor
#

or just a couple of seconds of black screen

#

and then immediately unitplay?

cerulean cloak
#

It's multiplayer so the guys will have people to talk to.

little raptor
#

ok

cerulean cloak
#

Plus I don't really want to re-do the untiplay recordings.

little raptor
#

you can "crop" them blobdoggoshruggoogly

cerulean cloak
#

You can?

little raptor
#

unitplay data is just an array

#

you only select the part you want

#

and you get a cropped output

little raptor
#

which event handlers?

#

if you're referring to stuff like "Fire" and stuff, yes

#

they're just vanilla event handlers blobdoggoshruggoogly

fair drum
#

like for CBA_fnc_addClassEventHandler... if say I use "dammage", will it still pull in, params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"]; to use?

cerulean cloak
#

How do I crop the unit play arrays? I tried deleting everything before a certain frame time but that lead to them being outside the map phasing through hills.

cerulean cloak
#

I opened the file, looked for the first frame time greater than 75 and deleted all before it.

little raptor
#

(i mean which element?)

cerulean cloak
#

The one on it's own as just a number that had a [ after it.

little raptor
#

I hope you mean the first element meowsweats

cerulean cloak
#

[0.0499954,[12093,17887.5,342.037],[-0.777783,0.628533,-0.000265738],[-0.000206135,0.000167708,1],[-1.29157e-005,-1.83402e-005,-3.16445e-005]]
In that case it'd be the 0.0499954

little raptor
#

Ok

#

But you also have to correct the play times

cerulean cloak
#

So subrtract ~75 from each of the first elements?

little raptor
#

yeah

cerulean cloak
#

How on Earth do I do that?

little raptor
#

apply
Actually, subtract them from the time at the 1st element

#

(Or recording start time if you know how to get it)

cerulean cloak
#
{
    _x set [0, ((_x select 0)-k)];
} foreach in pathA;
``` Will that do if k is the number I deleted up to?
inland valve
#

@little raptor @cerulean cloak just curious but if you wanted to crop the playtime couldnt you record yourself with unitcap as you play the mission with unitplay? and start/stop as you need

#

?

cerulean cloak
#

You do have a point.

#

Seems easier than messing with this array.

inland valve
#

Ive tried deleting stuff before, I had no luck, but I did with recording during a playing mission

#

Im trying "Larrows" method for smoke trails, I cant seem to adjust the RGB values the way I want... any help appreciated

#

_emitter setParticleParams [
["\A3\data_f\ParticleEffects\Universal\Universal_02",8,0,40,1],"","billboard",1,_particleLifeTime,[0,0,0],[0,0,2*_particleSpeed],0,0.05,0.04*_particleLifting,0.05*_windEffect,[1 _particleSize + 1,1.8 * _particleSize + 15],
[[0.7
_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.7*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.6*_colorAlpha],[0.7*_colorRed,0.7*_colorGreen,0.7*_colorBlue,0.45*_colorAlpha],
[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.28*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.16*_colorAlpha],[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.09*_colorAlpha],
[0.84*_colorRed,0.84*_colorGreen,0.84*_colorBlue,0.06*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0.02*_colorAlpha],[1*_colorRed,1*_colorGreen,1*_colorBlue,0*_colorAlpha]],
[1,0.55,0.35], 0.1, 0.08*_expansion, "", "", ""];

#

anyone make sense of this? there is the more in txt, seems like too many RGB options

tough abyss
#

Hey y'all, I have a question for you. Hopefully it can be resolved quick. Basically I'm using the https://steamcommunity.com/sharedfiles/filedetails/?id=909790601
Radiation script to add sounds and damage to radiation to objects in my missions.

The author mentions it's dedicated tested. However I've gotten it to work on single player, locally hosted eden, but not dedicated. I've moved the .PBO with all the scripts inside the dedicated and it doesn't work. The issue is after I pick a role it gets stuck on an infinite loading screen. Anyone have any ideas??

inland valve
#

Im new but export to MP?

tough abyss
#

I've had some ideas maybe the .ogg sounds can't be transfered over server? Yes I've exported it through MP

inland valve
#

lol sry

tough abyss
#

I mean, thanks for the attempted hep.

#

help*

fair drum
#

let me download and look through the script

fair drum
tough abyss
#

yes of course

void delta
#

_list = position player nearObjects ["Item_Laptop_Unfolded", 50];

How do I update this list continuously?

cosmic lichen
#

with a loop

#

while {condition}....

spark turret
#

Maybe its more performant to check for nearby Players to the laptop instead of nearby laptops foreach players

void delta
#

Ideally I only want it to update for a player driving a specific vehicle but I'm in the proof of concept phase and just trying to get it to work.

spark turret
#

Well you can just use that vehicle as the center to check around

#

And add a condition that the driver needs to be a player

west grove
#

hm. as you all know, it is possible to fade in / out black screens. is it possible to fade between different colors? like, my whole screen is black, and i want that black to fade into white

void delta
spark turret
#

🙂

signal kite
#

Hello! Is there any script to hide the grass without sacrificing terrain grid detail?

cosmic lichen
#

@signal kite There are Grass Cutter objects you can place. Other than that, nope

signal kite
cosmic lichen
#

nope

#

Question is, why do you wanna get rid of the entire gras 😄

signal kite
#

because it's such a pain in the ass if you try to shoot while prone

#

oh, and by the way thanks for 3den enhanced!

desert cargo
#

Does anyone know what's the command to set the maximum capacity of a vehicle? Trying to get the vics to do more frequent resupplies. Tried setVehicleAmmo but it goes back to default ammo load when they rearm.

willow hound
#

Mod.

little raptor
untold sail
#

Hey there, I am in the editor at the moment and have an air invasion in the background. As i'm doing cinematic screenshots I would like the gun to point in more or less high angle to its top right. I tried searching key words for it on the server but sadly found no script. I hope one of you would be so kind and help me out with a possible script!🙂
I tried the setvectordir command, but that didnt change anything sadly. https://imgur.com/KFN2Jg5

cosmic lichen
#

You can always hope in , turn the gun and use the splendid camera to take a screenshot

#

I am not sure turrets of vehicles can be moved. At least it didn't work when I tried it a few month ago

little raptor
#

Or have an AI do it blobdoggoshruggoogly

keen sorrel
#

@signal kite could always just load a view distance mod that turns the terrain quality down enough to just completely get rid of grass.

cosmic lichen
#

hide the grass without sacrificing terrain grid detail?

cosmic lichen
#

We need a removeGrass <area>, dedmen 😄

untold sail
#

@cosmic lichen The problem would be, that the planes would star moving across the sky which wouldnt give me enough time to turn all 4 Flaks and I cant add the firing effects and tracers in there I think? I always just used quick camera instead of splendid.

cosmic lichen
#

just disable simulation for the poor plane

untold sail
#

Hm, I guess. I just like finetuning everything🥲

little raptor
untold sail
#

Oh? I didnt know about fake targets, i'll look into that. Thank you!

hot kernel
#

assuming these two test scripts accomplish the same thing, what method or rational would dictate which to use in a given situation,

[]spawn {
    waitUntil {sleep 1; if !(player getVariable ["var_value", 0]== 0) then {true} else {systemChat "var is zero"; False}};
    systemChat "var is no longer zero"
}
[]spawn {
    while {sleep 1; (player getVariable ["var_value", 0]== 0)} do {
        systemChat "var is zero"
    };
    systemChat "var is no longer zero";
}

Looping waitUntil vs while?

little raptor
#

waitUntil has a one frame uiSleep built in

hot kernel
# little raptor waitUntil has a one frame uiSleep built in

So a sleepy while/do is basically a waitUntil? Which means there is effectively no difference between the scripts above in terms of performance or execution?

Would you select while/do in this case?
Where would you definitely not use a while/do?
When and why would the waitUntil solution be a better choice?

little raptor
# hot kernel So a *sleepy while/do* is basically a *waitUntil*? Which means there is effectiv...

waitUntil could be a bit faster (internally). But I'm not sure. Dedmen knows better blobdoggoshruggoogly

Would you select while/do in this case?
If what I do can be done by waitUntil, no.
Where would you definitely not use a while/do?
A loop without sleep (but with time dependence)

waitUntil {isNull findDisplay 46};
```![blobdoggoshruggoogly](https://cdn.discordapp.com/emojis/748124048025714758.webp?size=128 "blobdoggoshruggoogly")
still forum
#

a while executes its condition and action code. A waitUntil only executes a condition. so the waitUntil is more efficient, but both should have a sleep

hot kernel
#

I'd have to check but I think I only have one script that uses while continuously. It's the part of base-builder that allows picking objects up and moving them. Of course suspension in the script would cause the object to drop until the script resumed. By nature it's a limited time event, while the player is holding the object.

little raptor
hot kernel
#

So for this specific example, the rest of the script executes when the while/do completes. After I begin the onEachframe statement, I'll still need a waitUntil to suspend the rest of the script until player releases the object. Something like,

onEachFrame { do_hold_object_script };

waitUntil {sleep 0.5; !(_caller getVariable ["hold_object", false])};

onEachFrame {}
finish script

Does that sound about right?

still forum
#

why not check inside the onEachFrame if the player isn't holding anymore?

#

and don't use onEachFrame, use addMissionEventhandler and removeMissionEventhandler

hot kernel
#

@still forum,

why not check inside the onEachFrame if the player isn't holding anymore?
Because apparently I'm going to use addMissionEventHandler
😋

little raptor
#

@hot kernel better to use the stackable "eachframe" eh

#

onEachFrame { do_hold_object_script };
onEachFrame do_hold_object_script

still forum
#

I don't understand why thats an answer to my question?

little raptor
hot kernel
#

@little raptor, thanks, that makes sense!
@still forum, is this what you mean?

hold_object_script= {
    if (_caller getVariable ["hold_object", false]) then {
        hold_object statements
    }else{
        release_object statements
    }
};
onEachFrame hold_object_script;
little raptor
hot kernel
#

Like this then?

addMissionEventhandler ["EachFrame", {
if !(player getVariable ["hold_object", false]) exitWith {
removeMissionEventhandler ["EachFrame", _thisEventHandler];
//release_object statements
};
//hold_object statements
}];
little raptor
#

at least not in this case

hot kernel
#

I'll try it out. Thanks for your help guys!

spark turret
fresh wyvern
#

Is there any way to add more pylons to the black wasp or extra magazines. I don't addWeaponTurret, addMagazineTurret to work with pylon weapons. Also setPylonLoadout is limited to the the number of available pylons on the black wasp.

exotic flax
#

You need to modify to configs at least, and perhaps even the models, to be able to add pylons.
Can't be done with only some scripts

agile mist
#

Hola fellow ArmA friends, just a query. I'm trying to make a nice shooting range, I'd like to be able to score people based on their accuracy but that's just too much work. What I've got right now however is an 800m long rifle range. I've got lines of targets every 50 metres, and I'm going to have the option to pop up targets at different distances so they aren't all up at once. Any tips on how to have them spawn folded down? Do I just do this setDamage 0.1; or something?

cosmic lichen
#

You can manipulate the targets with

target_1 animateSource ["Terc", 0]; //0 = up, 1 = down
agile mist
#

❤️ Many thanks, I can just slap this in the init of each target by the looks of this, right?

cosmic lichen
#

if you do it in init then sqf if (local this) then {code above};

#

You could also use initServer.sqf

{
_x animateSource...
} foreach [target1, target2 ..];```
agile mist
#

Awesome, I'm trying to use part of Feurex's tutorial (https://www.youtube.com/watch?v=ehIzXg2Ttqw) to control my range. I'd like the rangemaster to be able to control the range, so it starts off with all targets folded down, and then via a script, he can choose to reset specific areas of targets.

cosmic lichen
#

You can do that via addAction, or radio trigger

agile mist
#

Yeah he uses a laptop to execute the 'reset' script, which resets all targets within an area. I'm just trying to make it more functional. Once I get that sorted, I intend to have it playSound3D upon selection.

wind hedge
#

Why does this work: playSound3d [getMissionPath "vScripts\vWeather\sandStormWall.ogg", player];

#

When this doesn't: playSound [getMissionPath "vScripts\vWeather\sandStormWall.ogg", player];

winter rose
#

one takes classname, the other takes filepath @wind hedge ↑

wind hedge
#

yeah but playSound3D used to take classname only too... it got expanded in version 2.02 right?

#

If so, shouldn't playSound get the same love too?

wind hedge
#

Allright, my bad, nevermind what I said

little raptor
#

you're confusing it with say3D

wind hedge
#

Perhaps!

#

but most likely I am just an idiot 😅

gloomy aspen
#

klaxon1 playsound3d ["a3\missions_f_beta\data\sounds\firing_drills\drill_finish.wss"];

Am i using this correctly? Called via. sqf on addaction to make a speaker play the drill sound at the start of a firing range

#

Doesnt seem to be working 😦

gloomy aspen
#
playsound3d ["a3\missions_f_beta\data\sounds\firing_drills\drill_finish.wss", klaxon1];

got it, thanks @little raptor my bad!

astral tendon
#

how to black list numbers in random? I need to make sure that he does not chose a specific number

_n = str (floor random [30, 58, 87]); //it should not chose 55 and 67
winter rose
#

re-randoming

#

_n = 0
while _n in [0, 55, 67] do random stuff @astral tendon

astral tendon
#

well, my function was unscheduled

little raptor
#

while doesn't need scheduling

astral tendon
#

it can run unscheduled for a little time if I remember

winter rose
#

10000 cycles top

worn obsidian
#

I need some help with this idea of mine:

Convoy is grouped together (about 5 or 6 vehicles)
Along the way, I want to degroup certain units and have them drive to different waypoints, then turn off their engines at the final waypoint
No re-grouping required

If anyone can help, that'd be great!

#

If this can be done with trigger or anything, that's fine too

manic sigil
#

I can spawn a VLS cruise missile, and have it fly in the direction I need... but can't get it to actually home in on a target, even with setMissileTarget T_T I can't rely on the player having a laser designator, since the mission theme is 'heavy fog, GPS guidance only'. The example script for a targeted missile uses thermal signatures, which don't work for the cruise missile.

little raptor
# worn obsidian I need some help with this idea of mine: >Convoy is grouped together (about 5 o...

I recommend using waypoints (I think you have to use "scripted waypoint" or something if you want to do it in 3den?) . Create the new groups and their waypoints in waypoint completion statements.

To move some units to a new group, create a new group and use joinSilent.
Example:

_grp = createGroup blufor;
[unit1, unit2, ...] joinSilent _grp;
_grp addWaypoint [[1,2,0], -1]; //some position

https://community.bistudio.com/wiki/addWaypoint
https://community.bistudio.com/wiki/setWaypointStatements
https://community.bistudio.com/wiki/joinSilent
https://community.bistudio.com/wiki/createGroup

worn obsidian
#

@little raptor thanks!

manic sigil
#

Okay, I can spawn in an invisible jtac and have him laser designate a target at point blank range... but I can't get them to use their laser designator T_T

#

Or just use the related function. Durr.

little raptor
#

Those "lasers" you see are actually objects

#

I don't recall what their class name was but you can find it in the config

manic sigil
#

I couldn't figure that out... is it not "LaserBeam"?

little raptor
#

You can check the laserTarget command page

#

I think it was mentioned there

manic sigil
#

Not as far as I could tell... and my googlefu just turned up people complaining about spawned laser targets not lasting more than 10 seconds, but no code to do so

little raptor
#

@manic sigil or just do this:
give yourself a laser designator and lase something
type this in debug console:

typeOf laserTarget player
#

meh

#

that's your only option blobdoggoshruggoogly

manic sigil
#

Yeah, that at least got my to get it spawned in, but as expected, it disappears after a few seconds :/

#

And they're not targetable, I think...

#

Blah.

#

I dunno why i'm fixating on this, it's a minor thing in a mission that is more of an exploration bonus than anything.

tribal onyx
#

I want to spawn one and have one of the panels go down to 60%

tribal onyx
signal kite
young current
#

You could add a user action for your players to clear grass around you. The action could drop a grass cutter object on ground for let's say half an hour or something to keep their number limited.
Personally I like it that sniper has to pick his spot and when sniping I move around a bit to flatten the grass to make the firing position.

half spear
#

I'm trying to edit the movement speed of a modded Skeleton unit, I use the SetCoefAnimation and it does work for less then a second, then speed goes back to normal. This script is executing in eden editor local exec

cosmic lichen
#

@hardy tree _this select 2: NUMBER - Break multiplier - Is used to calculate the display length of every line - Default: 0.1

#

Just increase that. It automatically calculates the time for each line depending on its length

little raptor
half spear
#

Hmmm, the skeleton does have custom script that is called when damaged. Could that be it?

winter rose
#

if there is a setAnimSpeedCoef usage in it

half spear
#

Not that I saw from before, dont have the file on this device to double check sorry. Will do again

#

Cause that script being called will happen often due to the nature of the check right?

signal kite
crude stream
sour slate
#

anyone able to give me some insight on how to use the setObjectScale command

willow hound
manic sigil
sharp peak
#
[] spawn {
    while{true} do {
        {
            private "_a";
            _channelToDeleteMarkers0 = 0;
            _channelToDeleteMarkers1 = 1;
            _channelToDeleteMarkers2 = 2;
            _channelToDeleteMarkers3 = 3;
            _a = toArray _x;
            reverse _a;
            _a resize 1;
            _number = parseNumber toString _a;
            if(_number == _channelToDeleteMarkers0) then {
                deleteMarker _x;
            };
            if(_number == _channelToDeleteMarkers1) then {
                deleteMarker _x;
            };
            if(_number == _channelToDeleteMarkers2) then {
                deleteMarker _x;
            };
            if(_number == _channelToDeleteMarkers3) then {
                deleteMarker _x;
            };
        } forEach allMapMarkers;
    };
};```Got this script yesterday from a nice guy in [#arma3_editor](/guild/105462288051380224/channel/115333379133669382/) , adjusted it to delete markers from multiple channels simultaneously - but in a very "crude" way. Anybody could help make it less crude, and also less performance heavy?
bold chasm
#

Just wanna triple check, there's NO way to hide/make invisible certain parts of a prop, only the whole prop?

still forum
#

private "_a"; Don't do that. Use the private keyword, not the command.
Also why private _A but none of the other variables you have in there?

all the ifs can be replaced by a single in
also if the numbers are hardcoded 0-4 anyway, why even put them into variables?

still forum
#

turn string to array, reverse array, resize array to 1 element (will probably reallocate the array, is expensive), turn it into string and parse number.
Oof.
parseNumber can be done with simple subtraction on the number if it can only be 0-9.
Also all these array shenanigans. Just use select to grab the last character in the string.

#

also you can reverse a string itself too, no need for toArray even if you want to use the complicated way

sharp peak
#

No idea, why 'private _a', I'm next to clueless with scripting, was given to me as such.
by in do you mean smth along the lines of this?if("0" in _channelToDeleteMarkers) then {etc..

still forum
#

are the numbers 0-3 hardcoded?

#

"0" in ["0", "1", "2", "3"]

sharp peak
#

"Channel ID = Global = 0, Side = 1, Command = 2, Group = 3, Vehicle = 4, Direct = 5, custom = 6-15;"
I want only 0, 1, 2, and 3 removed

still forum
#

then you also don't need the parseNumber stuff

#

Ah you want to extract the channel from a player placed marker

sharp peak
#

Yes

still forum
sharp peak
#

Maybe should've explained that at first - script is for instantly deleting/removing the possibility to place markers

still forum
#

returns the channel as number

#

"script is for instantly deleting/removing the possibility to place markers"
We have a eventhandler for MarkerPlaced

#

the while true loop is nonsense then, use the eventhandler

#

do you only want to delete specific channels? or player placed markers in general?

sharp peak
#

Player placed markers only

#

So keep editor markers, and keep markers from direct and vehicle

still forum
#

why are you even checking the channel number then. All player markers literally say _USER_DEFINED right at the start of the marker name

#

just checking for that would be alot easier

sharp peak
still forum
#
addMissionEventHandler ["MarkerCreated", { 
  params ["_marker"];
  if (_marker select [0, 13] == "_USER_DEFINED") then { deleteMarker _marker; };
}];
#

your while true loop will also kill scheduler performance. It will run for the max allowed time every frame, a total FPS destroyer

sharp peak
#

Yeah, was worried about that

still forum
#

Whoever wrote that needs a slap on the back of their head 😄

sharp peak
#

I couldn't find anything about the 'MarkerCreated' on the bi wiki before when trying to find this myself yesterday

#

What you just wrote - how does it define which channels to delete markers from?

#

Is that what [0, 13] is?

still forum
#

it doesn't

#

it deletes all user placed markers

sharp peak
#

I c, would there be an "quick" way to do that - or would I need to put a if/in somewhere inside?

still forum
#
addMissionEventHandler ["MarkerCreated", { 
  params ["_marker", "_channel"];
  if (_marker select [0, 13] == "_USER_DEFINED" && _channel in [0,1,2,3]) then { deleteMarker _marker; };
}];
sharp peak
#

Figured that was somewhere along that, thank you lots!))

sturdy patrol
#

Hi any can resolve my doubt about what is wrong with this line of code

    {
        deleteVehicle SUCCESS_CODE;
        }

i need test 4 variables to delete a object on the map i'm making a secuence scripts for puzzles

still forum
#

where do the variables come from

#

and what is SUCCESS_CODE?

sturdy patrol
still forum
#

"SUCCESS_CODE" allcaps name with underscore seperation is usually indicator for a macro, not for a variable name

#

if its a variable name it should also have a unique TAG_

#

well some of your _c variables are probably not a boolean

#

where do you set these variables

#

show more of the script

sturdy patrol
#
_c1 = true;
_c2 = true;
_c3 = true;
_c4 = true;

while {true} do
{
    if( !alive CODE_1 ) then {
        _c1 = false;
    };
    if( !alive CODE_2 ) then {
        _c2 = false;
    };
    if( !alive CODE_3 ) then {
        _c3 = false;
    };
    if( !alive CODE_4 ) then {
        _c4 = false;
    };

    if(_c1 && (!_c2 || !_c3 || !_c4)) then
    {
        deleteVehicle ERROR_CODE;
    } else {
        if(_c2 && (!_c3 || !_c4)) then
        {
            deleteVehicle ERROR_CODE;
        } else {
            if(_c3 && !_c4) then
            {
                deleteVehicle ERROR_CODE;
            }
        }
    }

    if(!_c1 && !_c2 && !_c3 && !_c4) then
    {
        deleteVehicle SUCCESS_CODE;
    }
}

here is the script

still forum
#

your while loop should have a sleep, even just a sleep 0.1
otherwise it will try to kill your fps and check hundreds of times per frame which is nonsense

sturdy patrol
#

ok is good to know that

still forum
#

Did you read the error message you got?

#

what error it actually tells you?

sturdy patrol
#

error missing ;

still forum
#

Well.

#

Then look