#arma3_scripting

1 messages ยท Page 504 of 1

still forum
#

๐Ÿค” I thought there was a command to get all units by side

#

allUnits select {typeOf _x == "Logic"} ? ๐Ÿค”

astral dawn
#

Is remoteExec reliable? Does it guarantee packet delivery?

still forum
#

yes

queen cargo
#

would be pretty horrific if it was not

drowsy axle
copper raven
#

Pretty sure thatโ€™s a bug atm. Was mentioned here earlier iirc.

tame lion
#

does the "IncomingMissile" event handler not work? I can't seem to get it to work at all

frigid raven
#

I created a rectangle marker, set its name to "foo" but getPos foo is resulting in nil

#

do markers work different?

high marsh
#

getMarkerPos

frigid raven
#

fine getMarkerPos

high marsh
#

BOOM

frigid raven
#

jeez why is there a difference

#

wait

#

I dont wanna know

#

๐Ÿ˜„

frigid raven
#

Do I always have to provide a group for createUnit?

#

What if it is a single

#

can I just say nil?

#

was using createGroup [West, 1]

#

hope it is a "good" practise

astral dawn
#

Probably createUnit creates a new group for the new unit if you provide no group

#

But your unit must belong to some side, and you do this by creating a group of this side first

meager granite
#

createAgent ?

#

Depends on what you need from unit though

#

Sometimes I wish there was selectLast command to do selectLast _array instead of doing _array select (count _array - 1)

#

A man can dream

#

(Don't suggest macro)

drifting dragon
#

Is there a way to add a line to a vehicle's init through script without wiping whats already in its init?

copper raven
#

What? How does it make sense even?

still forum
#

@drifting dragon that doesn't make sense, at the point where you can run scripts on the vehicle, it's init already ran through

peak plover
#

maybe he is talking about config

#

@drifting dragon

#

like this?

elfin bronze
#

I have a question for the C++'s here. I have started to learn the basics of C++ by using a website which offers alot of tutorials on it. Can anyone with experience tell me if this website is a proper learning tool or if I am better off using a different source. I have finished the 0.? chapter, and started on the 1.? chapter.

thank you for any help

https://www.learncpp.com/

still forum
#

On first look it looks good I guess.. Though.. Using libraries with Visual Studio Express 2005 Uh.. we are at Visual Studio 2019 now..
Once you're through that though, continue watching conference talks on youtube (cppcon, ACCU, Meeting C++, C++Now) (https://isocpp.org/wiki/faq/conferences-worldwide/)
You never stop learning

elfin bronze
#

that last part is true

#

but the version im starting off with atm

#

is the Visual Studio 2017

still forum
#

Oh nice. Just started looking into the actual chapters.. They don't make the mistake to Teach C instead of C++. Kate Gregory has a very good cppcon talk about that topic ("CppCon 2015: Kate Gregory โ€œStop Teaching C")
They also incorporate all the new features into it.
I only checked half a dozen pages, and honestly I haven't seen a better c++ tutorial, that's even better than some of the paid professionally-made video learning thingies that I've seen

If you need specific help, you can join the "#include cpp discord" (just google for it) or ask in #arma3_tools there are many c++ devs in that channel

IMO Chapter 15 should come right after 6.9, to not let you get used to doing it "wrong"

Btw you can also script for Arma using c++, although that's "experimental" still

frigid raven
#

offtopic

#

๐Ÿ˜›

#

awaiting wrath

still forum
elfin bronze
#

ah so this was the wrong channel

#

my bad @frigid raven

#

But thank you @still forum for the help on that question. For future reference which channel do i need on this server?

#

for what I was asking

still forum
elfin bronze
#

Ty

peak plover
#

have I gone too far

isComplete = [call {

    if (cond1) exitWith {};
    if (cond2) exitWith {};
    if (cond3) exitWith {};
    if (cond4) exitWith {};
    false
}] param [0,true];
winter rose
#

โ€ฆโ€ฆโ€ฆyyyyyes.

meager granite
#

@still forum Oh lol, exactly same command name too

still forum
#

Kllrt gave me the ability to bring some new script commands into the game. If that works out in the end maybe I can get that one too

meager granite
#

Nice

meager granite
#

I can suggest few if you're interested

still forum
#

Well depends on how much I'm allowed to bother him.
so far I have addWeaponWithAttachmentsCargo(Global) Commands to retrieve the visual bounding box (only visual LOD) and geometry center.
and removeBackpackCargo
Oh and surfaceTexture

meager granite
#
  • Getting\Setting UI scrollbars
  • laserTargetTurrets to return lasers from all turrets (laserTarget works only with primary)
  • Checking if two arrays are the same (not comparing contents, only if two variables point to same array)
  • Return missile target, set missile target (and release if null target is supplied)
still forum
#

oof. that sounds hard :D
Well besides the array one

#

It's on my todo list now

meager granite
#

Array one would be extremely useful, have a ton of uses for it

still forum
#

I also wanted to give a hashMap. But that would need a new datatype

meager granite
#

hashMap would be amazing too

still forum
#

The one that's already in Intercept_CBA.
ANY type key to ANY value.
I'm not really confident enough that my implementation is flawless though

meager granite
#

Hm, how about creating\deleting namespaces to work as hash maps, to avoid new data type?

tame lion
#

Sa-Matra, love the suggestion to get missile target. I was literally asking about that in here the other day

meager granite
#

Yeah, have a need for it as well

still forum
#

creating namespaces is a big nono

meager granite
#

Especially since missiles aquire targets mid-flight

#

Why not? Serialization?

still forum
#

They cannot be stored essentially. You can only store references to existing namespaces

tame lion
#

It would greatly help me with the APS system I plan to create

still forum
#

You always need something to hold them. Object or Location or one of the static namespaces
Quite shitty tbh. Also objects and locations aren't even namespaces. It's a mess

meager granite
#

Oh, another thing about arrays, some kind of command to increment and decrement number in array

#
_array = [1,1];
_array inc 1; // [1,2]
#

Instead of _array set [1, (_array select 1) + 1]

still forum
#

you can already use set/select for that. Seems a bit too special use case. I'm wasting kllrt's time with that stuff, so I'd rather make it count doing things that we just can't right now

meager granite
#

Sure, you can also do selectLast with count and select, its a quality of life thing and to decrease number of commands executed

#

Not expecting anything to get into the game though, I already gave up many years ago

still forum
#

Also always a complexity thing. Kllrt is not a programmer so he basically just copy-pastes my stuff

#

We'll have to see what the future brings. There's no guarantee anywhere

meager granite
#

Yeah I know how it goes with Arma

#

We can dream at least ๐Ÿ™„

tough abyss
#

A map implementation would be fantastic to have in the core API. One thing I have been wanting was a way to store and load large data, like 100s of MBs in a reasonable way without an extension, putting that much in the profile seems like a bad idea.

#

I have also been thinking a periodic callback. The idea being if there is spare cycles and time call this function. It is a not guaranteed to be run at any reasonable period but it also refuses to get in the way of the games normal operation and hurt performance.

meager granite
#

Yeah saving significant data without extensions is something I'd love to have as well

#

Always imagined it to work similar to saveProfileNamespace

#

<Something> saveNamespace "something" saves serialized namespace into <Profile>.something.Arma3Profile
"something" loadNamespace <Something> loads serialized data into namespace of <Something>

#

Not sure what Something can be here, anything that has namespace attached to it?

tough abyss
#

The periodic callback kind of works with it. ACE does all this cache generation every load now and causes stutters on every mission start, we have the same problem with caching of terrain density and both mods and likely many more would happily save their data around a terrain and avoid doing it over and over if they could store it and generate it less invasively

astral dawn
#

How can I check if a given owner ID is valid, that is, currently connected to the server? So far I can only think about looping through allPlayers until I find a match.

languid tundra
#

I don't know any other approach, but why would you need to validate them anyway? At the very moment you ask for the owner ID, it's certainly a valid one.

astral dawn
#

Just making my code a bit foolproof. The function manages transferring ownership of a group to some other machine.

#

Yes I agree that generally one doesn't change owner until he knows who will take ownership ๐Ÿ˜„

languid tundra
#

I would say if you do all your stuff in unscheduled env, you don't need a check. If the machine disconnects in the next frame, the group will be transferred to the server automatically.

astral dawn
#

Good point, I was just going to wrap everything into a nice isNil {}

languid tundra
#

Yes, so you are in unscheduled env.

sturdy cape
#

Can i put muliple foreach behind each other like foreach 1;foreach 2; or should i use an array?

#

Does it matter?

high marsh
#

syntax: script forEach array

#

Your above doesn't make sense.

sturdy cape
#

K just wanted to make sure i dont break it

high marsh
#
{
    {

    } forEach [1,2,3,4,5
} forEach[1,2,3,4,5];
sturdy cape
#

Perfect thanks

still forum
#

@tough abyss @meager granite Yeah saving significant data without extensions is something I'd love to have as well
How about LZ compression of a string, and then output in base64 or something like that?

#

Also a serializeToString command would be nice. I already have serializeToJson in Intercept-network. But using that you would only see how terribly inefficient it is.

#

@meager granite giving users the ability to create files is probably not a good idea.
Hm... One could do a Serialize to binarized command.. But... I think when you try to deserialize invalid data, you will crash the game, so that's a bad idea in general. Though attaching a checksum... maaaybe

astral dawn
#

Hmm how would I better do synchronous remote execution? Maybe CBA has it?
So I want to remoteExec something and get an ACK from the other computer that it has executed it.

still forum
#

Just use remoteExec

#

and remoteExec something back

#

you have remoteExecutedOwner to get the ownerID of the guy that sent the request

astral dawn
#

yes, but I will need to waitUntil {} something happens. How would you send the ACK from the other computer? By storing a special variable in the first computer's mission namespace? ๐Ÿค”

still forum
#

huh?

#

Ah

#

yeah.. Just use a global var I'd say

#

could also generate a random one. And send the var name along with a string

astral dawn
#

Yeah I also thought of it. Thx!

still forum
#

I do that in TFAR too. But I don't have a waitUntil

#

I send something like a uniqueID along. And if I do another request before I got the answer, I "invalidate" the old UID and just ignore the old answer when it comes back

languid tundra
#

To get rid of scheduled env, you could create an event handler on your first computer that is called from the second one.

astral dawn
#

That's cool but would need a sort of heap of sent requests that have not been ACKed, I think ๐Ÿค” The whole thing starts to resemble a communication protocol.

still forum
#

well yeah. array/cba_hash/cba_namespace

astral dawn
#

To get rid of scheduled env, you could create an event handler on your first computer that is called from the second one.
I think I'm ok with scheduled env. The point of it was to avoid remote disconnection in the middle of owner change. But it will be solved by the acknowledge protocol anyway. I just need a reasonable timeout in the waitUntil.

devout wolf
#

hey

#

i want to blackout everyone screen until everyone loads
to eliminate failstart in TDM

what to do?

#

i've tried something like

#

{getPlayerUID _x != ""} count allPlayers == count allPlayers

#

but how to use it

#

step by step

high marsh
#

Uhhh.....

still forum
#

uhm.. wat

#

nothing in that line of code will work.. I think?
I guess the != will "work"

high marsh
#

Nope.

#

It would never work anyways, won't return player?

devout wolf
#

[] spawn {
[ "MyLoadingScreen" ] call BIS_fnc_startLoadingScreen;
uiSleep 10;
[ "MyLoadingScreen" ] call BIS_fnc_endLoadingScreen;
};

waitUntil {
//If there are no current loading screens
if ( missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]] isEqualTo [] ) then {
//Continue
true
}else{
//Otherwise log current loading screens to RPT
diag_log str ( missionnamespace getvariable ["BIS_fnc_startLoadingScreen_ids",[]] );
false
};
};

#

i've tried something like that

#

i've seen it in post on BIF

still forum
#

Nope that doesn't work

devout wolf
#

i've noticed that

still forum
#

You can never be sure that all loading screens are done

devout wolf
#

damn

still forum
#

because once you see that there are no loading screens open.. And your condition returns true... Half a second later a mod could open another loading screen

devout wolf
#

so how do you suggest to make everyplayer start at the same time?

still forum
#

start loadingScreen

high marsh
#

Where did you get that first one at? Don't tell me someone posted that somewhere

still forum
#

And on server wait till mission has been running for 60 seconds or so. and remoteExec stop the loading screen

devout wolf
#

something like that

#

[] spawn {
[ "MyLoadingScreen" ] call BIS_fnc_startLoadingScreen;
uiSleep 60;
[ "MyLoadingScreen" ] call BIS_fnc_endLoadingScreen;
};

#

should work?

still forum
#

then everyone will start at a slightly different time

#

scheduled scripts only start running after preInit

#

people that take longer to load, will execute later

devout wolf
#

So the best option is to create trigger which fires is 1 player is connected and deletes all invisible walls after 90 seconds?

still forum
#

What I told you will work. But only if noone takes longer than 60 seconds to load (unlikely)

#

That might work too

#

But...

#

Why is it not an option to wait in the briefing screen till everyone is done loading?

#

that's how I always do it

peak plover
#

Do cba PFH scritps run even when alt tabbed and without -noPause

still forum
#

noPause doesn't matter in MP

#

I can tell you that they don't run in SP when tabbed out without noPause

queen cargo
#

though ... few hours too late

astral dawn
#

@queen cargo nice but as I see the array of requests doesn't get smaller

queen cargo
#

essentially, old IDs just get reused so the array does not has to be resized over and over again

astral dawn
#

Oh that's nice

queen cargo
#

wait ... no

#

i think i accidentially removed that functionallity at some point ๐Ÿค”

#

because i cannot find the spot where i set it to -1 again

#

though ... that at least allows Promise_Done to be used correctly ๐Ÿคท

#

ahh

#

nah forget it

astral dawn
#

remoteExecSync should be in base game IMO. The fact that you did it on your own proves that some other guy might be reinventing it some time. I am sure they have it in the engine somewhere.

queen cargo
#

not really ๐Ÿคท
implementing such a thing is trivial as you can see

#

though ... inengine solution would be faster

frigid raven
#

how to actually test for any

#

like if (_foo != any)

#

is this what isNil is for?

languid tundra
#

Yes, you get any printed, for instance, when an element in the array is not defined or in other words isNil for that variable returns true.

frigid raven
#

aye

#

thx

austere granite
#

keep the quotes in mind with isNil

languid tundra
#

or curly brackets

lost iris
#

I have a mission file where when a marker is selected from treeView the marker changes color, this works in singleplayer but not in mp. any ideas?

#

the command "marker1" setMarkerColor "ColorRed"; works when I execute it manually but not when it is run in missionfile

outer fjord
#

Is it possible to ragdoll a unit without killing it?

hollow thistle
#

_unit setUnconscious true; should ragdoll unit for a moment.

verbal saddle
outer fjord
#

Sweet, just what I needed ^-^

still forum
#

@astral dawn no they don't have it in the engine. Freezing the game for an answer to come back isn't something you do

quasi rover
#

I want to find players within given circle area(_center and _radx, _rady). is it corret?

allPlayers select {alive _x && _x inArea [_center, _radx, _rady, 360, false]};```
digital jacinth
#

I just wished you could use a command to permanently ragdoll units. I have some workaround which are really glitchy to say the least. Main issue is control of the state when the ragdolling should stop

still forum
#

networking packets in Arma can't do that

#

Implementing that would be alot more work than just adding a command.
Though you could add a "doragdoll" command like I have in Intercept and a "ragdollEnded" eventhandler. Then you can just start a new ragdoll with 0 velocity once the ragdoll ends

digital jacinth
#

what i am doing right now for some testing shenigans is setting setunconscious false and then true the next frame.

#

hence why i say "glitchy"

#

you like people wobbling around and slide around the floor? Boy do I have news for ya

young current
#

why do they need to be constantly ragdolled?

digital jacinth
#

ace medical reasons for me. I play with ace for so long that i can tell by looking at someone 400 meters away if they are dead or not

#

and for goofing around with firends, as in walkinto someone, fall down "Help I've fallen and I can't get up"

#

and to emulate an older arma bug which made people ragdoll if they walked into someone

west venture
#

That (almost) singular unconsciousness anim is one of my biggest niggles with ACE

still forum
#

Just make a dozen and add them to ACEX

digital jacinth
#

well i do "have" some and i am too lazy to intergrade them into medical rewrite

#

iirc there is no logic in place to apply these instead of the vanilla after ragdoll animation

#

these animations are right now only available in my mod tho

winter rose
#

@quasi rover allPlayers select { _x distance _center < _maxDist };

#

If you talk about a circle, that is

still forum
#

Maybe it's a circlette. Don't be so sexist

winter rose
#

did you just assume its gender??

quasi rover
#

thx, the _maxDist mean the radius of circle?

winter rose
#

Yep! You only check if the unit is less than X metres from the centre

still forum
#

you are missing the alive check tho.. And

#

allPlayers inAreaArray [_center, _maxDist/2, _maxDist/2]; HAH!

#

still missing the alive check :u

#

/(._.)\

sonic belfry
#

can someone tell me how i can make this this addAction[localize "STR_MAR_Rebel_Clothing_Shop",life_fnc_clothingMenu,"reb",0,false,false,"",' license_civ_rebel && playerSide isEqualTo civilian'];``` into a [] spawn``

still forum
#

I don't understand the question

#

just put a spawn around it and it will be a spawn?

#

Oh you mean

#

calling the fnc_clothingMenu via a spawn?

sonic belfry
#

ye

still forum
#

"[] spawn life_fnc_clothingMenu"

sonic belfry
#

[reb] spawn life_fnc_clothingMenu

#

not working

still forum
#

you need to put it into a string

sonic belfry
#

tried it

still forum
#

your argument is a string... But in your [reb] example it's not a string

#

can you show what you tried?

sonic belfry
#

action = "closeDialog 0; ['reb'] spawn life_fnc_clothingMenu;";

#

should i change 'reb' into ""reb""

still forum
#

๐Ÿค”

#

I have no idea what that's supposed to be

#

show me the whole thing, not just a part of it

#

is reb supposed to be a string or not?

sonic belfry
#

class

still forum
#

wat

sonic belfry
#

1 sec

#

class reb {
title = "STR_Shops_C_Rebel";
conditions = "license_civ_rebel";
side = "civ";
uniforms[] = {};
headgear[] = {};
goggles[] = {};
vests[] = {};
backpacks[] = {};
};

tough abyss
#

""Reb"" and 'Reb' should be the same, no? Double quotes or single ' escapes?

quasi rover
#

thx guys.

sonic belfry
#

Any idea?

verbal saddle
#

Your giving the script a string

#

If it needs to be a class then you should be referencing to the location of the class

#

Try using something like this to get the class

"configName _x isEqualTo 'reb' " configClasses (missionConfigFile >> "Location" >> "to" >> "class");
#

That will return the class for your script in an array

still forum
#

it will return you an array with a single entry

#

which is kinda stupid if you could instead just do
missionConfigFile >> "Location" >> "to" >> "class" >> "reb"

#

Question is what the function actually wants as parameter. And what "doesn't work" actually means. And why it wouldn't work without a "spawn"

tough abyss
#

are there any setName commands, or a way to create dynamic "identities" in description?

still forum
#

which description?

astral dawn
still forum
#

๐Ÿค” That's a interesting thought

astral dawn
#

Credit goes to this guy ๐Ÿ˜„ @unreal leaf

still forum
#

You can run my Intercept SQF-Assembly. It has a custom implementation of the scheduler. You can just ... Eh.. where is my custom scheduler.. It should be right there.. Or was it in the debugger?
No it's not.. Where the heck is my scheduler?!

#

loading screen being open is indicated by a display being open. And... Opening a display on HC....... Doooess.... cmon go faster.....

#

Should work ๐Ÿค”

#

I expected it not to

astral dawn
#

So we don't really know... need to try it some time

still forum
#

I gotta find my custom scheduler now.. I have it somewhere I swear!
If it doesn't work you could always use Intercepty stuff for it

signal pulsar
#
(getPosATL player select 2 < 150))) exitWith // 30m ``` can someone help me understand the math here so i can increase the height?
unreal leaf
#

getPosATL player returns [x,y,z] where z is hieght

#

select 2 means select z

#

then you check if its smaller then 150

#

is if its less then 150 it exitWith

astral dawn
#

Why is it 150 and // 30m though ๐Ÿค” The coordinates in arma should be in meters

signal pulsar
#
_result = false;
{
    if ((((_x select 0) distance2D _position) < (_x select 1) && (getPosATL player select 2 < 150))) exitWith // 30m height restriction on trader god mode
    {
        _result = true;
    };
}```
#

does that help

verbal saddle
#

Your current height limit is 150

signal pulsar
#

it definitely isnt tho

#

i just watched a player die from like 30ft

verbal saddle
#

What's _x?

signal pulsar
#
 
private["_position", "_result"];
_position = _this;
_result = false;
{
    if ((((_x select 0) distance2D _position) < (_x select 1) && (getPosATL player select 2 < 150))) exitWith // 30m height restriction on trader god mode
    {
        _result = true;
    };
}
forEach ExileTraderZoneMarkerPositionsAndSize;
_result```
languid tundra
#

As others already told you the limit is clearly 150m within the zone limited by the radius (_x select 1). You can convince yourself that this is true by adding a logger like diag_log format ["God Mode: %1", _result]. Just watching a player die doesn't proof anything. It's obvious that this small code is called from other code that is actually responsible for making the player invincible. We don't know what's happening there.

ruby breach
languid tundra
#

Looks like someone copied/pasted the code and changed the height without changing the comment ๐Ÿ˜„

still forum
#

Also that code should be using findIf and private keyword

peak plover
#

@astral dawn why do you need scheduled code anyway? ๐Ÿ˜„

#

if you need performance then unscheduled

astral dawn
#

If I need to calculate a lot do I freeze the whole frame then?

still forum
#

yes

astral dawn
#

Let's say I have 60 FPS, so it's 16 ms per frame

#

And I need to calculate for more than 16 ms, then what?

still forum
#

then you just do that

#

fps will go down

#

game will "freeze" till your calcs are done

#

which doesn't really matter on a HC I'd say?

astral dawn
#

But if I play my scenario alone or if I'm the one who hosts?

languid tundra
#

Wouldn't this freeze the units local to the HC?

still forum
#

then you'll get a short stutter when that code runs

#

It's not like your script freezes the game for seconds right?

astral dawn
#

But but... if i need to calculate for 100ms or so? ๐Ÿ˜ฎ

still forum
#

Cookies!

astral dawn
#

So far I do my stuff with unscheduled scripts and message queues, works fine, but might port some things to per frame EHs which don't take a lot of time, maybe

still forum
#

just write better scripts. All problems will begone

astral dawn
#

Well it's easy to say so but some things really take a lot of time

languid tundra
#

A lot of config look-ups can't be really optimize, can it? That's usually the problem with code that is expensive for me.

astral dawn
#

But I get that for something like TFAR you don't need to calculate a lot so you better do everything unscheduled

austere granite
#

what is that you need to do?

astral dawn
#

AI planning and things like that

austere granite
#

because if you have something for 100ms, then you either dun fucked up, or you're making something very special which usually means you already know when to use what ๐Ÿ˜„

astral dawn
#

Message queue is great to sinchronize things

still forum
#

TFAR needs to calculate alot. and it drags your FPS down quite a bit. But it has to be ran predictably. If someones position just stops updating for 10 minutes because some idiot wrote a stupid scheduled script... People will scream at me instead of that idiot who's fault it actually is

astral dawn
#

But a scheduled script doesn't stop my position from updating for 10 minutes

#

If you need to calculate a lot in unscheduled, you divide it in pieces, right? Like no more than 10 units per frame. Well that's like scheduling in some sense.

still forum
#

yeah

astral dawn
#

'always run unscheduled' is like saying 'always write single threaded code' IMO

#

yes you are prefered to deal with as little amount of threads as possible, no you must not write it in one thread in all cases

still forum
#

Well besides that scheduled is also single threaded ^^

austere granite
#

I'd say its more like one of those guidelines for new people, once you become adept enough you'll learn to use the exceptions

still forum
#

Well you could grab Intercept and move stuff to multithreaded :3

astral dawn
#

Well in the end if you have single-core CPU then it can run one thread at a time

still forum
#

And you pay for all the thread switching code, and the code that checks at every semicolon whether the 3ms are already over

astral dawn
#

Really, in any engineering-related task I have never seen a situation where you don't pay with something for something else ๐Ÿคท
For example, If you're at the point when you do your own scheduling in sqf (no more than 10 units per frame), might have let arma's scheduler decide it for you because it will do it faster at engine level?

still forum
#

nope

#

A forEach and deleteRange is faster than a check whether 3ms are over at every expression plus the sorting that's done for scheduled scripts

#

When you need custom scheduling.. Your code is probably quite heavy, meaning the scheduling code time is probably very negligible.
But moving it to scheduled would add overhead to every expression

#

3*N+5 is better than 4*N if N is big enough

astral dawn
#

I guess at some point your own scheduling might become quite complex and overweight the engine-based one?

still forum
#

Don't know how it would

#

If your scheduling code is slow.. then maybe the slow code shouldn't run in there

languid tundra
#

I would pay the price for using scheduled for expensive code to avoid freezes on the HC. My two cents.

still forum
#

I would launch a second HC that just runs the slow scripts ยฏ_(ใƒ„)_/ยฏ

astral dawn
#

You must calculate all the AIs and all the player's radio propagation for TFAR and ... and ... except that the whole thing must not take more than xxx ms of your frame, and some parts must get more priority that other parts

signal pulsar
#

so like 300 replies later

#

to my question

#

i figured it myself lol

still forum
#

You must calculate all the AIs and all the player's radio propagation for TFAR no. Neither of those

signal pulsar
#

my bad guys

#

but thanks for all the help

rough heart
#

No worries ๐Ÿ‘

signal pulsar
#

(:

#

i rlly did leave that shit

rough heart
#

Just do yourself a favor, if you take code from others, don't be a dick when people ask you about it.

signal pulsar
#

lamo

#

LMAO

#

take code from others?

#

thats exilemods code?

#

from the client?

#

tf?

#

do u mean

still forum
#

and some parts must get more priority that other parts no. But with custom scheduler code you could actually do that. With BI scheduled you cannot.

signal pulsar
#

lmao sheep go back to ur exile discord.

#

if i wanted to talk to u id PM you.

#

now ur just starting shit for no reason

still forum
#

@signal pulsar I'd recommend you stop that now

signal pulsar
#

ok so hes cool to just start argumens

#

and accusations

still forum
#

You took other peoples code and didn't know how to use it.. So...

signal pulsar
#

its not tho?

rough heart
#

It's actually very simple. What you posted is a edited version of a released script. Which is, to my knowing only available to privately handed out people. So either you took it from somebody's mission file or stole it some other way.

signal pulsar
#

whos code?

still forum
#

It's just pure accident that the code that someone else wrote 1,5 years ago is EXACTLY the same as yours?

signal pulsar
#

its exiles code?

#

how did i steal this

rough heart
#

It's not Exile's

still forum
#

noone said stealing

signal pulsar
#

i got it off exiles forums

#

posted publicly

#

tell me how

#

u guys

rough heart
#

Is a edited version of that released by somebody else and then edited again and now u took it from somebody's server mostlikely.

still forum
#

"I took code from somewhere" yeah. That's exactly what Sheep just told you

signal pulsar
#

lol im not even gonna bother

rough heart
#

And the version that "was" public, is not what you posted.

signal pulsar
#

" So either you took it from somebody's mission file or stole it some other way."

#

ok

rough heart
#

Yeeh. Very simple.

signal pulsar
#

but can u prove this?

#

because i can jjust link you the page

languid tundra
#

I think we lost the point of this channel a long time ago

ruby breach
#

Also worth noting that the version you modified is marked as non-derivative, but that's a rabbit hole we'd best not delve down.

rough heart
#

But instead you answered our question you went mayhem on a very well known member of the Exile community and tried to shit all over him.

still forum
#

"Can you prove that I took code from someone else, because I can link you to the page where I took it from"
Uh.... You are just confirming what he's saying dude ๐Ÿ˜„

signal pulsar
#

yeah

#

thats not from someones mission file

#

ur trying to say

#

i went on someones server

#

and took their code

#

thats not the same

#

" So either you took it from somebody's mission file or stole it some other way."

rough heart
#

The thing is Dedmen, there was a version that was public. What he has is a edited version of that script which was never released.

signal pulsar
#

as going on the forums and installing something

astral dawn
#

@still forum Well BIS scheduler gives equal share to all scripts. So I can divide my 'objects to update' into threads based on priority. So I can do that with BIS scheduler. Except that some other dude's scheduled script will take performance from my scripts as you said, so I get your point, with unscheduled code you get more control of that.

still forum
#

that some other dude's scheduled script will take performance from my scripts That's basically the reason why ACE,CBA,TFAR,ACRE are all unscheduled

astral dawn
#

\o/ because they must be pluggable into any scenario, but i'm writing a scenario so I can afford that ๐Ÿค” Maybe that's the reasonable boundary between scheduled and unscheduled?

still forum
#

Do you also know which mods are running together with your scenario?

#

Because these can also introduce shit

#

I had to pull so much crap out of MCC to make it acceptable ๐Ÿ˜„

#

And to find the crap. I just searched for "while {true}" and "spawn"

astral dawn
#

Haha don't worry I'll test my thing if it's done with TFAR and ACE at least ๐Ÿ˜„
In fact I can't play without these two, so...

languid tundra
#

Ares is almost entirely based on scheduled, which Achilles inherited. Will take quite some time to get rid of it ๐Ÿ˜„

still forum
#

Yeah I love it when you drop a module and the dialog takes seconds to open. Or when you press ok in a module dialog and... nothing seems to happen. That's awesome

#

With the game freezing for like 200ms when you press a button, you know that the game is working really hard

#

but when it's running along at 60fps and nothing happens, you feel like the game is trolling you

#

Also with freezes, you immediately see that something is wrong. Plug a profiler onto it and you see where it's wrong.
You can't really see shit scheduled scripts that cause other scheduled scripts to execute less often

That's also kinda putting the burdon onto you of having to fix it. Because people are more likely to complain. Forcing you to write better code

languid tundra
#

But for parts that search every mod for vehicles and units, I don't really want to move such expensive stuff to unscheduled. Maybe a progress bar would help in such cases.

still forum
#

or prepare some things at game start. Like ACE Arsenal does

languid tundra
#

Well, if you know that a certain module is almost always used, you could do that for sure.

still forum
#

Or atleast cache once it's first used

languid tundra
#

That's already there ๐Ÿ˜„

still forum
#

I prefer a 200ms lag, over having to wait 2 seconds after pressing a button till it actually does anything

#

lags ingame while running around are unacceptable.
But lags while pressing a button are not that problematic unless they are really too long. Like entering/leaving zeus interface... BI could use some caching there... -.-
But also depends on the kind of button. On a okey button you can freeze longer than for example on the "add item" button in Arsenal. You wanna add 5 items and immediately click the button again, freeze there is just annoying

languid tundra
#

Just the thing about Zeus is that I suspect that lags caused by expensive scheduled code affects the gameplay, since by design all units placed are local to the Zeus.

still forum
#

is Ares on github?

languid tundra
#

Yes, it is.

still forum
#

You are using try except on a function that doesn't throw?

languid tundra
#

I don't think I've ever used try except in SQF. What is it even good for?

still forum
#

That code is a very nice playground for people that wanna do optimizations

#

if you execute a throw command inside a try block. It will basically do a "exitWith" chain and jump till your except block

#

you can use it to quickly and easily exit deep nested scopes.
Or you could just use breakOut/breakTo commands instead

languid tundra
#

It's always a question of time. It's a trade-off. Do you want to spend more time on new features or on optimization? Stuff is working, just not really good ๐Ÿ˜„

still forum
tough abyss
#

Does anyone know of a way to remove gps in vehicles? I've made it so you can't get one on the server and gps is set to 0 in description but you can still use built in gps's in certain vehicles etc.

still forum
#

I guess you can't without a mod.
You can close the dialog/display though if it's open

languid tundra
#

Thx for the suggestions. I've added a new issue for it.

polar stag
#

Hello to everyone here. Anyone has a tip and guide on how I can start scripting and modifying arma 3 to the way i want it?

winter rose
polar stag
#

@winter rose wow thank you so much! Do you need a private server set up inorder to run your modifications and scripts or there are other ways of testing them if they work?

winter rose
#

the famous 3den Editor, dear โค

#

depends on what you do, obviously

polar stag
#

hmm ok. It's time to read and learn! Thanks much ๐Ÿ˜ƒ

winter rose
#

enjoy, and don't hesitate ๐Ÿ‘

high marsh
#

FAMOUS? Does no one ever remember 2D sweetness?

winter rose
#

NO

languid tundra
#

The good old days of the 2D one are over ๐Ÿ˜‚

astral dawn
#

I hated the 2D editor so much

high marsh
#

YES! Damn you kids and your fancy crapA

winter rose
#

it was enough for basic stuff, but come on 3den was soooooo a step forward ๐Ÿ˜„

#

@high marsh old fart!

high marsh
#

๐Ÿ–• BonzyBuddy ๐Ÿ–•

astral dawn
#

Eden was like a new dimension

high marsh
#

Perhaps

winter rose
#

I even felt too much freedom at first ๐Ÿ˜„ "omg omg omg, I can do this and this and that, and place and rotate everythiiiing"

astral dawn
#

You can even do amazing attachTo compositions with it

winter rose
#

directly in 3den?

astral dawn
#

Yes ๐Ÿ˜„

#

By placing the attachTo in the init field

#

We did some insane mad-max inspired vehicles like this some time ago

slim oyster
#

Battlebus without having to preview the mission after every 5 seconds of work

astral dawn
#

Yes I was also amazed when I discovered this

still forum
#

I might make a Ares PR when I'm at work

#

maybe I can someday stop complaining about how bad Ares scripts are ๐Ÿ˜„

languid tundra
#

You mean Achilles, since Ares is no longer being worked on.

#

Anyway, your wisdom would be appreciated ๐Ÿ˜„

frigid raven
#

playing around with playSound I look for a list of vanilla sounds

#

am I mixing up things here?

#

Using them like this playSound "\a3\missions_f\data\sounds\radio_track_03.ogg";

#

nothing tho

digital jacinth
#

most vanilla sounds as encoded in .wss, unless the ogg extension is in the path

frigid raven
#

hm

#

Just wanna play some radio chatter

#

sb. knows the sound name for that mybe?

earnest path
#

Hey guys any idea how to stop arma from kicking me if i join one server with two instances logged in on the same computer and steam account? I am trying to test interaction on a mission on my dev box

frigid raven
#

so u have 2x same steam id?

#

do not think that will work

austere granite
#

its a server setting

#

kickDuplicates

#

or something else al ong that lines

earnest path
#

kickduplicate = 0;

#

No i have one steam ID i want to join a server as two clients

austere granite
#

not sure if that works on dedi then it that case if you already got that

high marsh
#

loopBack = 1;

#

this is specifically for allowing two instances

earnest path
#

@high marsh Thank you ! that is what i was looking for

#

Finally i can test alone without the need of a second person

frigid raven
#

How to check best for an vehicle to have completly no ammo

high marsh
frigid raven
#

I spawned a truck with 5x magazines and checkit it with waitUntil to have getAmmoCargo _vehicle isEqualTo 0

#

but that son is always returning 1

#

even tho the inventory is blank

#

oh

#

Nah I am talking about cargo of a truck

high marsh
#

magazineCargo

frigid raven
#

so magazine is the inventory stuff

#

where ammo is like ammo of an APC gun

high marsh
#

sure.

frigid raven
#

well does BIS has any convenient function to check if cargo is all blank?

#

I made an own func that checks getMagazines, getItems, getBackpacks etc.

#

but feels very hacky

high marsh
#

just count ti

#
_magCount = count magazineCargo _veh;
if(_magCount == 0) then 
{
    hint "It's blank, bleh.";
};
winter rose
#

if (magazineCargo _veh isEqualTo []) then { โ€ฆ };
^ I see it more and more written like thisโ€ฆ isEqualTo is better performance-wise (but less understandable from my personal pov)

high marsh
#

Makes perfect sense.

winter rose
#

isEqualTo?

high marsh
#
if(magazineCargo _veh isEqualTo []) then
{

};
winter rose
#

Well, I guess there might be an "old school" side to me too but I also think that here you are saying "is what this command returns an empty array" and not, more human readable, "are there no magazines in there"

#

I don't know if I make sense here

ruby breach
#

The only thing wrong with how Midnight is doing it is the newline for the open bracket. lol

high marsh
#

Oh dear god, gnashes please no.

winter rose
#

No, Allman style all the way!

ruby breach
#

And then obviously if you want to check for no weapons, backpacks, etc, etc at once just stack the commands before the isEqualTo check

#

kinda wish we had an actual getContainerContents command that returned everything at once. Including container contents within the container.

#

Course, that's also probably asking for just a messy return format

winter rose
#

Just a blurry memory but don't we have that now? Or am I mixing it with some vehicleWeapons command?

ruby breach
#

I don't think we do? You'd have to loop everyContainer coupled with get(x)Cargo currently unless I'm having a massive blonde moment (i.e, to return contents of containers stored in a larger container)

winter rose
#

no no really, don't trust my brain at this time of the day ^^ I will check on my side, for my brain's sake

#

Yeah, nevermind.

frigid raven
#

Actually I was asking for a more convenient way to check for ALL types of "stuff" in a vehicle cargo

#

To check if a truck is fully empty I actually do fn_hasEmptyCargo

#include "script_component.hpp"

params [["_object", objNull]];

if (_object isEqualTo objNull) exitWith { false };

(count itemCargo _object == 0) and (count weaponCargo _object == 0) and (count magazineCargo _object == 0) and (count backpackCargo _object == 0)
#

I was looking for something like BIS_fnc_isCargoEmpty or something but no luck

still forum
#

Use a configViewer to find all possible sounds. RadioChatter is probably not in there

frigid raven
#

@still forum alrighty

#

What is the reason for that?

player inArea "insertion" // true
(vehicle player) inArea "insertion" // false
#

ok it was just a pixel further away xD

#

nevermind

still forum
#

[itemCargo _object, weaponCargo _object, magazineCargo _object, backpackCargo _object] isEqualTo [[], [], [], []]

frigid raven
#

ah nice wasnt aware this poppible

winter rose
#

or array + array + array isEqualTo []

distant egret
#

Is it possible to get the current camera position. eg. if playing as unit the pos of the unit, but when in spectator mode and free flying get current position of where you are. and when in spectator mode but 3rd person of a unit get their position?

#

is there a single simple command for that? or does CBA/ACE has?

distant egret
#

so, positionCameraToWorld [0,0,0] would be center of head when as a unit? but also center of camera as spectator.

still forum
#

ye

distant egret
#

k thanks

still forum
#

@astral dawn if you want your HC to run more scheduled, you could also grab the fps unlocked server binary.

astral dawn
#

I think default FPS lock of the server or HC is 50, right?

still forum
#

ye

astral dawn
#

Should give 18% spent on scheduled SQF considering it can do everything during the rest of the frame

#

Yeah, interesting idea

#

I thought a bit today. If I run unscheduled inside the frame, can I just save all the local variables of current function so that I can implement the context switch through SQF in case I want to suspend the current function until better time?

still forum
#

theoretically... but that would be alot of work

astral dawn
#

I think for an MP scenario it would be preferable for the server to run all scripts inside frames

still forum
#

"inside frames" ? What are you talking about

#

everything is inside a frame

astral dawn
#

Yeah i mean inside the onEachFrame handlers or their CBA counterparts

#

I mean, even if it takes 100ms for the server to crunch my data, and if it stretches the whole frame to 100ms, it's not as noticeable for clients as if it happened on player's computer and he would have a noticeable freeze. Or am I wrong and having one long frame is still very bad for MP?

still forum
#

server freezing means no network messages are passed around. No AI's are simulated

#

everyone would essentially desync as long as the server is frozen

#

at 100ms it doesn't matter much thouch

astral dawn
#

Yeah that's what I thought

still forum
#

You can freeze a HC as long as you want. But on server that's not really a good thing to do

astral dawn
#

As long as it owns no groups or objects I suppose?

still forum
#

yeah. If it owns AI's they will freeze

astral dawn
#

Then that's a solution of making an HC just crunch data, make it run a function through remoteExecCall. No 3ms or framerate limitation. ๐Ÿ˜„

#

Did you see anyone do it though?

still forum
#

no

#

Well life servers do that for their database writes

vernal mural
#

I wonder if there is a way to halt the rebeather from working ? Appart from taking it from the unit ?

astral dawn
vernal mural
#

Hell O_o I have never seen such a command O_o Nice catch, sir !

astral dawn
#

Phrase 'remaining oxygen' got stuck in my mind so I just googled arma 3 remaining oxygen ๐Ÿ˜„

delicate lotus
#

okay I apparently got the weirdest error ever in one of my scripts.

_unit = _this select 0;

removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;

_unit forceAddUniform "U_BG_Guerrilla_6_1";
_unit addItemToUniform "FirstAidKit";
_unit addItemToUniform "MiniGrenade";
_unit addVest "V_PlateCarrier2_rgr_noflag_F";
_unit addItemToVest "HandGrenade";
_unit addItemToVest "SmokeShell";
_unit addItemToVest "SmokeShellGreen";
_unit addHeadgear "H_ShemagOpen_tan";
_unit addGoggles "G_Balaclava_TI_blk_F";

_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemWatch";
_unit linkItem "ItemRadio";
_unit linkItem "NVGoggles_OPFOR";

Error is that _unit is not defined at line 3...

austere granite
#

_unit will be nil :3

astral dawn
#

is _this an array? How do you call your script?

austere granite
#

inb4 _unit call _fnc_thatscript

delicate lotus
#

from my lightLoadout.sqf

_unit = _this select 0;
_handle = [_x] execVM "loadouts\generalUniformLoadout.sqf";
waitUntil {scriptDone _handle};

_unit addWeapon "arifle_AKM_F";
for "_i" from 1 to 6 do {_unit addItem "30Rnd_762x39_Mag_F";};
_unit addPrimaryWeaponItem "optic_Aco";
_unit addPrimaryWeaponItem "30Rnd_762x39_Mag_F";
#

weapon is added.

#

But the uniform stuff from the script with the error is not...

austere granite
#
_handle = [_x] execVM "loadouts\generalUniformLoadout.sqf";
waitUntil {scriptDone _handle};

So uh.... call compile preprocessFileLineNumbers? ๐Ÿ˜„

delicate lotus
#

thats the same as doing execVM

austere granite
#

it's not

astral dawn
#

why spawn it and then waitUntil if you can just call?

delicate lotus
#

hmm.... true

#

I better put it into the CfgFunctions anyway

#

though Im not sure if thats going to fix the error

austere granite
#

i mean you're using _x, why not unit?

delicate lotus
#

oh

#

lets forget all this lol

austere granite
#

also you should be using params instead tbh

#

params ["_unit"]

delicate lotus
#

yeah

austere granite
#

params is one of those good arma commands you should 100% understand beacuse you use it just about everywhere

delicate lotus
#

I understand it

#

though I usually only use it on functions with multiple parameters

vernal mural
#

@astral dawn oh, disappointing... Thanks anyway !

astral dawn
#

Maybe still worth trying though

#

Or maybe if you make a mod which inherits a rebreather but makes it not rebreather but a vest and then you simulate it with constantly setting player's oxygen until you decide it should break ๐Ÿ˜„ Not totally sure that it's possible in arma though

vernal mural
#

Yeah you don't even need to constantly set the exygen of the player. If I have an "exhausted" rebreather, I can just take out the true one from the player and give him the empty one instead

#

But I'm still trying to figure out what in the config make a rebreather a rebreather

#

It looks like the most promising value is "vestType = Rebreather" under ItemInfo, but not sure

frigid raven
#

What was the unit[] property in config.cpp good for again? I missed maintaining that part as I continued to add more editor modules but everything ran fine - so what do I need to care about that for again?

austere granite
#

@vernal mural check fn_feedbackMain.fsm

#

although that just seems to link to getOxygenRemaining player :/

vernal mural
#

Where is located this FSM ?

austere granite
#

functions_f\Feedback

#

might wanna unpack yourself though, didnt update my stuff in a while

vernal mural
#

yeah it looks like it's when the player is underwater without a rebreather

delicate lotus
#

How does the difficulty settings for AI skill and AI precision influence the actual AI skill? does it act as a limiter or as a coefficient?

still forum
#

thats the same as doing execVM execVM is the same as spawn compile preprocessFileLineNumbers
You are putting unit into _unit... And then try to pass _x as unit.. _x is not unit.

#

Yes I'm slow :u

#

@astral dawn there is no unit property that I can think off. There is units though. in CfgPatches

astral dawn
#

Not me but @frigid raven

frigid raven
#

yea sry I meant that CfgPatches thingie

#

is defined in my config.cpp

#

mixed that up

still forum
#

oops

#

Well it defines what CfgVehicles entries are contained within your mod.
Zeus references that to check if the vehicle should be spawnable. 3DEN editor might too. And other mods might use that too to check which vehicles you are adding

frigid raven
#

ah ok - its just for external purposes

#

so not needed for the addons functionality itself

still forum
#

depends what your addon is doing

#

if you add vehicles and want them to show up in zeus... then...

frigid raven
#

ok I see

still forum
#

It's also used to build the requiredAddons list in the mission.sqm

#

Curator goes through it's "allowed addons" to collect all classnames from the CfgPatches units entry for these mods to find all spawnable units

astral dawn
#

Yeah I thought my browser was dammaged or smth like that
Hopefully I have a local copy of that page ๐Ÿ˜„

still forum
#

Okey fixed the wiki again

#

Second time someone tries to break the script command page this month ๐Ÿ˜„

winter rose
#

my turn now!

young current
#

w u ppl do tis??

winter rose
#

for the Glory of Satan, of course! ๐Ÿ ๐Ÿ‘น ๐Ÿ˜ˆ

young current
#

ah carry on then

tough abyss
#

How do you set a variable for the people inside a trigger only?

EM_enable = [false, false];
//in trigger turns it off for everyone. Is there any way to do something like 
{EM_enable = [false, false];} forEach thisList; 
winter rose
#

be wary of potential sacrifices @young current ๐Ÿ˜„

#

@tough abyss setVariable?

young current
#

oh great a volunteer!!

tough abyss
#

would setVariable work for that though?

#

I was under the impression that setVariable needs to be gathered using getVariable

winter rose
#

@tough abyss what exactly do you want to do? set a public var only on people's computer?

tough abyss
#

Pretty much, if possible.

#

It's for disabling enhanced movement (3rd party mod) inside certain areas.

#

Currently it disables it for everyone whenever a guy is inside base.

winter rose
#

you can create a trigger with only "player" as trigger, NOT server-side

#

this should do, the trigger will only have local effect (DON'T publicVariable of course ^^)

tough abyss
#

Wait, how would one go about doing that? heh

winter rose
#

what you did, without the forEach

tough abyss
#

I guess there's no way then. Currently I have it set to

if (!isDedicated) then {
EM_enable = [false, false];
};
winter rose
#

"player activated", and not "server side"

Just EM_enable = [false, false];

tough abyss
#

Are there additional features for triggers when made outside the eden editor?

I have it set to:
Activation: Any player
Activation type: present
Repeat: true
Server only: False

#

condition: this
On act, deact is the code above

winter rose
#

oh wait, there is no "activation = player" maybe
then in conditions use this && player in thislist

#

should do the trick ๐Ÿ˜‰

tough abyss
#

Ok, thanks! ๐Ÿ˜ƒ

#

I just realised conditon is an if statement

#

My knowledge of triggers has widened lmfao

winter rose
#

Hehehe welcome to Arma

delicate lotus
#

This might be an awkward question but...
Is it possible to force the rotor on a helicopter to be completely on? Like skip the animation of slowing building up rotor speed.

tough abyss
#

In single player you can always just speed up the game for the duration needed?

winter rose
#

@delicate lotus not without Advanced Flight Model I'm afraid - or createVehicle one with "FLY" attribute and setPos it where needed

delicate lotus
#

Thats actually what I wanted to avoid. But thanks anyway. Its not really necessary anyway.

sturdy cape
#

i could use a little help here.i want to spawn in some anomalies of different types and i made this ```sqf

// find all anomaly mapmarkers and spawn a anomaly at that position
{
if ( x find "burp" >=0) then {
[getmarkerPos _x] call blablabla;
diag_log format["anomaly markers collected(blablabla): %1" , _x];
};
if ( x find "fart" >=0) then {
[getmarkerPos _x] call blabla;
diag_log format["anomaly markers collected (blabla): %1" , _x];
};

  if (  _x find "spark_" >=0) then {
    [getmarkerPos _x] call bla;
    diag_log format["anomaly markers collected (bla): %1" , _x];
};

} forEach allMapMarkers;

diag_log "finding all anomaly markers done";```

#

its finding all markers and logs names to the rpt

#

how do i pushback them into 3 arrays a spawn script could read from?

#

beacause calling the spawn files from the above will not work

#

basically i need something that will go through the indexed markers and repeat the object spawn until the array end is reached.to select 0 works for the first marker so i am on the right way,just need a tip for this being done multiple times

winter rose
#

declare the arrays before the forEach loop, fill them in it, use them after?

#

like

private _fartMarkers = [];
{
   if (_x find "fart_" > -1) then
   {
      _fartMarkers pushBack _x;
   };
} forEach allMapMarkers;
sturdy cape
#

that looks very interesting

#

gimme a min to try this

winter rose
#

then you can use another forEachโ€ฆ for each array ๐Ÿ˜„

sturdy cape
#

how bout a global var the array has got?

winter rose
#

I didn't get it?

sturdy cape
#

nvm i was a bit absent^^

#

nope it will continue to spawn only on the first marker

#

i double checked for loops tho

#

Foreach array doesnt work it seems.any other way than having redundant code for each one in the array?

#

I could do select 0
Select 1
And so on but why

still forum
#

how are you trying to use foreach?

sturdy cape
#

Collect markers depending on name.pushback into an array.do scriptexec foreach arrayname

#

Script takes select 0,spawns an object and effects

still forum
#

@winter rose your code would be a perfect example where one would use select

#

You've just successfully told me what I already knew. I meant how exactly. What the script is. aka show me the script

sturdy cape
#

Would take a few mins as i am cooking right now. Its just a createvehicle and the pushback (which may be too late?) with the effects taking the var name of the created vehicle

still forum
#

I'm asking to see the code because I think you have some syntax or logic error in there

#

you explaining what you are roughly somewhat doing doesn't help at all

sturdy cape
#

Will do after the meal.

carmine abyss
#

Is there a better way to gather nearestObjects without causing a big lag spike?

winter rose
#

@carmine abyss it all boils down to what you want to get, check nearObjects, nearEntities (iirc) and others, each has a different usage (sorted or not, dead units, etc)

carmine abyss
#

Okay I will look at those ty

peak plover
#

What do you need it for @carmine abyss ?

#

Sometimes there's a cheaper alternative way

carmine abyss
#

Well I use one nearestObjects to find all anti air vehicles with 1km of a drone. The second nearestObjects I need to find everything except the ones in the first array

peak plover
#

and it's causing a stutter?

carmine abyss
#

Yes because I have to increase the range to the size of the map and it freezes for a few seconds until it gathers it all

peak plover
#

use vehicles

#

and select with isKindOf

#

or typeOf

carmine abyss
#

When I tried using vehicle it wanted the array to be filled with objects in a string

#

["car", "tank","boat"] but it returned [car, tank, boat]

#

So nearestObjects would not work with it.

peak plover
#

don't use nearestObjects

carmine abyss
#

Ok

peak plover
#
private _allAA = vehicles select {(typeOf _x) isEqualTo '<myAAClassName>'}```
carmine abyss
#

Ah ok I'll try that ty

lost iris
#

@sturdy cape ```_nodeMarkers = [];

{
_containsStringNode = ["node", _x] call BIS_fnc_inString;

if(_containsStringNode) then{
    _nodeMarkers append [_x];
};

} foreach allMapMarkers;

sturdy cape
#

Nice one thanks.

lost iris
#

Im doing a similar thing and thats how i did it

#

it adds every marker containing the word node to an array

sturdy cape
#

Basically thats what ive already tried but your way is way better trackable in debug and looks more versatile

lost iris
#

you can easily add more searches aswell

sturdy cape
#
    if (  _x find "burp_" >=0) then {
        [getmarkerPos _x] call tzr_nuclear_create_burper_object;
        diag_log format["anomaly markers collected(burper): %1" , _x];
        
    };
    

      if (  _x find "fart_" >=0) then {
        [getmarkerPos _x] call tzr_nuclear_create_farty_object;
        diag_log format["anomaly markers collected (farty): %1" , _x];
        
    };

      if (  _x find "spark_" >=0) then {
        [getmarkerPos _x] call tzr_nuclear_create_sparky_object;
        diag_log format["anomaly markers collected (sparky): %1" , _x];
    
    };

    } forEach allMapMarkers;```
#

This was mine

#

Your way i can leave the pushback out

#

I think

#

๐Ÿค”

#

๐Ÿ˜

lost iris
#
fartArr = [];
sparkArr = [];

{
    _containsStringBurp = ["burp_", _x] call BIS_fnc_inString;
    _containsStringFart = ["fart_", _x] call BIS_fnc_inString;
    _containsStringSpark = ["spark_", _x] call BIS_fnc_inString;

    if(_containsStringBurp) then{
        burpArr append [_x];
        //or do something else
    };
    if(_containsStringFart) then{
        fartArr append [_x];
        //or do something else
    };
    if(_containsStringSpark) then{
        sparkArr append [_x];
        //or do something else
    };

} foreach allMapMarkers;
#

@sturdy cape

sturdy cape
#

Will try that tomorrow.Thank you very much.

lost iris
#

np

#

happy to help

peak plover
#

@lost iris replace inString with find
replace append [_x] with pushBack _x

rain mulch
#

Hi, I would like some help on a trigger I'm trying to make. Basically, there's a gate that I only want pilots to be able to enter. I've put the trigger down but I didn't know that I couldn't set multiple trigger owners and I have multiple pilot slots. Is there a way for the trigger to identify the player as a pilot which will then open the gate?

radiant needle
#

wHY IS (player call TFAR_fnc_isSpeaking) always returning false?

tame stream
#

Hi...im trying to play a xmas music file on dedi server, local testing works great but on server no sound is playing....what am i missing?

Descristion.extsqf class CfgFunctions { #include "Functions.hpp" }; class CfgSounds { sounds[] = {}; class xmas { name = "xmas"; sound[] = {"\Sounds\xmas.ogg", db5, 1.0}; titles[] = {}; }; };
InitServer.sqfsqf _nul = [x] execVM "scripts\xmas.sqf"; _nul = [x_1] execVM "scripts\xmas.sqf"; _nul = [x_2] execVM "scripts\xmas.sqf"; _nul = [x_3] execVM "scripts\xmas.sqf"; _nul = [x_4] execVM "scripts\xmas.sqf";Also what is the code for combining those into one command (the x and x_1 to x_4)

xmas.sqf```sqf
_soundObject = _this select 0;
_trackLength = 400; // Amount of seconds the sound goes for. You will have to adjust this to suit your sound!
_delay = 1; // How many seconds to delay between loops.

while{True} do
{
_soundObject say3D "xmas";
sleep _trackLength + _delay;
};```

radiant needle
#

Well that was harder than it should of been, but if anybody is wondering how to find difference between unit direction and bearing between two objects, the formula is 180 - abs(180 - abs(_Heading - _Bearing));

copper raven
#

@tame stream say3D has local effect, use remoteExec.

tame stream
#

@copper raven
xmas.sqf```sqf
_soundObject = _this select 0;
_trackLength = 400; // Amount of seconds the sound goes for. You will have to adjust this to suit your sound!
_delay = 1; // How many seconds to delay between loops.

while{True} do
{
_soundObject remoteExec "xmas";
sleep _trackLength + _delay;
};```

Likeso

copper raven
#

no. [_soundObject,"xmas"]remoteExec["say3D",-2];

delicate lotus
#

or playMusic, if it is an actual music

tame stream
#

@copper raven thx testing now

real tartan
#

does allDead array return also units handled by corpseManager / wreckManager ?

winter rose
#

not yet managed yes

#

Once dealt with, they are gone for good

radiant needle
#

Why am I getting undefined variable in this code

#
If (_SourceAltChannel == -1) then {_SourceAltFreq = _SourceFreq} else {_SourceAltFreq = parseNumber ((_SourceSettings select 2) select _SourceAltChannel);};
hint str(_SourceAltChannel);
If ((_SourceFreq == _TargetFrequency) || (_SourceAltFreq == _TargetFrequency)) then {
winter rose
#

where pls?

radiant needle
#

I'm getting a hint that says -1, but for that second if it says undefined variable sourceAltFreq

winter rose
#

It usually tells you the line and the var nameโ€ฆ

radiant needle
still forum
#

well _sourceAltFreq is undefined

winter rose
#

define it outside the blocks first

still forum
#

And atleast according to the code you posted. _TargetFrequency is also undefined

#
private _SourceAltFreq = If (_SourceAltChannel == -1) then {_SourceFreq} else {parseNumber ((_SourceSettings select 2) select _SourceAltChannel);};
radiant needle
#

I just posted a snippet of code

still forum
#

You just posted a incomplete snippet of code.

radiant needle
#

HEre is full code

#
[TestObject01,player,31.8] spawn {
_Target = _this select 0;
_Source = player;
for "_i" from 0 to 16 step 1 do {
_TargetFrequency = _this select 2;
_SourceDir = getDir _Source;
_SourceDirTo = _Source getDir _Target;
_Distance = _Source distance _Target;
_HeadingDifference = 0;
_SourceChannel = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getLrChannel;
_SourceAltChannel = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getAdditionalLrChannel;
_SourceSettings = (call TFAR_fnc_activeLrRadio) call TFAR_fnc_getLrSettings;
_SourceFreq = parseNumber ((_SourceSettings select 2) select _SourceChannel);
private _SourceAltFreq = If (_SourceAltChannel == -1) then {_SourceAltFreq = _SourceFreq} else {_SourceAltFreq = parseNumber ((_SourceSettings select 2) select _SourceAltChannel);};
hint str(_SourceAltChannel);
If ((_SourceFreq == _TargetFrequency) || (_SourceAltFreq == _TargetFrequency)) then {
_HeadingDifference = 180 - abs(180 - abs(_SourceDir - _SourceDirTo));
_HeadingCoef = (0.95^(_HeadingDifference));
_DistanceCoef = ((((log 20) * _Distance) + ((log 20) * 31.8)) / 200);
_CombinedCoef = _DistanceCoef / _HeadingCoef;
_Jitter = 1 - ((Random 200) - 100) / 1400;
systemChat str(_Jitter);
_SignalLevel = (37 - _CombinedCoef) * _Jitter;
If (_SignalLevel >= -96.6) then {hint format["Signal Level: %1 dBm",_SignalLevel]} else {hint "Signal Level: No Signal"};
Sleep 0.5;
};
};
};
#

With the private _SourceAltFreq I get generic error in expression on the same line

still forum
#

Looks like _SourceAltFreq is a number

#

๐Ÿค”
Btw TFAR frequencies are strings

radiant needle
#

If no alt freq is set, it returns as integer -1

#

if alt freq is set it will return as string

still forum
#

๐Ÿคฆ oops

#

you can use
```sqf
<code>
```
to properly highlight your code. makes it easier to read

#

And you didn't copy what I sent you

#

of course what you have is not gonna work

#

= doesn't return anything

#

you are trying to put nothing into a variable, that causes the script to bail out

radiant needle
#

Now another issue is that if I change off of that 31.8 frequency I stop getting hints, but if I change back I won't get hints again

still forum
#

If you change it you don't get hints.
If you change it back you still don't get hints?

#

which hints?

radiant needle
#

the signal level ones

#

here is code with your change

#
[TestObject02,player,31.8] spawn {
_Target = _this select 0;
_Source = player;
for "_i" from 0 to 32 step 1 do {
_TargetFrequency = _this select 2;
_SourceDir = getDir _Source;
_SourceDirTo = _Source getDir _Target;
_Distance = _Source distance _Target;
_HeadingDifference = 0;
_SourceChannel = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getLrChannel;
_SourceAltChannel = (call TFAR_fnc_ActiveLrRadio) call TFAR_fnc_getAdditionalLrChannel;
_SourceSettings = (call TFAR_fnc_activeLrRadio) call TFAR_fnc_getLrSettings;
_SourceFreq = parseNumber ((_SourceSettings select 2) select _SourceChannel);
private _SourceAltFreq = If (_SourceAltChannel == -1) then {_SourceFreq} else {parseNumber ((_SourceSettings select 2) select _SourceAltChannel);};
If ((_SourceFreq == _TargetFrequency) || (_SourceAltFreq == _TargetFrequency)) then {
_HeadingDifference = 180 - abs(180 - abs(_SourceDir - _SourceDirTo));
_HeadingCoef = (0.95^(_HeadingDifference));
_DistanceCoef = ((((log 20) * _Distance) + ((log 20) * 31.8)) / 200);
_CombinedCoef = _DistanceCoef / _HeadingCoef;
_Jitter = 1 - ((Random 200) - 100) / 1400;
_SignalLevel = (37 - _CombinedCoef) * _Jitter;
If (_SignalLevel >= -96.6) then {hint format["Signal Level: %1 dBm",_SignalLevel]} else {hint "Signal Level: No Signal"};
Sleep 0.5;
} else {};
};
};
still forum
#

add diag_log's everywhere for all your variables and check where it stops working

#

_HeadingDifference = 180 - abs(180 - abs(_SourceDir - _SourceDirTo));
Uh...

radiant needle
#

where do I find diag_log

still forum
#

What do you mean?

#

you write it down

radiant needle
#

?? I thought diag_log output to a file

still forum
#

RPT

#

%localappdata%\Arma 3

#
[TestObject02,player,31.8] spawn {
    params ["_target", "_source", "_targetFrequency"];

    for "_i" from 0 to 32 step 1 do {
        private _headingDifference = _source getRelDir _Target;
        private _distance = _source distance _target;
        private _activeLRRadio = (call TFAR_fnc_activeLrRadio);
        private _sourceChannel = _activeLRRadio call TFAR_fnc_getLrChannel;
        private _sourceAltChannel = _activeLRRadio call TFAR_fnc_getAdditionalLrChannel;
        private _sourceSettings = _activeLRRadio call TFAR_fnc_getLrSettings;
        private _sourceChannelSettings = (_sourceSettings select 2);
        private _sourceFreq = parseNumber (_sourceChannelSettings select _sourceChannel);
        private _sourceAltFreq = if (_sourceAltChannel == -1) then {_sourceFreq} else {parseNumber (_sourceChannelSettings select _sourceAltChannel)};

        if (_targetFrequency in [_sourceFreq, _sourceAltFreq]) then {
            _headingCoef = (0.95^(_headingDifference));
            _distanceCoef = ((((log 20) * _distance) + ((log 20) * 31.8)) / 200);
            _combinedCoef = _distanceCoef / _headingCoef;
            _jitter = 1 - ((random 200) - 100) / 1400;
            _signalLevel = (37 - _combinedCoef) * _jitter;
            if (_signalLevel >= -96.6) then {
                hint format["Signal Level: %1 dBm", _signalLevel]
            } else {
                hint "Signal Level: No Signal"
            };
            sleep 0.5;
        };
    };
};

What is the for loop for?

radiant needle
#

It's supposed to run for a fixed time, I just have it set to 16 seconds for testing purposes

still forum
#

It loops 32 times essentially wasting time needlessly if you are not on the frequency
Because the sleep is only inside the frequency checked if thing

radiant needle
#

Is there an easy way to make it only start running when correct frequency is set?

still forum
#

TFAR has a frequency changed eventhandler

#

Oh wait. Is that some kind of like... It shows you whether you are looking towards a certain object right?

radiant needle
#

Yes it's a radio direction finder

radiant needle
#

ALso I checked diag_log and when I switch from 31.8 to 31.9 it shows the switch, but when I did 31.9 to 31.8 all variables still there but it just stopped with the last entry being a 31.9

still forum
#

Yeah that's because of the sleep thing I just told you

#

if the frequency doesn't match. It will run through all 32 iterations in like.. 2 milliseconds and then exit

radiant needle
#

Oh okay I see now

#

ANd i wanted to add to check if target is actually speaking or not but this just shows "Not talking" when I talk, both over direct or radio.

[TestObject01,(_this select 1)] spawn {
_Target = _this select 0;
_Source = _this select 1;
For "_i" from 0 to 32 step 1 do {
    if (player call TFAR_fnc_isSpeaking) then {
    systemChat "Talking";
    }
    Else {SystemChat "Not talking"};
    Sleep 0.5;
};
};
still forum
#

TFAR 1.0 or 0.9.x?

radiant needle
#

1.-1.0.302

still forum
#

Try player getVariable ["TFAR_isSpeaking", false]; try that

radiant needle
#

Yep that works

still forum
#

OOPS. isSpeaking func is broken ๐Ÿ˜„ Thanks

#

Old TFAR returned SPEAKING new one returns two numbers indicating whether speaking and/or speaking on radio on a frequency that you can hear

radiant needle
#

Wait so could i have just skipped all the getting the channel stuff

#

if the fnc was working

still forum
#

Probably.


private _splitResult = ("task_force_radio_pipe" callExtension format ["IS_SPEAKING    %1", name _target]) splitString "";

//_splitResult
//1 - is Speaking
//2 - is Speaking on a Radio frequency that we can currently receive

private _isSpeaking = (_splitResult select 0) == "1";
private _isSpeakingOnRadio = (_splitResult select 1) == "1";
#

Ah discord doesn't copy correctly. After IS_SPEAKING there needs to be a tab, not spaces. very important

#

Or wait..

#

Forget that

#

way easier

#

player getVariable ["TFAR_isReceiving"];

#

I never tested that thing out though... Dunno what happens when you change frequency in the middle of a transmission. The internal variable mooost likely doesn't update correctly

#

Wait... I think that stuff doesn't even work at all :D
Nope.. Doesn't. That variable only works for player itself, only the local player

#

Why does everything have to be so complicated ๐Ÿ˜„

radiant needle
#

In a perfect world you'd have an eventhandler on both tx and rx that included both rx/tx info about the radios, and unit using the radio

#

But you start going down that route things start to get bloated

still forum
#

TFAR doesn't really store when you retrieve a transmission from someone else. It recalculates that on each audio packet.
Because you might be changing your local frequencies between start and stop of a transmission, or drop your radio.. or go out of range

#

So also can't expose that info to Arma. That TFAR_isReceiving var increments on transmission start, and decrements on stop. If you change the frequency while a transmission is going on, it will never decrement and that var will be stuck on true.. Have to fix that someday

radiant needle
#

Well my script works now at least, might not be pretty, but it's just used on one player for a single mission every now and then

calm bloom
#

Hello guys, speaking of TFAR, do you have any idea why cba keybind is not blocking its hotkeys?

still forum
#

TFAR has special code to not be blocked, or block other keys

#

So that you can radio while running or reloading or using the ace menu and so on

calm bloom
#

Ok, thanks for the info. How do you think, display event handler like that is gonna hit the client fps or not?

waituntil {!isnull (finddisplay 46)};

{
    // systemchat str (_x < 250);
    if (_x < 250) then {
        private _code = {
            if (!pzn_transmitting) then {
            _handler = (findDisplay 46) displayAddEventHandler ["KeyDown","if ([_this select 1,[_this select 2,_this select 3,_this select 4]] in pzn_radiokeybinds) then {true} else {false}"];
            // hint str _handler;
            pzn_transmit_handlers pushback _handler;
            };
        };
        ["KKA3fix", format['notransmithost%1',_x], ["No transmit host", "distribute transmit blocking"], _code,{false}, [_x, [false, false, false]],false,0,true] call CBA_fnc_addKeybind;
    };
} foreach (actionKeys "ReloadMagazine");


player addEventHandler ["Reloaded", {
    {(findDisplay 46) displayRemoveEventHandler ["keyDown",_x]} foreach pzn_transmit_handlers;
    pzn_transmit_handlers = [];
}];
still forum
#

it looks to be scheduled

#

Ah that there.

#

you might wanna use params instead of 4 times select

#

also if X then true else false is dumb and idiotic and stupid

#

if x is true.. It's already true. Then true doesn't change the value

#

If it's not true, it will be false. And call the else statement. Which will return false. But it already is false. That doesn't make sense

#

So actually.. Half of your code is completely useless.

calm bloom
#

yep that is not make preety much sence

#

i was just preety messed up with that true on the end of eventhandler code to intercept other keybinds

sonic slate
#

Question, when using the rhs launcher by a gear script, it spawns unloaded

#

Is there any way to spawn it on the unit loaded with a spesific ammo type?

#

this addWeapon "rhs_weap_smaw_green"; || does not add ammo to it

spice axle
#

try reload

ruby breach
high marsh
#

add the magazines before adding the weapon

sonic slate
#

@ruby breach Thanks, that seems to be what I need

ember verge
#

mpmissions__cur_mp.kelleysisland\mission.sqm/Mission/Entities/Item0.type: Vehicle class ModuleHideTerrainObjects_F no longer exists
can somebody help me ?

astral dawn
#

What am I doing wrong? My HC runs this inside init.sqf. I host the server from the editor and remoteExecutedOwner returns 0.

    [clientOwner, {
        private _remoteOwner = _this;
        diag_log format ["---- Connected headless client with owner ID: %1. RemoteExecutedOwner: %2, isRemoteExecuted: %3", _remoteOwner, remoteExecutedOwner, isRemoteExecuted];
    }] remoteExec ["call", 2, false];

And that's what i find in my server's RPT:
1:14:33 "---- Connected headless client with owner ID: 3. RemoteExecutedOwner: 0, isRemoteExecuted: false"

winter rose
#

yes, you make the server execute the code @astral dawn

#

wait, I might be wrong in my night logicโ€ฆ

astral dawn
#

The code above runs on HC, which makes the server execute what is inside {}

sturdy cape
#

ive made a function that applies player damage on being inside a radius.made a diag log to check if things are working and its applying damage twice or 3 times per kill. easy way to prevent a script doing this?

#

this is on a local machine

spice axle
#

What would you like to prevent? The script called 3 times or what?

leaden summit
#

if I wanted the remote designator backpack camo to match say the RHS version of the assault pack, could I just use setObjectTextureGlobal to do that in a multiplayer mission? Is there anything I have to watch out for?

sturdy cape
#

@spice axle yeah,basically.script is executed by a while that checks every secont for player distance to object

peak plover
#

What are you trying to achieve sparker

spice axle
#

Holy Shit that is performance garbage @sturdy cape

sturdy cape
#

setobjecttextureglobal should in theory just work fine on selection 0

spice axle
#

Use a trigger is eden

leaden summit
#

Cool thanks

peak plover
#

Descent object texture global work if someone chips

#

Jips

sturdy cape
#

its for a server side addon ๐Ÿ˜ญ

spice axle
#

What do you want to achieve?

sturdy cape
#

well i am having an anomaly system that spawns anomalies around the map,then checks if theres player approximity,then kills people

spice axle
astral dawn
#

@peak plover Just experimenting with remote executions. Or is remoteExecutedOwner supposed to return garbage sometimes?

sturdy cape
#

if i would throw that into a client mod,could i createtrigger on this anomalies maybe? no no, want to do our own stuff for the map we are making so i wont reuse other stuff than ive already got permission for to rewrite

spice axle
#

There is no client and server mod. There is a mod. They should be loaded on client and server. Sometimes there is no need for a server version.

sturdy cape
#

yeah i meant server as in plugin

#

apms and stuff

spice axle
#

What?

sturdy cape
#

desolation redux mod>>arma plugin management system (APMS)

#

pretty nice,you throw your plugins into a server folder,a config file in the other and stuff is running server only remotecalling stuff

spice axle
#

Then I canโ€˜t answer your questions. I have no clue about these kind of stuff

sturdy cape
#

in lazymens terms

spice axle
#

Yeah thatโ€™s how a mod works^^

sturdy cape
#

the client hasnt got any files,only compiled fnc

tough abyss
#

@astral dawn seems legit, remoteExecutedOwner is 0 because isRemoteExecuted is false. Why is it false, who knows, could be because you run it from editor or could be because it is HC, could be a bug. Try on dedicated.

peak plover
#

why is it false?

#

๐Ÿคท๐Ÿป

#

It worked when I tried it with call

#

I'd post the code, but it's malicious

astral dawn
#

I have no clue why it's false, it's very weird

peak plover
#

Try from a normal client

#

really odd

#

remoteExecCall might be worth a try too

astral dawn
#

But it worked when i get the clientOwner at the HC and pass it as argument to the server so the server knows the HC's owner iD

peak plover
#

yeah I guess

surreal peak
#

What is the name of the script that allows you to make boxes like this

#

trying to search through the ace PBO's and cant find it

#

if it helps I am using ACE, Achillies and CBA

cedar kindle
#

google CBA progress bar

surreal peak
#

thanks

cedar kindle
#

itโ€™s on their github wiki if it doesnโ€™t show

surreal peak
#

looks fun...

cedar kindle
#

ya

tough abyss
surreal peak
#

ooo thanks!

peak plover
#

You can just make a CT_STATIC and change it's size and use ctrlCommit <time>

#

But why reinvent the wheel ๐Ÿคท๐Ÿป

real tartan
#

I have issue with mod ( operator % ). When I run my loop it gives incorrect values.

#


_c = 0;
while { true } do
{

  systemChat format ["_counter: %1", _c];
  systemChat format ["_mod: %1", _c mod 3];
  
  if ((_c mod 3) == 0) then
  {
    _c = 0;
  };

  _c = _c + 0.2;
  sleep 0.2;
};
#

results: _counter = 26 | _mod: 2.00003

#

_counter 26.2 | _mod: 2.20003

#

_counter: 31.6 | _mod: 1.60005

still forum
#

what are the expected values vs what you are getting?

#

looks correct to me so far

real tartan
#

well, _counter: 9 should give _mod: 0 if I am not mistaken

still forum
#

yeah. And what do you get?

real tartan
#
16:12:32 "_counter: 0"
16:12:32 "_mod: 0"
16:12:33 "_counter: 0.2"
16:12:33 "_mod: 0.2"
16:12:33 "_counter: 0.4"
16:12:33 "_mod: 0.4"
16:12:33 "_counter: 0.6"
16:12:33 "_mod: 0.6"
16:12:33 "_counter: 0.8"
16:12:33 "_mod: 0.8"
16:12:33 "_counter: 1"
16:12:33 "_mod: 1"
16:12:34 "_counter: 1.2"
16:12:34 "_mod: 1.2"
16:12:34 "_counter: 1.4"
16:12:34 "_mod: 1.4"
16:12:34 "_counter: 1.6"
16:12:34 "_mod: 1.6"
16:12:34 "_counter: 1.8"
16:12:34 "_mod: 1.8"
16:12:34 "_counter: 2"
16:12:34 "_mod: 2"
16:12:35 "_counter: 2.2"
16:12:35 "_mod: 2.2"
16:12:35 "_counter: 2.4"
16:12:35 "_mod: 2.4"
16:12:35 "_counter: 2.6"
16:12:35 "_mod: 2.6"
16:12:35 "_counter: 2.8"
16:12:35 "_mod: 2.8"
16:12:35 "_counter: 3"
16:12:35 "_mod: 4.76837e-007"
16:12:36 "_counter: 3.2"
16:12:36 "_mod: 0.200001"
16:12:36 "_counter: 3.4"
16:12:36 "_mod: 0.400001"
16:12:36 "_counter: 3.6"
16:12:36 "_mod: 0.600001"
16:12:36 "_counter: 3.8"
16:12:36 "_mod: 0.800001"
still forum
#

single precision floating point number.
That's what happens.

#

on the 3 you basically get a 0.000000...4768...

real tartan
#

3 % 3 == 0, not 0.0000000000000000004768

#

so need to modify: if ((_c mod 3) == round(0)) then

still forum
#

3 % 3 == 0 no that's not how floating point numbers work

meager granite
#

Do _c = _c + 2 and _c mod 30 instead?

real tartan
#

need that _c = _c + 0.2 as doing internal counter in loop

meager granite
#

Divide by 10 where you need it?

still forum
#

How bout if ((_c mod 3) < 0.1) then ?

#

Just add a bit of tolerance

real tartan
#

my tolerance for SQF in Arma 3 is at my peek at the moment :D, thx for suggestions

meager granite
#

_c = 0; for "_i" from 1 to 30 do {_c = _c + 0.2}; [_c mod 3 < 0.1, _c toFixed 100]
=>
[false,"5.99999856948852540000"]
lul

#

Works only on reaching first 3

#

[true,"3.00000047683715820000"]

#

from 1 to 15

#

Oh wait you reset _c to 0

#

Nevermind

lost iris
#

If I have an array like this classes = [ ["C_1","Class1"], ["C_2","Class2"] ]; how can I edit an element in that array for example use an id of C_1 to edit Class1 to Class1Edited for example

real tartan
#

set

lost iris
#

classes set ["C_1", "Class1Edited"]; like that?

meager granite
#
{
    if(_x select 0 == "C_1") exitWith {
        _x set [1, "Class1Edited"];
    };
} count classes;
#

then instead of exitWith if you want to do changes to all C_1 in case there are several

lost iris
#

thanks, appreciate it

digital plover
#

I use the Battleye Extended Control (BEC) on my own server. But i have a problem. I have set the automatic restart. Bec window is closing. But it won't open Bec.exe automatically again. Probably need write a command to the ServrStart.bat file. But I don't know about it. Can you arrange this for me?
My ServerStart.bat:

color 0a
title Spook DayZ Server Monitor
:Serverstart
echo Sunucu Baslatiliyor
F:
cd "F:\Steam Game Library\steamapps\common\DayZServer"
echo Spook DayZ Server Monitor... Aktif !
start "DayZ" /min /wait DayZServer_x64.exe "-mod=@Trader;@KillFeed;@BuildAnywhere;@InventoryPlus;@LogBaseBuilding" -config=serverDZ.cfg -port=2302 "-profiles=ServerName" -dologs -adminlog -freezecheck -scriptDebug=true -cpuCount=4
ping 127.0.0.1 -n 15 >NUL
echo DayZ Sunucusu Kapatiliyor ... Yeniden Baslatiliyor!
ping 127.0.0.1 -n 5 >NUL
cls
goto Serverstart```
still forum
#

@meager granite we also have findIf now ๐Ÿ˜‰

meager granite
#

But will it be faster?

peak plover
#

๐Ÿค”

#

intriguing

still forum
#

uh.. yes..

tough abyss
real tartan
#

how can I play sound "from A3" for player locally? e.g. use playSound and use sound from Arma 3, e.g.: "a3\sounds_f\ambient\winds\wind-synth-fast.wss" ?

digital jacinth
#

playsound has global effects if you only want one unit to hear it you probably have to go with say3d and some invisible helper object.

#

that also needs a cfgSounds entry as well

real tartan
#

I want to only unit hear that sound

#

NOT broadcast it from unit

digital jacinth
#

yeah saay3d can play sounds from inanimate objects as well. My question to you was "Do you want only the one unit/client to hear that sound?"

real tartan
#

only one client

#

aaa... I see say3D have localEffect

digital jacinth
#

okay then

1. define the sound in cfgSounds
2. Execute a script that does following on the machine of your choosing.
3. spawn an invisible helipad at the spot you want with createVehicleLocal
4. wait until the sound is gone with a sleep or similar
5. delete local vehicle
real tartan
#
  1. do I need to define sound that is already in a3 ?
digital jacinth
#
  1. if it already has a cfgSounds entry that all is good
  2. depends on your use case, really. Here you have to go into detail if you already have something in place or just starting with this.
real tartan
#

checking if those sound are defined in some config

#
a3\sounds_f\ambient\winds\wind-synth-fast.wss
a3\sounds_f\ambient\winds\wind-synth-middle.wss
a3\sounds_f\ambient\winds\wind-synth-slow.wss
digital jacinth
#

i am not sure if these are already defined either, probably used in some showcase.

cedar kindle
#

playSound is local although canโ€™t take a position

#

only playSound3d is global

real tartan
#

did not find config for those specific, but found alternatives that have config values

#
configfile >> "CfgSounds" >> "wind1" | sound[] = {"\a3\data_f_curator\sound\cfgsounds\wind1",0.316228,1};
configfile >> "CfgSounds" >> "wind2" | sound[] = {"\a3\data_f_curator\sound\cfgsounds\wind2",0.316228,1};
configfile >> "CfgSounds" >> "wind3" | sound[] = {"\a3\data_f_curator\sound\cfgsounds\wind3",0.316228,1};
configfile >> "CfgSounds" >> "wind4" | sound[] = {"\a3\data_f_curator\sound\cfgsounds\wind4",0.316228,1};
configfile >> "CfgSounds" >> "wind5" | sound[] = {"\a3\data_f_curator\sound\cfgsounds\wind5",0.316228,1};
configfile >> "CfgSounds" >> "WindBig" | sound[] = {"A3\Missions_F_Bootcamp\data\sounds\wind_big",0.177828,1,80};
configfile >> "CfgSounds" >> "WindNormal" | sound[] = {"A3\Missions_F_Bootcamp\data\sounds\wind_normal",0.177828,1,80};
configfile >> "CfgSounds" >> "WindSmall" | sound[] = {"A3\Missions_F_Bootcamp\data\sounds\wind_small",0.177828,1,80};
tough abyss
#

you can make mission config yourself for them

forest ore
#

Server is supposed to create a trigger that is supposed to add an action menu entry to any player that is inside the trigger area.

_trgW = createTrigger ["EmptyDetector", [1399.276,704.546,0], true];
_trgW setTriggerArea [75, 75, 0, false];
_trgW setTriggerActivation ["WEST", "PRESENT", true];
_trgW setTriggerStatements ["call{player in thisList}", "call{{if (isPlayer _x && alive _x && local _x) then {menuID = _x addAction[""Open menu""];}} forEach thislist;}", "call{player removeAction menuID;}"];```
What am I missing that when testing the action I'm trying to add doesn't show up in the action menu?
As far as I understand the way I'm creating the trigger it should be global and thus created not only to the server but to the player(s) as well
tough abyss
#

You are creating global trigger but setting its params on local machine only

forest ore
#

ahh yes. Can I ask some advise how to make the params available to the players? Need to remoteExecCall?

tough abyss
#

make trigger in editor

forest ore
#

I had that heh ๐Ÿ™‚
For reasons would like the trigger to be created by the server

tough abyss
#

then you need to add params in either init.sqf (trigger name then has to be global) or remote exec them with persistent flag

#

I would go with the editor for safety and reliabilty

forest ore
#

Thanks M242. Will see if I can come up with anything and make a return back to the editor when not

south rivet
#

I got a weird thing going on. I have the following code in the init field of a group in the editor:

if (isServer) then {
    this setVariable ["FKF_GroupMarkers_iconData", ["b_inf", "ColorUNKNOWN", "HQ"], true];
};

The weird part is it doesn't apply globally. It gets set on the server, but not on the client; it has got me stumped. Does anyone know why this might happen?

delicate lotus
#

Hey, how can I force a helicopter to fly to a specific position and then stay at that position while having its gunner engage targets?

#

The helicopter should not move once engaging targets.

#

Already tried the "HOLD" waypoint, but that one just makes him wait at said position to identify targets and then fly to engage them.

forest ore
#

Alex, there are also SENTRY and GUARD waypoints. Have you tried those?

delicate lotus
#

AFAIK Sentry is just: Go there. Identify Targets. Then Move to next waypoint while eventually engaging them

tough abyss
#

@forest ore Try

if (isServer) then
{
    private _trgW = createTrigger ["EmptyDetector", [1399.276,704.546,0], true];
    [_trgW, 
    {
        _this setTriggerArea [75, 75, 0, false];
        _this setTriggerActivation ["ANYPLAYER", "PRESENT", true];
        _this setTriggerStatements 
        [
            "player in thisList", 
            "menuID = player addAction[""Open menu"", {}];", 
            "player removeAction menuID;"
        ];
    }] remoteExec ["call", 0, _trgW];
};
delicate lotus
#

@forest ore And GUARD waypoint only works with GUARD points. The group will move to the next guard point, and then defend it according to their ROE and Behaviour.

#

Which I guess also include following a target a bit

#

I guess if I disable the target AI of the pilot it could work. But I have the feeling that the gunner would not shoot since he isn't getting any: engage XYZ from his "commander".

tough abyss
#

@south rivet what is this?

south rivet
#

That is the group, that code is in the group's composition init field

forest ore
#

M242 thanks for the example! Tried it but no Open menu selection came available

tough abyss
#

So you check if it was set like this: !isNil {groupName getVariable "FKF_GroupMarkers_iconData"}?

#

@forest ore I missed then

#

added

south rivet
#

I checked with allVariables groupName, which returned ["FKF_GroupMarkers_iconData"] on the server and [] on the client.

tough abyss
#

allVariables could be broken in MP

south rivet
#

Still gives the same result if I use your code

#

False locally and true on the server

tough abyss
#

there were some restrictions applied to the command, now I am not sure anymore how it supposed to work in MP

south rivet
#

The array is a valid value, that should not be the problem

drowsy axle
tough abyss
#

@south rivet what if you set it with delay, like after the game is already running

south rivet
#

I'll try, got some other things I'm trying first

tough abyss
#

I would try first making sure the group is not null: isServer && !isNull groupName

#

init field could be tricky

south rivet
#

But it does get set on the server, so it is not null there.

#

It is just not broadcasting the value

tough abyss
#

Works for me if I set it later in game

astral dawn
forest ore
#

@tough abyss Just tested the "then" version of your script but still no dice. I don't see any script errors either so difficult to pinpoint where the problem might be

tough abyss
#

it is because addaction needs 2 args minimum, I just copied your one, don't blame me for it ๐Ÿ˜‰

#

added

forest ore
#

Well now that did the trick! Thank you M242!

languid tundra
#

@south rivet
Not sure why your code doesn't set the variable for all clients, but why wouldn't you just use

 this setVariable ["FKF_GroupMarkers_iconData", ["b_inf", "ColorUNKNOWN", "HQ"]];

The init line is already global and JIP compatible.

south rivet
#

Yea, that was a last resort. The way I did it would have had the most desirable effect for my use

still forum
#

@tough abyss allVariables could be broken in MP yes. on profileNamespace

#

@drowsy axle you cannot include external files in description.ext in 3DEN missions. BI broke that.

drowsy axle
#

oh ffs

#

๐Ÿ˜ข

#

How do they do it then?

still forum
#

they don't

#

BI only makes mission mods

drowsy axle
#

How's that different to the normal way?

still forum
#

mission pbo's are broken

#

that are generated by 3DEN

#

BI has their missions in a mod pbo

#

That's different in that it's a mod that contains a mission.. Not just a mission

next lily
#

There's setVehicleTIPars but is there any way to GET those values?

#

I vaguely recall seeing something about animations or an animation command having that value but I can't for the life of me remember.

still forum
#

No there is no getter

#

don't see anything useful in the animation states

drowsy axle
#

In which way(s) are they broken?

still forum
#

In exactly the way that you experienced