#arma3_scripting

1 messages ยท Page 362 of 1

umbral vale
#

Anyone here familiar with InputAction?

peak plover
#

I used actionkeys

#
        // Add keydown eventhandeler to the display
        private _keyDown = _display displayAddEventHandler ["KeyDown", {
            params ["_ctrl", "_dikCode", "_shift", "_ctrlKey", "_alt"];

            // if ctrl + J is pressed
            private _keys = (actionKeys "tasks");
            if (_ctrlKey && {(_dikCode in _keys)}) then {

keyDown EH might be better in some cases than waitUntil that other thang

umbral vale
#

So I was actually able to implement the InputAction thing

#

Im using it with push to talk, problem is it calls the script again if you press and release a key while holding another

#

so like

#
Capslock held -> in script called
Capslock still held + W -> nothing
Capslock still held, W released -> out script AND in script called again
Capslock released -> out script called
peak plover
#

keydown EH might be worth a try

quasi rover
#

Sorry but, BIS function "BIS_fnc_EXP_camp_IFF" still available? where can I find the description?

robust hollow
#
    Author: Thomas Ryan
    
    Description:
    Simple handling of the Support Team's scripted IFF.
    Must be executed locally.
    
    Notes:
    - To always show the icon and name of a unit, use:    <unit> setVariable ["BIS_iconAlways", true]
    - Otherwise, icons can be hidden with:                 <unit> setVariable ["BIS_iconShow", false]
    - And names can be hidden with:                     <unit> setVariable ["BIS_iconName", false]
    
    Parameters:
        _this: ARRAY - Array of Support Team units.
    
    Returns:
    True if successfully initialized, false if not.
*/
#

u can find it in the function browser.

quasi rover
#

thx, @robust hollow ๐Ÿ˜€

peak plover
#

CfgDebriefingSections
Can this be custom for each side anyhow?

#

Anyone have experience?

peak plover
#

Nvm I thought it can't be changed, but it can

indigo snow
#

@tough tartan Id simply assume the variable is true at the start?

#

Maybe check against that with a diag_log / systemChat

modern sand
#

I'm checking now

#

I'm pretty sure it has to do with my KeyDown event handler,

indigo snow
#

The syntax, at least, is correct

modern sand
#

wait

#

I think I found my issue

#

no ๐Ÿ˜ฆ

#

Even when I use [] spawn {}; it still bypasses the waitUntil

#

unless I'm using the spawn feature incorrect

indigo snow
#

did you log the variable's value?

modern sand
#

what do you mean?

indigo snow
#

dump the value of testVar using diag_log or systemchat or whatever

#

it might simply be true

modern sand
#

oh wait no, it's not seeming I just use the watch feature in debug to check the status of my variables

#

I've made sure

#

Essentially what I am trying to do, is when the script is executed it adds a KeyDown displayEventHandler to the player, and when it is used once it deletes it using displayRemoveAllEventHandlers, I just can't get the waitUntil to work

#

although I am using [] spawn {};

#

and yes, when the event handler is used it changed testVar back to false

#

I've just tried using [] call {}; instead of spawn, and still not working :/ I'm confused lmao

indigo snow
#

youre spawning the entire thing, right, and not just the waitUntil?

modern sand
#

Yes

indigo snow
#

did you add some diag_logs to output the value of the player getVariable?

modern sand
#

Maybe spawn and call don't work when executed in debug console? Only in a sqf file? Also about the output values, I'm just using the Watch section on the debug console which is the exact same thing

indigo snow
#

if the waituntil doesnt wait, that variable simply is true, and youve made a mistake in the way you structured your script

#

debug console works fine

#

so the watch fields show false ?

modern sand
#

yes

indigo snow
#

and youre sure the part with the waitUntil is actually running?

modern sand
#

Yes

#

I've just added an extra line below the waitUntil which simply hints me the word "test", and as soon as I execute the script I get hinted "test"

#

so clearly it's not waiting

indigo snow
#

can you also log the value of canSuspend from there?

modern sand
#

Most certain, but If I'm correct that value isn't defined anywher?

indigo snow
#

its a command

modern sand
#

ok

#

I'll try real quick

#

it says false

indigo snow
#

then you cant wait

modern sand
#

yes

indigo snow
#

and the code is in an unscheduled environment

modern sand
#

But doesn't [] spawn {}; fix that?

indigo snow
#

yes

modern sand
#

I am using spawn

indigo snow
#

then youre testing an old version of the script

#

if the code containing the waituntil is spawned, you can suspend

#

with the sole exception being if you wrapped it inside an isNil CODE check

modern sand
#

It's not

indigo snow
#

the sole exception is the isNil check

modern sand
#

but the script doesn't even contain the isNil command.

#

while using the [] spawn

indigo snow
#

then the bit containing the waitUntil isnt spawned

modern sand
#

it is though, it's in the middle of the spawn brackets

#

ughh

indigo snow
#

then you might be editing / testing in different locations

#

this is a hard rule, im afraid - spawned code can suspend barring minor exceptions such as the isNil command (and i dont know any other commands that allow that)

modern sand
#

ughh

#

I have no clue why it's not working

indigo snow
#

youre sure the waitUntil isnt inside the code argument of an addeventhandler inside the spawned bit?

modern sand
#

Seeming it is being spawned, and doesn't inclue isNil

#

Yes I am %100 sure

indigo snow
#
[] spawn {
    player setVariable ["AABBCC",false];
    waitUntil {
        sleep 1;
        systemChat "loop";
        player getVariable ["AABBCC",false];
    };
};

[] spawn {
    sleep 15;
    player setVariable ["AABBCC", true];
};

Execute that in the debug console

modern sand
#

wait I just tested, it has to do with the string inside of the waitUntil

#

seeming when I change it, in this case I changed it to waitUntil {not alive player}: it waits

#

I executed that and has script erros

#

apparently it is missing a '{'

#

It has to do with trying to check if the variable is false or not

#

I fixed it

#
waitUntil {!(player getVariable "testVar");};
indigo snow
#

Yea i see it

modern sand
#

that works

#

I tried that before I even asked on the A3 discord but clearly wasn't spawning the script

indigo snow
#

that just implies your variable didnt have the value you expected it to be

#

now you wait till its false, instead of true

modern sand
#

I always wanted it to wait until it was false

#

and always had it wait till it was false

indigo snow
#

then
waitUntil {player getVariable ["TestVar", false]}; is syntactically wrong, this stops waiting when testVar is true

#

Hence why i asked if it showed as false

modern sand
#

That explains it

#

I got told by another person on this discord that ```
waitUntil {player getVariable ["TestVar", false]};

#

vice versa for waiting for it to be true

indigo snow
#

it doesnt

#

the second bit is a default value

#

for it it wasnt defined

modern sand
#

then my bad, it would of worked if I just changed the false to a true

indigo snow
#

but then why did you say the variable showed false

modern sand
#

the variable did show false

#

when it is supposed to

indigo snow
#

im very confused

#

you said it being false was expected, but you also expected to waituntil to keep looping even if it was false?

#

but you also wanted to stop waiting when it was false

modern sand
#

no no no

#

From the start I wanted it to waitUntil the variable was false, but I was using the incorrect syntax and had it waitUntil the variable was true

#

thats why even with the [] spawn {}; it wasn't working, because the variable was set to false (which is correct) but it was waiting until the variable was true

indigo snow
#

I'm still confused why you were fine with the watch field showing false then

#

I asked specific questions to check what it should be, including you logging the value, and now it turns out like this ๐Ÿ˜›

modern sand
#

Well I told you everything that you needed to know, which was correct information. Seeming my script is layed out when it is first executed it defines the variable to true, then adds a KeyDown EventHandler to the player, and when that EventHandler is toggled it sets the variable to false, then after the keyhandler is added to the player the waitUntil waits still the variable is false, meaning the player toggled the event handler.

#

When you asked me to check the value of the variable I checked it after I toggled the EventHandler, meaning the variable was false. Expecting the waitUntil to wait till the variable was false, but I had the incorrect syntax so it was waiting for the variable to be true, hence why it wouldn't work

indigo snow
#

I mean its all solved now, but thats why i specifically asked you to log the value from the script itself

#

Im not mad but let that be a lesson that doing that is good practice

modern sand
#

That's besides the point, the only issue here is the lack of communication seeming I asked if the waitUntil waits till the variable was true, thinking it waits till it was false. I didn't clarify what I wanted. That is why you are confused

#

Overall thanks for the assistance, and I will try to be clear with my questions next time ๐Ÿ˜›

modern sand
#

Okay, I am stuct on another task. Is there anyway I could teleport the player directly infront of him, in the direction that he is looking?

#

I've tried using modelToWorld but that only works based off of axis

#

and not direction

indigo snow
#

the alternative getPos syntax or indeed modeltoworld

#

player getPos [10, getDir player] or player modelToWorld [10,0,0]

modern sand
#

I also thought to create a marker directly infront of the player, and just set the players position to the marker, but don't know how to get the position which is infront of him

#

I'll try that

#

thanks

#
_pos = player getPos [10, getDir player];
player setPos _pos;
``` Works like a charm, thanks!
#

Strange, it works but also throws me into the sky 200+ meters.... lol

#

Any ideas?

#

Don't worry, managed to fix it by playing around with timing

indigo snow
#

getPos / setPos are wierd if youre standing on objects

#

player setPosWorld (player modelToWorldWorld [10,0,0])

modern sand
#

I'll try that!

#

That also makes me fly, strange

#

I managed to get it working so I'll keep with it. Thank you again for your assistance ๐Ÿ˜ƒ

indigo snow
#

player setPosATL (getPosATL player vectorAdd (vectorDir player vectorMultiply 10))

#

theres probably a way to make it even more complicated

modern sand
#

omg hahahaha

#

I'm just using getPos / setPos with a sleep time of 0.001 just before the players position is set so it stops the random act of shooting the player into the sky and essentially looks instant.

astral tendon
#

why is the LEAN_ON_TABLE not working?

#

he is doing the standard STAND

young current
#

@indigo snow @modern sand you could also pick modelToWorld position as it takes into accord all the directions of the model.

indigo snow
#

i already did that above

young current
#

so you did xD

#

skipped that line

#

๐Ÿ˜„

indigo snow
#

i also did modeltoworldworld, got the unicorn out of the stable

#

@astral tendon what are those?

#

animations?

astral tendon
#

yes

indigo snow
#

which function?

#

gonna need some amount of context

astral tendon
#

[delet1,LEAN_ON_TABLE,"ASIS"] call BIS_fnc_ambientAnim;

indigo snow
#

you need quotes around LEAN_ON_TABLE

#

its supposed to be a string, not a variable

#

check the examples

astral tendon
#

fak

#

my "quotes" are not working in the editor

#

instead is doing this ~~

indigo snow
#

your keyboard might be in the wrong language mode for some wierd reason

astral tendon
#

it always does that

#

i need to restart the editor to come back

indigo snow
#

try pressing CTRL + SHIFT a few times and trying in between

#

its the hotkey to switch keyboard language mode iirc

astral tendon
#

can i change that?

#

maybe i am pressing that

indigo snow
#

otherwise dive into your windows settings i guess

#

might have two input languages set

astral tendon
#

well, my windows is set in english were originaly was brazilian portuguese

#

of couse, im using a south american like keyboard

indigo snow
#

Sure but that wont be meaningfully different from the other versions, right?

#

Saves you a command for direction, tho

astral tendon
#

do you guys know the resolution of the witeboard?

#

the prop we have in game?

astral tendon
#

actually it does not.

peak plover
#

How on earth do I check if player was run over by vehicle?

#

Nvm

#

I guess manual if work

tough abyss
#

maybe with epeContact EH

peak plover
#

using ace

#

ace_medical_lastDamageSource

subtle ore
#

What epeContactStart doesn't work with ACE?

river blade
#

@astral tendon its 2:1 so 1024x512

peak plover
#

@subtle ore it should, but I can just use lastdmgsource and do a couple of if and it'll be ok

#

Only issue is grenades

thorny monolith
#

I'm trying to get a globalChat message to be sent to all clients whenever a member of a group is killed. This is my code (in init.sqf):

    if (group _x == church) then {
      _x addMPEventHandler ["MPKilled", {
        [_x, format ["This is %1 at the church, does anyone hear this? Please, stop shooting us!"], (name _x)] remoteExec ["globalChat", -2];
        }];
    };
} forEach allUnits;```

The above works (with some modifications) with `hint` and even `systemChat` but I can't get `globalChat` to work. I've tried replacing the `_x` with `_this select 0` just before the `format` but to no avail. Where am I going wrong?
subtle ore
#

@peak plover meehhh, hardcoded stuff feels safer to use imo

peak plover
#

19:13:29 Script command setOwner cannot be used for object 'LOP_ChDKZ_BMP1'. Use setGroupOwner instead.

#

Hmm ๐Ÿค”

#

In theory setGroupOwner should not be used on vehicles

#

I do a check for isKindOf "CAManBase"

#

๐Ÿ™ƒ

little eagle
#

The point of that message is to tell you that you should use setGroupOwner on grouped units.

real tartan
#

is there some hidden animation for BobCat crane ?

#

lowering crane to de-mine minefields

subtle ore
#

@real tartan look at the animationSources entry in the bobcat config. You will find it all there

real tartan
#

if anyone will need it here it is

#

this animateSource ["movePlow",1]; // 0 to 1

subtle ore
#

Yep, you can do any value between 0 and 1. Ive made it go to 0.25 before and it works quite well. It's a phase

waxen cosmos
#

I'm really bashing my head against the wall, I cannot seem to get this exceptionally common command to work on my weapons shop; " [player, "Weapon_arifle_MX_F", 3] call BIS_fnc_addWeapon; " I really have no clue, I have used the old school addweapon individually etc any ideas?

indigo snow
#

yea that looks correct, but Id just use the normal commands personally

#

player addWeapon "Weapon_arifle_MX_F";

#

If that doesnt work theres a mistake somewhere else

thorny monolith
#

isn't it just arifle_MX_F?

indigo snow
#

that certainly looks like a better classname

waxen cosmos
#

I actually thought that but there classnames in 3den were listed as weapon_ ..will verify now.

indigo snow
#

the name in 3den isnt the actual weapon classname

#

(the one where you place it from the right hand menu)

#

thats actually a weapon holder object, that contains the weapon

copper raven
#
player addWeapon "arifle_MX_F";
waxen cosmos
#

Oh ok, I wouldn't of known that as usually don't pull them out of 3den. This is why you need another pair of eyes, thanks guys for such a silly error

copper raven
#

just cut the prefix, for vests its Vest_V , for backpacks its the same one tho

waxen cosmos
#

Noted - Any idea why BI did that in 3den?

indigo snow
#

because the thing you place in 3den is actually an object / vehicle

#

and actual weapons live in cfgWeapons and are only ever really strings

#

its to do with how the inventory system works

waxen cosmos
#

Cool, once again thanks for the help and quick response

thorny monolith
#

seeing as I helped solve a problem, anyone have an idea why I'm stuggling with my thing ๐Ÿ˜› ? (See 17:23 today)

indigo snow
#

_x doesnt exist within the {} of the event handler

waxen cosmos
#

^^

thorny monolith
#

just realised it won't be the same timestamp for everyone else... wish you could link to chat messages like in slack ๐Ÿคฆ

indigo snow
#

youll have to use the arguments in _this

#

or do a cheeky setvariable and access that

waxen cosmos
#

Just had the same issue when creating Kill Currency not 2 hours ago

thorny monolith
#

yeah i've tried them with the this select 0 as well:


format ["This is %1 at the church, does anyone hear this? Please, stop shooting us!", (name (_this select 0))] remoteExec ["systemChat", 0];

[(_this select 0), format ["This is %1 at the church, does anyone hear this? Please, stop shooting us!"], (name (_this select 0))] remoteExec ["sideChat", 0];

format ["This is %1 at the church, does anyone hear this? Please, stop shooting us!", (name (_this select 0))] remoteExec ["hint", 0];```

Of these, hint and systemchat work
indigo snow
#

probably the issue with the binary format for remoteExec, then

#

yea thats it

#

check the array of the first line

#

it has 3 elements

#

the format isnt parsed correctly

#
[
  (_this select 0), 
  format ["This is %1 at the church, does anyone hear this? Please, stop shooting us!", (name (_this select 0))]
] remoteExec ["globalChat", 0];```
#

^should work

thorny monolith
#

goddamit

#

it's always a bracket somewhere wrong....

indigo snow
#

(although you should properly aim it at -2 instead of 0, the server doesnt need chat)

thorny monolith
#

testing now

indigo snow
#

proper indentation management my dude

thorny monolith
#

yeah i started with -2 but switched to 0 in desparation

little eagle
#

You'll kill the server by asking it to display a chat message. /s

indigo snow
#

think of the wasted electrons

#

think green

thorny monolith
#

My server hates me so much it'd probably embrace the sweet release of death

little eagle
#

You probably waste more energy by putting either the 0 or the -2 there.

thorny monolith
#

@indigo snow works thanks for the help!

indigo snow
#

in the vein of modeltoworldworld we need a globalGlobalSay

little eagle
#

What for? You have remoteExec to do it.

#

That was the point.

#

Ah, fuck. Tired. Should be globalSayGlobal.

peak plover
#

Server does not die on chat message

little eagle
#

D-did you just try that or what?

peak plover
#

Shows up on display

#

No, I've got a debug message on there

#

*not display

#

The tiny window the server has (console) or whatever

#

Atleast on the hc.... My ai script has a constant systemChat

little eagle
#

I don't understand why people are so careful about putting the -2 in remoteExec for systemChat etc.

peak plover
#

Don't wanna put more pressure on the server ๐Ÿ˜„

#

100 broken scripts running on amd athlon 64 server, Don't wanna make it run any slower than it is

simple solstice
#

systemChat pressure.

#

lmao

peak plover
#

/jk

little eagle
#

That's the thing though. You probably create more work by specifying the -2

#

Instead of letting the systemChat or whatever just fail.

#

It's so little that it doesn't matter. Yet people go with the more complicated thing. It's really weird.

cedar kindle
#

well -2 would exclude a listen (player) server, so it shouldn't be done anyway. at least here

peak plover
#
[] spawn {
    if (!hasInterface) then {
        while {isNil "stop_loop"} do {
            systemChat "SPAM";
        };
    };
    if (hasInterface) then {
        sleep 1;
        missionNamespace setVariable ["stop_loop",true,true];
    };

};```
little eagle
#

Can't read, no indents.

#

else ?

peak plover
#

not the point

#

point is, systemchat kills server FPS

#

๐Ÿ˜‰

#

a while loop with systemchat turn server fps from 300 to 170

little eagle
#

The loop alone does, because it has no sleep. You could put any command there...

peak plover
#

๐Ÿ˜‚

#

๐Ÿ‘Œ๐Ÿฟ

little eagle
#

๐Ÿคฆ

peak plover
#

I'm sorry, having a bit of fun ๐Ÿ˜„

little eagle
#

300 server fps tho ๐Ÿ‘Œ

peak plover
#

Yoiu know it ๐Ÿ˜„

little eagle
#

This also confirms that using systemChat on the server makes you lose 130 server FPS!

peak plover
#

haha yes ๐Ÿ˜„

#

Put that on the wiki ๐Ÿ˜„

#

Nah jk, dont

little eagle
#

That's almost 3 servers per server.

peak plover
#

๐Ÿ˜‚

#

The unlocked server is prime for debugging script perf 'tho ๐Ÿ˜„

little eagle
#

Is that one dude on the bif thread still mad at dedmen for releasing this?

peak plover
#

Yeah I don't get that guy

peak plover
#

would side or side group _unit work with onKilled?

#

or does onkilled mean that it's already a civilian and not in the group anymore?

#

Or sideemtpy or sth

little eagle
#

side group should work

runic surge
#

it doesn't work for killed or mpkill event handlers

peak plover
#

w-wha?

#

What do I do now?

#

I know. I will set side on unit as a variable

#

on postInit

#

This way I will always have a side

runic surge
#

what I did since that wasn't possible because of locality was just get the side from the unit's configuration

#

only works if the unit is on it's original faction's side though

peak plover
#
_unit setVariable ["unit_score_side", (side group _unit),true];```
#

Ohh I got an issue...

#

Vehicles

#

Hard to keep a track of their side....

runic surge
#

use the config

peak plover
#

hmm

#

Could cause issues

runic surge
#

that is the only solution I can think of

peak plover
#

yeah, I guess fuck vehicles ๐Ÿ˜„

runic surge
#

vehicles would have to stay on their own sides

peak plover
#

Only scalps

little eagle
#

I am pretty sure the dead unit stays in it's group for a short while and you can use side group _unit just fine in a killed eventhandler.

peak plover
#

hmm, that might be true because, EH is unscheduled

runic surge
#

I had issues with that just the other day

#

would always return civilian

peak plover
#

okay, good, this way I won't have to! Thanks!

#

hmm, I'm having a brainfart

#

["CAManBase", "initPost", {_this call score_fnc_unitInit}] call CBA_fnc_addClassEventHandler;
#

global?

#

only on server?

#

local?

#

From What I read, "It's kinda like init box"

#

So global?

little eagle
#

The event will fire on every machine that the function was executed on.

peak plover
#

So If I run that on the server... it will run my function on all the clients as well?

#

For*

little eagle
#

No, because you only ran the function on the server, the event will only be executed on the server.

peak plover
#

I ment to say for. So when a player connects, and his unit is created, the initPost fires on the server and runs the function on the server?

little eagle
#

If AI is disabled then the unit is created on the server when the player picks that slot.

peak plover
#

Yes, agreed

little eagle
#

So as long as this function was executed on the server, the initPost event will be executed when the player picks that slot.

#

on the server.

peak plover
#

Gotcha, I'll put that line on the server,

  1. addClassEH
  2. unit/player object is created
  3. initPost EH runs on the code on the server

this way I'll just use MPKilled on server for keeping score

#

EH will still trigger globally only once.

#

I don't believe that

little eagle
#

Run it before the first objects are created.

peak plover
#

I've got the cba addClass in preinit

little eagle
#

Good.

peak plover
#

I've got 2 paths now.

  1. add a killed eh using remoteExec from server
  2. add a mpKilled (means it's added to everyone)
#

This feels so stupid ๐Ÿ˜„

little eagle
#

What are you trying to do?

peak plover
#

keep score

little eagle
#

Deaths or also who killed them?

peak plover
#

addScore, log teamkills, civilian kills

#

It's for CfgDebriefingSections

little eagle
#

Considered to use this?

addMissionEventHandler ["EntityKilled", {
    params ["_killed", "_killer", "_instigator"];
}];
peak plover
#

๐Ÿค”

#

That looks perfect

#

Still need to initpost the side... but that one will solve the killed eh

#

Thanks!

little eagle
#

I still don't believe that is necessary, but w/e.

peak plover
#

1 setVariable is the least of my worries...

waxen tide
#

can someone explain to me the main advantages for defining classes inside SQF? i find interaction with them still a bit awkward especially if they're extremely simple?

little eagle
#

There are no classes in SQF.

peak plover
#

.cpp?

waxen tide
#

looks at commy2, looking for the "elaborate" button

little eagle
#

You asked for classes in SQF, but there are none. There are people who would like to have them though for whatever reason.

peak plover
#

You can probably just use classes in your description.ext if mission making...

waxen tide
#

well i see missions where people define lots of classes in hpp files

#

i kinda get what they're doing

#

but not why

peak plover
#

What's the difference of cpp and hpp

waxen tide
#

one has a c, the other an h

peak plover
#

so... same?

waxen tide
#

who knows.

little eagle
#

.hpp is used as #include'd file for .cpp (or description.ext).

#

H for "header" I think.

peak plover
#
#define PLUGIN ace3
#include "..\..\..\engine\macros.cpp"
#include "..\settings.cpp"

oops

little eagle
#

It really doesn't matter how you name them.

peak plover
#
#include "settings.sqf"

lmao ๐Ÿ˜ฆ

little eagle
#

And people split their configs in multiple files so they don't get large and are easier to edit.

peak plover
#

I like using include for doing settings separately. So I only edit settings, everything else is static

little eagle
#

According to Github, the official โ„ข header file extension for sqf is .hqf

peak plover
#

๐Ÿ˜ฒ

#

Never heard of that one

little eagle
peak plover
#

๐Ÿ‘๐Ÿฟ

little eagle
runic surge
#

is there a way to allow the player to keep map control while a custom dialog is open?

little eagle
#

Not opening another dialog.

peak plover
#

cutRsc or createDisplay

little eagle
#

Yep.

runic surge
#

That works, thanks

subtle ore
#

@peak plover wtf, they have skin tones for different thumbs up? Lol.

peak plover
#

That's why discord is so populard

runic surge
#

when I open another display dialog from the original, is there a way to make it hide the previous dialog like it does when it's created with createDialog?

#

with createDisplay they simply stack on top of one another

little eagle
#

๐ŸŽ…๐Ÿฟ

runic surge
#

santa skintone 5 is exactly what I was looking for thanks

little eagle
#

yw

runic surge
#

thought it was skinetone 3 but I appear to have been incorrect

cloud thunder
#

My understanding for config files in mission are .h (stem from C language) and .hpp (stems from C++). Both could be used from the viewpoint of C++ since C headers are viewable through c++ so game must have C++ engine. Both are header files used to define classes. .cpp are config class definition files for mods wich have not yet been finalized-editable/still in developmant to bin format(binerized) .bin.

runic surge
#

nvm I forgot to change the actions for the dialogs in my new mission file

cloud thunder
#

so .h or .hpp is okay in mission (function the same way). Anyone ever use or tried .cpp in mission? I don't kow if that works.

little eagle
#

Missions use description.ext for their config and you can include everything you want. File extensions are just part of a filename.

runic surge
#

so you could do
#include config.cpp in description.ext with what is normally in description.ext and have an extra file for absolutely no reason?

cloud thunder
#

"Missions use description.ext" much like header files can include libraries in c++ , but can you define classes in any file type extention?

little eagle
#

Yes you could, Rylan. But you probably make things confusing by using this unrelated name in the "wrong" place.

#

but can you define classes in any file type extention?
You can include anything you want. Extensions are just part of a name...

#

I'd suggest using something that your favorite text editor understands as c++ and the code highlighting works properly. So .hpp

uneven prawn
#

Hi, does anyone know any server addon or mission file script that will warn players of incoming missles? All I found was this from someone's mission file with a initplayerlocal call https://pastebin.com/eZvrMQZH although seems like he has some serveside addon that has all the defines in it..

little eagle
#

This script works out of the box.

cloud thunder
#

this addEventHandler ["IncomingMissile", {hint "Incoming Missle"}];

runic surge
#

would copying and modifying the entire high command system to give more options for modification be a good idea?

cloud thunder
#

I would say only if you make good progress and added features, give it back to community and makeit better then any already outthere. Oh and don't get Diabetes i n the process because of it, then yes.

runic surge
#

I am not making it to release to the community as an alternative, but as a specialized version for a gamemode I am making

#

RTS functionality

cloud thunder
#

so private?

runic surge
#

No, just not to be used as a replacement

#

private would be lame

#

if it's public, people could make missions with it

#

which would be nice

cloud thunder
#

k best luck to you. stay healthy.

runic surge
#

also once this is done I will create a modified zeus that integrates with it as well

#

if I get that far

cloud thunder
#

anything already done or just conceptual atm?

runic surge
#

The basic mission framework is done.
You can collect resources, buy units or groups, supply drops, vehicle drops, manned vehicles, and command them around with high command. You can also remote control friendly units

#

Multiplayer compatible

#

but having modified high command for more direct and polished integration would make things much better

#

less confusing for players

#

my biggest issue right now is coming up with a mod name

#

ArmA-Time-Strategy?

#

ArTS for short

cloud thunder
#

knida sounds like warfare? how much to buy an AI person?

runic surge
#

varies depending on class

cloud thunder
#

high class then

runic surge
#

right now for vanilla NATO units, lowest is 50 and highest is 200

#

50 is for pilots and crew members, stuff like that, highest cost is for AT and AA specialists

peak plover
#

addMissionEventHandler

#

local?

still forum
#

I'm totally gonna start writing .hqf scripts ๐Ÿ˜„

peak plover
#

Number cannot accurately represent integers above 16777216 (2^24)

#

Does this mean distanceSqr is inaccurate AF?

still forum
#

if you go that high.. yes..

#

distance has the same issue. as it's just the sqrt of distanceSqr

#

taking the sqrt of a inaccurate number doesn't make it more accurate

peak plover
#

๐Ÿ˜‰

#

I'll just try using more inArea

still forum
#

distanceSqr will be 100% accurate for distances <4km... and being inaccurate doesn't mean it will be out by several hundred meters

peak plover
#

Yeah... I guess it's fine

#

btw @still forum does sqf [player, true] call TFAR_fnc_forceSpectator;
have to run in non-sched?

#

Either that or there's some other issue on my end

still forum
#

I remember.. I wanted to look by "Atom" crappy editor didn't want to open any file

#

Answer is. It doesn't matter.
All that function does is set 2 variables via setVariable

peak plover
#

Okay, so it's something on my end

peak plover
#

might be buggy in arma

#

Anyone ever use?

still forum
#

Yes.. Last time I used that over a year ago

#

but it worked

peak plover
#

Hmm, awesome

graceful saddle
#

It works

#

Last time I used it was like 2 months ago though

#

But it didn't cause me any problems

peak plover
#

Setting the civilian side to be the enemy of any other side will result in the other side attacking inanimate mission editor placed objects such as empty vehicles and static objects, since these objects belong to the civilian side.

#

I though that's what sideEmtpy is for

#
civilianUnit setFriend [west, 0];
#

Some kind of undocumented alternate syntax?

#

I kinda feel like the documentation for side stuff is outdated

still forum
#

Oh yeah.. it sounds like setFriend takes side or object as left argument

#

It doesn't though

#

maybe the game can automatically convert unit to side? That would be new to me

peak plover
#

๐Ÿค”

#

errors

neon snow
#

Hi, for some reason the line below does not work in my init.sqf, any help? :

#

if (isEngineOn _OK_F_35C) then {hint "on";};

little eagle
#

What are you trying to accomplish with that?

still forum
#

where is _OK_F_35C defined?

neon snow
#

@still forum above that I put _OK_F_35C = _this select 0;

still forum
#

init.sqf doesn't have _this

neon snow
#

so how does it work with any other scripts in that file? O.o

peak plover
#

do

systemChat str _OK_F_35C;
still forum
#

I don't know.

#

I can't see your script

little eagle
#

Oh boy.

neon snow
#

it is init.sqf for a vehicle

still forum
#

There is no such thing as "init.sqf for a vehicle" there is only one init.sqf and it is for a mission

little eagle
#

init.sqf is for a mission.

neon snow
#

ok, I know nothing now.

peak plover
#

init.sqf is AUTO loaded by mission

#

Name it something else

little eagle
#

If I don't know what to do, I usually think about:

What am I trying to accomplish with that?

peak plover
#

Or set a variable name to your plane and
_plane = myplanevar;

neon snow
#

I am trying to make a simple line that will activate when the engine of jet is on, then make a simple timer counting to 5 (using sleep or uisleep) after which MFDs will enable.

#

And return a value to config using setUserMFDValue

little eagle
#

Is this for a mod?

neon snow
#

as for the init.sqf itself, it is weird becouse this part of script work flawlesly :

#

_OK_F_35C = _this select 0;
i=1;
_OK_F_35C setUserMFDValue [0,1];
switch (toLower worldName) do {
case "stratis": {_OK_F_35C setUserMFDValue [1,1];};
case "altis": {_OK_F_35C setUserMFDValue [2,1];};
case "malden": {_OK_F_35C setUserMFDValue [3,1] };
case "tanoa": {_OK_F_35C setUserMFDValue [4,1] };
case "chernarus": {_OK_F_35C setUserMFDValue [5,1] };
case "takistan": {_OK_F_35C setUserMFDValue [6,1] };
case "utes": {_OK_F_35C setUserMFDValue [7,1];};
default {_OK_F_35C setUserMFDValue [49,1] };
};

little eagle
#

Is this for a mod??

neon snow
#

yes it is, doing it for F35E mod creator

little eagle
#

If you don't want to completely confuse everybody, then don't name the script init.sqf.

#

Also you need an engineOn eventhandler like dedmen posted.

neon snow
#

well, I didn't . This mod is based on the FC37 mod for arma, and it was named ike that from the begining.

peak plover
#

It's time to improve!

neon snow
#

Ok, so testing now. Thank you and sorry for misleading

little eagle
#

Your script doesn't work, because it's executed when the vehicle is spawned (presumably) and then the engine is always off.

neon snow
#

hmm that's why. Makes sense now

peak plover
#

Using publicVariable too frequently in a given period of time can cause other parts of the game to experience bandwidth problems.
How much is too much?

#

Using publicvariable onKilled might be bad, because if a car full of people blows up, it's probably gonna cause a lot of lag... right?

simple solstice
#

if the variable is small

#

then there isn't that much traffic

#

public variable was used for remotexec ;)

peak plover
#

It contains UID of every client + 5 integers

simple solstice
#

thing is.. why make it a public variable?

peak plover
#

maybe someone wants to know...you are probably correct

simple solstice
#

when someone is killed

peak plover
#

no one will need to know

#

score list

#

Probably I'll do a ended EH and just publish it then

#

Save some perf.

simple solstice
#

makes more sense

#

I don't think public variable is such a stresser as the wiki says.. same thing would then apply to JIP remoteexecs and setvariable

peak plover
#

Hmm

simple solstice
#

TFAR uses publicvariables every time the settings update IIRC

peak plover
#

I imagine a plane/heli with 10+ passengers crashing. I don't wanna cause extra stress ti the network, because that's already gonna cause a lot of stress on it

simple solstice
#

imagine people on an coop adjusting the radio settings.

#

and the array is large for it

peak plover
#

hmm

#

Yeh

simple solstice
#
ย "tf_rf7800str_21_settings" = [0,7,["211.3","191.3","323","371.3","165.6","254.5","471.3","67.7","445.5"],0,"",-1,0,"",false]
#

that's an example public variable

#

from tfar

still forum
#

It's not thaaat bad

#

main problem is JIP.. as when you join into the game you need to receive all variables that are set

little eagle
#

STRING =
๐Ÿค”

still forum
#

and when you start getting into the thousands that takes some time

peak plover
#

that's the recieveing data

#

right?

still forum
#

yes

#

you can "fix" that by setting unused pvar's to nil and then pvar'ing that nil

#

that essentially removes it from the queue

peak plover
#

unless you are sending functions with publicVar (some do) the amount of data for objects will probably be bigger

still forum
#

objects are basically just a netID

#

which is.. <10 bytes

peak plover
#

what aboud, inventory, health, pos, group, side?

still forum
#

what is "inventory"?

peak plover
#

items/weapons/clothes

still forum
#

health is a float.. 4 byte. pos is 3 floats. group is also a netID. side is one byte

#

how do you put items into a public variable?

peak plover
#

pos is a long ass float...

#

Well I assume the game transmits all the items when joining, I'm just saying, the amount of data the game has to transfer to clients joining, is probably bigger than the publicVars I have

still forum
#

probably

peak plover
#

Also all buildings that are changed.... there's so much

still forum
#

You don't need to care about that. until you get into the hundreds

peak plover
#

must be tons of data

#

good!

#

I only got like a few

still forum
#

I wonder what happens if you create like 5k PVAR's and then a JIP joins in

#

5k is probably not enough.. more like 50k

peak plover
#

I wonder, how much does traffic increase when publicvar a sentence in string every ms

#

Find out next time... on SCRIPTBUSTAS

#

I also wonder, if setting a numerial value to functions would give me any performance gains.

#

instead of my_fnc_longassname f1

#

or just 1

little oxide
#

@peak plover Have you already checked the "code opitmization" from BI ?

peak plover
#

Yeah

#

from 3 to 100 char it says double the perf.

little oxide
#

the names of the functions must have the smallest possible name

little eagle
#

Please keep it readable...

slender halo
#

reliability vs. performance

peak plover
#

mission_fnc_checkFile >> mission_fnc_1

#

I guess the function library should be off the table then

#

mission_fnc_checkFile >> f1

#

Maybe i'll put in 2nd number for folder

#

same with variables

#

unit_score_side>>u61

little oxide
#

Dude like Commy said before, this change is not going to do a double performance, and keep your code readable

#

and will don't keep your code readable *

peak plover
#

I can make a printable .pdf dictionary for the code

#

๐Ÿ˜‚

little oxide
#

Optimisation is everything when running lots of instances, with low delays. However, there is such thing as premature optimisation. Also, avoid excessive cleverness.

slender halo
#

i always overtag my global vars :

SP_fnc_brush_init
SP_fnc_surfacePainter_paint
Z_var_areaRadius
Z_obj_vip
peak plover
#

good point

#

z means global?

little oxide
#

When you look at xcam code

slender halo
#

zgmrvn

little oxide
#

Just look at xcam code, and you will se what happens when you don't do any comments or other things in your code xD

#

To be more clean

#

Idk, how he can edit his code

peak plover
#

Genius like mozard

slender halo
#

^^

little oxide
#

I am very grateful for the work that Silola did for xCam, but when you want to look at its code, it is impossible to read it

#

For me,When you creating some code for community, you need to keep your code readable, if you create code for yourself, you can make it unreadable if you want.

peak plover
#

I wis I could do something cool like that

little eagle
#

xcam on github?

halcyon crypt
#

since xcam code isn't public it's very much possible that they have comments and what not stripped from the builds

#

to save space I guess

peak plover
#

yes

halcyon crypt
#

(which probably doesn't save much but whatever ^^)

astral tendon
#

you guys know a way to forbide weapons to have certain sights in arsenal?

little oxide
#

it would be nice if Silola posts its code to the public after 1 year has been inactive the community could fix the problems by making a pull request on the github

#

But I heard that he was going to resume service by posting a fix, which is not bad

slender halo
#

@astral tendon BIS_fnc_addVirtualItemCargo look for these functions

astral tendon
#

those just add the weapon to the virtual box, nothing about forbide a weapon to have a especific modification

#

for example, in the same box there is a sniper and a normal rifle

#

i dont wanna the rifle to be able to have sniper sights

little eagle
#

You have to add all that you want. There is no way to remove ones.

slender halo
#

i think you'll have to check for the dialog to be closed then check for player's gear

astral tendon
#

nevermind

slender halo
#

since arsenal doesn't trigger take event

tough girder
#

Arsenal has a scriptedEvent "ArsenalClosed"

slender halo
#

wow, nice

slender halo
#

didn't know about that one

astral tendon
#

why does the BRIEFING_POINT_RIGHT does not point at anything?

#

the full command is [this,"BRIEFING_POINT_RIGHT","ASIS"] call BIS_fnc_ambientAnim;

slender halo
#

maybe there is a weapon property in the config that'd let you know what kind of primary weapon it is

astral tendon
#

does the stop false; work for groups

#

or it have to be for especific units?

little eagle
astral tendon
#

groups are not consider units?

little eagle
#

No, groups are groups and units are units.

astral tendon
#

i wanna put enableSimulation false as a temporary server boost perfomacy

#

becasue there is some situations in my scenario that there is allot of enemys

#

does disabaling the simulation increse the perfomacy?

still forum
#

performance* disabling*
yes.

astral tendon
#

thats good to know

#

there is some situations were the enemy still far and there will be no combat

#

so i think is not nessesary they be enabled

waxen tide
#

@astral tendon why do you spawn the enemies in the first place? you have to trigger their simulation to be enabled when players are close enough for contact, then you can spawn them with the same exact trigger, too

astral tendon
#

because they are in especific places

#

were the convoy will try to escape under fire

zenith jay
#

is there a script where in game you press like ctrl + b and it opens up some kind of gui that you can select like f 18s to spawn every 5 minutes
like how MCC you can spawn vehicles and a.i vehicles in but only one every 30 seconds manually

little eagle
#

There could be.

slender halo
#

@astral tendon why not simply put them in 3DEN and enable dynamic simulation in the group options ? to many locations ?

astral tendon
#

YES

#

and many of they are doing especific stuff

#

that require they to not be in the same group or their AI will fart

slender halo
#

i'd still give a try to dynamic simulation

#

with dynamic spawn comes micro-freezes when unit's gears are read on disc

peak plover
#

wrong...

#

dynamic simulation has no stuttering

#
[] spawn { 
 { 
  if (!isPlayer _x) then { 
   _x enableSimulationGlobal false; 
  }; 
  true 
 } count allUnits; 
 sleep 5; 
 { 
  if (!isPlayer _x) then { 
   _x enableSimulationGlobal true; 
  }; 
  true 
 } count allUnits; 

#

Just freeze everything

slender halo
#

yep, i was talking about scripted ia spawn for suttering

#

what about enableDynamicSimulation ?

peak plover
#

aa dynamic spawn not simulation

#

yes

#

createVehicle / createUnit can cause stuttering

#

but

#

I feel like performance gains are worth stuttering on clients without SSDs

delicate lotus
#

Is there a simple way or method to check / waitUntil a player is in the game like no loading screen, no briefing screen, just when he is able to see the world?

peak plover
#

yeah

delicate lotus
#

And would I do that?

peak plover
#

sleep 1;
//

#

Also

delicate lotus
#

no... I dont want to sleep the script.

peak plover
#

findDisplay

delicate lotus
#

I want to check if the player is able to see the world aka no loading screen and no briefing screen

little eagle
#

People keep asking for this and idk why.

still forum
#

findDisplay. Search for loading/briefing screen. If not there then he is probably in mission

delicate lotus
#

Thanks

#

@little eagle mmh maybe because of intro stuff? Or Ares Custom Module Inits?

little eagle
#

Why not use sleep then? The mission is frozen until the briefing is ended by the host.

#

waitUntil {time > 0}
if you really really want, although there is no diff.

delicate lotus
#

oh okay...

peak plover
#

waitUntil also requires suspensions

#

for loop with exitwith if you want to avoid suspensions... But that would acuse even more issues...

#

As in it would not load, because it's busy looping

#
private ["_westScores","_eastScores","_guerScores","_civScores"];
{
    (call compile format ["_%1Scores",toLower(str _x)]) = _scores select {(_x param [2,""]) isEqualTo _x};
}count [west,east,resistance,civilian];
delicate lotus
#

yeah I already had a problem with a never ending briefing screen.

peak plover
#

Goddamn, this feels so wrong

little eagle
#

wtf is that?

peak plover
#

I'm hoping it gives values to the privated local variables

#

I'm guessing I'm wrong

little eagle
#

I have no idea what that is.

peak plover
#
_x = west;
(call compile format ["_%1Scores",toLower(str _x)]) 
// _westScores```
still forum
#

you have to private the variables outside of the loop.. If you do that it should work

little eagle
#

No, assignment doesn't work like this.

still forum
#

wait

#

no. you have to put the = inside the compiled string

peak plover
#

Ok, I've got a new idea. I can scratch that one I guess...

little eagle
#

_scores params ["_westScores","_eastScores","_guerScores","_civScores"];

#

???

peak plover
#

_unitScore = [_uid,_name,_side,[
    (_kills + _newKills),
    (_teamKills + _newTeamKills),
    (_civKills + _newCivKills),
    (_deaths + _newDeaths)
]];

// Update the scoreList
_scoreList pushBack _unitScore;
#

_scoreList == _scores

#

Instead of old approach

#

I will just _totalScores + _x

#

Context: persistant custom score. Making the ending screen right now

delicate lotus
#

well commy2, your time > 0 works, but apparently the game thinks I already am in the game while I still get a second loading screen...

peak plover
#

Time is synced from server before the loading screen ends

delicate lotus
#

...

#

why is there so simple BIS_fnc_finishedLoading or BIS_fnc_canSeeWorld function...

little eagle
#

Make one.

delicate lotus
#

I dont have access to the engine

#

also im too lazy

peak plover
#

just sleep

#

๐Ÿ’ช๐Ÿฟ ๐Ÿ˜ด๐Ÿ‘Œ๐Ÿฟ

still forum
#

BIS_fnc is not engine stuff

#

and you could make one for CBA

delicate lotus
#

well when I use sleep, it sleeps for the time I supply it with.

#

but the time the second / third loading screen takes it always a little different

still forum
#

Use my solution

#

detect if loading screen is open.

#

That way you can know if loading screen is open..

delicate lotus
#

yeah... just gotta find out which display the loading screen is

#

actually, I have also another question, why does my map change its name to UNAMED MISSION in the second and third loading screen?

peak plover
#

101

still forum
#

Because that's the default. And no one is telling the loading screen to do that

peak plover
#

102, 103,105

delicate lotus
#

thanks nigel

#

@still forum anyway to solve that? I saw that BI Maps dont have that issue

still forum
#

There is probably a way

slender halo
#

when you say map, you mean mission ?

#

are your sqm binarized ?

tame portal
#

@peak plover I'd avoid call compile and rather use getVariable, the only bad thing about is that you would need to make the variable public

peak plover
#

global not public

#

I've altered my whole script to remvove that now

#

It seems to be a bad way

tame portal
#

What's with the need to correct me if you know what I mean

peak plover
#

Sorry, didn't mean to come off like that...

tame portal
#

Like some people casually drop stuff like this in

#

I know some people mean well so people that don't necessarily know what it means understand it or don't get wrong terms into their mouth, but jesus it happens so often

#

It's like I say public instead of global and 20 people get triggered over it ๐Ÿ˜„

peak plover
#

Yeah, I get you ๐Ÿ˜„ It's like OCD ๐Ÿ™ƒ

delicate lotus
#

@slender halo no...

#

its not binarized

cedar kindle
#

it's quite a big difference so depending on context it's pretty important ๐Ÿ˜†

slender halo
#

@delicate lotus there is an issue with displayed mission name when "too heavy" sqm are not binarzed

delicate lotus
#

ah okay

slender halo
little eagle
#

Hmm, figuring out when the loading screen is gone is pretty annoying. The display is created before preInit, at least in the editor, and that means that no loop or mission namespace variable survives into the mission.

slender halo
#

BIS_fnc_recompile is a lie

waxen tide
#

@slender halo you need to enable it in the init or description.ext (forgot which one) it says how in the biki page to the fnc

subtle ore
#

allowFunctionsRecompile ? @waxen tide

slender halo
#

actually BIS_fnc_recompile is ok...

subtle ore
#

I mean. Really not all that safe whilst running a game

pulsar anchor
#

Alrigth Math folks ๐Ÿ˜‰ I ve got myself a new vector challenge, but I am failing again... I want to create a sphere.

if !(isNil "objs")then{
    {deleteVehicle _x}forEach objs;
};
objs = [];
_radius = 50;
_tiles = 20;
_pos = getposasl player vectoradd [0,0,200];


for "_j" from 1 to 360 step 360/_tiles do
{
    for "_i" from 1 to 360 step 360/_tiles do
    {
        _t = "Land_VR_Block_02_F" createVehicle [0,0,0];
        _npos = (_pos vectoradd [(sin _i)*_radius*(sin _j),(cos _i)*_radius*(sin _j),(cos _j)*_radius]);
        _t setposasl _npos;
        _up = vectorNormalized (_pos vectorDiff _npos);
        _t setVectorUp _up;
        _dir = _up vectorCrossProduct [0,0,1];
        _t setVectorDir _dir;

        objs pushBack _t;
    };
};

https://i.imgur.com/Cm6BwLi.jpg

#

As you can see one half looks wrong.

subtle ore
#

Sorry, not an answer. But holy shit lol

#

Looks freaking cool

little eagle
#

Didn't we do this already?

pulsar anchor
#

not exactly

#

_obj setVectordir (_n vectorCrossProduct [0,0,1])vectorCrossProduct _n;

little eagle
#

isn't that just [0,0,1] again?

pulsar anchor
#

no

little eagle
#

๐Ÿค”

#

It's missing a pair of parenthesis. Or the closing one has to be moved.

#

_obj setVectordir (_n vectorCrossProduct [0,0,1])

#

nil

#

nil vectorCrossProduct _n; <<<< does nothing

#
_obj setVectordir (_n vectorCrossProduct [0,0,1] vectorCrossProduct _n);
#

This is what you might've meant.

#

But again, this is just [0,0,1]

slender halo
#

why do you use vectors instead of setPitchBank ?

little eagle
#

BIS_fnc_setPitchBank is relative to the object and not relative to the world axis.

polar folio
#

how do you disable sat texture on a map control? i saw the answer somewhere the other day but couldn't find it again

little eagle
#

Didn't AGM do this? I think lot's of config.

polar folio
#

damn. i could swear i saw a two liner somewhere that did it. might've been a wet dream though

little eagle
#

hmm, idk

polar folio
#

follow up. can you fade out the whole map control with some hack? or is it too hardcoded for that with all the special icons and shit

#

?

little eagle
#

ctrlShow false ?

#

You can't move map controls, but you can hide them

polar folio
#

i mean fade though

little eagle
#

Idk, the command is ctrlSetFade, ctrlCommit

polar folio
#

yea not working. but thx

peak plover
#

class RscMapControl;
class RscDisplayMainMap
{
    class controlsBackground
    {
        class CA_Map: RscMapControl
        {
            maxSatelliteAlpha=0;
            sizeExLevel=0.029999999;
        };
    };
};

```?
polar folio
#

yea might've been config only. damn

#

basically i have a respawn menu for a aas pvp mode and i have a satellite camera i have teh map overlayed on. would be cool to fade from map to 3d smoothly. but i guess not in this engine lol

peak plover
#

ehmm

#

Can't you make a rsc with the map and try that?

#

That sounds prettty cool

polar folio
#

how do you mean? i was thinking maybe one could make the map control child to another and fade the parent but i haven't looked deep into the config part anymore since ctrlCreate got added. so liberating to not have to use configs for ui

peak plover
#

yeah a map control, but as a resource, so it's like a hud element

#

fade it

#

Ohh yeah

#

that's still a class 'tho

#

But does not have to be a mod

polar folio
#

oh dude. that's a good idea

#

do you happen to have a config example so my lazy ass only has to change stuff to my liking?

little eagle
#

You can create your own control base classes that you use with ctrlCreate. No reason to limit yourself to script only. Many things can only be done with config.

peak plover
#

I find the best to make a couple of template configs and then a few functions to work with those. So if need comes, extra functions/classes can be added, but it's also fast after it's setup

polar folio
#

i know commy but i try to avoid it when i can. i've done it with configs in the past. just prefer it on the fly

tough abyss
#

@peak plover what is sizeExLevel=0.029999999; for?

#

ah found the answer in your pastebin, thanks ๐Ÿ˜„

little eagle
#

Too stingy for 0.03.

sick drum
#

I don't know how to explain this, Can I add two Scripts In the same trigger example.

!alive "name" && !alive "name"] {alive _x} count (units "name"1 + units "name"2) == 0

Something like that

halcyon crypt
#

you can separate lines of code with a semicolon ;

sick drum
#

So like !alive "name" && !alive "name"; {alive _x} count (units "name"1 + units "name"2) == 0

halcyon crypt
#

yes but it kinda depends on the field you're testing

#

I guess it's the condition field?

sick drum
#

yes

still forum
#

You want to check if the first AND the second condition are true?

sick drum
#

I'm having it so you have to kill all the enemies but I don't want all the enemies to be in groups

halcyon crypt
#
!alive "name" && !alive "name" && ({alive _x} count (units "name"1 + units "name"2) == 0)
still forum
#

that's what && is for.

halcyon crypt
#

something like that

sick drum
#

Okay I'll test it out thanks

indigo snow
#

alive STRING ๐Ÿค”

subtle ore
#

๐Ÿค”

sick drum
#

๐Ÿค”

indigo snow
#

good thinking folks, well solve the case soon

subtle ore
#

๐Ÿ˜‚

sick drum
#

๐Ÿ˜‚

subtle ore
#

Oh, i know. I've got this crazy idea guys

#

Whatif

#

We

#

Put a unit

#

Instead of a string?

sick drum
#

Right because I was about to put a noodle string in the game instead of an unit

subtle ore
#

Noodle strings are good too

sick drum
#

๐Ÿ’ฏ

quasi rover
#

How do I get the number of "House" within given distance at nameCity Location? for example, "La Pessagne" on Malden map.

_nearestCity = nearestLocation [ getPos player, "nameCity"];    //e.g. "La Pessagne" on Malden map
_centerPos = locationPosition _nearestCity;    //[3115.53,6330.82,-224.34]
_nearbuilds = _centerPos nearObjects ["House", 100];    // count _nearbuilds get zero

count _nearbuilds get 0 value. because "La Pessagne" is located at high altitute.(224m)

indigo snow
#

you need to convert from the locationPosition, which is apperently underground?, to AGL coordinates

#

try to do a _centerPos resize 2; before the nearObjects check?

#

the negative Z value is really confusing though

#

might also need a nearestTerrainObjects vs nearObjects

quasi rover
#

thx @indigo snow ๐Ÿ˜€

little eagle
#

alive STRING

#

๐Ÿค”

peak plover
#

๐Ÿ™ƒ๐Ÿ‘๐Ÿฟ

little eagle
#

Dumb discord doesn't update messages after you resume from standby mode. Great that using the ๐Ÿค” emoji the way I do caught on though.

peak plover
#

Yes

indigo snow
#

it was a homage

little eagle
#

Is it an homage? The "h" is silent, no?

indigo snow
#

well that entirely depends on how you pronounce homage

#

i did debate it for a bit, to be honest

little eagle
#

honest ๐Ÿ˜ฌ

waxen tide
#

pinches his nose with two fingers, and says " 'omage "

tame portal
#

Lease top alking ike his

rose hatch
#

Erm... Error publicvariable: Type Array, expected String

#

I thought publicVariable supported arrays?

little eagle
#

No, what made you think that?

rose hatch
little eagle
#

This what they mean:

#
myVar_anArray = [1,2,3];
publicVariable "myVar_anArray";
rose hatch
#

Ahh, makes sense

little eagle
#
myVar_aSide = west;
publicVariable "myVar_aSide";

^ This for example fails.

queen cargo
#

best use setVariable instead @rose hatch
missionNamespace setVariable ["myVar_anArray", [1, 2, 3], true]

little eagle
#

Yeah, it saves a line. And ink is expensive.

rose hatch
#

Better use as in vast optimization benefit?

little eagle
#

vast

rose hatch
#

Neato, thanks for the tip

little eagle
#

lol

rose hatch
#

Final result (more or less):

waitUntil {time > 1};
specialAccessUIDs = ServersideAdmins; //defined on init by server mod
missionNamespace setVariable ["specialAccessUIDs", specialAccessUIDs, true]; //defined in mission script(s)

This way I can define specialAccessUIDs in the script should I ever want to disable the servermod.

little eagle
#

You need to set that public flag to emulate publicVariable.

rose hatch
#

oh yeah, missed that

little eagle
#

That does nothing ๐Ÿคฆ

#

You accomplish nothing with this. Setting the final flag achieves nothing.

brazen sparrow
#

please explain your reasoning behind this?

#

an antivirus doesnt stop all potention threats, i still use one lol

#

compilefinal wont stop all hackers but id prefer to use it than not

tough abyss
#

If someone finds away to inject sqf code via editor before joining a server (which has happened before afew times).
CompileFinal functions / important variables, will limit what they can mess with.
Its just a tiny extra layer of security, not much but better than nothing.

#

The only downside to compileFinal that array, it will prevent you changing the array on the fly.

little eagle
#

Great. By now putting the uids into a function you made it possible to have a script that runs before this variable is synched that itself uses compileFinal.

tough abyss
#

If your paranoid you can get the client to check if variable isnil before it compilefinals..
Or get the client to sent the variable to server etc
Or you could randomize the variable name etc
There are afew different methods to be annoying

All better than just assuming client will override the admin variable.
Nothing is foolproof, its all about just making it slightly harder

#

Plus its minimal work to use compileFinal vs compile vs an array

little eagle
#

There was no compile before.

#

I didn't even know this was about admin rights, but I guess it makes sense looking at the variable name.

#

A function is even easier to fake, thanks to compileFinal ironically.

#

If you don't mind the RPT spam, you could just try to overwrite it and have it backuped in another variable.

astral tendon
#

guys

#

i maded a scenario with this

#

the server also needs to be subbed to it?

#

to work right?

#

Because in the serve that i was testing, the AI were doing randown stuff

subtle ore
#

No @astral tendon

astral tendon
#

becasue, when i was tring to play, the AI were being soo random

subtle ore
#

the mods and the ai aren't related at all

#

if the AI were dependent on something you wouldn't be able to play the mission without it

astral tendon
#

what else it could be?

subtle ore
#

The way you have your AI setup?

#

from skill range

#

rules of engagement

#

combat mode

astral tendon
#

they have verry especific setups

subtle ore
#

Okay? I'm not concerned as to how you set your AI up.

#

the concern is if they are acting like dumbasses then you likely either don't have them tasked to do anything

#

or you haven't set up their skill range high enough

astral tendon
#

i mean, i need they o run exacly what i need

#

the strange thing is

subtle ore
#

Come on dude ๐Ÿคฆ

astral tendon
#

if i play in SP they run just fine

#

but when i play in the server, they are acting strange

subtle ore
#

Configure your server skills settings!

astral tendon
#

like, i made a trigger to give a doMove to a AI

#

step on it in SP is fine

subtle ore
#

Especially if you are hosting on a listen server

astral tendon
#

in MP they dont move

subtle ore
#

Can you please post the trigger condt, act, and deact here?

astral tendon
#

i cant because i am not in my computer right now

subtle ore
#

Well, there isn't much you can do then. Because explaining that they "just don't move" or that they "work fine in sp" doesn't mean a whole lot. I recommend once again, you go and configure your skills settings in your game options

astral tendon
#

so that affect their behavio?

#

what exactly is the optiom?

astral tendon
#

what level i have to put they?

astral tendon
#

if so, how can i lock those dificuty sethings and override any server setings?

runic surge
#

are you having a stroke

astral tendon
#

My english machine broke

tulip cloud
#

In a multiplayer match, If I want each team leader to have a variable passed to the server and have the server add them together. What is the most efficient way for the server to only get the variable from team leaders and not every player?

indigo snow
#

teamLeader_1 setVariable ["my_variable",2600,true]; on the client, getVariable on the server

tulip cloud
#

Basically, if a player is a group leader they are defined a variable. Simple

astral tendon
#

"returns -1 if difficulty is not forced and it's used one from player's options"

#

How do you actually force it on your mission?

simple solstice
#

using server.cfg

astral tendon
#

so i just make a server.cfg inside my mission?

still forum
#

No. server.cfg as in server cfg. as in server config. as in not-mission

little eagle
#

crazy

astral tendon
#

So there is no way to force a Difficulty to my mission?

tough abyss
#

Yes there is.

#

But you will have to iteratively search every single unit and their vehicles to do it.

little eagle
#

There is?

astral tendon
#

Midnight said above about set the skill seting

#

basicly, the AI farts and start to do wathever

#

when i test the mission on the editor it all works fine, but when my friend set a server to we play the AI became randon

#

and my mission is heavly AI dependent

#

they drive and also activate triggers

#

and i and my friend have diferent dificulty setings that maybe is causing the problem

#

all the commands related to this like difficulty, missionDifficulty, difficultyOption and difficultyEnabled do only return values and there is no way to change it.

little eagle
#

Yes, there is no way to change the difficulty with script commands.

astral tendon
#

i tink o got other way around

#

maybe i can make the mission fail with the difficulty

#

and give a erro message

tough abyss
#

I thought you could use


setSkill 
``` ?
astral tendon
#

does it get reset by the server?

tough abyss
#

Not as far as I know

#

as long as you spawned them?

#

@little eagle Can CBA block diag_log from working?

little eagle
#

No.

#

How? And why??

tough abyss
#

Strange problem diag_log not displaying anything.

#

Do I have to format ["%1"]; ?

little eagle
#

diag_log _undefined
never printed anything

#

Because every command with nil on either side as argument fails.

#

diag_log [_undefined]
is the work around (in unscheduled environment)

tough abyss
#

The script being run is the simple IED script.

#

The RPT just stops displaying.

#

Even executed from console...

little eagle
#

Post it?

still forum
little eagle
#

Is nothing some kind of thing? ๐Ÿค”

tough abyss
#

I gave it diag_log 'test';

#

nvm now it's going to work...

little eagle
#

I bet there's a script error somewhere.

tough abyss
#

Odd, stuff in this mission must be playing catchup.

#

I reloaded the mission a few times but this script is running scheduled

#

I should get some kind of error.

little eagle
#

he

tough abyss
#

Yep

pulsar anchor
#

I managed to solve my sphere question from yesterday:

if !(isNil "objs")then{
    {deleteVehicle _x}forEach objs;
};
objs = [];
_radius = 50;
_tiles = 20;
_pos = getposasl player vectoradd [0,0,200];

for "_j" from 1 to 360 step 360/_tiles do
{
    for "_i" from 1 to 360 step 360/_tiles do
    {
        _t = "Land_VR_Block_02_F" createVehicle [0,0,0];
        _npos = (_pos vectoradd [(sin _i)*_radius*(sin _j),(cos _i)*_radius*(sin _j),(cos _j)*_radius]);
        _t setposasl _npos;
        _dir = (_pos vectorDiff _npos);
        _t setVectorDirAndUp [(_dir vectorCrossProduct [0,0,-1]) vectorCrossProduct _dir,[0,0,1]];
        objs pushBack _t;
    };
};
little eagle
#

nice

tough abyss
#

@little eagle Is it a bad idea to add a lot of commands within a forEach loop?

little eagle
#

No?

still forum
#

It is equally as bad as putting a lot of commands in a script

scarlet spoke
#

*as bad as putting "a lot of commands" times the looping count in a script

tough abyss
#
_ieds = [];
_iedArea = (getMarkerSize _x) select 0;
_iedRoadsPos = (getMarkerPos _x);
_iedRoads = _iedRoadsPos nearRoads _iedArea;
waitUntil {_iedRoads isEqualType []};
#

Along with a bunch of other code.

#

The post is too big.

little eagle
#

That's nothing.

tough abyss
#

But nearRoads keeps returning nothing.

#

Throws an assignment error

#

when iedRoads = nearRoads.

#

At mission start it throws an error

#

Still not sure why tried waiting till it actually equals to []

scarlet spoke
#
_iedRoads = _iedRoadsPos nearRoads _iedArea;
waitUntil {_iedRoads isEqualType []};

That code doesn't make sense (the waitUntil part)
Either _ieRoads is of type array and the waitUntil won't wait at all or it isn't and waitUntil will wait forever

tough abyss
#

iedRoads returns an array

#

iedArea refers to the area in that pos.

#

The area is derived from a marker.

#

This is someone elses script. There was a number of errors and bugs that needed fixing.

still forum
#

your waitUntil {_iedRoads isEqualType []}; doesn't do anything (Which was already said.. But I wrote this before reading the other messages ^^)

tough abyss
little eagle
#

Yeah, that will forever be the same. Either wait forever or just pass through.

tough abyss
#

So what can I do?

#

To verify the array actually exists?

#

So it doesn't spam 20 entries of RPT spam

scarlet spoke
#
if(_ieRoads isEqualTo []) then{
    hint "failed"
} else {
    //perform code
}```
still forum
#

What is going on with that indentation ๐Ÿ˜ฎ

tough abyss
#

Should have seen it before.

scarlet spoke
#

Yep just noticed myself xD

tough abyss
#

It was all concatenated on one line.

still forum
#

Ewww

tough abyss
#

Yeah I know.

#

It was a mess.

peak plover
#

I've recieved a nearly lethal dose of eyecancer ๐Ÿ˜ฆ

still forum
#

sounds like something a certain youtuber would do to "improve performance"

peak plover
#

pls elaborate

still forum
#

But that script is probably not from him. the variable names are too long

#

There is a quite popular youtuber that has videos on SQF optimization..
Stuff like "make variable names as short as possible. Less than 5 characters atleast!" and "remove all whitespace"

tough abyss
#

The naming is mine

#

I re-wrote the naming to actually make sense.

peak plover
#

"remove all whitespaces" what is he racist?

tough abyss
#

Before it was uninformative names like _junk

#

or _jnkR

still forum
#

That sounds more like him

scarlet spoke
#

Well in theory you reduce the amount of characters the lexer has to go through...