#arma3_scripting

1 messages · Page 305 of 1

little eagle
#

this is why i dont bother asking for help in here...
Fuck off then

brazen sparrow
#

could you try to be alittle nicer?

#

i explained myself pretty well, not my fault you miss understood

jade abyss
#

Dscha - Today at 9:05 PM
Whats sqf objects / map content?
A file, an array?

maca134 - Today at 9:06 PM
its irrelvent
i have the data

....

#

bye then

plucky beacon
#

I don't think it's fair to condemn an entire channel "here" when asking for help.

brazen sparrow
#

my mistake just a few ppl then

short sleet
#

Hey guys, got a small problem in my script I hope someone could help with. The script gives an insurgent that I spawn via Zeus a random vest, however it for some reason has a chance to not give a vest at all, which I don't want. Can someone help?

_vests = ["V_Chestrig_rgr",
    "V_Chestrig_khk",
    "V_Chestrig_oli",
    "V_PlateCarrierIA1_dgtl",
    "V_HarnessOGL_brn",
    "V_HarnessOGL_gry",
    "V_Harness0_brn",
    "V_Harness0_gry",
    "V_BandollierB_cbr",
    "V_BandollierB_rgr",
    "V_BandollierB_khk",
    "V_BandollierB_oli",
    "V_TacChestrig_cbr_F",
    "V_TacChestrig_grn_F",
    "V_TacChestrig_oli_F",
    "V_TacVest_blk",
    "V_TacVest_brn",
    "V_TacVest_camo",
    "V_TacVest_khk",
    "V_TacVest_oli"];

_vestCount = count _vests;

if (isServer) then {
BIS_randomSeed1 = [];
_rnd1 = floor random _vestCount;    
_this setVariable ["BIS_randomSeed1", _rnd1, TRUE];
};

waitUntil {!(isNil {_this getVariable "BIS_randomSeed1"})};
_randomSeed1 = _this getVariable "BIS_randomSeed1";

if (true) then {
Removevest _this;
_this addvest (_vests select _randomSeed1);
};
plucky beacon
#

Does it need bis_randomseed? Or can it just random. shrug

short sleet
#

To be perfectly honest I'm not sure. I'm just a junior scripter. 😛

jade abyss
#

BIS_randomSeed1 = []; <- Not needed

#

You create the Var "BIS_randomSeed1" with
_this setVariable ["BIS_randomSeed1", _rnd1, TRUE]; };

#

Why?
if (true) then {

#

(can be deleted)

plucky beacon
#

Unless you plan on checking something i guess

jade abyss
#

The whole thing makes no sense? 😄

#

What are you trying to achieve?

plucky beacon
#

Well we can read it

#

It's making a random vest selection

jade abyss
#

sush, be quiet little boy

plucky beacon
#

Lol

short sleet
#

Heh, well, most of the code was gifted from a friend.
I guess I can tell you the overall idea behind it.

jade abyss
#

Yeah, go on

#

(keep it as short as possible 😛 )

plucky beacon
#

Haha

short sleet
#

I'm making a mod for my community that takes existing gear and turns it into a new faction. I've currently already made a Police faction, which works 100%, however now I'm starting on an insurgent faction, which to have variety uses a random selection of gear. Currently, it randomly selects a uniform and a vest. The uniforms work fine, however with the vests there is a chance that it does not spawn a vest at all, which is problematic when trying to make a loadout like a machinegunner, who needs the space for ammo.

That short enough? 😛

jade abyss
#

I just wanted an explaination, what that script has to do^^

short sleet
#

Hey, I said 'the overall idea', and you said yeah. :P

The script itself takes a random selection of vests, the array at the top, and then puts that on a unit when it is spawned via Zeus.

#

The actual script is called via the unit's config, in a different file.

jade abyss
#

And the problem is?

#
_Vest = [blablabla];

_this setVariable ["BIS_randomSeed1", ( selectRandom _vests ), TRUE];
};```
short sleet
#

The problem is it has a chance of not actually spawning a vest.

jade abyss
#

~~_vestCount = count _vests;
BIS_randomSeed1 = [];
_rnd1 = floor random _vestCount; ~~

#

Not in that scriptpart you pasted

#

As i mentioned earlier: The stuff you pasted there doesn't make much sense atm

ionic orchid
#

yeah, just had to check random was non-inclusive at the upper end, it looks fine and should always pick within that array

jade abyss
#

then there is "if (true) then {" <- ???

short sleet
#

Hey, I have no idea what that does, either. XD

#

Facedesks

#

Welp, at least we tried.

brazen sparrow
#

use selectRandom?

#

selectRandom _vests;
maybe...

#

do u need to wait for server to set that seed crap?

short sleet
#

Any idea where I would implement that into the script? I'm a junior scripter, so I have no idea. XD

brazen sparrow
#

_vests = ["V_Chestrig_rgr",
... clip ...
"V_TacVest_oli"];
removeVest _this;
_this addvest selectRandom _vests;

short sleet
#

I'll give it a shot, and report back if it works~ Thanks~

brazen sparrow
#

is it multiplayer or singleplayer

polar folio
#

oh. didn't know this

isNil {_this getVariable "BIS_randomSeed1"}

was a thing

short sleet
#

It is going to be used in multiplayer.

brazen sparrow
#
if (!isServer) exitWith {};
_vests = ["V_Chestrig_rgr",
//... clip ...
    "V_TacVest_oli"];
removeVest _this;
_this addvest selectRandom _vests;
#

that would add a random vest on unit init, on the server

short sleet
#

Thanks. Would this work singleplayer, for testing, or would I have to launch a server to test it?

polar folio
#

i think isServer will be false (meant true) in SP?

brazen sparrow
#

!isServer && !is3DEN maybe?

polar folio
#

so remove the first line to test in SP

jade abyss
#

@badbenson#0154 isServer in Editor = true

#

So prolly in sp also

polar folio
#

ah cool. thx

short sleet
#

Heh, so, final answer, what where? XD

polar folio
#

ignore me. brain is broken today. use maca code

#

wait

short sleet
#

Okay, so I put:

if (!isServer && !is3DEN) exitWith {};
```?
polar folio
#

i was right but messed up with w3hat i said

#

if (!isServer) exitwith {}; will make it not work in SP since isServer is true in SP? or should i just go to bed? 😄

brazen sparrow
#

isMultiplayer && !isServer then 😛

polar folio
#

yes

short sleet
#

Facedesks

jade abyss
#

if (!isServer) exitwith {}; <- Should work in Editor. SP -> No clue

brazen sparrow
#

it all depends were u want it to run at the end of the day

polar folio
#

well he asked if he can test in SP. is why i said it. sorry for confusion

brazen sparrow
#

@ the bottom

short sleet
#

Okay;

  • I want it to run in singleplayer for testing
  • I want it to run in multiplayer.
brazen sparrow
#

in fact

#

KK comment

short sleet
#

Maca, how would I make it run in both SP and MP?

polar folio
#

wouldn't if (isServer) then {do stuff} solve it? will run both in MP/server and SP

jade abyss
#

if (!hasInterface) exitWith{};

polar folio
#

but hasInterface is true in SP?

brazen sparrow
#

its wrong 😛

#

invert it

#

ok

jade abyss
#

Why Invert?

brazen sparrow
#

wont work in SP

#

isMultiplayer && !isServer

#

if (isMultiplayer && !isServer) exitWith {};

#

done

jade abyss
#

"hasInterface" won't work in SP? Makes no sense

polar folio
#

lol. this should be the simple part 😄

short sleet
#

My head is 100% confuzzled.

jade abyss
#

^^ We have to many commands

#

Just like the Discord-channels

polar folio
#

just give it a minute @short sleet we're almost there

short sleet
#

Hahah, thanks.

polar folio
#

pfft. since 1.66

jade abyss
#

i say:
hasInterface is enough.
Since: Dedi has no Interface -> So evrything else can run it (i assume he doesn't use HC, hell.. he can't even write that easy codepart 😄 )
My bet is one:

if(!hasInterface)exitWith{}; //Won't run on Server but on self hosted/SP/Editor/Wherever
short sleet
#

The server we use is both dedicated and runs with a headless client.

jade abyss
#

Who is administrating the Server?

short sleet
#

Administrating? You mean, who owns it / has access to it?

jade abyss
polar folio
#

but i thought the goal is to run the code ONLY on the server and not everywhere but?

brazen sparrow
#

😂

jade abyss
#

I thought he want's it on the fkn player?

short sleet
#

OK

#

XD

jade abyss
#

Where

#

Server or Player

brazen sparrow
#

he said server or Sp lol

polar folio
#

god. this should be so easy. wtf is happening? collective stroke?

short sleet
#

I spawn the unit, the script runs on the unit to give him the gear.

#

The server is multiplayer, with around 37 people per event.

jade abyss
#

Okay, to be very very very very lear:
Where is this Script it running. Server or Clientside.

polar folio
#

AI or player?

short sleet
#

AI

polar folio
#

k. so server only

jade abyss
#

Not rly

#

Can be HC also

#

or player created AI

#

fml, i am out. My brain starts to hurt.

polar folio
#

assuming simplest case here

jade abyss
#

They use HC

#

He mentioned it before.

polar folio
#

maybe better to use init EH with !local check?

jade abyss
#

Wich creates some other cases

polar folio
#

or like mission EH entitycreated if there is one

jade abyss
#

thats why -> I am out^^ Too much wobblewobblewobblewobble

#

or maybe AI creatVehicleLocal stuff, you never knoooowwwwww

short sleet
#

Facedesks and cries

polar folio
#

just one more minute lol. we're almost there

brazen sparrow
#

its 1 line of code and it takes how many people to figure it out 😄 😛

jade abyss
#

He had extra wishes

polar folio
#

so do you have the spawn script? best would be to jsut run the vest code right after createUnit

brazen sparrow
#

client changing specs halve way thru a job...

jade abyss
#

and doesn't say if its beeing executed on the server, by the Server, by the client or the HC

#

Or is it AI thats was placed in the MissionEditor before?!

short sleet
#

I don't know the answer. I place down the unit and it activates. Here is the unit's code:

class Insurgent_Grenadier : I_G_Soldier_unarmed_F {
        _generalMacro = "Insurgent_Grenadier"; 
        scope = 2;
        scopeCurator = 2;
        displayName = "Grenadier"; // In-game name of unit
        faction = ZEUSOPSInsurgentFac; // Puts unit under new faction
        vehicleClass = "ZEUSOPSInsurgentFac_Infantry"; // Puts unit in the vehicleclass
        icon = "iconMan";
        editorCategory = ZEUSOPSInsurgentTop;
        editorSubcategory = ZEUSOPSInsurgentInfantry;
        nakedUniform = "U_BasicBody";  
        uniformClass = "U_BasicBody"; // Uniform Class
        backpack = ""; // Backpack Class
        linkedItems[] = {"V_TacVest_brn", "ItemMap", "ItemCompass", "ItemWatch",  "ItemRadio"}; // Item's added to the unit. 
        respawnLinkedItems[] = {"V_TacVest_brn", "ItemMap", "ItemCompass", "ItemWatch",  "ItemRadio"}; // Item's added to the unit. Should be identical to the linkedItems section.
        weapons[] = {""}; // Weapons added to the unit.
        respawnweapons[] = {""}; // Weapons added to the unit. Should be identical to the weapons section
        magazines[] = {"rhsusf_5Rnd_00Buck","rhsusf_5Rnd_00Buck","rhsusf_5Rnd_00Buck","rhsusf_5Rnd_00Buck","SmokeShell","SmokeShell",};
        Respawnmagazines[] = {"rhsusf_5Rnd_00Buck","rhsusf_5Rnd_00Buck","rhsusf_5Rnd_00Buck","rhsusf_5Rnd_00Buck","SmokeShell","SmokeShell",};
        
        class EventHandlers {
        init = "(_this select 0) execVM ""ZEUSOPS_UNITS\Scripts\randomizeUniforms.sqf""; (_this select 0) execVM ""ZEUSOPS_UNITS\Scripts\randomizeVests.sqf""";
            }; 
        };
jade abyss
#

Thats a config.

#

🤦

thin pine
#

XD

short sleet
#

Yes, that is a config. The config of the mod.

jade abyss
#

😂

short sleet
#

I'm going to die

jade abyss
#

I am out guys, have fun 😂

short sleet
#

I'm such a junior programmer. XD

polar folio
#

oh nice. that's good though. allows simple init EH

jade abyss
#

my belly hurts

#

😂

brazen sparrow
#

if (!local _this) exitWith {}; ?

#

that will add the gear were ever the unit is local too

polar folio
#

yer

brazen sparrow
#

which is prob what u want

short sleet
#

xD

jade abyss
#

"Can he use that in SP?" 😂

short sleet
#

😂

jovial ivy
#

Wasn't he just asking how to randomly load a vest onto a AI or something? 😂

jade abyss
#

Yeah

jovial ivy
#

Ah

jade abyss
#

It ended up like that. How? No idea.

jovial ivy
#

Thats discord for ya

#

Anyways

short sleet
#

xD

jovial ivy
#
    {
        player sideChat Format["Loading Player: %1", (name _x)];
        _index = _cbo lbAdd(name _x);
        _cbo lbSetData[(lbSize _cbo)-1, (name _x)];
    } forEach allPlayers;``` is how you would load stuff onto a scroll thing right?
#

Or am I really stupid.

jade abyss
#

One doesn't negate the other.

short sleet
#

Did we have a final solution for my question? 😂

brazen sparrow
#

_cbo lbSetData[(lbSize _cbo)-1, (name _x)];

#

use index var

jade abyss
#

I gave up after you posted the Config Sif, sry 😄

short sleet
#

xD I understand~

brazen sparrow
#

_cbo lbSetData[_index, (name _x)];

short sleet
#

Alright, can we confirm this is the final answer? 😛

brazen sparrow
#

well until the next arma patch 😛

short sleet
#

XD

jovial ivy
#

@brazen sparrow So this correct? dy_fnc_LoadPlayers = { _cbo = ((findDisplay 7866) displayCtrl (1501)); lbClear _cbo; { player sideChat Format["Loading Player: %1", (name _x)]; _index = _cbo lbAdd "Test"; _cbo lbSetData[_index, "Some Test Data Whatever Bro"]; } forEach allPlayers; }; As it doesnt seem to be adding to my RscListBox (and yes I know im looping through the players :P)

brazen sparrow
#

check ((findDisplay 7866) displayCtrl (1501)) is correct would be the first thing

#

thro some diag_logs in there check shit is running etc

jovial ivy
#

I love the params for diag_log = Parameters:
anything: Anything -

sweet canyon
#

@jade abyss can i pm you

jade abyss
#

Ask your questions here. Might help others + i am tired, so not a big help anymore.

jovial ivy
#

Any idea why diag_log isn't dumping to my RPT files?

jade abyss
#

Code doesn't get executed.

#

Or they are just an empty string
Use something like that instead

diag_log format[":::: %1", Stuff];
sweet canyon
#
if(player inArea "ThirdAllowed")then {
    if (cameraView == "INTERNAL") then
        {
            player switchCamera "EXTERNAL";
        };
    } else {
    
        player switchCamera "INTERNAL";
        
    };
#

tried for a simple code for third person doesnt switch camera...

jovial ivy
#

Are you looping that code? Or just executing it once

sweet canyon
#

set marker in mission.sqf with tag ThirdAllowed

jade abyss
#

He is looping, according to prev. code

sweet canyon
#

yes its in a while loop ui sleep 0.1;

jade abyss
#

So "Name" of Marker is "ThirdAllowed"?

sweet canyon
#

yes

jovial ivy
#

That should be working. Unless its not getting past if(player inArea)

jade abyss
#

This code runs Client Side?

sweet canyon
#

yes

#

i execVM in the init

jade abyss
#

try to add a hint "wörks" to the positive one

jovial ivy
#

RTP is created/saved in C:\Users\*******\AppData\Local\Arma 3 right?

sweet canyon
#

yes

#

well i have it saved in a custom spot for file cleaning purposes

jade abyss
#
[] spawn
{
    abc = false;
    sleep 0.1;
    abc = true;
    while{abc}do
    {
        if(player inAreaArray "ThirdAllowed")then
        {
            hint "In Area";
            if(cameraView == "Internal")then
            {
                player switchCamera "External";
            };
        }
        else
        {
            hint "OutSide Area";
            if(cameraView == "External")then
            {
                player switchCamera "Internal";
            };
        };
        uisleep 0.1;
    };
};```
#

exec that in your debugConsole

sweet canyon
#

ok then check logs ok man didnt think about that

jade abyss
#

This also:

systemchat format["Dist: %1", ((getPos player) distance2D (getMarkerPos "ThirdAllowed"))];```
sweet canyon
#

ok

jovial ivy
#

Hmm the displays and what not are correct. It just isnt adding to the list

#

Oh im dumb. My RscListBox class was incorrect 😛

tough abyss
#

@sweet canyon correct me, but this will be used in exile right? ExilePlayerInSafezone < global var that returns true/false depending on if the player is in safezone

tough abyss
#

Anyyways question time :
Can i do something like

SERVER:
_string = "hint 'TEST MESSAGE';";
code2run = compile _string; 
publicVariable "code2run ";
Client:
call code2run;
#

Are you going to reuse the same code?

#

over and over?

#

nope just a one time thing.

#

compileFinal it

#

compile allows remote over-riding

#

including over-writing the variable

#

and if im going to re use said code2run i just compile?

#

Is the variable going to change?

#

Internally at ALL?

#

no

#

Then compileFinal it

#

yep, thanks.

#

This is a MP mission?

#

correct

#

Many players playing it?

#

Definitely compileFinal it

#

well

#

10-20 max

#

Public?

#

yep

#

Or Clan?

#

yes compileFInal it

#

What were you wanting to do?

#

A better alternative is to use the cfgRemoteExec.hpp

#

well i was just wanting to do some testing thats all, not really trying to put it out for production

#

Just trying to have the client listening for the PV?

#

You could use a publicVariable event handler on the client waiting for the message.

#

@tough abyss but lets say code2run has a file. this file is located on the mission file and not server side. So something like execVM "sometestfile.sqf" in the same folder as the call code2run is located. Will this work?

#
"code2run" addPublicVariableEventHandler { 
    params ["BroadcastVar","PublicVarValue"]; 
    [] call PublicVarValue; 
 };

#

That should do what you want

#

Add the PV-EH on the client

#

Send the variable from the server.

#

@tough abyss

#

Client will listen for the PV

#

when the PublicVariable is sent.

#

In networking we call this a broadcast message.

dusk sage
#

It doesnt matter if you compileFinal it or not

#

Anyone can trigger that PVEH

tough abyss
#

So my way is wrong?

#

@tough abyss bear in mind I don't actually script A3 anymore.

#

Became disillusioned by it.

#

Went to C++

#

,C and Python.

#

Fell in love.

#

Can't even write matrice functions in A3 without it imploding.

jovial ivy
#

I love how descriptive arma's errors are sometimes.

tough abyss
#

Indeed...

#

Compiler in CodeBlocks C++

#

@tough abyss no worrys. thanks for the help. I understand that feeling of leaving a language and finding a beauty (i love C# and lua)

#

Tells me the line and why it didn't work.

dusk sage
#

Hate CB so much

tough abyss
#

Awwww why?

#

Prefer it to VC++

jovial ivy
#

Ooh @tough abyss C# is a great language.

dusk sage
#

Just can't stand it in any way

tough abyss
#

Tools are tools.

#

i need to go learn more C++

queen cargo
#

no @tough abyss! learn C#

#

there is an IDE to code

tough abyss
#

Same with C++ ...

#

@queen cargo i know c# :/

jovial ivy
#

When I write switch() blocks in SQF I always end up writing break; instead of the {}

tough abyss
#

i just have no clue how to start on an ide

dusk sage
#

Just set VS up to use a different compiler 😛

tough abyss
#

or help*

queen cargo
#

uhm .... cough ArmA.Studio cough

tough abyss
#

C# is...

#

definitely not suited for a hacker...

#

DONT SAY IT

queen cargo
#

totally did not advertised there

tough abyss
#

<--- Wants to know linux ins and outs...

#

C, C++ and Python.

dusk sage
#

C# is suited for hackers, sure

tough abyss
#

@tough abyss by hacker you mean memory editing?

dusk sage
#

Depends on what kind

queen cargo
#

you can fuck up and do hacking too with c# ...

tough abyss
#

or what

dusk sage
#

😉

tough abyss
#

C# Has a lot of Microsoft shackles right?

queen cargo
#

c# also does support unmanaged code

dusk sage
#

It does, as of recently, less so

tough abyss
#

Can't even directly Sys-call windows

queen cargo
#

c# just has loads of microsoft APIs

tough abyss
#

WINAPI invokes

#

Linux allows you direct Syscall.

dusk sage
#

net standard is reaching almost full coverage now

queen cargo
#

a lot of that can be cut off easy

tough abyss
#

Windows not a hacking OS....

queen cargo
#

c# is also linux compatible but the most fucking important part ... WPF 🙈

tough abyss
#

Linux / Unix is.

queen cargo
#

thats absolut bs

dusk sage
#

Did you read that on the internet again

tough abyss
#

No it's not.

dusk sage
#

Don't start this 😄

queen cargo
#

not the right place to start either @dusk sage 🤣

tough abyss
#

nope. Used WPF once and never again. I stick with either a consol application or forms

#

Wrong chat to be having this discussion

queen cargo
#

@tough abyss is pretty damn handy once you got your head around it

#

but well ... should spend less chatting here and more time coding ... the fucking code editor does not rewrites itself apparently

tough abyss
#

@queen cargo its just so limited. You HAVE TO USE extended wpf tools or else no list box with check boxes

#

alright ill leave yall be

queen cargo
#

uhm ... thats not really true actually

tough abyss
#

(last time i checked was 2 years back no quotes me)

queen cargo
#
<ListView>
  <ListView.View>
    <GridView>
      <!-- Add your rows with stuff you want (eg. checkbox and textblock) here -->
    </GridView>
  </ListView.View>
</ListView>

and you are done

jovial ivy
#

My own code confuses me sometimes :/

#

I dont think that is a good thing sadly.

tough abyss
#

@queen cargo interesting. Will look into wpf MAYBE again

queen cargo
#

well ... ArmA.Studio always needs helping hands to get a better experience for all users @tough abyss

#

and WPF is neat 😃

#

whats the matter @jovial ivy ?

#

such things usually happen when you drink and code

#

or check old code which does not suites how you code today in any way anymore

jovial ivy
#

Well you see. I forgot I was storing a player object within setVariable. So I spent 10 minutes debugging why I couldn't check if ((getVariable) == "some string")

#

Because as you know, you cant compare a string and a object without calling str() generally

#
if(_var == "default") exitWith {};``` example
queen cargo
#

soon™ there will be a solution

#

in fact: it already is existing
but not really usable for missions as of now

jovial ivy
rotund cypress
#

If I do scriptName "script";

#

i can then in the same script do _fnc_scriptName and it will return script?

dusk sage
#

No, this is for the handle returned by spawn/execVM

#

_fnc_scriptName is a var defined in a compiled functions header (CfgFunctions)

rotund cypress
#

Ah right

jovial ivy
#

How do you get a vehicles name(Like A-10 or whatever) from (vehicle player)?

plucky beacon
#

You mean classnames?

jovial ivy
#

Yeah.

plucky beacon
#

Look up CFG West and go to the BI wiki page

#

Oh you want display name then

jovial ivy
#

As im using: if((vehicle _target) == _target) then { _vehicle = "On Foot or Swimming"; } else { if(vehicle _target isKindOf "Air") then { _vehicle = "Air Vehicle"; } else { _vehicle = "Ground/Water Vehicle"; }; };

plucky beacon
#

_name = getText (configFile >> "cfgVehicles" >> typeOf _veh >> "displayName");

#

I'm sure you can fill in the blanks for it

jovial ivy
#

Yeah 😛

plucky beacon
#

k

jovial ivy
#

And by that you meant just replace _veh?

plucky beacon
#

Ya and use name in your formatted hint

jovial ivy
#

Yeah.

#
    if((vehicle _target) == _target) then {
        _vehicle = "On Foot or Swimming";
    } else {
        _vehicle = getText (configFile >> "cfgVehicles" >> typeOf (vehicle _target) >> "displayName");
    };    ``` Simple enough. Thanks 😄
plucky beacon
#

Ye

jovial ivy
#

Any idea why this wouldn't be working on other players in a MP session? if((vehicle _target ) != _target) then { _vehicle = (vehicle _target); _dir = getDir _vehicle; _vehicle setDir _dir - 180; player sideChat Format["Turned Player 180 Degrees: %1", (name _target)]; };

plucky beacon
#

Hmmmm

#

What's not working for multiplayer the sidechat?

jovial ivy
#

No turning the vehicle itself.

#

I've already checked to confirm its the right vehicle.

plucky beacon
#

Setting direction has to be local to the machine that owns the vehicle

jovial ivy
#

Ah

velvet merlin
#

can one overwrite BI functions by loading ones init code earlier them them?

vapid frigate
#

compilefinal might overwrite them? i think they use cfgFunctions

#

you could edit the cfgfunctions if it's for a mod too

velvet merlin
#

well thats why you would need to load first and apply compileFinal yourself

#

good point. cfgFunctions mod may work too

vapid frigate
#

compilefinal won't work sorryMain benefits (of cfgfunctions): Automatic compilation upon mission start into a global variable - no need to remember direct paths to files. Anti-hack protection using compileFinal (see Recompiling for more info) ...

velvet merlin
#

if you load before cfgFunctions, it would work - maybe its not possible though

vapid frigate
#

if it's for a mission, it looks like you could add allowFunctionsRecompile = 1; to the description ext and overwrite it

velvet merlin
#

its for mod use - context: BI broke with 1.68 custom groups with ZEUS (for some unknown bad reason every unit in cfgGroups has to have a side assigned too..)

tough abyss
#

hi, im trying to do something that i cant get working. what im trying to do is a "switch" where you press it once and it does something and you press it again and it does something. (on/off)

vapid frigate
#

has to have it assigned in CfgGroups or in the CfgVehicles for the units?

tame portal
#

@tough abyss

#

myButtonState = !missionnamespace getvariable ["myButtonState", false];

if (myButtonState) then { } else { };

velvet merlin
#

@vapid frigate cfgGroups has sides already - as such is no need to define it per unit basis again

vapid frigate
#

yeh ok, was just wondering why we haven't encountered it.. might be because our units all have a side=

velvet merlin
tough abyss
#

@tame portal its a add action

tame portal
#

You can put it all into one line

#

Replace " with '

#

And It would work too

vapid frigate
#

@tough abyss

_obj addAction ["Turn On", { (_this select 0) setVariable ["MASON_SwitchedOn", true, true]; }, [], 1.5, true, true, "", "!(_target getVariable ['MASON_SwitchedOn', false])"];
_obj addAction ["Turn Off", { (_this select 0) setVariable ["MASON_SwitchedOn", nil, true]; }, [], 1.5, true, true, "", "_target getVariable ['MASON_SwitchedOn', false]"];
hollow lantern
still forum
#

Indentation of the code of the then statement.

turbid thunder
#

@jade abyss I wonder though, why would I use inArea scripting with an forEach script running in the background doing the check if a blufor unit is inside a predefined area when I could just place a trigger and set its activation to "Blufor"? 🤔

jade abyss
#

Do you need a constant check each 0.5s?

still forum
#

A trigger is doing exactly that. But every 0.5 seconds. In your script you could increase that interval

jade abyss
#

Exactly. Thats why i was asking, if he needs it 0.5s

still forum
#

or maybe choose the interval dynamically depending if any vehicles are within 200m of the gate

jade abyss
#

If so -> Use Trigger.
If not -> Use anything else but Trigger

turbid thunder
#

Do I need that level of optimization. That's the question

jade abyss
#

what?

turbid thunder
#

what?

#

I dont even get your point

jade abyss
#

Wich point?

turbid thunder
#

Your point about not using triggers? Alright you know what: No

jade abyss
#

My point? The 0.5s thing?

turbid thunder
#

If your point isnt about optimizing the mission then I dont get it

jade abyss
#

Why do you wanna waste Ressources with a constant Check running every 0.5, when you don't rly need it?

#

Its like leaving the motor on in your Car, while beeing inside because "I need it tomorrow"

queen cargo
#

because of reason @jade abyss 🙈

jade abyss
#

^^

turbid thunder
#

Because placing down a trigger, settings its activation to "Blufor" and then syncing it to a waypoint is a much quicker and simpler process which is more than likely equally surfficiant for non-scripters

jade abyss
#

XD Okay. hf

brazen sparrow
#

triggers are bad in large numbers 😛

#

engine evaluates too quickly

turbid thunder
#

Isn't that with like, everything?

brazen sparrow
#

i suppose 😛

#

if u write the checking in sqf somehow, u have much more control over checking time etc

turbid thunder
#

I guess yeah. Not sure why people like Dscha feel the need to be rude about "Trigger users" or me trying to bring legit arguments into a conversation but I guess sometimes one just can't have proper scripting related discussions without people thinking that their opinion is fact and their way of doing it is the only correct way :/

brazen sparrow
#

some people are like that, its life 😄

turbid thunder
#

I'm currently thinking about how one could properly evaluate how much performance a trigger with different sizes actually require

simple fiber
#

I guess he is easily Triggered

brazen sparrow
#

😮

jade abyss
#

wtf?

turbid thunder
#

It's nothing I ever really considered. I just placed it down, set it up and I never thought about performance when it came to triggers

jade abyss
#

" feel the need to be rude about "Trigger users"" <-- I was rude? Where?

turbid thunder
#

"XD Okay. hf"

jade abyss
#

And?

turbid thunder
#

Try to be funny elsewhere please

jade abyss
#

lol

polar folio
#

it's all in the name of optimisation

jade abyss
#

I just gave up, trying to explain you (and i wasn't the only one who did), why triggers shouldn't be used. If you use it or not -> Your choice. Gl hf with that.

turbid thunder
#

Anyways, still thinking of a way to figure out how much performance triggers really take away

polar folio
#

tone sucks sometimes. for sure. but take what is useful. don't fokus on the other stuff. text can be misinterpreted anyways

jade abyss
#

polar folio
#

like intensity and tone and all that blablabla

#

sry

#

let's all just hug it out

#

plucky beacon
#

Dscha literally pretends to beat me like an abusive father when i script incorrectly in this channel.

jade abyss
#

And you deserve it.

plucky beacon
#

D: abuse!

hollow lantern
#

Error: word or function not found!

jade abyss
#

oO

hollow lantern
#

Oo

plucky beacon
#

oO

hollow lantern
#

I'll remember once that someone just placed an AI just for running down a road and activating "triggers"

plucky beacon
#

HAHA

hollow lantern
#

like wtf dude?

turbid thunder
#

Cuz who needs a script with sleep's between each thing that it is supposed to do

plucky beacon
#

i mean hay, I thought about it before i wrote my first sqf file

turbid thunder
#

Also, relying on AI

plucky beacon
#

For me it was using zeus to place them in a box

turbid thunder
#

My first looping SQF file was basically just re-executing the SQF

#

Which was like, dunno, 5 years ago?

plucky beacon
#

So it was recursive

turbid thunder
#

<<<----- Didnt know how to "While"

#

No idea about locality either, so doing that anti teamkill script sure was fun xD

#

If I look hard enough, I might find a screenshot of that again

#

I found it D:

#

I'm probably going to get murdered from all sides now but yeah, thats the result of someone trying to script with no idea about anything

brazen sparrow
#

notepad? OMG!

turbid thunder
#

yeah ikr

brazen sparrow
#

lol

turbid thunder
#

Cant imagine to not work with notepad++ and custom SQF language highlighter

brazen sparrow
#

sublime ftw imo

hollow lantern
polar folio
#

i've been using notepad for the longest time. jsut hard to let old habits go

brazen sparrow
#

the multi select wins it for me

#

typing on multi-lines ❤

turbid thunder
#

once you use notepad++, you'll never want notepad again

brazen sparrow
#

i use NP++ for logs etc just not for programming

turbid thunder
#

Closing () and {} suddendly becomes incredibly easy

thick oar
#

the ALT + Drag LBM multi select?

polar folio
#

yer, can't unstretch that p...oh shit nvm

thick oar
#

That made life so much easier

hollow lantern
#

Intelij IDEA Ultimate for everything ^.^

brazen sparrow
#

or alt-f3 for select all selected

polar folio
#

so like you double click one instance of a word and then you can change it everywhere through typing? sounds great

turbid thunder
#

@hollow lantern But €€€

hollow lantern
#

@turbid thunder yeah but if your company pays for it its like "i don't care" 😄

#

but the normal version should also work well

turbid thunder
#

I have no sounds right now so nothing is well here D:

#

fixed

#

Windows 10 is having a hard time choosing between the HDMI audio output, my USB headset, or the virtual stuff from Elgato

brazen sparrow
#

😛

simple fiber
#

Sublime Text Ftw

polar folio
#

i've just been converted

still forum
#

@queen cargo Get a nice counter-screenshot in here!

turbid thunder
#

@brazen sparrow soooo, in context, what exactly is that doing?

brazen sparrow
#

rename all instances of _logic

still forum
#

replacing all occurences by just typing new name

brazen sparrow
#

in the file

thick oar
#

So.... CTRL+H? 😛

turbid thunder
#

thats convinient

polar folio
#

not even in the file but the lines you select, right?

#

which is badass

brazen sparrow
#

u can ctrl-click to add extra cursors, to type on multiple lines

polar folio
#

hm. nvm. but is the above possible?

dusk sage
#

Most text editors can refactor

brazen sparrow
#

or alt-f3 so select all the instances of what you have just selected

dusk sage
#

IDEA certainly

polar folio
#

ssshh. let me be excited for a bit

dusk sage
#

Atom/VSc have everything handy as well

brazen sparrow
#

sublime prob has one of the fastest loading times compared to other ides+similar

turbid thunder
#

Does sublime cost any money though?

brazen sparrow
#

YES! 😛

turbid thunder
#

Dang

dusk sage
#

VSc has exceptional loading times for me (split second usually)

brazen sparrow
#

its a one off tho

#

forever i beleive

#

ive had the same license for years

thick oar
#

So... nobody here doing sqs using punchcards, eh?

simple fiber
#

You can get everything for free on the internet

turbid thunder
#

IDEA is yearly / monthy not sure

#

Do what you want cuz I pirate is free: I'm not a pirate D:

hollow lantern
#

but just the ultimate edition

polar folio
#

i hand write my code in wet beach sand

dusk sage
#

IDEA is free for community version

#

But anything jetbrains is free for students 🎉

still forum
#

I'm using the CIA license for Sublime. Works fine

halcyon crypt
#

%s/oldname/newname/g yay 😛

simple fiber
#
i hand write my code in wet beach sand

#HardcoreMode

polar folio
#

😄

willow basin
#

@dusk sage I have that issue on Linux (Ubuntu) only. On Windows VSC works smooth

thick oar
#

Redefines the concept of "work sprints". Get it done and shipped inbetween tides. 😄

dusk sage
#

Yep I've seen problems with VSc on nix

still forum
#

Holy shit... I'm rarely using sublime... It was open before the start menu even closed 😮

simple fiber
#

ATOM could be great but it is a Sublime clone with extra long loading times soooo

dusk sage
#

Atom is great, but loading times with lots of extensions does get quite high yep

brazen sparrow
still forum
#

Thaaats neat. Exactly what our mission maker wanted. copy pastes link Now I don't have to build that myself :3

hollow lantern
#

so yeah its also possible in Intelij IDEA

simple fiber
#

@brazen sparrow What is the plugin language associated with Atom ?

brazen sparrow
#

JS

simple fiber
#

Yeah I forgot it is web based

#

ty

polar folio
still forum
#

Sublime + SQF... basically

polar folio
#

sweet. so it's good basically

tough abyss
#

Can pre-processor commands be used inside FSMs?

queen cargo
#

edge of map grids @tough abyss ?

#

ok ... well .. worldHeight and worldWidth
or was it worldSize?

#

this gives you the size of the world

#

however, the edge of the grid might also just contain water

#

thus ... it might not be what you want

#

why would you want to do that Oo

#

there you got the world size

#

with which you can get the map grid

#

apparently it is the only way

#

alternativly you can also allow manual override of this

#

gimme a sec

#

though ... the old codebase which is not auto-generated via OOS might be better due to human readable

#

as i said
you might not like what you are seeing

#

check earlier commits

#

that is auto-generated via OOS

dusk sage
#

SQF extreme

#

😄

queen cargo
#

there it is in a human readable form again

#

i did quite some time ago as the interest was dropping in it and no feedback came in

#

it is designed to dynamically spawn the AI

#

pretty much all interest dropped

#

so ...

#

the biggest problem however was always the grouping stuff

#

as the insurgents behaved like total shitheads due to them trying to always act as group

#

you can do
might work
might not

no idea about its current state sadly
the OOS variant never was fully tested
the old code base had problems with spawning the right ammount of enemies

#

no more playing arma due to relationship mostly relying on the weekend
coding arma related tools and sometimes doing SQF stuff on my lil medic mod

#

it is not yet done
thats all

#

designed however around the idea of setting everything up in config

#

and letting SQF code generation do the rest of the magic

#

most of that part is done
just ... the simulation

#

intended as such
though, can easily be used for mission-only when ever done 🙈

#

virtual items obviously required for that then

#

well ... if time wasnt an issue for me ...

#

part of the unfinished simulation stuff

#

i remember those from back when i released XMedSys

#

though ... never used setUnconscious but instead used SQF only to do all that

#

in the end, the result was the same

#

reason for this being one animation being fucked up

#

weird querks ... never should rely on SQF-only commands though with such things

#

same for setHitpoint crap ...

#

wont work properly on units

#

well ... there are a hell lot of pitfalls when developing a medical system ...

#

but enough of nostalgia 🙈

polar folio
#

@queen cargo is the idea of your system to basically entirely model damage yourself? since you said config is invovled

queen cargo
#

should get back to ArmA.Studio so you folks can properly debug arma 😛

#

kind of @polar folio

#

XMS2 relied on Hit EH

#

but due to it being simply too bloated due to all SQF stuff was needed to be self written i started Project-Alcatraz

#

which uses config-based stuff for eg. drugs

#

damage model, still to be implemented, would again rely mostly on what arma provides due to me being too lazy to code everything else differently
but it would record the values itself

#

so every unit having "Spine_hitpoints" etc. variables

#

using the Hit EH you in theory could create an endless ammount of detail in damage model
but ... well ... as said ... time is an issue

#

cannot code the whole day
not to mention that i got no medical education in any way besides the normal "first aid" crap for drivers license so realism is kind of limited

polar folio
#

realism is not a given in game design

#

but i get it. you like it

queen cargo
#

realism can be archived

#

but you do have to make cuts

#

you cannot make everything as realistic as possible

#

first problem always will remain: ppl wont have fun

#

as realisticly spoken

#

get hit and you are fucking done

#

there is no "quick treat" in field
you are hit
you go back to base for like ever

#

not to mention that all the controls required

#

hell i even coded a mini game for XMS2 once just to discover that it is annoying to do and ppl did not liked it

#

but still ... realism is something you can archive by simply trying to add as much of it as possible in first place, and then cutting out all those bits which do not make fun

#

though, you should leave all of those inside of whatever you create

#

but the defaults should always consider fun > realism

polar folio
#

yea. and micro management =/= realism

#

blows my mind how for some people making stuff tedious is making it realistic. i'm fine with putting timers on actions that shouldn't be instant

digital pulsar
#

Problem with medical systems is that irl its all about keeping you alive long enough to reach field hospital

#

U can move player to spectator after getting a serious wound

#

Coz they wont be doing any fighting on that day even if cls fulfilled his duty

polar folio
#

truth. i evn feel that way about too many or badly designed logistics. i'm a fan of trying to give every action a gameplay value. remember that script for defusing IEDs that was basically an sqf version of windows' mine sweeper? awesome!

cerulean whale
#

Hey, is there a way that you make make items that are attatched to a player not colide with other players? People are using them to run into people and kill them 😛

polar folio
#

afaik, and don't quote me on that, the above won't work on CaManBase

#

but i tested it a looong time ago

#

if only createSimpleObject had a collision parameter

cerulean whale
#

ye

polar folio
#

i use createVehicleLocal to have a non lethal preview object

#

well to be fair. it's fun 😄

dusk sage
#

You can setMass on the attached object (to a reaaaally low value)

#

And it won't kill people

hollow lantern
#

is there a way to remove a "open door" action on an object?

#

removeAction seems to be only for user added actions

rancid pecan
#

Hello,
How can I make the tools black, they all.

#

example hatchback: { "Police", "cop", { "#(ai,64,64,1)Fresnel(1.3,7)" }, "" }

#

How can I make others? This is "#(ai,64,64,1)Fresnel(1.3,7)" }, " how is it set up?

turbid thunder
dusk sage
vital onyx
#

@queen cargo

you cannot make everything as realistic as possible
main problem is balance between real <=> casual

In real life even minor injury could mean a person would stay off the front line for a period from several hours to several days, in game we should deal with shorter periods, so we a speaking about, if not seconds, then minutes. If you aim at survival - then medicine can be one of the primary game mechanics and features, where you can go more real. If primary goal is a combat - people want to be focused more on combat, and to not to be annoyed much with advanced medicine.

For many people default medical things in Arma seem too very simple and casual, this is a place where ACE3 steps in, providing two additional levels of medical simulation.

rancid ruin
#

i've never seen a realistic medical system be fun in any game ever

#

i'm sure ACE medical could be fun in a proper unit under the right circumstances though

silent coral
#

A pararescue unit for example

plush cargo
#

I see the appeal of an in depth medical system but ace just doesn't do it for me. Getting shot and then bamdaging 3 body parts and taking pain killers is more of an annoyance than anything. Lots must like it though considering how popular it is

blazing zodiac
#

Does anyone have a way to return nearby projectiles to a unit? I'd like to try and use it to return the shooter using getShotParents

jovial ivy
#

@blazing zodiac Are you trying to figure out who shot a player or something?

blazing zodiac
#

No, I need to figure out who is shooting at an AI but not neccessarily hitting them

jovial ivy
#

Erm. You could use the FiredNear event handler. It detects within 69 meters or something.

#

Or maybe use Fired and detect the course of the bullet. There could be a better way though.

blazing zodiac
#

Yea firedNear is what I'm using currently for within 69m but I need to handle outside of 69m as well

#

Basically what I need can't be reasonably done with the current event handlers but if I could return incoming projectiles I could get the shooter with getShotParents, I just don't have a way of returning the projectiles.

jovial ivy
#

Hmm. I would love to help but I dont have any experience in the field on your needs 😦 - Also, would yall suggest adding seperate .sqf files for buttons in say a admin menu. Or have it in like a function sqf.

tough abyss
#

@jovial ivy "status online" seems like some filler eh? Its quite obvious ita online :P

#

Anyways itd look better seperated and centered in my opinion

jovial ivy
tough abyss
#

@jovial ivy ye

rancid ruin
#

just use buttons to call functions @jovial ivy

#

doesn't really matter if they're in different files

#

personally i use cfgFunctions

#

do whatever makes sense to you within reason

jovial ivy
#

@rancid ruin My buttons and what not are calling correctly. Im saying would it be better to have one file for god, inf ammo, recoil, esp, etc. As I have it all stuffed in a switch() right now

rancid ruin
#

yes, and i'm saying have a function for godmode, a function for infinite ammo, etc

#

then just call the function from the button

#

way easier to manage and debug, expand on, etc

#

stuff like god mode is so simple you could just inline it to the button call anyway

jovial ivy
#

True

cerulean whale
#

Anyone got an idea about why my extDB3 is writing NULL to the DB after a huge uptime? (just curious)

silent coral
#

Not really sure where to put this. I want to make a helicopter fly to a location and hover about 10m off the ground for people to rappel.

#

I can get everything before and after that fine. But cant get the altitude right

rancid ruin
#

helicopters are a bitch to get perfect though

#

maybe have a google around for "arma 3 + fast rope"

#

fast roping is definitely something a lot of people have scripted

jovial ivy
#

How would you get all vehicles? As in every single vehicle on the map in like a forEach loop

tough abyss
#

Vehicles @jovial ivy in ArmA 3 context is quite loose...

#

Do you mean drivable vehicles?

#

For this you would use vehicles.

#

This will generate an array containing all vehicles in the map

#

or mission.

jovial ivy
#

Yes. I meant any vehicles on the map(so trucks, heli's, etc). Im assuming I could do like _vehicles = vehicles?

tough abyss
#

_vehicles is just a local indentifier...

#

vehicles

#

is a physical scripting command

#

_vehicles = vehicles;

jovial ivy
#

Yes thats what I meant 😛

#

I would be a bit more descriptive but I'm on mobile currently.

#

Anyways, thanks 😉

cedar kindle
#

@blazing zodiac an option is to use a fired eh and save current bullet pos eachframe until it's null and then check nearby units on that position

tough abyss
#

Can pre-processor commands be used inside FSMs?

tough abyss
#

Test it @tough abyss

#

?

tough abyss
#

@tough abyss I can't even get the game to execute the FSM 🙃

#

execFSM "\nev_cache\fsm\nev_ai_caching.fsm"; gives out a Warning Message: Script \nev_cache\fsm\nev_ai_caching.fsm not found. While is clearly there inside @NEV_Addons/addons/nev_cache.pbo/fsm.

meager granite
#

wrong addon prefix

halcyon crypt
#

you should use the path that's defined in your pboprefix file

jade abyss
#

iirc, this has been told to him several times 😄

tough abyss
#

I get it wrong every time 😦

jade abyss
#

I know i did, a few days ago 😉

halcyon crypt
#

🤦 😁

jade abyss
#

Setup a P Drive, work from there =}

tough abyss
#

I have a P: drive, but I don't use it 😛

jade abyss
#

Pack with PboProject (wich creates pboPrefix automaticly), couldn't be easier.

#
Neviothr - Today at 11:50 AM
I have a P: drive, but I don't use it :stuck_out_tongue:```
You see the problem here? 😉
#

If you have further knowledge -> Outsource your stuff to another HDD/Workdrive. But for the beginning -> Stay simple.

tough abyss
#

I don't have another HDD.

#

Just 1, 500 GB one.

jade abyss
#

Then just use P Drive

tough abyss
#

Why did they choose P for the drive's name? 🤔

jade abyss
#

Folder:
P:\MyTag\MyAddonName

inside the config.cpp

class CfgFunctions
{
    class MyFunctionTag
    {
        class SomeNameForYourselfToSortStuff
        {
            file = "\MyTag\MyAddonName\Functions";
            
            class MyFunctionName{};
        };
    };
};```
tough abyss
#

PREP() is better.

jade abyss
#

As i said -> As long as you can't even pack an Addon without Problems -> Keep it as simple as possible.

#

"Learn to walk, before you try to run"

#

Get an idea of what you do there first. Otherwise -> Clustf**k like the one you posted above

#

(i am just giving you hints, what you do is your choice 😉 )

tough abyss
#

Well thank you.

jade abyss
#

Don't thank me, that makes me feel like i was a good/nice person.

#

urgs

tough abyss
#

Is that bad?

jade abyss
#

*slap* how dare you ask me questions directly

#

😉

tough abyss
#

I'll send a PM next time.

jade abyss
#

You got masochistic tendencies, aye?

tough abyss
#

I don't usually touch myself when making addons.

jade abyss
#

Thats something different, but okay ^^

scarlet spoke
#

Updated SQDev to version 0.7.2 which improves the live SQF-Error-Checker further in order to detect more errors without the need to open ArmA and run your code

digital pulsar
#

looks sexy, raven

scarlet spoke
#

Thanks! 😄

turbid thunder
#

@blazing zodiac there is a command that returns the current supressionlevel of an AI.

austere granite
#

Is there a good way to format config classes out of a array?

#

["blabla", "somethign", "somesubclass"] >> configFile >> "blabla" >> "somethign" >> "someSubclass"

vapid frigate
#

dunno if it's good, but

private _cfg = configFile;
{_cfg = _cfg >> _x;} foreach ["blabla", "somethign", "somesubclass"];```
polar folio
#

@Adanteh#0761 can't you just progessively build a string and then compile it?

austere granite
#

i'll have to do a test on which is faster i guess, just figuring out if i missed some other obvious way

polar folio
#

is what i do somewhere. can't remember where

austere granite
#

Either append with a loop and >> or build string + compile

polar folio
#

how do you mean append with a loop? got an example?

austere granite
#

what lecks did

#

it's actually for missionconfig override, so if that class exists use that, if not use configfile, if that doesnt exist either use default return

polar folio
#

ah. totally overlooked that. yea. looks good

#

pretty sure it's faster 😄

tame portal
#
_returnConfigFromArray = {
    private ["_arrayNames", "_return", "_parentConfig"];

    _parentConfig = param[0, configNull, [configNull]];
    _arrayNames = param[1, [], [[]]];

    _return = configNull;

    if (count _arrayNames > 2) then {
        _newSubArray = +_arrayNames;
        _newSubArray deleteAt 0;
        _return = [(_parentConfig >> (_arrayNames select 0)), _newSubArray] call _returnConfigFromArray;
    } else {
        if (count _arrayNames == 1) then {
            return (_parentConfig >> (_arrayNames select 0));
        };
    };

    _return
};```
#
_myConfig = [missionConfigFile, ["subconfig1", "subconfig1"]] call _returnConfigFromArray;```
#

@austere granite

#

oh whoops theres a logic error

austere granite
#

return (_parentConfig >> (_arrayNames select 0));

#

😃

tame portal
#

No

#

Thats not the error

jade abyss
#

What are you trying to do?! oO

tame portal
#

now its correct

jade abyss
#

stahp editing your text^^

tame portal
#

I only forgot deleteAt returns the deleted element, not the new array

#

which is fixed now

#

@jade abyss it loops through an array of config names and returns the config of the last entry (one config is always the child of the previous)

#

i think im over complicating right now though lol

jade abyss
#

Erm

tame portal
#

i like recursive methods

jade abyss
#

"returns the config of the last entry" <- why? ^^

tame portal
#

no basically

#

like

#

missionConfigFile >> "CfgVehicles" >> "ATV"

#

but as an array

#

["CfgVehicles", "ATV"]

austere granite
#

in my case i only want it so it autochecks missionconfigfile, if the entry doesn't exist, it switches over to configfile

vapid frigate
#

there's no need for recursion though?

austere granite
#

yea there isn't

vapid frigate
#
_returnConfigFromArray = {
    params ["_cfg", "_array"];
    {_cfg = _cfg >> _x;} foreach _array;
    _cfg
};
_myConfig = [missionConfigFile, ["subconfig1", "subconfig1"]] call _returnConfigFromArray;```
jade abyss
#

@Adanteh#0761 just do a erm... for example getNumber (or whatever you choose). It result is 0 -> use configFile instead of missionConfigFile (getText = "" / getArray = [] etc)

tame portal
#

BUT I LIKE RECURSION

#

;-;

austere granite
#

what if the result is actually 0 😉

jade abyss
#

Then search for something else ffsssssss

#

^^

vapid frigate
#

use isNumber

jade abyss
#

Not needed Lecks

#

if getXYZ doesn't find anyting -> EmptyXYZ/0 is beeing returned

tame portal
#

@vapid frigate isnt your method missing a return

vapid frigate
#

yeh sry fixed

tame portal
#

now its gucci

vapid frigate
#

0 could be valid though dscha

#

ie have different meaning to not being there

austere granite
#

isNumber > getNumber

#

fun

jade abyss
#

¯_(ツ)_/¯

vapid frigate
#

probly wont work in all scenarios but thats what i use

#

so you can put stuff on config, missionconfig, campaignconfig or missionnamespace and it sets them in that priority

#

or adds to arrays

austere granite
#

yea that's basically what im going for here

#

I'd give you a thumbs up, but dwarden doesn't let me cuz i'm not one of the cool kids

old basin
#

I see script commands for waypoint loiter radius and type, but not height. Should I use flyInHeight or will that make the pilot copy the ground again like normally?

austere granite
jade abyss
#

if !(isNil "_return") exitWith {};

austere granite
#

😄

jade abyss
#

getArray _cfg; -> return if nothing found : []

#

same for number etc. What i wrote above =}

austere granite
#

yes

#
        case (isNumber _cfg): {getNumber _cfg};
        case (isText _cfg): {getText _cfg};
        case (isArray _cfg): {getArray _cfg;};
jade abyss
#

Means -> That isNil is useless^^

austere granite
#

except that it can be any type

vapid frigate
#

default {nil};

jade abyss
#

case (isNumber _cfg): {getNumber _cfg};

austere granite
#

isNil isn't useless, because i do want to respect 'empty' arrays

#

yes

#

"blablabla >> "wajltkasdjfklsd" = 0

#

i want that 0

#

if it's in mission

#

if it doesnt exist i still want it to check configfile

jade abyss
#

oh myyyy

#

But is _cfg a Number?

austere granite
#

_cfg would be anything

jade abyss
#

isn't it a path like configFile >> bla etc

tame portal
#

@jade abyss oh myyyyy

jade abyss
#

oh myyy

vapid frigate
#

yeh im not sure what exitWith does in a foreach tbh

austere granite
#

just exists it

vapid frigate
#

stops looping?

austere granite
#

ye

tame portal
#

It's like break in c#

vapid frigate
#

or exits the whole script?

austere granite
#

exits foreach

#

same with count

vapid frigate
#

ah ok cool

tame portal
#

It exists the current scope

austere granite
#

Not sure about apply, but i expect the same?

jade abyss
#

idk why, but that script confuses me

tame portal
#

It's OK

jade abyss
#

Only got 1 coffee and 1 Effect, so have mercy

austere granite
#

so if value (of allowed type) is found in missionconfig, use that, else check configfile, if that doesn't exist either return default value (which oculd be nil)

vapid frigate
#

looks right i think

tame portal
#

@jade abyss what should I order to eat

austere granite
#

i'm actually not sure what isEqualTypeAny does if it's nil... 😄

#

but if it derps out ill gotta do isnil there too...

jade abyss
#

But _cfg >> _x would return -> configFile >> configFile

vapid frigate
#

i didnt know it existed till i saw it there

jade abyss
#

why is this one kicking my brain so badly oO

austere granite
#

what

#

why

#

i didnt have my coffee yet either

jade abyss
#

["_configPath", []]

private _cfg = _x; //_cfg = configFile
{
_cfg = _cfg >> _x; //configFile = configFile >> configFile
nil;
} count _configPath;

austere granite
#

no it wouldn't scha

#

yes

vapid frigate
#

so configpath = ["CfgVehicles", "Car_F", "scope"]

austere granite
#

_cfg = configFIle
_cfg = configFile >> "what"
_cfg = configFIle >> "what" >> "even"

#

etc

vapid frigate
#

_configfiles = [missionConfigFile, configFile, campaignConfigFile]

jade abyss
#

ah snap, it was CfgFiles, not _configPath

#

no wait

#

nvm... i totaly ignored "count" so its a new/different _x

austere granite
#

I think it's time for some more coffeee dscha

jade abyss
#

Energy

#

Total Brainf*rt. Oh myyyy

tough abyss
#

I'm having a hard time wraping my head around addon prefixes and how they interact with paths in scripts.

#

Could someone (@jade abyss) explain it again?

jade abyss
#

Use P Drive.

#

Otherwise -> I refuse to help 😉

tough abyss
#

If my prefix is my_addon\addons\my_component, and I want to, say, run a script located at @my_addon/addons/my_component/some_folder, I'd have to use the following path within said addon \some_folder\file.sqf?

jade abyss
#

Search for "SomeNameForYourselfToSortStuff" in here and read that again.

tough abyss
#

I stil don't get it 😦

#

How does the prefix effect paths within the addon?

austere granite
#

The PBOPREFIX is is the root path for your scripts

#

PBOPREFIX = x\hi\nub

#

then in the PBO with that PBOXPREFIX, lets say there's a file called wtf.sqf

#

execVM "\x\hi\nub\wtf.sqf";

tough abyss
#

So in order to run file.sqf in my example I'd have to do "\my_addon\my_component\some_folder\file.sqf"?

vapid frigate
#

how do you mean 'located at' @my_addons/addons/my_component ?

#

generally @ folders are just the folders that you put PBOs in

#

and aren't used by scripts/configs

#

just the prefix is, so it would be \my_addon\my_component\some_folder\file.sqf

#

so you could put your pbo in @whatever\addons and it'd behave the same

tough abyss
#

@my_addons/addons/my_component is I guess the "physical" location of the file on ones PC.

jade abyss
#

@MyBrainHurts or @NevitsAddon doesn't matter.

#

What counts is the Path behind it.

austere granite
#

the physical locationo of files on PC doesn't matter

jade abyss
#

Hell, you can even call it: @OuchMyBallsHurtBecauseIDontUsePboProjectOrPDriveWichWouldDoItAutomaticlyAndWouldGiveMeLessHeadachesButIRefuseIt.pbo

tough abyss
#

Does the prefix's path get added behind the the first \ of the file's path? [prefix path]\some_folder\file.sqf?

vapid frigate
#

yeah, the root of your pbo is \[prefix path]\ in arma

tough abyss
#

Fine @jade abyss. I'll try it your way for once.

jade abyss
#

finaly...

#

(5min later "It works")

vapid frigate
#

P: does make it much simpler.. P:\A\B on your filesystem = \A\B in arma

jade abyss
#

I even gave him the example before^^ search for "SomeNameForYourselfToSortStuff" in here 😄

tough abyss
#

I'll post a screenshot of P: just in case anything is missing.

vapid frigate
#

there doesn't really have to be anything on p:

#

it's just a workspace

#

extracting arma can be handy, especially if you're using pbo project

jade abyss
#

(unless you need external Files from other Addons, then they must be unpacked in P Drive)

vapid frigate
#

u making an arma2 mod or something?

#

looks like you have arma 2 tools, not arma 3 tools

tough abyss
#

Nope, it's an A3 mod.

#

Do mod.cpp and the keys folder have to be inside @MY_MOD?

vapid frigate
#

i think keys goes in a separate folder on the server, but people often leave it there for convenience

#

mod.cpp is optional and goes in @MY_MOD

tough abyss
#

Tag is like x, right?

vapid frigate
#

it's the tag for your mod.. like ACE, CBA, A3, RHS, etc

tough abyss
#

Yes.

jade abyss
#

@tough abyss and?

halcyon crypt
#

he rage quit

jade abyss
#

Or it worked right from the beginning and he died because of joy

halcyon crypt
#

😁

jade abyss
#

and/or forgot to answer, beause it worked 😄

warm thorn
#

Does anyone have an idea how I can prevent user from continue from lobby? For example after the restart, I want that the server have at least 3 mins to initialize and load all objects from my database, without any player playing 😉 One ugly solution is to lock/unlock the server with RCon BEC, but this is no reliable solution. Any ideas?

scarlet spoke
#

I think you have to implement the waiting in the mission itself... A black screen for example via cutText

warm thorn
#

@scarlet spoke I have already thought about it, but that needs to fit all my other stuff ^^ Anyway, thanks for your fast reply!

cedar kindle
#

3 minutes 🤔

scarlet spoke
#

Sure you have to adapt the rest to that but afaik there is no way to suspend in the lobby... However someone else might know a different approach :)

jade abyss
#

@warm thorn in initPlayerLocal.sqf

_KD_EH = (findDisplay 46) displaySetEventHandler ["KeyDown","if((_this select 1) isEqualTo 1) then {true}"];    //Disable ESC

41 cutRsc [someFancyBlackOutSettingsICantRemember];
waitUntil {VarSetByServerOnceItsReady};

displayRemoveEventHandler ["KeyDown",_KD_EH];
41 cutRsc ["","PLAIN"];    //Enable ESC again
#

go to bed

tough abyss
#

I've yet to finish setting up the P: drive @jade abyss.

#

Had to leave for a while 😛

jade abyss
#

Oh my

tough abyss
#

What do I do again? Make a folder with a tag right?

jade abyss
#

I wanna hug you

#

with a 2x4.

#

with nails in it.

#
Dscha - Today at 3:12 PM
I even gave him the example before^^ search for "SomeNameForYourselfToSortStuff" in here :smile:```
tough abyss
#

Ok.

#

Folder structure is x/nev_addons/addons/nev_cache, that fine right?

#

Inside nev_cache are config.cpp, etc.

jade abyss
#

Where do you get that X?

#

I gave you an example. even with the fricking Path on the P Drive oO

tough abyss
#

x is a folder within the P: drive.

jade abyss
#

Yeah, why?

tough abyss
#

Idk, I guess I'll remove it.

#

Done.

#

Do I just drag the whole thing into pboProject now?

jade abyss
#

this getting ridiculous. I am out...

tough abyss
#

Sorry.

jade abyss
#

I won't take you by the hand, when you not even try to read/do something alone.

tough abyss
#

I understand.

jade abyss
#

What buttons do you have??

tough abyss
#

As in...?

jade abyss
#

forget it

#

i am done

tough abyss
#

Sorry again, I'll just figure this out on my own.

jade abyss
#

Don't say sorry. Just simply read what i send you. There is a full path to a function as example in it. You just have to take the names, for example simply change "MyTag" -> "NEV" and "MyAddonName" to "nev_addons". Then starting proProject, select nev_Addons, done...

tough abyss
#

Ok, thank you.

silent coral
#

Is there a way to assign task to a new set of units?

#

Team 1 has task A, team 2 has task b.

#

If team 2 succeeds task b I want to give them task a after.

#

I don't want them to see task A before however.

tough abyss
#

@jade abyss do you want the good news, or the bad news?

jade abyss
#

I want the fake news: "everythings fine"

hollow lantern
tough abyss
#

Well, everything is actually fine.

jade abyss
#

told ya, but wouldn't listened ¯_(ツ)_/¯

tough abyss
#

The issue was a missing #include script_component.hpp, and a faulty path inside the script.

#

Please don't hurt me.

#

hurls flaming rocks

#

@jade abyss would do something way worse.

#
[7:45 PM] Dscha: I wanna hug you
[7:45 PM] Dscha: with a 2x4.
[7:45 PM] Dscha: with nails in it.
silent coral
#

@hollow lantern Im a terrible scripter. If my task I want hidden is named o2 in init. How would I start with it hidden and when I trigger the success of o1, it reveals and assigns o2

jade abyss
#

yepyep

silent coral
#

@hollow lantern " o2 settaskstate none "?

tough abyss
#

Well everything is fine besides the fact that pre-processor commands don't seem to be working inside FSMs. Bummer 😕

#

I wonder if there's a way around that...?

#

"Help! My custom pre-processors aren't defineing!".

hollow lantern
#

@silent coral sqf if (taskState o1 isEqualTo "Succeeded") then { o2 setTaskState "Assigned"; unit setCurrentTask o2;} So if o2 is created but not assigned to someone its invisible but I think asignable. So you could just use the if method to check if o1 was successfully completed and then asign o2 to a unit

silent coral
#

You used to be able to just have tasks hidden. This is annoying

#

If I had a trigger of [ !alive HVT1, t1 setcurrenttask 02] but didn't link 02 to then originally it should work?

hollow lantern
#

@silent coral yes (assuming that 02 is created before the assignment)

silent coral
#

Yea I have o2 ceated via editor.

#

So I will remove it's ownership and try that.

#

Thanks for your help. One other topic getting a low heli hover.

#

I try [h1 flyinHeight 12] to get something to hover above the ground sick can rappel from it.

#

Do I need to take into account ground altitude?

#

Like a 50m tall hill should be have the altitude # set to 62 instead? @hollow lantern

hollow lantern
#

@silent coral Sets the flying altitude for aircraft relatively to the ground surface. Avoid too low altitudes, as helicopters and planes won't evade trees and obstacles on the ground. The default flying altitude is 100 meters. so I think 50m above the ground below is 50

silent coral
#

I for the life of me, can't figure this out. The mod let's you rappel from whatever distance you want,but it feels too high.

hollow lantern
#

nothing a mogadishu like RPG-7 can't solve

#

assuming you are using Blackhawks for it 😄

silent coral
#

I'm using Falcons from OpTre

#

I even tried to land it on a helipad in air, that didn't work.

hollow lantern
#

well helipads are supposed to be on the ground

silent coral
#

Yea but I was hoping to cheese it, I'm desperate

hollow lantern
#

you could probably use

helo1 setPos [position helo1 select 0, position helo1 select 1, 50];
silent coral
#

Maybe I can get it to just land on a roof, have the team rappel down the building.

#

Sqf?

hollow lantern
#

the syntax highlighting stopped working

#

thats why sqf is shown there

#

fixed

silent coral
#

So I could replace 50 with 15 or 20?

hollow lantern
#

yes

silent coral
#

I have a lot to test after my lab.

#

Thanks a lot

hollow lantern
silent coral
#

Nah, making a small campaign for the guys.

warm thorn
#

@jade abyss Thanks!

jade abyss
#

o7

#

You just need to check for the cutRsc Setting to blackout a screen. Was way too lazy to search for it again 😛

digital pulsar
#

how is it possible that one player gets a script not found pop up while another player (same server, same mission, same time) does not?

#

namely JIPs see the warning, others don't

#

the script does exist of course

silent coral
#

@hollow lantern I got neither thing to work. :L

median abyss
#

Heyo, is there any way to move a task mid mission? Or attach it to a unit?

silent coral
#

Do you mean the marker?

median abyss
#

Yeah

silent coral
#

I think if you sync the task with a unit and set the marker destination as synchronized object it would work?

#

With a destination marker that is

#

Not the Create Task module

median abyss
#

Wow

#

Amazing

#

Been screwing around with this for a good 30 minutes 😄

#

And it was that easy

silent coral
#

So it worked?

#

Good good

median abyss
#

Without a flaw