#arma3_scripting

1 messages · Page 246 of 1

indigo snow
#

GrpNATO_CO

does this hold a value?

#

wait this is all wrong

marsh storm
#

Have you used the F3 framework before?

indigo snow
#

group != string

#

i have devved for it, yes

marsh storm
#

awesome!

indigo snow
#

but group OBJECT will never == STRING

marsh storm
#

OK so I need to parse the object to a string?

indigo snow
#

what no

#

other way around

#

you need the group

#

in eden easiest way is to simply set it as group attribute

marsh storm
#

I currently set the groups in the unit inits as per F3, so I need to set the group elsewhere too?

indigo snow
#

that var might get set after assignGear is done running

#

but you would ideally do (group _unit) == myGroupName, in this case, == GrpNATO_CO

#

group name in EDEN is the Composition Variable name, when you edit group attributes

marsh storm
#

OK so my code will look something like if((group _unit) == GrpNATO_CO) then foo

indigo snow
#

ya

marsh storm
#

Excellent, i'll give that a bash, thanks chief

indigo snow
#

keep an eye on the next F3 release, the team is re shuffling a ton of stuff to adjust everything to eden spec

marsh storm
#

Any ballpark on release date or just soon(tm)?

indigo snow
#

©

marsh storm
#

I'll keep an eye out then, thanks for the heads up man

#

Also - just gave that a test - worked like a charm. Thanks @indigo snow

indigo snow
#

np

rancid ruin
#

i've got a similar question to that guy earlier, except i'm more stupid

#

pls somebody ELI5 vectors

#

and why this script doesn't work proper

#

why does this 3d ctrl only ever reach 0.66 on the vector i'm modifying?

#
                _model = (uiNamespace getVariable 'a_3d_model_ctrl');
                _modelDirUp = ctrlModelDirAndUp _model;
                _modelDir = _modelDirUp select 0;
                _modelUp = _modelDirUp select 1;
                _d1 = _modelDir select 0;
                _d2 = _modelDir select 1;
                _d3 = _modelDir select 2;
                _u1 = _modelUp select 0;
                _u2 = _modelUp select 1;
                _u3 = _modelUp select 2;
                
                
                systemChat str _d1;
                _d1 = _d1 + 0.1;
                _d = vectorNormalized [_d1,_d2,_d3];
                _u = vectorNormalized [_u1,_u2,_u3];
                _model ctrlSetModelDirAndUp [_d,_u];
            }] call BIS_fnc_addStackedEventHandler;

half hornet
#

Anyone here? got an issue w/ create vehicle

jade abyss
#

let me guess. It takes ages, until the object appears online? 😛

lyric isle
#

Beautiful minds of the editing world. I am trying to figure out how to get the remove all foliage (Ctrl+G) from the 3den editor to work during game play. Any ideas?

rancid ruin
#

not sure if you could do it better than hideObjectGlobal'ing something like nearestTerrainObjects [getPos player, ["Tree"], 500]

velvet merlin
#

can one use loadFile on any file type within a mission? (sqm, paa, *)

tough abyss
#

2x questions;

  1. How can I view the raw code for a bis_fnc? They're blank in the cfg viewer, assuming they're under cfgfunctions.
  2. How can I find the IDD for a specific part of the UI? Ex., the "hide" button in Virtual Garage.

please and thanks ❤

halcyon crypt
tough abyss
#

@halcyon crypt Ah, I was just being stupid, then. As per the norm. Thank you! 😃 And thanks for the allDisplays link, as well. Exactly what I needed.

tough abyss
#

Ah, though it doesn't seem to get the me necessary IDDs. I know the LOAD button in Arsenal/Garage is 44146, and neither the allDisplays or allControls gives me numbers similar to that. I have managed to guess a few other IDDs, but this is inefficient and doesn't help me in future situations.

halcyon crypt
#

Guess your only option is to scan the AllInOne config dump then 😃

tough abyss
#

That worked, didn't even know the Allinone dump existed, thank you 😃

little eagle
#

allDisplays does not return child displays of other dialogs

#

findDisplay can't get them either

vagrant badge
#

can write code for copy to clipbord building ID from cursor target ?

native hemlock
#

@vagrant badge Yes, but it's not suggested to use building IDs as they can change

#
_str = (str cursorTarget);
copyToClipboard (_str select [0, _str find "#"]);
vagrant badge
#

house_ this is id or clase name ?

#

Land_house_ .... ?

native hemlock
#

So you want the classname?

vagrant badge
#

yes class name

native hemlock
vagrant badge
#

@native hemlock dont wor i try in editor on tano hangar

vagrant badge
#

fail

lone glade
#

Any way to stop a player from entering a vehicle outside of allowGetIn (broken, action still shows up)

#

like, stop the action from occuring, not act after the fact

native hemlock
#

Is locking not an option?

lone glade
#

nope

#

revive system, want to stop peop;e from entering a vehicle with someone on their back

native hemlock
#

Worst case you could settle for GetInMan event handler

lone glade
#

and drop the dude yeah, but I want to avoid that

pliant stream
#

mission or mod?

#

@lone glade

lone glade
#

mission

pliant stream
#

then probably not

lone glade
#

if it was a mod it would've been much easier

native hemlock
lone glade
#

oh good idea, didn't think of that one

pliant stream
#

oh arma.. what a silly EH

#

that one might not work for keybindings

#

Since Arma 3 v1.49.131743 this EH returns array of params for selected/activated action in _this variable:
what was even the point before? 🙄

lone glade
#

disabling action menu entirely

rancid ruin
#

is there a better way to detect how near a unit is to something other than the distance command?

#

yes, the center of the tree is about 15.1 meters above your head, but you're still within 15 meters of that tree FFS

jade abyss
#

distance2D

rancid ruin
#

thank you

#

i should have known better

jade abyss
#

Save that page

#

=}

rancid ruin
#

dude i think i've bookmarked every page about sqf there has ever been

jade abyss
#

Just save that^^

rancid ruin
#

that's already saved on my browser homepage bro 😃

#

p.s vivaldi browser is very nice now

#

is it possible to make civilians ignore gunfire? allowFleeing doesn't quite do the job

steep matrix
#

hitPart EH is still local to the shooter in latest A3 or not?

vital onyx
#

yep

velvet merlin
#

ok good (at least no further mess up)
ok bad (that is so bad design)

queen cargo
#

not rly bad design

#

it is more that you got invalid expectations

#

that EH is not for what you would expect 😛

#

but you can get the networked variance with a lil bit overhead on networking side and some scripting

velvet merlin
#

bla bla

#

ACE2 has scripted such system

#

IF(A3) has scripted such system

#

the result is utter madness due to the bad design

#

and btw - the EH was made for ACE on request

#

the BI dev was just so clueless (or lazy) that he made it so bad

#

just ask Nou how "happy" they were with the result

#

BI loves to merge scripted features/modules into engine (while performance in general doesnt matter for these) which makes customization no longer possible more or less (without BI adding tons of extra sqf cmds)

#

whereas meaningful sqf cmds that would save ppl inefficient and complex scripting, it doesnt happen

tough abyss
#

anyone else has the error "author/ is not a value"? I searched for it in mission.sqf but couldn't find it anywhere

#

Never mind, seems to be connected to the new update

#

I'm trying to animate the fence in "Land_ConcreteWall_I_gate_F" (Tanoa building asset) but I don't know the corresponding animation name

vital onyx
#

hey guys

#

spawning a box with createVehicle (not present in mission.sqm), then trying yo add arsenal to it using
["AmmoboxInit",_box] spawn BIS_fnc_Arsenal on every client, but arsenal is not enabling, why?

vivid eagle
#

I know the additonal params for Ammoboxinit are optional but what happens if you use: ["AmmoboxInit",[_box,true,{true}]] spawn BIS_fnc_arsenal;

vital onyx
#

worked with ["AmmoboxInit",[_box,true]] hence it is a default value and no error given in my first try

#

anyway thanks - that solved my pain)

#

btw, first option works fine from box init field in editor

vivid eagle
#

Yea i use the first one you posted all the time from editor.

vital onyx
#

Also is anyone aware how while using MenuInventory to remove default loudout, defined by unit's class and leave only custom one?

ruby spoke
#

Hi guys, quick question. If addAction is run serverside then will all clients be able to see the action?

native hemlock
#

No

#

If you look at the top left of the wiki page for addAction it shows an E with a big L, meaning "Effects of this script command are not broadcasted over the network and remain local to the client the command is executed on" https://gyazo.com/d6f427393862a0b266fe99eec2059189

ruby spoke
#

ohh i see

#

okay thanks

vital onyx
#

Does anyone know wether BIS_fnc_arsenal has global effect?

#

the addVirtualItemCargo has global flag, what about arsenal function itself?

lone glade
#

it init the boxes everywhere

#

it's good practice to call it only once in initServer for all your boxes and add the items clientSide

vital onyx
#

why not from server using global flag?

tough abyss
#

I got the new Revive system from the APEX Protocol campaign working on the server. Only downside to it is that on respawn it resets your entire loadout. Is there maybe a workaround? BTC revive seems to remove a player from group leadership when killed

vital onyx
#

resets after you got revived?

thin pine
#

Quick question. I've just started writing my own function to check if a number is in a range (min,max) but this seems so extremely basic..is there no BI command that does this already? I've looked but I couldn't find any..

#

I mean it's literally just if(_number > (_minMaxArray select 0) && _number < (_minMaxArray select 1)) but considering SQFs speed vs native C++ speed I figured it's worth asking here. 😛

native hemlock
#

None to my knowledge, and that's such a simple operation that even if there was a function we are talking hundredths if not thousandths of a millisecond

thin pine
#

yeah fair enough...my function is very fast so it ain't a problem. Now and then I still stumble upon some useful SQF commands I had no prior knowledge about so I was secretly hoping something like this would be one of em 😄 It's all good though

tame portal
#

Tbh I dont know why people cut their scripts down to be performant as hell if its not necessary

#

I mean if it's not important theres no need to adjust it 100 times to cut it down for 0.0001ms

thin pine
#

depends entirely on the usage

#

if you run the script on each frame for example it's nice to have it as fast as possible.

nocturne iron
#

Preferably you'd make it as fast as possible, and then have it run on as few frames as possible

jade abyss
#

@tame portal Might work for some small missions. If you have a bigger crapload running -> imho each 0.0001 ms counts 😛

tame portal
#

Yeah I know it depends on the situation

#

but then there are people that shittalk others for not boosting their scripts to 100% performance even though its absolutely unnecessary

nocturne iron
#

Could someone have a look about how I could optimise this script?

tame portal
#

@tough abyss "I CAN SQUEEZE OUT 0.0001MS BLARGH"

nocturne iron
#

I'd give my virginity back for 0.0001

queen cargo
#

@nocturne iron i have no clue how they get removed from the field ... but i assume by getting killed
thus your loop does not makes sense
better use killed EHs

only reason to use such a construct would be if you would not have had access to the spawned unit

#

there you go with your performance boost

nocturne iron
#

Thankyou

#

It's an on-death

#

I was originally going to do an EH but the EH has to also be applied to the troops coming in as reinforcements

queen cargo
#

uhm ... so?

nocturne iron
#

Wasn't sure how to apply it :p

queen cargo
#

<OBJECT> addEventHandler [<STRING>, <STRING|CODE>]

nocturne iron
#

I see

#

Thanks

queen cargo
#

only reason to use such a polling way would be if you would have no direct control

nocturne iron
#

I get that, I was just worried that putting the addEH inside an EH triggered event would create some kind of cpu crunching loop

vital onyx
#

just keep in mind a fact about BIS_fnc_moduleRespawnVehicle - if air vehicle spawn with posATL select 3 > 0 - it would be respawned with engine on and retracted gear (which is always true for artificial island built with scripts)

nocturne iron
#

Yeah

#

I've modified my script to be a function that adds the EH to a given unit (_unit)

#

would applying the EH to units I spawn with the function like so work?

#

{_x moveincargo _helicopter; _nul = [_x] spawn fnc_act3_unitspawn_blufor_eh;} foreach units _grpCargo;

vital onyx
#

what EH are you applying? is it SP/MP?

nocturne iron
#

Killed, MP

#

It's working SP so far

#

Only complication is I have to find a way to prevent like 10 choppers spawning if a squad gets wiped out at once

forest jasper
#

hello guy

#

i'm trying to close inventory if groundweaponholder is around(in 5m)

#

can i place my code here ?

lone glade
#

use ```

forest jasper
#

need help its take my whole night

#
addMissionEventHandler ["EachFrame", {
  disableSerialization;
  if (!isNull findDisplay 602) then {
    if(isNil "KAPU_HANDLE_GROUND") then { 
      KAPU_HANDLE_GROUND = [] spawn {
        private _suppArr = player nearSupplies 5;
        for "_a" from 0 to (count _suppArr) - 1 step 1 do {
          if((typeOf (_suppArr select _a)) == "GroundWeaponHolder") then {
            (findDisplay 602) closeDisplay 2;
          };
        };
        KAPU_HANDLE_GROUND = nil;
      };
    };
  };
}];
lone glade
#

no need for an eachFrame EH

#

use the EH for inventory and override it

forest jasper
#

its not triggered when i open like unifrom on the ground

lone glade
#

are you sure? gimme a sec i'll check

#

it does fire

forest jasper
#

aw

#

how i can detect the ground event

#

i'm in altis life its got backpack ,veh, house

lone glade
tough abyss
#

Hey guys, is it possible to add a drag/drop animation for wounded players while using the End Game revive? Activating on player Killed, deactivating on player Revived?

#

I did the loadout saving the same way

forest jasper
#

i did on my server

lone glade
#

returns something like this

[B Alpha 1-1:1 (alganthe),
3c9a8100# 4: dummyweapon.p3d,
3c992b00# 7: dummyweapon_single.p3d,
3c992400# 8: dummyweapon_single.p3d,
59231600# 21: dummyweapon.p3d]
#

@tough abyss not at the moment

forest jasper
#

so try nearSupplies in the event you provide ?

tough abyss
#

@lone glade awh thanks anyway

lone glade
#

use nearSupplies and filter out the player, if there's other holders override the EH and close the inventory

forest jasper
#

okay i will be back . give it a try

tough abyss
#

@lone glade just for confirmation, creating a drag/drop script and calling it the same way as my loadout save/load (player addEventHandler ['Killed',{tag_saved = getUnitLoadout (_this select 0);}];
player addEventHandler ['Respawn',{player setUnitLoadout [tag_saved,TRUE];}];) won't work?

lone glade
#

no, the system is much more complex than that

forest jasper
#

is that new func ?

tough abyss
#

ah okay, thanks

lone glade
#

also the reason you cannot use revive inside vehicles is because setUnconscious is broken inside them

tough abyss
#

@lone glade thanks man, hope they will fix that in time then

lone glade
#

eh, I doubt it

tough abyss
#

so... back to BTC revive then?

lone glade
#

currently writing my own because I don't like btc

tough abyss
#

@lone glade me neither, so if you need any help or testers, let me know!

forest jasper
#

yes you correct its fired

placid root
#

hey 😃 does anyone know where the path to your mission.sqm is saved? like C:\Users\me\Documents\Arma 3 - Other Profiles\[6Rus]DonElSarjo\missions\bla.vr

#

some variable in uinamespace?

velvet merlin
#

Added: diag_ActiveScripts script command returning an array of running scripts
can someone compare the output of this (in todays dev branch) vs diag_activeSQFScripts please

forest jasper
#

hey @lone glade

lone glade
#

@velvet merlin probably only runs for scheduled scripts

forest jasper
#

can you please take a look i tink i go wrong

#
#include "..\..\script_macros.hpp"
/*
    File: fn_inventoryOpened.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    For the mean time it blocks the player from opening another persons backpack
*/
_suppArr = player nearSupplies 5;
_stopIt = false;
{ 
 if(typeOf _x == "GroundWeaponHolder") then { _stopIt = true; }; 
} forEach _suppArr;
if(_stopIt == true) exitWith {
    hintC "sorry, some weaponholder within 5m attached and its just not aollowed to look into";
    true;
};
private["_container","_unit","_list"];
if (count _this isEqualTo 1) exitWith {false};
_unit = _this select 0;
_container = _this select 1;

_isPack = FETCH_CONFIG2(getNumber,"CfgVehicles",typeOf _container,"isBackpack");
if (_isPack isEqualTo 1) exitWith {
    hintC localize "STR_MISC_Backpack";
    true;
};

if ((typeOf _container) in ["Box_IND_Grenades_F","B_supplyCrate_F"]) exitWith {
    _house = nearestObject [player, "House"];
    if (!(_house in life_vehicles) && (_house getVariable ["locked",true])) exitWith {
        hintC localize "STR_House_ContainerDeny";
        true;
    };
};

_list = ["LandVehicle","Ship","Air"];
if (KINDOF_ARRAY(_container,_list)) exitWith {
    if (!(_container in life_vehicles) && (_container getVariable ["locked",true])) exitWith {
        hintC localize "STR_MISC_VehInventory";
        true;
    };
};

//Allow alive players who've been knocked out to be looted, just not the dead ones
if (_container isKindOf "Man" && !alive _container) exitWith {
    hintC localize "STR_NOTF_NoLootingPerson";
    true;
};```
#

its alway handle GroundWeaponHolder but nothing around

lone glade
#

what do you mean by "nothing around"

forest jasper
#

like uniform

#

i just stand solid and press i

lone glade
#

and it doesn't open ?

forest jasper
#

yes

#

it's say hintC sorry,

#

no GroundWeaponHolder there

#

fml -*-

lone glade
#

player has one

forest jasper
#

player will be like C_man_1

#

okay let check it again - -

lone glade
#

make sure to have the debug console running checking for containers around

forest jasper
#

ya i'm , only this take me almost 24hr 😦

lone glade
#

@velvet merlin you forgot to mention the biggest change in today's dev branch changelog:

Changed: Disabled soft formation for cars formation driving

#

dammmmmn finally

thin pine
#

Another quick question guys. I remember at some point CfgRemoteExec got disabled because BI wasn't done with it or something. Is CfgRemoteExec fully functional and working by now?

lone glade
#

it's broken

#

they disabled mode 1 because of issues, apparently those issues are still present but you can enable mode 1 anyway

#

I got massive desync / increase in bandwith when using mode 1

thin pine
#

:/

#

but mode 2 works alright?

lone glade
#

yes it does

#

because it does nothing

thin pine
#

yeah default n all

#

alright thanks...hope they'll fix the whitelisting at some point

lone glade
#

also, something that might not be noted somewhere:
init.sqf sometimes run before remoteExec data with JIP flag

#

there fixed

#

initPlayerLocal and initServer do run after always

thin pine
#

them edits 😄

lone glade
#

holding 3 discussions at the same time is hard 😛

thin pine
#

i think that persistent functions are called refers to remoteExec (previously bis_fnc_mp)?

lone glade
#

who knows where remoteExec is on that list now

thin pine
#

yeah :S

lone glade
#

init.sqf seems to run before initPlayerLocal, always in my case

#

(dedicated)

thin pine
#

matches the table...I've never used any of the targeted inits though so I have no personal experience with their order of init

#

oh dedicated*

lone glade
#

initServer -> initPlayerLocal -> init afaik

thin pine
#

you lost me.

lone glade
#

preInit and postInit are placed properly tho

thin pine
#

first you say "init.sqf seems to run before initPlayerLocal" and now you say "initServer -> initPlayerLocal -> init afaik" - haha im so confused. But it's okay. I'm not bothered about any of this. Perhaps you shouldn't have 3 convos at the same time

lone glade
#

well, it's how it's "supposed" to work

#

someone would need to log everything and redo that table

native hemlock
#

BIS_fnc_initFunctions might also show you them

pliant stream
#

it may well not be deterministic

lone glade
#

the right question should be:
do people use init.sqf for the right reasons

#

aka when you need a value set on the server and client and you're too lazy to write it twice

vital onyx
#

@tough abyss example of headache?

lone glade
#

headache ---> "I forgot to tag my public vars"

runic heart
#

anyone have any difficulty examples theyve made with the new system?

lavish ocean
#

so after diag_activeSQFscripts, diag_activeSQSscripts, diag_activeMissionFSMs the diag_activeScripts finally is done
•Added: diag_ActiveScripts script command returning an array of running scripts
note it returns the array with count by types as originally wanted (just for statistical measurement)

lone glade
#

I guess the next step is diag_ActiveScriptsCount

lavish ocean
#

no, that's the one already

half hornet
#

anyone here?

#

I've got an issue and I've been trying to solve it for the past few days

#

When spawning buildings via createVehicle or createSimpleObject, then attaching them to the player, then detaching, they can then deal mass amounts of damage just by bumping into them

runic heart
#

what is the question

half hornet
#

How do you disable collision damage for certain objects

runic heart
#

found this by googling arma3 disable collision

half hornet
#

I'm not looking to disable collision, just the damage that it deals.

runic heart
#

write a damage handler

vivid eagle
#

Is there a way to check inventory for headgear items? Like if class ItemInfo is HeadgearItem

native hemlock
#

@vivid eagle If I'm understanding your question correctly this should work

(items player) apply {
    _parents = [configFile >> "CfgWeapons" >> _x >> "ItemInfo", true] call BIS_fnc_returnParents;
    if("HeadgearItem" in _parents) then {
        systemChat format ["%1 is in your inventory and inherits from HeadgearItem", _x];
    };
};
#

That will check all items in your inventory and show a systemChat if that specific item's ItemInfo inherits from HeadgearItem

vivid eagle
#

Awesome, thanks @native hemlock will test it in a bit.

vital onyx
#

hey guys, is there any scripted way to force player enable NVG? I mean scripted way to make it on/off for remote client

native hemlock
vital onyx
#

oh yes, forgot to look in here

#

hope it will make difference for new goggles which have both NV and TI channels

#

off works ok for NV and TI - sets back to normal vision mode, but no way to switch to TI mode

#

and I think I do not need it for now

#

thanks @native hemlock !

native hemlock
#

There probably is, let me check

#

Maybe not, I'll let you know if I find anything

vital onyx
#

checked in configs

#

did not found something related to particular vision mode

#

well, does not work for switching vision mode in scope

rancid ruin
#

@half hornet try just setMass 0.001 the attached object - that stops it dealing collision damage afaik

forest jasper
#

what is the id of this dialog

rancid ruin
#

what would be the most performant way to store a large amount of data which I could then filter? am I best doing this in a .cpp file and then using some config functions?

lone glade
#

arrays

rancid ruin
#

yeah i have a shit ton of arrays, what's the fastest way to find X array?

#

and don't say select

#

lol

lone glade
#

name the vars they're assigned to properly ?

#

if you have an array of subarrays select is indeed the best way

#

also depends which kind of data you're storing

rancid ruin
#

say I want to attach arbitrary data to those arrays and then filter them all by X value though

#

this is stuff best done in config right?

lone glade
#

no

#

just store shit like this

[[id, []], [id2, []], [id3, []]]
rancid ruin
#

like key/value style?

lone glade
#

and if you don't tell me what kind of data you're storing I wont' be able to help you much

rancid ruin
#

like say i'll be storing a ton of polygons which represent areas

lone glade
#

mod or mission ?

rancid ruin
#

like 5000 of them or something crazy

#

it's going in a mod anyway, so i don't mind doing it via mod

lone glade
#

if it's a mod do it via configs

#

but i'm sure you can rethink of the design and try to avoid having such a high amount of data

rancid ruin
#

you're probably right, i'm just having a bit of fun

#

have traced a load of fields on tanoa and altis, as polygons, and i'm messing around generating 1000s of plants inside these areas

#

but really i was just wondering in general what the most efficient way to store data is

lone glade
#

it depends entirely on what you wanna store

#

and since apply has been introduced it has changed

rancid ruin
#

like say we're storing data on farming fields. in javascript i could go field.owner = "john smith"

#

or field.nearestTown = "kavala" or whatever

lone glade
#

configs for that kind of data preferably

rancid ruin
#

i'd like to query data on sensibly named keys somehow

lone glade
#

arrays in an included file if a mission preferably

rancid ruin
#

thanks very much, useful info

#

and what's the best command for querying configs? there's a few ways to do it and i'm never sure which is best

rancid ruin
#

ah i've been doing pretty much the same thing, thanks!

lone glade
#

that doesn't surprise me 😮

rancid ruin
#

^i just made random positions near the center of the polygon, if (inPolygon) then i made a marker

#

unreliable as fuck

#

once the polygon gets to a certain complexity i think it just goes "fuck it, a rectangle will do, yeah?"

distant egret
lone glade
#

afaik no

#

and you're better off using remoteExec anyways

pliant stream
#

though if you're doing it a lot it might hurt performance

forest jasper
#

anyway to return all data in listbox ?

elfin bronze
#

Hey, I make a script for verify mod version between client and server, but I want to executed on the .pbo and not in the mission. I tried in my Functions.h (in the .pbo) this : class verifyFiles {preInit = 1;}; but the script is not executed

rancid ruin
#

@pliant stream i get "invalid number in expression", line 28, when i call that function

pliant stream
#

what were the arguments

rancid ruin
#
[(getpos player),zone] call test_fnc_inpoly```
#

in fact it's throwing that error before i even call the function

pliant stream
#

yea the macro is wrong

#

hold on it's an old script i had let me fix it

#
[[0.1,0.1],[[0,0],[0,1],[0.2,0.2],[1,0]]] : true```
rancid ruin
#

i think i just realised why i wasn't getting the results i expected before

#

my code being shit rather than inPolygon not working properly

pliant stream
#

😄

rancid ruin
#

that function is clever stuff though, did you write it before the BIS function?

pliant stream
#

don't know when that inPolygon was added, but it's arma 3 only i wrote mine for arma 2

#

didn't even know arma 3 had that before today

rancid ruin
#

they are both about the same performance wise

pliant stream
#

really lol

#

unless it's a complete shit implementation the native command should probably have much better performance

rancid ruin
#

inPolygon vs. foxy_fnc_poly
avg 0.31ms vs. avg 0.18ms

pliant stream
#

wat

#

are you telling me mine is faster

rancid ruin
#

that's the results i got running each 10 times from the debug console

#
hint str ((getpos player) inPolygon zone);```
#
hint str ([(getpos player), zone] call foxy_fnc_poly);```
#

being inside said polygon each time

pliant stream
#

are they both giving the same result as well?

rancid ruin
#

yeah, it's just a simple 4 point poly though

#

yours goes as fast as 0.11ms for me sometimes, and BIS' is always around 0.2-0.4 lol

pliant stream
#

bohemia pls

#

i get 0.234687ms for mine and 0.0031ms for inPolygon

#

maybe you're doing something wrong

#

they both give exactly the same correct results though

#

just use inPolygon

tough abyss
#

Does anyone have a line which can be executed to disable all hints in a scenario?

frail trout
#

Is it frowned upon to ask for general scripting help, with little previous knowledge? I've just hit a potential issue that scripting can fix?

native hemlock
#

No, as long as you aren't like "Can someone script x for me please?"

#

Never hurts to google your issue or question with "arma" somewhere in there as well

frail trout
#

Of course, naturally.

So I'm creating a map for future Zeus missions for a small group of friends. Small base on the edge of one of Tanoa's islands, with plenty of Helis etc. Now I want the Helis to respawn once lost. As a rule, we don't lose helis often but when we do the simple respawn script means that we're ending up with two many helis.

#

Are there any working examples of an object that brings up a menu to respawn certain objects at certain places upon request

#

I can happily hack away at a code such as this but my search efforts have fallen short, even when looking from the ground up.

native hemlock
#

I'm not sure if I know what you mean by "two many helis", for every heli destroyed is it spawning a new heli?

dusk sage
#

Has anybody played through the campaign? At some point there is a tied person, of whom you have an action to untie. There is a funky circular loading icon when doing it, anybody know how to reproduce that?

native hemlock
#

Thanks for reminding me...

#

I said I was going to put that BIS function on the wiki

dusk sage
#

cheers 👍

pliant stream
#

@tough abyss for real?

#

well that seems pretty retarded

tame portal
#

Hm

#

Does anybody already have the line that got used in the campain mission for the circular thing?

native hemlock
#

What circular thing?

tame portal
#

holdActionAdd

#

In the campain it had a pretty neat paa

#

Was a circle with a circle progressbar around it

native hemlock
#

a3\ui_f\data\igui\cfg\holdactions\

tame portal
#

Are they always there or do you have to reference those paas

#

Ah great

#

Thanks honey

native hemlock
#

The progress circles are all different icons

tame portal
#

So wait

#

they changed the progressicon every single time?

native hemlock
#

For the circles? Looks like it based on how many icons there are

dusk sage
#

It has the circular loading icon

tame portal
#

Thanks

#

Much love to your lads

austere granite
#

Anyone knows what determines the order in which preInit / preStart functions are run from cfgFunctions?

native hemlock
#

You might be able to get more insight from BIS_fnc_initFunctions, I would assume it's in the order they are read

austere granite
#

ye looking at initFunctions.sqf

#

seems like it's just from the order of configs

#

Which i guess is purely alphabetical

#

_cfgFunctions = (_pathConfig >> "cfgfunctions");
for "_c" from 0 to (count _cfgFunctions - 1) do {

that's about all there is to it

native hemlock
#

It's not alphabetical though, it's in the order they are loaded in game/in the config

austere granite
#

Seems you are right. What is the easiest way to change that. preloadAddons?

native hemlock
#

I've never really understood what that config entry did, are you trying to run something with a preInit before a BIS function?

austere granite
#

Basically got a different compile script and want to compile different functions on preInit/prestart based on some conditions

#

Thing is that I'm uising compileFinal and want to make sure the correct one is loaded also when extra addons are added (That use the same function names)

#

basically replacement functions

#

That's about the simplest explanation i can give for it

austere granite
#

Okay well i managed to do it. Made an extra dummy PBO putting the cfgPatches name of the other mod in there and doing requiredAddons[] += { my pbo with functions }

split karma
#

Guys, i need some help with a hopefully just dumb scripting failure.

#

Anyone got some time left?

velvet merlin
#

what would you guys see as useful capabilities to do meaningful performance (fps, network, scripts) logging and debugging to be added?

what is available:

  1. fps logging - https://community.bistudio.com/wiki/diag_fps

  2. capture slow frame - https://community.bistudio.com/wiki/Performance_Profiling

  3. log slow frames - https://community.bistudio.com/wiki/diag_logSlowFrame

  4. #monitor to show server fps

  5. network calls (although BI doesnt tell what each type is) - https://community.bistudio.com/wiki/mpStatistics.log

  6. list network entities - https://community.bistudio.com/wiki/logEntities

  7. list running scripts - https://community.bistudio.com/wiki/diag_activeSQFScripts (FSM, SQS)

  8. measure runtime of a piece of code - https://community.bistudio.com/wiki/diag_codePerformance

  9. logging of scripts taking more than 3ms in debug.log (diag.exe only)

134.367:   (last instruction at e:\kju\a3data\users\test\missions\#testVehicles.VR\init.sqf:40)```
urban ocean
#

ifll exec script on some action, and in script write "player move "...."" , it will be done on every player ? player addaction ["Free hostage", "hostage,sqf"], and in hostage.sqf - player playmove . Is it correct ? I just done everything like this, because tested it alone. Now im thiking it was bad idea

tough abyss
#

I was wondering, is there a particular reason why the 3D editor (of which I'm not a fan at all) tries to convert a 2d mission to 3d but opens a completely empty mission? Like it deletes literally every piece of information

barren magnet
#

@tough abyss Maybe place a playable unit in the old 2d mission, and then try it out again

tough abyss
#

I'll try that, thanks!

pliant stream
#

@velvet merlin a debugger?

velvet merlin
#

@pliant stream
wont happen in this engine

#

the next one using the ToM scripting engine might

pliant stream
#

i know

velvet merlin
#

didnt look into those games myself

#

static code analysis is quite useful though (not for performance aspects)

#

i wish someone would rewrite squint from SBSMac

#

preferrably open source so others could contribute and keep it uptodate

tough abyss
#

uhm.... all steam servers just died?

robust hollow
#

mmhm 😦

tough abyss
#

can't even enter my server's lobby

robust hollow
lone axle
#

apparently a poodlecorp "hack" (ddos?)

#

at least they are claiming it

#

and they are back

jade abyss
#

hmm

keyCarSoftBrake[]={};
keyCarBrake[]={};

keyCarGearUp[]={};
keyCarGearDwn[]={};

keyCarShiftFwd1[]={};
keyCarShiftFwd2[]={};
keyCarShiftFwd3[]={};
keyCarShiftFwd4[]={};
keyCarShiftFwd5[]={};
keyCarShiftFwd6[]={};
keyCarShiftFwd7[]={};
keyCarShiftFwd8[]={};

keyCarShiftRvs1[]={};
keyCarShiftRvs2[]={};```

GearUp
GearDwn
keyCarSoftBrake
keyCarBrake

Were they always in the profile? Can't remember seeing them before.
velvet merlin
#

i think yes @jade abyss

#

AFAIK BI tried to implement in in A3 during dev but gave up

#

try to search in the exe if there are still references to these strings

frail trout
#

Hi all, I'm not particularly good at scripting but I can hack away at stuff to modify.

I'm looking for a script / to create a script that respawns vehicles on request. Imagine a small inanimate object next to a helipad that a user can simply select 'request new vehicle' etc.

Any ideas? I can get the vehicles to respawn after death on a timer but thats it really. My search efforts have fallen short.

pliant stream
#

"my_vehicle_type" createVehicle [x,y,z]

#

that's how you create a vehicle

#

so you might add a "spawn helicopter" action or something to your small inanimate object in its init handler

tough abyss
#

is it true Eden editor will break the EOS system?

jade abyss
#

Thx4Info @velvet merlin

frail trout
#

Nice @pliant stream I think you've given me that needed boost, thanks!

tough abyss
#

I'm trying to use the EOS layout from BMR on my own insurgency to create a starting FOB, however when using the 3d editor EOS system breaks and won't spawn anyone

#

even tho squares are activated

#

script error keeps going zero divisor in eos_core

lone axle
#

(MyObj getVariable ["myArr",[]]) pushback (1)
Does this update "myArr" as set on myObj?

robust hollow
#

I would think not

#

I would do _var = .. Getvar...., edit that then re-set the variable as ... Setvar ["",_var] , but thats just me.

lone axle
#

Yeah, been doing it in a similar way so far

#

just struck me, I'll test it later

robust hollow
#

I imagine it wouldnt work cause all its doing it fetching the var, nothing about setting it, but i dont know for sure cause ive never tried 😃

pliant stream
#

@lone axle it will if myArr already existed on MyObj

lone axle
#

neat

frail trout
#

@pliant stream regarding the vehicle spawn you've just helped me with, If I take your examples verbatim it simply respawns on load of the map, is there something I'm missing to get it to work as planned?

For instance, walking up to a generator or whatever, having it display a 'spawn heli' option in the context menu? once selected, it respawns?

pliant stream
#

@frail trout that's what you use addAction for

#

my_small_inanimate_object addAction ["spawn heli", my_spawn_function]

frail trout
#

Sorry @pliant stream I'm learning retrospectively due to time constraints so there's many basics that I'm not aware of.

#

Oh okay in the objects init, I didn't mention the object.

#

just started with player addAction

#

is there a chat shortcode for code snippets like above?

pliant stream
#

surround a code block with three backticks (`) on each side

#

or one backtick for inline code

#
{
    comment "type of the heli to spawn";
    _type = "Land_UWreck_Heli_Attack_02_F";
    
    comment "get the position of the generator object (first argument)";
    _pos = position (_this select 0);
    
    comment "get a list of objects of the same type in a 10m radius around the generator";
    _near = _pos nearObjects [_type, 10];
    
    comment "if list is empty (no existing vehicles) then create new one";
    if (count _near == 0) then
    {
        _type createVehicle _pos;
    };
};

comment "create generator object near player";
_my_generator = "Land_FieldToilet_F" createVehicle position player;

comment "add spawn heli action to generator with the handler _my_spawn_function";
_my_generator addAction ["spawn heli", _my_spawn_function];```

why don't you try this in the editor console
frail trout
#

PortableHelipadLight_01_Blue_F addAction ["Spawn Heli", B_Heli_Transport_01_Camo_F createVehicle [2214,13335.585,0]];

This is what I have so ar which actually doesn't sem to do anything. Obviously I don't want you to simply script for me, I'm very interested in learning myself, but sometimes the best way I can learn is via working example.

pliant stream
#

yea i edited the code with comments

#

i didn't actually test it but it looks legit to me

frail trout
#

okay cool, I'll try that as that seems much more in depth and seems to have a few features that I would obviously want! Thanks man

#

@pliant stream this would be inside of an .sqf file right?

pliant stream
#

if that's what you like. for now i suggest you just copy paste it into the editor debug console and execute it to see what happens

#

then you can read the code and see why it does what it does

#

and like learn n shit

frail trout
#

haha yeah, exactly - thanks bro. Hugely appreciated

frail trout
#

@pliant stream Any idea why the else arguement is stopping anything from working?

`_vehicle_spawn_function =
{
comment "type of the heli to spawn";
_type = "B_Heli_Transport_01_Camo_F";

comment "sets position of spawn - use landing pad as coords"; 
_pos = [2215, 13335.252, 0]; 
 
comment "get a list of objects of the same type in a 5m radius around the helipad"; 
_near = _pos nearObjects [_type, 5]; 
 
comment "if list is empty (no existing vehicles) then create new one"; 
if (count _near == 0) then 
{ 
    _type createVehicle _pos, hint "UH-80 Ghost Hawk Request Accepted"; 
} else {
    hint "UH-80 Ghost Hawk Already Present";
}; 

comment "create generator object near player";
_my_generator = "Land_FieldToilet_F" createVehicle position player;

comment "add spawn heli action to generator with the handler _my_spawn_function";
_my_generator addAction ["Request UH-80 Ghost Hawk", _vehicle_spawn_function];`

#

It's not a crucial aspect, just would have been nice.

lone axle
#

I assume you didn't paste the part of the function where it's closed?

#

or is the function supposed to be done before the comments?

#

in that case I think a }; is missing

#

also you're calling _vehicle_spawn_function but it's named vehicle_spawn_function?

pliant stream
#

@frail trout also you separate statements using a semicolon ; not a comma , type createVehicle _pos, hint "UH-80 Ghost Hawk Request Accepted";

frail trout
#

@lone axle I'm not calling a function, I'm defining it. At least, as far as I am aware.

pliant stream
#

i think the code block got fucked up because you did inline with single backticks instead of code block with three backticks

frail trout
#

Three back ticks at the beginning and end - is that right?

dusk sage
native hemlock
#

```
hint "hi"
```
Would show up as

hint "hi"
coral pasture
#

Does anyone know if you can move the EG Spectator camera to a specific position?

frail trout
#

Thanks @pliant stream and @native hemlock

Okay so I've got the below in an sqf file.

_vehicle_spawn_function = 
{ 
    comment "type of the heli to spawn"; 
    _type = "B_Heli_Transport_01_Camo_F"; 
     
    comment "sets position of spawn - use landing pad as coords"; 
    _pos = [2215, 13335.252, 0]; 
     
    comment "get a list of objects of the same type in a 5m radius around the helipad"; 
    _near = _pos nearObjects [_type, 5]; 
     
    comment "if list is empty (no existing vehicles) then create new one"; 
    if (count _near == 0) then 
    { 
        _type createVehicle _pos; hint "UH-80 Ghost Hawk Request Accepted"; 
    } else {
        hint "UH-80 Ghost Hawk Already Present";
    };

Then I have the below in a random object:

this addAction ["Request UH-80 Ghost Hawk", _vehicle_spawn_function];

The above script seems fine however on the init script within the object I'm getting a "Init: local variable in global space" error.

native hemlock
#

_vehicle_spawn_function is a local variable

#

That will go in your description.ext and you have a few options of which way you would want to do it. So for example using the file path way it would look something like this

class CfgFunctions
{
    class leon
    {
        class vehicleSpawning
        {
            class spawnVehicle
            {
                file = "some/path/fn_spawnVehicle.sqf";
            };
        };
    };
};
frail trout
#

@native hemlock is it typically bad dev practise to leave loads of scripts in the root, like best to organise etc?

native hemlock
#

Then your mission folder would look something like this

mission.sqm
description.ext
    some
        path
            fn_spawnVehicle.sqf
#

I'd say so yes, if you have a couple of scripts it is no big deal but gets messy quickly

#

Then in the init of the object you would have

this addAction ["Request UH-80 Ghost Hawk", leon_fnc_spawnVehicle];
frail trout
#

SO regarding the parent classes @native hemlock, is there reason for those. I notice one is Leon and another related to spawning?

native hemlock
#

There are different formats, so it depends. For some reason the format I gave didn't work in the editor when I just tried it. So try this one instead

class CfgFunctions
{
    class leon
    {
        class vehicleSpawning
        {
            file = "your\path";
            class spawnVehicle {};
        };
    };
};

That would look like this

mission.sqm
description.ext
    your
        path
            fn_spawnVehicle.sqf
#

In this format for CfgFunctions the class vehicleSpawning could be renamed anything, it's just a categorization you could use for organization

#

So if you wanted to add more functions related to vehicle spawning you might add

class vehicleSpawning
{
    file = "your\path";
    class spawnVehicle {};
    class armVehicle {};
    class rotateVehicle {};
};
frail trout
#

Okay cool - I'm actually still getting the local/gloab variable error though?

#

local/global*

native hemlock
#

Can you paste the init for the vehicle

#

And have you tried using the vehicle respawn module?

frail trout
#

init for the object yeah? and no.

native hemlock
#

It probably would do exactly what you are looking for

frail trout
#
this addAction ["Request UH-80 Ghost Hawk", _vehicle_spawn_request];
native hemlock
#

You need to update that

this addAction ["Request UH-80 Ghost Hawk", yourTag_fnc_yourFunction];
frail trout
#

Oooh you've thrown me there.

#

is the "fnc" needed?

native hemlock
#

Yes if you defined it in the CfgFunctions like I described

#

I think the vehicle respawn module would do exactly what you'd like

#

While in Eden Editor pres F5 (Systems) > Select the cog icon (modules) > Search for vehicle respawn or go to multiplayer and find vehicle respawn > Place down vehicle respawn module > Select the vehicle or the module, right click, and click Connect > Sync to, then move your cursor to the opposite object and click it

#

If you did that correctly there will be a blue line between the vehicle and the module. If you right click the module and go to attributes you can set the specific settings for the respawning of vehicles attached to that module

frail trout
#

Am I going to be able to make it print Hint text and allow a custom option text such as the coded version?

#

Having a look now.

native hemlock
#

Yes, it has a built in hint it displays, which you can disable. Or alternatively you can use the expression field to execute code when the vehicle respawns

frail trout
#

lol so yeah that does exactly what's needed. Thanks @native hemlock !

vital onyx
#

interesting one
{arr deleteat 0} forEach arr;
deletes all but last element

PS yeah, I know that modifying array while iterating it is a weird idea

#

nope, it deletes first 2 elements if count arr == 3, deletes first 4 elements if count arr == 7

#

so, do not do like this)

dusk sage
#

Those results are consistent though

vital onyx
#

well by this way you get half an array removed

dusk sage
#

If the number of indexes was even it would be I imagine. Can you verify?

#

With count equal to 10. Not on PC

vital onyx
#

not on PC? where?

dusk sage
#

Sorry, I'm not at a computer to run it

vital onyx
#

it removes 5 of them

#

69 > 35 > 17 > 8 > 4 > 2

#

seems to be skipping an element on every deleteAt inside forEach code block

#

anyway I found my way through it

dusk sage
#

Yeh, so you'll always end up with floor((countarray + 1)/2) elements being removed

vital onyx
#

since it is for script replacement of BIS's vehiclerespawn module - I just replace destroyed vehicle with new one in array

#

yep, that's odd, but again

#

changing an iterating array is always weird idea

#

unpredicateble behaviour

dusk sage
#

It seems predictable from this. It's lowering the number of elements it's looping through each time

vital onyx
#

well yes

#

if count _array changes

#

so I ended up with for _i from 0 to count-1

dusk sage
#

It's bizarre though. Checking count every time

vital onyx
#

and just do not change the array length

#

because as @queen cargo mentioned - arrays in arma are mutable objects, and I do not want to spawn copies of it

dusk sage
#

What are you trying to do to an array?

vital onyx
#

I am writing a MP vehicle replace module to replace stock one
adding a vehicle to respawn manager - means to add this vehicle object to an array on server

#

from time to time script iterates through this array to check if we need some vehicles get respawned

#

when we have one - we need to remove old vehicle - because if we just delete it, its array element will become objNull

#

so I ended up replacing old vehicle objectin this array with a respawned one

dusk sage
#

Does the replacement vehicle have to go on the end?

#

Can't you replace the old element (at that index)

vital onyx
#

that's what I finally did

#
private _index = rwt_adrem_managedlist find _oldveh;
rwt_adrem_managedlist set [_index,_veh];
#

before removing _oldveh

dusk sage
#

You can still iterate through it using set

#

If you need to iterate

vital onyx
#

I need to iterate to check respawn conditions

#
{
    private _veh = _x;
    if (_veh call RWT_fnc_adremNeedsRespawn) then
    {
        [_veh] call RWT_fnc_adremRespawnVehicle;
    };
} forEach rwt_adrem_managedlist;
dusk sage
#

Iterate through and use set with _forEachIndex

vital onyx
#

I only need it sometimes, vehicle are not likely to respawn all at once at the same moment

#

for example we need it to respawn when alive _vehicle isEqualTo false

dusk sage
#

But you need to frequently monitor them all for that?

vital onyx
#

every 15-30 seconds

#

I do not need this on each frame

dusk sage
#

Loops in loops 😛

vital onyx
#

nope

#

no loops

dusk sage
#

Hehehe

vital onyx
#

I made a crontab for that purpose

#

if you are interested

dusk sage
#

Hard to see much on the phone. Looks good though

#

I think BI has a very similar set of functions

vital onyx
#

that's to avoid tons of while {true} do {}

#

they have many similar functions, but I always hit some limitations

#

like with vehicle respawn module

dusk sage
#

I mean, PFH/crontab idea functions

#

I only noticed the other day

vital onyx
dusk sage
#

There is one that repeats too

#

For infinite loops

vital onyx
#

yes

#

["itemAdd", [_id, _code, _timer, _timerType, _condition, nil, true]] call BIS_fnc_loop;

#
    //On each frame event handler
        missionNameSpace setVariable ["BIS_fnc_loop_onEachFrame", ["BIS_fnc_loop", "oneachframe", {
            //Function is called every frame
            ["oneachframe"] call BIS_fnc_loop;
        }] call BIS_fnc_addStackedEventHandler];

^^^ from BIS_fnc_loop

#

come on :)

#

that's a complete handbrake

#

in unscheduled environment

dusk sage
#

PFH ;)?

vital onyx
#

PFH?

vital onyx
#

for visuals yes - for things like respawn management - big overkill

dusk sage
#

I can't see the code on the phone, but I guess you're using a trigger longbow?

vital onyx
#

@dusk sage yes, trigger checks every 0.5 seconds if we have a job queued - it is just a select cmd

#

if there is one - the job is spawned

#

@tough abyss I know, I am not from that company)

dusk sage
#

So a slower PFH then

vital onyx
#

much slower

#

it designed for workloads where +/- 2-3 seconds will not matter

#

like bomb timer, veh respawn and other similar use cases

dusk sage
#

For purely the vehicle respawning, you said you'd need to check every 15 seconds. Surely a loop would be adequate?

vital onyx
#

why I need a loop? again, I made a cron scheduler for such things

#

max precision with trigger - 0.5 seconds

dusk sage
#

PFH, trigger, doesn't matter. You need to check one thing every 15 seconds

vital onyx
#

not exactly

#

the trigger evaluates ~0.5 seconds the first element of job schedule array, if arr select 0 >= time - it means that now we need to spawn a job

#

so we keep in trigger's loop only one simple operation

dusk sage
#

Like the idea behind PFH, yes

vital onyx
#

yep

dusk sage
#

All I'm saying is you are checking every 15 seconds, it doesn't seem crucial to use

quiet shale
#

Hi, I have a problem with base respawn. For testing purposes I made a simple mission file. 1 soldier 1 respawn marker, added the description.ext and startet testen. Hosting die Server on my local machine, everything works as intented. Loading the mission on my linux dedicated server the respawn button is grayed out and respawn doesn't work. Any ideas what the problem might be?

rancid ruin
#

is it possible to make a map ctrl which can't be dragged around with the right mouse button?

#

like, part of a dialog but not interactable with mouse cursor

teal coral
#

like the foldable map mod?

rancid ruin
#

yeah except part of a dialog, not a display

vital onyx
#

I guess it is, check Karel Moricky's mission in workshop - he has a mission showcase for all types of controls

tough abyss
#

hi guys, my server's been infested with SSPCM users lately. I'm currently using BASIX anti cheat mechanic and I've added sspcm.pbo to the blacklist. However some people still seem to bypass it, and I think it's because it only checks for lower case "sspcm" and not any capital-lower case combo of "sspcm". Is there a way to have it check for "sspcm" whether it's in capital letters or not? If not, would it be possible to have the basix search for .sqf files that are in the pbo file?

lone glade
#

there's absolutely no reason I can think of right now to use the scheduler

#

it provides no advantages over unscheduled whatsoever

lone axle
#

Is there a command similar to count that returns an array of the items that meet the condition?

foo = {_x % 2 == 0} §command [1,2,3,4];
foo = [2,4];
lone glade
#

select code does

native hemlock
#

Or more simply

_even = [1,2,3,4,5,6,7,8,9,0] select {_x%2 == 0}; // returns [2, 4, 6, 8, 0]
lone axle
#

cheers

native hemlock
#

@tough abyss Why not use verifySignatures?

tough abyss
#

wouldn't that block players with legit mods from joining my server?

native hemlock
#

Not if you have the corresponding bikeys in the keys folder

tough abyss
#

true but I meant "legit mods" that are not in the pack the server runs

#

like if my server isn't running RHS, someone with RHS would be kicked off

#

also I've tried the verify signatures but clan members with the exact same mod pack wouldn't be able to join, even if they have the exact same (!) files as the server

#

like putting them on a USB and transferring

lone axle
#

You generally don't want people to run mods that your server isn't using

#

e.g. someone with RHS accesses arsenal and picks a RHS weapon, then everyone else will get errors

#

then there are tons of mods which simply aren't made for MP

native hemlock
#

And they won't see it, if they are in a vehicle you don't have the mod for they will be floating through the air

#

Then from an anti cheat perspective you can't block a PBO name or CfgPatches entry, because those could be simply renamed by the addon user

pliant stream
#

@tough abyss then you were doing something wrong, or the mods weren't signed

tough abyss
#

all keys copied to the keys folder for the server

#

rest of the mods are all signed on client machine

#

for some it's RHS, some it's USAF etc etc

vital onyx
#

Sounds like eating a cactus

#

Server admin defines a set of mod played on server, if you do not verify mods players connect with - you will never get rid of cheaters and errors

#

pure brainfuck instead of game

tough abyss
#

I know but I'd prefer letting people with non-SSPCM mods join, regardless of the mods on the server. Is the coding of ArmA 3 when comparing filenames subject to capital <-> lower case differences?

#

like "sspcm" and "SSPCM" aren't the same for it

#

just to confirm what I was thinking

halcyon crypt
#

most things in Arma are case insensitive, or used to be anyway

#

not sure about string comparisons though

#

seems like "abc" == "ABC" is case insensitive and "abc" isEqualTo "ABC" is case sensitive

tough abyss
#

Ill post the code that checks for the mods later

#

1 AM here xD

tough abyss
#

This is the code used by BASIX to check PBO files:

#

//Addon Blacklist
_Setting1 = true; //Scan player PBO files ("true" is on, "false" is off, set to false by default)
_Setting2 = ["devcon.pbo","DevCon.pbo","DEV_PostA3.pbo","DEV_CO_Dummy.pbo","sspcm.pbo","SSPCM.pbo"]; //Addons you don't wan't on your server (e.g. "devcon.pbo")
// BASIX Engine

if (_Settings select 0) then
{
[{
if !(isServer) then
{
_Settings = call BASIX_SETTINGS;
if ((_Settings select 11) && ((getPlayerUID player) in (_Settings select 12))) exitWith {};
if ((count activatedAddons) > 348) then
{
for "_i" from 0 to ((count activatedAddons) - 1) do
{
_pboName = (activatedAddons select _i) + ".pbo";
if (_pboName in (_Settings select 1)) exitWith
{
_reason = format ["Blacklisted Addon (%1)",_pboName];
_reason spawn BASIX_BAN_ADD;
sleep 0.1;
waitUntil {!(isNull(findDisplay 46))}; (findDisplay 46) closeDisplay 0;
};
};
};
}
}, "BIS_fnc_spawn", true, true] spawn BIS_fnc_MP;
};

#

first bit (Addon Blacklist) is from the files called Settings

#

2nd bit from the file Initial

lone glade
#

use ```

tough abyss
#

@lone glade sorry could you elaborate that a bit more?

lone glade
#

use markdown code block

#

three of those before and three after the block

#

also, enable signature check, otherwise you're just open bar for cheaters

tough abyss
#

verify signatures will kick off anyone not using a mod that is not running on the server, so if people have a older version of a mod, they will still get kicked off, am I right? Also I'm not sure where you want me to use the markdown code block, do you mean '"SSPCM.pbo"'?

lone glade
#

like this

mycode
#

if you want people to be able to join with older mods keep the keys

#

just enable signature check, if you refuse to do so you have no ground to complain

tough abyss
#

might be just me but I'm seeing your [mycode] without any quotation marks

lone glade
#

O.o

barren magnet
#

Does anyone know how to use the restrain/unrestrain feature from the apex protocol in your own singleplayer / mp mission?

lone glade
#

which "restrain" feature ?

barren magnet
#

In the first mission from apex, you unrestrain a polcie man in the house you shall get to

#

Just before going to the radio tower

lone glade
#

that's a simple HoldActionAdd with an animation

#

it's not really a "feature" per se

barren magnet
#

You press spacebar for a few seconds and then he is free

lone glade
#

yeah, that's HoldActionAdd

barren magnet
#

uh nice, thank you

lone glade
#

there

#

read the header of the function too, it has more informations

#

for the animations themselves check the animation viewer then > cinematics, it has all of the ones you want.

#

and finally, if you want the animation to be seen by everyone remoteExec switchMove

barren magnet
#

Allright, thank you 😉

lone axle
#

is there a native command/function to shuffle an array?

lone glade
#

no

#

want the code to do it ?

lone axle
#

sure

lone glade
#
private _cnt = count _this;

for "_i" from 1 to _cnt do {
    _this pushBack (_this deleteAt floor random _cnt);
};

_this
#

put this into a function and enjoy.

lone axle
#

cheers

lone axle
#

Just realized that copying MyObj_2 no longer creates MyObj_2_1 but MyObj_3

#

That makes me absurdly happy

barren magnet
#

@lone axle I didn't notice before, but if that is true then thank god!

jade abyss
#

hm, is SetMarkerText still buggy sometimes? I rember some cases, when they were not synced to JIP Players.

rancid ruin
#

why's my camCreate quality so shitty?

#

never mind, think i've got it

#

switchCamera quality is normal, but rendering to texture gives me like 1/4 quality

scarlet spoke
#

Is there a way to open the Esc-pause menu via script?

frail trout
#

guys is armaholic essentially dead for scripts? Virtually everything I've tried is full of errors

lone glade
#

it is

#

if you need something ask here

dusk sage
lone glade
#

didn't realize KK rewrote it :p

dusk sage
#

😉

unreal skiff
#

Ok. I tried making a GUI for something a while back and I had a problem. I made it in the arma 3 GUI editor and all that, I didn't even add any functions to the buttons because when I went to test it, it just would say couldn't find the class name

#

Both the class names were the same. But it didn't launch anyways.

dusk sage
#

We'll need to see it to comment 😛

unreal skiff
#

I'm on my phone right now so I can't, but is there any reason you can think of?

#

Or is there some documant that is like a step by step that I can read through to see where I messed up?

lone glade
#

there's some documentation on GUIs

unreal skiff
#

Ok thanks

#

Lol can't look at it right now. School internet blocks it. XD

jade abyss
#
2016/07/19, 17:00:34 Performance warning: SimpleSerialization::Write 'params' is using type of ',NaN' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types

2016/07/19, 17:00:34 Performance warning: SimpleSerialization::Read '' is using type of ,'NaN' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types

2016/07/19, 17:00:34 .: Value type not matching: Number != Not a Number```

dafuq? `Value type not matching: Number != Not a Number` oO
rancid ruin
#

i got that error once and it made me angry and upset

jade abyss
#

ah, output is 0

#

...

lone glade
#

So, any idea why moveInCargo would just.... break and refuse to do so ?

#

and on top of it "fuse" the unit that I used as target with the vehicle ?

#

nevermind found it, localilty issue, moveInCargo uses AL

lone glade
#

apparently moveInCargo doesn't assign objectParent properly :/

scarlet spoke
#

Does someone know the IDD of the dialog for adding markers on the map?

vital onyx
#

check in config?

native hemlock
scarlet spoke
#

@vital onyx Where do I find the respective config?

#

@native hemlock thanks I'll have a look

split coral
#

It might be "RscDisplayInsertMarker" idd = 54?

vital onyx
#

@scarlet spoke open config viewer in editor and scroll down to Rsc* classes

#

I do not remember exact name, but seems @split coral pointed you where you need

scarlet spoke
#

@vital onyx @split coral Thanks for your help! 😃

frail trout
#

Has anyone got access to a database or just collection of really useful scripts that you throw in your content? I'm after a simple earplugs script that has a keybinding at the moment.

#

Oh also a kill ticker too. "player1 killed CSAT Grenadier - 200m" etc

rancid ruin
#

kill ticker seems like something which would be pretty easy to make but impossible to do properly

scarlet spoke
#

@split coral You were right... It's idd is 54

#

@frail trout Just look into the ACE SourceCode

frail trout
#

@scarlet spoke - actually a solid idea i hadn't thought of.

tough abyss
#

KoTH also have an earplug script (just press F1 to toogle EP)

dusk sage
#

@frail trout

if (soundVolume != 1) then {
    1 fadeSound 1;
} else {
    1 fadeSound 0.1;
};
rancid ruin
#

nice, now you just need to write the kill feed function quickly

#

don't forget to handle explosion and collision deaths

frail trout
#

oh ace

#

thanks @dusk sage!

vital onyx
#

So actually someone interested in script collection with easier process of adding it to your mission?

frail trout
#

Yeah, wouldn't most people?

vital onyx
#

I've made an attempt to make a framework for such thing

#

or better anmed skeleton

#

allows to copy script folder to your mission, run install script and it will be present

frail trout
#

Your post doesn't descibr what it includes exactly?

vital onyx
#

it is a tool for installation now we need to pack the scripts to form a library and the easy way to install them

#

I have repackaged one of my scripts to support this approach

#

more to come

frail trout
#

so currently your library is empty?

vital onyx
#

yes

#

it requires some time to fill

frail trout
#

oh well, I'll definitely download it.

vital onyx
#

there is also need to request permission from various scripts authors for such repackaging

frail trout
#

I couldn't personally give you any feedback until you've got stuff to add though dude!

vital onyx
#

ok :)

#

@frail trout you may suggest some scripts you want to see first)

frail trout
#

A basic revival system
A more in-depth revival system
Earplugs (hotkey and idealy a visual icon, top right or something to say they're in)
Custom Music Player that uses triggers easily
A few different types of mission intros - thing such as patrol ops comes to mind.

final sparrow
#

Neat library idea @vital onyx

frail trout
#

Yeah great idea. you could add in some serious functionality in seconds.

vital onyx
#

ok, that's really valuable input

#

thanks!

frail trout
#

I could likely think of a hell of a lot more. I genuinely believe that the arma life servers have some of the coolest little scripts added in their mission files.

winged thistle
#

Don't forget a deathcam

#

everyone likes to watch their own corpse

#

or maybe that's just me...

lone glade
#

the arma life servers have the shittiest written code you've ever seen outside of MCC

winged thistle
#

^

frail trout
#

Well I've experienced some good stuff just trying out the tanoa life servers to see what they are all about

winged thistle
#

I honestly don't know how I feel about this framework idea. On the one hand, it makes missions easy to build for people that aren't familiar with scripting. However, it encourages laziness on behalf of the person using the script because then they don't actually have to learn how things work in order to use them.

vital onyx
#

@winged thistle unfortunately that's true, but my oringinal intention to start working on it was time sacing on routine operations

winged thistle
#

I prophesy a wave of new mission makers flooding the channel with repeat questions...

vital onyx
#

to a get a good repeatable result

frail trout
#

@winged thistle, isn't that quite an elistist viewpoint?

winged thistle
#

No

lone glade
#

do it for yourself, not for others

#

and no, he's right

winged thistle
#

It's not elitist to expect people to learn how to use tools provided.

#

Just ask anyone you've ever referred to as "teacher"

lone glade
#

it's much better to have to learn how to use and write stuff than depend on someone else to do it for you

winged thistle
#

^ Give vs teach a man to fish

vital onyx
#

this problem already present

winged thistle
#

Touche

vital onyx
#

just instead of asking howto questions in separate threads of particular script authors you move it to a single thread

#

and it will definitely simplify support and save time for authors of scripts

lone glade
#

which other people can find more easily

winged thistle
#

It's that whole "lead a horse to water" idea though. Ultimately, there will always be people that are too lazy to use Google.

vital onyx
#

as for me I am most happy to support stringtables in separate files, split logically and then make the script merge it for me

#

the only thing I am worried about and not sure how to do right is about how to resolve dependencies, when some script depends on functionality of another script

winged thistle
#

Maybe have a flag for each script, and if present, check for dependent script, otherwise, error handling

vital onyx
#

yep there is some work to study and perform

winged thistle
#

I'd just do everything in an array var for dependencies, but maybe I just like to work too hard

vital onyx
#

right now it is am empty book shelf without library assistant

winged thistle
#

Well, I stopped watching The Outer Limits for now. Let me take a look at what you have so far...

frail trout
#

Well in that case we shouldn't have DIY website building applications and services and a myriad of other industry comparables. But they exist due to demand.

Perhaps there's not demand for this, but it'll likely create it.

#

I get what you guys are saying though

winged thistle
#

Go find me a Wix.com website that doesn't suck donkey balls.

#

😛

#

Those tools breed complacency rather than competence.

#

I'm not saying don't do it. Just saying it's not always the best option for someone with grand mission plans in mind.

vital onyx
#

@winged thistle I would broaden you thought, show any site using framework that does not suck :)

#

sarcasm of course, but

winged thistle
#

Well, as a web developer, I could show you a few, but I'm speaking purely from a technical standpoint

#

Front end is arbitrary

vital onyx
#

I know some people that write good mission scenarios, but very limited in scripting

winged thistle
#

Scenarios would equate to the front end in arma

vital onyx
#

sounds reasonable

winged thistle
#

Doesn't really matter what people make, honestly. Someone, trolls or otherwise, will always hate it.

vital onyx
#

so I am not worrying :)

lone glade
#

I wonder if people would be interested in attack dogs

#

😛

winged thistle
#

Is there a reason you didn't put onplayerkilled and onplayerrespawn in the functions folder?

#

I don't think it really matters, but I've always tossed em in there

#

Left the inits out though

#

Maybe I'm just an organization freak...

#

Yeah, after looking at it, everything looks pretty damn good, but my brain explodes when I see a bunch of related files not organized into folders.

#

So

#

What should I write first? Earplugs? Basic revival system?

#

... Attack dogs?

vital onyx
#

I skipped this one, should go into scripts like init.sqf and so on

#

some of the files are put into the root not to fight the dir paths

#

as when you paste a path to icon for your dialog - it uses path from missionroot

#

#include uses relative path

#

so file structure - is a quick and dirty approach to lessen a headache, yet looks less beautiful

barren magnet
#

Does someone know how to use the new respawn feature?

vital onyx
#

@barren magnet yes it is not present in Apex, you may configure revive from editor in mission attributes

barren magnet
#

Well i though it would be impletmented by default

vital onyx
#

where mission name , game type are settled

#

just scroll down

barren magnet
#

well in the description.ext i know but still ...

winged thistle
#

Gotta say, I love me some sexy lookin' script, but if it works, don't fix it

vital onyx
#

exactly

#

being all life a linux man, writing a batch script caused some pain, so first working set was left

winged thistle
#

lol Embrace your Microsoft overlords

vital onyx
#

they are going to introduce bash interpreter officially

#

waiting also for stock wget.exe

barren magnet
#

@vital onyx I configured it in the attributes, but still revive is not available ...

vital onyx
#

paste a screen shot of you mission config

#

I am using it on my end and it looks fine

winged thistle
#

Or pastebin...

vital onyx
#

if it is edited from Eden - then screen shot is more handy

barren magnet
#

yep eden

winged thistle
#

... That's a thing?

#

Was thinking you were asking for a SS from notepad 😛

barren magnet
#

Well actually the attribues are in the mission file

#

i could paste you those from my description.ext

#

respawn = 3;
respawnDelay = 30;
respawnVehicleDelay = 0;
respawnTemplates[] = {"Revive","MenuPosition"};
respawnOnStart = -1;
respawnDialog = 1;
disabledAI = 1;

reviveDelay = 20; //The time it takes to revive an incapacitated unit (default: 6 seconds). Having a Medikit will halve this time. Must have "Revive" Respawn template enabled.
reviveForceRespawnDelay = 45; //The time it takes for an incapacitated unit to force their respawn (default: 3 seconds). Must have "Revive" Respawn template enabled.
reviveBleedOutDelay = 60; //The time it takes for a unit to bleed out (default: 2 minutes). Must have "Revive" Respawn template enabled.

#

they are all pretty default values, and everything from the system works, execpt he throws that error

winged thistle
#

What's the error?

barren magnet
#

"Revive" is defined for beeing revived

winged thistle
#

check config for cfgrespawntemplates

barren magnet
#

however if you respawn it is unknown

winged thistle
#

I haven't played with their respawn system since before Apex

#

I use my own

#

let me slap together a test mission and check it out

barren magnet
#

Strange ... there is no revive one

winged thistle
#

Interesting...

#

It's official. You broke Arma.

zealous solstice
#

because Revive is not a respawn template anymore

#

since 1.62

winged thistle
#

They changed it?

zealous solstice
#

yes

winged thistle
#

It's still listed on the wiki 😛

barren magnet
#

So what to do?

zealous solstice
#

there are some settings in 3den

barren magnet
#

I want to use the revive system

#

Hmm I will try it out to just have the revive system

vital onyx
#

@barren magnet Revive template has been removed from CfgRespawnTemplates

zealous solstice
#

under Multiplayer there is the point revive

#

ther are all settings

vital onyx
#

so only available from EDEN

#

I am not aware of description.ext entries to provide the same

winged thistle
#

I'm gonna see what I can find.

zealous solstice
#

Attributes => Mulitplayer => Revive

#

in 3den

frail trout
winged thistle
#

I can help in a sec Leon

#

I already have one

#

Interesting. The whole revive business was revamped.

#

@barren magnet, I just created a blank mission and checked out the mission.sqm

frail trout
#

oh cool

winged thistle
#

I'd recommend doing the same

#

Ok, hang on a sec Leon

#

I'll get you a paste

barren magnet
#

@winged thistle I was able to get everything working fine. BUT only via mission attributes. The question would be if i could make it work with just the description.ext

#

as missions sqm can change ...

winged thistle
#

I'm not entirely sure. I have to relearn the system since they changed it and removed the template.

barren magnet
#

There are options in the attributes that are not available for description ext but necessary for it to work ... genuis arma

ruby spoke
#

Hi, sorry for interrupting, but does anyone else have a problem with using mysql_escape with extDB3? Every time I try running the query it crashes my server.

barren magnet
#

contact @tough abyss for that maybe 😃

ruby spoke
#

Yea, just wondering if it's a problem with how I formatted it or if it's an actual bug.

winged thistle
#

I'll let you know after I learn to use extDB3 😛

#

That's next week

ruby spoke
#

Hahaha sure thing

#

I mean honestly, I found extDB2 much easier to use lol - ever since I had to make the switch to 3.

tough abyss
#

Sorry for interrupting, but could anyone please tell me how to spawn a cluster artillery explosion in the same manner as a car bomb script?

winged thistle
#

I wish @vocal mantle was here for that one. He loves exploding things.

tough abyss
#

If its crashing your server its a bug, submit a bug report on bitbucket. And give a simple repo etc

ruby spoke
#

Okay @tough abyss thanks for the quick reply 😃

winged thistle
#

Create a new case for each DIK you want to use. Put stuff in the cases. Voila, you're now a master of the keys.

#

You owe me a beer.

#

😛

#

Let every server from now on contain an earplugs script.

frail trout
#

thanks! I assume I'm not looking at the right key list? If 51 = F1

#

59*

winged thistle
#

DIK codes

#

Should be on the wiki, sec

#

Those values are all listed in hex

#

Convert to dec

frail trout
#

The keys look like they are in hex

winged thistle
#

Yup

frail trout
#

oh right okay, so you an straight convert

winged thistle
#

So do us all a favor and convert them all and update the wiki 😛

frail trout
#

does arma not use the hex keys anymore?

winged thistle
#

Not sure

#

I've only ever used dec values

#

Both in Arma 2 & 3

frail trout
#

oh okay

winged thistle
#

It's actually fairly easy once you recognize the pattern

frail trout
#

so this script just needs chucking in an .sqf and referencing in the init?

winged thistle
#

Yeah, instructions at the top of the paste I linked

#

Just slap that EH into initplayerlocal.sqf

#

Reference it in functions.hpp as well

#

Otherwise, no go

#

Forgot to add that bit

frail trout
#

You've actually just provided more insight than you think. So initlocal would apply when making sure the script applies to all players on a MP server or...?

winged thistle
#

It applies to all players where the player is local, aka to each player

#

Since we don't want to add it to each player everytime another player joins, we put it in initplayerlocal

frail trout
#

So if I'm creating an MP mission (it's basically just an empty map for Zeus missions between friends) I want to be referencing the created scripts in there rather than just init?

winged thistle
#

Otherwise, you'd get it added repeatedly

#

Yeah

frail trout
#

Gotcha

winged thistle
#

Assuming you only want them to work for the local player

#

If you want something to run whenever a player joins, use onPlayerConnected EH

frail trout
#

I want all of the scripts I am using to apply to each and every player on the server

winged thistle
#

Like ["connect", "onPlayerConnected", {[_id,_name,_uid,_owner,_jip] call TAG_PlayerConnected}] call BIS_fnc_addStackedEventHandler;

vital onyx
#

come on no need for such stacked EH

winged thistle
#

Well, it's what I use cuz I have complex stuff happening

#

Recommend a simpler solution?

winged thistle
#

Pretty much the same result either way

frail trout
#

I'm going to also have to look into functions.hpp as that's something I've not come accross yet

winged thistle
#

So, you have options 😛

#

It's fairly simple

#

Just makes declaring functions simplified

vital onyx
#

I prefer remoteexec way

winged thistle
#

I run mine from the server, and it only handles a server function, so no need, but yeah, remoteExec works

#
    class TAG {
        tag = "TAG";
        class general {
            file ="\functions";
            class keyDown {}; //keyDown function
        };
    };
};```
#

functions.hpp example

#

Then you can simply call the function with TAG_fnc_keyDown

#

be sure to #include "functions.hpp" in description.ext

frail trout
#

Sorry just catching up, so I don't have to create and add something to functions.hpp but merely reference it from within description.ext?

winged thistle
#

If you want, you can just put cfgFunctions directly in description.ext

#

But I prefer organization

#

my cfgFunctions example assumes that you put your fn_keyDown.sqf file in a folder called "functions" in the mission root

#

And yes, you have to put "fn_" as a prefix to the files you reference in functions.hpp

#

I realize now, I just explained that whole thing to you backwards...

#

Should probably have started from description.ext, but hey, all the info is there.

frail trout
#

Yeah I kinda understand most aspects. I mean if it doesn't work, I just blame you and throw lines of code at you anyway.

#

putting cfgFunctions directly in description.ext is what I'm confortable with at the moment

winged thistle
#

Well, don't do it

#

Get comfortable with granularization

#

You'll thank me later

#

It's really easy.

#

For example, let's say you have cfgFunctions in description.ext currently

#

Everything is peachy keen

frail trout
#

yeah

winged thistle
#

Well, instead, move cfgFunctions to a new file in the mission root called "functions.hpp"

#

(Normally I would say put it in missionroot\functions, but hey, simplicity)

#

Then, where cfgFunctions was in description.ext, instead, put #include "functions.hpp"

#

That's it

frail trout
#

oh okay that's stupidly easy, I must have been confused

#

yeah totally better

winged thistle
#

Probably because I explained it backwards 😛

#

Just be sure your filepaths match up to the actual file locations in functions.hpp, and be sure to add "fn_" as a prefix to your actual filenames for the scripts you reference in functions.hpp

#

Let's take keyDown for example

#

In functions.hpp, cfgFunctions would look as I have it above, where your function is referenced with class keyDown {};

#

No prefix there

#

But the file with your keyDown script would be named "fn_keyDown.sqf"

vital onyx
winged thistle
#

And if you use the path in my cfgFunctions example, it would also expect that you put fn_keyDown.sqf into missionroot\functions

#

Then you're good to go

#

And yes, there is a wiki for this

#

But I don't mind explaining because I'm freakin bored