#arma3_scripting

1 messages ยท Page 284 of 1

dusk sage
#

isNil {backpack player};, can never be true, because it always returns a string, even if empty

jade abyss
#

Just link the WikiPage next time @queen cargo

cerulean whale
#

I already made that point

#

but if backpack player returns a string then how does changing a VARIABLE called B_carryAll_base effect the outcome

dusk sage
#

If backpack player returns B_carryAll_base

jade abyss
#

@dusk sage Wait a sec, i might had a brainfart before:

What is isNil ""returning? I mean, he is checking for an empty string. (guessing: Error msg, cause no parameter given)

dusk sage
#

Then isNil backpack player

#

is isNil "B_carryAll_base". So if you define B_carryAll_base, then it will be false

queen cargo
#

reading this will give you the information
that IsNil STRING is checking the variable behind the stirng (in the case of backpack player (eg. B_carryAll_base ) it thus will check if the variable B_carryAll_base is set)
if you never set that variable, isNil will return true
if it was set it will return false

dusk sage
#

isNil "" should always be true

#

Because it's nothing

cerulean whale
#

See, the way @queen cargo Was explaining it was saying it was happening before the return of the isNil, not after the return of the isNil.

dusk sage
#

o.o

jade abyss
#

So if no backpack -> isNil (backpack player) = true

#

If backpack = isNil (backpack player) = false

dusk sage
#

No

#

Because the variable will never be defined

cerulean whale
#

Sorry, confused myself there

#

lol

dusk sage
#

unless you loop through the config and define all the backpacks ๐Ÿ˜„

jade abyss
#

Can someone of you guys fkn start Arma?

queen cargo
#

it is too late (or by now early) for such conversations ๐Ÿ™ˆ

jade abyss
#

And just execute the motherhugging command in the motherhugging Console????

cerulean whale
#

Exactly...... My point is, why was the conversation useful? because the whole point of my thing was to check ALL backpacks ๐Ÿ˜›

#

which I solved in about 20 seconds

#

by just watching a var

jade abyss
#

Use (backpack player) isEqualTo ""

cerulean whale
#

returns false, because I have a backpack as expected

#

lol

#

as I said 10 minutes ago lol ๐Ÿ˜›

queen cargo
#

the conversation is happening ... so that you hopefully understand what isNil is doing

#

we do not want to harm you

#

hell i do not even want to talk to you

#

i try to be "nice" recently because ppl wanted me to do

#

i still think you are a fucking stupid for not even being capable of RTFM ...

jade abyss
#

Then halds goschen X ๐Ÿ˜„

queen cargo
#

but i try to still explain it to you

#

so you understand

dusk sage
#

Muted troll inc

queen cargo
#

and do not come back here bothering us with a stupid question

dusk sage
#

๐Ÿคฃ

queen cargo
#

which is wasting my time

#

etc.

jade abyss
#

@dusk sage Again ๐Ÿ˜„

dusk sage
#

I miss the red

#

It looked funky

queen cargo
#

me too

#

made me feel important

dusk sage
#

haha

jade abyss
#

*impotent

dusk sage
#

Give it a few hours

#

and commy will comment on isNil

#

I'm calling it

queen cargo
#

๐Ÿฟ
already can hear him crying over me

night frigate
#

(is it wrong that I find this whole discussion enjoyable to watch, like a Benny Hill skit? ๐Ÿ˜‰ )

queen cargo
#

no
it is never
it is entertaining as hell as usual @night frigate
even as participent

jade abyss
#

Its not funny! Its war!

queen cargo
#

as usual @jade abyss ๐Ÿ‘Š ๐Ÿ˜ˆ
but now back to my UI editor

cerulean whale
#

@queen cargo The way you explained it made it seem as it was happening BEFORE the return of isNil which was what confused me in the first place, I thought it simply checked the string returned from backpack player not if it was an undefined var as well lol. It makes more sense now, even though it wasn't irrelevant. I guess you didn't really get what I was trying to explain and vice versa xD

jade abyss
#

(Info: His UI-Editor is like DayZ. He started with that UI-Editor about 1 Year ago ๐Ÿ˜„ - still in Pre-Alpha XD)

queen cargo
#

@jade abyss the UI editor also was kinda frozen due to a new gf ๐Ÿ˜

dusk sage
#

Gah

jade abyss
#

@cerulean whale One thing i also forgot was, that isNil was checking quoted stuff. So yeah, it was correct.

dusk sage
#

What is it with girlfriends and coding

#

๐Ÿ˜

jade abyss
#

@queen cargo JILL is not a real Person.

queen cargo
#

wont work together @dusk sage
they are too time consuming

jade abyss
#

lol so true ๐Ÿ˜„

dusk sage
#

I could be playing games 24/7

jade abyss
#

lmao

dusk sage
#

But if I open visual studio

#

nag nag nag nag

queen cargo
#

stopped arma due to that
it was either arma or coding

#

so i left my clan

jade abyss
dusk sage
#

๐Ÿ˜„

jade abyss
#

Thats why he wrote:


X39 - Today at 8:13 AM
wont work together @BoGuu
they are too time consuming(edited)```
dusk sage
#

God this chat is distracting

#

I have a 20 page lab report due in 3 hours, and I've written 5 pages

jade abyss
#

Sucks to be you then ๐Ÿ˜„

dusk sage
#

๐Ÿ˜ญ

jade abyss
#

๐Ÿ˜‚

queen cargo
#

wanted to get progress on my UiEditor rewrite @dusk sage ... same here with the progress

dusk sage
#

๐Ÿ˜›

night frigate
#

UI Editor... that would be nice. The built in one is ... interesting. The part that annoys me is that I can't get an existing display to actually load in, even if I save in GUI Editor format. Am I missing something?

dusk sage
#

Probably

night frigate
#

Perhaps I should have said "What am I missing?" ๐Ÿ˜ƒ

dusk sage
#

Well, what did you do

night frigate
#

created the dialog. ctrl-shift-s to save in format I can save in hpp, then ctrl-s to save as GUI Editor format (which gives me something that looks like a long set of arrays).

queen cargo
dusk sage
#

love it

#

this is like #5 now X39

#

Your self plugging

#

is over 9000

#

๐Ÿ˜„

queen cargo
#

can also ref to the other editor

#

but that link is just writing it down once quickly

night frigate
#

As I understand it, I should be able to copy to clipboard the GUI Editor format (minus the comment lines), and then CTRL-O to make it magically appear in the GUI editor.

queen cargo
#

ye ... that "magical" part ... i got bad news for ya

night frigate
#

heheh

dusk sage
#

You can save it in config format

#

Then load it up

#

via missionConfigFile

night frigate
#

I was putting it into an addon

queen cargo
#

party hard
2.9GB download for 3 16x16 images

dusk sage
#

๐Ÿ˜ฎ

night frigate
#

See... File... Open... that's making sense to me. ๐Ÿ˜ƒ This has the basic controls I would need - thanks X39. ๐Ÿ˜ƒ

queen cargo
#

np frost

#

in case it crashes, try to add as much info as possible

night frigate
#

will do.

#

the grid that shows - is that assuming a 1920x1080 resolution, and covers the whole screen?

queen cargo
#

yup

#

currently not changible

#

grid resolution however is (defaulted to 10, changible via the lil textbox bottom)
it is pretty self explaining

night frigate
#

Awesome. Thanks.

spring dune
#

And last Q for me guys

I done with switch already & want to load it separately...
I can't find equal examples of calling scripts from scripts...

if ((count _###_name_array < 1) || {!((_###_name_array select 0) in XY_XYZ_available_patches)}) then { //no name or no appropriate patch
    if (_patch == "") exitWith {}; // no default patch
} else { 
    _this compile preprocessFile "switch_insignia.sqf"; };```

It's a part of main sqf which would load another sqf... Do i wrong?
Just wanna separate...
thin pine
#

Try replacing _this with call. If you need the other sqf to be parallel use execVM

jade abyss
#

+Why compile preprocessFile ? Why not define it as function?

spring dune
#

Cause i totally mess with it. ๐Ÿ˜ƒ I'm really not sure.

thin pine
#

If the switch insignia script runs more than once, compile preprocessFileLineNumbers somewhere in init sqf. Store it in a handle and then call the handle instead

#

That way you process only once

jade abyss
#
class CfgFunctions
{
    class aTagIAssignToThatFunction
    {
        class SomeFancyNameToSortItForYourself
        {
            file = "scripts\SubFolder";
            
            class MySuperDuperFunction {}; //Means: In folder "Missionfile\scripts\SubFolder" is a file named: "fn_MySuperDuperFunction". sqf | The Function name would be: " aTagIAssignToThatFunction_fnc_MySuperDuperFunction"
        };
    };
};```

So in your example, it would change from:

```_this compile preprocessFile "switch_insignia.sqf";```
to
```call Yourtag_fnc_YourFNCName;```
thin pine
#

All roads lead to Rome

spring dune
#

This is my config.cpp (created by original Author), i just added 20th line

jade abyss
#

Yep

spring dune
jade abyss
#

Don't do pics

#

pastebin it, but don't to pics

spring dune
#

How said X39... "Pastebin thinks SQF escapes like \""

dusk sage
#

you should be fine with that one

#

It won't go funny

spring dune
#

Anyway, thanks everybody who help'd me today. I gotta go for now. Will try to test it later.
Can i post results there?

wheat bone
#

Does anyone know how to restrict certain guns to players in a MP mission like if you choose a riflemen slot you can only get a rifle and so on or is anyone who knows what I'm talking about up to help us ?

polar folio
#

provide more info

#

you talkign about the BIS respawn templates?

queen cargo
#

think he talks about the virtual arsenal
in case this is true, the arsenal allows for filtering
though, you have to add those items manually

wheat bone
#

So you know invade and annex

queen cargo
wheat bone
#

If you choose rifleman then you can only get a rifle and so on

#

So the slot you choose

queen cargo
wheat bone
#

Restricts weapons

polar folio
#

dude. can you specify like we asked? arsenal?

#

so the arsenal is white listed based on slot? or is there some other menu for gear selection specific to that mission?

queen cargo
#

he wants the arsenal limited to certain weapons for certain slots

wheat bone
#

Yes

#

So if you go into a sniper slot then when u go to the ammo box the sniper is there for you

#

But if your a MG then the sniper isn't a option

#

If you play on the 77th invade and annex they have it

polar folio
#

my guess is they uniquely named those units and then maybe spawned local ammo boxes and added virtual inventory to those like X39 described

#

either way you need to google for white list like suggested

#

there's some good threads on it. look for those in which a guy named Larrow posted

queen cargo
#

ye ... more or less
alternativly you can add a variable to the player object limiting the stuff that certain object can receive and then just refering that var in the call filter

#

but i am too sleepy to get things easy to understand currently

polar folio
#

ye sounds more straight forward

severe pendant
#

Issue: Players killed by a mine (ie. apers mine) get registered as being killed by the weapon that the individual that placed the mine is currently wielding, and the distance the mine killed the player from is whatever distance there is between the dead player and whomever placed the mine. This causes some confusion.

Is there some way to detect that a player got killed by a mine, rather than the minelayers weapon?

polar folio
turbid thunder
#

@severe pendant depends. Have you examined what the killed eventhandler array returns?

queen cargo
#

you want to create some weird anticheat @severe pendant mhh?
what about examining the EHs further

#

tipp: HandleDamage

polar folio
#

i think the "hitpart" one returns teh ammo type. not sure. that one is a bitch to deal with in MP though

turbid thunder
#

@wheat bone Solution: have one arsenal PER "class" and hide all arsenal objects except the one that the player of the certain class is allowed to us

severe pendant
#

@queen cargo I am logging things for "longest shot" kills, etc. but mines keep breaking it, because if you kill a player with a mine at 3000m it is registered as a kill by whatever weapon you currently have equipped

polar folio
#

ye defo go for handledmage. hitpart sucks

severe pendant
#

Basically my guys wanted to have a "longest kill"-competition

#

But mines are breaking it

#

One dude has a 12031m kill with an AK74

#

But it really was a mine :S

turbid thunder
#

@severe pendant Remove mines? :D but yeah as said already, check what handleDamage / hitPart return in their array

#

If you can find just one reference that the death was not caused by a rifle, then you know how to detect it

severe pendant
#

rgr

turbid thunder
#

Other question: is there a way to disable the addrating that ace3 does all the time so that teamkills dont cause the AI to kill you?

tough abyss
#

The closest I got was "\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa" however it has a square in the middle, not the exact texture

halcyon crypt
#

define library?

turbid thunder
#

@tough abyss look in the expansions folder. Since this is from..... oh... nvm

#

Apex is still encrypted in EBO's. If the texture is in there, then its impossible to access it

#

Atleast at the moment

halcyon crypt
#

well you could reference it from within A3

tough abyss
#

I'm pretty sure it's in a pbo, I've seen people use it in other servers and I got pretty close to it in a pbo. @halcyon crypt I just mean folder

turbid thunder
#

@halcyon crypt that requires knowing its exact path

tough abyss
#

Or that ^

turbid thunder
#

@tough abyss are you sure it isnt something the game layers ontop on its own?

#

If not then just reverse engineer the mission files from the server you have seen it being used

tough abyss
#

No it's it's own texture

turbid thunder
#

@tough abyss what I meant is that the texture gets autoadded ontop if the existing loading screen

halcyon crypt
#

scan the config viewer for RscDisplayStart

#

most obvious guess would be \Expansion\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa

#

or \A3\Ui_f_exp\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa

#

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

tough abyss
#

That's the same link I mentioned, it isn't the same texture :{

halcyon crypt
#

it's not the same "link"?

tough abyss
#

The closest I got was
"\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa"
however it has a square in the middle, not the exact texture

#

@little eagle you know that "\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa" you shown me, it has a square missing out the middle which makes me think it isn't the exact one, any ideas where the complete texture would reside?

little eagle
#

the logo is another texture

civic maple
#

oh god

#

forEach in one place, and foreach in another

little eagle
#

That is the least of the problems. It's the most beautiful indent hadouken, I've ever seen in SQF.

civic maple
#

oh god no please

still forum
#

Who allowed that guy to share my screenshots of other peoples ugly crapcode?

little eagle
#

What guy?

still forum
#

That blue guy that just asked what guy

little eagle
#

It's beautiful, the world must see.

still forum
#

Ok. You can do anything you want anyway mister goodly2

little eagle
#

This must be some kind of obfuscation working on a psychological level. If you open that file for the first time, you close it immediately.

still forum
#

Which is what i did... But then i opened it again to screenshot it

little eagle
#

The absolutely best thing about it

#

is that Chinese comment on top

still forum
#

It explains what that piece of code is doing. Its important

little eagle
#

In Chinese ...

#

xD

still forum
#

ๅˆทๆ–ฐไธ€ๆฌกๆ€ง็ญ’ๅญๅผน่ฏ -> Refreshing disposable cheese ammunition

little eagle
#

it's true, ahahahaha

#

Lefleshing disposable cheese ammunition

still forum
#

Is it just me or do only germans make that joke? ๐Ÿ˜„ #offtopic

open vigil
#

Engrish dot Com

little eagle
#

Probably frowned upon in the US if you're living with actual Asians there.

oak marten
#

hi, its possible in a condition waypoint box set if blue is detected in obj1 go to obj1 waypoint, if blue is detected in obj2 go to obj2?
If not, how can I set in condition box if obj1 or obj2 is true then go to next waypoint

#

?

little eagle
#

branching waypoints?

oak marten
#

Yes, its possible? with or sentence for example?

little eagle
#

No, branching waypoints are not possible and you would need a bigger script to get that behavior. Definitely too long for the ingame condition / on act. fields.

austere granite
#

@tough abyss Download all in one config, makes it a lot easier to do that stuff

#

Also use arma tools to extract data so you can actually look at the textures easily

#

Will help you a lot with UI stuff, especially if you're doing things like loading screen and similar

oak marten
#

in triggers you can use multiple conditions to trigger go ON, in condition waypoint I cant set obj1 or obj2=true;?

little eagle
#

You can't skip waypoints though

oak marten
#

not skip, if trigger obj1 is true then waypoint2 is ON, or if trigger obj2 is true then waypoint2 is ON

little eagle
#

And if waypoint1 is OFF, the unit will just wait and not proceed to waypoint2

oak marten
#

either one is valid to waypoint2 on

little eagle
#

I don't get what you mean, sorry.

oak marten
#

waypoint1 its complete before

#

now in waypoint2 its waiting to obj1 or obj2 be true

little eagle
#

what is obj1 and obj2?

oak marten
#

obj1 or obj2

little eagle
#

Yeah, What are those?

oak marten
#

oh, sorry, obj1 and obj2 are triggers

little eagle
#

trig1 and trig2

oak marten
#

onact: obj1=true etc

#

yes

#

waypoint condition: trig1 or trig2=true

little eagle
#

O.K. And what's the problem?

oak marten
#

what is the syntax?

little eagle
#
trig1 or trig2

???

oak marten
#

not

little eagle
#

How so?

oak marten
#

I dont know

little eagle
#

Does it error? Does it not work?

oak marten
#

fault ;

little eagle
#

Have you defined them as default value false at mission start?

scarlet spoke
#

Unless trig1 and trig2 are Booleans it shouldn't work...

little eagle
#

They are booleans

#

But probably undefined

scarlet spoke
#

Oh then I overread something... Nvm

oak marten
#

trig1 or trig2=true;

thin pine
#

I think he's looking for triggerActivated trig1 or triggerActivated trig2

#

Or no?

oak marten
#

activated waypoint

little eagle
#
trig1 or trig2=true;

^ this is definitely wrong

#

definitely

thin pine
#

Only call sumn trig if it's a trigger please

little eagle
#

Better than obj1 and obj2 tho

thin pine
#

So much confusion has been caused in the past due to shitty variable naming

little eagle
#

Yeah, that throws me off every time.

thin pine
#

So many debates about it in this channel too

little eagle
#

Can't wrap my head around that, no matter how hard I try.

thin pine
#

Weekly

little eagle
#

Sorry, all me.

thin pine
#

Im outside waiting for a bus. I didn't read everything but trig1 is still a tad better than obj1

#

Hehe

jade abyss
#

Better than using "MyVar"

oak marten
thin pine
#

Myvar123 = true

jade abyss
#

๐Ÿ˜„

oak marten
#

xD

jade abyss
#

Where is the "#" Spawrk?

#

(# = indicator where the Error is)

oak marten
#

I dont know the correct syntax

jade abyss
#

I see that.

thin pine
#

Senor spark. Trig1 and trig2 are just variables, si?

jade abyss
#

Tequilla ayayay ariba.

little eagle
#
trig1 or trig2
#

I posted this already -.-

jade abyss
#

And everyone keeps ignoring you, like always

oak marten
#

yes, are variables from two triggers zones

little eagle
#

lol that counter

jade abyss
#

๐Ÿ˜„

thin pine
#

Thumbs up madness ๐Ÿ˜

jade abyss
#

Its not ThumbsUp

#

๐Ÿ˜„

thin pine
#

I sees

jade abyss
#

โ˜
: point_up :

thin pine
#

๐Ÿ‘

oak marten
#

im mad with editor so, sorry for that xD

thin pine
#

Im a mutant. My thumb is my point finger

oak marten
#

thankg @little eagle

civic maple
#

๐Ÿ––

little eagle
#

๐Ÿ’ฉ <-- favourite

jade abyss
#

๐Ÿคฆ

civic maple
#

๐Ÿ˜‚ ๐Ÿ”ซ

jade abyss
#

Those 2 are mine @little eagle

little eagle
#

lmao

scarlet spoke
#

I don't even know how to "react" to someones message xD

jade abyss
#

You can't

#

Only the priviliged can.

thin pine
#

Pffft

jade abyss
#

No peasants are able to.

#

๐Ÿ˜„

scarlet spoke
#

xD

thin pine
#

Self proclaimed elite

scarlet spoke
#

Viva la revolution!

oak marten
#

xD

thin pine
#

It's time for some communism in here

jade abyss
#

We sold our Soul, what did you do? ๐Ÿ˜„

scarlet spoke
#

What is yours shall be mine!

thin pine
#

Communism = true;

jade abyss
#

Its Dictatorship here, no chance for Communism

oak marten
#

OR capitalism

jade abyss
#

Nah, that 100% not ๐Ÿ˜„

thin pine
#

CommunistRevolutionStartTime = time + 5

civic maple
#

;

jade abyss
#

waitUntil{name (leader (Group _this)) != "dwarden"};

#

๐Ÿ˜‰

thin pine
#

It was at the end of a scope pffff

oak marten
#

haha

thin pine
#

No semicolon needed ๐Ÿ˜‰

jade abyss
#

Oh yeah, EOF, you are right

#

๐Ÿ˜„

thin pine
#

_discord setGroupOwner _allPlayers

scarlet spoke
#

allPlayers

#

no underscore

thin pine
#

Shit

civic maple
#
_discord setGroupOwner allPlayers;
little eagle
#

replace all semi-colon with commas!!!

thin pine
#

Maybe i modified that array

civic maple
#

@little eagle die

thin pine
#

To exclude some

jade abyss
#
disableUserInput commy2;```
thin pine
#

Like @jade abyss

civic maple
#

thank you

scarlet spoke
#

๐Ÿ˜„

little eagle
#

๐Ÿค

jade abyss
#

๐Ÿ˜„

little eagle
#

Fixed: Inventory weight of loaded magazines was doubled

civic maple
#

:D

#

Wait, when?

jade abyss
#

That was an issue? oO

civic maple
#

Yeah

peak plover
#

That's actually realistic. The further away an object is from the center of mass of the holder, the more energy it requires to hold

civic maple
#

Loading a missile in a Javelin increases weight a lot

little eagle
#

Yeah, massively limits AT soldiers

#

Every magazine actually

jade abyss
#

Interesting.

#

oO

little eagle
#

It's just especially noticeable with RPGs

peak plover
#

That's why carrying a case of beers is easier when your arms are not straight

jade abyss
#

Since when was that Error in it?

little eagle
#

Tweaked: Dead crew of static weapons is now ejected

#

Always

#

A3

jade abyss
#

Are you sure??

little eagle
#

No, but it goes way back

jade abyss
#

when i was playing around with a WeightSystem for Vehicles (and Backpacks) it was okay, iirc... hmm..

#

~1 Year ago

peak plover
#

Having a round in your grenade launcher would make it extreamly harder to wield...

hallow timber
#

Yeah, the weight doubling was a problematic issue

peak plover
#

A 2.6 kg pg-7VL would cause the weapon to have un-even balance...

vague hull
#

@nigel wtf, do you think they designed it to have no rocket loaded?

peak plover
#

Well...

#

In-real life situations I doubt any actual trained military force would pre-load anti tank weapons. At least they don't with the CG2/3 for fear of blowing up.

#

I guess it finally goes down to personal opinion. But I never saw the weight as an issue.

hallow timber
#

well the wieght of a magazine doubling when you load it into the weapaon is a bit ridiculous

peak plover
#

I just made up lies to cower up for it. Called it a feature

polar folio
#

lol

tacit pebble
#

Can anyone tell me what exactly global namespace is? A set of variables yes but in what context when for example using this line

_ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];

still forum
#

uiNamespace stays between missions. missionNamespace resets between missions.
Both are theoretically Global as every variable in there is accessible by every script

tacit pebble
#

Can you elaborate ?

little eagle
#

I can try

still forum
#

Depends on how you define global... Commy can do better.. I gotta watch youtube stuff ๐Ÿ˜„

tacit pebble
#

Haha thanks :p

little eagle
#

A namespace is a container for variables. All variable are defined in one namespace. In theory, you can have the same variable identifier (variable name) used in multiple namespaces and the identifier can even represent totally different values.

#

The variables only exist as long as the namespace exists.

tough abyss
#

Like we saw, there is near to no difference in distance and distanceSqr functions performance, but anyone know about distance VS distance2D? I can test for sure, but can't now.

little eagle
#

The default namespace is the missionNamespace

#

The missionNamespace persists as long as the mission exists.

#

It can be saved and loaded by saving or loading a mission save (savegame).

#

The uiNamespace persists as long as the game is running.

#

It's used for stuff that exists outside of missions (e.g. ui - user interfaces)

#

The profileNamespace persists as long as the profile exists. So it can carry over variables from old sessions.

#

The missionNamespace contains all "global variables".

#

Local variables would only exist in the script scope they are defined in and it's child scopes.

#

There is a different definition for global though and that deals with variables that exists on all machines in multiplayer.

#

It's not to be confused with global- (alias for missionNamespace-) variables.

#

They are called public global variables, not sure if you mean that or not.

#

That's it basically. I'm no computer guy , so it's my layman terms for all of this. Basically the commy school of SQF

tacit pebble
#

I understand what your saying but why wouldn't we just access them variables directly, why put it in a uinamespace

little eagle
#

Not sure, since I didn't write that script

#

But I have an idea.

#

The missionNamespace is meant to be serialized when saving a game.

#

This is essential, so you can resume it later.

#

However, displays and controls cannot be serialized.

#

Since they are gone when closing the game.

#

This is the reason why you cannot store them in:

#
  • global variables
#
  • object namespace variables
#
  • local variables in scheduled scripts that don't have serialization disabled (disableSerialization command)
#

The game does not complain when the controls or displays are stored in arrays that are defined in any of the three above for some reason, but they become displayNull or controlNull when loading the game (after closing it down in some cases)

#

life probably just says "fuck savegames", we only do MP

#

And just stores them in uiNamespace, to retrieve them later

#

Honestly, they probably don't know themselves why they do it. They just copied it from someone else and it's a common way to "get it to work"

tacit pebble
#

Yeah that's why I like to understand why, I like the architecture behind it. Thanks for clearing that up mate. Like you said the missionNamespace is default, if you were to store the ui in global variables would it try to serialize this in missionNamespace as default or am I missunderstanding?

little eagle
#

They can't just store it in missionNamespace, because the game would throw an error message in your face.

#

I mean they could. All they have to do , is to put it in an array. But they don't know that ; )

tacit pebble
#

A|hh so you can't store them there alltogether

#

Igy

#

Thank you pal

little eagle
#

testvar = findDisplay 46

#

try this, it complains

#

(once per session)

#

It's another dumb check that was meant to be helpful, but is just annoying and frustrating to new modders.

#

Just like "hurr durr, undefined variable in expression" when using scheduled environment scripts

thin pine
#

but..but...the variable is undefined in the expression ._.

little eagle
#

This has to be one of the worst design choices of SQF

#

I mean I get it

#

But why is it different in unscheduled environment?

#

Just be consistent : (

thin pine
#

naw that'd be boring man

#

how else would you get frustrated while scripting?

little eagle
#

You don't get frustrated while scripting

#

You optimize a macro or function

#

And you test it and it works. You even have a unit test that you call from debug console

#

patch done, release

tacit pebble
#

You say your not a computer guy @little eagle that's a nice meme

little eagle
#

You get bug reports from people using your API and suddenly it errors!

#

You spawn your unit test this time and it does error: undefined variable in expression

#

: (

thin pine
#

I assume it does output the error in the RPT file, in an unscheduled environment? It just doesn't do it visually after the first time, right?

little eagle
#

It's totally valid to use undefined variables in unscheduled environment

#

The check only exists in scheduled environment. And getting nil as GameValue by other means (commands without return value) does handle exactly the same way.

#

It's only referencing undefined variables and only in scheduled environment

#
call {
    _undefined
};

no error

#
0 spawn {
    _undefined
};

error

#
0 spawn {
    isNil {_undefined};
};

no error

thin pine
#

Hmm, didn't know it just completely ignored it. But then again I try to keep my variables defined, hehe

little eagle
#

Which sucks, because

[_potentiallyUndefined] param [0, <DEFAULT VALUE>]

is such a nice syntax. Errors in scheduled.

#

I'm at the point where it's harder to deal with scheduled vs. unscheduled than it is with local vs remote in multiplayer

#

And that's just fucked up

tough abyss
#

distance2D worth over distance? ๐Ÿ˜„

halcyon crypt
#

what?

#

oh

#

fail ๐Ÿ˜„

#

well, distance2D compares x,y and distance compares x,y,z but I doubt it's that big of a difference

#

performance wise

little eagle
#

one + z^2 less

thin pine
#

I checked it a week or so ago. I found pretty much no difference in speed

#

player distance [1000,1000,1000] vs player distance2d [1000,1000,1000] - 2d and '3d' output the same speed. i think 2d was occasionally 0.001 ms faster, lool

tough abyss
#

thanks!

#

Oh my

#

I will use distance1D

#

lol

halcyon crypt
#

๐Ÿค”

tough abyss
#

just kiding for sure

little eagle
#

player distance [1000,1000,1000] vs player distance2d [1000,1000,1000]

#

those should report completely different things

#

z has to be small compared to x and y for them to be equivalents

halcyon crypt
#

"output at the same speed"

tough abyss
#

sqrt(100000) is more expensive than sqrt(10)?

#

Man, so now we are discussing 0.000001 improvements ๐Ÿ˜›

little eagle
#

No, because 10 is really like 0000010

tough abyss
#

Ah...

#

i will try to tun the less heavy code like a=1; and see if i get the same execution time than distance, distance2D and distanceSqr.

#

If yes, so its a limit in the smallest time it can have, at least on that test.

halcyon crypt
#

I think someone fed you the optimization cool-aid ๐Ÿ˜›

#

no point in testing, just use whatever you need to use

little eagle
#

performance is overrated anyway

halcyon crypt
#

exactly ^^

thin pine
#

@little eagle the Z value was made high on purpose to demonstrate that even then the difference in performance is pretty much non existent ๐Ÿ˜ƒ

still forum
#

If you worry about performance...just removing one script call whatever it is gets you atleast a 10 or 20x improvement than what removing one dimension from the distance calculation gets you

little eagle
#

Yeah, but one is 1000*sqrt 2

#

and the other is 1000* sqrt 3

thin pine
#

if you worry about performance, just use nearestObjects with a 10km radius.

tough abyss
#

its uses distance2D states the wiki... but... it orders also.

#

may be for THIS distance2D there is gain

#

since its internal to the function

#

not a function

still forum
#

nearestObjects doesn't use distance 2D. it uses distanceSqr and compares that against the squared input distance

#

At first atleast. Once it has the list of all nearestObjects it sorts it again using distance2D

thin pine
#

it was a joke, monsieur. une example of killing le performance, oui oui. ๐Ÿ˜„

hearty plover
#

How do you post code like that D:

#

Well, anyways, I have two scripts there, obviously in reality they live in seprate files.

#

I am wanting to use them to create a timer

#

One sets the start time of the timer

#

The second updates the elapsed time

#

They would write to two pre-defined global variables, and they would be used server side only to control the game-modes logic / loop

#

Example :
while {(MODE_RUNNING) && CLOCK_ELAPSED < ROUND_TIME} do { // logic and check other end cons }

#

The ff_clockStart would get called right before the loop, as well as a call to the clockTimer to setup the elapsed time, should make it zero, even if it alread is.. I doubt I will put enough code between those points for it to add up to a full second.

#

My question is, I plan on have two teams of five people, no AI, and am wondering what would be THE MOST accurate way, to assure that the information related to that elapsed time, is shown to them, as accurate as possible.

civic maple
#
// FIRST FILE, ff_clockSet.sqf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// =============================================================================
//  [ff_clockSet.sqf] 
//  Takes no arguments, can be called to set the CLOCK_START in order to calculate
//  time left in the round, or other time managed events.
// =============================================================================
CLOCK_START = serverTime;
_clockStart = [CLOCK_START, "MM:SS"] call BIS_fnc_secondsToString;
systemChat format ["Last Time State | %1 ", _clockStart];
// END OF FILE HERE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


// SECOND FILE, ff_clockTimer.sqf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// =============================================================================
//  [ff_clockTimer.sqf] 
//  Takes no arguments, called during the loop in which it manages. It updates the TIME_COUNTDOWN
//  to be the elpased time since CLOCK_START was last set.
// =============================================================================
CLOCK_ELAPSED = serverTime - CLOCK_START;
_clockElapsed = [CLOCK_ELAPSED, "MM:SS"] call BIS_fnc_secondsToString;
systemChat format ["Time Elapsed | %1 ", _clockElapsed];
// END OF FILE HERE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hearty plover
#

Yay ^_^

#

@civic maple thanks.

civic maple
#

you do triple backtick, then sqf, then new line, then code, then newline then triple backtick

queen cargo
#

not sure why you annotated me

#

and no idea what you are talking about

#

ok
ye ... did not followed that much anymore

dusk sage
#

D:

hearty plover
#

?

spring dune
#

Uhm...

#

Is it possible to use #include inside {}?

dusk sage
#

yeh

little eagle
#

The question is not if you can, but if you should.

spring dune
little eagle
#

Did you enter this in debug console?

ionic orchid
#
} else {
#include <switch_insignia.sqf>
};

try that

#

it probably doesn't like the bits before and after the include

#

maybe also needs " instead of < and >

little eagle
#

No

spring dune
#

@ionic orchid same return
" and <> are equal...

little eagle
#

Did you put that into the debug console?

#

To ask again.

spring dune
#

@little eagle Yup, same return.

little eagle
#

You cannot use preprocessor instructions in the debug console.

#

You have to preprocess a file if you want to use macros or include etc.

#

It has to be a .sqf file

spring dune
#

Some sort of code line in init?

#

To make it possible to #include, right?

little eagle
#

No. It has to be in a .sqf file.

#

Preprocessed via execVM or preprocessFile(LineNumbers)

#

Only preprocessing can resolve the macros. If you enter the code into the debug console, it already is a STRING in the eyes of the game that will be compiled.

#

To resolve preprocessor instructions a FILE has to be preprocessed.

spring dune
#

@little eagle Any example?

little eagle
#
  1. create test.sqf in your current mission folder
  2. paste your code in there
  3. execute via debug console:
execVM "test.sqf"
#

execVM command will load the file contents, preprocess it (resolve preprocessor instructions like #define or #include), compile it and start a pseudo thread.

#

Note the: * preprocess it*

spring dune
#

It's alive finally guys.
Thanks to @little eagle for his advices.
May i post some results there a bit later & show you how that's work?

warped moon
#

In Exile, how can I run a command that, lets say needs to be executed every 60s?

dusk sage
#

Not really Exile related @warped moon

#
while {true} do {
    //mycommand
    sleep 60;
};```
#

Make sure it's run scheduled though

warped moon
#

run scheduled, what do u mean by that, can't I just put it in initserver?

dusk sage
#

You can yes, initServer runs scheduled.

warped moon
#

okay nice, thanks buddy

dusk sage
#

what do u mean by that
Have a google around the topic, something that has plenty of resources avaliable

warped moon
#

will do, thanks ๐Ÿ˜ƒ

little eagle
#

LineNumbers*

little eagle
#

wrong as ever ๐Ÿ˜›

dusk sage
#

๐Ÿ”ฅ

thorn saffron
#

hey folks

sudden delta
#

Is there a script for getting some sort of TFAR jammer?

thorn saffron
#

Im trying to debug the real armors mod and I keep getting a script error in this bit in smart.sqf:

        if ((true in ([_x] call list_weapons)) AND !(_x in _active) AND alive _x)

game complains that list_weapons is undefined, its a function that has list of weapons and such

smart.sqf: http://pastebin.com/UvEf84fP
functions.sqf: http://pastebin.com/Bi8GZRh2

thin pine
#

@thorn saffron that moment when you're on mobile and the links aren't hyperlinked nor can you copy them without copying the entire quote

thorn saffron
cerulean whale
#

@sudden delta tfar has inbuilt functions to disable radio I believe... you could use that

sudden delta
#

@cerulean whale As a radio jammer?

cerulean whale
#

There us scripts to block radio signal if you are out of range. ... you could transform them into a jammer script

#

If a player with a jammer is nearby then block as if you were out if range

sudden delta
#

I will have to look into that, sounds a bit complicated though

prisma void
#

I want to create an Extension on a Win PC without using Visual Studio. My source code worked in VS but I canยดt get to work in any other IDE (CMake + CLion). Has someone experience wiht that?

thin pine
#

@thorn saffron see if list weapon is defined in the debug console

#

The fnc

#

If there was an error in the function the function would be undefined

little eagle
#

It isn't. That's why the game complains about it.

#

Yeah. Could be error in the function. Check RPT

thorn saffron
#

got it working, I missed a comma between one of the weapons

still forum
tough abyss
#

Would someone mind explaining this line of code, I just can't get my head around it no matter how much I read what the functions do
{!(lineIntersects [eyePos vehicle cameraOn, eyePos _object, vehicle cameraOn, _object])}
It's saying the line starts from the the position of the persons vehicle to the position of the object and ignore any other vehicles in the way and also ignore the object we want???

vague hull
#

nope, it checks whether a line between the camera eyepos and the eyepos of the target in intersected

#

we are just ignoring the two objects, because we want to make sure that something else is in the way

tough abyss
#

What do you mean by that?

still forum
#

Basically if you have direct line of sight to the target.

vague hull
#

exactly

#

the lineIntersection may be cause by you or the target itself

tough abyss
#

But why do we ignore the 2 objects we want

still forum
#

if nothing intersects between players camera (cameraOn may be different than player) and the target it returns true

vague hull
#

because the model is in the way of the LOS

still forum
#

because We wan't to see if something is between the objects. We don't want the 2 objects. We only want stuff between

vague hull
#

if you are laying in the ground and look backwards, your LOS from the eyepos may be intersected by your backpack, and thats what you want to avoid

still forum
#

Or theoretically eyepos is on your pupils. If you have glasses on these might intersect. But we don't care about that

tough abyss
#

Okay so specifically eyePos vehicle cameraOn returns the eyes of the player driving the vehicle, if this line of sight intersects with the objects line of sight whilst ignoring the vehicle which hes sat in and also ignoring object return true

still forum
#

" if this line of sight intersects with the objects line of sight"
no

#

Draw a line between the eyes of the player driving the vehicle and the object

#

just a straight line between the heads of both objects

#

if the line goes through anything besides vehicle cameraOn and _object then it returns false

#

like if a wall or a vehicle or a building or anything is on that line it Intersects so it returns false

tough abyss
#

Does it return false because of the ! operand, are you including that in your answer?

still forum
#

yep

#

easier: lineIntersects x y
returns if a line between points x and y intersects anything

tough abyss
#

Yeah I get what your saying mate, thanks for that I just need to understand why in this code now. Cheers ๐Ÿ‘Œ

#

It's nto gonna retrun false though is it?

#

Or could you say in other words it's going to be true aslong as it doesn't intersect with any objects

still forum
#

lineIntersects returns false if nothing intersects. combined with the ! it would return true if nothing intersects

tough abyss
#

Yea I'm there now I was tripping on that bit haha thanks

#

@still forum what would {!(lineIntersects [eyePos vehicle cameraOn, eyePos _object, vehicle cameraOn, _object])} return if the player wasn't in a car?

still forum
#

same

#

vehicle player == player if not in a vehicle

tough abyss
#

Ahhh

#

Okay brill

#

cheers

peak plover
#
allPlayers select 0
//It's headless_client
#

annoying

ivory timber
#

Can anyone help me with this?

still forum
#

I'd guess you are missing a ]
I don't see enoguh code so i can't help. Show me that section of the code

ivory timber
#

Sure

#

"extDB3" callExtension "9:ADD_DATABASE:Database2";

_life_sql_id = str(round(random(999999)));
life_sql_id = compileFinal _life_sql_id;
"extDB3" callExtension format["9:ADD_DATABASE_PROTOCOL:%2:SQL:%1:TEXT2",FETCH_CONST(life_sql_id),EXTDB_SETTING(getText,"Database2")];
    
"extDB3" callExtension "9:LOCK";
still forum
#

Uhm... Doesn't look wrong.. But i don't know whats inside FETCH_CONST and EXTDB_SETTING
But macros usually are written correctly ๐Ÿ˜„

#

That Database2 thingy. Did you set that in the settings somewhere? looks like it's retreiving something from a settings file

indigo snow
#

those macros shouldve been resolved at this point, no?

rotund cypress
#

Hey if I would like to pass in an array with say [0,0,0]

still forum
#

Right.. They aren't according to rpt

rotund cypress
#

Would this be suitable then? ```params [

[ "_array", [ 0, 0, 0 ], [] ]

];```

still forum
#

[[0,0,0]] call function; @rotund cypress

#

yes

#

if you call it the right way

rotund cypress
#

so

#

That is the params

#

And then i would do as you said

#

[ [1,2,1] ] remoteExecCall [ "function" ];

still forum
#

yep

rotund cypress
#

๐Ÿ‘Œ

rotund cypress
#

If I wanna make a string into code Im trying to use compile

#

But it gives me a value like { [ 0, 0, 0 ] }

#

When I have a string like "[0,0,0]"

#

Any thoughts?

austere granite
#

call compile

#

compile create a code block out of, hence { [0,0,0] }

rotund cypress
#

Ah there we go

austere granite
#

call the code block will return [0, 0, 0]

rotund cypress
#

Aah yeah I see lol

austere granite
rotund cypress
#

Thanks Ill have a look

ivory timber
#

Emm

#

Dont really see where those macros are

shadow sapphire
#

Does anyone know off the top of their head if there is a radio animation that isn't tied to other cutscene actions? I've found some good radio use animations, but they are all tied to part of a cutscene sequence, so I can't use them in game.

dusk sage
#

@prisma void You haven't really elaborated. Did you give an entry point for the extension? (VS will usually do this for you). Also, like Dedmen said, #arma3_tools is the better place

shadow sapphire
#

Hey, how might I make these two switch move animations work one right after the other during gameplay?

S1 switchMove "GetInHemttBack";
S1 switchMove "GetOutMRAP_01Pst";```
#

Trying to allow players to climb over taller objects without requiring an addon.

shadow sapphire
#

Anyone know anything about animations?

hallow timber
#

If you look in the animations viewer at the two animations, you should be able to see the length of time the animation takes

#

then just wait that amount of time before calling the next animation

#

also playMove may be better to make the transition smoother

shadow sapphire
#

playMove doesn't work for these animations, I did try it. Okay, so, I use like waituntil?

#

or sleep?

#

@hallow timber

hallow timber
#

I'm not really sure which would work best, I was thinking you could use sleep, but I'm just guessing with all of this

shadow sapphire
#

Oh, okay.

still forum
#

There is also a animDone eventhandler ๐Ÿ˜‰

shadow sapphire
#

Oh??

#

Now that might be what I need.

shadow sapphire
#

@still forum, it worked! Thanks!

#
S1 switchMove "GetInHemttBack";
S1 addeventhandler ["AnimDone",{
S1 switchMove "GetOutMRAP_01Pst";}];```
hallow timber
#

nice, thats a much cleaner solution

shadow sapphire
#

Problem is now I have to figure out how to make this crap actually do something other than play an animation. Would you guys recommend like getpos setpos or is there a better way to move a unit?

#

Right now, the animation plays, it looks fine, until the second animation, then it drops right back where it started, no actual climbing.

still forum
#

you may need to remove the eventhandler again after it fired ๐Ÿ˜‰

shadow sapphire
#

No, it was putting back where they started even when I just use one animation by itself.

#

I mean, you're probably right, but that isn't the cause of this particular problem.

#

Not the sole cause, anyway.

still forum
#

yep wasn't talking about that problem

#

yeah animations start from your position. your position doesn't really change while the anim is playing

#

Just checked what enhanced movement does. He sets the player position every Frame according to the current position in the animation

#
_poswt = _climber worldtomodel (asltoagl _pos);
_climber setposASL (agltoasl (_climber modeltoworld [_posWT select 0, _posWT select 1, _posWT select 2]));

I don't know what _pos is. I think it is the original pos of the player

#

It may be enough if you do that once in animDone

shadow sapphire
#

@still forum, that's brilliant!

still forum
#

@polar folio 's code

shadow sapphire
#

Just set it on the eventhandler. Perfect.

#

What is the regular default animation state called? Do you know?

still forum
#

switchMove "" ?

shadow sapphire
#

Dammit. I knew that. Thanks so much.

#

Hmm... this isn't working:

S1 switchmove "GetInHemttBack";
S1 addeventhandler ["AnimDone",{
S1 setpos (getpos S1 vectoradd [0,0,10]);
S1 switchmove "";
}];
S1 removeeventhandler ["AnimDone", 0];```

Any advice?
#

S1 is going back to default animation no problem, but S1 is always returning to default position.

indigo snow
#

you remove the EH immediately after adding it

shadow sapphire
#

I thought that's what I needed to do.

indigo snow
#

it never fires now ๐Ÿ˜› i guess you want to remove it after that setMove, so inside the EH itself

shadow sapphire
#

Oh! Okay.

#

@indigo snow, do you know how to always add one meter forward and three meters up from the object's current facing? Could I get a link or a template?

#
S1 switchmove "GetInHemttBack";
S1 addeventhandler ["AnimDone",{
    S1 setpos (getpos S1 vectoradd [0,0,10]);
    S1 removeeventhandler ["AnimDone", 0];
    S1 switchmove "";
}];```
#

Current iteration.

indigo snow
#

something like player setPosATL player modelToWorld [0,1,3];

shadow sapphire
#

Why do we use setposATL, instead of just setpos after getdir?

indigo snow
#

player might be on a building like some docks

#

if you use getDir youd have to get his facing, rotate the offset vector, add it to his current position and set him to that

#

using modelToWorld is more efficient

shadow sapphire
#

Okay! Alright... lemme take a crack at this....

indigo snow
#

modelToWorld returns posAGL which is the same as posATL over land

#

and im assuming youre not getting into hemmets whilst over water

shadow sapphire
#

HAha, yeah. I'm trying to create a mobility script. It's way over my head, but I'm ready to clock the hours.

#

error in modeltoworld. Expected array.

indigo snow
#

add some brackets

shadow sapphire
#

Don't know what I've done wrong.

#
S1 switchmove "GetInHemttBack";
S1 addeventhandler ["AnimDone",{
    S1 setposatl S1 modeltoworld [0,1,3];
    S1 removeeventhandler ["AnimDone", 0];
    S1 switchmove "";
}];```
indigo snow
#

player setPosATL (player modelToWorld [0,1,3]);

shadow sapphire
#

Ah, shit.

indigo snow
#

btw dont remove the 0 EH

#

remove _thisEventHandler and youll be guaranteed its the right one

shadow sapphire
#

I don't understand the syntax.

#

Also, we have a problem. The modeltoworld coordinates seem to be cumulative. Every time I run it, my object goes higher. First time it climbs 3 meters up, next time he climbs then teleports to six meters, then nine meters on the next attempt.

indigo snow
#

yea because i think the EH isnt actually getting removed

#

youre removing the 0 index one eacht time

shadow sapphire
#

S1 removeeventhandler _thisEventHandler;

#

Like that?

indigo snow
#

replace the 0 with _thisEventHandler

#

just the 0

shadow sapphire
#

Why do we do that? What does the zero mean?

indigo snow
#

so all event handlers get assigned a number and theyre fired in order

#

so you remove the 0 index (first) one every time

#

so if it actually has index 1 (second) it doesnt get removed

#

_thisEventHandler is a magic variable with the right number you need

shadow sapphire
#

Ah! Gotcha. That makes sense.

#

It's working well now! I just have to keep tweaking it to get it looking right.

#

I also have to figure out how to do keydown and check that there is something to climb, then make it work in multiplayer. Ugh!

indigo snow
#

for a keyDown youll need a displayEventHandler, which you can add to the main display (findDisplay 46)

chilly hull
#

Anyone know if it's possible to ressurect a player who has gone to spectator? I'm trying to add a zeus module that would allow us to ressurect players who died for certain reasons.

shadow sapphire
#

Main display?

#

@indigo snow, the wiki for displayaddeventhandler is WAY over my head.

#

@chilly hull, are you talking about for players who were killed by glitches or something like that?

chilly hull
#

That would be its primary use. Players fall through rocks sometimes. Tracked vehicles fly into the sky and various other things.

shadow sapphire
#

@chilly hull, If you're already using Zeus, consider using the Ares mod. Using Ares, you could just revive the player, then teleport them back to where they died. Might still require a tiny bit of scripting, though.

civic maple
#

Ares Achilles is better imo

chilly hull
#

I'm using Ares, but never saw any tool I could use in it

little eagle
#

I don't see any eventhandler here.

#

Time is not synched in Arma

#

One client can be at 24:00, the other at 23:30.

#

The slower the client is and the longer they are connected, the bigger the time desynch becomes

#

skipTime has local effects

#

And even without the commands, time is not synched.

#

If you want stuff to happen at a certain time, you monitor the time on the server and if 24:00 is reached, you call a global scripted event.

#

I doubt Arma has API for that by default.

#

remoteExec from the server

#

Predefine the function to remotely execute on the clients beforehand

#

// init
func = { ... };

#

there, predefined

#

it can then rest in memory until called by the server via remoteExec ["func"];

#

change "func" to whatever you want. With tag of course, since it's a global variable

#

No need for waitUntil at all

#

Well one loop on the server I guess

vague hull
#

What would you guys guess, how many AI would simulate the load of 50 Players? ^^

#

cpu and mem ofc, network cant really be simulated that way I think

rancid ruin
#

they do it by magic

vague hull
#

yep, well its just a bit harsh to get a good opinion of how the performance would be without having actual players testing it

#

but it kinda needs to be done

little eagle
#

An AI (group at least) does some stuff that a player unit doesn't have to do. So purely by processing time, one AI is more load than a player.

#

In theory.

#

Who knows what simplifications they do to AI.

rancid ruin
#

if you expect 50 people to play the mission then it should be easy enough to get 25 to help test it right?

little eagle
#

You can't compare that at all I'd say.

rancid ruin
#

that's why you charge people ยฃ25 to play your mission. then tons of people will come

vague hull
#

even if I would get 25 people to test it once, I would not be able to get that going every week

#

try it in debug console

#

I know, but if you type it in debugconsole then it will show the syntax

#

then you can just try what types are expected for the filter

little eagle
#

The debug console tooltip isn't right all the time either.

vague hull
#

numbers or strings would be my first pick

#

try -1

#

or 0

#

nah, just numbers

#

however

#

maybe its just time to make a mp stress tester mission

#

I mean more like: add that thingy to your missionfile on the mission/mod you are developing and then run it

#

so it doenst need no players

#

so thats good at least for testing the calculation load (CPS and FPS, memory usage and so on)

little eagle
#

Just store the effects inside an array

#

remoteExec a cleanup function

#

and that cleanup function iterates through the array with all the effects and deletes them

#

The whole script with that arrangement should just run locally and should be started by one remoteExec from the server

#

If you have a "musical arrangement", then you won't be able to keep that in synch with network delay

#

Hell, even scheduled scripts will desynch that music and the effects

tough abyss
#

Would someone mind explaining why we do _units-[player]; out of an array for example

_units = _units - [player];```
#

Removes the player from the array

#

So it returns any other object but player

#

What would the array look like if we didn't do that?

#

Well it would include your player in the array. You player is always the nearest object

#

Ohh I see

#

Thanks

little eagle
#

nearestObjects[(visiblePosition player)
๐Ÿคฆ

tough abyss
#

XD

cerulean whale
#

What's the style to make RscActiveText show an image?

#

It works fine with RscText but not RscActiveText

cerulean whale
#

I tried ST_Picture but that only works like stated above, with RscTect not ActiveText

cerulean whale
#

I figured it out. I needed type=CT_ACTIVETEXT

cerulean whale
#

Is there a way to execute a script on button hover?

little eagle
#

onMouseEnter The mouse pointer enters the control area. Returns control. Control

cerulean whale
#

Thx, @little eagle

cerulean whale
#

Weird, I am trying to set a ' onMouseButtonClick' EVH like this ```SQF
createDialog "HRP_radialMenu";

HRP_fnc_colorRadial = {
player setVariable ["test", 1, true];
};

[] spawn
{
waitUntil {!isNull (findDisplay 5055)};

        ((findDisplay 5055) displayCtrl 1602) ctrlSetEventHandler ["onMouseButtonClick", "[] call HRP_fnc_colorRadial"];
};
#

Just for debug purposes

#

but it doesn't seen to work... Hmm

#

Anyone got an ideas?

jade abyss
#

Erm, why don't you assign the action to the button itself?

#

Instead of using EHs. I am confused

native hemlock
#

It's probably not working because you are doing onMouseButtonClick, try MouseButtonClick

#

If you were adding it in the dialog config, like Dscha is suggesting, you'd use on beforehand, if you're using it with an event handler in a script, you don't use on

cerulean whale
#

@jade abyss I'm not actually using that. I'm trying to use onMouseEnter but that doesn't work either, so I was trying that one. and @native hemlock That doesn't work either

#

Wait, now I restart it again and it wroks

#

that's weird lol

jade abyss
#

No, its Arma.

#

UI Stuff -> Reload mission each time ๐Ÿ˜„

cerulean whale
#

This was a script

#

:/

#

I know about UI. But this was just a script I execed in console ๐Ÿ˜›

jade abyss
#

Wait until you wanna add/change Image to it ๐Ÿ˜‰

#

yep yep then

cerulean whale
#

Ik, I've been doing GUI's for awhile. Maybe I put my teamspeak push to talk key in at the very start and didn't notice the script error ๐Ÿ˜„

jade abyss
#

prolly

rocky marsh
dusk sage
#

Could be a few things

#

What was the value of _ammocount?

#

Did you have a weapon? @rocky marsh

rocky marsh
#

Yeah I had a weapon and I had 3 mags, all full up

little eagle
#
    _fuck = 0;
    if(_ammocount > 0) then
    {
        _fuck = _ammocount / _maxammo;
    };
chilly surge
#

Good evening.
Is there any chance of making a ammo hemmet into a smaller vehicle, like a humvee?
So you can rearm vehicles and turrets with ACE 3

little eagle
#

You cannpt change the model of objects in Arma and even if you could, they are both massively different config wise and that would cause all kinds of problems.

chilly surge
#

No, I think I sayed it wrong.
I would like to have like a "smaller Hemmet". Where you can rearm anything like the normal Ammo Truck

jade abyss
#

Only doable by Mod (search for "transportAmmo" in the Config.cpp's)

little eagle
#

You would like to be able to (ACE) rearm at a Humvee?

civic maple
#

Does anyone know the rate that triggers check if units are present?

halcyon crypt
#

not sure but I think triggers are supposed to be per frame

civic maple
#

Strange, my trigger would only activate if I went slow enough

jade abyss
#

iirc 0,5s

civic maple
#

fuck

#

Any way to make it quicker, or do I need to add a onEachFrame thingy and check the positions manually?

jade abyss
#

For what?

civic maple
#

Racing

jade abyss
#

Clientside, per frame EH, tiny 5m Radius Check or so

civic maple
#

kk

jade abyss
#
conditionStatement is evaluated every 0.5 seconds regardless of anything. If you have created a trigger, it is already evaluating its condition every 0.5 seconds.```
little eagle
civic maple
#

Is addMissionEventHandler local?

little eagle
#

Yes.

civic maple
#

Ok, thanks

#

Does getPos return the position of the center of the object?

jade abyss
#

Simply execute it, when standing somewhere.

#

if > 0 = center

little eagle
#

I think so. But does it fire for remote units?

#

The doc sucks.

woeful mirage
#

hat hier jemand plan von altis Life 5.0 ?

little eagle
#

English please.

dusk sage
#

AL? ๐Ÿ‘บ

woeful mirage
#

need help on Tanoa Life 5.0
I made new items (modelling) > Goldbar and a new shop to buy and sell.
My goldbar is a magazine and i cant sell it. This item isnt in "your inventory"

i think, the problem is this "_iS = [_x,_itemArray] call TON_fnc_index; in the fn_weaponShopFilter.sqf

_is = -1 and i dont know why

meager granite
#

check the function to see why it returns it

woeful mirage
#

merci

tough abyss
#

To set an agent locality to server i can use _agnt setOwner 0;?

#

Server id is 0?

#

@tough abyss oh my! Tremendous bug in my part!

#

Thanks!

#

I was using 0. This explain nuts situation.

#

@tough abyss in truth i saw that somewere, but not give credits: "server on 2?? Naaahh..."

#

And keepet using 0.

indigo snow
#

__SERVER__

little eagle
#

__SERVER__

#

np

tough abyss
#

SERVER______

#

i just added 20 _ + SERVER + 20 _

#

20 underscore + SERVER + 20 underscore

#

lol

#

and it worked

little eagle
#
\_\_SERVER\_\_

try this

tough abyss
#

___________________________________SERVER_______________________________________________

#

lol

#

@tough abyss can i use _agnt setOwner __SERVER__;?

little eagle
#

2 is the server

#

setOwner needs a number

meager granite
#

What's with everyone using isEqualTo instead of == ? ๐Ÿค”

#

It is slightly faster than ==, especially when comparing Strings

#

I guess this line might be the reason

#

I guess case sensitivity might reason why it compares quicker

#

isEqualTo might be dangerous for entities

#

entities?

#

yes

#

comparing two null entities will return true

#

its a useful trait of null is that its not equal to another null

#

simply replacing every == with isEqualTo might potentially break something

#

Also I guess _a != _b should be faster than !(_a isEqualTo _b) ?

#

the less commands the better

tough abyss
#

This dont work as i want (code exec in server) _agnt enableSimulation true; _agnt setOwner 2;, but this _agnt enableSimulation true; _agnt spawn {_this setOwner 2;}; works as i want. Any problem on that i need to consider? ๐Ÿ˜„ Thanks! It will be used many times, when the agents don't have a target and fall back to the server.

#

Seens the first command take some time to happens..

meager granite
#

Can you even setOwner 2 if server is not player? ๐Ÿค”

tough abyss
#

@tough abyss ok, but in the tests it returned true so it worked, but not update the object imediatily.

meager granite
#

Or was it fixed in A3?

#

setOwner 2 wasn't working on dedicated server

#

But I recall some talk about fixing it in A3

#

Fixed in rev. 129204.

#

yeah, fixed in A3

#

Feb 2015

#

2 years ago

#

@tough abyss Do you happen to spawn said _agnt on the same frame?

#

I recall there was issue with changing owner on same frame with entity creation

#

Only through scripts, client physically doesn't know other client ids

tough abyss
#

@meager granite zombies are created on server and have server locality, when they engage on a player, the zombie locality is transfered to the player machine and i use _zombie enableSimulation false on the server. When the zombie is not on engage anymore, its locality is set back to the server, this is when i use this code on server _zombie enableSimulation true;_zombie setOwner 2; but the zombie get teleported to the place he was when i disabled simulation.

#

if i exec that _zombie enableSimulation true;_zombie spawn {_this setOwner 2;}; the zombie don't get teleported.

meager granite
#

So the issue is teleporting, not transfering locality?

tough abyss
#

Yes, is teleporting, and it teleport because for the server the zombie is still on the place he was when i disabled simulation.

meager granite
#

When you disable zombie simulation on server it no longer updates its position there from messages received from client

tough abyss
#

The problem about setOwner was solved already thanks to @tough abyss.

meager granite
#

So when you transfer it back to server, server's position becomes real entity position

#

which was where you last disabled the simulation

tough abyss
#

Yes, but i enable simulation right before setting the ownerit.

meager granite
#

if you do spawn setOwner, there is a small time frame where position finally updates to whatever server got from real zombie owner

#

Otherwise you instantly change locality and whatever server knows about zombie state becomes actual zombie state

tough abyss
#

Any problem in using the code that works, with the aditional spawn? During a server time, 4 hours more or less, this can happens 1000+ times.

meager granite
#

and server only knows about last position on the moment of enableSimulation false

tough abyss
#

I see.

#

So its 1000+ spawn i will be creating.

meager granite
#

Practically it shouldn't be an issue

#

You can try to change ownership on next frame to make sure to avoid theoretical scheduler issues

#

_zombie enableSimulation true;
server_returnOwnership pushBack _zombie;

on each frame somewhere:
{_x setOwner 2} forEach server_returnOwnership;
server_returnOwnership resize 0;

tough abyss
#

I can't use a sleep because its unscheduled "place".

meager granite
#

spawn creates separate scheduled thread

#

its unrelated to where you create it from, scheduled or not

#

So you can use sleep inside that spawn

tough abyss
#

Thanks, i will leave the spawn on the code.

meager granite
#

doubt you need it though

#

I think my approach with setting owner on next frame might work

#

Just guessing that 1 frame will be enough for server to simulate the object and apply real position

tough abyss
#

also, on a 50 fps server and 5 fps server.

#

Only test will say

#

I will leave with spawn for now, without sleep inside spawn

#

If i got reported problems about that, i change things

little eagle
#

any easy way from client to get owner of remote unit? for P2P stuff
There is no P2P in Arma. It uses a server-client architecture. Every message goes through the server.

hollow lantern
#

Anyone knows whats wrong with this? ``` class AebianUI
{
class controls
{
class BLUECIRCLE : IGUIBack
{
x = "SafeZoneX + (795 / 1920) * SafeZoneW";
y = "SafeZoneY + (30 / 1080) * SafeZoneH";
w = "(128 / 1920) * SafeZoneW";
h = "(128 / 1080) * SafeZoneH";
text = "media\bluecircle.paa";
};
class REDCIRCLE : IGUIBack
{
x = "SafeZoneX + (1170 / 1920) * SafeZoneW";
y = "SafeZoneY + (30 / 1080) * SafeZoneH";
w = "(128 / 1920) * SafeZoneW";
h = "(128 / 1080) * SafeZoneH";
text = "media\redcircle.paa";
};
class MIDDLEWARE : RscEdit
{
text = "conquest_score_west | conquest_score_east";
font = "EtelkaNarrowMediumPro";
x = "SafeZoneX + (909.166666666667 / 1920) * SafeZoneW";
y = "SafeZoneY + (29.166666666667 / 1080) * SafeZoneH";
w = "(250 / 1920) * SafeZoneW";
h = "(105 / 1080) * SafeZoneH";
};

};

}; ``` The UI is not getting displayed sadly when using cutRsc ["AebianUI","PLAIN"]; or I just didn't understand how UI works

meager granite
#

any errors?

#

Why you have no idd, duration or name defined?

#

Not sure if these are actually required

#

Are you sure its in RscTitles?

#

also try cutRsc with layer number

tough abyss
#

Any problem in doing that? _obj setVariable ["dmg",0,true]; _obj setVariable ["dmg",0.5,false];

meager granite
#

no

tough abyss
#

Thanks!

hollow lantern
#

@meager granite well File C:\Users\Aebian\Documents\Arma 3\missions\[A]_Rising_Sun.Woodland_ACR\game_dialog.hpp, line 4: /AebianUI/controls.BLUECIRCLE: Undefined base class 'IGUIBack'

#

if I try to add them via class XY; I don't get an error but its still not shown

meager granite
#

Well you don't have IGUIBack class defined to reference it

#

Are you including any kind of config with base classes?

#

Check what classes you have there

hollow lantern
#
class RscFrame;
class RscText;
class RscListbox;
class RscControlsGroup;
class RscCombo;
class RscButton;
class RscStructuredText;
class RscButtonMenu;
class IGUIBack;
class RscEdit;

class AebianUI
{
    class controls
    {
        class BLUECIRCLE : IGUIBack
        {
            x = "SafeZoneX + (795 / 1920) * SafeZoneW";
            y = "SafeZoneY + (30 / 1080) * SafeZoneH";
            w = "(128 / 1920) * SafeZoneW";
            h = "(128 / 1080) * SafeZoneH";
            text = "media\bluecircle.paa";
        };
        class REDCIRCLE : IGUIBack
        {
            x = "SafeZoneX + (1170 / 1920) * SafeZoneW";
            y = "SafeZoneY + (30 / 1080) * SafeZoneH";
            w = "(128 / 1920) * SafeZoneW";
            h = "(128 / 1080) * SafeZoneH";
            text = "media\redcircle.paa";
        };
        class MIDDLEWARE : RscEdit
        {
            text = "conquest_score_west |  conquest_score_east";
            font = "EtelkaNarrowMediumPro";
            x = "SafeZoneX + (909.166666666667 / 1920) * SafeZoneW";
            y = "SafeZoneY + (29.166666666667 / 1080) * SafeZoneH";
            w = "(250 / 1920) * SafeZoneW";
            h = "(105 / 1080) * SafeZoneH";
        };





    };
};
dusk sage
#

holy batman

hollow lantern
#

but ArmA says that AebianUI not found :x

meager granite
#

cutRsc requires displays to be defined in RscTitles

#

Are you sure its there?

#

Or are we talking addons here?

#

Looking at config referencing its addon

hollow lantern
#

I just want some UIs to be displayed in my mission. no AddOn

meager granite
#

Is this class defined inside RscTitles in description.ext?

hollow lantern
#

hmm actually not. Wasn't sure if I really need RscTitles for that :x

meager granite
#

You do, if you want to use display in cutRsc, you need to have it in RscTitles

#

Displays outside of it can be used for dialogs (createDialog)

fathom cloud
#

_keyDown = (findDisplay 46) displayAddEventHandler ["0x1A",;"hint str _this";objecthidden true;]
_keydown = (findDisplay 46) displayAddEventHandler ["0x1B",;"hint str _this";objecthidden false;] Can someone tell me what is wrong with this (im new to scripting and this is supposed to be an early version of a stealth script)

meager granite
#

everything wrong

fathom cloud
#

ok ๐Ÿ˜ฆ

#

any tips?

dusk sage
#

every wrong, is that you commy?

#

๐Ÿ˜„

meager granite
#

This is the list of events you can add to display with displayAddEventHandler command

#

Since you want key presses, use KeyDown event handler

fathom cloud
#

ok

meager granite
#
myKeyDownFunction = {
    _key = _this select 1;
    if(_key == 0x1A) then {
        player hideObject true;
    };
    if(_key == 0x1B) then {
        player hideObject false;
    };
    hint str _this;
};

(findDisplay 46) displayAddEventHandler ["KeyDown", {call myKeyDownFunction}];
#

Here is what I guess you wanted to do

fathom cloud
#

wow thats right

#

lol

meager granite
#

Do you call this from init.sqf ?

fathom cloud
#

yeah i was using arma edit without knowing what to do

meager granite
fathom cloud
#

ok thanks for the help

rotund cypress
#

Hey guys, is there any way of getting a resource title ctrl to resize itself automatically depending on how much text is inside it?

meager granite
#

only by height

#

no command to return actual text width unfortunately

fathom cloud
#

Is there a toggle for true and false for this myKeyDownFunction = {
_key = _this select 1;
if(_key == 0x1A) then {
player hideObject true;
};
if(_key == 0x1B) then {
player hideObject false;
};
hint str _this;
};

(findDisplay 46) displayAddEventHandler ["KeyDown", "call myKeyDownFunction"];

#

it makes an annoying sound when i walk

meager granite
#

it makes sound because of hint command

fathom cloud
#

ok

hollow lantern
meager granite
#

it says duration in AebianUI, not one of controls

hollow lantern
#

oh lol okay then I should add a default for that

#

thx

dusk sage
#

@rotund cypress If you hardcore in at how many characters you need a new line, you can work from that

fathom cloud
#

ok i removed the hint and its not annoying anymore

royal abyss
#

is there a script published to make every building and all walls & fences indestructable ?

fathom cloud
#

Whats the script to add particles?

hollow lantern
#

hmm not sure what this error should tell me. Google wasnt helpfull /RscTitles/: 'c' encountered instead of '{'

meager granite
#

@royal abyss no you can't make fences invincible, you still can destroy them through collision

#

@fathom cloud look into drop command

dusk sage
#

The config errors are often ambiguous, can you post where the issue is coming from? @hollow lantern

royal abyss
#

@sa Matra that realy sucks...^^

hollow lantern
#

@dusk sage ^

hollow lantern
#

o m g, I just oversaw that on line 24

#

thanks for this

dusk sage
#

happens ๐Ÿ˜ƒ