#arma3_scripting

1 messages ยท Page 307 of 1

jade abyss
#

uisleep > sleep

jovial ivy
#

Is there a difference?

jade abyss
#

Thats for you to find out.

little eagle
#

Not in MP

jade abyss
#

Of course in mp

little eagle
#

See? Dscha is "only" an Expert

jade abyss
#

You go back to your Macros commy, sush! I go back to my corner.

#

โ˜

little eagle
#

Quiksilver too is only an expert.

jade abyss
#

๐Ÿคฆ

jovial ivy
#

Wateryer? Seems legit to me.

jade abyss
#

You see, we are a big Family here.

#

Everyone hates everyone.

#

from the bottom of their buttocks.

little eagle
#

diag_tickTime is a really bad idea when you want to make your missions work in savegames

jade abyss
#

who the f is talking about savegames

#

Is SP still a thing?

little eagle
#

uiSleep still pauses when you don't use -noPause, QS.

jade abyss
#

I thought that time ended, when ISDN was introduced.

#

It takes Systemtime oO

#

So it shouldn't pause

#

gonna start arma

little eagle
#

uiSleep doesn't use system time. Ask dedmen which checked the source code.

jade abyss
#

uiSleep is basically using the system time (uiTime more specifically) and not simulation time

little eagle
#

uiSleep is the same as simulation time of sleep, but ignores pausing the game with ESC menu in SP and setACCTime.

#

The wiki is obviously wrong.

jade abyss
#

Then its time to edit the Wiki Page

little eagle
#

diag_tickTime does use the clock, but uiSleep doesn't

jovial ivy
#

I tab out 24/7. Mostly for finding missed ; ๐Ÿ˜›

little eagle
#

Yes, because simulation stops when you tab out without -noPause

#

See what you started, DylanSMR?

jovial ivy
#

๐Ÿ˜„

little eagle
#

You don't like QS?

jovial ivy
#

Who?

little eagle
#

I think it's a cute nickname.

#

QS

jade abyss
#

Wrong Commy

#

You were wrong

#

uiSleep executed when tabbed out.

#
[] spawn
{
    systemchat str diag_TickTime;
    sleep 5;
    systemchat str diag_TickTime;
    uisleep 5;
    systemchat str diag_TickTime;
};```
jovial ivy
#

Would make sense @tough abyss My variables tags are dy ๐Ÿ˜ƒ

jade abyss
#

Oh and yes: noPause is not enabled

jovial ivy
#

Thats my standard quality arma terrain.

jade abyss
#

Its a Prototype/Testterrain, so i don't give a fkn damn ๐Ÿ˜‰

still forum
#

Yeah.. uiSleep continues running when tabbed out without -noPause. I think. diag_tickTime is using systemTime btw

jade abyss
#

told ya ยฏ_(ใƒ„)_/ยฏ

#

ScrollMenu?

#

ingameUIEventhandlerthingy

#

inGameUISetEventHandler ["Action", "systemchat str _this"]; <--

#

prev next

#

or so

#

not my prob, you just asked for beeing opened ยฏ_(ใƒ„)_/ยฏ

#

๐Ÿ˜„

jovial ivy
#

@tough abyss As in the actual scroll menu? With switch weapon, etc, and not just a single action.

jade abyss
#

that overly outdated piece of OperationFlashpoint

#

"familiar" - like in "Oh god, our alcoholic, debile and incontinent uncle comes to my birthday party - and i am 14"

jovial ivy
#

Hmm, maybe the scroll menu has a dialog number?

#

Hmmm ok.

jovial ivy
#
                _hintData = missionnamespace getvariable ["BIS_fnc_advHint_hint",[localize "STR_A3_CFGMPGAMETYPES_UNKNOWN_SHORTCUT_0"]];
                _hintClass = _hintData select 0;
                ["Hint '%3' is too long (%1, shouldn't exceed %2)",_height,_heightLimit,_hintClass] call bis_fnc_error;
            };``` good to know they implented a hint too long feature ๐Ÿ˜›
jovial ivy
#

@tough abyss This is what that variable returns _text = str(uinamespace getVariable "igui_displays"); http://prnt.sc/ete1lc

night minnow
#

I notice that there is no button to click ok to ignore??

vapid frigate
#

the error means the config entry is missing

night minnow
#

what config entry?

vapid frigate
#

needs configFile >> RscMainDisplay >> controls >> TitleSinglePlayer >> TextureNoShortcut to = a string

night minnow
#

humm, let me dig around more then....

little eagle
#

It doesn't mean at all that a string is missing. I think the error simply is wrong inheritance.

#

Updating base class ....

vapid frigate
#

doesn't mean a string is missing specifically, but means that value doesn't exist

#

and in this case textureNoShortcut should be a string

#

could be inheritance or just left out

little eagle
#

If you just say "there is a string value missing" then that implies a way to resolve the problem and I don't think that implied way is any good in the long term.

#

"Couldn't find the value". That sounds better.

vapid frigate
#

yeah true.. something like the error means the config entry is missing ๐Ÿ˜ƒ

little eagle
#

If you say so. Manually adding one still is a bad idea.

vapid frigate
#

i didn't suggest doing that

#

but ty for linting me

little eagle
#

Didn't mean to. ๐Ÿ˜ฆ

vapid frigate
#

it's a good thing

#

keeps us on our toes

still forum
little eagle
#

Well there also IS that thing that checks the init boxes in the editor, but it's pretty limited in what it does.

simple fiber
#

@still forum Isn't there an editor which does that that is still in developpement ?

still forum
#

Arma.Studio is in alpha now yes.
But Dwarden told me before that a script Debugger doesn't exist. But it indeed does ๐Ÿ˜‰. And the Interface for that is what my Debugger is using

simple fiber
#

It doesn ot in Arma itself

still forum
#

it does

simple fiber
#

nor Arma 3 Tools

#

It's a part of VBS Suite

still forum
#

It does. The Interface is there in Arma. I'm using it for my Debugger. It's probably the same Interface that's used for the VBS debugger

simple fiber
#

You mean Arma Studio is using it ?

still forum
#

yes. Arma.Studio is using my Debugger and that is using the Existing script debugger Interface in Arma

vapid frigate
#

been using Visual Studio Code with SQF Language + SQFLint lately

little eagle
#

Stop capitalizing the nouns, dedmen.

vapid frigate
#

very good so far

still forum
#

First they tell me to capitalize the nouns and now they tell me not to. I don't know what to do know ๐Ÿ˜„

vapid frigate
#

but i wouldn't call it a debugger (even though it displays log errors, etc)

simple fiber
#

Also tried the IntelliJ plugin but these are bugged af

vapid frigate
#

needs breakpoints to be a debugger imo

still forum
#

We have a working Debugger with breakpoints. We actually have two

vapid frigate
#

which??

still forum
simple fiber
#

@still forum So is Arma studio actually usable and suitable for developpement ? I use Sublime Text rn and I don''t want to loose the functionnalities

still forum
#

It's useful for Debugging. But not for writing code yet. It's still very much alpha.

simple fiber
#

Okay

vapid frigate
#

Arma.Studio and ARMA STUDIO are 2 different projects?

still forum
#

yes. You can see that from the different Names. Obviously

vapid frigate
#

yeh, my bad

still forum
#

๐Ÿ˜„ Not really your fault ^^ These Names are kinda similear if you don't pay attention to it ^^

simple fiber
#

@still forum Well, I think I'll still with the hacky and crapy methods for now like everyone. I use enigma's tool for a second syntax check

still forum
#

Arma.Studio also has live syntax checking. advertising

simple fiber
#

He has good ideas, maybe you guys should work together instead of creating xxxx tools

still forum
#

My debugger is open-source. Anyone can use and implement it into their tools. But till now no one seemed to care.

vapid frigate
#

i have a suggestion

#

change the name

#

the saddest part is when you google arma studio, neither of them are in the top 5

simple fiber
#

The saddest part is that arma.studio is recognize as an url

#

really chrome

still forum
#

Well.. One tool has been teased for over a year only on some youtube videos. The other was only released as early alpha a few weeks ago. So I wouldn't expect many search results

#

But for me Arma.Studio is third result on google

simple fiber
#

I have one question, THE QUESTION : Is there a Dark Theme ?

still forum
#

๐Ÿ˜„ Not yet ^^ I'm also waiting for that.

simple fiber
#

ok then => ๐Ÿ–•

still forum
#

Currently doing a big rewrite. When that's done you can choose any colors you want

simple fiber
vapid frigate
#

how do breakpoints work? with a dll or something?

still forum
#

yeah

vapid frigate
#

nice

simple fiber
#

I suppose it does not work with Battleye

still forum
#

true. Will also try my best to keep it that way

little eagle
#

Why would you use battle eye while debugging?

simple fiber
#

Because why not ?

#

Anyway it would be easier if Bohemia just shared their tools

little eagle
#

It's an anti cheat tool?

simple fiber
#

Even a lightweight version

little eagle
#

Debugging requires a lot of cheating

still forum
#

Because you would be able to stop/manipulate any script running on any Battleye enabled Server. And Battleye aims to prevent exactly that

simple fiber
#

Cheating requires a lot of debugging *

little eagle
#

Why do you know?

vapid frigate
#

i like this VS Code one because it's adding the language to a good text editor

little eagle
#

Suspicious...

simple fiber
#

I'm a cheater that's why

#

Kappa

vapid frigate
#

seems too much to make a good text editor AND put the language in

little eagle
#

I knew it.

simple fiber
#

Any good Arma dev knows approximately how battleye works

#

Tell me you never went on cheating forums

#

They are gold mines

little eagle
#

I never went on a cheating forum.

simple fiber
#

For infos

still forum
#

I know @vapid frigate ^^ We have most of the language part done. But creating an actually good text editor is the harder part.

simple fiber
#

You should you can learn a lot

little eagle
#

Like what?

simple fiber
#

Like how everything is working ? Like how do ppl cheat ?

still forum
#

If commy needs to learn something he'll just ask me. And you don't need to know how people cheat. Except you are a Server owner or something like that

little eagle
#

All my learning is from asking the game engine by testing stuff.

#

Everything I was told and learned from others turned out to be a lie.

simple fiber
#

Because you don't try ๐Ÿ˜„

#

(Rip first account)

vapid frigate
#

@still forum seems like it'd be easier to make it a VS or VS code plugin

simple fiber
#

Btw, you know you can freeze the process and read in the memory without being Battleye'd ?

vapid frigate
#
  • u could put it in the extension browser so ppl don't have to google it ๐Ÿ˜‰
still forum
#

Already talked to the guy that made the VS Code plugin. He is free to add my Debugger into his stuff.

little eagle
#

If I play it's on a closed server, so the only one cheating is me (the only one that would know how to).

simple fiber
#

Battleye don't care if you are on a private server

#

I lost an account trying on mine

little eagle
#

My point is that there is no battle eye, because it's a resource hog and you don't need any of that in Arma.

simple fiber
#

L

#

ol

little eagle
#

Why would you use BE in a closed community?

simple fiber
#

Why would you trust everyone ?

little eagle
#

I don't. It's a closed community.

still forum
#

You don't need BE to make sure no one does bad.

simple fiber
#

It helps, a lot

#
  • Rcon
still forum
#

You don't need Rcon in a closed community. And Battleye creats more Problems than it solves in that scenario

simple fiber
#

k boi

#

Closed communities are rare

vapid frigate
#

depends how big the community is

simple fiber
#

Most of the servers need Battleye

still forum
#

They are not rare. Just not as big and well known as Public ones are. Which makes sense. Considering most of their servers are password protected

vapid frigate
#

we don't use anticheat with 40-50 vs ai

#

because why would u cheat

simple fiber
#

I guess we changed topic

#

I smell the FM comming

still forum
#

Yes. Indeed ^^

little eagle
#

Stop editing your posts, dedmen. It's hard to keep track of what you write.

#

Just make a new response.

simple fiber
#

lel

little eagle
#

This is not a forum, this is a chatroom.

#

Usually I complain about the other way round.

jade abyss
#

i smell mimimi

simple fiber
#

We are like 4 ppl talking it's not that hard to track

little eagle
#

And Harm, stop writing like a 4chan reject.

simple fiber
#

@little eagle Please, you can do better, 9gag reject

little eagle
#

๐Ÿ”ฅ ๐Ÿ˜

still forum
#

๐Ÿฟ

simple fiber
#

Are you a not funny version of @jade abyss ?

jade abyss
#

๐Ÿฟ

#

stop comparing me to that excessive-Macro-User

#

thx

little eagle
#

I should visit a "cheating forum" so I can learn about scripting.

simple fiber
#

Yeah, still it is not what I said

#

Try better

rotund cypress
#

Reading what harm says is always ๐Ÿฟ time

little eagle
#

Please. I try to be entertaining too.

rotund cypress
#

Not always the best thing to be entertaining ๐Ÿค”

little eagle
#

You assumed that I always have the best intentions.

simple fiber
#

VS ?

#

If yes, which one are you using ? And can you give the plugin names ?

vapid frigate
#

yeh that's from VS 2017 vanilla

willow basin
#

^

vapid frigate
#

unfortunately not aware of arma plugins

simple fiber
#

Oh ok, i'll stick with Jetbrain then

vapid frigate
#

VS code has some

simple fiber
#

I'll take a look thanks

vapid frigate
#

looks like @willow basin made one of the ones i use.. creatively named 'SQF Language'

#

the other one is 'SQFLint'

#

to show more of the typos

#

at least they're uniquely named though ๐Ÿ˜ƒ

simple fiber
#

shots fired

willow basin
#

;D it was free so I took the chance to claim "sqf". But especially SQFLint will give you some hints. Mine is more to make SQF look more beautiful in VSCode ๐Ÿ˜‰ atleast for now.

vapid frigate
#

so easy to tell devs 'get vs code, click the bottom icon, install SQF Language and SQF Lint, click play under the debug icon'

#

and just right click > 'open folder in code' to open an existing mod

little eagle
#

It is important to know that even the engine of BI needs some () brackets around these statements (like the array after format []).

#

wat

cedar kindle
#

format %1 try catch ๐Ÿค”

still forum
#

Catch returns something according to wiki. Probably return value from catch code

proven crystal
#

I am wondering:
I have 2 scripts here. Both are generating a marker on a map and then update the location continuously. They are launched through the init of an object.

In case A i continuously generate and delete the marker, in case B i create the marker first and then just continously update its position.

I used local markers first, which works in case A, but in case B, that does not work. The marker then only exists on the server.

jade abyss
#

why deleting it?

proven crystal
#

Now, If lauch through an objects init, that script is executed once on mission start, or will it run on every client that connects later, too?

#

Because, if it is run for every client, then i dont understand why local marker does not show up on the client

#

In case B

jade abyss
#

What kind of Obj? MapObj? Placed? If placed -> only when created.

proven crystal
#

Some rock, placed by editor

jade abyss
#

"
In case A i continuously generate and delete the marker, in case B i create the marker first and then just continously update its position."

#

Why deleting it

proven crystal
#

Its attached to an objective that might get destroyed

proven crystal
#

Because otherwise the marker persists after the object is destroyed

jade abyss
#

add a killed-EH to the Obj, that deletes the marker, when its dead oO

proven crystal
#

Does that throw errors for objects that cant be killed? Because i want to use it on all sorts of things

#

Still thats not the point, im aware that there are other ways to do that. But that script works and has no issues

#

Im wondering why local markers dont show on clients in tge second script

#

Where i also could do it differently and a normal marker does the job, but still i wonder

jade abyss
#

local = local to the machine where created oO

#

Does that throw errors for objects that cant be killed? Because i want to use it on all sorts of things

Wut?

proven crystal
#

In principle that part only would need to run on the server anyway, but it should also work with local markers in my understanding

jade abyss
#

What do you want exactly. I have no clue atm

little eagle
#

killed only triggers on the machine where the dead object was local, but then you might as well just switch to global markers.

proven crystal
#

there is script A) for things that should be used as objectives. all sorts of vehicles, people, and whatever kind of objects in principle. all the script does is generate a marker on the position of those objects, and objects get this function, so they can be picked up

#

script B) only generates a marker on an object, and checks whether any objects tagged through script A) are within the area

#

i use local marker for script A) because i thought that, if launched through init, the thing is executed on servers and client and then there could be shitloads of markers on the map in the end

little eagle
#

uhm.

proven crystal
#

and i was considering some functions depending on conditions that depend on the individual players

#

ive skipped all that already, and yes, now both scripts could do if only run on server, but my question is the same: why does the second case not work with local markers. because i seem to understand something wrong about what happens when something is called through an init of an object

little eagle
#

I think this might be all too vague for a chat.

#

Also, define "init of an object".

#

Editor Init box?

proven crystal
#

yes

#

the code looks shitty right now, i dont want to post it ^^

#

but its very basic stuff really

#

in one case i generate and delete a local marker in a while look

little eagle
#

The code inside the init box is executed on every client after the object was created on mission start. Note that "mission start" is a "local" concept. The mission start happens for a JIP when it joins which might be 2 hours into the mission.

proven crystal
#

in the other i generate the marker first and then only update the position in the loop

little eagle
#

There is one huge trap with marker locality which might be your problem.

#

Even if you create a local marker with createMarkerLocal

#

As soon as you use one of the global setter command, e.g. setMarkerText instead of setMarkerTextLocal

#

The marker will turn into a global one and is broadcast to all clients.

jade abyss
#

โ˜

proven crystal
#

no i used all the local commands. im wondering why the marker is not generated on the clients at all when i create it outside the loop. it looks to me that only the while loop is running on theclients

little eagle
#

Maybe the marker name is already taken.

proven crystal
#

so as if its lauched in the beginning, where only the server is there. but if a client connects then it just keeps running there too but the initial part is not executed again.... its weird

#

ahhhhhh

little eagle
#

Marker name or marker id has to be unique. Note that marker name != marker text, which is the one shown on the map.

proven crystal
#

that could be... although that marker name would only be already taken on the server

#

not on the client that connects....

jade abyss
#

๐Ÿ˜•

little eagle
#

You should try to debug your specific issue with as simple code as possible.

proven crystal
little eagle
#

And if it still happens, then you can post that here so anyone here can try to repro or find the problem in the thinking.

proven crystal
#

let me just clean this up a bit

proven crystal
#

hm actually now i see that i have no indication of that script runnin on the client at all

#

i recall that i once noticed that a simple object would not show an action that was attached to it

#

could it have something to do with simple object??

#

diag_log "geddon homezone registering";

_center = _this select 0;
_side = _this select 1;

if (isnil "fez_CTFgeddon_homezones") then {
    fez_CTFgeddon_homezones = [];
};
_array = fez_CTFgeddon_homezones;

_number = count _array;
_rd = random 1000;
_zonename = format ["fez_CTFgeddon_homezone_%2_%1_%3",_side,_number,_rd];
_zone = createMarkerlocal [_zonename, (getpos _center)];
_zone setMarkerSizelocal [75, 75];

_zone setMarkerTextlocal format ["AREA %1",_number];
diag_log format ["geddon zone marker created for %1",_zonename];

_array pushbackunique _zone; 
fez_CTFgeddon_homezones = _array;


while {true} do {
    diag_log "geddon homezone update loop is running";
    _zone setMarkerPoslocal getpos _center;
    _zone setMarkerColorlocal "ColorBlack";
    _zone setMarkerShapelocal "ELLIPSE";
    _zone setMarkerAlphalocal 0.5;
    
    if (!isnil "fez_CTFgeddon_Objects") then {
        diag_log "geddon zone found geddon objects";        
        {
            diag_log format ["check location of geddon objective %1",_x];
            if (_x inArea _zone) then {    
                diag_log format ["objective /n %1 is in area %2",_x,_zone];
            };
        } foreach fez_CTFgeddon_Objects;
    };
    
    sleep 30;
    
    
};

#

so this works with normal marker but not with local marker when called through an objects init box

#

i added _rd = random 1000; to the name of the marker, to exclude the thing with double names

turbid thunder
#

@proven crystal that sounds unreliable

proven crystal
#

also there is a counter in the name

#

so there shouldnt be that option in the first place

#

but just to check i added that too

#

still: i found that the entire code is not executed on the client now in the first place, even though this is executed through an objects init box

jade abyss
#

while {true} do { <- checking each frame? Put a uisleep of min. 0.5s in it

proven crystal
#

so all that doesnt matter

little eagle
#

Dscha is blind.

proven crystal
#

ow i wonder if that has to do with the fact that this is attached to a siple object?

jade abyss
#

fk that {-oneliner...

proven crystal
#

i also have a sleep 30 there

still forum
#

Dscha... Ckean your glasses

jade abyss
#

screw it, unreadable bs

little eagle
#

๐Ÿ˜‚ ๐Ÿ‘Œ

jade abyss
#

๐Ÿ’ฉ

#

no rly... whats the point of not putting { in a new line, to cleary see where something starts... -.- i hate humanity

still forum
#

Because some people like more compact code

little eagle
#

_center = _this select 0;
_side = _this select 1;

#

???

still forum
#

and some People know that the { starts at the same line (People like me :3)

turbid thunder
#

Compact code is a relative term

jade abyss
#

Thats for Sadists!

#

+Compact? wth? thats not an argument^^

still forum
#

I don't like a line of code that only has one char on it. It's a wasted line. And there are only that many lines that fit on my screen

jade abyss
#

readability > CompactCode (unless it affects performance)

turbid thunder
#

^

jade abyss
#

If you got stuff like sqf if(_abc)then{_abc = false;}; one liner
instead of:

if(_abc)then
{
   _abc = false;
};```
still forum
#
if (_abc) then {
   _abc = false;
};
jade abyss
#

But noooooooooooooooooo, there are sadists that like to write it like that:

if(_abc)then {
   _abc = false;
};```
#

As i said -> Sadists

#

no sense it makes

#

^^

proven crystal
#

well yea, but there is going to be more code in those brackets obviously. because the point of it wont be a diag log

still forum
#

I don't need the bracket to see what's going on. The Indentation is already telling me that

little eagle
#

wtf is happening here

turbid thunder
#

I like it like in Dscha's second example

jade abyss
#

(btw.: A Sidenote for those who might not get it: My "raging" is just a joke)

little eagle
#
if(_abc)then {
   _abc = false;
};

should be:

_abc = false;
#

:kappa:

turbid thunder
#

xD

jade abyss
#

Anybody know where the button is?

little eagle
#

๐Ÿ˜‚

turbid thunder
#

What if _abc is nil? D:

still forum
#
if (_abc != false) then {
    _abc = true};
jade abyss
#

Die

#

step on Lego and die

#

barefoot

little eagle
#

Then I also fixed an error, German

jade abyss
#

falling in Brennessel

little eagle
#

See how efficient I am?

jade abyss
#

๐Ÿคฆ

#

^^

delicate mason
#
if !(_abc isEqualTo false) then
    {
        _abc = !_abc
    };
turbid thunder
#

Normal folk praise the sun. I praise commy for having the efficency of a german :D

jade abyss
#

Commy is a MacroUser... pff... never.

simple fiber
#
_abc = [false, true] select _abc;
jade abyss
#

And Harmd can't even use the sqf tag for code...

#

oh my... what happend to this world

thin pine
#

How do I teach someone to stop using if (var == true) instead of if(var)? It's important

indigo snow
#

you show them it doesnt work at all

still forum
#

You don't need to

jade abyss
#

if(true == false)then{};

simple fiber
#

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

still forum
#

It just doesn't work. No need to teach something ^^

turbid thunder
#

Who puts == or isEqualTo in if's when the var in question is a bool?

jade abyss
#

Enough

indigo snow
#

BOOL is not an allowed type for == either way

delicate mason
#
if (_abc) then {
    if (_abc == true) then { // REALLY make sure
        _abc = false;
    };
};
jade abyss
#

There are also ppl who claim that Trigger don't affect the game.

little eagle
#

Check the channel description, nick.

simple fiber
#

isEqualTo won't throw an error as is checks the var type no ?

#

(if var is not a bool)

jade abyss
#

i quote:

IF (script == true) THEN {chat here};```
turbid thunder
#

You use == to return true or false, if you already have a var with true or false = wasted time typing it

jade abyss
#

๐Ÿ˜„ Dwarden messed it up

little eagle
#

isEqualTo won't throw an error, because it doesn't check the variable type.

simple fiber
#

Well that's what I meant but you got it

proven crystal
#

so what about my ugly code now? why doesnt it run on the client?

#

no matter how it looks r whats in it

jade abyss
#

Channel Description wrong since:
10/19/2015

proven crystal
#

again the question - can it have to do with te fact that it is a simple object?

#

because i also once added an arsenal to a simple object and that also wouldnt work

indigo snow
#

you cant use addaction with simple objects

#

you can cheat by having a hidden gamelogic or whatever which you do attach the action to or something

thin pine
#

The if bool == true thing a friend of mine is doing is in C# actually. I'll try to teach him not to do so using the lego on the floor method

willow basin
#

Why would you have the month before the day and then the year? Were ppl drunk back then? ^

still forum
#

Just let him do that. But tell him the more code he writes the slower he is coding. If he wants to be slow then that's how it is. Doesn't really hurt

thin pine
#

Because smaert

delicate mason
#

Real languages will optimize that stuff out but in sqf it's probably bad to have lots of them in a PFH or something

still forum
#

true

#

every call of that would trigger a rpt error. Which will drop fps like crazy

simple fiber
#

real dev use -nologs

#

pls

thin pine
#

Lol

delicate mason
#

-noLogs and while {true}...

thin pine
#

And always use spawn

jade abyss
#

for everything

delicate mason
#

spawn {call {...}}

#

it's a new thread!

turbid thunder
#

@willow basin its the default format for the USA. YYYY/MM/DD is much better to use on a computer. Looks nicer. Im just confused because I still cant tell if dscha is german for using german or american for having time and date formats popular in the US :x

still forum
#

better spawn {isNil {...}} Unscheduled but still scheduled

turbid thunder
#

Make sure to put it in isNil or an eventhandler :D

delicate mason
#

^

turbid thunder
#

@still forum wait what?

jade abyss
#

I got Discord (and almost everything else) in English, so it sets it like that.

turbid thunder
#

Lol

delicate mason
#

proper localization is almost as hard as timezones

turbid thunder
#

Timezones are worse

delicate mason
#

language, dates, decimal/thousand seperator, currency...

turbid thunder
#

Especially when some countries have a summer and a winter time but others not

willow basin
#

YYYYMMDD is perfect for sorting and stuff. It's MM/DD/YYYY that makes no sense to me xD if you have 01/02/2017 or if someone messes up with the delimiter you have an issue ๐Ÿ˜‰

turbid thunder
#

Yeah YYYY/MM/DD in filenames for example

proven crystal
#

so just for info, the simple object thing was the issue

turbid thunder
#

Sort by name = sort by date

jade abyss
proven crystal
#

seems that the script then still executes on the server, but not on client

jade abyss
#

add some diag_logs

delicate mason
#

addAction is ignored on dedicated server

little eagle
#

Well if the script doesn't execute on the clients, then it's no wonder the local markers aren't updated.

proven crystal
#

exacty

jade abyss
#

wait, where is addAction beeing added?

proven crystal
#

no addaction. just marker

little eagle
#

Now you need to figure out why the script isn't executed on the clients.

#

And it's probably nothing inside the script, but something in the way it's executed.

proven crystal
#

just because its in a simple object. just removed the simple object tag and now it works

little eagle
#

So you're saying that the init box doesn't work on clients for simple objects?

proven crystal
#

same object, same code all good.. if simple object is on, it only executes on server

#

i now execute the same code in 2 objects. same objects but one simple one not simpel.

little eagle
#

I'll try to debug that, but I could imagine this being caused by the server deleting the original object and replacing it with a simple one or something like that.

indigo snow
#

cant use addAction with simpleObjects

proven crystal
#

so its pretty obviously the thng

indigo snow
#

or at least according to the wiki

proven crystal
#

im not using addaction

indigo snow
#

nvm then

proven crystal
#

im just generating markers

little eagle
#

lol what's up with people bringing up addAction again and again.

proven crystal
#

localmarkers

#

not sure ^^

indigo snow
#

it came up somewhere /shrug

proven crystal
#

anyway solved ^^

jade abyss
#

But addAction

little eagle
#

diag_log [this]
and checking "simple object"
should lead to no logging on the client and logging on the server

#

If this bug exists. Will try later, maybe ...

proven crystal
#

in my case now the effect seems to be pretty much the same that i would get if i added if (!isserver) exitwith {}; on top

little eagle
#

Yeah. The 3den attribute literally deletes the map placed object and replaces it with a simple object. And that is maybe why the init box expression is ignored on clients.

shell gale
proven crystal
#

can i use these RGBA codes instead of colorRED etc?

halcyon crypt
#

don't do modeling but that seems quite useful

proven crystal
little eagle
#

No you can't. There only are a handful of predefined marker colors.

#

Well with an addon you can.

hollow lantern
#
/*
         author: @Aebian
         description: Entrance script
         returns: nothing
         // _null = this addAction ["Area 69","itsAebian\lab_gate.sqf",toLab, this];
     */

      params["_state","_caller"];

      if (rank _caller isEqualTo "SERGEANT" && _state isEqualTo "toLab") then
        {
         _caller setPosASL [10622.9,7409.4,2.28408];
         GateBunker animate ["TurnDoor",1];
         sleep 3;
         GateBunker animate ["MoveDoor",1];
        };


      if (rank _caller isEqualTo "SERGEANT" && _state isEqualTo "toBase") then
        {
         _caller setPos [7541.05,7392.53,0.43043];
        };``` I think this is easy but it seems that I can't see the forest because of trees... My goal is to get the actual user that executed the script ported but Its not working. Whats wrong?
vapid frigate
#

can't really see what _caller is based on that

jade abyss
#

params["_state","_caller"];

#

whats the call?

hollow lantern
#
 _null = this addAction ["Area 69","itsAebian\lab_gate.sqf",toLab, this];```
#

thats the call

jade abyss
#

_caller = toLab

vapid frigate
#

what's 'this' lol

jade abyss
#

ah, mom

#

Yeah, that addAction is wrong

hollow lantern
#

okay ^^

vapid frigate
#

you might be able to just use 'player'

#

instead of _caller

hollow lantern
#

good then every player gets ported gg

vapid frigate
#

that's the unit for the client the script is running on

hollow lantern
#

hmm well it will be running on the server side

vapid frigate
#

in an addaction, it's just the 1 client

hollow lantern
#

okay

#
/*
         author: @Aebian
         description: Entrance script
         returns: nothing
         // _null = this addAction ["Area 69","itsAebian\lab_gate.sqf",toLab];
     */

      params["_state"];

      if (rank player isEqualTo "SERGEANT" && _state isEqualTo "toLab") then
        {
         player setPosASL [10622.9,7409.4,2.28408];
         GateBunker animate ["TurnDoor",1];
         sleep 3;
         GateBunker animate ["MoveDoor",1];
        };


      if (rank player isEqualTo "SERGEANT" && _state isEqualTo "toBase") then
        {
         player setPos [7541.05,7392.53,0.43043];
        };``` well my debug console tells me that I executed addAction Area69 but I still don't get ported
#

biki tells sqf object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection]

#

thats why I put toLab behind the script

jade abyss
#
object addAction ["MyText",MyTag_fnc_MyFunction, [MyArg1 , MyArg2 ], 0, false, false, "", "", 5];```
vapid frigate
#

looks like the syntax he used should work

#
SQF file example:
_act = player addAction ["Exec the file", "somescript.sqf"]```
#

but _null = this addAction ["Area 69","itsAebian\lab_gate.sqf",toLab, this]; is passing 'toLab' as the params

hollow lantern
#

thats correct

#

it should do that

vapid frigate
#

and your script is expecting [_state]

jade abyss
#

params["_state","_caller"];

#

That was before

#

so the addAction was wrong

hollow lantern
#

params["_state"]; is the parameter 0 so toLab will be _state

vapid frigate
#

maybe you meant like this _null = this addAction ["Area 69","itsAebian\lab_gate.sqf",[toLab, this]]

#

with (_this select 3) params ["_lab","_object"] ?

jade abyss
#

๐Ÿ˜• wth?

#

even worse after edit

hollow lantern
#

why? the addaction sqf _null = this addAction ["Area 69","itsAebian\lab_gate.sqf",toLab];
is completly fine. I just don't get teleported

vapid frigate
#

the args from addaction go into _this select 3

hollow lantern
#
/*
         author: @Aebian
         description: Entrance script
         returns: nothing
         // _null = this addAction ["Area 69","itsAebian\lab_gate.sqf",toLab];
     */

      params["_state"];

      if (rank player isEqualTo "SERGEANT" && _state isEqualTo "toLab") then
        {
         player setPosASL [10622.9,7409.4,2.28408];
         GateBunker animate ["TurnDoor",1];
         sleep 3;
         GateBunker animate ["MoveDoor",1];
        };


      if (rank player isEqualTo "SERGEANT" && _state isEqualTo "toBase") then
        {
         player setPos [7541.05,7392.53,0.43043];
        };```
jade abyss
#

No Lecks oO Only ",[toLab, this]" would be transported to the script. lol

vapid frigate
#

as _this select 3, yeah

jade abyss
#

Now it could work, Aebian

dusk sage
#

Your first three params are for reversed values

vapid frigate
#

arguments (Optional): Anything - Arguments to pass to the script (will be _this select 3 inside the script). If Array is used as an argument for example, its 1st element reference would be _this select 3 select 0. Default value: nil

dusk sage
#

You'd need

 _null = this addAction ["Area 69",{[toLab] call preProcess "itsAebian\lab_gate.sqf"}]; 
#

For that

jade abyss
#

Ah! Missunderstood.

hollow lantern
#

ah okay thanks @dusk sage

jade abyss
#

make a function of that .sqf

vapid frigate
#
_act = player addAction ["Exec the file", "somescript.sqf"]``` is valid according to biki
dusk sage
#

Just use

_this select 3

or

params ["", "", "", "_yourstuffhere"];
hollow lantern
#

btw preProcessFile ^^

vapid frigate
#

or

_args params ["_toLab", "_yourOtherArgs"];
dusk sage
#

yada yada ๐Ÿ˜‰

#

@vapid frigate One more

vapid frigate
#

sry

#

drunk

dusk sage
#

๐Ÿ˜›

vapid frigate
#

with the addAction you initially posted though @hollow lantern, ```SQF
params ["_target", "_caller", "_id", "_toLab"];

#

because you put toLab outside of an array in the args, so it's the 4th param directly

#

_caller will always == player afaik

hollow lantern
#

yey ๐Ÿ˜„

vague hull
#

@jade abyss [missionNamespace,["varname",varvalue]] remoteExec ["setVariable",target] works
although I havent tested if there are any sideeffects

hollow lantern
#
GateBun>
12:05:42   Error Undefined variable in expression: _state
12:05:42 File C:\Users\Aebian\Documents\Arma 3\missions\[A]_Cuda.Woodland_ACR\itsAebian\lab_gate.sqf, line 10
12:07:23 Error in expression <if (rank player isEqualTo "SERGEANT" && _state isEqualTo "toLab") then``` but ```sqf
params ["_target", "_caller",  "_id", "_state"];```
and the line 10 is ```sqf
if (rank _caller isEqualTo "SERGEANT" && _state isEqualTo "toLab") then {}``` shouldn't that work?
vapid frigate
#

is it faster that missionNamespace setVariable ["varname",varvalue,true] ?

#

_state isEqualTo "toLab"

#

_null = this addAction ["Area 69","itsAebian\lab_gate.sqf",toLab];

#

tolab isn't equal to "toLab"

#

"toLab" is a string, toLab is a variable

hollow lantern
#

oh lol

#

yeah I see

vague hull
#

its not about being faster

jade abyss
#

@vague hull Shouldn't. It's like executing that command on that Client. So... i don't think there are any Probs.

vague hull
#

and setting with public true, will share it with all clients

jade abyss
#

Yep

vapid frigate
#

ah ok, you want to share it with only some?

jade abyss
#

and Server

vapid frigate
#

or one

vague hull
#

exactly

#

and only at a certain point in time

hollow lantern
#

@vapid frigate yup works now

little eagle
#
format ["%1", switch (false) do {case true: {1}; default {0}}];
#

works fine

hexed obsidian
#

anyone know how to get AI to spawn with custom loadouts with EOS?

vapid frigate
#

@little eagle

#

obviously nonsense code.. but valid

#

well.. same if _c = true;.. then it wouldn't error

#

what version are you using?

#

what you pasted doesn't work for me either

queen cargo
little eagle
#

Idk about SQFlint, but

It is important to know that even the engine of BI needs some () brackets around these statements (like the array after format []).
is what irritates me.

#

The command precedence is pretty clear and that is true for control structures too.

queen cargo
#

since when Oo
SQF is actually the one thing they did not fucked up

little eagle
#

Yeah. Exactly

vapid frigate
#

yeh idk about that sry

#

i tend to use brackets alot because i dont trust sqf to work it out

queen cargo
#

you tested ingame? maybe we are wrong @little eagle ๐Ÿ™ˆ

vapid frigate
#

its usually right but not worth re-launching arma when it's wrong

queen cargo
#

use a proper linter and it will not happen

#

only moment when things happen like that is when you fucked up the precedence

scarlet spoke
#

However the usage of more brackets usally makes the code more readable so it is in gereral a good idea to use them ๐Ÿ™ƒ

queen cargo
#

However the usage of more brackets usally makes the code more readable so it is in gereral a good idea to use them :upside_down:

(if ((_this > (_other)) && false) then ({ foo = (bar);};)```
scarlet spoke
#

Yeah you can always fuck things up but if you do it a little thoughtfull my statement applies xD

#

But even in this extreme I'd say it's easier to read in some cases than when not using brackets at all

little eagle
#

I tested in 1.68 profiling

#

And it works.

vapid frigate
#

in C i would've written if (_this > _other && false).. in SQF i wouldve written if ((_this > _other) && false)

queen cargo
#

so still SQF is the only thing they did not fucked up

vapid frigate
#

both would probly work in SQF but i cbf restarting arma to find out

#

because in SQF it seems to occasionally not be what you expect

queen cargo
#

just because SQF as language is fucked up

scarlet spoke
#

Once you know the rules you can predict how it's going to evaluate ๐Ÿ˜‰

queen cargo
#

not because it is not working as intended

little eagle
#
if (_this > _other && false)

works fine in SQF. No idea why you trust it in C, but not SQF

queen cargo
#

because of this most likely @little eagle sqf _arr select 1 + 2

little eagle
#
  • has higher precedence than other binary commands
queen cargo
#

i know

little eagle
#

So it's basically select 3

queen cargo
#

you do not have to tell me

vapid frigate
#

yeh that's not real obvious

#

could go either way

little eagle
#

No. There is a table where you can find out.

vapid frigate
#

so i just put in the brackets

queen cargo
#

SQF lacks a proper array access op
which is kinda bad and leads to confusion which leads to those ()crap

little eagle
#

And it's really simple.

#

This has nothing to do with select, X39

dusk sage
#

works fine in SQF. No idea why you trust it in C, but not SQF

#

๐Ÿ˜„

#

I think I'd trust anything in C more than SQF from an offset

vapid frigate
#

would like to see the table/understand the full logic.. but until then.. when in doubt ()

little eagle
#

C has weird logic too in places.

vapid frigate
#

yeh im sure it does.. i would chuck in extra brackets there unless i was sure too

queen cargo
#

the SQF BNF there btw. has some mistakes in it

vapid frigate
#

nice, thanks

little eagle
#

The precedence in SQF is as far as I can tell exactly the same as it is in C.

#

Obvious additions are the binary commands and the odd one else

vapid frigate
#

yeh i guess just the syntax doesn't allow for as many mistakes

little eagle
#

e.g. or lower than and

vapid frigate
#

because functions are func(a,b)

#

not a func b

little eagle
#

The most annoying thing is that isEqualTo doesn't have the same priority as ==.

#

And min max being the same as + and - which threw me off twice already.

vapid frigate
#

personally i find the most annoying things select 2 instead of [2] and a getVariable "b" instead of a.b

little eagle
#

Well that is not a problem of precedence, but having those syntaxes sure would make it easier to write.

jade abyss
#

Thats what rly fkd me up, when i touched c#/c++ for the first time, after doing nothing but .sqf before!

#

BUT: I rly rly missed the creation/handling of the Arrays in c#/++

vapid frigate
#

yeah i came from C#/c++ (and a little SQL) before SQF... so confusing

#

especially with the little bit of SQL knowledge

#

and yeah, the ability to throw arrays around like you can in sqf is why _array[2] could conflict/get confusing

#

but still don't see what's wrong with a.b

queen cargo
#

a.b?

#

what should that do if i may ask?

vapid frigate
#

a getVariable "b"

#

in my dreams

queen cargo
#

because your a is a namespace

#

not an object instance

vapid frigate
#

it could be either

queen cargo
#

as no structures are existing, . is simply not needed

#

not to mention the problem this would cause in the engine

#

effectifly, your dot operator would look like this: sqf missionNamespace."foobar"

#

which is even worse then the GetVariable as that is essentially a sqf command in SQF common syntax whilst the . simply looks bollocks and makes no god damn sense

vapid frigate
#

i mean without the quotes. obviously the command doesn't currently work in sqf

queen cargo
#

want it even more bad? use the set syntax: sqf missionNamespace.["foobar", value]

vapid frigate
#

i want to see missionNamespace.fooBar

#

player.fooBar

queen cargo
#

impossible

vapid frigate
#

it's just a dream

queen cargo
#

unless: with receives a "tiny" version supporting only the next command
which again is impossible in SQF

vapid frigate
#

set syntax would be missionnamespace.fooBar = value;

#

i don't see how either conflict

queen cargo
#

that actually could work

#

the rest, no chance

little eagle
#

How can you say it's impossible though? I can see this being implemented rather easily and with full bwc.

queen cargo
#

enlighten me then

vapid frigate
#

it could almost be done with a macro

queen cargo
#

i do not see in which way this could be solved unless you rewrite a hell lot of crap

little eagle
#

How do you know what you have to rewrite? I'd argue that way more effort went into x64 than would go into implementing these syntaxes.

#

You say "hell lot of crap", but maybe it's just one file.

#

Who knows. I don't see how it could be that hard.

queen cargo
#

adding new commands is not hard

#

what this would require would be changing the parser

little eagle
#

I never said anything about adding new commands.

queen cargo
#

exactly

#

doing it with new commands is how i showed

little eagle
#

And why you think amending the parser is such a impossibly huge task?

queen cargo
#

you are right ... totally forgot that BI does this every patch

#

ohhh wait ... no

little eagle
#

Uhm. That doesn't mean anything. They don't add x64 every patch either.

queen cargo
#

ye ... i will stay with what i said ...

little eagle
#

You always do.

queen cargo
#

implementing that will never happen unless they rework how SQF works

#

because it simply is not possible in SQF right now

little eagle
#

implementing that will never happen unless they rework how SQF works
By definition, yes.

#

because it simply is not possible in SQF right now
Right now, sure.

vapid frigate
#

yeah, i'm just dreaming.. saying it COULD work without breaking anything

queen cargo
#

not by definition ... i showed how this could be solved with a new command
it would look ugly, but it would work

#

any change to the actual parser is bad

little eagle
#

any change to the actual parser is bad
Why?

#

Seems arbitrary to me.

queen cargo
#

ever read the reasonings for compilers not doing something?
or why some stuff got dropped?
or why a tiny feature takes ages to implement?

little eagle
#

No and I don't care.

vapid frigate
#

it would break aRmA?sTudiO

queen cargo
#

nope

#

linting is fairly simple

#

would cost me a few days
but my work hours are non-paid anyway

nocturne bluff
still forum
#

BI could easilly make missionNamespace . "myVariable" work ^^. Though.. doesn't _var&&_var2 work already? without spaces?

little eagle
#

I think so.

still forum
#

Then just adding . operator to where && and || is should be easy

little eagle
#

yeah. it's still not the same, but at least it's not as verbose

#

I don't mind the long version tbh.

still forum
#

true. It doesn't fit current SQF style..

little eagle
#

Everyone has tab for autocomplete these days anways

#

Programmers are just too lazy

dusk sage
#

Depends how far they went with it. If it only did one thing then sure, but it seemed like an OO approach was wanted (with other commands avaliable?)

little eagle
#

Getting with to work with objects / locations would be a massive leap imo.

blazing zodiac
#

Does anyone have a way to return a units current weapon object and not the name of it as a string?

still forum
#

I don't think so. What are you trying to do?

blazing zodiac
#

I'm trying to use the animChanged event handler to detect when a unit is reloading

#

but it doesn't seem to trigger for reloads

still forum
blazing zodiac
#

yes unfortunately

#

I want to tie it into my AI system so it triggers my cover function when they are reloading

#

Looking around it seems like the weapon anims need to be setup in the config to be able to be used by animChanged? Can anyone confirm, I have very little expirience with configs compared to everything else

#

actually let me double check when reloaded fires

#

if it fires early enough it may work for me

#

No unfortunately that doesn't fire until the reload is complete

#

For now I'll just run a loop to check for ammo count in the current magazine I suppose since currentMagazineDetail seems to be quite lightweight

little eagle
#

weapons use gestures for reloading and not full blown animations that trigger eventhandlers and can be read with the script commands

blazing zodiac
#

Ah so there's no way to do it then with an EH?

little eagle
#

no

blazing zodiac
#

Alright, thanks for the info as usual.

#

I'm about to do a big optimization pass on a lot of my older code and I feel it's always worth knowing the little quirks when writing new code to make it as quick as possible

still forum
#

I think everything is on that Page. Anyone can add to it so..

blazing zodiac
#

Right, was just curious because I noticed it hasn't been updated in a while and they've added quite a few new commands in the last few updates that may have replaced older slower methods I wasn't aware of

still forum
#

isEqualTo is faster than ==

#

that might not be on there.

#

It also doesn't say that if (true) then [{true},{false}] is faster than if (true) then {true} else {false}

blazing zodiac
#

it is

#

I tested it last night

tough abyss
#

i didnt even know thast worked... [{true},{false}]

blazing zodiac
#

if (true) then [{}, {}] is the faster of the two

still forum
#

{true} else {false} just makes an array out of the two and returns that. then expects code or array

#

also [1,2] select true is even faster (I think. Didn't actually test) if you just need to decide between 2 values

jade abyss
#

Yep

dusk sage
#
It also doesn't say that if (true) then [{true},{false}] is faster than if (true) then {true} else {false}

@still forum The page argues against you, it is on there

cerulean whale
#

Is there a way to tell if anyone has put a speech mark (double quote) when they enter an rscedit? Because you can't just do```SQF
if (""" in _str)...

dusk sage
#

Hmm, you could purely loop through the string

#

Far from ideal though

#

Does

 if ('"' in _str)...

work?

little eagle
#

You need to escape the quote mark

#
"""" in _str
jade abyss
#

should work with ' instead of "

dusk sage
#

๐Ÿคข

still forum
#

Removing script calls always improves performance. Even if that site says no difference

dusk sage
#

๐Ÿ™ƒ

little eagle
#

Just because it's on the wiki doesn't mean it's true.

cerulean whale
#

Yeah, I would think that @little eagle @jade abyss But I just need to check if there is a singular one by itself... doing ```SQF
"'"

little eagle
#

""""

#

is a string with a single double quote

#

essentially:

#

"

#
"""" in _str
cerulean whale
#

Ye, I just realised the sommand won't even get passed through though because it has incorrect format

#

idk it's being weird af

#

Xd

jade abyss
#

('"' in ["aaa"]) <- false

#

('"' in [""""]) <- True

little eagle
#

in STRING, not in ARRAY, Dscha

jade abyss
#

then he has to make an array, i don't care

cerulean whale
#

xD

little eagle
#

Does in STRING even exist? lmao

jade abyss
#

Problem solved, make an array, next one.

indigo snow
#

count (_str splitString """") >= 2

cerulean whale
#

I was doingit in an arrythe whole time

#

but I realised it's weird

#

xD

jade abyss
#

find should be used with String iirc

cerulean whale
#

ye

jade abyss
#

Yep, FIND is for Strings

cerulean whale
#

idk, I don't even know how it wrong a thing to my DB anyway.... because it shouldn't have been able to pass through anyway because of it's stupid quotations

jade abyss
#

('"' find """") = 0
('"' find "AA") = -1 (not found)

#

('"' find ""AAA"") = ERROR

#

So... more or less useless to search for ", since it fks it up earlier

dusk sage
#

Whatcha mean? In the last one you're not escaping

tough abyss
#

From my experience in cannot search substrings?

still forum
#

True. That's why Dscha said that. And it's not only your expirience. Wiki says in doesn't work for strings

tough abyss
#

I always wondered why they didn't expand in support substrings?

#

@still forum I can't believe this even running 24 AI is killing my FPS...

#

Tanoa specifically.

#

Too much work for the renderer to do along with the AI calculations running in the main-thread?

#

Wonder if I can force the renderer off core 0

still forum
#

You can force the main Thread to another core. But renderer and AI calculations are still main thread

tough abyss
#

What can I do? I mean my core 0 is hitting 100%

#

can't even play scenarios on Tanoa now.

still forum
#

get profiling build and check what's causing that. Or just remove Core 0 from the cpu affinity in task-manager

tough abyss
#

Could it be cause I'm allocating 16GB of RAM?

#

It's the main thread

#

The main-thread is hammering core 0

#

One sec.

still forum
#

Need to open the first level. I can't see anything there besides "game is running"

tough abyss
#

Largest Tanoa town. 12 vs 12 AI

#

okay. I'll run some new captures

#

This is an empty Zeus mission.

#

Which frame number should I capture?

#

1st 30th or 60th ?

still forum
#

doesn't really make a difference

tough abyss
#

k

#

Sufficient?

#

The game is running Ultra with View distance set to 2000M
I was conducting a tiny battle between Opfor and Blufor within the city
@still forum Any of this make sense? That has also been limited to 4 cores.

#

I'll take one without limiting it next.

cerulean whale
#

Is there a command to make the player get in a vehicle? (like player enterVehicle _vehicle if there was something to do that) I want to run it through my interaction menu\

tough abyss
#

No.

#

You can't actually make a player get into a vehicle

#

Wait

#

yes you can.

rancid ruin
#

you what

tough abyss
#

moveIn

rancid ruin
#

yeah no shit you can

#

lol

tough abyss
#

nvm I forgot.

#

Yeah MoveIn or MoveInCargo

#

depends where you want the player to be.

#

@cerulean whale Do you want him in the driver?

#

or other position?

cerulean whale
#

Ah, I was trying to look for one with Get or Enter. Either is good. Thanks @tough abyss

tough abyss
#

Below that is the related commands

cerulean whale
#

is there a way to get max passengers seats in a vehicle without using configClasses?

tough abyss
#

Yes

rancid ruin
#

why not just use the config file, like you're meant to?

tough abyss
#

I did write a small script a while ago.

#

but heres the command

#

I used that command to enumerate all the positions in a vehicle and fill the vehicle with AI

rancid ruin
#

that's the answer to a different question though

tough abyss
#

E.g a rebel truck.

rancid ruin
#

not the "max passengers"

cerulean whale
#

@tough abyss Thanks, @rancid ruin Less code is key lol xD, and it still solves my problem, I can just manipulate it

tough abyss
#

Well you could do an easy way for this Harris

#

make an array

rancid ruin
#

you can do it with cfg in a one liner, surely

tough abyss
#

and all the vehicles you know of have the count.

rancid ruin
#

using emptypositions would need more

tough abyss
#

Array would probably be faster if you were to know the values first.

#

You can eliminate processing by simply keeping the data in an array

#

So what you can do is simply create the vehicle, scan all the postions pump it into an array.

#

e.g

still forum
#

Why do you always delete the images you upload? Was just playing a bit of Metro and now the image is deleted

tough abyss
#
getAllVehiclePositionsSize = { 
params ["_vehicle","_listOfPositions","_positionTypesCount"];
_listOfPositions = []; 
{

_positionTypesCount = _vehicle emptyPositions _x;   
_listOfPositions pushBack [_x,_positionTypesCount]; 
} forEach ["Commander", "Driver", "Gunner","Cargo"];
_listOfPositions;
}:
#

@cerulean whale If that goes according to plan it will generate a list of positions containing a single nested array for each index

#

[["Commander",1],["Driver",1],["Gunner",2],["Cargo 5"]]; etc

still forum
#
getAllVehiclePositionsSize = { 
params ["_vehicle","_listOfPositions","_positionTypesCount"];

(_listOfPositions +  ["Commander", "Driver", "Gunner","Cargo"] apply {[_x, _vehicle emptyPositions _x]})
}:

I don't know why you have that _positionTypes count argument there. Or that _listOfPositions argument you are passing in

tough abyss
#

It's all there.

rancid ruin
#

just use cfg like a normal person

tough abyss
#

Ah, yeah you have apply as well

#

Which is faster.

#

I used similar code when I was re-writting I&A for populating vehicles

#

before I was aware of apply.

#

Question to be asked though @rancid ruin Is the config faster?

#

than the function?

rancid ruin
#

i expect so yes

still forum
#

config is generally slow. If the function does what you need then function is definetly faster

#

and less code

tough abyss
#

^

#

configs are good for more or less "static data"

#

Which is access once.

rancid ruin
#

how's it less code? you could get # of positions for x vehicle in one line

jovial ivy
rancid ruin
#

rather than that 15 line function or whatever

still forum
#

The function is 2 lines..

tough abyss
#

Indent better Dylan

#

You need to make it clear where one block begins and where one ends

jovial ivy
#

Im aware @tough abyss - It needs some cleaning lol

still forum
#

Indentation, params > select. Why do you have 4x if with the same condition?

tough abyss
#

You could also check if the first block

#

If they are player and exitWith otherwise

#

Instead of running 5 checks everytime

jovial ivy
#

Different vehicle placements. As you cant move a player into the co-pilot without using: _target moveInTurret [_vehicle, [0]]; - But I could probably fit that into one single if.

tough abyss
#

Could also move a lot of those operations into a function on their own

#

Smaller functions == faster code generally

#

also far more modular code too.

#

Seen patrol ops?

#

All tiny functions a lot of the time.

jovial ivy
#

Yeah I need to clean the entire SQF that is in. I wrote it without thinking very much about cleanliness.

still forum
#

smaller functions == faster code. Yeah. But also more function calls == slower code

tough abyss
#

^

#

Fine balancing act.

#

Wait? Is that the case if the function is called in scheduled?

#

vs unscheduled?

still forum
#

it's the same

tough abyss
#

Hmmmm. Now I know why some of my code was slower.

#

I had a lot of function calls

#

How many function calls does it take the cripple a mission?

still forum
#

thousands

tough abyss
#

I used select in one of my pieces of code to replace a switch

#

Worked well

#

Just called the function with the select within it

#

used the indexes of the array as the results of the condition

jovial ivy
#

Could probably do: _positions = ["Commander", "Gunner", "Cargo", "Driver"]; { if((_vehicle emptyPositions _x) > 0) exitWith { [_player, _x] call dy_fnc_findSeat; }; } forEach _positions;

tough abyss
#

@still forum 's solution is probably faster

#

because it is using apply

jovial ivy
#

Ah true

#

Didnt see that till now

#

How would you handle moving the player into the seat though. Switch, if statements?

tough abyss
#

select you mean?

#

switch is slower

#

Nested if-then is faster most of the time.

#

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

#

Arma logic.

jovial ivy
#

lol

turbid thunder
#

Whats the point in using Switch then other then looking nicer?

tough abyss
#

^

#

Debatable.

#

Documenting your functions

#

Does.

#

With descriptive documentation

#

Not //Get this plug that into function _someName

#

Define exactly what you were doing

jovial ivy
#

@tough abyss You ever find a way to do that action thing?

tough abyss
#

What action thing?

#

Which action menu?

jovial ivy
#

Scroll.

tough abyss
#

Right.

#

Ever used the endgames addaction?

#

yes

#

I wrote using your code an vehicle airdrop script

#

for squad leaders in I&A

#

Given their squad had > 6 players

#

It was adapted from your helicopter drop code

#

Yeah no one really got to see the Squad supports system I'd written

#

You couldn't request anything OP either.

#

Either ammo or a prowler / hunter

#

And only every 5 minutes

#

Old battlefield 2 style

#

As in? the networking or?

#

the cleanup?

#

Used arma 3's built in clean up system.

#

addToRemainsCollector

#

Perfectly good garbage collector. But initially for another community I created a vehicle destroy'd EH

#

Listening on the radiotower for cleanup

#

then adapted your cleanup script for use with it.

#

Was definitely lightning fast.

#

Then discovered I could use that destroyed handler for any kind of destroy able objective.

jovial ivy
#

Key note, "Before" an object is deleted ๐Ÿ˜›

austere granite
#

Is there a way to actually draw polygons on the map in arma... where it fills the polygon? D:

still forum
austere granite
#

See that would make sense right

#

I agree

still forum
#

Filling is a very good question

austere granite
#

However... where is the fill option?

#

LOL

#

i just implemented that for thsi WIP thing... then i realized it doesn't fill

still forum
#

Probably always filled. If you want unfilled polygon you could just draw lines

austere granite
#

obviously also still no line thickness on these sorta commands, because why would you ever want easy polygon / line drawing with more than 1px with?

#

No filling

still forum
#

Well... Feature request and waiting for months to get any response on it time.

austere granite
#

Amazing

#

Into my collection of tickets that will be closed in 2035

rancid ruin
#

it'll probably be closed by judge dredd

#

judge, jury, executioner, and closer of arma 3 feedback tickets

still forum
blazing zodiac
#

Does anyone know if you can use multiple typeNames in the nearObjects command like you can with nearestObjects?

scarlet spoke
#

I don't think so

blazing zodiac
#

Damn, must be a side effect of it's age compared to nearestObjects

glass temple
#

Best way to get objects placed in eden and filter though them with a blacklist array?

blazing zodiac
#

I'm sure there's a better way but anything placed in Eden should come up in near/nearestObjects

#

as far as filtering through them probably apply?

#

and in

glass temple
#

Hm

#

_blacklist = ["mapobj1", "mapobj2", "mapobj3"]; if (objs in _blacklist) then {do something};

#

Basically what I want to do

#

(on mission start)

blazing zodiac
#

yea and objs can just be objs = nearestObjects [syntax here]

#

don't remember exactly the order of params

#

nearObjects would be better if you don't need the sorting of nearest

#

and invert it if you wanna do something to the objects not in the blacklist

#

so _blacklist = ["mapobj1", "mapobj2", "mapobj3"]; if !(objs in _blacklist) then {do something};

#

if possible though I would look for a better command to get the Ed3n objects if it exists

#

isn't there a missionObjects or something?

#

I'm not able to check at the moment

glass temple
#

Nah

blazing zodiac
#

there it is

glass temple
#

ah

still forum
blazing zodiac
#

there you go, I'm sure that's faster

glass temple
#

Hm

#

Items in the blacklist are buildings I place in the map. So I don't want them to be touched, meanwhile I want others that aren't those to be. tl;dr

blazing zodiac
#

actually looking at it, I'm not so sure

#

I would test the 3 options to check for speed

#

I guess that one would depend heavily on your mission as well

glass temple
#

For instance I'm using a foreach

#

to get nearestObjects

blazing zodiac
#

If you have a a lot of triggers and stuff it could be slower than just returning the mission objects

glass temple
#

If _x is in blacklist array don't do anything to them

#

then continue on the others

blazing zodiac
#

Make sure you don't run nearestObjects on each iteration of the loop though

still forum
#

you are doing it only once at mission start. so speed is not that important

glass temple
#

yes

blazing zodiac
#

oh shit, sorry missed that part

glass temple
#

Takes a minute, but works.

blazing zodiac
#

yea speed is obviously irrelevant then, carry on

glass temple
#

lol

still forum
#

_blacklist = ["mapobj1", "mapobj2", "mapobj3"]; if (_x in _blacklist) then {do something};
use that inside a forEach allMissionObjects. But these mapobj strings have to be variables of the blacklisted buildings instead of strings

glass temple
#

was about to type psudocode with _x in _blacklist lol

#

You beat me

#

ty

#

I'll test now

#

I think it worked

#

YES!

#

Thanks guys

#

I derped out and forgot in was a keyword omg

vapid frigate
#

keep in mind it's case sensitive "lol" in ["Lol", "LOL", "loL"]; //false

glass temple
#

Yeah

#

Question

#

So say I have a whitelist and blackist of objects

#

I only want to mess with objects in an area that's in the whitelist using nearestObjects, but if they're in my blacklist don't do anything. wut do

blazing zodiac
#

just use nearestObjects instead of allMissionObjects

glass temple
#

That's what I'm using

#
        trees pushBack _x;
    };```
#

How could I implement that into a whitelist array?

vapid frigate
#

nearestobjects accepts an array of types

simple fiber
#

If you are looking for trees I would rather use nearestTerrainObjects

vapid frigate
#

ie nearestObjects [player, _whitelist - _blacklist, 200];

glass temple
#

not trees lol

#

So basically I want to mess with objects that are in the whitelist, but if it's in the blacklist (variable name set in eden) then leave it alone.

simple fiber
#

There is no regex in the whitelist array afaik

vapid frigate
#

ah ok, so _whitelist is classnames?

#

and _blacklist is object variables?

glass temple
#

if (_x in _whitelist && !(_x in _blacklist)) then {do stuff};

#

using nearestObjects

simple fiber
#

You use object name to know if they are blacklisted ?

glass temple
#

Whitelist would be names of objects I set in the editor..

vapid frigate
#

ah ok

glass temple
#

(When you click attributes in the editor on an object you set the name)

simple fiber
#

I would use variables instead

vapid frigate
#

_allowedObjects = (nearestObjects [player, ["All"], 200]) select {_x in _whitelist && !(_x in _blacklist)};

glass temple
#

I was using str _x find "objname" > -1, but it looks like crap. lol

#

Hm

#

I'll try that sec

vapid frigate
#

sry had extra quotes on player

glass temple
#

Yeah

#

Actually, how can I use _allowedObjects?