#arma3_scripting

1 messages ยท Page 299 of 1

tough abyss
#

Why not ```SQF
[param someCommand [param, param]] remoteExec

#

Sperating the command and it's params makes me thinks the params belong to remoteExec.

#

How come?

dusk sage
#

Because someCommand will execute in that block

#

The engine is reading it bit by bit

meager granite
#

And here I am, still using public variables and blacklisting remoteExec completely.

jade abyss
#

ew

tough abyss
#

publicVariable is much easier to understand.

halcyon crypt
#

well not really

#

PV requires handlers, remoteExec doesn't

#

kinda

#

probably wrong ๐Ÿ˜

tough abyss
#

Personnally i prefer remoteexec, but i can see why PV can he easier for addon makers.
Because you don't need to tell people to update thier CfgRemoteExec if using one in their missionfile description.ext

jade abyss
#

Yeah, some "Add this files to an existing RemoteExecConfigFile"-like Config Entry would be awesome.

nocturne bluff
#

Or release all hope for public servers

#

:P

tough abyss
#

isn't cfgRemoteExec part of the master config.bin?

little eagle
#

Can be overwritten by mission.

#

And when you have to whitelist the commands anyway, you might as well set up the PVEH thing.

#

Haven't used that yet.

dusk sage
#

Simply open debug console and type utils 1 then click on LOCAL EXEC (available since Arma 3 v1.67) @tough abyss

tough abyss
#

@little eagle but it completly overwrites it or expands it?
would be cool if a mod could define the cfgRemoteExec for its own scripted systems and be fine

jade abyss
#

overwrite

#

It takes the one, that is "closer" (Mission -> Addon)

little eagle
#

Yeah, but then again, you might as well set up the PVEH stuff before you bother with configs and whitelisting and serveradmins overwriting your whitelists.

jade abyss
#

Why?

#

If ServerAdmins want to overwrite your Whitelist (and get Probs with it) ->Screw em, not your fault.

#

+setting up the config for RE is easier (and faster) than writing down lines and lines of codes for PVEH

tough abyss
#

not sure if i follow you guys ๐Ÿ˜›

jade abyss
#

๐Ÿ˜„

tough abyss
#

is a cfgRE defined in a mode even used at the mission stage?

#

or just whiped as soon as a mission has its own in the desc?

jade abyss
#

Okay:
RE checks the Mission for REConfig -> If found -> Use that +ignore Addon

little eagle
#
// postInit
["my_setFuel", {(_this select 0) setFuel (_this select 1)}] call CBA_fnc_addEventHandler;

["my_setFuel", [_truck, 1], _truck] call CBA_fnc_targetEvent;
#

Doesn't get simpler than that.

jade abyss
#

Wanna bet?

little eagle
#

show

jade abyss
#

How much?

little eagle
#

?

tough abyss
#

damn that kinda sucks..

#

a growing "tree" would have been cool

jade abyss
#
[[_Veh, _FuelAmount],{(_this select 0) setFuel (_this select 1)}] remoteExecCall ["call",_Target];```
Nothing else.
#

Or even use setFuel, instead of "call"

little eagle
#

Yeah and what if the mission has setFuel and call disabled?

#

for RE

#

?

jade abyss
#

Since its coming from the Server -> Noone cares.

little eagle
#

If you say so.

jade abyss
#

RE doesn't check ServerSide send Commands

#

Only from Client

#

also

class MyTag_fnc_MyFunctionName            { allowedTargets = 0; }; //client can target Server AND Client
class MyTag_fnc_MyFunctionName            { allowedTargets = 1; }; //client can target ONLY other Clients (not Server)
class MyTag_fnc_MyFunctionName            { allowedTargets = 2; }; //Client can target ONLY Server
#

That what you can't rly do with pveh :/

#

So with that in my mind (AND when adding Updates to the RE-Whitelists in Addons is added) -> RE is better, imho.

little eagle
#

RE doesn't check ServerSide send Commands
Only from Client
So?

jade abyss
#

I never needed to whitelist any functions, that are beeing send from Server to Client. So, yeah.

proven crystal
#

how can i customize the difficuly settings on my server?

#

i see the stuff about CfgDifficultyPresets but how can i overwrite that?

#

in the description.ext?

#

or mainly: how do i get rid of friendly and enemy tags?

little eagle
halcyon crypt
#

lol

#

you can do that in your Arma3Profile server profile

proven crystal
#

cant find that profile file.

plucky beacon
#

It's in your config folder

proven crystal
#

only config folder that i have here contains just a config.vdf

#

its a rented server, probably differnt somehow?

plucky beacon
#

I just got here, but is Arma already fully installed and running on the server or are you setting up

#

My server is at C:\Server\Arma\Config\Server2312

#

-config=C:\Server\Arma\Config\Server2312\config.cfg with this in startup parameters

agile pumice
#

So I downloaded killzonekids 64 bit dll's, but I'm getting "Call extension 'make_file' could not be loaded" so I tried make_file_x64 but that's not working either

plucky beacon
#

64bit dlls for what?

agile pumice
plucky beacon
#

didn't know these were around

agile pumice
#

"debug_console" callExtension "12345"; works properly, so I don't think calling extension make_file_x64 will work

plucky beacon
#

Are you using any of the new drive onpath scripts?

#

so basically it's when a distance on the vehicle is reached it goes around it

#

then when it's ahead it pulls a sharp turn

#

close enough

#

at least enough to add some challenge to your speeding escepade

#

So this confirms that if you attatch a position to a vehicle it will follow it

#

with the setdriveonpath

#

I still gotta try that command on jets

#

This is great, I've been wanting to make a chase scene for a while

#

That actually reminds me, is there a way to force AI to turnout on the offroads?

#

you could do some serious chasing with AI shooting from the backs of those

#

ya but forcing them to stand up

#

ya that's what I mean

#

unit action ["TurnOut", vehicle]

little eagle
#

Pretty sure AI will switch back to whatever they prefer immediately.

plucky beacon
#

That's my concern

#

may just be one of those things I can't force aI to do

#

so they can shoot forward

#

they can only shoot backwards if they sit

#

also they can't use rocket launchers facing backwards

#

kinda hard to do that and have them shooting something

#

BI kinda jerry rigged the armored turnout system to change animation in the cars, maybe we'll see a change with that who knows

#

maybe turn around instead of turn out

tough abyss
#

im having a brain fart. What would you say when finding the closest number to a given number in a list, So
[3700, [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000]] call findClosestNumber;

#

something like that

#

obviously the closest number is 4000

#

so how would I formulate a function findClosestNumber

plucky beacon
#

Nah man, closest is 3000

tough abyss
#

fixed lol

meager granite
#

Do you need this only with thousands?

#

I mean finding closest thousand

little eagle
#

round, *1000, /1000

meager granite
#

If yes, then just do: _number = round(_number / 1000) * 1000;

tough abyss
#

thanks

meager granite
#

Otherwise easy solution would be to sort numbers with sort command, then do forEach

#

or even no sort if you manually input the numbers already in order

#
_number = 1234;
_search = [100,500,1000,1200,1250,1300,1400];

if(_number in _search) exitWith {_number};
if(_search select 0 > _number) exitWith {_search select 0};
_last = count _search - 1;
if(_search select _last < _number) exitWith {_search select _last}:
_last = 0;
{
    if(_x > _number) exitWith {
        if(_x - _last > _number - _x) then {_number} else {_last};
    };
    _last = _x;
} forEach _search;
tacit ruin
#

Does anyone know how to fix the problem with people spawning in as seagull ? I think it is somethink with a scrip, but correct me if im wrong

meager granite
#

Did it break since last update?

plucky beacon
#

Description.ext?

#

What's the respawn settings

tacit ruin
#

reaspawn = BASE and Respawndelay = 1 and respawnDialog = 0

plucky beacon
#

Is it only when joining in progress?

tacit ruin
#

Its when you join the server as a civ then you just beacome a seagull

#

or cop or medic

plucky beacon
#

Oh it's altis life thing

#

It shouldn't matter but it handles respawns differently

tacit ruin
#

It just heppens when we use our map insted of Lakeside, becuse we can sapwn in on Lakeside but when we join our and spain in as Civ, cop or medic we become a seagull

plucky beacon
#

Tree op

meager granite
#

drive onpath scripts?

plucky beacon
#

Did he just jump?

plush cargo
#

^ sick stunts

meager granite
#

Damn I always miss new commands

plush cargo
#

Anyone get the new ui "table" working?

turbid thunder
#

@tough abyss So how did you get the AI to actually work so well here?

plush cargo
turbid thunder
#

Being able to get ANYWHERE is already a challange, but keeping up with the speed and manuverbility of a player controlled vehicle?

plucky beacon
#

New Command

turbid thunder
#

wow

#

Weeeeell I should go and edit all my raw video footages so that I can free up space

#

BUT, this command just got infinitely more interesting

#

Launches Arma 3

#

Atleast with the commands I knew from the past, all of those were like impossible to do

#

The AI would always react too slow to be able to be a real threat

#

One way I did it is by having police cars move towards the player location, and if the player was close enough & slow enough, they would instantly stop the car and dismount, moving on foot and then letting the normal AI handle it until the AI would get too far away from the vehicle, OR if the player stops the car, AI dismounts and then the player starts driving away again. They would also dismount if they were coming up from in front of the player allowing them to fire on the player

#

Oh god

#

Like, car next to you body slam with vehicle hits a tree and dies

#

The question is, how well does this work when you are not on a straight road?

#

I made a first test

#

Remarkable on multiple levels

halcyon crypt
#

diag_tickTime vs time

jade abyss
#

diag_tickTime

halcyon crypt
#

oh wait, time is rounded to seconds ^^

#

sorry ๐Ÿ˜

jade abyss
#

and diag_TickTime is way more accurate (mmmms :D)

cedar kindle
#

CBA_missionTime ๐Ÿ™‚

jade abyss
#

Okay, maybe someone knows:
Can you request every EXISTING MemoryPoint from a model, by ScriptCommand? hmm..?

jade abyss
#

wutwutwut?

little eagle
#

It's missing all the ones only defined in the Memory LOD (which are the most interesting ones and the default of selectionPosition).

#

You could brute force selectionPosition. ๐Ÿ˜›

jade abyss
#

hmpf

#

I need custom Points, wich only exist in MemoryLOD -.- grml... fml

little eagle
#

hexeditor

jade abyss
#

by ScriptCommand

#

" from only the resolution LODs"

night frigate
#

@tough abyss I think ill try combining it with setvelocitymodelspace to do ram and fishtail maneuvers - is that how you made the Jeep Launcher on Tanoa? ๐Ÿ˜ƒ (That was the next video after your Dukes of Hazard police chase)

#

I was wondering about the landing. ๐Ÿ˜ƒ

turbid thunder
#

Tbh when I saw that video, I thought it would hit the X right in the middle

#

The math on that one just fits too good :0

#

You know what that reminded me of?

#

Planetside 2's jumppads

#

The pin point accuracy of those jump pads even when the destination is 500m+ away

compact galleon
#

@still forum Turns out, there's a sling load waypoint, lol

velvet merlin
#

BIS_fnc_effectKilledSecondaries - any changes known with this by 1.68?
from what ive read BI changes the explo FX for planes/air units

tough abyss
#

Getting this CBA related error: ```
10:39:00 [0,46.575,0,"XEH: PreStart started."]
10:39:00 Error in expression <QUOTE(call COMPILE_FILE(XEH_preStart));>
10:39:00 Error position: <(call COMPILE_FILE(XEH_preStart));>
10:39:00 Error Missing ;
10:39:00 Error in expression <QUOTE(call COMPILE_FILE(XEH_preStart));>
10:39:00 Error position: <(call COMPILE_FILE(XEH_preStart));>
10:39:00 Error Missing ;
10:39:00 [0,46.893,0,"XEH: PreStart finished."]

#

CfgEventHandlers: ```HPP
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};

class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};

#

Any clues?

#

@jade abyss tought you could set a flag in selectionPosition to search in the mem lod

indigo snow
#

Did you define the macros?

#

They didnt get resolved in your rpt

tough abyss
#

Fixed. Forgot to #include "script_component.hpp".

proven crystal
#

how do i add items to a dead body?

#

addItemToUniform doesnt seem to work

dusk sage
#

isRemoteExecuted returning false when RE'd from a headless client

#

๐Ÿ˜ฆ

rotund cypress
#

@dusk sage nice with a command like that, didn't know it existed. What would you even use that for? I have hard to try and come up with an example where to use it ๐Ÿ˜‰

dusk sage
#

To stop pesky people executing things they are not meant to be ๐Ÿ˜‰

rotund cypress
#

Hmm, ye, but could just use cfgRemoteExec

#

But I assume you are speaking about only certain people ๐Ÿ˜‰

#

Or for certain ifs

dusk sage
#

I'm using it in the manner if (!isRemoteExecuted)

#

I want it to be RE'd, but not called locally

#

Hoping one day for a command to see who RE'd something

#

One day ๐Ÿ˜‰

thin pine
#

@dusk sage for now you could pass the object that RE'd as an argument to the function

rotund cypress
#

Ah ok ๐Ÿ˜ƒ

#

Btw, I wish there was a command to see from what function a script was called

#

Like scriptParentName or something

little eagle
#

_fnc_scriptNameParent

#

Is a local variable that does exactly that.

rotund cypress
#

oooh, like a magic variable?

little eagle
#

It's build into the CfgFunctions framework.

#

If the standard header is enabled (default), this variable will be there.

rotund cypress
#

Ah ok

little eagle
#

Same for
_fnc_scriptName

rotund cypress
#

So doesn't work for script that is stored in a variable or precompiled?

little eagle
#

Only if it's done via CfgFunctions.

rotund cypress
#

Alright

#

I KNEW it

#

I thought I saw that somewhere but couldn't find a script command

#

So _fnc_scriptName is the same as _fnc_scriptNameParent?

#

Or is _fnc_scriptName the current script and _fnc_scriptNameParent the parent script?

dusk sage
#

@MrSanchez#5319 Because it's not hard for someone to pass any object they like? ๐Ÿ˜‰

thin pine
#

Oh I didn't read that you're on about security stuff.

jade abyss
#

@tough abyss
True, but i need to get a list of all Points in the MemoryLOD, before.

tough abyss
#

i see.. vanilla content?

little eagle
#

Or is _fnc_scriptName the current script and _fnc_scriptNameParent the parent script?

#

yes

jade abyss
#

Nope Lappi

tough abyss
#

but you need to get them dynamically?

jade abyss
#

Yep

#

And they are all different, except for the TAG in their names ๐Ÿ˜‰

tough abyss
#

otherwise you can write a custom config parameter array and list all the names for the object

jade abyss
#

Thats what i did right now.

#

But it sucks

tough abyss
#

armaround

jade abyss
#

Doubling the work. Adding the Points to the Model, adding the same to the Config, bbbuuuhhhhh -.-

#

Yeah, armaround ๐Ÿ˜„

rotund cypress
#

Is it possible to use ctrlCommit on progress bars?

jade abyss
#

Why not?

#

but, i tended to create my own ProgressBars.

rotund cypress
#

Alright

#

Well ye,

#

But I need ctrlCommit for a specific thing

jade abyss
#

Do your own

rotund cypress
#

I think ctrlCommit will be easiest for this case

austere granite
#

Okay.... weird idea time, is it somehow possible for clients to download an image through a http get or so through scripting?

#

Basically think squad.xml type stuff, but then to use it for drawIcon on map

plucky beacon
#

I think there is something called file patching?

#

but it has to be enabled and I never used anything like that before

#

What do you need to update through http anyway?

still forum
#

filePatching and own extension would do that. But why can't you just include all icons in the missionfile or something

plucky beacon
#

Well I guess technically if you have a database of images you might want to have them al available but would bloat the mission file

brazen sparrow
austere granite
#

Because it's a gamemode written in python, based on heatmaps and we can export that into a PNG and would like to overlay said heatmap + generated lines on it on the map ๐Ÿ˜„

tough abyss
austere granite
#

@brazen sparrow that's an extension I'm guessing? Basically i just need to get a picture that i could then use as a path for drawIcon (but quite big)

brazen sparrow
#

yup no other way

plucky beacon
#

I don't know about the map part but the image thing looks like is possible

brazen sparrow
#

@plucky beacon ye, no other way to get images on the fly.

plucky beacon
#

but if the mission itself is generating the heatmaps why can't you script the markers?

austere granite
#

doing that now, but it's a pretty big amount of markers walking through now, plus can't really prettyify it

rotund cypress
#

Can anyone here confirm if I can use ctrlCommit with progressSetPosition? I tried and didn't seem to work.

austere granite
#

nope you can't

rotund cypress
#

fuk

austere granite
#

pretty easy to just make a progress bar yourself with and use ctrlSetPosition to resize

rotund cypress
#

Ye I know

#

Just wanted to script a quick one

#

With ctrlCreate

austere granite
#

@brazen sparrow is that available anywhgere?

plucky beacon
#

I'm wondering too actually

tough abyss
#

Getting this CBA error: 18:14:42 [0,39.17,0,"XEH: PreStart started."] 18:14:42 Warning Message: Script \NEV_Addons\addons\nev_debug_menu\XEH_preStart.sqf not found 18:14:42 [0,39.508,0,"XEH: PreStart finished."] XEH_preStart.sqf is present at said directory...

indigo snow
#

inspect the pbo, is it there? some settings remove included files from the pbo

#

other than that, try removing the leading slash

#

and make sure the pbo prefix is correct

tough abyss
#

As far as I know there's no way to remove the leading slash, it's pretty deep inside all the #include mess that comes with script_component.hpp.

indigo snow
#

thats explorer, how about inside the pbo?

still forum
#

no PBOPREFIX in that folder?

tough abyss
#

Nope.

#

Worked without it before I started implenting CBA stuff.

indigo snow
#

sure but CBA macros expect it

#

due to the PBO structure mimicks your P-Drive idea

still forum
#

You can't just implement 3/4th's of the CBA stuff and expect it to work

tough abyss
#

Yeah I'm trying to work around all the \x\ crap.

indigo snow
#

just use a different folder name /shrug

tough abyss
#

I don't really use the work drive.

#

It's there, and setup just in case.

still forum
#

redefine the macro that you use in your XEH_PREP file so they don't use that \z\bla\addons\blah path

indigo snow
#

\x\ , \z\ etc is an minorprefix / majorprefix iirc

tough abyss
#

What do mean @still forum? ```SQF
PREP(addToZeus);
PREP(aggressiveAI);
PREP(broadcast);
PREP(commitDate);
PREP(commitWeather);
PREP(garrison);
PREP(nearestObjects);
PREP(onLoad);
PREP(openDebugMenu);
PREP(openGarage);
PREP(openZeus);
PREP(removeDead);
PREP(repairVehicle);
PREP(safeStart);
PREP(sideChange);
PREP(spawnGroup);
PREP(teleport);
PREP(visability);

still forum
#

The only macro you can see there

#

PREP

tough abyss
#

How do I redefine it?

still forum
#

#undef and #define it again

indigo snow
#

redefine the MAINPREFIX in your script_mod.hpp

#

thats where x, z, etc is defined

still forum
#

He already did that @indigo snow

indigo snow
#

if that still mimicks his folder structure hes good to go

tough abyss
#

mainprefix is not present inside script_component.hpp.

indigo snow
#

then define it yourself

#

you just need to make sure the defines mimick the folder structure and the PBOPREFIX does that as well

tough abyss
#

You know how when you use script_component.hpp, it includes stuff from CBA? Well, since all the #includes start with an \x\, I just copied them into my addon's script_component.hpp. I then got an error that Script \x\NEV_Addons\addons\nev_debug_menu\XEH_preStart.sqf not found, so I removed everything that has to do with the work drive.

#

I don't how else to explain it...

indigo snow
#

well CBA is in the \x\ include space yes but you control where your own files go

still forum
#
#ifdef PREP
    #undef PREP
#endif

#define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QUOTE(DFUNC(fncName))] call CBA_fnc_compileFunction

that's how I do it. You probably want to change the path and other stuff.

#

You also have to change QPATHTOF and it's sub macros if you are using that

#

#define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 this is the default backend for QPATHTOF. You probably want to change that to \##var2\##var3 or something

tough abyss
#

I'm only using PREP(). Also this is inside script_component.hpp: ```Cpp
#ifdef DISABLE_COMPILE_CACHE
#undef PREP
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf)
#else
#undef PREP
#define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
#endif

indigo snow
#

whoops that was a bit big

still forum
#

@indigo snow He doesn't want to change the prefix and use that. He doesn't want to use the whole folder system.

indigo snow
#

so just remove the\x?

#

youd have to redefine every macro that uses MAINPREFIX

still forum
#

no would be left with mod\addons\subprefix\file he just want's it to be file

little eagle
#

What's wrong with PBOPREFIX ?

indigo snow
#

but in the end it boils down to using MACRO(file)

#

confused

still forum
#

I don't know why all these decisions that just make more and more work and result in confusing messy code.. Instead of just adding a PBOPREFIX and being done with it

little eagle
#

this ^

#

๐Ÿ˜•

still forum
#

Plus if you have no Idea of how to do the complicated way. Why do you still want to do it instead of the easy (And recommended) way

tough abyss
#

Alright, tell me where to add it.

#

I'll give you the benefit of the doubt.

little eagle
#

the PBO folder

#

$PBOPREFIX$

jade abyss
#

๐Ÿคฆ

little eagle
#

x\cba\addons\settings

indigo snow
#

theres no benefit of doubt needed, commy touches all of this ๐Ÿ˜›

tough abyss
#

Alright, I'll report back in a few minutes.

little eagle
tough abyss
#

Same error occurs.

still forum
#

what did you put into your $PBOPREFIX$ file ?

tough abyss
#

NEV_Addons\Addons\nev_debug_menu

still forum
#

with what tool are you packing your folder. and which folder are you packing? You should pack the folder containing the config.cpp and $PBOPREFIX$ files and not some parent folder of that

tough abyss
#

BIS AddonBuilder.

still forum
#

That's correct.
and your $PBOPREFIX$ is at Desktop\nev_debug_menu\$PBOPREFIX$ ?

tough abyss
#

Yes.

#

I can push the whole thing to GitHub if you'd like to take a look at it.

still forum
#

Can you PM me the finished PBO? that would be best

austere granite
#

does addon builder even use PBOPREFIX?

tough abyss
#

Sent.

#

I'd be surpised if it didn't...

austere granite
#

Don't be surprised about anything in regards to BIS tools

still forum
#

You can set the Prefix in Addon Builders options. From the finished PBO it looks like it might actually be ignoring the $PBOPREFIX$ file
Good job BI

tough abyss
#

Wow.

#

Fucking hell, really. Not much else to say.

#

AddonPrefix would be 'NEV_Addons\Addons\nev_debug_menu`, right?

still forum
#

yes

indigo snow
#

it would typically be all lowercase

#

dunno if it matters for linux

still forum
#

Also Addon Builder is removing all *.hpp from the resulting PBO.
case doesn't matter in PBO. On linux it would matter with filePatching enabled and trying to use external files with filePatching

tough abyss
#

Thank you @still forum, @indigo snow and @little eagle!

little eagle
#

@still forum

#ifdef PREP
    #undef PREP
#endif
#

This looks so retarded. Armake when

still forum
#

Yeah.. Mikero stuff... Armake already there for scripts :u

plucky beacon
#

if I put add an onPlayerConnected handler on a player, it will execute the script on the server still?

#

or do I need to remotely add the handler to the serve

still forum
#

if you addMissionEventhandler on clientside then it will only trigger clientside. Atleast logic says that should happen

#

Arma not always == logic

little eagle
#

The PlayerConnected eventhandler only fires on the servers machine and only if it was added on the servers machine.

#

If you add onPlayerConnected on a client all you do is waste some bytes of memory. The eventhandler will never fire.

plucky beacon
#

okay, note taken

#

So gotta remote the handler to the server

#

then the server has to remote the client that connects

little eagle
#

a = selectRandom ["0","1","2"]
b = selectRandom ["0","1","2"]

That's 9 different possibilites, right?

How to best handle these? 3 switch inside 3 cases of another switch?

plucky beacon
#

9 cases

#

3x3

little eagle
#

Yeah.

plucky beacon
#

probably switch inside 3 cases

indigo snow
#

is 0,1 the same as 1,0 for you?

little eagle
#
    switch (_source) do {
        case "client": {
            switch (_priority) do {
                case "client": {
                };
                case "mission": {
                };
                case "server": {
                };
            };
        };
        case "mission": {
            switch (_source) do {
                case "client": {
                };
                case "mission": {
                };
                case "server": {
                };
            };
        };
        case "server": {
            switch (_source) do {
                case "client": {
                };
                case "mission": {
                };
                case "server": {
                };
            };
        };
    };
#

This looks dumb

plucky beacon
#

00 , 01 , 02 , 10 , 11 , 12 , 20 , 21 , 22

little eagle
#

0,1 is not the same as 1,0

indigo snow
#

i see

#

pfft its gonna look a mess either way

#

its readable at least

still forum
#

are they numbers?
call ([{code},{code},{code}] select _x)
Does the same just more compact :u

#

depends on what changes I'd say. split the _source specific part and the priority specific part. put each parts differences in a variable and then... you know what I mean

little eagle
#

No, strings

#
    switch ([_source, _priority]) do {
        case ["client","client"]: {
        };
        case ["client","mission"]: {
        };
        case ["client","server"]: {
        };
        case ["mission","client"]: {
        };
        case ["mission","mission"]: {
        };
        case ["mission","server"]: {
        };
        case ["server","client"]: {
        };
        case ["server","mission"]: {
        };
        case ["server","server"]: {
        };
    };
#

Will I be hated for this?

plucky beacon
#

Both are readable for me

still forum
#

Depends.... Some places may hate you. I know a guy called commy. I guess he'd get angry at that.

plucky beacon
#

^

little eagle
#

It sure looks dumb.

plucky beacon
#

I feel like you're more worried about how it looks than you should be

still forum
#

what is changing in between all these parts of code? does the priority only change one function argument or something like that?

little eagle
#

all different, except
case ["server","server"]: {
case ["mission","mission"]: {
case ["client","client"]: {

still forum
#

well 3 less is 3 less. if _source isEqualTo _priority then dick else butt (foobar is boring! I vote for dickbutt!)

#

Just write it ugly at first and optimize it later

little eagle
#

or

#
    switch [_source, _priority] do {
        case ["client","client"];
        case ["mission","mission"];
        case ["server","server"]: {
        };
        case ["client","mission"]: {
        };
        case ["client","server"]: {
        };
        case ["mission","client"]: {
        };
        case ["mission","server"]: {
        };
        case ["server","client"]: {
        };
        case ["server","mission"]: {
        };
    };
still forum
#

Thought about that. But unsure if Arma could do that

indigo snow
#

default? unless they also happen most frequent

little eagle
#

Pretty sure that is a feature of SQF switch

indigo snow
#

it works tho dedmen

#

yea

little eagle
#

If this ever reaches default, something went wrong, cptnick

tacit ruin
#

Hallo we are trying to run a Kelly's custom map and the you spawn in as a seagull. But if we run the same setup just on a lakeside map it all works, so we can't figure out what the problem is. We got this log from the server - https://imgur.com/a/SlqbU#LK7JQZ7 "the black out is just a name"

little eagle
still forum
#

Grouplimit is my first guess if spawning as seagull

tacit ruin
#

We did try to change it, but teh apawn menu wont eve appear

#

But yeah thanks

indigo snow
#

if readability isnt a concern dedmens ARRAY select INDEX option might just be the fastest way to deal. for readability the switch? Just make sure to relatively order in order of highest probability.

little eagle
#
    switch [_source, _priority] do {
        case ["client","client"];
        case ["mission","mission"];
        case ["server","server"]: {
            _ctrlLocked ctrlSetText "";
            _ctrlLocked ctrlSetTooltip "";
        };
        case ["client","mission"]: {
            _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_mission_tooltip);
        };
        case ["client","server"]: {
            _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_server_tooltip);
        };
        case ["mission","client"]: {
            _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_client_tooltip);
        };
        case ["mission","server"]: {
            _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_server_tooltip);
        };
        case ["server","client"]: {
            _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_client_tooltip_server);
        };
        case ["server","mission"]: {
            _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_mission_tooltip_server);
        };
    };
still forum
#

Why are you doing the same thing 6 times :X

little eagle
#

I'm not.

still forum
#

I like mine better

if (_source isEqualTo _priority) then {
    _ctrlLocked ctrlSetText "";
    _ctrlLocked ctrlSetTooltip "";
} else {
    _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
    switch [_source, _priority] do {
        case ["client","mission"]: {
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_mission_tooltip);
        };
        case ["mission","server"];
        case ["client","server"]: {
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_server_tooltip);
        };
        case ["mission","client"]: {
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_client_tooltip);
        };
        case ["server","client"]: {
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_client_tooltip_server);
        };
        case ["server","mission"]: {
            _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_mission_tooltip_server);
        };
    };
};

#

could also move _priority == server into another if

little eagle
#

I like it.

still forum
#

I also think that _source == _priority -> nothing to do here
is more readable

little eagle
#

could also move _priority == server into another if
Not so sure about that. I might want to amend it in is3DEN with a different dooldib

#

top ๐Ÿ‘

still forum
#

I don't quite like that repetitive _ctrlLocked ctrlSetTooltip localize. Could create a pseudo enum and then use [bla,bla,bla] select enum But that adds more performance overhead

#

and.. can switch return a value? Maybe just use the case content as return value so you have a single call to that ctrl stuff

little eagle
#

switch returns whatever the case block returns

#

or the default block returns

#

and

#

don't ask why

#

If there is no default block and no case was true

#

switch 1 do {}

still forum
#

It is usable and readable as it is. Could be made more compact but with no real benefit

little eagle
#

switch 1 do {}
-> true

#

ok

still forum
#

Aaand. sort the case statements after something ๐Ÿ˜„ I'd say swap priority and source so you can order the

        case ["mission","server"];
        case ["client","server"]:

next to eachother

#
if (_source isEqualTo _priority) then {
    _ctrlLocked ctrlSetText "";
    _ctrlLocked ctrlSetTooltip "";
} else {
    _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
    _ctrlLocked ctrlSetTooltip localize (if (_priority isEqualTo "server") then {LSTRING(overwritten_by_server_tooltip)} else {    ([LSTRING(overwritten_by_mission_tooltip),LSTRING(overwritten_by_client_tooltip),LSTRING(overwritten_by_client_tooltip_server),LSTRING(overwritten_by_mission_tooltip_server)]  select ([["client","mission"],["mission","client"],["server","client"],["server","mission"]] find [_source, _priority]))});
};

uhm.. Yeah.. I'll better go to bed

little eagle
#

hahaha

#

localize format

#

how about that?

still forum
#

ugh

#

not worth the overhead

little eagle
#

btw, this is a way to execute different code depending on the localization:
call compile localize

still forum
#
#define SourcePrioritiesFind(X) (["client","mission","server"] find X)
(([["cc","cm","cs"],["mc","mm","ms"],["sc","sm","ss"]] select SourcePrioritiesFind(_source)) select SourcePrioritiesFind(_priority))
#

or better. param with default value

#
#define SourcePrioritiesFind(X) (["client","mission","server"] find X)
(["cc","cm","cs","mc","mm","ms","sc","sm","ss"] param [SourcePrioritiesFind(_source) * 3 + SourcePrioritiesFind(_priority), "You're screwed"])
little eagle
#

stop it

#

"You're screwed"
commy setDamage 1

still forum
#

But ๐Ÿ˜ฆ Optimizing ๐Ÿ˜ข

little eagle
#

It's a ui script

still forum
#

Okey. good night, have fun, implement my client only stuff, dickbutt > foobar

little eagle
#
    if (_source isEqualTo _priority) then {
        _ctrlLocked ctrlSetText "";
        _ctrlLocked ctrlSetTooltip "";
    } else {
        switch [_source, _priority] do {
            case ["client","server"];
            case ["mission","server"]: {
                _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
                _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_server_tooltip);
            };
            case ["client","mission"]: {
                _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
                _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_mission_tooltip);
            };
            case ["server","mission"]: {
                _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
                _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_mission_tooltip_server);
            };
            case ["mission","client"]: {
                if (is3DEN) then {
                    _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
                    _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_client_tooltip_3den);
                } else {
                    _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
                    _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_client_tooltip);
                };
            };
            case ["server","client"]: {
                if (isServer) then {
                    _ctrlLocked ctrlSetText "";
                    _ctrlLocked ctrlSetTooltip "";
                } else {
                    _ctrlLocked ctrlSetText QPATHTOF(locked_ca.paa);
                    _ctrlLocked ctrlSetTooltip localize LSTRING(overwritten_by_client_tooltip_server);
                };
            };
        };
    };
still forum
#

You still have duplcated setText locked bla
just lock once before the switch and in that one quite uncommon case unlock it again

#

#UnoptimizingForBetterLooks

tough abyss
#

Forgot a then

still forum
#

if (condition) exitWith {true}

#

you can edit messages by pressig up-arrow

tough abyss
#

Was trying but missed it on my phone

little eagle
#

these tooltips will totally make sense in the end and will not be confusing, totally

still forum
#
#define SourcePrioritiesFind(X) (["client","mission","server"] find X)
(["cc","cm","cs",if (is3DEN) then {"dick"} else {"butt"},"mm","ms",if (isServer) then {""} else {"sc"},"sm","ss"] param [SourcePrioritiesFind(_source) * 3 + SourcePrioritiesFind(_priority), "You're bolted cuz screws can't hold that much :banana: "])
polar folio
#

does anyone know how bis_fnc_door gets away with using the "this" variable? it is run from the statement property of class useractions classes for opening doors.

native hemlock
#

Well isn't "this" in that context the object, so it's passing the object to the door function?

subtle ore
#

has anyone messed around with the list boxes? Or whateveer they had presented a couple weeks back?

#

Not sure what they called it at this time

plucky beacon
#

So if someone asked me what language is SQF like, what should I say

subtle ore
#

๐Ÿค” I'm not sure. I've heard some people compare it to c++ before. Not sure if that's really a good evaluation, never used c++.

plucky beacon
#

It kiiinda is like c++ syntaxually in a lot of places

subtle ore
#

Interesting, well. I guess that's a start.

plucky beacon
#

functions work diffrently though

subtle ore
#

Yeah, does Arma have their own unique way for calling/creating functions or is that pretty commonplace?

plucky beacon
#

usually it's more like BIS.function

#

instead of using prefixes

subtle ore
#

Ah yes.

plucky beacon
#

or vehicles.create

subtle ore
#

Right, that makes sense.

plucky beacon
#

categorized functions more neatly that way

#

because you could types vehicles. and it would give you all the autofill options for that object type

subtle ore
#

Right, and you'd have something seperate for functions.

#

Hey quick question here, don't mean to switch subjects so quickly. I'm trying to get a button to appear over the map. But have the player be able to draw and navigate the map whilst the button is active and clickable. Any ideas?

plucky beacon
#

I think spawned diolags prevent interaction with other dispalys

subtle ore
#

damn it..

polar folio
#

@native hemlock well yea inside the statement string. but they are using "this" inside the actual function. it's crazy. i took the statement right from the config and replaced "this" with cursorObject (which i used to get the config). and it threw the expected error that "this" is not defined instead of opening the door.

basically BIS fucked my fast door button code by deciding to suddenly clean things up and using some unified method.

well i found a workaround though so fingers crossed till the next update -_-

#

@subtle ore try ctrlCreate using the map idd

subtle ore
#

@polar folio Hmm. I'll look into this.

#

What about buttons though? I dont see any display type for buttons in ctrlCreate?

#

Nevermind, sorry about that

polar folio
#

example:

0 = [] spawn
{
   waituntil {!isNull (findDisplay 12)};

   (findDisplay 12) ctrlCreate ["RscButton", -1];
};
#

sorry guys. forgot how to wrap code

#

12 is idd of the map

#

just some test code. probably wouldn't advice adding it like that. i just added the spawn and waituntil so you can run from the devbug console

subtle ore
#

yep, I already got this: _mapBrief = (findDisplay 12) ctrlCreate["RscButton",-1];

#

I'm just going for a quick and dirty run of it. Then I'll go back and refine it.

polar folio
#

nice. what functionality are you adding to the map?

subtle ore
#

I'm forcing players to come up with a game plan before they enter. Then the team confirms it, then they enter. Gather supplies ,etc.

#

Oh hell yeah! This totally works! ๐Ÿ˜„

polar folio
#

nice sounds great. released mission?

subtle ore
#

Nah, I plan to work on it for a couple of months.

jade abyss
#

```sqf
CODE
```

#

=

#
hint str ["This works"];
subtle ore
#

you could definitely do that as well. Lol.

jade abyss
#

That was meant for Benson, when he pastes code ๐Ÿ˜‰

#

*fixed ๐Ÿ˜„

subtle ore
#

I know. I entertained the joke a little bit too.

polar folio
#

ty Dscha ๐Ÿ˜„

subtle ore
#

`` double for multi line and then single for singular lines yes?

jade abyss
#

3x `

#

Just copy and paste what i posted above

subtle ore
#

Ahh, I see now.

polar folio
#

wtf. i just placed an empty littlebird in eden on a steep slope. it started sliding downhill and actually made a scratching/sliding sound. most random feature. still like it though. must be part of all the little sound additions

jade abyss
#

Then try this:

#

Get in the Editor, place yourself near the water, get in the Water, dive to ~5m, close your eyes and listen.

polar folio
#

will do now. this better be good

#

btw. not a recent change. but do the same deep inside the tanoa jungle in the middle of the night. some scary shit

dusk sage
#

@plucky beacon Somewhat C like syntax, nothing like it in other aspects. Not statically typed. If you want to give the person a language - mash some together ๐Ÿ˜‰

jade abyss
#

More like an inbred of C, C++, Java and something else

polar folio
#

well. all i heard was myself drowning. so i guess i got trolled. well played sir

dusk sage
#

It may share syntax, but it's the polar opposite of C/C++/Java in practice

jade abyss
#

๐Ÿ˜„ @badbenson#0154

#

๐Ÿ˜‚

#

my belly

#

it hurts

#

๐Ÿ˜‚

polar folio
#

very good drowning sounds though ๐Ÿ˜„

jade abyss
#

Yeah ๐Ÿ˜„ I told ya

subtle ore
#

so I ran into a problem.

openMap[false,false];
_mapBrief ctrlEnable false;
}];
#

doesn't disable the control on the map ๐Ÿ˜ฆ

polar folio
#

you could also create another dummy control of the same size ontop of the button to disable it. i think

subtle ore
#

Agh, man. I have a great fear of "workarounds" :/

jade abyss
#

*Armaround.

subtle ore
#

Wait a sec. Would the ctrlAddEventHandler be able to acess _mapBrief if it was defined outside ?

polar folio
#

no

#

problem solved ๐Ÿ˜„

subtle ore
#

Oh my god. I'm doing many facepalms right now. DUH! ๐Ÿ˜„

vapid frigate
#

just incase it pops up for anyone else, this is a new error. it seems as of 1.68, _this gets passed to 'calls' by default

["string"] call { 
  _something = call {
     params [["_obj",  default_object, [ObjNull]]];
     _obj
  };
};```
#

so you have to use _something = [] call

#

the error being 'type: string, expected: object' on the params

jade abyss
#

param != params *After edit: Yep.

#

+why do you do this? oO

#

+Thats normal behaviour.

vapid frigate
#

i wasn't doing exactly that, it's just a simple repro

#

pretty sure it used to be nil that was passed in to _something = call {}, now it's _this from the scope you call it from

#

certain it used to be nil actually

jade abyss
#

Can't remember, that it was different. Are you sure, that you don't mix it with spawn?

vapid frigate
#

i'm sure, because it was a script that hasn't changed in 12 months and it suddenly started erroring with 1.68

jade abyss
#

works like before.

abc = {hint _text};
    [] spawn
    {
        _text = "abc";
        _Bla = call abc;
    };```
vapid frigate
#

that's just reusing _text ? not checking what's passed in

jade abyss
#

You might forgot to private a var before.

#

Why should it check? _textis known

vapid frigate
#

if u did hint _this, it would be different from before

jade abyss
#

call is like:
Copy and paste the code inside this document.

#

While spawn is -> Create a new SubFolder and forget everything done before

#

hint _this should ne error, since nothing is defined

#

mom

vapid frigate
#

yeh but since 1.68 it is defined

jade abyss
#

Yep,error hint: Type Array

#

No, it was like that before.

vapid frigate
#

as [] (from your spawn)

jade abyss
#

Sry to dissapoint you =}

vapid frigate
#

well it's either the call that's changed, or params

jade abyss
#

call = Nope, don't think so. + can't remember reading anything n the Changelog about params

#

My bet is: You forgot to privatize before.

#

Or you did private it

#

depends on the situation ๐Ÿ˜„

vapid frigate
#

maybe this didnt used to be an error:

["string"] call { params [["_obj", objNull, [objNull]]]; };
#

the script didn't change

#

the modified date is 1/2/2016

jade abyss
#

Could be params, no idea. I just said, i can't remember seeing changes. But call is as usual

#

btw. you should start your Game with -ShowScriptErrors ๐Ÿ˜„

vapid frigate
#

i do

#

i think that last one should be valid? that's probably what's changed

#

docs say " input can be tested in case it is undefined, of the wrong type or of the wrong size (if array) and substituted if necessary with default values.", which implies it should be treated the same as passing in [] instead of ["string"]

jade abyss
#

wich docs are you talking about?

vapid frigate
#

ah nvm just read the part about 1.53

jade abyss
#

Arma ยฏ_(ใƒ„)_/ยฏ

vapid frigate
#

which means i should have been getting this error since 1.53 (unless they just mean those editor-only errors)

jade abyss
#

Yep

plucky beacon
#

server fps?

proven crystal
#

in ky killed eventhandler there are these lines here

_victim = _this select 0;
_killer = _this select 1;
diag_log format ["%1 killed by %2",name _victim,name _killer];

yet _victim and _killer turn out to be the same unit everytime it fires

#

what am i missing?

vapid frigate
#

maybe a script is capturing handledamage and killing them?

cerulean whale
#

Does anyone know a PP Effect that puts on a slight blur and makes the screen grey?

vapid frigate
#

probably ColorCorrections + DynamicBlur

cerulean whale
#

Yeah, but I can't figure out a good colourcorrection lol @vapid frigate

vapid frigate
#

the default from the wiki makes the screen grey

cerulean whale
#

I just figured one out lol, now I can't get any goddamn blur to go nice

tough abyss
#

Having some trouble with CBA macros, the following button doesn't do anything. ```Hpp
class commitDate: NevRscButton {
text = "Change date";
x = "SafeZoneX + (810 / 1920) * SafeZoneW";
y = "SafeZoneY + (465 / 1080) * SafeZoneH";
action = QUOTE(remoteExecCall [QQFUNC(commitDate), 0]);
tooltip = "Commit time & date changes";
};

#

Should I be using QFUNC instead?

indigo snow
#

Im pretty sure there is no thing such as QQFUNC

#

unless you added that yourself'

vapid frigate
indigo snow
#

mhm. Either way he'd have to use QFUNC there

vapid frigate
#

i think it needs the double quotes because it's already in quotes

#

i haven't seen action= before

#

i think it should be OnButtonClick=

indigo snow
#

guessing it used to work without the CBA macro-fu

#

would help to see how that line actually gets processed

#

normally when using this in config you'd wrap a normally resolving line of code in a QUOTE() macro and shit works in my experience

#

scratch that

#

seems youre right about the double quotation

vapid frigate
#

yeah, what he has should resolve to "remoteExecCall [""whatever_fnc_commitdate"", 0]";

#

unless the ; being up against the bracket is breaking it

#

can't remember if ; is counted like other text

indigo snow
#

nah thats ok. throw it in a linter, see what it spits back out and compare with whatever you had working before @tough abyss

little eagle
#

@tough abyss Looks right what you're doing with the macros, but you're using remoteExecCall wrong I thnk.

#

params remoteExecCall [functionName, targets, JIP]

#

forgot the "params"

#

Even if no params, you have to use []

#

Oh, I think I know why it doesn't work.

#

You cannot use commas inside macros, because commas are used to separate the arguments and Arma doesn't support variadic macros.

#
QUOTE([] remoteExecCall [ARR_2(QQFUNC(commitDate),0)]);
tough abyss
#

@little eagle did you mean semi-colons? There's a comma insde the QUOTE() macro.

little eagle
#

No, comma

#

But ARR_2 has two arguments, so it's fine

tough abyss
#

How would passing arguments to the function work?

#

onLBSelChanged = QUOTE(ARR_3(FUNC(sideChange), _this select 0, _this select 1));?

little eagle
#

ARR_3, not ARG

#

also you need the []

tough abyss
#

Around the arguments?

little eagle
#

Yes, you can only pass multiple arguments if they are in an array.

tough abyss
#

Alright, thank you.

#

Also, what use would it be to switch from action = to onButtonClick = ?

little eagle
#

Why would you do that?

tough abyss
#

@vapid frigate said it should be onButtonClick =, see above.

#

I see no point is doing it, so I'm asking "Is there a point, that perhaps I'm missing?".

little eagle
#

Don't do that.

vapid frigate
#

my buttons use onButtonClick, i didn't know about action

tough abyss
#

Ok, I won't.

little eagle
#

They're two different eventhandlers that basically do the same thing, but pass different arguments and work for different contols too I think.

tough abyss
#

Yep, onButtonClick passes the control.

#

With action the presser is passed an _this.

little eagle
#

The command says it executes SQS code.

tough abyss
#

An SQF command that adds the option to execute SQS commands with a button. Why does that sound wrong?

thin pine
#

It's not a sqf command necessarily

little eagle
#

All "SQF commands" work in SQS.

#

Well, some exceptions like sleep or waitUntil I guess.

#

Some might not work for practical reasons like switch. And if then else have their own other syntax.

tough abyss
#

Just to clearify, this is correct, right? ```SQF
onLBSelChanged = QUOTE(ARR_3(FUNC(sideChange), [_this select 0, _this select 1]));

#

This is how fnc_changeSide looks, nothing happens upon change the listbox selection since I added CBA macros. ```SQF
#include "script_component.hpp"

params ["_control", "_index"];
private ["_dummySide", "_dummyGroup"];
hint format ["Contro: %1, Index: %2, DummySide: %3, DummyGroup: 4", _control, _index, _dummySide, _dummyGroup];

switch (_index) do {
case 0: {
_dummySide = east;
};
case 1: {
_dummySide = west;
};
case 2: {
_dummySide = resistance;
};
case 3: {
_dummySide = civilian;
};
};

_dummyGroup = createGroup _dummySide;
[player] joinSilent _dummyGroup;

#

This worked, though: ```SQF
"[_this select 0, _this select 1] call fnc_sideChange"

#

Also this is ran every time the dialog is opened: ```SQF
#include "script_component.hpp"

params ["_dialog"];

_sideList = _dialog displayCtrl 80015;
_sideList lbAdd "East";
_sideList lbAdd "West";
_sideList lbAdd "Independent";
_sideList lbAdd "Civilian";
switch (side group player) do {
case east: {
_sideList lbSetCurSel 0;
};
case west: {
_sideList lbSetCurSel 1;
};
case resistance: {
_sideList lbSetCurSel 2;
};
case civilian: {
_sideList lbSetCurSel 3;
};
};

little eagle
#

You're doing it wrong.

#

"[_this select 0, _this select 1] call fnc_sideChange"

#

->

#

QUOTE([ARR_2(_this select 0,_this select 1)] call FUNC(sideChange))

tough abyss
#

Oh.

little eagle
#

Also,
[_this select 0, _this select 1]
seems pretty pointless.
Could just use:
_this

tough abyss
#

So ARR_1?

#

Since it's 1 argument.

little eagle
#

There is no ARR_1, because a one element array would have no commas

#

These only exist to work around you not being able to use commas in macros.

#

ARR_2(1,2)
->
1, 2

#

ARR_3(1,2,3)
->
1, 2, 3

#

etc.

tough abyss
#

Ah, so QUOTE([_this] call FUNC(sideChange)).

little eagle
#

QUOTE(_this call FUNC(sideChange)).

#

Because _this already is an array

#

Otherwise your script would break.

tough abyss
#

They always do ๐Ÿ˜„

#

Thanks @little eagle, you're awesome. ๐Ÿ˜ƒ

little eagle
#

If you don't like ARR_n, you can also use the X39 method

#

#define COMMA ,

#

QUOTE([_this select 0 COMMA _this select 1] call FUNC(sideChange))

#

never tried this myself, but I don't see why it wouldn't work.

halcyon crypt
#

you could also just not use macros ๐Ÿ˜

tough abyss
#

๐Ÿ˜ฌ

little eagle
#

Sure, but it's really not that difficult.

#

And if it's an incentive not to put code in configs, great.

dusk sage
#

_this select 0 COMMA _this select 1

queen cargo
#

wait wait
commy rly recommended one of my methods ๐Ÿ˜ฑ

#

but yes, it works

little eagle
#

@dusk sage make variadic macros for Arma or stop being triggered.

queen cargo
#

reasoning is as follows:
preprocessor is seeing a COMMA not a , --> no preprocessor token
no preprocessing

#

but as it is a token registered for the replacement

#

it gets replaced correctly :3

#

magic

#

@little eagle would require a separated preprocessor

#

which actually is quite nice but requires extra tools in toolchain to build

#

but that would solve those nasty preproc errors

#

like ```sqf
#ifdef foo
#ifdef bar
enter what you want ... script wont be correctly preproced anyway
#endif
#endif

tough abyss
#

Are variadic macros an engine limitation?

queen cargo
#

yes

#

or no

#

it is more a horrible preprocessor ๐Ÿ™ˆ

#

you have to know what it is supposed to do

#

it is like the c# preprocessor

#

it is ok for what it wants to provide

#

but not for more :3

tough abyss
#

Can you nest QUOTE() macros? And is there a a double quote macro (QQUOTE())?

queen cargo
#

you can nest as many macros as you want

#

thats the fun part ๐Ÿ˜„

#

and that is why COMMA works

#

COMMA is pretty much the same as COMMA()

tough abyss
#

So basically: "closeDialog 0; [""Open"", true] spawn BIS_fnc_arsenal" >> QUOTE(closeDialog 0; [QUOTE(QUOTE(Open)), true] spawn BIS_fnc_arsenal)?

#

Seems hacky.

queen cargo
#

you also should not use that ... looks horrible

tough abyss
#

Haha, it does.

queen cargo
#

to get that, you can use a simple function
str _code with a select

tough abyss
#

Ctrl+Zs...

queen cargo
#

takes out some performance indeed ...

tough abyss
#

It's inside an hpp.

queen cargo
#

but in most cases, that does not matters

#

why?

#

why would you do that ๐Ÿ™ˆ

tough abyss
#
// A button to open the virtual aresnal
    class virtualArsenalButton: NevRscButton {
        text = "Virtual arsenal";
        x = "SafeZoneX + (510 / 1920) * SafeZoneW";
        y = "SafeZoneY + (375 / 1080) * SafeZoneH";
        action = "closeDialog 0; [""Open"", true] spawn BIS_fnc_arsenal";
        tooltip = "Open the BIS virtual aresnal";
    };
#

It's a button within a dialog...

queen cargo
#

use control event handlers

#

those in-config code handlers are horrible

tough abyss
#

Why?

#

Pff.

#

No they're not.

#

How would you do it?

queen cargo
#

use the dialog as simple dialog

#

it is your bluepint of a dialog

#

not blueprint + actions

#

separate code from UI

#

after that: create two new functions

#

createDialog and destroyDialog

#

createDialog will setup your dialog

tough abyss
#

Yeah I know how dialogs work..

queen cargo
#

((make sure the actual setup is done in sync space not in async))

tough abyss
#

In most cases the action calls a functions.

#

As such: ```Hpp
// A button to open Zeus
class zeusButton: NevRscButton {
text = "Open Zeus";
x = "SafeZoneX + (510 / 1920) * SafeZoneW";
y = "SafeZoneY + (285 / 1080) * SafeZoneH";
action = QUOTE([] remoteExecCall [ARR_2(QQFUNC(openZeus), 0)]);
tooltip = "Open the Zeus curator interface";
};

queen cargo
#

i know

#

ugly as hell

#

btw

#

" my string can use double "" for escaping a single """

tough abyss
#

Eh?

queen cargo
#

"" will escape quotas in a string

tough abyss
#

Yeah that's way ""open"" is in doubles.

queen cargo
#

" a "" b " --> a " b

#

it still looks cleaner then using quotes
though ... you use those ugly function macros too

tough abyss
#

Also, why whould I use destoryDialog? I press Esc and it's gone.

queen cargo
#

ever needed to cleanup something when your dialog closes?

tough abyss
#

Nope.

queen cargo
#

complex UIs with update cycles can be quite complicated

tough abyss
#

"Complex UIs can be complex" - somebody pin that.

#

โค

queen cargo
#

let me be a lazy stupid :3

#

actually have to write some content for threads

#

but as said: how i would do it would be add the action inside of the createDialog

#

via addEventHandler function

#

the CIDs would be in a separate hpp files

#

so you do not need to memorize

#

and got nice strings to access them

#

can be pretty handy

#

especially if the files get larger

#

and you need to narrow down a script issue

tough abyss
#

Unnecessary. I'd rather do things on the config than to mess with more scripts.

queen cargo
#

in the end it is up to you

#

still you will mix everything then

tough abyss
#

Do you want me to send you the whole thing? I feel like you're misunderstanding it.

#

The whole addon, that is.

queen cargo
#

i do not missunderstand ๐Ÿ™ˆ but i think we still talk about different things :3

#

anyway

#

as long as you stick to functionmacros and config files
you will need to use QUOTE

little eagle
#

wtf, how difficult can it be to convert one line.

tough abyss
#

We're sorry, Commy. ๐Ÿ˜ฆ

queen cargo
#

no need to be @tough abyss he is just angry as usual

tough abyss
#

Is he? Seems calm usually.

jaunty ravine
#

Someone needs to die.

peak plover
#

Dear god

queen cargo
#

search the error somewhere else#

#

looks like the classy follow up error

little eagle
#

playSound doesn't work on the briefing screen. Alternative?

jade abyss
#

hint it as Text

little eagle
#

hint "click"

#

Bad idea

kindred lichen
#

Does anyone know of a way to "disable" player face/mask customization?
I'm trying to make a Period Mission, and players keep having the Tactical Eyeglass thing, or the Stealth balacklava, or stuff.

#

Additionally, one of our mod-packs adds a gas masks that's functional, and I want to restrict it, otherwise everyone always wears the gas mask.

peak plover
kindred lichen
#

How should I use that command?
If I place units in the editor, and use the loadout feature in the 3den editor, is there a way to do this for players and preserve what I've selected in the editor? or is it like I put that in the init, and then add whatever I actually want with a script after?

peak plover
#

Put this in front of your gear script

plucky beacon
#

initplayerlocal.sqf too

little eagle
#

^ this should be the easiest.

plucky beacon
#

If you do it in the initplayerlocal it shouldn't add goggles unless your gear script does

rancid pecan
#

Hello all

plucky beacon
#

hayo

rancid pecan
#

How can we turn off police officers on the map?

plucky beacon
#

lol what?

#

what map

rancid pecan
#

I know little about english?

#

map

#

mapcontent

#

"M" key

plucky beacon
#

Where do the police officers come from

jade abyss
#

Just guess.

rancid pecan
#

1 min

#

I will give an example

plucky beacon
#

I wanted to be sure but okay

rancid pecan
#

yes yes @tough abyss

plucky beacon
#

server config difficulty

rancid pecan
#

That is what I mean

#

but but

plucky beacon
#

but

rancid pecan
#

You can not see your own place when mapcontent = 0. Is there any other way?

plucky beacon
#

no clue, I always turn it off anyway

rancid pecan
#

hmm i am understand

#

well

#

Is there a custom script? To show his place?

plucky beacon
#

yes, lots of

rancid pecan
plucky beacon
#

there are lots of scripts especially if you just want to see your own position

rancid pecan
#

i am understand but

#

I can hardly find it because it is not in my language. Can you sample? please

plucky beacon
#

what is your language?

rancid pecan
#

Turkish

#

"istanbul"

plucky beacon
#

I have a friend there actually

#

His alias is Gentoc

rancid pecan
#

I do not know a foreign alias ๐Ÿ˜ฆ ๐Ÿ˜ƒ

#

I am very happy if you give me an example in this matter. At least what should I investigate?

plucky beacon
#

I'm writing it

rancid pecan
#

okey i am waiting

plucky beacon
#
null = [] spawn 
{
    _marker1 = createMarker ["DNI_PlayerMarker", position Player];
    "DNI_PlayerMarker" setMarkerType "mil_triangle";
    "DNI_PlayerMarker" setMarkerColor "ColorYellow";
    while {true} do 
    {
        "DNI_PlayerMarker" setMarkerDir (getDir Player);
        "DNI_PlayerMarker" setMarkerPos (getpos Player);
        sleep 0.5;
    }; 
};

Untested but if you put this in the initplayerlocal.sqf it should work

rancid pecan
#

okey i am very fast try

plucky beacon
#

๐Ÿ‘

rancid pecan
#

@plucky beacon I thank you for your help. you are a good person

plucky beacon
#

๐Ÿ˜„

tender fossil
#

What's the benefit of using stackable eventhandlers?

#

vs. normal ones

still forum
#

They are stackable. normal ones aren't

tender fossil
#

Yes but what's the benefit of using them?

still forum
#

having more than 1 eventhandler

tender fossil
#

Ah

#

So I can create multiple eventhandlers for the same event?

still forum
tender fossil
#

I see, thanks for explanation ๐Ÿ˜ƒ

still forum
#

There are two versions of stackables though. the BIS function that get broken as soon as someone uses a nonstackable version of that handler anywhere. and addMissionEventHandler

tender fossil
#

I haven't taken the game (engine) courses in uni yet so I'm not familiar with all concepts. Thanks for the tip too!

still forum
#

the BIS function one doesn't get recompiled before every execution as the addMissionEH one does. But that is expected to be fixed

little eagle
#

But that is expected to be fixed

#

Just like flip tanks, right?

still forum
#

flip tanks are fun!

tough abyss
#

i hear flip tanks?

little eagle
#

PhysX

jade abyss
#

You say PhysX
I say huiiiiiiiiiiiiiii
You say PhysX
I say huiiiiiiiiiiiiiii

little eagle
#

The best thing about Arma 4 will be the lack of PhysX.

tough abyss
#

no PhysX? then what? Physics?

#

๐Ÿ˜›

spring ravine
#

in house physics

little eagle
#

But Jets now also get PhysX, so maybe we have flip jets soon too.

spring ravine
#

they are working on their own system for enfusion engine so yeah

little eagle
#

Can't wait for someone to jump start them by turning in place and then actually flying away.

jade abyss
#

Just did that in Editor 3-4Hrs ago

#

turned to the left, huiiii

slim apex
#

Can someone tell me where about this model will be: Land_CarBattery_01_F

#

I have no clue which file directory to search through, and my ArmA 3 Folder will take wayy to long (Over 300gb of mods xD)

little eagle
#

That is not a model, but a classname.

slim apex
#

Well, where the model of the item is?

#

That's what i meant, sorry ๐Ÿ˜›

jade abyss
#

Editor -> Esc -> configViewer -> search for Classname -> MODEL = "PathToP3D";

#

there you go

slim apex
#

ty โค

little eagle
#
copyToClipboard configSourceAddonList (configFile >> "CfgVehicles" >> "Land_CarBattery_01_F");
jade abyss
#

sush, let them do some work

little eagle
#

I guess your method is better.

#

It actually gives the models filepath.

jade abyss
#

That also.

slim apex
#

"Them" ๐Ÿ˜ฎ

#

So offended right now

little eagle
#

It's gender neutral, mate

slim apex
#

Good point

plucky beacon
#

triggered

tough abyss
#

Hey guys, do you know if you can transfer Objects without a varName through format? Like i got an Object C Alpha 1-3:1 and I wanna bind it to a button with buttonSetAction format["[0,_object] execVM 'bla.sqf'",_object].

#

sry %1, not object ^^

jade abyss
#

@plucky beacon You just don't count. Back in the corner and do your homework.

#

shush! go! shush

little eagle
#
my_object = _object;
buttonSetAction "[0, my_object] execVM 'bla.sqf'";
jade abyss
#

โ˜

tough abyss
#

so i gotta transfer it into a global var?

little eagle
#

Your fault for using ancient commands like buttonSetAction and not ctrlAddEventHandler

tough abyss
#

so thats a better solution then, why not putting this advice first ๐Ÿ˜›

little eagle
#

You didn't ask for it.

#

You asked how to serialize objects into strings.

#

Objects cannot be serialized into strings.

#

I guess you can mess around with this:
BIS_fnc_objectFromNetId

tough abyss
#

thanks so far, thats all i needed

little eagle
#

But meh

tough abyss
#

netId doesn't work in SP i guess

little eagle
#

The BIS functions do work in SP

#

But I don't think the sqs snipped supports return values from functions, so...

tough abyss
#

Well i think i go with the EH, thanks so far commy ๐Ÿ˜ƒ

little eagle
#
[_control, "ButtonClick", {[0, _thisArgs] execVM 'bla.sqf'}, _object] call CBA_fnc_addBISEventHandler;
#

no wait

#

edited. Like this, should also work.

tough abyss
#

I'll give it a try! ๐Ÿ‘

tough abyss
subtle ore
#

Is this a result of what we saw in the flag improvements?

plucky beacon
#

I read Dscha's message from 5 hours ago, which is funny because I was actually doing homework

subtle ore
#

having this weird thing happening here. I added disableSerialization; at the beginning of the bracket in a new script aside from the initPlayerLocal. Keeps telling me that the variable shouldn't be stored in the missionNamespace

#

am I missing something here?

jade abyss
#

Instead of wasting your time, describing it -> Post it.

subtle ore
#

Good point.

plucky beacon
#

I feel like I've been writing this script one line at a time, but in any case. if I remote execute a script to the server (2) that contains

if (isMultiplayer) then {
    [[],"\DNI_FpsZeus\jip.sqf"] remoteExec ["execVM",2,false];
};
onPlayerConnected
{
    [[],"\DNI_FpsZeus\client.sqf"] remoteExec ["execVM",_owner,false];
};

then it should remotely execute to the client that joined right?

vapid frigate
#

depends what _owner is i guess

#

looks like it'll be nil

plucky beacon
#

the onPlayerConnected said it passed that variable

vapid frigate
#

oh ok, should work then

plucky beacon
#

_owner: (since Arma 3 v1.49) Number - is owner id of the joining player. Can be used for kick or ban purposes or just for publicVariableClient.

#

looks like it checks out

vapid frigate
#

not sure if you need the top script though?

#

just need to run the bottom one on the server once

plucky beacon
#

it's for an addon so it all fits together

#

thats why OnPlayerConnected had to be remotely called to the server

vapid frigate
#

not sure how \DNI_FpsZeus\jip.sqf can exist on the server, but an init script can't though?

plucky beacon
#

Good point actually. I guess id have to remotely execute the command

vapid frigate
#

just the last one i think, no need to tell the server to add the 'onplayerconnected' event from the clients (the server can just do it itself)

#

unless it's a client side mod.. then you'd have to do something like that

plucky beacon
#

It is

vapid frigate
#

remotexec onplayerconnected

plucky beacon
#

Ya

vapid frigate
#

sounds like you should actually use the 'BIS_fnc_addStackedEventHandler' or playerConnected event handler too

#

onplayerconnected might overwrite something on the server

plucky beacon
#

Would it?

#

Hmm

vapid frigate
#

if something else is using it

plucky beacon
#

It can only be one at a time?

#

Interesting

vapid frigate
#

sounds like it from the blue/green notices on the wiki

plucky beacon
#

Remotexeccall

#

Does the block of code count as a param in remote exec?

#

I've never tried that before

vapid frigate
#

yeah

jade abyss
#

@subtle ore Your problem is solved, i assume?

little eagle
#

having this weird thing happening here. I added disableSerialization; at the beginning of the bracket in a new script aside from the initPlayerLocal. Keeps telling me that the variable shouldn't be stored in the missionNamespace
am I missing something here?

#

You cannot store displays or controls in mission namespace variables or this error will pop up.

rancid pecan
#

@plucky beacon Hello again ๐Ÿ˜ƒ

#

Showing everyone's place ๐Ÿ˜ฆ

soft crest
#

If anyone who knows code pretty well and has 2 min i would like to ask a question about a a ogv not playing on my dedicated but on my local need some help with a line of code to activated it on dedi machine aswell

thin pine
#

@soft crest are you familiar with the concept of locality?

soft crest
#

very !!!!

#

thats whats happenign

#

but there must be a line of code to put before my script that should allow it to play

thin pine
#

how is the playing of the video activated? through addAction? through a trigger?

soft crest
#

through the init then this is the script

#
[] spawn {
scriptName "initMission.hpp: mission start";
["rsc\ARMA_3.ogv",0,0,1920,1080,true] spawn BIS_fnc_titlecard;    
waitUntil {!(isNil "BIS_fnc_titlecard_finished")};
//titleText [WELCOME_MESSAGE, "PLAIN", 3];
};
sleep 35;
execVM "intro.sqf";
thin pine
#

I haven't really used titleCard before so I'm unsure of its behaviour, but try adding a sleep 0.01; infront of the [] spawn { - this will cause the code to be triggered only AFTER the briefing screen is done

soft crest
#

ok il ltry thanks

plucky beacon
#

@rancid pecanchange createmarkerlocal

#

Createmarker>createmarkerlocal

plucky beacon
#

Anyway i can force AI to never eject their aircraft?

still forum
#

You may be able to lock it. No one can enter and no one can exit AFAIK

plucky beacon
#

That works since i have no intention of any AI leaving any vehicle

#

But to be honest i thought i remembered a bug with damaged aircraft

#

They would just pop out anyway

peak plover
#

ohh yeah, It's pretty bad. I always see a tank take a hit in the tracks and the crew bails and even leaves the gunner

plucky beacon
#

there is a command for that but it's only for tanks

#

it's like immobiledismount or somethin

subtle ore
#

@jade abyss i found a workaround.

jade abyss
#

uhm, okay.

plucky beacon
#

Lol

#

Good job Dscha

#

Ou saved the city

rotund cypress
#

Is there any command or similar to switch interface size on a mission?

plucky beacon
#

during a mission?

#

I don't think so, since you need to restart the game usually anyway

rotund cypress
#

Cause when I make dialogs

#

They're different even though Im using safezone

#

So text gets bigger if you change interface size and resolution

#

Not the dialog itself

#

But the text

plucky beacon
#

Text is multiplied by the safezone?

#

It should be

rotund cypress
#

Maybe sizeEx = 0.04 * safezoneW + safezoneH?'

plucky beacon
#

just height I think

#

because font size is vertical based

rotund cypress
#

Okey

#

How about structured text?

plucky beacon
#

You'll have to trial and error some numbers because I don't know how much safezone effects it

#

oh uh, never tried that

#

try it

jade abyss
#

When you do UI -> Use Safezones

#

Definitions i used:

#define Txt_Small "0.01 * safezoneH"
#define Txt_Norm "0.02 * safezoneH"
#define Txt_Big "0.03 * safezoneH"
#define Txt_VBig "0.04 * safezoneH"
#

+define the Textsize in the .hpp itself (i assume you use that) by using it like: sizeEx = Txt_Norm;

#

@rotund cypress

rotund cypress
#

oh ok nice

#

I use Safezones for ctrls positions but not text

jade abyss
#

Create a file named:
DispDefines.hpp
->
Add the Defines i posted above in it
->
include "DispDefines.hpp" in the description.ext (again: I assume you use that one) before you add the rest of the UI/Display/RscTitles Stuff
->
Use "Txt_Norm" instead of "0.02 * safezoneH" in the Cfg. way more easier.

rotund cypress
#

I guess I could do that

#

Or just do safezoneH each time

#

If I want to use different sizes than the one defined

plucky beacon
#

You can use definitions and just change the defined size?

rotund cypress
#

Ye but why use a macro for this little

jade abyss
#

Don't call it a Macro^^

plucky beacon
#

easy readability?

jade abyss
#

Its more like a defined Name for better readab... exactly

#

Its like in a Script:
_A = 1+2;
if(_A == 3)then{hint str _A;};
instead of
if( (1+2) == 3) then {hint str (1+2)};

rotund cypress
#

Ye I know

#

But

jade abyss
#

No but

#

no

#

stop

#

no no

plucky beacon
#

lol

rotund cypress
#

I'll know anyways without a macro, so no need ๐Ÿคฃ

plucky beacon
#

what if you look at it months later and forget

jade abyss
#

Its not about understanding, but.. ah.. do what you want. pff... peasant

rotund cypress
#

hahaha

plucky beacon
#

Or what if other people look at it

jade abyss
#

=}

#

shush Nitro

#

let him be a peasant himself

plucky beacon
#

LOL

#

okay

jade abyss
#

go back and learn

#

๐Ÿ˜„

rotund cypress
#

lol

#

I don't think its right or wrong to use macros, sometimes they're enjoyable sometimes not imo