#arma3_scripting

1 messages · Page 457 of 1

still forum
willow rover
#

so it detaches with but I am unsure why its not returning it.
{
detach _x;
} forEach attachedObjects player;

still forum
#

yes.. that code detaches it and doesn't return it...

meager heart
#

"I attached the NPC to my Pelvis and everything was fine" 😮
Warning: 🔞 🚳

verbal otter
#

@meager heart try'ed, but still is not work 😦

#

to marker with text

meager heart
#

hmm

verbal otter
#

get it working 😄

#
"markertextsd12D22" setMarkerColor "ColorWhite";
"markertextsd12D22" setMarkerTypeLocal "KIA";
"markertextsd12D22" setMarkerText "Не входить! Ведётся военное положение!";```
meager heart
#
private _marker = createMarkerLocal ["markertextsd12D22", player];
_marker setMarkerColorLocal "ColorWhite";
_marker setMarkerTypeLocal "KIA";
_marker setMarkerTextLocal "Какой-нить текст тут";
#

setMarkerText vs setMarkerTextLocal

still forum
#

Какая ето bуква

You didn't give me a b to copypaste :u

meager heart
#

б Б < b

still forum
#

Какая ето буква

meager heart
#

это*

still forum
#

oh. oops

#

long time no russian

meager heart
#

lol

winter rose
#

since Arma 2 I guess 😄

meager heart
#

where you get that experience from tfar guys, Dedmen ? 😀

still forum
#

correct

#

no. I could choose Russian in school. And I did because I wanted to read the signs on cherno in DayZ

meager heart
#

ahaha

#

like Березино

#

Электрозаводск 🤔

earnest path
#

Электрозаводск = Powerstation 😃

fossil yew
#

Do Extended_PostInit_EventHandlers get run for every client that connects to the server?

still forum
#

for every client that has the eventhandler in his config

fossil yew
#

ok

earnest path
#

Березино = Willowtree if i am not mistaken

verbal otter
#

Старый Собор 😄

earnest path
#

Старый Собор = Old Market

verbal otter
#

xD

#

Old Church maybe

meager heart
#

березино - береза - birch

earnest path
#

Aha

#

Birchtown 😃

meager heart
#

yeah

winter rose
#

where all the birches are

still forum
#

Always wanted to continue learning it. But don't have time. So i'll probably stay at alphabet and a couple words :U
eta otschen kraciwui kniggi

meager heart
#

😀

still forum
#

or kraciwaja kniga?

meager heart
#

both right

#

books or book

#

книга - book
книги - books

still forum
#

In class I got a very bad mark for singing a russian song. Now I'm humming it on my way to work

meager heart
#

lol

#

guys saying it's hard to learn

still forum
#

just like most other languages. Just small additional barrier cause of the alphabet

meager heart
#

well yeah, japanese is hardest

still forum
#

😄

meager heart
#

(probably)

still forum
#

🈵 🈚 🈹 🔣 🕉

meager heart
#

omaewa mo shindeiru

winter rose
#

NANI??!

still forum
#

Ohayo gozaimasu

meager heart
#

kon ban wa

winter rose
#

konnichi waaa
dat offtopic 😄

still forum
#

@meager heart do you write scripts in russian? do you know if russian variable names work in russia?

meager heart
#

never tried tbh

still forum
#

I think it might be locale dependent. Russian letters might work in russia but not other countries. country specific scripts... wouldn't that be awesome?

meager heart
#

😀

#

next level protection

winter rose
#
private _scriptPath = localize "STR_scriptPath";
execVM (_scriptPath + "\myScript.sqf");
still forum
#

XD

winter rose
#

you could already do that to dub in English or a different language ^^

meager heart
#

russian variables don't work (just error)

still forum
#

._.

meager heart
#

or nothing

#

so.. nope

still forum
#

https://feedback.bistudio.com/T82940 The " Error: Object(4 : 13391) not found" spam in RPT. As I already suspected it seems that BI didn't fix the issue. Exactly as their changelog said. They fixed the "lag" caused by that, that afaik no one reported. But they didn't fix the actual issue it seems

carmine maple
#

after using "addMagazineTurret", how can i skip the reload process?
setWeaponReloadingTime seems to be a way, but is not really good

meager heart
#

probably -noLogs have some effect (perfomance) because of spam only

#

Yoshi_E 😀

carmine maple
#

having a long reload time after spawning the unit might not be so bad after all 😃

compact maple
#

Use infinity bullets lol

winter rose
#

a dirty way would be to remove/add the weapon

#

"hacky"

earnest path
#

@still forum I actually asked a question here i think regarding the RPT causing lag due to filesize. I am so glad they fixed it

still forum
#

they didn't though

#

the RPT spam and the issue are both still there

earnest path
#

😦

#

I guess RAMdrives untill they fix it

winter rose
#

noLogs and SSD should be enough

still forum
#

very unlikely that they will

earnest path
#

They should just change the reporting level of that stupid thing to debug and allow to be enabled if required by the CMD flag

#

I think we should all spam @lavish ocean with Object not found messages 😃

winter rose
#

hue hue hue
a little background exe parsing your logs, automatically e-mailing one line of report 😄

little eagle
#

How about one fixes the errors and drops the shitty mods?

earnest path
#

If you read trough the report a way to reproduce it rapidly changing Gear on a unit . Make a loop with 100 itterations and your log gets spammed. So i agree maybe its caused by the mods but why does it happen when you changing backpacks too ?

#

This was the example given

for [{_i=0}, {_i<100}, {_i=_i+1}] do { 
    player addBackpackGlobal "B_TacticalPack_ocamo";
    player addBackpackGlobal "B_TacticalPack_oli";
};
little eagle
#

What kind of mission rapidly changes the gear like that?

earnest path
#

Its a test

digital jacinth
#

not that extensive, but zeus missions apply loadouts to freshly spawned units

#

at least my missions do that

little eagle
#

That's silly. Might as well use diag_log and then complain about the rpt being big.

#

tf is a zeus mission?

winter rose
#

Curator?

little eagle
#

That's also called zeus, yes. What about the mission part?

still forum
#

@little eagle What kind of mission rapidly changes the gear like that? Arsenal does it.

digital jacinth
#

curator or what the plebs call it, zeus

still forum
#

not that fast of course. But even a hand full players setting up their equipment at mission start cause the problem

winter rose
#

of course ><

little eagle
#

indeed

#

INDEED

still forum
#

I'm not off course

#

I'm right on track

winter rose
#

😛

little eagle
#

It hurts.

#

How big is a man?

#

In Arma?

still forum
#

course means something. Ad of course means something completly different. wtf is this

#

1.70-1.80

little eagle
#

-0.10 ?

digital jacinth
#

ye they live underground normally

little eagle
#

Why would I take ANYTHING written in a forum for granted?

still forum
#

Okey between 1.60 and 1.82m depending on stance

little eagle
#

That's 10 people that have no clue talking about what I don't know either.

still forum
#

actually.. Between about 0.2 and 1.82m depending on stance

gleaming oyster
#

Yes, eating the dirt stance indicates your height :p

little eagle
#

I want to add a man height at 100,200,300,400m to my debug reticle.

lone glade
#

it depends on zoom and fov too 😛

digital jacinth
#

Just place a vr block that has a defined size next to a unit that has no weapon equipped

still forum
#

1.8 for that then

little eagle
#

alganthe, it will always be the same amount of milliradians.

#

No matter the fov.

#

1.8 it is.

meager heart
#

pso stadiametric rangefinder says 1.7

#

!!1

little eagle
#

I'm 1.90

meager heart
#

i'm 185 + - 2

#

BUT pso...

winter rose
#

on the battlefield, you're never standing still like a stick in the mud

#

so, 1.7 is a good measure for a stand-up position, even if you're 1.80

meager heart
#

last time played battlefield long time ago 😄

winter rose
#

#

has left

molten folio
#

is setCamUseTI usable in arma 3?

meager heart
#

yes

#

nvg also

molten folio
#

ty

meager heart
#
0 spawn {
    true setCamUseTi 0; 
    [player, "HAI 1.0 CAN HAS ? TI KTHXBYE", 80, nil, 270, 1] spawn BIS_fnc_establishingShot; 
    waitUntil {!isNil "BIS_fnc_establishingShot_playing" && {!BIS_fnc_establishingShot_playing}}; 
    false setCamUseTi 0;
};
#

@molten folio

winter rose
#

dat LOLCODE… I made a terrible mistake

meager heart
#

yes 😄

#

and thanks for that

molten folio
#

@meager heart ty

astral tendon
#

other way to check if the AI unit have the weapon raised?

winter rose
#

not weaponLowered?

astral tendon
#

urg

#

that was bad

winter rose
#

!weaponLowered if you prefer

astral tendon
#

I mean, a way to detect if the AI have the weapon lowered or raised (check the commets in the page)

winter rose
#

is the note still up-to-date, have you tried it?

#

things may have been corrected

astral tendon
#

nah, cant test it right now.

winter rose
#

I may be able to, hold on

meager heart
#

don't know what are you doing, but afaik ai's will keep weapons lowered only in safe behaviour, so maybe you can check behaviour, if it possible... 🤔

astral tendon
#

nop

winter rose
#

if they are in "SAFE" mode but you lay down, they will do the same

#

and I just tested, still player only

astral tendon
#

AI some times walk with their weapons raised

winter rose
#

it always returns false for AI.

astral tendon
#

oh well..

winter rose
#

maybe parsing the anim name…?

gleaming oyster
#

animStateChanged ? 😬

#

What's the end goal here?

meager heart
#

stance _unit != "PRONE" + behaviour check 🤔

winter rose
gleaming oyster
#

so why tf cant you use weaponLowered in this case again?

winter rose
#

STANCE Amov: Sras - raised - aimed weapon ready for fire in horizontal position Slow - lowered - weapon in ready state, not aimed

little eagle
#

Those names are not consistent for all animations. I wouldn't rely on them.

gleaming oyster
#

Can someone test if
seems to only work on players ?

winter rose
#

I did - player only

well, for normal AI anims it should be fine?

#

I would toArray the anim name,
grab S position, the 3 letters after and check if they are ras or low

meager heart
#

commy said it already, that animation state name, will change, Lou

winter rose
#

how comes?

#

they are in a certain format, nay?

meager heart
#

that is anim name AinvPknlMstpsnonWnonDnon_medic_1

#

that is state on that anim amovpknlmstpsraswrfldnon_amovpknlmstpsnonwnondnon

#

and there you have X number of states

#

for 1 frame of animation

#

and funny thing that is will report only final state, not elements... if that make sense

#

🤔

#

grab S position, the 3 letters after
so that 3d letter could be anything

#

till anim done

#

BUT

#

you need not the last state ?

#

😕

winter rose
#

well, go weaponDirection if you must then 😄

#

~~via animationState:

_animation = animationState _unit;
_weaponLowered = ("slow" in _animation && !("sras" in _animation));
```~~
ruby breach
#

Could you potentially do something with (animationState _unit find "sras" > -1)

winter rose
#

<string> in <string> seems not to be in Arma yes 😄

ruby breach
#

Yeah, have to use find

#

Good thing is that animationState already returns lowercase, so no need for a toLower

meager heart
#

probably yes (about to find sras 😄), but idk is it reliable for different animations

winter rose
#

not a 100% proof solution but will sure help 99.8 times

#

hence both check, "slow" and not "sras"

astral tendon
#

"Number: Delta Y, Text will move up or down depending on value (Optional)"

#

can some one add a note that the value of the number you set effets the speed that its moves

#

like
1 goes downwards fast
0.1 goes downwards really slow

winter rose
#

1 = height of the monitor (or safeZoneH I don't remember)
make Duration ×10 and it will move at the same speed

#

it's an offset, so the more you set the further it will move

molten folio
#

is it possilbe to add more functions to thissqf buttonSetAction [1009, "[] spawn AdminVehicleList"];

still forum
#

yes

#

just put more into there.

molten folio
#

in the quotes?

still forum
#

Is that a trick question?

molten folio
#

or coma than quotes?

#

bro im just asking.....

still forum
molten folio
#

i looked at it doesnt help

still forum
#

Does that look like commas would make sense?

molten folio
#

nvm

winter rose
#

is it possilbe to add more functions to this

buttonSetAction [1009, "[] spawn AdminVehicleList; [] spawn anotherFunction; player setDamage 0"];

@molten folio

wary vine
#

why button setaction at all ?

#
(_display displayCtrl _idc) ctrlAddEventhandler ["ButtonClick",{
  [] spawn blah;
  [] spawn blah;
}];
molten folio
#

thanks @winter rose

hollow thistle
#

Would BIS_fnc_addScriptedEventHandler be enough for mission like liberation or should we look into CBA custom event system?

#

What is the biggest advantage from using cba system? Better locality handling?

polar folio
#

doesn't it depend on the event in question? i think the BIS stuff is limited to certain events. mostly end game and zeus stuff by the looks of the wiki

hollow thistle
#

You can define your own events via bis function.

cosmic lichen
astral tendon
#

Thanks

hollow thistle
#

The listed events are events that are fired by various bis scripts.

polar folio
#

i think i'm blind. can you point me to the function?

hollow thistle
#

the one I named...

#

for eg. ```sqf
[true, "KPLIB_sector_capture", {hint "Sector captured" + _this select 0}] call BIS_fnc_addScriptedEventHandler;

#

And later you can fire it via:

[missionNamespace, "KPLIB_sector_capture", ["sector name"]] call BIS_fnc_callScriptedEventHandler; 
#

I'm just wondering what is the advantage of CBA handlers.

meager heart
#

we have default ownerchanged scripted EH for the sectors

little eagle
#

Scripted event is always on the local machine, while cba has global, remote, target, server event etc.

hollow thistle
#

I'm not using bis module for sectors @meager heart

little eagle
#

Also, the overhead of scripted events is pretty bad from what I remember.

hollow thistle
#

For CBA too or BIS stuff only?

#

I guess internaly it holds something like an array of handlers and searches for one with given name to be called?

#

Some overhead might be acceptable if it does not fire frequently.

little eagle
#

It's a hash on a dummy "object".

#

Yeah, the functions are stored in an array.

#

Well, some CBA events fire every frame.

#

In medical and fatigue.

hollow thistle
#

Ok, ty for info. I think I will go with bis events for now as I want to use it on things that dont fire "too much" eg. "sector captured", "player bought unit" etc.

little eagle
#

Btw., you read what I wrote about the vectors and positions this morning?

hollow thistle
#

Me? I was not asking about anything vector related recently. 😛

#

But I've read that 😄

little eagle
#

Omg, oh well, someone did.

hollow thistle
#

^^

#

I see BIS scripted events look almost the same way I wanted to implement this when I did not know there is their implementation of this.

unborn ether
#

So you actually can detect if arsenal is opened.

gleaming oyster
#

Couldn't you just see if the display is open?

little eagle
#

absolute

gleaming oyster
#

?

meager heart
#

!isNull (findDisplay _idd) ? 🤔

unborn ether
#

dont forget you need waitUntil and proly while for that.

#

I hope scripted EVH does it better, tho 😄

meager heart
#

does it better what ? 🤔

#

Couldn't you just see if the display is open?
!isNull (findDisplay _idd) <

#

ez

#
soldiers are blown up by mine
vehicles are shelled by artillery
air units are hit by AA missile
underwater units are simply killed.
#

looks like nice function

unborn ether
#

lol

#

want to try it

meager heart
#

works! 😄

unborn ether
#

But I dont actually see mines explosion or artillery coming

meager heart
#

there is

unborn ether
meager heart
#

wow allowDammageexist...

#

Alias of allowDamage 🤔

edgy dune
#

would EH would be used to detect when a bullet hits anything, killed, hit, or deleted? im using the fired EH to attach a EH to the bullet ,this is what I got

_this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    
    _projectile addEventHandler ["Deleted", {
    params ["_entity"];
    
    "Deleted EH fired" remoteExec ["hint"]; 

    }];
    
    _projectile addEventHandler ["Killed", {
    
    params ["_unit", "_killer", "_instigator", "_useEffects"];

    "Killed EH fired" remoteExec ["hint"]; 
    
    }];
        
    _projectile addEventHandler ["Hit", {
    params ["_unit", "_source", "_damage", "_instigator"];

    "hit EH fired" remoteExec ["hint"]; 
    }];

}];
#

and no hints are made

little eagle
#

CfgAmmo objects don't support any eventhandlers.

#

Only CfgVehicles.

edgy dune
#

damn makes sense

#

y it wasnt working

meager heart
#

when a bullet hits anything
probably only with hit eh
but when you add it to a unit and when unit is hit
also with fired you can wait until isNull projectile but that not when bullet will hit something (when EH was added in the right way)

little eagle
#

Dude.

#

CfgAmmo objects don't support any eventhandlers.

#

Period.

#

Sorry, no patience today anymore.

meager heart
#

its ok

little eagle
#

Not your fault, I had to explain someone how an EOTech works.

meager heart
#

nah np man, all cool

#

probably the worst is a ricochets or when projectile already penetrated some object... 😀

fringe yoke
#

Is it possible to run a script once on server start?

little eagle
#

init.sqf

digital jacinth
#

if you do not want to add the script in every mission you could also make a mod which runs that script post or even pre init.

fringe yoke
#

@little eagle Isn't that for the start of a mission?

#

I want a file that runs when a dedicated server is started

digital jacinth
#

That is not how things work. If there is no mission loaded, technically there are no userscripts running.

#

so you pretty much just want a script to run once on misison start

little eagle
#

Well, depends on what Brett wants to do.

#

There's always a way. I got groups renamed in the lobby.

digital jacinth
#

true, but that was probably not so easy to manage

#

btw i love that feauture

little eagle
#

The question was if it was possible, not feasible. But depending on what's to do here, it may be easy although obscure.

fringe yoke
#

I am fine if I need to use a mod, but the thing I want to do takes upwards of 10 seconds.

#

and does not require a mission be loaded

little eagle
#

Check put CfgFunctions preStart or if CBA, Extended_PreStart_EventHandlers.

#

That's some addon config classes that can get either a function to run or a config script at session start.

fringe yoke
#

ah, can't believe I didn't check there. that should work. thanks.

little eagle
#

It is very strangely named. "preStart", to me it seems like, a program cannot do anything "before started".

#

onGameBoot = 1;
or something is how I woulda shoulda coulda.

fringe yoke
#

too bad there isn't something like postMissionInit and postClientInit / postServerInit

#

that would make a bit more sense

little eagle
#

Well, postInit is a thing.

#

Idk what else that should do.

fringe yoke
#

I know, just saying it would be nice to have more EHs with more intuitive names

little eagle
#

True.

#

But it seems like the scripting community was/is just as bad as it as BI.

#

Or maybe it's consistency, consistency on a low level.

tame portal
fringe yoke
#

The server does not just run one mission

#

preStart looks like it should work, but I can't test atm

little eagle
#

What are you doing? Keep in mind the mission namespace is whiped at mission start, so use ui namespace if this is for caching.

fringe yoke
#

I am dumping an all in one config to disk

tame portal
#

If you make it persistent and autoinit it will pick aossion though if correctly configured

#

But that would mean you'd either have to set one specific mission with the code to check if the server just started

#

Or have the code be in all missions

little eagle
#

If the server is on auto start anyway, one could just set a flag in ui namespace to not do the same thing twice and use preInit. OPTiX, doesn't sound like a work around like that is needed here,

#

Much more reliable than serverTime guessing.

tame portal
#

Posted it before knowing what he wanted to do 😅

#

Didn't know UI namespace persists over mission change

little eagle
#

That's the point of it. And it's another horrible name.

#

It should be named caching namespace, because that's its main purpose really.

#

Or sessionNamespace.

cosmic lichen
#

I added that info to the wiki.

tame portal
#

That's a a really terrible name then......

#

I would have NEVER expected uiNamespace to be session persistent

peak plover
#

morning performance 🤔

#

So

#

would there be any performance improvement in sqf

#

I have an array with data for ai/groups

#

Which will be like [group,patroldistance,cachingdistance etc. etc.]

#

right now I do

_aiArray call cache;
_aiArray call patrol;
_aiArray call alter;
etc.
#

in all of those I use params

#

if I just use params before calling those and then
just call them with no parameters

#

It doesn't do those params commands and assign new variables, whcih are used in all of those

winter rose
#

yes, params does local variables (_var)

peak plover
#

So I'm wasting a lot of time doing the local variables

winter rose
#

?

peak plover
#

Like in every function

#

It just creates new local variables

#

Wasting precious fps

#

So my question is
Using an object and getVariable instead of that array. Would actually be a lot slower, right?

#

If I have an array and I lay out the data before hand

#

Then call all the functions

#

vs

#

I call the functions and lay the data needed out in every one of those

#

vs

winter rose
peak plover
#

I call the function and grab data from an object instead

#

I can just do

_aiArray params ['_cache','_patrol','_altert','_fight'];
call ai_patrol;
call ai_cache;
call ai_fight;
#

and those variables will be available in there anyway

#

This shoudl be faster then saving into a new namespace anyway?

#

Another thing

#

wouldn't it be even faster

#

if I have multiple arrays

#

and I use index

winter rose
#

please, one big message

peak plover
#

to seleect the array for a certain ai group

#

Okay

winter rose
#
_aiArray params ['_cache','_patrol','_altert','_fight'];
[_cache, _patrol, _altert, _fight] call ai_patrol;
[_cache, _patrol, _altert, _fight] call ai_cache;
[_cache, _patrol, _altert, _fight] call ai_fight;
peak plover
#

yeah

#

but

#

I don't even have to relay the variables to the function

#

If I already define them

#
_var1 = '5';
call {
    systemChat _var1;
};
winter rose
#

does this ↑ work?

peak plover
#

Sure

winter rose
#

so you're good to go with your solution

peak plover
#

yeah

#

But

#

I'm contemplating getting variables from a new namespace I create.
The new namespace would be easer to access, but

_cache = aiNamespace getVariable ['ai_cache',[300,500]];
vs
_cache = aiArr_cache select _i;
compact maple
#

What are you trying to do exactly ?

peak plover
#

optimize

winter rose
#

does it need optimising?

peak plover
#

I realized iterating through ~500 ai groups will take me ~2 seconds
but this is because my fps is ~50-100

Sometimes fps goes lower than that.
So at around 20 fps it takes like 8 seconds to iterate through 500 ai groups

#

And so on

winter rose
#

@peak plover why not use missionNamespace on the server then? a public variable, no underscore, but without transmitting to the client

peak plover
#

I was using a location for namespace

winter rose
#

I don't see the point, but okay

peak plover
#
_cache = cacheArr select _i;
_patrol = patrolArr select _i;
_fight = cacheArr select _i;
_alert = cacheArr select _i;
call ai_fight;
call ai_patrol;
call ai_cache;

vs

_aiArray params ['_cache','_patrol','_altert','_fight'];
call ai_patrol;
call ai_cache;
call ai_fight;

vs

_cache = _namespace getVariable 'ai_cache';
_patrol = _namespace getVariable 'ai_patrol';
_alert = _namespace getVariable 'ai_alert';
call ai_fight;
call ai_patrol;
call ai_cache;
winter rose
#

#2.

peak plover
#

Is it faster to have multiple arrays in 1 namespace containing all info and use iteration.
Or is it faster to have 1 array and keep all the data for a group in there
or is it faster to use a namespace

winter rose
#

depends.

#

"Premature optimization is the root of all evil." – Donald Knuth

peak plover
#

This is not premature 'tho

#

this is after the fact

#

That I'm being limited to ~200 groups to keep things running 'ok'

winter rose
#

use solution #2 , and as I said:

does it need optimising?
because if so, you will get more performance working on these:
https://community.bistudio.com/wiki/Code_Optimisation
#

a poor var assignation is not going to save you 5 FPS.
also, use solution #2: params

peak plover
#

It will if there's tons of data and tons of iterations that I need to do < 3 seconds

#

If it's more than 5 seconds, fast moving vehicles will cause players to see ai spawn in in front of them when uncaching etc.

#

even from switching from private [] to private _blah I saw like huge gains a while ago

tender fossil
#

Which one of these is correct syntax?

if (_isHQdeployed && _i == 1 && _extra == "") then {

or

if ( (_isHQdeployed && _i == 1) && (_extra == "") ) then {
#

The latter I assume?

digital jacinth
#

All of them. since those are all and conditions all of them have to be true

#

grouping them results into the same result every time

#

all you can do is optimize the condition so it returns false earlier without the need to check all 3

tender fossil
#

Ah, I see it was a bad example, let me make a new one

#

(Haven't drunk my morning coffee yet lol)

#
if ( (_isHQdeployed == 1) && (_extra == "") ) then {

or

if ( _isHQdeployed == 1 && _extra == "" ) then {
winter rose
#

both equivalent

tender fossil
#

I see, thanks! 😃

winter rose
#

if you want to stop on the first encountered "false", you may want to use lazy evaluation like

if ( _isHQdeployed && { _i == 1 } && { _extra == "" }) then {

but on such small conditions it is not worth it

tender fossil
#

Yup

winter rose
#

parenthesis are useful if you have an || (or) and you want a certain order to be evaluated

tender fossil
#

Alright. Thanks for the tip 👍

winter rose
#

👍

#

good luck, soldier!

compact maple
#

does the function getDamage exist ?

#

pretty weird that’s there is setDamage and getDammage

digital jacinth
compact maple
#

alright thanks

warm gorge
#

I've asked this question before, but unfortunately wasn't able to figure out the issue. Does anyone know what could cause the 'Continue' button in a RscDisplayDebriefing to force the player out of the server fully compared to just the lobby role selection area? I'm calling this: ["Abort", true, false] call BIS_fnc_endMission;

#

Sometimes its fully out of the server, other times its just to the role selection screen. Not sure what causes either.

winter rose
#

I don't know if this could be the cause.
if you use something else, does it work properly?

warm gorge
#

What do you mean by use something else?

winter rose
#
["Abort", true, true] call BIS_fnc_endMission;
"EveryoneLost" call BIS_fnc_endMissionServer;

something like that

warm gorge
#

This is just per player, I don't want the mission to end for everyone. It's basically called in a script which is called when the player clicks the abort button in the escape menu. My way overrides the default Abort button and runs this custom script instead, which ends with ["Abort", true, false] call BIS_fnc_endMission;

#

Just very confused why it's only sometimes kicking them out fully

winter rose
#

maybe this specific command is not the problem, it may be a global issue

warm gorge
#

@winter rose Figured out the issue. I was running a script that closed all open displays and I didn't exclude some important ones which seemed to cause this issue

winter rose
#

👍 !

still forum
#

@peak plover yes params outside of calls is better.
and select is faster than getVariable.

@winter rose stop giving bad advice 🔨

winter rose
#

what did I say again

still forum
#

advising him to take all parameters out. Then putting them back together and passing them as argument just to take them out again.

winter rose
#

I'm confused… anyway

peak plover
#

I reckoned that, thanks for confirming

#

But dedmen

#

What about 1 array per group
vs
10 big arrays and selecting _i to find info for certain group

still forum
#

again. getVariable is slower than select

peak plover
#

No

#

I mean

#
_groupArray = [_group1data,_group2data];
vs
_group1data_1 = _data1 select _i;
_group1data_2 = _data2 select _i;
daring pawn
#

Hi gents, im trying to select a trigger via a name given to it as triggerText setTriggerText as the trigger is dynamically created and its variableName is not known. Is it possible to select a trigger near a marker (its spawned with same dimensions as a marker)?

    _list = (getMarkerPos _mkr) nearObjects 1;
    systemChat str(_list); systemChat str(_mkr);
    _trigger = _list select 0;
    if (typeOf _trigger == "EmptyDetector") then { systemChat format ["Deleted %1",_trigger];deleteVehicle _trigger;} else {systemChat format ["Tried to delete %1 but it wasn't a trigger ;(",_trigger];};

Ignore the shitty debugging, im just trying to see that it is returning the correct thing, but unfortunately it always returns https://i.imgur.com/YeRfC82.png "helipadempty.p3d" however when I do it as a player with:

_list = player nearObjects 1;
_trigger = _list select 0;
systemChat str(_trigger);

When im right ontop of the position, it returns the correct thing of <no shape>

still forum
#

you have to get the data out of both variants @peak plover
Big arrays don't have performance impact. select is constant time if you know the index that you want

#

So. Go for the route that needs less select's

peak plover
#

Yes, but is it better to store a lot of data in multiple arrays or multiple smaller arrays in a big array?

#

Okay less selects is so much prettier too

still forum
#

"better".
with the big array you first have to get the small array out

#

and with multiple arrays the question is how do you get to them?`

#

Above you showed using getVariable to get the multiple smaller arrays.

#

and as I said getVariable is slower

peak plover
#

gotcha

still forum
#

I'd say have one big array. With smaller inside.
And always make sure to modify by reference if you do lots of modification

peak plover
#

@daring pawn
is this trigger local or public(multiplayer)?

#

Aite thanks

daring pawn
#

public. Its multiplayer

#

for some clarity. https://i.imgur.com/TP7MkmS.png. The red one has a trigger created over it. I know the name of the red marker and the triggerText of the redMarker but I can't delete the trigger because I need to know its name

still forum
#

why are you only getting the first element that was found? What if the trigger is the second? you should check all elements that nearObjects returns and find the trigger

peak plover
daring pawn
#

Well firstly when I increase the area doing it the first way, its not even detected unless its via "player". Secondly my theory was if the range was 1 and the trigger was spawned exactly on top of the marker, there was no way it could be anything but the trigger in element 1

peak plover
#

So it's like clear squares mission/

still forum
#

Insurgency! :3

peak plover
#

My advice is that having a trigger per square with house will cause lag

#

Don't do it

#

Create markers - > markers into array - > ```sqf
{
private ["_side","_marker"];
_side = nil;
_marker = _x;
_pos = getmarkerPos _marker;
{
if (position _x inArea _marker) exitWith {
if (side _x isEqualTo east) then {_side = 0;};
if (side _x isEqualTo resistance) then {_side = 0;};
if (side _x isEqualTo west) then {_side = 2;};
};
}count allunits;
if (!isNil "_side")then{
[_side,_marker]call {
params ["_side","_marker"];
private ["_side","_marker"];
if (_side isEqualTo 0) exitWith {
_marker setMarkerColor "ColorEAST";
_alpha = markerAlpha _marker;
_marker setMarkerAlpha 1;
_marker setMarkerAlphaLocal _Alpha;
};
if (_side isEqualTo 1) exitWith {
_marker setMarkerColor "ColorGUER";
_alpha = markerAlpha _marker;
_marker setMarkerAlpha 1;
_marker setMarkerAlphaLocal _Alpha;
};
if (_side isEqualTo 2) exitWith {
_marker setMarkerColor "ColorWEST";
_alpha = markerAlpha _marker;
_marker setMarkerAlpha 1;
_marker setMarkerAlphaLocal _Alpha;
};
};
};
true
} count ins_gridmarkers;

daring pawn
#

Yea essentially like Insurgency. Im making everything myself mostly out of learning and some more control of things

still forum
#

don't use triggers. Just store the list of markers and periodically go through all of them to check them

peak plover
#

I made that a few years ago, use that for inspiration if you wanna

daring pawn
#

So at the moment, the player themselves checks if the square is clear and all that works just fine. I've got the enemy unit spawning/caching all made myself with no dramas (its probably kinda horrific but its pretty efficient)

#

Oh so it would be better to loop through the markers?

peak plover
#

trigger per square <<<<<<<<<<<<<<<<<<<< markers in array and check them via inArea or sth like that

#

You can heavily optimize with findIf or such

#

LMAO, just realized I have params and private array 🤦🏻

daring pawn
#

was about to ask why both ~_~

peak plover
#

Old code, didn't know what params does

#

Don't pasta that, use it as inspiration 😄

daring pawn
#

Nah aha I didn't plan on it. So really quickly, how are you suggesting to loop through the markers to achieve the same effect that I have currently with my triggers that are spawned on the markers?

#

The triggers are much larger than the marker itself so it spawns the units for that marker way before the player is actually in it

peak plover
#

Ohh, you use the triggers to spawn the units?

daring pawn
#

Yea yea. So basically what I need is, when the square is blue(or void of any hostiles anymore) to delete the trigger so the process I have doesn't then spawn more units

#

I've got all the bits im describing already except for the ability to delete the trigger

#

because I can't give the trigger a variable name (thanks arma) and don't know how to detect it any other way

peak plover
#

okay

#

pseudo codeish

#

This won't be fastest

#

But probably easy to udnerstand

daring pawn
#

once I can select it and delete it I can work it from there

#

just a nudge/some pseudo is awesome

peak plover
#

create a location for every square (createLocation) On server or HC.
Create a marker and setVaraible to the location. (also save a variable that u can identify this location from normal locations)

loop through the PLAYERS (there are less players then grids) [bear in mind locations are only available to where they are created] {if headless client crashes everythign breaks}
https://community.bistudio.com/wiki/nearestLocations

if player has a location ~700 meters -> activate it (spawn ai) [you can add a setVariable (location) and onKilled EH for the ai to save the amount for that location]
Move activated location to separate array (you can check if the activated location has no players near it now(~1000m) and (delete) the units if no players at it.

For persistence you can have a function that creates a savable array from the locations and their variables or sth like that.

You can access the information like marker or alive units or whatever for that specific grid with _location getVariable ['insLoc_marker',''] etc.

#

Might not be the fastest, but quite easy to manage as opposed to arrays for everything. Location and setVariable is like Object Orientated Scripting. U can also delete a location and such and such

daring pawn
#

hmm, in the long term that does sound more ideal

#

Need to redo a fair chop of things, but im getting close on malden already to probably too many triggers and i've hit a wall a bit with my issue as above

#

Good food for thought and I think really the best way to do it. cheers @peak plover i'll need to rework things

peak plover
#

Yeah, I loaded up a insurgency mission on takistan with all triggers and the performance was TERRIBLE

daring pawn
#

It goes great on Malden or smaller. Any bigger, yea performance really eats it

peak plover
#

Another cool trick you can do is check if the locations have a location near them and spawn a vehicle or a bigger enemy force if there's a huge cluster of grids without any manual input on setting up cities etc.

#

Like here

#

debug circles

daring pawn
#

Oh yea fuark i didn't think of that benefit. I started to code my stuff around detecting nearby markers and stuff but its a bit messy

peak plover
#

Don't worry if it's messy

#

Just make it work

#

And then iterate over your code and optimize

#

If you try to make it perfect first time around, you will never get anything done

#

I literally make some things and then realize I need more features or sth doesn't work as planned, So I just make a copy of the whole thing and start one over while using the original code as inspiration

daring pawn
#

Yea no nothing i would have got done if I tried it perfect

late gull
winter rose
#

@late gull every BIS_fnc_module* is a function that is called by an editor's module - in this case Curator module

late gull
#

yes, but isn't possible use it by code?

winter rose
#

it is, but most likely not recommended

hollow thistle
#

@peak plover thanks for your detailed writing about "locations". Might be useful for liberation rewrite. 😄 (using markers currently)

peak plover
#

No problem ;)
Glad you find it useful!

daring pawn
#

hey @peak plover

_looping = true;
[_looping] spawn {
    _looping = param [0];
    waitUntil {PMF_GridsDone};
    while {_looping} do {
        {
            _nearbyLocations = nearestLocations [position _x,["NameCity","NameVillage"],PMF_ActivationDistance];
            {
                PMF_ActivatedLocations pushBackUnique _x;
            }forEach _nearbyLocations;
        }forEach playableUnits;

        {
            //[str(_x)] call EO_Render; // Spawn the units
        }forEach PMF_ActivatedLocations;

        while {(count PMF_ActivatedLocations) > 0} do {
            hintsilent format ["%1",PMF_ActivatedLocations];
        };
    };
};

This is the sort of track im on atm. Im confused as to having the reverse effect of players near location not locations near player

little eagle
#

🤢

daring pawn
#

Im sorry @little eagle 😭 I said it wouldn't be neat 🤣

peak plover
#

U can use Invisible as location type

#

Easier to filter

daring pawn
#

Alright done that, it didn't list that as an available location type

peak plover
#
_nearbyLocations = nearestLocations [position _x,["Invisible"],PMF_ActivationDistance];
{
    call {
        private _isInsLoc = _x getVariable ['loc_isInsLoc',false];// this is set when location is created
        if (!_isInsLoc) exitWith {};
        private _isActive = _x getVariable ['loc_isActive',false];// 
        if (_isActive) exitWith {};
        _x call PMB_fnc_activateLocation;
    };
}forEach _nearbyLocations;
lone glade
#

jesus christ.....

peak plover
#

I'd do sth along those lines

little eagle
#

Sometimes the magic is too magical even for me.

peak plover
#

🤔 what did he mean by this

lone glade
#

that we both got an aneurysm from reading this

peak plover
#

🤔

daring pawn
#

gotta learn some how @lone glade thats why im here, unfucking my things 😃

peak plover
#

Feel free to pitch in 😆

lone glade
#

oh hell naw, i've already given enuff

daring pawn
#

at my level of knowledge, functional is better than the levels of optimization yourself or commy aim for in larger projects

hollow thistle
#

I wonder why you wrap it in call {...}; in the forEach? Are doing it to use exitWith as "continue" that you can find in "normal' languages?

#

exitWith in loop scope "breaks" loop, doesn't it?

still forum
#

exitWith also breaks the loop without the call didn't read the code

peak plover
#

in that case

#

It exits the call <code> block

#

Not the loop

#

It's to avoid if (then)

lone glade
#

you use a call each loop, which is worse

#

and also doesn't make sense because it's less readable

still forum
#

^ true

hollow thistle
#

So you kinda "emulated" continue.

still forum
#

a simple if would be better

peak plover
#

It is worse?

lone glade
#

you could use a switch

peak plover
#

Switch is heall slow

#

hella

lone glade
#

O.o

#

eeerm, no

hollow thistle
#

I guess it is less performant as it creates another scope.

peak plover
#

I did a few tests once and I tried multiple conditons and if (cond)then {} etc.
And i got the fastest results by running the least amount of code everytime

call {
    if (cond) exitwith{}

}

means it will only run the necessary checks

#

if i recall correctly if then else is slower than call if exitwith

#

in some cases

#

I didn't test it long enough to know EVERYTHING about it

#

But I just remembered that call exitwith is fastest way to do it in sqf.
Also I find switch hard to read.
call exitwith just makes sense to me 🤷🏻

lone glade
#

the calls to add the list entries (for 600+ items) take 147ms

still forum
#

It's so slow because of the switch!

#

throws stones

peak plover
#

@lone glade can u swtich the switch with call exitwith ? 🤔

lone glade
#

if I want to make it slower and less readable sure 😄

lone glade
#

I think my hand went through my skull after facepalming this hard

peak plover
#

switch is slower

#

in sqf

still forum
#

that's because the exitWith actually exits. The switch runs till the end

peak plover
#

I have concluded the same. I'll use call exitwith until I can prove other methods faster 👆🏻

lone glade
#

i'm fairly sure that should be the least of your worries right now

still forum
#

Also...

_nearbyLocations = nearestLocations [position _x,["Invisible"],PMF_ActivationDistance];
_nearbyLocations select {_x getVariable ['loc_isInsLoc',false] && {_x getVariable ['loc_isActive',false]} && {_x call PMB_fnc_activateLocation; false;}};

may not need the false at the end depending on what activateLocation returns

peak plover
#

and a _newArr = before 2nd line

still forum
#

no

#

you are not using that. So why store it in a variable?

#

the fastest if is _cond && {<true code>}

little eagle
#

I'm not sure actually. Only if-then-else vs. cond-&&-||

lone glade
#

the difference in speed is so minimal it may as well not exist^

little eagle
#

You're the one defending count vs. forEach, alganthe.

lone glade
#

oh god

#

i'm not commy

#

YOU COMMIE

daring pawn
#

does a while loop wait for a ForEach loop to finish before continuing?

still forum
#

thaaat

#

question makes no sense

daring pawn
#

okay uh

still forum
#

the while loop executes it's code before continuing

#

because otherwise... How should it run faster than it... runs.

#

paradoxon

little eagle
#

does a while loop wait for a ForEach loop to finish before continuing?
Code is executed from top to bottom.

daring pawn
#

yea I see the spectrum in what I just asked the moment I asked it and re-looked at my code... I did a silly...

still forum
#

😕

little eagle
#

I don't see any benefit of using modelToWorld for spawning an object.

still forum
#

how is modelToWorld related to spawning a house?

#

oh.

#

buildingPositions

atomic crow
#

Its for a life server, im trying to work with custom house's and having troubles with spawning vehicles

little eagle
#

Wait, spawning inside a house?

still forum
#

so the house is in a random position that you don't know. And you want to get the position of the garage to spawn the vehicle inside it?

atomic crow
#

I place the vehicle in the garage where it should spawn then log the position and the vehicle doesnt spawn in the position i had set

still forum
#

how are you spawning it?

little eagle
#

Did you use getPos?

still forum
#

I don't care about life crap

#

how are you spawning it. What script commands

lone glade
#

use NONE as special placement

little eagle
#

harsh

#

CAN_COLLIDE

lone glade
#

otherwise the createVehicle command finds a safe pos

#

oh right it's can collide 😄

little eagle
#

I think it's a problem of using getPos returning AGLS when AGL is needed.

lone glade
#

🤦

still forum
#

wow man

#

What script commands

lone glade
#

holy fucking shit

still forum
#

script. Not config.

lone glade
#

you guys hardcode the pos of the garage

atomic crow
#

Its default altis life.

still forum
#

I think that's supposed to be a position relative to house

lone glade
#

you sure? 270m in the air? 😄

little eagle
#

6700 meters relative?

still forum
#

As I said. I don't care about life crap. You are asking a scripting question so I expect you to show me the script that has the issue

#

If that config is the issue. Then ask in a life forum. We don't know what that is

little eagle
#

Yeah, should ask life devs how it works. It's not scripting.

atomic crow
#

my mistake

#

Honestly, they don't help much just get ignored half the time lol

still forum
#

Sounds like life yeah 😄

atomic crow
#

I've never worked with non vanilla house's to be honest. First time

still forum
#

They are not really different. Houses are houses

cold pebble
#

Interesting, don't see one message from you in the other discord 🤔

atomic crow
#

I dm people

#

that I used to know

cold pebble
#

Honestly, they don't help much just get ignored half the time lol

#

Lets not claim things then

still forum
#

So you DM a few people instead of publicly just asking thousands that might help you like you did here?

atomic crow
#

I've publicly asked yes, but no response

still forum
#

@cold pebble your search is incorrect. You have to include the ID

cold pebble
#

1 sec

still forum
#

your discord searched for a from: without a name and some message containing "Drunken" and "Cheetah"

atomic crow
lone glade
#

my eyes

#

light theme monster

cold pebble
still forum
cold pebble
#

Last time I checked you weren't ignored at all ^_^

still forum
#

why are you asking on how to use modelToWorld after someone told you to use worldToModel?

atomic crow
#

I meant worldToModel by bad.. and I honestly forgot that guy even replied lol

cold pebble
#

...

still forum
#

Lifer problem solved. Next please.

little eagle
#

modelToWorld

#

MTW

#

worldToModel

#

WTM

#

mfw

digital hollow
#

Arma is rather trans friendly, then?

still forum
#

no. Men only.

#

There are some 3rd party womans. But they aren't as good as the vanilla men

lone glade
#

I think his joke was more centered around commy's comment

#

wooooooosh

still forum
#

my joke was centered about Arma not having woman

lone glade
#

women*

still forum
#

are you trying to say my joke was bad?

lone glade
#

and it does have a woman being represented

#

remember the skype call that last through LOW?

digital hollow
#

My Terrain When

still forum
#

no Arma doesn't even have woman. women would need multiple woman

#

no I don't. Me not played low

lone glade
#

well you hear the voice of a woman through skype, meaning that arma has a woman

still forum
#

woooo man.

winter rose
#

OFP had Angelina
ArmA 1 had the "the Thing" reporter
Arma 2 had grandmas and hookers (both?)
Arma 3 has LoW Skype chat

little eagle
#

no Arma doesn't even have woman. women would need multiple woman
SET THEORY

#

The only thing I like even more than linear algebra.

still forum
#

What was the command to get the position of a memory point in a model? I thought there was one

little eagle
#

selectionPosition

compact maple
#

Hey, is there a simple way to transform an array into a string, without using the dirty way splitString & joinString ?

little eagle
#

joinString

#

... can you give an example?

lone glade
#

.... i'm... interested too.

#

muzzle flash, no typing

#

SHUSH

little eagle
#

Also, if the goal is to create a string out of an array, how would splitString help if it does exactly the opposite???

still forum
#

transform an array into a string?.... str

lone glade
#

aaaaaand he ruined it ^

errant jasper
#

Also, toString .

little eagle
#

format ARRAY

lone glade
#

no, toString doesn't do what you think it does @errant jasper

little eagle
#

Well,depends on what the array actually is.

errant jasper
#

It doesn't convert an array of unicode code points to a string?

little eagle
#

Maybe it's an array of ASCII codes.

lone glade
#

true, but I doubt it

little eagle
#

@compact maple We need your help.

#

lol

lone glade
#

unless he wants to smash together each element and make a string out of it? 😛

still forum
#

Ahhh now I know what he meant

little oxide
#

I think, he want just to string the array with all elements inside

compact maple
#

lol

still forum
#
_array = [1,2,3];
_arrayAsString = "ARRAY";

There.

little eagle
#

Put quote marks around it!

compact maple
#

i mean transform this :
[0,0,0,0]
into :
"0,0,0,0"

little eagle
#

"[1,2,3]"

peak plover
#

@still forum 😆

little eagle
#

[0,0,0,0] joinString ","

#

How is that dirty? That is as good as you can get with sqf.

lone glade
#

i'm still failing to see what splitString has to do with this

little oxide
#

And the fastest way too

little eagle
#

And the fastest way too
naive

peak plover
#

What's problem with joinString or str [1,2,3]

compact maple
#

    _data = [0,0,0,0];
    _data = str _data splitString """[]" joinString "";


lone glade
#

you got a " extra

little eagle
#

That's just wrong.

peak plover
#

🤦🏻

little eagle
#
    _data = [0,0,0,0];
    _data = _data joinString ",";
ruby breach
#

splitStringToArrayString

lone glade
#

actuall... no, just... wat

#

what was the thought process there?

compact maple
#

@lone glade its not extra...

little eagle
#

Brainfart

errant jasper
#

Yo dawg, I heard you like to join strings, so I split some strings for you to join.

lone glade
#

yeah, because I didn't expect you to do """ something"

#

that's.... stupid

little eagle
#

ACHTUNG ACHTUNG

#
    _data = [0,0,0,0];
    _data = _data joinString ",";
lone glade
#

I know commy

#

but why the hell did he add an empty string there

compact maple
#

oh fuck

#

joinString

little eagle
#

This does the same thing, but with less digging holes to fill them up immediately after.

compact maple
#

is enough

still forum
#

str _data splitString """[]" joinString ""; wao..
str _data select [1, count str _data -2]

compact maple
#

Example 3:
["1",2,text "3"] joinString ""; // "123"

#

seems to be what i need...

little eagle
#
["1",2,text "3"] joinString ","; // "1,2,3"
#

?

compact maple
#

hm so, thanks for the tips xD

little eagle
#

I wrote "," and not "". Don't you see the comma?

#

Maybe discord eats commas now.

#

OpenOffice, which I am stuck with at work atm. ate my .xml doc.

#

Never trust computers.

still forum
#

Nope.

#

Trust computers. But never trust humans

little eagle
#

I don't trust programs written by humans.

sonic ocean
#

guys i'm trying to create a sort of battle royale game mode with no mods and i'm trying to make a script that makes a zone that gets smaller and killes everyone outside of it after a warning
i'm a bit new to scripting so i would appreciate the help.

little eagle
#

I have an idea on how to implement this with as little effort as possible.

sonic ocean
#

ive tried to do it with triggers only but it doesn't work out (to many triggers[150])

lone glade
#

depends on how much you're willing to pay for it

little eagle
#

haha, funny.

#

It's like 15 lines of code. If you pay for this, you're being ripped off.

lone glade
#

well, we both know this

#

he doesn't :kappa:

little eagle
#

Why do you want money all of the sudden, alganthe?

lone glade
#

I was thinking you'd ask for it commy

#

not me

little eagle
#

If this gave money, it would be work, and work is no fun.

lone glade
#

I got a lil' bag of chocolate for ACE3 Arsenal commy, it all went downhill from there

little eagle
#

I thought you knew me.

#

From Nick?

lone glade
#

yes

little eagle
#

He's awesome.

lone glade
#

most delicious chocolates EVER

little eagle
#

I got some too.

#

Swuisse chocolate.

sonic ocean
#

dam commy2 a real community helper never thought that this community was this awesome

little eagle
#

Is that how you write it?

lone glade
#

swiss*

little eagle
#

okay.

lone glade
#

suisse if you meant to write it in french

little eagle
#

🐸 🐌

#

Serenity, I'll just write something very basic but functional after dinner, and maybe you can expand on that later.

sonic ocean
#

ill try ^^

still forum
#

what you get for winter?

sonic ocean
#

but thanks man

still forum
#

wtf

#

what did my brain do there

lone glade
#

it's discord ded

still forum
#

dinner I meant

sonic ocean
#

no idea but i got nothing

lone glade
#

I keep forgetting words or getting magic autocorrect

still forum
#

you mean discord is secretly modifying my messages to make me think my brain is focked?

lone glade
#

I think

#

so therefor I am 😛

still forum
#

e*

lone glade
#

lies

still forum
#

c*

little eagle
#

How do I check if a marker exists?

still forum
#

_marker in allMapMarkers but that seems crappy

little eagle
#

Good enough.

still forum
sonic ocean
#

_triggerActivated = _this select 0;

#

?

still forum
#

what?

sonic ocean
#

what?

still forum
#

no.

sonic ocean
#

no.

#

im trying

little eagle
#

This will be better than triggers, believe me.

sonic ocean
#

i believe in 2 things

#

you

still forum
#

humanity is the wrong second thing

sonic ocean
#

k

#

then

little eagle
#

setMarkerType "ELLIPSE";

#

This errors, how the hell do I create a marker in this game? -.-

#

setMarkerShape

#

Shape, not Type

#

Silly me.

still forum
#

that's 67 lines though.. not 15

#

you gotta remove some of these useless newlines to make the script faster

little eagle
#

grr. Give or take 50 lines. What's that between friends?

still forum
#

Depends on what friends

little eagle
#

This took me almost 15 minutes to make including testing. I am disappointed in myself.

astral tendon
#
[] spawn {
_title = 0;
if (true) then {_title = "test"};
hint str _title ; //works and show t"est"
};

[] spawn {
if (true) then {_title = "test"};
hint str _title ;// error undefined
};

Some one care to explain why this happens?

meager heart
#

shrinking_matchzone! sounds dangerous 😄

little eagle
#

Well, how is this trope named?

still forum
#

That happens because the variable is undefined

#

@astral tendon

little eagle
#

I have no idea, Arma is the only video game I played in the last 10 years.

still forum
#

local variables are defined in the current scope and visible in lower scopes

astral tendon
#

I am seting that at the if statment, so why is undefined?

meager heart
still forum
#

because that's how scopes work

little eagle
#

Roque, variables carry over into child scopes, but not parent scopes. It always matters which scope your variable belongs to.,

astral tendon
#

though, why can i edit it on a child scope?

little eagle
#

Still waiting for alganthe's comment on my script.

still forum
#

Because variables carry over into child scopes which commy just said

little eagle
#

Because the assignment operator without private does walk through all parent scopes and changes the variable if the identifier is already used in a parent scope.

#

Which is why assigment without private is a much more complicated endevour than assignment with private, even though it looks shorter written down as script.

meager heart
#

shrinking_matchzone > variable_size_playground 🤔

#

no...

#

sound shit

#

nvm srry

little eagle
#

I don't think PBUG did this first.

astral tendon
#

This same rule aplies to script load order?

still forum
#

what is "script load order"?

little eagle
#

I don't understand either.

still forum
#

no. init.sqf always executes before postInit

little eagle
#

Never check this, Dedmen.

still forum
#

yeah bad example

little eagle
#

Could be world view altering.

still forum
#

it probably doesn't

little eagle
#

Who knows, they're scheduled and we all love that.

sonic ocean
#

@little eagle thnx man

little eagle
#

Does it even work?

sonic ocean
#

not tested it yet but i believe

little eagle
#

Good answer.

sonic ocean
#

@little eagle can this work on a server ?

meager heart
#

lol

still forum
#

is has isServer inside it.. What do you think? 😄

sonic ocean
#

let me be retarded

little eagle
#

The only place this wouldn't work is in SP or local host when using savegames, because you said "no mods" and options are limited without recreating a whole scripting library.

sonic ocean
#

and also one more retarded question how do i activate it

#

i feel bad

#

knowing nothing

little eagle
#

Do you know what init.sqf means?

sonic ocean
#

yes

little eagle
#

Well, the script says in line one, "place me inside the init.sqf".

sonic ocean
#

well

#

i

#

am

#

a

#

bit retarded

little eagle
#

At least your replies are intelligible.

sonic ocean
#

lol

little eagle
#

Sometimes it's like talking to chimps.

sonic ocean
#

i placed it but still does nothing do i need to set something in game?

little eagle
#

🤔 That's weird.

#

Go to

#

%LOCALAPPDATA%\Arma 3

#

And search for the latest RPT file

#

Then open it with some editor and copy paste the contents to pastebin or something similar.

#

And then post the link here.

sonic ocean
#

no arma 3 in there -_-

viral gust
#

LPT: Use "Everything" search tool by Void Tools to find any file on your system instantaneously based on various criteria (e.g. ".rpt")

meager heart
#

C:\Users\<user_name>\AppData\Local\Arma 3 < try this @sonic ocean

sonic ocean
#

thnx

digital hollow
#

%localappdata%\Arma 3

little eagle
#

That's what I posted, no?

digital hollow
#

Oh, sure is!

#

But I made it pretty.

sonic ocean
little eagle
#

I hope windows will appreciate your efforts and decide to find the files.

meager heart
#

maybe he don't know where to put that... (%localappdata%\Arma 3 < that) 🤔

little eagle
#
19:38:16 Error in expression < spawn ENGIMA_CIVILIANS_StartCivilians;
S>
19:38:16   Error position: <S>
19:38:16   Error Undefined variable in expression: s
19:38:16 File C:\Users\quint\OneDrive\Documents\Arma 3 - Other Profiles\Sgt-I%2eSerenity\missions\PVP.sara\Engima\Civilians\ConfigAndStart.sqf, line 27
19:38:16 Error in expression <ceCPR_probabilities = [40,40,15,70];
 
 
med1 additem "adv_aceCPR_AED";
med2 addi>
19:38:16   Error position: <med1 additem "adv_aceCPR_AED";
med2 addi>
19:38:16   Error Undefined variable in expression: med1
19:38:16 File C:\Users\quint\OneDrive\Documents\Arma 3 - Other Profiles\Sgt-I%2eSerenity\missions\PVP.sara\Scripts\ADVMEDICALSETTINS\case0.sqf, line 8
sonic ocean
#

i do i didn't chow up please stop moking me

little eagle
#

There's a script error in the mission. If the code I posted is written after this, then it's probably never executed or something.

sonic ocean
#

k il set it front

#

it works now but i don't see anything on the map

#

no zone so i don't know if i'm inside it i just get killed

little eagle
#

hmm, strange. It was supposed to show up as blue marker.

sonic ocean
#

private _radius = 100;
private _position = [0445,0490,0];

little eagle
#

Maybe increase the _radius? 100 meter is maybe too small and you missed it.

sonic ocean
#

can i change the private position?

little eagle
#

Sure. To whatever the center of the circle should be.

sonic ocean
#

@little eagle can this be activated by a trigger so the script only runs when a trigger is activated

little eagle
#

Sure, but it has to be a trigger that is executed everywhere.

sonic ocean
#

why not in a certain area

#

Do i need to put it in a diffrend sqf file for the trigger activated

hollow thistle
#

@little eagle
So last sunday we were talking about checking if units are around area. You said that checking with allUnits inAreaArray position "beats all".

#

I've checked that and it seems that using nearEntities is faster.

#

Am I missing something? 🤔

#

Also I don't get why count variant of nearEntities was consistently a liiiitle bit faster than findIf (I was using bis performance benchmark thingy but I've used it a lot of times to get average because it seemed to return inconsistent results.) The more units are found by nearEntities the slower count method will be.

little oxide
#

yeah but nearEntities can check only sphere zone instead of inAreaArray that can check rectangle and ellipse

#

And number of allUnits when testing ?

hollow thistle
#

It is in my gist. I've tested on single unit and 100

little oxide
#

Yeah, fuck me, didn't see

wary vine
meager heart
#

looks like setAnimSpeedCoef in action 🤔

little eagle
#

Am I missing something?
Well, everyone inside a vehicle or static weapon for starters.

gleaming oyster
#

@meager heart It's like road runner whenever you have it super high, your unit runs in place for a bit then ZOOOM

meager heart
#

ZOOOM is op 😔

#

needs nerf

gleaming oyster
#

😉

unborn ether
#

@meager heart Its it exactly.

gleaming oyster
#
scriptName "fn_grantSuperpowers.sqf";
params["_unit",objNull];
_unit setAnimSpeedCoef 10;
meager heart
#

better try this

#
0 spawn {
    [
        player,
        "Maximum speed",
        "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\transport_ca.paa",
        "\a3\ui_f\data\gui\cfg\Debriefing\enddefault_ca.paa",
        "true",
        "true",
        {player setAnimSpeedCoef 1},
        {
            private _progress = param [4];
            player setAnimSpeedCoef (linearConversion [0, 24, _progress, 1, 5]);
        },
        {player setAnimSpeedCoef 1},
        {player setAnimSpeedCoef 1},
        [],
        10,
        0,
        false,
        false
    ] call bis_fnc_holdActionAdd;
};
#

😄

#

pictures is a bit off...

#

@gleaming oyster

gleaming oyster
#

0_0

#

Amazing! 😄

meager heart
#

lol

meager heart
#

what is the easiest way to check if vehicles are occupied by anybody (ai/player) ?

gleaming oyster
#
_occupied = count crew _veh > 0;

?

meager heart
#

well yeah...

ruby breach
#

~~I wonder if this would be marginally faster ```sqf
private _occupied = (crew _veh isEqualTo []);

meager heart
#

don't know... probably fullCrew kinda more reliable way

still forum
#

@ruby breach it will be faster. But return invalid results.. So it's kinda useless

quasi rover
#

why _shooter has any?

player addEventHandler ["HandleDamage",
{
    params ["_unit","","","_source"];
    private _shooter;
    if((_source != _unit) && (side group _source == side group _unit) && (lifeState _unit == "INCAPACITATED")) then {
        if(!(isPlayer _source) and ({_source in crew _x} count allUnitsUAV > 0)) then {  //if UAV crew,
             _shooter = (uavControl (objectParent _source)) select 0;
        } else {                                                                         //if just AI or team player
             _shooter = _source;
        };
        [_unit, _shooter] remoteExecCall ["fnc_teamkill_Feed"];    
    };
}];
still forum
#

because that's not how private keyword works

#

it should actually be a syntax error.

#

private is a modifier to =. You don't have a =

#

also

        if(!(isPlayer _source) and ({_source in crew _x} count allUnitsUAV > 0)) then {
             _shooter = (uavControl (objectParent _source)) select 0;
        } else {
             _shooter = _source;
        };

->

        private _shooter = if(!(isPlayer _source) and ({_source in crew _x} count allUnitsUAV > 0)) then {
              (uavControl (objectParent _source)) select 0;
        } else {
              _source;
        };
winter rose
#

private "_shooter"; should work too

#

¯_(ツ)_/¯

quasi rover
#

thx 👍

little oxide
#

Attachto to memorypoint, the object attached follow the memorypoint if memorypoint moved by an animation ?

lone glade
#

nope

#

well, it does "follow it" but only like it would if you attached it via object center

knotty mantle
#

Does this work?

{
    _test1 = _x
    {
     if (_test1 == _x) then {
    ...
    };
    }foreach arr2;
}foreach arr1;
still forum
#

define "work"

#

yes. It doesn't crash the game and it's not a syntax error.

#

If you get the value return from the last forEach it crashes your script though

knotty mantle
#

i dont use the bool outside the second foreach scope. and what exactly crashes this script?

still forum
#

nothing crashes that script

#

if you get the returned value from the last forEach it will crash I think

#

because the first forEach doesn't return anything. And the second...

#

now you changed the script..

knotty mantle
#

Yeah to clarify. Sorry

still forum
#

yes that works. No it doesn't crash anything

knotty mantle
#

good. thanks 😃

lone glade
#

if you're asking if you can nest foreach then yes

knotty mantle
#

It was more a question if it would work this way to bring the magic _x into the second foreach.

still forum
#

it's not magic

#

yes it works

knotty mantle
#

The array items are represented by the magic variable _x.

From the wiki 😄

still forum
lone glade
still forum
#

you must've misheard something

#
        {
            if (_x select 0 == _currentID) then {
                _currentPage deleteAt _forEachIndex;
            };
} foreach _currentPage;

That loop is bugged

lone glade
#

lies

still forum
#

Example if it should delete every element like that. It would only delete half

#

after each you delete it skips one

lone glade
#

again, big fat phony lies 😛

#

you can't have 2 stats with the same ID, you can't have 2 stats with the same ID in the same page

still forum
#

so that array can only contain the ID once?

lone glade
#

da

still forum
#

Why are you not using find then :U

lone glade
#

I wrote that whole API in a day, don't expect much from it 😄

still forum
#

I do though

lone glade
#

uuurgh, fine, want me to replace it with find? I got an open PR where I could stash it

still forum
#

nods

lone glade
#

shit, I was expecting you to never answer back, now I have to replace those 3 lines

#

wait, I can't count, that's 5, plus I have to find a snarky commit message.

still forum
#

"FFS these pesky furries"

little eagle
#

@still forum It's not a syntax error, because it assumes private STRING or private ARRAY and the input is undefined. Since it's an eventhandler and therefore runs unscheduled, it fails silently.

#
_shooter = "_shooter";
private _shooter;

;~)

still forum
#

ah right

lone glade
#

AH, I remembered why I didn't use find ded!

still forum
#

because there can be more than one? in which case it's still broken?

lone glade
#

nope, because currentPage indexes are arrays not strings

still forum
#

but...

#

you can use that with find can't you?

lone glade
#

nope

still forum
#

findIf then

lone glade
#

oh shit you got me

still forum
#

Wait

lone glade
#

THIS WAS MADE BEFORE FINDIF

still forum
#

why can't you use arrays?

#

find takes anything on the right.

lone glade
#

because [ ["ID1"], ["ID2"] ] find "ID1" doesn't work duh

still forum
#

ahh the _x select 0.
Well.. find [_x select 0]

#

¯_(ツ)_/¯

lone glade
#

nope, still wrong

still forum
#

ahh I see

#

you should use a CBA hash 😄

#

and findIf