#arma3_scripting

1 messages · Page 524 of 1

keen bough
#

Hya! I check in my arsenal script something like this:
if (_magName == "")

The thing is. When there is a magazine, it just works, without magazine it works but if i use a rhs-weapon without a magazine in the weapon itself, i get the error that _magName is undefined oO

#

i mean i check the weapon of course ^^

#

[["rhs_weap_ak103_npz","rhs_acc_dtk","","",[],""]] is stored in my variable. So i choose _loop (in this case 0) followed by 4 (magazine array) and select 0 (magazine name). Every other weapon, but rhs, gives me back a empty string ("") but not the rhs weapon. It gives me [].

#

nvmd. I get a nil value on normal weapons too. But it doesnt throw me the undefined variable error

robust hollow
#

could use param instead of select @keen bough

long hatch
#

Thanks for the hint Connor, but even wit the private array, the function won't set the loadout. I will try to use params and gave this values a default value

keen bough
#

could you give me a if-example with param please @robust hollow ?

robust hollow
#

_arr param[4,""]

keen bough
#

so i could write it if (_magName param[""]) then ? @robust hollow

robust hollow
#

no

#

arr param [index,default value]

keen bough
#

AH!

#

lemme try.

#

_magNameArray = _wepAtt select _loop4 select 4; // always magazine name
_magName = _magNameArray param[0,""];

somehow like so? @robust hollow

robust hollow
#

yea

keen bough
#

works! thaaaaaanks @robust hollow Now i learned something new ^^ BOYAH!

long hatch
#

after changing the header to this

params [
    ["_unit", objNull],
    ["_unitLoadout", "rfl"],
    ["_unitRank", 0],
    ["_medLevel", 0],
    ["_engLevel", 0],
    ["_eodLevel", false],
    "_uniform1",
    "_uniform2",
    "_headgear1",
    "_headgear2",
    "_headgear3",
    "_vestLeader",
    "_vestMedic",
    "_vestRifleman",
    "_vestGrenadier",
    "_vestMarksmen",
    "_vestMachineGunner",
    "_backpack1",
    "_backpack2",
    "_backpack3",
    "_backpack4"
];

It works, thanks for the hint.

long hatch
#

Another Question, when i want to store this in a _var how should i write it to use it in a setUnitLoadout?

_myVar = ["BWA3_G36A2","","BWA3_acc_VarioRay_irlaser_black","BWA3_optic_RSAS",[],[],""];

or

_myVar = [["BWA3_G36A2","","BWA3_acc_VarioRay_irlaser_black","BWA3_optic_RSAS",[],[],""]];
robust hollow
#

uhh, either would do but the first makes sense. then you would be selecting the elements from the array instead of using variable names alone like in ur script paste from earlier

#

or now i look properly... thats just a weapon isnt it?

long hatch
#

Yep, it's just the Array for the Mainweapon including Attachments

robust hollow
#

yea, still the first one and then the variable would be the first element of your loadout array

long hatch
#

ok Thanks

short trout
#

How can i get array of all compatible magazines for primary weapon? Before magazineWells i used config's magazines[] value, but now it's not enough

tough abyss
#

What is not enough?

short trout
#

magazines[] is not complete list of compatible mags (like now CUP and RHS weapons share their magazines, but magazines[] array for CUP weapon contain only CUP mags, same for RHS).

#

But i want to get all compatible mags, from all mods (as player can have mixed loadout of CUP's and RHS's mags)

still forum
#

CBA has a func for it in cba common

tough abyss
#

Does arsenal show all compatible mags with mods?

still forum
#

ye

spice axle
#

Not sure which is the right channel. I want to add a GUI on a object. Like a compass in a helicopter. But I have literally no idea how to start

tough abyss
#

Start by opening a notepad

spice axle
#

such useless and dumb comments only showing that you shouldn't spread your opinion in the internet

tough abyss
#

Would it help if I add smiley face? Seriously though your question is a bit vague. If you could give an example of what your ultimate goal is I’m sure this would help

spice axle
#

How about ask about more informations and not write such a useless sentence

austere granite
#

Getting of on the right foot here

spice axle
#

I want to have a object on the ground and there should displayed some given values...

austere granite
#

You can not add GUI to objects

tough abyss
#

Yeah, no, you want help you should do leg work

austere granite
#

compass in helicopter is special stuff

tough abyss
#

What kind of stuff are you looking for, you want it 3d in the cockpit or like a 2d overlay on the HUD?

austere granite
#

I want to have a object on the ground and there should displayed some given values...

#

Unless I'm mistaken the only way for you to be able to do this, is make a model with hiddenSElections and use setObjectTexture to set separate letters to it

#

Which falls more in the reign of model makers

spice axle
#

ok thanks

#

like 3d in helicopter^^

tough abyss
#

you can use config to edit things displayed on MFDs, but actual model changes will need whoever did the original model to change it

austere granite
#

doesnt MFD only work for vehicles you're in anyway?

tough abyss
#

si

#

and the MFD system is a giant pain in the ass to work with unless you have config experience

#

and even then it's at best a medium pain in the ass

spice axle
#

ah ok i will leave it there haha

austere granite
#

it wouldnt work for what he wants anyway in that case

merry warren
#

How do I assign a new task through a trigger

#

nvm

still forum
astral dawn
#
Create the page "fileExists" on this wiki!

There were no results matching the query.

🤔

queen cargo
#

i doubt that fileExists actually is a useful command ... who cares if a file exists?
just to get rid of a single RTP message?

still forum
#

ACE/CBA uses it

#

RTP?

#

you mean RPT?

#

I need it.. Because otherwise I would literally throw thousands of RPT messages

short trout
#

@still forum thx, will check

swift crane
still forum
#

this command executes script stuff remotely

swift crane
#

so. other players will also see stuff? ok

still forum
#

If you tell remoteExec to execute it on other players.. yes.

#

But I have no idea what you mean by marker or smoke

#

smoke is vehicles. and markers are also created globally unless you force it not to by using the local commands

tough abyss
#

@swift crane you don’t need remote exec 99% of the time

#

Whoever told you it makes any mission work is a liar

keen bough
#

I have done it. I rewrite it now cleaner but i did a complete dump-script, that not only sorts items but also checks if they are suitable for an ace-arsenal entry. From weapons and their atachments, to containers, to vehicles.

astral tendon
#

How do I check what unit is the player using the remoteControl? especially for UAVs

keen bough
#

Checking for rifles is this:
if (_var isKindOf "Rifle") then ?

still forum
#

what is _var?

#

Rifles are not objects, you cannot have them in a variable

#

so.... probably not?

keen bough
#

_var = weaponname got with weaponsItemsCargo (select and stuff)

tough abyss
#

Wiki has example how to use isKindOf why not check it first?

keen bough
#

I did it, but i dont understand the examples too good and wanted to know if i could do it that way. I already have another way ^^

tough abyss
#

It has the example how to use it with "Rifle"

#

What do you not understand there?

keen bough
#

The part where it says >> "bwa3_g36k". Is that predefined? Or is this the weapon the example was looking for? because then i could use >>_var

#

so the _iskindof give just the state of false/true (like stated)

tough abyss
#

There is no such thing on wiki, where did you get it from?

keen bough
#

_isKindOf = "Rifle" in [(configFile >> "CfgWeapons" >> "BWA3_G36K"),true] call BIS_fnc_returnParents; // is true

#

"BWA3_G36K" is this, in this example, used as "I want to know, if this specific weapon is a rifle" or not? Because if it is, then i can use a variable instead of a fixed predefined name.

tough abyss
#

That is not an example that’s a comment

#

The example says Example

keen bough
#

@tough abyss Could you hit me with a bat every now and then? 😄

#

so can i use this:
if (_weaponName isKindOf ["Rifle", configFile >> "Cfgweapons"]) then?

tough abyss
#

Yes

keen bough
#

you can now hit me with a bat

#

(but also, i have now saved this information anyway in my head, and i wont loose this information ^^)

winter rose
#

unless hit hard with a bat

keen bough
#

but that would solve all scripting problems ^^

twilit scarab
#

Can someone help me im trying to make a mission where 6 ospreys fly over an airport and drop a bunch of paratroopers, using the RHS paradrop way point. Problem is when they see enemies they fly crazy and dont end up dropping anyone.

#

Works fine with no enemies

#

How can i make the pilot ignore the enemies

keen bough
#

set the pilot(s) to careless. Then they ignore enemies (afaik)

twilit scarab
#

How do i do that

keen bough
#

You create the weypoints via script i guess?

#

If not, and you do it via the eden editor/2d editor, you double click on the waypoint and set it to 'careless'. That would be also something for #arma3_scenario then currently

twilit scarab
#

Oh i figured id need a script for it, thats why i posted in here

#

Well i got another question for you that im sure requires a script

keen bough
#

Well, you could do it with script(s) or you could do it directly in the eden editor, or even within zeus ^^ Depends on how you wanna do it

twilit scarab
#

The easist way lol

#

I want to make a mission, where a cruise missile hits an anti air site in the beginning, then some CAS bombs the airfield. After that paratroopers land and you gotta fend em off.

#

How do you script the VLS to shoot at a specifc target without a support or radio option since it will be on the enemy team

keen bough
#

I think you work something out with https://community.bistudio.com/wiki/doTarget i guess. At least, that what i can imagine. But a more experience scripter probably can give you more directions. Like @still forum or @tough abyss

still forum
#

Too advanced scripts for a beginner

#

You're better off finding something if someone else already wrote it

twilit scarab
#

Im sure someone has, i mean who wouldny want to call in their own cruise missiles, or have one hit a specific area

tough abyss
#

I despise A3 AI, please do not tag me into this clusterfuck @keen bough

#

I think I made 0 posts so far in #arma3_ai and would like to keep it this way

twilit scarab
#

So i kind of figured out the scripts and commands or whatever for firing the cruise missile, i just dont kow how to put em into play

#

The commands is "HAFM_CRUISEFIRE"

#

Prior to calling the command i have to set the target location

#

Vehicle_name setVariable ["Cruise Waypoints", _TargetLoc, true];

#

Before that i gotta open the hatch doors

#

In order to force the hatches for cruise missile open animatedoor

#

Command is "hatch1L"

#

Vehicle_name animateDoor ["hatch1L", phase];

#

I just have no idea where to put these commands

#

Like do i put these into the object init, or composition init, or do i place a script waypoint down?

twilit scarab
#

@keen bough can you enlighten me on where to put these commands?

fringe yoke
#

Does anyone know the Display ID for the loading screen? The one after the map briefing screen while you are loading into the mission

#

or anyway to know once the loading screen has faded out

still forum
#

There might be multiple loading screens after briefing

#

so just one ending doesn't mean you are through all of them

twilit scarab
#

#ignored

fringe yoke
#

So is there no way to know when the player is loaded in, and ready to move around?

still forum
#

you can run around while in loading screen

#

And even 20 seconds after you were already running around, any mod might launch a new loading screen because that mod wasn't done initializing yet

#

CBA has a eventhandler that tries to catch the last loading screen

#

but it only does the best that it can do. Doesn't mean that there are no loading screens after that event, any mod could launch one

keen bough
#

@twilit scarab I would need to look into it myself first to see what i would do before i could explain it, i am very sorry :3

#

i had over 8 hour session now to fix an arsenal problem with weapons that have a grenade launcher XD

twilit scarab
#

I cant even get the Hatches to open

#

These are ships from HAFMs and theres a manual that shows you how to script the cruise missiles but its not very detailed

#

I named the ship im using "Destroyer" in the object init variable spot.

#

And i put the following line in the init spot

#

_Destroyer animateDoor ["hatch1L",phase,now];

#

But nothing happens:/ its supposed to force the silo hatches to open @keen bough

#

@tough abyss no its the Arleigh Burke Class Destroyer from HAFM ship mods

slow elbow
#

onPreloadFinished?

#

@fringe yoke

twilit scarab
#

Im trying to post a screenshot of the guide but i dont have permissions

#

Oh fkin hell i finally got it

#

I needed to replace phase with 1

#

So the correct command is

#

Destroyer animateDoor["hatch1L",1];

#

Now for the hard part of actually getting it to fire on the correct target

#

Okay i got the cruise missile to fire but cant figure out how to get it to hit a specific target

#

It says:

#

Targetloc_: is an array with format positionAGLS

#

But i have no idea what that means

#

Vehicle_name setvariable["Cruise Waypoints"_targetloc,true]

#

My question is what do i replace targetloc with? A grid number?

#

Ya i can get the grid number

#

079107

#

How do i convert that to position for future reference?

quasi sedge
twilit scarab
#

So my syntax should look like this:

#

Destroyer setvariable["Cruise Waypoints"_realPosition = "079107" call BIS_fnc_gridToPos,true]

#

Does that look correct?

robust hollow
#

no

twilit scarab
#

Whats wrong with it

#

Says im missing an end bracket

robust hollow
#
private _realPosition = "079107" call BIS_fnc_gridToPos;
Destroyer setvariable["Cruise Waypoints",_realPosition,true];```
#

or just use the call instead of a variable at all/

twilit scarab
#

Oh okay ill give that a shot ty

#

Whats the private part in the beginning mean?

robust hollow
#

defines the variable in the current scope instead of checking parent scopes for an existing local variable of the same name to overwrite.

twilit scarab
#

Fuck now it isnt even firing the cruise missile

#

Says error in expression

#

This shit is such a head ache

#

Im gonna try to XYZ method

#

Ill try it

#

Well you were right

#

It fired again

robust hollow
#

weird, i would have thought you can considering you can use symbols that can't be used in raw form.

twilit scarab
#

Should i change real position to targetloc?

#

"Error Zero Divisor"

robust hollow
#

using select with an index outside the range of the array or dividing something by 0

twilit scarab
#

i dont really know what im doing wrong, heres my entire script for the destroyer:

#

Destroyer animateDoor["hatch1L",1]; _targetloc = "079107" call BIS_fnc_gridToPos; Destroyer setvariable["Cruise_Waypoints",_targetloc,true]; ["HAFM_CruiseFire",[Destroyer]]call CBA_fnc_serverEvent;

robust hollow
#

send the error log

twilit scarab
#

Where do i find that

robust hollow
#

rpt file

twilit scarab
#

okay i will attempt to find that

#

does the script itself look okay?

robust hollow
#

yea, the script itself looks like it isnt where that error is coming from

#

not that snippet anyway. idk about the functions it uses

twilit scarab
#

its the only thing i have scripted

#

where is this rpt file located?

robust hollow
#

%LOCALAPPDATA%\Arma 3

twilit scarab
#

i found the file but i cant just click and drag it in here

robust hollow
#

dont need the file, just the error log from inside it

#

scroll down to the bottom and then start scrolling back up until you find it.

twilit scarab
#

think i got it

#

22:37:59 Error in expression <und ((_mapPos1 vectordistance _mapPos2) / ctrlmapscale _ctrlMap);

if (_stepY >>
22:37:59 Error position: </ ctrlmapscale _ctrlMap);

if (_stepY >>
22:37:59 Error Zero divisor
22:37:59 File A3\functions_f\Misc\fn_gridToPos.sqf [BIS_fnc_gridToPos], line 82
22:37:59 Error in expression <hicle [0,0,0];
_Target setpos (_WPArray select (count _WPArray - 1));
_TargetPos>
22:37:59 Error position: <select (count _WPArray - 1));
_TargetPos>
22:37:59 Error Zero divisor
22:37:59 File \HAFM_Navy_Core\scripts\CruiseMissile_Fire.sqf [HAFM_fnc_CruiseMissile_Fire], line 106
22:38:00 [1.07941e+006,24563,0,"XEH: PostInit started. MISSIONINIT: missionName=Red%20Star%3a%20EP1%20Invasion%20of%20Malta, missionVersion=53, worldName=Malden, isMultiplayer=false, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
22:38:00 [1.07941e+006,24563,0,"CBA_VERSIONING: cba=3.10.1.190316, "]
22:38:00 [1.07941e+006,24563,0,"XEH: PostInit finished."]

robust hollow
#

well there you go, line 106 of the file \HAFM_Navy_Core\scripts\CruiseMissile_Fire.sqf . im going to assume _WPArray is an empty array

twilit scarab
#

so how do i fix it

robust hollow
#

idk... make sure the array isnt empty 🤷

twilit scarab
#

im like really noobish to this if you cant tell lol

robust hollow
#

im going to go a step further and assume it happens when you do this
["HAFM_CruiseFire",[Destroyer]]call CBA_fnc_serverEvent;

#

scrolling up further you have an issue with BIS_fnc_gridToPos too so im going to assume ur position is wrong

twilit scarab
#

its a grid number tho?

robust hollow
#

or ur map isnt defined? shit idk. good luck 😃

twilit scarab
#

fuck my head hurts

#

im so close to getting this right i can taste it

#

plus its on malta so idk how the map wouldnt be defined

slate gull
#

So if i have a big list of player Steam UID that i want to use in a code for member only area do i list them in square brackets ["blahblah", "blahblah"];? or in {} ??

proud carbon
#

Hey I'm trying to put UPK-23-250 BZT on Mi-24G's pylon 1 through 4 via spawning in script. Anyone know what classname it is? or what do I put in for

  _Hind setPylonLoadOut ["pylon1", ""]; ```
#

please 😛

robust hollow
#

@slate gull []

slate gull
#

Like this uidListA[] = {"blahblah"}; ??

#

i found that someone else did an array and it looked like that.

robust hollow
#

depends where your putting it. in a script you would do _array = [uids]; but in a config you would do as you have written above

slate gull
#

Its a script that gets called upon by another

robust hollow
#

yea, so do it in []

slate gull
#

ok

golden thicket
#

Is there a possible way to give the AH-9 a missile warning system (as a UI panel) via the init or a scipt? - Couldn't find results through Google search and the wiki isn't helping.

robust hollow
velvet merlin
#

how to script dynamically Zeus?

#
        _groupLogic = createGroup sideLogic;
        TEST_Curator_0 = _groupLogic createUnit ["ModuleCurator_F",[0,0,0],[],0,"NONE"];

        TEST_Curator_0 setVariable ["text","TEST_Curator_0"];
        TEST_Curator_0 setVariable ["Addons",3,true];//3: allow all addons with proper use of CfgPatches
        TEST_Curator_0 setVariable ["owner",player];
        TEST_Curator_0 setVariable ["vehicleInit","_this setVariable ['Addons',3,true]; _this setVariable ['owner',player];"];
        unassignCurator TEST_Curator_0;

        sleep 1;

        player assignCurator TEST_Curator_0;```
#

try this gives me the interface, but can only place markers and no units or vehicles and such

tough abyss
#

You need to add addons you wanna use to curatoraddons

velvet merlin
#

yep done this:

#
        TEST_cfgPatchesConfigs = "true" configClasses (configFile >> "CfgPatches");
        {
            TEST_Curator_0 addCuratorAddons [configName _x];
        } forEach TEST_cfgPatchesConfigs;
#

i think the problems comes from this being a mission with playScriptedMission

brave jungle
#

As silly as it sounds, how do I know if my Headless Client is actually working? I get the host identity created - how do I know if it's connected or does it not show up in the lobby (while logged as admin)

tough abyss
#

So when you are curator what hint str (curatoraddons assignedCuratorLogic player) shows? @velvet merlin

#

HC should be in allPlayers

velvet merlin
#

getAssignedCuratorLogic

#

["a3_characters_f","a3_weapons_f_rifles_mx","a3_weapons_f_pistols_p07","a3_weapons_f","a3_modules_f_curator_curator"]

#

this should be just those entities already created

tough abyss
#

And you don’t have those available to you via UI?

velvet merlin
#

just markers

#

getClientStateNumber returns 0

tough abyss
#

Wait that’s all it shows after you pushed in every addon available in game?

velvet merlin
#

so maybe the Zeus logic is confused by playScriptedMission

#

yes it doesnt get updated. but i see "TEST_Curator_0 setVariable ["Addons",3,true];"

#

maybe this plays into it. testing without

tough abyss
#

I don’t know what that variable does

velvet merlin
#

didnt help

#

i suppose the red display of the unit kinda indicates i am not allowed to be Zeus/do stuff

#

the adding of the player entity is done by:

            _curator addCuratorEditableObjects [vehicles,true];
            _curator addCuratorEditableObjects [(allMissionObjects "Man"),false];
            _curator addCuratorEditableObjects [(allMissionObjects "Air"),true];
            _curator addCuratorEditableObjects [(allMissionObjects "Ammo"),false];```
#

also not sure if this is correct

        TEST_Curator_0 setVariable ["Owner",player,true];
        TEST_Curator_0 setVariable[ "CuratorUnitOwner",player];```
#

seen it with name player, owner player, player and "player"

#

damn was just me super stupid 😭

#

<- had scope=1 mod on for BI assets 😇

tough abyss
#

Why?

velvet merlin
#

we dont care for modern stuff. WW2 all the way

#

in case someone wants to test

#

from terrain selection in main menu you can launch for any selected terrain a dynamic Zeus mission (to be polished but works)

twin steppe
#

Hello I'm trying to destroy the windows of these two buildings and then make them indestructible. For some reason this script doesn't work. Any help would be appreciated. ```
_newObject1 = createVehicle ['Land_i_House_Big_01_b_blue_F', [4340.48,3873.13,0.258911], [], 0, 'CAN_COLLIDE']; _newObject1 setPosWorld [4340.62,3873.32,237.545]; [_newObject1, [[0.00421824,-0.999991,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", 0, _newObject1]; _newObject1 enableSimulationGlobal true;
_newObject2 = createVehicle ['Land_i_Shop_02_b_blue_F', [4340.7,3885.15,-0.0610352], [], 0, 'CAN_COLLIDE']; _newObject2 setPosWorld [4341.52,3885.8,237.338]; [_newObject2, [[0.0014389,0.999999,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", 0, _newObject2]; _newObject2 enableSimulationGlobal true;

newObject = createVehicle ['ModuleExplosive_IEDUrbanSmall_F', [4351.61,3871.64,0], [], 0, 'CAN_COLLIDE']; _newObject setPosWorld [4351.61,3871.64,234.22]; [_newObject, [[0,1,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", 0, _newObject]; _newObject enableSimulationGlobal true; _newObject setDamage 1;
_newObject = createVehicle ['ModuleExplosive_IEDUrbanSmall_F', [4352.87,3883.59,0], [], 0, 'CAN_COLLIDE']; _newObject setPosWorld [4352.87,3883.59,234.22]; [_newObject, [[0,1,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", 0, _newObject]; _newObject enableSimulationGlobal true; _newObject setDamage 1;

[] spawn {sleep 5;

_newObject1 allowDamage false;
_newObject2 allowDamage false; };

young current
#

this feels awfully complicated

twin steppe
#

oh it is

#

I dont know how to script. This is just taken from ares save composition module. I added some stuff hoping it would work.

young current
#

probably not

#

thats usually not very good way to script

twin steppe
#

Well I mean the issue here isnt the placement of the structures. I dont know how to make the structures indestructible after Ive destroyed their windows.

velvet merlin
#

allowDamage false

#

or addEH handleDamage with 0 as return

twin steppe
#

yeah but if I add that after I spawned them in, before the ieds, the windows wont break.

#

so is there a way to disable their damage after the IEDs have blown out the windows?

#

better yet, is there a command that simply destroy structures windows`?

velvet merlin
#

setHit[Points] probably if the building is set up correctly

young current
#

was just about to ask that

astral tendon
#

How do I check what unit is the player using the remoteControl? especially for UAVs

dusky pier
#

hello, i got problem - execVM command don't working on multiplayer, but on editor is working fine

#

can't find any blockers for this command

quartz coyote
#

@dusky pier Are you executing the command locally or server-side ? and how ?

winter rose
quartz coyote
#

How could I make playerPlaceTwo and playerPlaceThree stop bothering me if no player is listed in position 1 and 2 or my array _players ?

private _players = allPlayers apply {[getPlayerScores _x param [5, 0], _x]};
_players sort false;
_players = _players apply {_x select 1};
playerPlaceOne = _players select 0;
playerPlaceTwo = _players select 1;
playerPlaceThree = _players select 2;```
#

probably a super dumb question but I'm having troubles with logic right now ^^

still forum
#

use params [<index>, objNull] instead of select

quartz coyote
#

i'll try that

tough abyss
#

Or rather param

still forum
#

🤦 yes ^ that

quartz coyote
#

thx
EDIT : It's working thx

astral tendon
#

@winter rose Thanks but seems line getConnectedUAV will do it.

#

I still dont get what unit inside he is controlling but I can figure some work around.

tough abyss
#

That line won’t return controlling player if the unit is not in a vehicle

#

Hence the example workaround

#

Oh wait, you want remote controlled unit not who is remote controlling? Never mind then

winter rose
#

@astral tendon depended on the kind of remote control, but yep: use getConnectedUAV for UAVs only (you could remoteControl a unit, for example)

astral tendon
#

Yeah, that is that feature as well.

#
addMissionEventHandler ["HandleDisconnect", {
    params ["_unit", "_id", "_uid", "_name"];
    _UAV = getConnectedUAV _unit;
    if (isnull _UAV) exitwith {};
    _unit connectTerminalToUAV objNull;
    _unit switchCamera "internal";
    {objNull remoteControl _x} forEach crew _UAV;
}];

I was doing this fix for the player that is connected to a UAV that disconnect wile remotecontroling a unit and allow other player to take control, connectTerminalToUAV objNull was not doing the full work and it was impossible to take control of the driver or gunner that the player disconnected.

twin steppe
#

@velvet merlin Thank you. Worked perfectly with SetHitPoints.

dusky pier
#

@quartz coyote local, on clientSide

#

i'm executing from client, on addon i have option: ```cs
class UserActions {
class Process {
displayNameDefault = "";
displayName = "Собрать соты";
position = "Door_1_trigger";
radius = 1.5;
onlyForPlayer = 0;
condition = "this animationPhase ""Door_1"" >= 0.5";
statement = "[] execVM ""code\MedoMed_dob.sqf"";";
};
};

#

but when i trying use action - nothing is working

#

script just not execute on multiplayer. But on local server, or editor is working fine

#

i don't want add that script to missionNamespace, because is use not all the time and just with that model

still forum
#

this animationPhase
what is this ?

#

any errors in RPT?

dusky pier
#

@still forum no, no errors

#

model work fine

#

when door opened - show action

#

but execVM don't working

#

i don't want define that code like function, because is don't use all time

#

hm...

#

what you think about that?

#
[] spawn compile preprocessFileLineNumbers "code\MedoMed_dob.sqf";
still forum
#

spawn compile preprocessFileLineNumbers might just aswell write execVM, they are the same thing

dusky pier
#

understand, thank you!

dusky pier
#

can i ask about how code optimization affects to fps?

proper sail
#

hard to answer, has to do with how full the scheduler is

dusky pier
#

for define all functions i used that code: ```sqf
private ["_code", "_function", "_file"];
{
_code = "";
_function = _x select 0;
_file = _x select 1;

_code = compileFinal (preprocessFileLineNumbers _file);

missionNamespace setVariable [_function, _code];

} forEach
[
["func1", "code\func1.sqf"],
["func2", "code\func2.sqf"]
];

proper sail
#

i think that way of using private is obsolete in a3

still forum
#

hard to answer, has to do with how full the scheduler is not really

#

scheduled code in general doesn't really effect fps, because it's limited to 3ms

dusky pier
#

but when mission is loaded - i got -30 fps

#

i was thinking about part of not often used functions - start with execVM, is make sense?

#

so as i understood - on fps affect functions, witch started from call command?

#

ah, so a lot questions, sorry 😃

still forum
#

on fps affect functions, witch started from call command? No. If you call from scheduled, it's still scheduled

#

i was thinking about part of not often used functions - start with execVM, is make sense?
functions laying around in a global variable doesn't cost fps, even if you never use them

proper sail
#

scheduled code might not directly influence fps, but if the scheduler is full it will greatly effect gameplay

#

dont know how bad this effect is in arma 3, but in arma 2 it's very noticable

dusky pier
#

@proper sail How do you optimize your code? What to pay attention to?

proper sail
#

can't really help you with that, i only do a2, a3 has much better methods

astral dawn
#

if you use unscheduled code a lot( which I think you dont) then you must optimize it a lot in order not to take too much time from eachFrame

#

if your scenario has low frames, most likely it's due to big amount of vehicles or units

dusky pier
#

@astral dawn i getting low fps without vehicleson map. When starting editor with my mission.sqm - pfs in kavala near 60, but when starting server, or local host - in ``kavalai getting only30` fps. Problem not in vehicles, or map objects. I think - problem in my scripts 😦

astral dawn
#

Well, if you disable your scripts, what happens then?

dusky pier
#

i have taskForce radio addon - is working with onEachFrame option. Have name tags - is working with onEachFrame too

astral dawn
#

you can use Dedmen's profiler to check performance impact of unscheduled scripts

dusky pier
#

as i understand - onEachFrame - unsheduled, but if i use```sqf
[] spawn {
code here...
sleep 0.5;
};

astral dawn
#

what does the code do?

#

if it asks engine to search for all trees in 10km radius it will stall engine too

#

if it's just some mix of different small operations then it won't cause FPS drops

dusky pier
#

that code check for units near (40 meters) and if needed - run another script

#

@astral dawn i think understand. Thank you!

astral dawn
#

that shouldn't be impactful I think

#

all scripts (scheduled and unscheduled) are in one thread anyway (the main arma thread), that's the point

dusky pier
#

i think - sleep will help, or no?

astral dawn
#

depending on what you need to achieve 🤷 I don't know

#

you can do sleep 9000; to make it almost never run 😄 it would help to reduce its impact for sure

#

but scheduled code can't take more than 3ms from frame anyway

dusky pier
#

understand

thin pond
#
removeAllItems player; 
removeAllAssignedItems player; 
removeUniform player; 
removeVest player; 
removeBackpack player; 
removeHeadgear player; 
removeGoggles player; 
 
player forceAddUniform "U_BG_Guerrilla_6_1"; 
 
cutText ["<t color='#009600' size='3'>Ausrüstung zurückgesetzt</t><br/>", "PLAIN DOWN", -1, false, true];``` Im trying to execute this in the player that walks through a trigger but when a player walks through that trigger it only gets executed on the host somehow... any suggestions ?
still forum
#

is it a serverside only trigger?

#

if !(player in thisList) exitWith {};
Make it global (not server only) and add this to the top

thin pond
#

testing right now with some friends

swift crane
#

which command will give me number of the unit inside the group?

#

F1. F2. F3 e.t.c.

high marsh
#

groupID iirc

tame axle
#

Hi All i'm looking for a script to put players in a parachute at the start of the mission, Here's what i tried in the init of each unit, but in MP each player sees each instance of the parachutes.

chute = "Steerable_Parachute_F" createVehicle [0,0,0];  
chute setPos [getPos this select 0, getPos this select 1, 100];  
this moveIndriver chute;  
#

so if I have 3 players we all see 9 parachutes.

#

its hosted mission, not dedicated server.

winter rose
#

try wrapping that with if (local this) then { (…) }

#

(still, it's usually bad practice to put anything in an init field)

swift crane
#
groupID iirc

@high marsh groupID ? nah - it Returns group name.

tame axle
#

@winter rose Thanks Lou will try that one later when I get someone to test with me. cheers

quasi sedge
#

can someone suggest optimizations here?

quasi sedge
#

_delta_max = 0.1 + (0.3 * _k); //Max. change of vehicle angle in 0.05sec

swift crane
#

@tough abyss Return Value: Nothing 😦
I need to get unit group number somehow

tough abyss
#

That is a setter

swift crane
#

@tough abyss but if I'm not inside this group?)

tough abyss
#

Not 100% on it but maybe units command returns units in the same order, worth checking it out

swift crane
#

yeah - the same order. example:
You've got 3 dudes in your squad: number 1, number 2, number 3.
In the group units array, number 1 is at index 0, number 2 is at index 1, number 3 is at index 2.
Everything's good, I can easily retrieve the actual number by doing array index + 1.
However, something bad happens to number 2, so now you've got 2 dudes in your squad: number 1, number 3.
In the group units array, number 1 is at index 0, number 3 is at index 1, so I can't retrieve the number based on the array indexes anymore.

#

but dont know how to make solution to work yet

winter rose
#

it's a hack, but it seems to be a working one

swift crane
#

thx - it works

winter rose
#

yay! I thought a getter existed, but well

swift crane
#

😃

thin pond
#

@still forum the script still only removes stuff from the host

tough abyss
#

then you have your trigger set up incorrectly

thin pond
#

i think i got it... stupid mistake... had the condition still set to "this" instead of "thislist"

tough abyss
#

What you just said doesn't make sense

#

thisList is an array, this is boolean

keen bough
#

boom! The emptying script works awesome! And it takes nearly all things into account, except the stupidity of very few people ^^

thin pond
#

@@dire star i was confused because the Changes i made in the "condition" field didnt saved, so it worked in SP as all settings where like before... Sorry for my stupidity.... What im trying to achieve is: any Player that walks through the trigger gets all his items removed, gets the Uniform and then the cuttext gets displayed

keen bough
#

i have actually a script that would exactly do that, in some way ^^

thin pond
#

Sounds good, but i Kind of only need to know what i have to replace this/player with in Order to achive that.... Taking a Look at it tomorrow night

keen bough
#

if you use a trigger, the script would be executed locally, if i am correct and therefore you can use 'player' if you wanna do this. or units. groups. Basically anything that can have any form of items in it.

frigid apex
#

Anyone know if its possible to make static weapon tripods compatible with normal handheld rifles and optics? And yes I do know about the ACE3 SSWT kit

next scaffold
#

I don't know if this is good practice or even needed but let's say I want my own way to handle errors.

params[["_markerName", ObjNull], ["_position", ObjNull], ["_size", ObjNull], ["_shape", "ELLIPSE"], ["_alpha", 0]];

[_markerName, _position, _size] apply{
    if(_x isEqualTo objNull) exitWith{
        ERROR2("Required argument undefined, %1", _x);
    };
};

In this function _markerName, _position and _size are actually required arguments. I just gave them a default value to check if they were not defined.

ERROR2 is a macro that display a message with systemChat.

Ok, so my problem here is that in the systemChat _x will be "objectNull" because that's the value of the variable but how, if I can, would go to get the variable name instead of the value?

tough abyss
#

You might wanna check isEqualTypeParams

next scaffold
#

brain broke, let me try to understand the command

quasi sedge
#

(If ACE_Item_DAGR Distance (GetMarkerPos "mar1") > 1000)

#

how to activate trigger if player has ACE_Item_DAGR and it outside from mar1 1km?

frigid raven
#

Can we add SQF-VM to this anyhow?

#

Because... it's sqf-vm

next scaffold
#

@quasi sedge I would try something like

if("ACE_Item_DAGR" in items player && player distance (getMarkerPos "mar1") > 1000) then{
    //code
}
still forum
#

@frigid raven already asked, answer is no

queen cargo
velvet merlin
#

@still forum can you tell how hard it would be to implement reading named properties ingame via sqf?

queen cargo
#

wut?

still forum
#

what u mean how hard?

#

if we had a command for it you could just call the command, but we don't

velvet merlin
#

does the engine read it from p3ds in runtime anyway and its just not exposed, or does it handle them each on its own

still forum
#

it only reads the properties that it needs/uses

velvet merlin
#

should be super easy for BI to expose them, no?

still forum
#

¯_(ツ)_/¯

frigid raven
#

@still forum are you sure it has been already asked? Are you really really sure?

still forum
#

yes

#

I was here

#

You can probably also use discord search

tough abyss
#

Drugs are bad, mmmk?

real moat
#

[this] Called from helipad (invisible) init:

params [
    "_obj"
];

if (_obj == "spawnA1") then {
    "mkrA1" setMarkerPosLocal ASLToAGL getPosASL _obj;
};
#

Getting generic error on this if statement.

winter rose
#

an object cannot be equal to a string?

real moat
#

I thought thats just a var?

winter rose
#

a var is without quote

still forum
#

A var is not a string

winter rose
#
if (_obj == spawnA1) then { (…) }```
real moat
#
if (_color == "blue") then
{
    hint "What a nice color";
}
still forum
#

Yes.. A _color contains a string. You can compare string with string

winter rose
#

that's string comparison, not variable comparison

still forum
#

you cannot compare object with string

real moat
#

But

#

When I str(_obj)

#

I get a string

winter rose
#

str transforms anything as string yes; but it's still not the good way to do it

real moat
#

What would you recommend then for converting it to a string so that I can use it in this if statement?

winter rose
#

do not compare objects by str'ing them ^_^

#

also, only execute the script on the wanted object, first of all ;-)

else just do:sqf if (_obj == spawnA1) then { (…) }

real moat
#

Okay interesting
So what is spawnA1 in this example if not a string?

winter rose
#

a variable

#

the variable name I guess you set on your helipad in the editor

real moat
#

Indeed

#

Okay okay I see, thanksa bunch @winter rose

winter rose
#

with pleasure! don't hesitate, you're welcome.

real moat
#

Hmmm thing is though, VS is telling me the variable spawnA1 is undefined.

winter rose
#

VS is an idiot :p

#

your mission.sqm defines variables and is loaded before scripts, so you're good 😉

still forum
#

It cannot see variables that it can't see. So yes. It tells you it's undefined

real moat
#

And It cant see it since its in game, okay, makes sense.

real moat
#

Hey guys

I'd like to use the array set [index, value]
But the wiki has not examples for multidimensional arrays.

#

For the index, how would I select the index of an array in another array?

ornate sky
#

@real moat I imagine you would have to select the required sub array first

#

(array1 # 5 # 2) set [index, value]

#

or

_newarray set [0, 123];```
#

in other words, select your sub array first and input it directly into set

real moat
#

I see, giving that a go

real moat
#

One last question for the day XD!

How can I go about using a forEach to loop an addAction for the amount of elements within an array?

#
// This is the array I have
_myArray = [
    "Alpha",
    "Bravo",
    "Charlie"
];

// This is what I want to loop
player addAction ["a useless action that does nothing", {}];
#

I have no code down yet so there is nothing specific to reference here. Just something I have been thinking of.

winter rose
real moat
#

Ive been looking at this mhmm

#

But I just cant seem to wrap my head around it

#

Can I literally just:

#
_myArray = [
    "Alpha",
    "Bravo",
    "Charlie"
];

{
    player addAction [_x, {}];
} forEach _myArray;
modest temple
#

Is there a way to have "player x was killed." Messages visible for zeus/admin while being disabled for everyone else

winter rose
#

@real moat yep

velvet merlin
winter rose
#

else it returns 0 yes

real moat
#

Saw this on the ACE3 Wiki:

#

5.2 Indents
"Every new scope should be on a new indent. This will make the code easier to understand and read. Indentations consist of 4 spaces. Tabs are not allowed. Tabs or spaces are not allowed to trail on a line, last character needs to be non blank."

#

Was just wandering why this is the case? No reason is provided.
I always thought tabs were more efficient?

still forum
#

No reason is provided.
Read again..This will make the code easier to understand and read

#

Ah you meant only the second part?

#

Preference. spaces were chosen, and everything needs to conform to one standard, can't mix and match as it will look terrible.

#

tabs are very slightly more efficient when the script is parsed for compilation.
But tabs can also look widely different on different computers.
Some editors use 2 space indent to display a tab, some use 4, some use even 8.
So one some users the indent will be way too little to be readable. On other it will be so big that code goes ofscreen

silk tulip
#

whats the difference between using params and private?

astral dawn
#

params is for unpacking an array into multiple private variables

#

useful for unpacking function input parameters, but can also be used anywhere else where you want to unpack an array

#

also it has alt syntax that aids type checking

#

private is just... you declare a private (local) variable

next scaffold
#

I need to check if the player is inside any of the markers I have in an array.

right now the only thing that has worked for me is

for "_x" from 0 to (count _allMarkers - 1) do {
    if(player inArea (_allMarkers select _x)) then {true} else {false}};

But since this is in a condition for an addAction, I don't know if my approach is too expensive?
Is there a more efficient way to achieve the same?

silk tulip
#

Would anyone be willing to take a look at some stuff and help me find why it's not working?

astral dawn
#

Just post it here and explain what you want to do, what doesn't fit your expectations, etc

#

So yeah this channel is for such cases: take a look at some stuff and help me find why it's not working 😄

silk tulip
#

Ok so my mod was originally built to run on Tanoa so all the buildable items are the green jungle variants. I'm trying to make them the arid versions for altis/malden. I edited the list of buildables to be variables instead of defined classnames, and the variables are defined in the missions initvar

#

so they went from

#
        ["walls",price,"classname","classname","classname"],
];```
#

and i changed it to

#
        ["walls",price,[OT_Wall1,OT_Wall2,OT_Wall3],"","description"]
];```
#

and then in the mission initvar i just added OT_Wall1 2 and 3 with the classnames

#

unfortunately when i changed them it broke everything and the mission no longer loads

#

I know i can just add the extra variants to the array but i'd really like them to change per mission

#

The original dev already did it so placeable maps change to the correct map

#

im super confused on the correct syntax for it too cause some of the original ones are in brackets and some arent

slate gull
#

Does this script make sense to any of you? Im running into issues with it not executing {
dataType="Trigger";
position[]={20919.838,29.900393,7289.7822};
angle=0.77276194;
class Attributes
{
condition="call{((vehicle player) in thisList) and ((getPos (vehicle player) select 2) < 1);}";
onActivation="null = thisList execVM ""file\file\script.sqf"";";
sizeA=20;
sizeB=17;
sizeC=20;
repeatable=1;
activationBy="WEST";
isRectangle=1;
};
id=35653;
type="EmptyDetector";
atlOffset=1.3319225;
};

winter rose
#

@slate gull to enhance readability please edit your last message and wrap it with
```sqf
yourCode
```

dreamy kestrel
#

why is it my ad hoc function arguments are appearing as any? literally, private myFunc = { params ["a", "b"]; /* ... */ }; and when I log those, i.e. to globalChat , they appear as any for a value.

#

I should be able to call that, for instance, [123, 456] call myFunc;, should I not?

#

player globalChat format ["a '%1' b '%2'", a, b]; will report "a 'any' b 'any'".

#

however when I capture a parent scoped private variable, a and breport correctly.

astral dawn
#

you must do params into variables that start with _

#

params ["_a", "_b"];

eager mesa
#

Can anyone simplify what arguments are? Really struggling to understand them atm

robust hollow
#

super simple description: they are values you have in one script that you want to use in another

eager mesa
#

gotcha, cheers

dreamy kestrel
#

underscore prefixed? I see, thank you for clarifying @astral dawn . I could not find this protocol documented anywhere.

astral dawn
dreamy kestrel
#

@astral dawn Except that private variable naming conventions are "relaxed", underscore is not required. or at least my scripts are running as such.

#

so somewhere along the way someone "got the memo" for parameters, but let it go for private variables.

#

read: I would suggest is not an examples issue, but an engine/parser issue.

tough abyss
#

Except that private variable naming conventions are "relaxed", underscore is not required underscore is a requirement for private variables

dreamy kestrel
#

@tough abyss exactly. try it.

tough abyss
#

try what?

dreamy kestrel
#

you were quoting me?

tough abyss
#

yes, you said nonsense

dreamy kestrel
#

literally I have a script private ["createBaseAsset", "asset_class_name", "asset_proxy_name_prefix", "asset_proxy_pos_atl"]; which works just fine. no underscores required. I get the expected results.

#

whereas the documentation calls for "_createBaseAsset" for example.

tough abyss
#

Your expression errors

#

error != working fine

dreamy kestrel
#

what errors? how?

tough abyss
dreamy kestrel
#

I'm not sure I follow, @tough abyss . You have something specific to suggest? or intended as a troubleshooting for the ad hoc function?

tough abyss
#

Whatever you think is working fine is not

#

this is not how you use private

dreamy kestrel
#

okay, then how do you use private? again, we're driving at params inconsistencies with the documentation, ultimately, but I'm all ears.

tough abyss
dreamy kestrel
#

I've seen it a couple of ways, declare a set of variables private, or ad hoc onesy twosy.

tough abyss
#

Please show the inconsistencies with documentation so if there are they could be corrected

dreamy kestrel
#

I just did, above, underscores are not required for private variables.

tough abyss
#

Where does it say so?

#

Underscore is required

dreamy kestrel
#

it's working fine for me, I get the objects placed that I want. so apparently not required.

tough abyss
#

Cannot find where it says you don't need underscore

#

And I am telling you it is not working fine as it errors

dreamy kestrel
#

The docs claim "The identifier of private variables in a script always has to started with an underscore.", however, mine are not, and it is working.

#

again, if you can be more specific, tell me how it is "errors".

tough abyss
#

You seem to have quite a misconseption what private is about

dreamy kestrel
#

again tell me how that is @tough abyss .

robust hollow
#

"Local variable in global space" is the error private [] gives when you give it a variable name without an underscore prefix

#

reading it sounds like it should be reversed but the point is it doesnt work without _

tough abyss
#

private variable by default cannot be defined without underscore (with exception of one special case in for loop)

robust hollow
#

it just sets your variables as a global variable instead which is why it would appear to work

dreamy kestrel
#

I see, so I could potentially evaluate those "private" variables in a debugger for instance?

#

which in fact I just did, I see...

#

then I can verify that further isNil "_asset_proxy_name_prefix" yields true, scope evaluated, private GC'ed.

tough abyss
#
_var = 123; 
call {
   private ["_var"];
   hint str [_var];
}

the result is [any]

var = 123; 
call {
   private ["var"];
   hint str [var];
}

the result is error and [123]

#

Now how is this working as expected?

radiant needle
#

My guess would be in the top example _var isn't being defined in the call

robust hollow
#

yea, the point is that the top one is working as expected and the bottom one doesnt work how mwpowellhtx thought it did.

dreamy kestrel
#

I verified that in my debugger @robust hollow , thanks for clarifying that.

#

and to be clear it did "work" but also potentially smashes bits in the namespace.

nocturne basalt
#

is it possible to check if a unit has been given a move order?

#

or if a move order is in progress?

tough abyss
#

unitReady ?

#

expectedDestination ?

#

currentCommand ?

nocturne basalt
#

ah ok. I was looking for something like "currentwaypoint", currentmoveorder etc

#

thanks

#

one more thing. can I check who gave the move command? I want to differentiate between move commands given by a script and commands given by a player/zeus

tough abyss
#

no idea, set a variable when you give order by script

nocturne basalt
#

ah yeah that is one way

#

could do that

tough abyss
#

or even better add scripted event handler

nocturne basalt
#

ok

keen bough
#

So, my shop script is evolving perfectly. But now i am thinking about taking it a notch up. Would it be a feature, players would like to have, or not?

I am talking about price-ranges of stuff (sometimes more expensive, sometimes more cheaper) and maybe like 'item of the day' thats half off and such things? I also could do a little stock market (later in the year, need my mission generator for that) that changes pricing accounting for things happening on altis.

Would that be nice or more or less uninteresting?

high marsh
#

Would make it interesting, but it would also move the economy away from being player based. You're essentially faking supply and demand with your idea.

#

At least in a capitalist economy. I think it's an interesting idea.

round scroll
#

is there a way to detect if an addAction script was called via the mouse wheel and click menu or via the keybind shortcut?

high marsh
#

Doubt it. Could detect shortcut keyboard and wire it to a variable. Then you'd know if someone used the action and if they pressed the shortcut

keen bough
#

Yeah, the player impact is probably not big enough to compete with the clash of west & east, their needs for weapons and such.

Like, when heavy war is going on, prices would shoot up very high, but when a no-attack-pact is made and everything comes to peace for a time, prices would go down again.

The war between east & west will be dynamically scripted (and only near players will be spawned in to have a living and breathing war-world)

keen bough
#

How can i make this, inherent of a 'point' like "mercs > new action"?

[player, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToObject;```
#

Currently i am simply not understanding what the ace interaction framework tries to tell me.

keen bough
#

Ah, i finally understood how it works.

ocean veldt
#

@round scroll try this:

player addAction ["This is a test", {
  // true if mouse button activated
  if (inputAction 'actionContext' > 0) then {
    hintSilent "Mouse Button Activated";
  } else {
    hintSilent "Keypress Activated";
  }; 
}];
high marsh
#

this is exactly as I suggested...

round scroll
#

@ocean veldt thanks, will give it a test after work, much appreciated!

#

@high marsh thanks as well 😃

still forum
#

@dreamy kestrel your SQF debugger? Tell me more about it. I didn't know there were any public debuggers besides mine

tough abyss
#

U jelly? @still forum

still forum
#

huh?

tough abyss
#

Are you jealous?

still forum
#

No. I just think he is using wrong words. Probably means some broken/incomplete linter and calls it a debugger.
Because if he had written a debugger, he would know that he's talking nonsense

#

Maybe he calls the debug console a "debugger"

tough abyss
#

I think you give him too much credit, probably calls debug console a debugger

#

Bingo!

astral dawn
#

I want that debugger, because the other one is... 🙄

still forum
#

Find someone who is able to write VS Code extensions and wants to continue what SkaceKamen started. Then you can have your debugger

astral dawn
#

what SkaceKamen started
you mean his linter?

astral dawn
#

you mean integration of your debugger into vs code, right?

still forum
#

yeah

astral dawn
#

oh that's interesting, I might know such a person

still forum
hollow thistle
#

Currently the whole codebase of that extension is a little bit messy. (if debugger uses sqflint as base it doesn't )

astral dawn
#

can you point me to the repo of his debugger plugin?

still forum
#

I just linked it above

astral dawn
#

ok thanks!

#

TypeScript? it's first time I hear of this 😄

quartz coyote
#

Hi all
I'm struggling with this

{deleteVehicle _x} forEach allDeadMen;```
it's returning ``Invalid number in expression`` on mission load. It's located in my outro script executed locally ...
robust hollow
quartz coyote
#

what does that mean ?

robust hollow
#

the last character in the line is some weird character that the compiler is interpreting as a number, but not a valid one? 🤷

#

delete the last character on that line. after the semicolon

still forum
#

How did you find that 😮

robust hollow
#

vscode shows the bad character on the end.

#

its a char with no width to it, is why other editors dont see it i guess

quartz coyote
#

I get the same in the error

still forum
#

Is the character also in the discord message? copying out of discord to notepad++ didn't show it to me

quartz coyote
#

{deleteVehicle _x} forEach allDeadMen;#

robust hollow
#

yes it is in the discord message

#

notepad++ doesnt show it

still forum
#

Ah! notepad++ does indeed show it. Just as 0 width as you said.. Man.. Next level debugging here 😄

quartz coyote
#

what's causing this ?

still forum
#

@quartz coyote delete everything from the semicolon till the next line. Then rewrite the semicolon

#

there is an invisible character after the semicolon as Connor said

quartz coyote
#

what is a semicolon ?

still forum
#

;

robust hollow
#

what

quartz coyote
#

ah ok

#

sorry

still forum
#

What did you call that character before if not semicolon?

quartz coyote
#

I didn't

#

😄

#

perfect it is working now

tough abyss
#

what's causing this ? copy pasting from forums

quartz coyote
#

Hell that's true

tough abyss
#

Wasn’t always the case but it came back after last forum upgrade

still forum
#

wut
Can you maybe find me a post that has that issue?

#

Maybe web department can fix it

tough abyss
#

If I come across yeah, don’t really copy paste much

#

You think? I have never in my life seen so incompetent web team as the one BI has

quartz coyote
#

jshock's post

tough abyss
#

Complained many times about the left hand side image on biki that covers half the page on mobile, the result - zero

still forum
#

Didn't complain to the right people then 😉

#

Don't get spaces in firefox, nor in chrome.
I checked the } forEach allDeadMen; line in jshock's first post

robust hollow
#

same for me ^^ 🤷

tough abyss
#

hello, does anyone know the best way to kick someone off your mission file? I've been thinking with endMission but maybe there's a better option

#

because at the current moment the best I can do against griefers and all is to freeze them

still forum
#

endMission is the easiest way I think

tough abyss
#

Hm, the issue is according to the wiki, I can't specify which object should get their mission ended

still forum
#

The local one will end

#

remoteExec to execute on specific player

tough abyss
#

You can use serverCommand to kick player

#

I guess something like this

serverCommand format ["#kick %1",_name];
#

No the one with the password

#

my mission file is player hosted (in game hosting), not a dedi

#

so i doubt I get a password?

#

If you are the host you can just login as admin and kick players

#

Yeah, I can understand that, what I'd like to do is give others access to kick/ban others too

#

That only makes sense if you have dedicated server where there is no host to oversee it

#

Besides hosted servers are for smaller groups

north tree
#

ok im trying to use grad persistence and after following the instillation instructions as closely as possable, every time i try and load the save in the editor it crashes and gives me the error that it cant find the cfgFunctions.hpp despite having the appropriate code to call it and it is clearly there.

tough abyss
#

Yeah, that's true, but here's the situation: There are virtual spectator slots on my mission file. While spectating, I don't wanna disturb anyone and/or cannot open my admin menu. So, I'd like the ones that have access to my admin menu to be able to kick/ban if they see fit through the menu

#

So if you are spectating and see some cheater you call a friend to kick him?

#

Ah no, you don’t want to disturb anyone. So what you just watch the injustice helplessly?

#

well, yeah it sounds stupid, I just wanna learn how to give access to others to these commands, expand my experience 😃

#

Yeah, hosted servers are not my favourite subject so maybe someone else can tell you how to manage them

#

thats understandable, thanks anyways

devout brook
#

Could use some help with onMapSingleClick. I am trying to turn off the functionality after the scripted event occurs so that the player can't just keep clicking on the map and invoking it. Have tried onMapSingleClick = ""; and it throws a "reserved variable in expression" error for that line. Any tips?

proper sail
#

its

#

onMapSingleClick "";

#

not
onMapSingleClick = "";

devout brook
#

doh

#

It works. I am ashamed. Thanks @proper sail

fluid abyss
#

Hey everyone
Someone know how to create a player activated trigger ?
I need the user to make an action (whatever, flare shot in the air ? Support call ?), and this action activates a trigger

keen bough
#

If i am not mistaken @fluid abyss there should be a "onFlareFired.sqf" within the server scripts on arma wiki. That could help you. Lemme quickly look it up

#

My Question:
Can you animate and/or use the arm on the back on a nemmera in arma? I want a script to unflip vehicles with the use of the nemmera.

fluid abyss
#

I really new to Eden, how can you import a script, and link it to a trigger ?

keen bough
#

I would suggest you a basic introduction to scripting and/or eden editor. Sadly i dont have a good link at hand for you. But there are plenty of very beginner friendly tutorials on youtube and in the www @fluid abyss I trie to find one i used and found pretty helpful. Gimme a minute

fluid abyss
#

Sorry to bother you again, do you know why this script raise a Generic error ?

#

{_X in crew evac} count (units alpha) >= {alive _X} count (units alpha)

still forum
#

use more parenthesis

fluid abyss
#

(alpha being my group and evac being the evacuation vehicle)

still forum
#

{_X in crew evac} count ((units alpha) >= {alive _X}) count (units alpha) isn't valid
({_X in crew evac} count (units alpha)) >= ({alive _X} count (units alpha)) is

tough abyss
#

what'd be the best way to make bullets deal lets say twice the damage?

#

addEventHandler and HandleDamage I suppose?

teal sorrel
#

Is it correctly understood that onPlayerRespawn fires every time the player respawns even if they use the respawn button?
Could i use this to get the position of a squad leader and then teleport the player to him?

keen bough
#

Yes, you can do something like that with 'onPlayerRespawn' but, afaik, vanilla has something like that already built in if i am remembering it correctly.

teal sorrel
#

@keen bough Hmm i looked around but couldnt find anything

keen bough
#

Ah, let me see, maybe i was mistaken.

#

Yeah, i actually think it was in mcc as we used this once barely half a year ago. You can write something yourself. Its actually not too hard as you just have to scan for alive players and get the group leader of the group and set your new spawned players position to that one/near that one eventually.

tough abyss
#

@fluid abyss Nothing is wrong with that expression, you probably caught non printable character from copy paste
@still forum >= is low precedence no need for parentheses

fluid abyss
#

After some testing, found out that the group alpha was non existent, just had to fix the group

tough abyss
#

@fluid abyss no that was not the reason. If apha was nil the whole expression would have been quietly ignored in unscheduled or undefined var error thrown in scheduled. If you had generic error it was most likely bad copy paste, happened a few times lately

devout brook
#

Does allGroups west create an array of existing groups on blufor?

tough abyss
devout brook
#

That is what I'm looking at, but the way I'm reading it, it doesn't seem to take any args. Some forum posts seem to indicate it does. I'm not sure.

tough abyss
#

pretty sure forum posts are wrong

devout brook
#

Thanks, seems that way

winter rose
#

@devout brook sqf private _westGroups = (allGroups select { side of the _x == west; });

#

(minus the brackets maybe)

devout brook
#

@winter rose I did this:

if (_countBlufor > 0) then 
{
    if (side _x == west) then
    {
        _getGroups = _getGroups + [_x] 
            forEach allGroups;
    };
...
}
#

Think that'll work?

winter rose
#

nope

devout brook
#

bleh

winter rose
#

_x is outside any forEach code block

#

my code works ;-)

devout brook
#

@winter rose thank you!

tough abyss
#

side of the _x 🤔

devout brook
#

I can't test it yet because it doesn't seem like the script is kicking off at all 😦

tough abyss
#

post the script

devout brook
#

I have a call in init.sqf, and the entire script is in while {true} do ....

#
while {true} do 
{
    [east, "OPF"] sideChat "The script is running.";

    if {playersNumber east > 0} then 
    {
        [east, "OPF"] sideChat "There is a player on EAST.";

        _countBlufor = 
            {alive _x and side _x == west} count allUnits;

        _getGroups = [];

        if (_countBlufor > 0) then 
        {
            [east, "OPF"] sideChat "There are units on WEST.";

            _getGroups = 
            (
                allGroups select 
                { 
                    side of the _x == west
                };
            );
            
            _groupToLocate = 
                [_getGroups] call BIS_fnc_selectRandom;

            _groupPosition = 
                mapGridPosition _groupToLocate;

            [east, "OPF"] sideChat "Locals have reported enemy activity around " + _groupPosition;
        } 
        else 
        {
            [east, "OPF"] sideChat "There have not been any reports of enemy activity.";
        };

        [] spawn 
        {
            sleep (10);
        };
};
tough abyss
#

no closing bracket }

devout brook
#

womp

tough abyss
#

you need to use syntax highlighter

devout brook
#

Am using VScode

tough abyss
#

[] spawn
{
sleep (10);
};

that doesnt make your script sleep instead it spawns millions of spawn scripts

#

your scheduler will smappen 10 seconds worth of scripts

#

really bad

devout brook
#

I'm intending to made the sleep be 5 minutes, but set it to 10s for testing

#

Also I'm not sure I understand the []spawn part of this; I was just following the sleep doc

tough abyss
#

side of the _x is not a valid expression

#

[east, "OPF"] sideChat "Locals have reported enemy activity around " + _groupPosition + _groupPosition will be just ignored

#

if {playersNumber east > 0} invalid syntax

devout brook
#

If _getGroups is an array, why won't BIS_fnc_selectRandom work?

tough abyss
#

_getGroups = ( allGroups select { side of the _x == west }; ); invalid, you cannot have ; inside ()

#

it is array inside of array, BIS_fnc_selectRandom will take only outer array and return inner array

#

_getGroups call BIS_fnc_selectRandom is correct

#

[_getGroups] call BIS_fnc_selectRandom is not

devout brook
#

Ahh okay

tough abyss
#

Described in detail on the page I linked with examples

#

Maybe start with something simple

#

one statement at a time

#

once a line is working as you expected add another one

devout brook
#

Good idea

tough abyss
#

anyway good luck

devout brook
#

Thanks for the help

devout brook
#

@tough abyss Success! Thanks again.

harsh vine
#

HEY guys, Im making a sector control mission ...but the problem im having is that, whenever someone kills an enemy player is shows up for all players and also gives everyone the "XP" ... how can i set it that only the "KILLER " can see the message and also the only one who gets the XP ???
https://imgur.com/VS7IrO2

i have this in my ...
..............................................................................................................
initplayerlocal.sqf
............................................................................................................
xpcash = 0;
addMissionEventHandler ["entityKilled", {
params["_killed", "_killer"];
_killed = _this select 0;
_killedside = side _killed;
_killer = _this select 1;
_killerside = side _killer;
cid = owner _killer;
cid publicVariableClient "enkilled";
if (!( _killer == _killed ) && { isPlayer _killer && !( side _killer == side group _killed )} ) then {cid = owner _killer;
cid publicVariableClient "enkilled"; [control, _this select 0] execVM "xp.sqf"; playSound "FD_CP_Clear_F";}}];

"enkilled" addPublicVariableEventHandler
{
xpcash = xpcash + 100;
};
..................................................................................................................................................
initserver.sqf
........................................................................................................................................................

"enkilled" addPublicVariableEventHandler
{
private ["_data"];
_data = (_this select 1 );
_killed = (_data select 0 );
_killer =(_data select 1 );
_cid = owner _killer;
_cid publicVariableClient "enkilled";
};

keen bough
#

Quick Question:

_action = ["Custom","Save Vehicles in Garage","",{[] remoteExec ["test2.sqf", 2]},{true}] call ace_interact_menu_fnc_createAction;
[merc_arsenal_box, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;

Did i write this correctly with the remotexec in mind?

#

long time i didnt use that ^^ figured it out ["params", "scriptpath"] remoteExec ["execVM", 2];

quartz coyote
#

Why isn't this channel displaying in Side Menu anymore ?

round scroll
#

@quartz coyote did you open 'creative editing'?

quartz coyote
#

what do you mean ?

#

omg ok

#

I understand

round scroll
#

you can collapse the 'creative editing'

quartz coyote
#

yeah smart

#

thx

#

does this work and if not, is there an easy way of doing it ?

var1 != var2 != var3 // All Different from each other```
hollow thistle
#
_vars = [var1, var2, var3];
(_vars arrayIntersect _vars) isEqualTo [];

(not tested but should work :3)

quartz coyote
#

Thanks !

hollow thistle
#

But don't try it with nested arrays as vars

#

arrayIntersect checks only 1st dimension of an array.

winter rose
#

wait, won't it simply return _vars?

#

https://community.bistudio.com/wiki/arrayIntersect
Additionally, using the same array for array1 and array2 will simply return array of unique elements.

first intention, I would do (maybe there is a better way)

_array1;
_tmpArray = [];
{ _tmpArray pushBackUnique _x } forEach _array1;
count _tmpArray == count _array1;```
#

or _array1 findIf { (_tmpArray pushBackUnique _x) == -1 } == -1 , but it's harder to get 😄

#

@quartz coyote @hollow thistle

#
// one-liner:
count (_vars arrayIntersect _vars) == count _vars```
quartz coyote
#

I'm gonna go with a simple check isEqualTo. Not like I had 200 vars to compare !
Let's stay simple.

winter rose
#

do it my way è_é

#

😉

hollow thistle
#

Yeah my first example was wrong. my bad.

#

(_vars arrayIntersect _vars) isEqualto _vars; this will work too won't it?

#

Not sure if this or count variant is faster.

winter rose
#

it should, but I don't know about items order (and I think this one would be faster)

round scroll
#

not a sqf question: We want to convert a bunch of p3d to use sbsource = visualex as property of the geo lod and either remove or rename the shadow lods as edit lods. Anyone got a o2 script for this purpose already or has any clue how to write one?

winter rose
next scaffold
#

Hi! Is there a way to check if the entire area of a marker is not inside/touching the area of another marker? In other words, the boundaries of a marker are not intersecting another marker's boundaries.

winter rose
#

playing with inArea, maybe

if they are round this can easily be done with getMarkerPos and distance

next scaffold
#

they are round indeed, would you mind explaining me how to use distance in this context? @winter rose

#

this is what we have now :

params ["_markerA", "_markerB"];

private _posA = getMarkerPos _markerA;
_posA inArea _markerB;```
winter rose
#
(getMarkerPos _markerA distance getMarkerPos _markerB) < (getMarkerSize _markerA select 0) * 2```
#

^ here you are checking that both centers are distance from at least a diameter

next scaffold
#

genious

winter rose
#

hehe

#

wait, only if they are the same size. I should write code while working at the same time e_e

#

with details:

private _distance = getMarkerPos _markerA distance getMarkerPos _markerB;
private _sizes = getMarkerSize _markerA + getMarkerSize _markerB;
private _biggestSize = selectMax _sizes;
private _result = _distance < _biggestSize;```
@next scaffold
next scaffold
#

ty!

next scaffold
#

@winter rose it doesn't seem to work. I have this:

params ["_markerA","_markerB"];

private _distance = getMarkerPos _markerA distance getMarkerPos _markerB;
private _sizes = getMarkerSize _markerA + getMarkerSize _markerB;
private _biggestSize = selectMax _sizes;

_distance < _biggestSize;

If the return of that is false then everything is fine. If the return is true, then the marker I was trying to create gets deleted and I get a hint to notify me that I was intersecting with a previous marker.

Markers get created at players position, if I am inside the old marker the function works as intended, marker gets deleted and I get the notification. But if I'm outside the old marker, new marker doesn't get deleted even when the new marker boundaries are obviously intersecting with the old marker ones.

See the picture to understand better the problem https://imgur.com/a/1jVpMab

winter rose
#

this script only manages round marker distance; if it properly detects marker overlap then this code is not the issue (maybe its usage).
you have to check with all of your current markers if you overlap, and if so delete the unwanted one

#

maybe keep a reference to old markers in an array or something

next scaffold
#

the logic that deletes them is done and working, it is the overlapping detection is what I have problems with

winter rose
#

if you take two markers, if they overlap, is the detection wrong?

next scaffold
#

I think so

#

let me try another test and show you I am not crazy

#

I made a while loop to keep updating the marker position and take the player position so you can see live how they overlap and the detection is failing

#

live debug on the up center is just the script you gave me returning true when the center of the marker is inside the other one

#

@winter rose

winter rose
#

ah yes! I forgot the * 2 on _biggestSize

#

@next scaffold getMarkerSize returns radius(es? ii?), not diametre!

next scaffold
#

jeez I'm really stupid

winter rose
#

I did it in the first code, not the latest ones, my bad!

next scaffold
#

working now, thank you very much!

tough abyss
#

getMarkerSize returns array

winter rose
#

@tough abyss yes, of radius_es_ (or radii ^^)

tough abyss
#

Well if you want to be more precise, they are axes

winter rose
#

true!

digital hollow
#

Should be sum of radii, no?

winter rose
#

getMarkerSize returns [x-axis, y-axis]
x-axis is half the width, y-axis half the height

digital hollow
#

If you have a tiny marker (radius 1) next to but outside of a huge marker (radius 10), center-to-center distance 12, so not-overlapping by 1, it would be within 2*_biggestSize.

winter rose
#

hmmmmmm I may have to rethink this one

#

(@work on some awful JAVA code…)

#
params ["_markerA","_markerB"];

private _distance = getMarkerPos _markerA distance getMarkerPos _markerB;
private _biggestA = selectMax getMarkerSize _markerA;
private _biggestB = selectMax getMarkerSize _markerB;
_distance < _biggestA + _biggestB;```
maybe something like this indeed
digital hollow
#

I believe so!

winter rose
#

@digital hollow thank you for your remark 👍

@next scaffold , updated code above ☝ (again!)

#

awful oneline 😄 :

params ["_markerA","_markerB"];

private _overlapping = (getMarkerPos _markerA distance getMarkerPos _markerB) > (selectMax getMarkerSize _markerA + selectMax getMarkerSize _markerB);```
next scaffold
#

wow

still forum
#

beautiful oneline

next scaffold
#

ty again

digital hollow
#

No checks against non-circular markers? =p and the same marker being passed for both?

winter rose
#

as you can see, NO

fluid abyss
#

Hello everyone
I still have trouble to create a player activated trigger
I need my player to do an action in a certain zone (whatever the action, radio call, flare shot...)

#

Does anybody have an idea on how I can create that ?

winter rose
#

is your area just a circle for a distance from an object/point?

fluid abyss
#

I would prefer, but it's not mandatory

#

I was thinking something like "my players come into a zone, shoot a flare in the air, and the evac come to save them from horrible things"

winter rose
#

because you could simply addAction and set a distance condition, the action will always be "attached" to the player but will only display when the condition is true

fluid abyss
#

So, I can use my range trigger to do a addAction when the come in, removeAction when they come out

#

and link this action to another trigger, that unlock my evac ?

winter rose
#

just addAction once, and in the condition argument, set something like "player distance zombie1 < 30"

fluid abyss
#

does player inRange evac_trigger works ?

winter rose
#

if the trigger is not server-only yes

#

inArea* or something

fluid abyss
#

I have this addAction [ "Call for evac", {evac_called = true; publicVariable "evac_called";}, nil, 1.5, true, true, "player inArea evac_trigger_zone" ]

#

Present in the init of my squad leader

#

But I can still call it from everywhere

still forum
#

what is evac_trigger_zone ? Trigger? Location? Marker?

fluid abyss
#

(For now I have the same evac_called in the black hawk wreck, but it think it's feels better with the action menu)

fluid abyss
#

Update just in case someone needs it:
I placed player_in_evaczone = true; publicVariable "player_in_evaczone"; in the server init

#

And placed a new zone trigger, which set player_in_evaczone = true when someone comes in

#

For the player init,

this addAction [
    "Call for evac",
    {evac_called = true; publicVariable "evac_called";},
    nil,
    1.5,
    false,
    true,
    "",
    "player_in_evaczone"
]```
silk tulip
#
    private _mortars = spawner getVariable ["NATOmortars",[]];
    {
        _mapCtrl drawIcon [
            "\A3\ui_f\data\map\markers\nato\b_mortar.paa",
            [0,0.3,0.59,(2000 - (_x select 1)) / 2000],
            _x select 2,
            24,
            24,
            0,
            ""
        ];
    }foreach _mortars;```
#

this is giving me a generic error

cold pebble
#

_mapCtrl isn’t defined?

#

You are also checking if their GPS isn’t visible, surely this should run if it is?

silk tulip
#

it's defined in the beginning of this script

cold pebble
#

Maybe show the whole thing?

silk tulip
#

i didnt write the script it's for an old mod i'm trying to revive

#

it's very long 😛

cold pebble
#

Is it on GitHub?

#

Aka could you link it?

silk tulip
#

yeah 1 sec

#

actually it might be fixed somebody pushed a pull request a few days ago

#

old RPTs

cold pebble
#

Ok I get the visibleGPS thing now lo

#

And ok

silk tulip
#

Thats fixed but now i see this Error in expression <lead = leader _x;

#

doesnt tell me where it is or what file its in

#
            if((_lead distance _lospos) < _spotDistance) then {
                if(>```
#

is there a way to search through every file?

digital hollow
#

Notepad++ can search text in files.

silk tulip
#

yeah but i'll have to search a boatload of files lol

winter rose
#

Visual Studio Code can search in a directory

tough abyss
#

yeah but i'll have to search a boatload of files lol notepad++ can search all that x10

still forum
#

Notepad++ "find in files" in the search dialog

digital hollow
#

You thought I meant "open each file and Ctrl+F"? xD

still forum
#

well afaik you can drag&drop folders into n++ to open every file in there 😄

tough abyss
#

when you have like millions temp files and you accidentally press saveAll

#

and the fucking button is right next to save and you cannot disable it

silk tulip
#

well @digital hollow i thought you meant open them all and use search in current documents 😛

still forum
#

Why would anyone press the save button if you can just CTRL+S

silk tulip
#

I didnt know about that search in file function

#

thats awesome

#

thank you

tough abyss
#

yeah I do

digital hollow
#

Now you can LIVE!

silk tulip
#

ok so i found where the broken stuff is but im not sure why its broken

#

it's flooding all the RPT logs though

#
            if((_lead distance _lospos) < _spotDistance) then {
                if(>```
#

aside from updating the outdated syntax it looks the same as the old version

tough abyss
#

loop_IOP_details params [""_group"",""_lospos""]; really?

#

oh i see you pass it as a string

silk tulip
#

i didnt write any of this code, i'm pretty new to the whole thing. I took up the mod and the guy I had got hired to do official content so im stuck here trying to fix little things while i wait on somebody to replace him

silk tulip
#
private _lospos = ATLtoASL ([_pos,[0,0,5.5]] call BIS_fnc_vectorAdd);
private _post = (_pos nearObjects ["Land_Cargo_Patrol_V4_F",10]) select 0;

private _group = creategroup resistance;
private _dir = ((getdir _post)+180);
_group setFormDir _dir;```
#

_post isnt being defined

#

halp GWsetmyxPeepoCry

digital jacinth
#

just means there is not any object of the type Land_Cargo_Patrol_V4_F, you have to account for this

#
private _pos = _this select 0;
private _lospos = ATLtoASL (_pos vectorAdd [0,0,5.5]);

private _group = creategroup [resistance, true];
private _post = (_pos nearObjects ["Land_Cargo_Patrol_V4_F",10]) select 0;
private _dir = 0;
if (isNil "_post") then {
    _dir = random 360;
} else {
    _dir = ((getdir _post)+180);
};
_group setFormDir _dir;
#

or make the search radius larger

silk tulip
#

hm

#

the script is for initializing a player built object, so i wonder if that would break things.

#

I'll have to test it out.

digital jacinth
#

why is it even creating a group then??

silk tulip
#

adds the spawned AI to high command i think, if thats what that means

#

like i said im still learning all this lol

#

tbh they server no purpose in the high command bar though so i could remove that.

#

Just clutters things

edgy dune
#

I tried looking for this but couldnt find anything for it, but theres no way to get the helmet of a unit is there? like how unitBackpack returns the backpack object. Im trying to see if I could use scripts to change a helmet texture

robust hollow
#

you cant change the texture of helmets by script, no.

high marsh
#

can you make hidden selections for helemets though?

fluid abyss
#

Hello again
My mission almost works... Except my players can't spawn.
Exactly, I want them to just "appear" in game, without using the respawn menu

#

(But keeping it enabled when they indeed die)

#

Found some info about the Description.ext file, but it doesn't seems to work, I still have the respawn menu at the start of the mission

fluid abyss
#

Well, nevermind, I found the root cause (I placed everything in class Header, including respawnOnStart)

keen bough
#

And if the helmet has variations, you could easily do a workaround to 'change' the helmets camo.

edgy dune
#

@keen bough ah okay thank u. I didnt check for the word headgear, I was searching like gethelmet or something. Thank you.

keen bough
#

haha, i know exactly how you feel ^^

silk tulip
#

anybody have any advice for when shit aint working and there are no errors to be found

tough abyss
#

Count opening and closing curly brackets

arctic zealot
#

would it be possible to include CEF into Arma 3 using mods?

still forum
#

"CEF" ?

winter rose
#

install ABCCEF and uninstall CBA 😄

quartz coyote
#

I want to set a velocity to my vehicle in the direction I pointed him in.
Is there a way to convert Direction into Verctor values to use as velocity ?

digital hollow
#

If you want to work with model directions there is setVelocityModelSpace

quartz coyote
#

Oh ! I didn't know ! That's perfect

#

thx

digital hollow
#

And if you need a world direction as a vector, use vectorDir

queen cargo
cold pebble
#

inclusive

#
for "_i" from 1 to 10 do { systemChat str _i; };

finishes with 10

queen cargo
#

what is happening on

for "_i" from 0 to 10 do
{
    systemChat str _i;
    _i = _i + 10;
};```
cold pebble
#

only 0

queen cargo
#

or when this is being done:

for "_i" from 0 to 10 do
{
    systemChat str _i;
    _i = true;
};```
cold pebble
#

just 0 again

queen cargo
#

no error or anything like that?

cold pebble
#

negative

queen cargo
#

kk

fluid abyss
#

Hey everyone
I'm this close to finish my map.
Sad problem is, when all my tickets are depleted, and all my players are dead, the game end with a "Mission completed". How can I change this to "Mission failed" ?

silk tulip
#

hey i have a script that is spamming my RPT logs with an error because of a broken variable. How would I 0 out the broken variable to stop the error? It's not a priority to fix it right now i just want it to stop flooding the logs

still forum
#

give us the "an error"

silk tulip
#
            if((_lead distance _lospos) < _spotDistance) then {
                if(>
 8:10:26   Error position: <_lospos) < _spotDistance) then {
                if(>```
#

the one i was trying to fix yesterday 😛

still forum
#

a local variable?

silk tulip
#

yes

still forum
#

can't do much about that globally

#

Or rather.. nothing

#

Besides fixing the real origin of that error

#

as far as I remember it was a nearestObjects?

#

Make sure the object that it wants does exist

silk tulip
#

im pretty sure the object it wants does exist

#

my private var _post isnt being defined

#

could i do something like if _post = nil then[]

silk tulip
#

Ok so i have another probably dumb question lol

#
private _lospos = ATLtoASL ([_pos,[0,0,5.5]] call BIS_fnc_vectorAdd);
private _post = (_pos nearObjects ["Land_Cargo_Patrol_V4_F",10]) select 0;```
#

is _pos just doing nothing?

#

because _pos is just saying select the first element in the array correct?

#

and then in _lospos it's essentially saying _lospos = ATLtoASL ([_this select 0,[0,0,5.5]]

#

and thats just selecting 0 in that array

tough abyss
#

you pass it to nearObjects command, so it is not doing nothing

silk tulip
#

so it's saying select the FIRST near object?

#

with the given classname

tough abyss
#

no it says select 1st element from returned array, obviously if return array contains no elements it cannot select it

silk tulip
#

yeah but nearObjects returns an array of all the land_cargo_patrol_v4_f doesnt it

tough abyss
#

maybe yes maybe no

#

depends

#

can return []

silk tulip
#

well thats what it's SUPPOSED to do right

#

given there is one to return

tough abyss
#

is this what wiki says?

silk tulip
#

ah yeah i found it

#

thank you

#

#

(_pos nearObjects ["Land_Cargo_Patrol_V4_F",10]) does the 10 mean only list 10 objects?

#

ah no found it, its the search radius

quartz coyote
#

Hi all,
Is there a way to delete or at least list all surrounding objects of type WW2_BET_Bwire_4 from IFA3 mod ?
I've looked in their configs but lets be honest... it's rampage in there...

winter rose
vast sand
#

So I am scripting for the Arma 2 warfare module and I was trying to do some custom settings. I had this block BIS_WF_LimitedWarfare = true; BIS_WF_UrbanWarfare = true; BIS_WF_Classic = true; BIS_WF_EnableCivilians = false; BIS_WF_FIELDHOSPITALCHANCE = 60; paramsArray = [-1,-1,-1,12,0,0,0,0,false,-1,3,0,-2]; in a script that is initualized by the warfare module's init field. I started it up and I have starting funds a lot higher so I know that Limited warfare is working, but the max city part of paramsArray doesn't seem to be working. Am I using the array wrong in some way?

#

From the code of warfare if (!IsNil "paramsArray") then { if (Count paramsArray > 12) then { _victoryTime = paramsArray Select 0; _victoryScore = paramsArray Select 1; _victoryTowns = paramsArray Select 2; BIS_WF_MaxTowns = paramsArray Select 3; BIS_WF_FastTime = paramsArray Select 4; _minStartingDistance = paramsArray Select 5; _miscSettings = paramsArray Select 6; _neutralOpposition = paramsArray Select 7; BIS_WF_RelativeSideColors = ((paramsArray Select 8) == 1); _startTime = paramsArray Select 9; _support = paramsArray Select 10; _townRangeModifier = paramsArray Select 11; _townSpawnTimeModifier = paramsArray Select 12; };

mortal monolith
#

I made a little RP prison. I have scripted it in a few times and it is super fun. I have been trying to fuck around with game logic and triggers to get the door to be locked/unlocked by blufor only. Basically, I would have to be able to script it in through debug with only blufor being able to lock/unlock it. Idk if that is even possible as I am too new to this. I will link the specific gate I am trying to use. Does anyone know how to make this happen?

vast sand
#

Probably an if check when giving the action to lock or unlock to see if they are bluefor

proper sail
#

@vast sand your script is correct

vast sand
#

Guess I will try replacing the init script in its entirety

proper sail
#

Unless you forgot a closing bracket in the bottom snippet

#

But you probably didn't copy that

#

what im not sure about is BIS_WF_RelativeSideColors = ((paramsArray Select 8) == 1);

#

because in your array you put false

#

not sure what happens if you compare false with == to a 1

vast sand
#

Default value is false

#

You get a boolean 0 though

#

The bottom snippet is from the code within the module

quartz coyote
#

@winter rose Ok so nearEntities ain't working.
I'm looking for the "Type" of object it could be.
ex: "Car", "Tank", "building"
The name of the object here is WW2_BET_Bwire_4 but I want it's type based on the Cfg file.

proper sail
#

typeof "WW2_BET_Bwire_4" ?

quartz coyote
#

returns Generic Error
typeOf will return the "Class Name" and not the "Class Type"

winter rose
#

use the type instead of "Car"

quartz coyote
#

what ??

#

the type is what i'm looking for ...

still forum
#

Didn't we already tell you several times that it doesn't work like that?

#

Look up the classname in config viewer. And it will list you all it's parents on the bottom

#

choose one of them

#

there isn't one "type" of any object. Each object has multiple of what you call "class type"

quartz coyote
#

i'm asking because it's a mess inside the bin file... I can't understand how they named them. Hold on let me copy/past what I found, you can help me from there...

#
    class WW2_BET_Bwire_4: LIB_Objects_Wire_base
    {
        author="Beton";
        scope=2;
        scopeCurator=2;
        displayName="$STR_LIB_DN_OBJECTS_BARBWIRE_4";
        model="\WW2\Objects_m\Structures\WW2_BET_Militia_m\WW2_BET_Bwire_4.p3d";
        icon="\WW2\Objects_t\Structures\WW2_BET_Militia_t\icons\map_barbwire_ca.paa";
    };```
still forum
#

Config viewer. Ingame

#

manually walking over the inheritance in debinarized config files is a mess

#

What class type do you want?

#

How about that one right there LIB_Objects_Wire_base I'd assume all barbed wire inherits from that

quartz coyote
#

I'd assume so too

#

i'll check in the cfg viewer

#

there is so much in there too, how would I find anything 😦

#

I don't even know what Cfg file to open ...

#

I think it's in CfgPatches

#

but only assuming that because it's the main class in the bin file I opened

still forum
#

Vehicle is CfgVehicles