#arma3_scripting

1 messages Β· Page 459 of 1

unborn ether
#

both user/admin. Like sudoers and not.

#

For user side it can be used for some minor stuff, like writing in-game notes, or smth (no clue yet)

#

admin, by access level, from godmoding himself|other player, up to plain code exec.

#

Where thing like himself|other will be segmented by permissions.

meager heart
#

looks interesting πŸ˜€

unborn ether
#

just don't know if its worth it yet. There are alot of more user-friendly tools around.

still forum
#

@little eagle >I propse a new command: selectIf
@astral tendon >is selectIf a comand?

Well... It is now! https://github.com/dedmen/Intercept_CBA/commit/d39ee4dbe9f4ef64fbc99de7c428c1721356fe08

@tough abyss If you know how SQF works then you don't need to tell anyone the difference between a variable and a inline array. Because at the end both are exactly the same. The array returns an array. And the variable returns an array too. so in both cases you just have append ARRAY

tough abyss
#

A bit of clarity doesn't hurt, and when you've been away from arma for a while its hard to remember all the quirks of SQF. If you know how SQF works, you aren't reading a wiki page about arrays.

#

Assuming that's what you meant.

hollow thistle
#

How many "Location" objects should be considered fine?

#

Would around 100-150 be fine?

peak plover
#

select if?

#

uhhh

#

@hollow thistle

#

I tried with 100k

#

Only impacts fps when map is open

hollow thistle
#

I guess with invisible ones it does not impact map?

peak plover
#

it still does impact on map

#

even if invis

still forum
#

as long as you are not getting into the thousands you don't need to worry about it

hollow thistle
#

In liberation currently there are markers that are preplaced in eden.

#

They are "parsed" into array and used as sectors.

still forum
hollow thistle
#

I though array of locations could be more usefull as you can use them in "object" oriented way.

still forum
#

Well markers are not locations. If you need markers for something then you need them. Also dunno how easy it is to place locations in 3den

peak plover
#

pardon crappy code

#

It was written a while ago as a quick test for something

hollow thistle
#

Auto detection of map locations would be cool but i think manual placement of sectors is better for our use case.

peak plover
#

I had mine create 2 cluster arrays

#

1 for players 1 for ai

#

ai + all objects etc.

#

I was experimenting with clientside caching

#

Right liberation

#

I remember, the circles around areas

verbal otter
#

hello, i have a question. Is possible to calculate size of structured text control for given structured text?

#

something like hint calculation, but i need to use my control

hollow thistle
#

Ye we are rewriting it from scratch for better code and performance. That's why im researching how to reimplement core functionalities in better way.

peak plover
#

@verbal otter Do you mean the size of the text to be bigger?

#

So basically

#

the background of the control must scale according to the text?

verbal otter
#

@peak plover yes

peak plover
#

I had something for that but can't find it right now. I remember someone else doing this here, but that was a while ago

#

I think I had my own thing but I just had something with the lenght of the string

#

and then resized the dialog accordingly

#

Try counting how many can 1 line fit and then modulo of that or sth along those llines

verbal otter
#

thank you! will try

#

i think - resize structured text like <t size='2'> is use (text size from config) * 2

peak plover
#

I thought you wanted to resize the ctrl?

#

ctrlSetPosition

#

can resize controls

verbal otter
#

yes, i know that πŸ˜ƒ i just have issue with calculations of size control

unborn ether
#

@peak plover 100k locations? jeez.

compact maple
#

Hey ! i am looking for a way, to check if the player enter in collision, with any objects in the game, i tought about checking the distance between the player and nearestObjects, but its a little tricky,what you guys would do ?

still forum
#

if the player enter in collision What does that mean?

#

If the player will soon collide with something? Or is he currently sticking his hand into some other object?

compact maple
#

I mean, if a player run, then he got stuck in front of a wall, or a house..

#

He is currently sticking.

#

thats what i meant, sorry for my eng xD

still forum
#

you can use cameraViewDirection and lineIntersects to check if something is infront of the player

compact maple
#

thanks you

#

will try

austere hawk
#

not sure if players triggere epecontact - because they collide with geometry LOD, not geometry Physx LOD

lone glade
#

I remember that working at some point^

#

might not have been intended tho.

austere hawk
#

if you say it worked for players, then i doubt this changed.

cedar kindle
#

i didnt get it to work for players

austere hawk
#

aha

unborn ether
#

You cant attach EpeContact to a unit for that case, it will only trigger at the time where you ragdoll from a car hit for example. So ^ Dedmen statement is more reliable.

cosmic lichen
#

Doesn't anyone know a good tool to edit stringtable.xml files? Something with a nice GUI?

lone glade
#

tabler

cosmic lichen
#

nice thanks, I have been using stringForge.

earnest path
#

Do you guys know if there is an eventHandler for side chat ? Or a good script that can run some filters on the text?

lone glade
#

You can't.

gleaming oyster
#

@lone glade Well, you can return and read text from the chat. But you can't "filter" it ^^

earnest path
#

@gleaming oyster How do you read from chat

gleaming oyster
earnest path
#

@gleaming oyster Thank you this seems nice

thorn saffron
#

How do I get the world position player is aiming at (where the cursor is), where he is looking at. I do not mean the muzzle direction either.

peak plover
#

cursorTarget maybe?

gleaming oyster
#

cursorTarget wouldn't work anytime

cosmic lichen
#

That's returns the aiming position doesn't it?

peak plover
#

aaah damn yeah

#

it doesn't

gleaming oyster
#

I am assuming this is supposed to work regardless of location or what you are looking that

errant jasper
#

AFAIK yes it works all the time. I can't remember what world position it gives you if you look at the sky, or the "fog" if you view distance prevents drawing.

jade abyss
#

where he is looking at

gleaming oyster
#

Dscha...welcome back. Cigs in hand with internet?

jade abyss
#

My best guess would be LineIntersect or just intersect

gleaming oyster
#

@errant jasper "Target" ? doesn't that just return say buildings or objects?

jade abyss
#

cigs in hand? Wut?

gleaming oyster
#

You said you were off to go get cigs and didn't come back for a long time :)

errant jasper
#

What? Target?

gleaming oyster
#

cursorTarget

jade abyss
#

Ah, yeah. They didn't have my brand

#

cursorTarget -> Take Weapon Aim iirc

gleaming oyster
#

The target has to be known to the player to some degreeΒ 
Eh....

#

Does wiki need updating?

errant jasper
#

But if you want the direction the weapon is aiming at, I guess you should take weaponDirection, extend it (from weapon muzzle position) with vectorMultiply, and do intersection checks

jade abyss
#

CursorTarget/object if the wants that.

errant jasper
#

Are we talking about Taro's request? He wants the position.

gleaming oyster
#

How do I get the world position player is aiming at (where the cursor is), where he is looking at. I do not mean the muzzle direction either.

jade abyss
#

πŸ‘†

errant jasper
#

Yes, take the muzzle position, add to it the weaponDirection extended far enough (say 5km), and use an intersection check on that?

gleaming oyster
#

pos [0,0,0]

jade abyss
#

Muzzle, no

hollow thistle
#

I would like to test how my scheduled code behaves when scheduler is heavily loaded (for learning purposes) how should i emulate that? limit my fps to eg. 20 and spawn bunch of AIs?

jade abyss
#

I do not mean the muzzle direction either
He want's to know, where the player is looking at (head, not Weapon), if i understood him right. @thorn saffron Clarification please

errant jasper
#

He said aiming at

jade abyss
#

Read what he wrote

gleaming oyster
#

Grab the position he is looking at with weapon as in a position([0,00,]])

errant jasper
#

Well, he can't have it both ways, aiming != looking

#

So looking just use screenToWorld.

jade abyss
#

what the?

gleaming oyster
#

Hehheheh

#

@thorn saffron use screenToWorld

#

Discord nitro treatin you nicely to captain emotes from cup disc? :^]

still forum
#

@cosmic lichen there is also that weird arma stringtable tool on my github github.com/dedmen
I use that for TFAR

#

@gleaming oyster The target has to be known to the player to some degree for cursorTarget is correct

gleaming oyster
#

@still forum Yep, we were talking about cursorTarget

still forum
#

@hollow thistle lowering FPS doesn't change load on scheduler much I'd say.
Spawn many threads with while true loops that do some basic arithmetic. Like adding numbers or smth

gleaming oyster
#

This obviously doesn't apply to screenToWorld

still forum
#

screenToWorld doesn't respect buildings. Only terrain

gleaming oyster
#

Hm. So lineIntersects is probably more a viable solution?

#

From the muzzle say?

hollow thistle
#

@still forum maybe loops with sleep ?

still forum
#

no

hollow thistle
#

or is sleep special and not considered as load?

still forum
#

sleep suspends the script

#

giving the scheduler time to execute other scripts

#

which I guess is the opposite of what you wanna do

gleaming oyster
#

Server fps below 20 affects scheduler yes?

still forum
#

no

#

server fps below 20 affects netcode

#

@gleaming oyster you can use screenToWorld to get the furthest possible point. And then do lineIntersects between eyePos and the screenToWorld pos to check if anything else is inbetween

jade abyss
#

Ecample for lineIntersectsSurfaces

  • _PosStart = eyepos player as start
  • _PosEnd = positionCameraToWorld [0,0,10] (10 = Range)

Code Example:

_LIS = lineIntersectsSurfaces [_PosStart, AGLToASL _PosEnd, player, ObjNull, true, 1, "GEOM", "VIEW", true];```
Cycle through the Output of `_LIS`
#

Taken from OBE code, no clue anymore if something else was missing there ^^

still forum
#

just replace posCamToWorld by screenToWorld

jade abyss
#

I know there was something, why i haven't used it thinkingsherlock

little eagle
#

@hollow thistle You can create millions. They only impact fps on the map, and maybe for obscure scripts that iterate nearestLocations. Check FPS on the map to see how bad it is.

unborn ether
#

Interesting that eyePos for example doesn't change by Z, even if you are looking to the sky. But when you ALT it does. So Arma wants to tell me that my character is still looking at the same spot in front of him instead of head actual direction? Imagination of how eyes would really look like in that case gives me creeps.

naive oyster
#

How do I select only cargo that is not loaded into a vehicle? Here is the code I am using to get the supplies:
_supplies = nearestObjects [_churchpos, [ KP_liberation_supply_crate ], 50];

gleaming oyster
#

You mean the crates? Lol

naive oyster
#

yeah

#

KP_liberation_supply_crate just equals CargoNet_01_box_F

#

would i need to build a list of nearby vehicles, check all their inventories for supplies and build a list, then use the list to exclude objects from my search, or is there an easier way?

gleaming oyster
#

I gues you could use the cargo commands like magazineCargo and do something like:

_peaShooterMagExitsts = "peaShooter" in magazineCargo _boxThing;
#

itemCargo, magazineCargo,weaponCargo,backpackCargo. etc

naive oyster
#

oo, looks like there is an "isVehicleCargo" function

#

ty

gleaming oyster
#

isVehicleCargo is for ViV i believe

#
Return transporting vehicle if vehicle is loaded in one.

Yeah, doesn't apply to cargo in the sense of items, only vehicles

errant jasper
#

Liberation uses attach to "load" a crate right? So maybe: private _unattached = _nearSupplies select {isNull (attachedTo _x)}; ?

gleaming oyster
#

@errant jasper I thought he was talking about containing items?

#

OH. In a vehicle???

#

Man I'm dumb. My bad

errant jasper
#

I dunno. @naive oyster are you talking about how you load supply boxes that can be loaded unto Truck in liberation?

naive oyster
#

yeah

#

i am pretty sure they count as vehicles

errant jasper
still forum
errant jasper
#

Nice!

#

The bottom last one to the right, the teal/greenish one?

#

Formats are heavy

still forum
#

GameInstructionFu one

#

yeah. But in my last profiling format was still faster than the joinString equivalent

meager heart
#

you was saying that latest profiler build has some troubles with current game version or it's working, Dedmen ?

still forum
#

Fixed yesterday

meager heart
#

link ?

still forum
meager heart
#

ty

naive oyster
#

@errant jasper thanks, that works perfectly. now you actually have to stop and unload the cargo truck for it to count for the mission goal.

outer fjord
#

Question, I noticed in AI behavior that the AI would automatically locate enemy artillery that is bombarding it's position. How could I exploit this in such a way that the AI would automatically counter-battery if they have artillery as well? Like a scorcher detecting the unit, and dropping it's own arty?

#

Is there event handler that can automatically detect type of unit spotted?

gleaming oyster
#

No, but you could make one

languid fable
#
    if (!isPlayer _x) then {
    _x enableGunLights "forceOn";
};
} forEach allUnits;``` Could anyone help me with why this doesn't work? It should force the flashlights of AI on yet it doesn't
#

I run this in init.sqf since it is for all the AI currently placed down in the editor

lone glade
#

if they don't have flashlights it won't work ofc

languid fable
#

Yep, made sure they got the flashlights

half monolith
#

is it possible to change the color of the background that appears behind addaction?

meager heart
#

and again, hory shet dude, profiler works πŸ‘Œ
i was not expected that you can get that level of debugging... thanks man @still forum

cunning storm
#

Is there a way to see the server time on Linux in sqf?

#

Trying to replace this statement. _currServerTime = call compile ("real_date" callExtension "+");

still forum
#

@cunning storm nope. That's why that extension was made

cunning storm
#

Does the dll run in Linux?

errant jasper
#

99% the dll does not. Does it come with a .so file ?

cunning storm
#

No. It is just a dll file.

still forum
#

dll's usually don't run on linux

#

Only exception is the Arma 3 linux client port.

cunning storm
#

I'll probably have to do notifications through BattlEye or something then.

errant jasper
#

Maybe that can be combined with diag_ticktime depending on your needs.

cunning storm
#

I'll look into it.

#

Thanks.

winter rose
#

No way to know IRL time in SP, right?

austere granite
#

no

winter rose
#

shaaame

errant jasper
#

Sigh... Yeah shame. Don't understand these half-implementations.

#

Remind me of A2 era, where something either was scripted to only work in SP or dedicated, but would fail on hosted server....

winter rose
#

I think it was the opposite, at least the main campaign had to be hosted to work

still forum
#

@meager heart i was not expected that you can get that level of debugging. I also had a real debugger with breakpoints and viewing/editing variables and stepping through code and all the bells and whistles

meager heart
#

dude so far what i saw/tried from your projects... you're doing the right things πŸ‘

still forum
#

Don't have enough time to do all the things I want tho ^^

unborn ether
#

There are dudes saying you can remove connection/disconnection messages from chat control. Wondering how true is that. Any ideas?

still forum
#

yes you can

#

You can do everything with chat that you can imagine

gleaming oyster
#

@still forum Like what? Can you give an example? like ctrlSetText? blah?

still forum
#

no. Backend intercepty kinda stuff

gleaming oyster
#

Damn it.

quaint turtle
#

Hey, is there a way to disable the connection and the disconnection logs from appearing? (The ones in the bottom right of your screen)

little eagle
#

There is a way to kill the whole chatlog, if that would be sufficient. Deleting specific messages is curiously and sadly not possible.

#

Otherwise not with scripting.

tough abyss
#

Is it possible to do an inline method? Rather than a function, so I don't need to add it to CfgFunctions.

Just something like, for example

_doThing = { 
    _y = 20;
    _y
};
little eagle
#

Yes, you can put functions into local variables.

tough abyss
#

Can you give me an example? The above is how I'd assume it works, but it returns like a string.

little eagle
#

Hmm, what could I make this example about? No idea... Could you maybe instead post your script, so I can look for a possible mistake?

tough abyss
#

Literally what I posted above.

_doThing = {  
    _y = 20; 
    _y 
};

_val = _doThing;

hint format (["%1", _val]);
little eagle
#

change:

#
_val = _doThing;

to

#
_val = call _doThing;
#

You printed a copy of the function. But you need to actually execute the function to retrieve it's return value. call executes a function.

little eagle
#

I found a use case for , over ;.

peak plover
#

πŸ€”

#

What is it?

#

Tell me more @little eagle

#

🎩 trick of the day

little eagle
#

In config this:

onLoad = ctrlParent (_this#0) setVariable ['BWA3_sizeReticle', SIZE_RET]; ctrlParent (_this#0) setVariable ['BWA3_sizeReticleTop', (64/8192)];

errors, because the script uses ; and that terminates the config enty, causing the config to not compile.

#

This however works:

onLoad = ctrlParent (_this#0) setVariable ['BWA3_sizeReticle', SIZE_RET], ctrlParent (_this#0) setVariable ['BWA3_sizeReticleTop', (64/8192)];

:~P

peak plover
#

Whoa

#

That's fucking awesome

little eagle
#

I'm afarid actually.

little eagle
#

@tough abyss

{
    if (side group _x == west) then {
        _x addEventHandler ["Killed", {
            params ["_unit"];

            private _marker = format ["commy_corpseMarker_%1", _unit call BIS_fnc_netId];
            createMarker [_marker, getPosWorld _unit];
            _marker setMarkerShape "ICON";
            _marker setMarkerType "mil_warning";
            _marker setMarkerColor "ColorBlue";
            _marker setmarkerSize [.5,.5];
            _marker setMarkerText name _unit;

            _marker spawn {
                sleep 240;
                deleteMarker _this;
            };
        }];
    };
} forEach allUnits;
#

This seems more reasonable to me.

tough abyss
#

I'ma go give her a swing

#

is that top bracket actually needed? I included it in the code snippet because the OP did it

little eagle
#

Yes.

#

It's part of the forEach of the last line.

tough abyss
#

I see

#

Well it would be nice to see where only your body is, but if it shows on all clients that's not good

#

setMarkerLocal would fix right

little eagle
#

Oh right. I forgot that createMarker creates it everywhere. Disregard what I said.

#

If you wanted to make the marker only be shown for the player, then you would have to use createMarkerLocal and all other local marker commands like setMarkerTextLocal etc.

#

Because if you use any of these not "Local" marker commands on a local marker, the marker will become global. This is because this game wasn't actually meant to be played or scripted for, but actually specifically to upset reason and logic and me personally.

tough abyss
#

xD

#

lmao

warm gorge
#

What would be a good way to determine if a vehicle is armed? Such as HMGs or armed air vehicles. Would I need to check the weapons on the turrets, or is there an easier way?

little eagle
#

Define "armed".

#
private _isArmed = !(weapons _object isEqualTo []);

Maybe.

unborn ether
#

Sometimes i dream of having something like ownerUID along with owner so we can detect UID better and faster than this:

private _owner = remoteExecutedOwner;
private _userArray = allPlayers select {(owner _x) isEqualTo _owner};
if (_user isEqualTo []) exitWith {}; // User not present anymore
private _user = _userArray select 0;
private _uid = getPlayerUID _user;
little eagle
#

This is easy to make yourself though.

#

Sec.

#
// preInit function
commy_ownerUIDs = [];

addMissionEventHandler ["PlayerConnected", {
    params ["_id", "_uid", "_name", "_didJIP", "_owner"];

    commy_ownerUIDs set [_owner, _uid];
}];

// any script
private _uid = commy_ownerUIDs select _owner;
unborn ether
#

πŸ€” thats actually way better. ty

little eagle
#

You may have to broadcast commy_ownerUIDs using publicVariable or setVariable public if you want to use the array on clients.

meager heart
#

filtering the __SERVER__ could help too πŸ˜€

vapid venture
#

So, I'm trying to change Kerry's loadout at the beginning of the first Mission, but it always loads as the same kit. where would I go to alter its loadout?

little eagle
#

filtering the SERVER could help too
Help how?

#

Null, you mean in the campaign?

vapid venture
#

yeah

unborn ether
#

I was always wondering, who is owner 1, mission instance? πŸ˜„

little eagle
#

The campaign is not very editing friendly. It's a set of hard coded missions.

vapid venture
#

it should all be in the mission init correct? cause I'm looking through it, but I cant seem to find it.

little eagle
#

I don't know how that mission or the campaign works internally.

vapid venture
#

Well basically I've extracted it, and made it a scenario for eden.

little eagle
#

That is some good first steps.

meager heart
#

i mean first name will be __SERVER__ with PlayerConnected, commy

#

kinda server connects to itself πŸ€”

#

and by filtering i mean that ^

I was always wondering, who is owner 1
__SERVER__ < he is

peak plover
#

I remember sth about setting variables to map objects. It should still work for buildings? I think it was stones don't get them or sth?

little eagle
#

sldt1ck, I don't understand what problem you're trying to circumvent here. PlayerConnected will not fire for the server iirc, and even if it did, how would that be a problem?

#

nigel, there're different kinds of map objects. Some support it, some don't.

meager heart
#

with that filtering you will get actual first player, with PlayerConnected

#

and afaik it will fire for the server (might be wrong)

little eagle
#

I think you misread the script, sld1ck.

#

You get a full array of all connected clients (and maybe the server) and the index position inside that array is the owner id.

#

So you can get the UID quickly from the owner id.

meager heart
#

don't know man... maybe you're right and there is nothing to worry about πŸ˜€

little eagle
#

I am right.

unborn ether
#

@meager heart server is 2 not 1?

meager heart
#

afaik local host is 2... not sure about dedicated

unborn ether
#

Dedicated is always 2 too.

#

So thats why im wondering what stays for 1 all that times πŸ˜„

little eagle
#

Nothing will stay at 1.

#

The array is either empty, or as soon as someone connected, be of size 2 or larger.

#

It will never be size 1.

#

Sure, index 0 and index 1 will be undefined, but no one has these owner ids anyway, so they're never selected.

unborn ether
#

Just trying to get BIS logic, like negative is an exclusion on owner -2 // anyone but server, 0 is everybody, 2 server > =3 are clients

#

So whats -1 and exactly 1 at this point

little eagle
#

There is no owner -1.

#

There's also no owner -2

#

-2 means every owner except 2.

#

But that doesn't matter here, because remoteExecutedOwner never reports negative numbers.

#

As it reports the owner of who sent a script. And owner can never be negative.

unborn ether
#

No no, im not talking about owner exactly.

[someargs] remoteExec ['someFunc',1];

Whom it will send it to?

#

Like whos that?

little eagle
#

Either nobody or everyone. Not sure.

meager heart
#

afaik for RE it's just how they made it, nothing to do with owners id

little eagle
#

Undefined behaviour I'd say.

meager heart
#

what will return server command #userlist id's ?

little eagle
#
"1" remoteExec ["systemChat", 1];

Tested in SP. Nothing happens. I infer that it is executed nowhere.

meager heart
#

smart people said that #userlist returns id's, same as playerconnected first param

#

so 1 for re is nothingness then

little eagle
#

I guess. Same as [] effectively.

peak plover
#

Does attachto overwrite older attachto commands?

little eagle
#

Yes.

late gull
#

guys, is there a function to generate random waypoints?

#

or to make ai guard a point but in movement

#

like guarding a base

inner swallow
#

BI_fnc_taskPatrol

late gull
#

thanks mate

still forum
#

@peak plover setVariable on stone doesn't error. But doesn't set the var.
Buildings are streamed in/out. So if a building is streamed out and later streamed back in the variable might be gone.

peak plover
#

What about on server?

#

or hc?

still forum
#

The server or HC "entities" never change position. So I think they always see everything. Or the HC sees atleast the same things

radiant needle
#

Is it possible to give a player a full screen radar while not being in a vehicle?

little eagle
#

If the radar is full screen, they could see nothing else. I cannot imagine this being right.

radiant needle
#

No I want to simulate being an AWACS type thing

little eagle
#

Surely you mean the arcade version of an AWACS, because I doubt anyone here is any clue how those things work irl.

#

I ask because that determines if it is possible to script or not and how much effort it'd take.

radiant needle
#

Yeah, just one player who has a radar screen and relays information to the fighter pilots

#

Don't need to compute BRAs or anything

little eagle
#

I still have the file of my scripted mission squad radar. Maybe that helps, idk.

radiant needle
#

Is it possible to use vanilla radar?

little eagle
#

It uses the textures of the vanilla radar.

#

There is no script command like:
enableAWACS true;
or anything like that though. It will take some effort.

radiant needle
#

Its not a display that can just be created?

little eagle
#

My solution is:

if (hasInterface) then {
    0 spawn {
        disableSerialization;
        waitUntil {!isNull findDisplay 46};
        findDisplay 46 ctrlCreate ["commy_SquadRadar", -1];
    };
};

So it is a control that can just be created.

late gull
#
14:12:52 soldier[O_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform?
14:12:53 Duplicate weapon Throw detected for B_T_Soldier_TL_F
14:12:53 Duplicate weapon Put detected for B_T_Soldier_TL_F
#

any idea?

little eagle
#

Just ignore.

still forum
#

screenshots of code? really?

late gull
#

i can't ignore it

still forum
#

There is an error there points at screen

late gull
#

since spawn 1k AI and they should be only 6 xD

little eagle
#

That error message has nothing to do with 1000 ais. Are you asking how to make it stop creating so many ais?

still forum
#

First one. Stop using BIS_fnc_param. That's like the worst you can do. For one there is param and second there is params

late gull
#

saw error in params

still forum
#

Second. Why are you setting _pos first to objNull and then to an array?
Third why are you setting _ran first to objNull and then to number?
Fourth why are you setting _rad first to objNull and then to number?
Fifth why are you setting _grp first to objNull and then to config?

late gull
#

i start using it cause of that:

Parameters
BIS_fnc_param has been replaced by param and params. The commands are approximately 14 times faster. Use them!
#

ah dam, i read wrong

#

xD

#

my english still in progress

#

id did understand that param was replaced with BIS_fnc_param

still forum
#

The commands are approximately 14 times faster.
param/params are commands. BIS_fnc_param is a function

late gull
#

yes i see, my fail

#

about why objnull

#

does matter?

still forum
#

It just doesn't make sense

little eagle
#

That's the default value in case the function was called without one.

late gull
#

i was about

private _pos = [0,0,0];
private _ran = 0;
private _rad = 0;
private _grp = objNull;
still forum
#
private _var = objNull;
_var = 100;

Why not just directly set it to what you need?

#

First setting it to objNull and then immediatly overwriting it is literally useless

late gull
#

because it's under test now

#

but will be generated dynamically

#

and will change a few times

#

same var but changing

#

what a datatype is that

_grp = configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam_AA";
still forum
#

config

late gull
#

thx

#

made it work with dataType configFile

#
params [
    ["_pos", objNull, [[]]],
    ["_ran", objNull, [0]],
    ["_rad", objNull, [0]],
    ["_grp", configNull, [configFile]]
  ];
still forum
#

configNull

late gull
#

oki

unborn ether
#

Interesting can you expect nil in params? πŸ˜„ πŸ€”

hollow thistle
#

Don't you set nil if you don't want to specify default value but you want to specify expected data types?

errant jasper
#

That would just make the default value nil

little eagle
#

Dedmen, you can use configFile as an example of CONFIG type. I don't think this is objectively worse than configNull.

#

Don't you set nil if you don't want to specify default value but you want to specify expected data types?

#

Yes.

#

That would just make the default value nil
Being nil and being undefined is exactly the same.

unborn ether
#

So

params [
    ['_variable',nil,[nil]]
];

Will basically error out if i try to call that function with something not nil? πŸ˜„

errant jasper
#

Yes, and the error message is just b-e-a-u-tiful: Error Params: Type String, expected Any.

#

Think it might beat my favorite general result/error: ERROR: OK.

late gull
#

guys, so i noticed that []spawn wont get return data?

#

just call?

little eagle
#

Think it might beat my favorite general result/error: ERROR: OK.
Try this one:

_a = []; _a pushBack _a;
errant jasper
#

^^ that's nasty

still forum
#

@late gull spawn cannot return data. Because the script is not done when spawn returns

late gull
#

@still forum any way to get returned data with scheduled process?

little eagle
#

call.

still forum
#

The code has to be done to get the returned data

#

All weird workarounds you might be able to do. Are essentially just crappy versions of call

cold pebble
#
15:33:17 Error in expression <_a = []; _a pushBack _a;>
15:33:17   Error position: <pushBack _a;>
15:33:17   Error 167750984 elements provided, -1362697488 expected
#

Thats good πŸ˜›

little eagle
#

call already can be scheduled.

late gull
#

spawn the call and wait until have data or something like that? xD

errant jasper
#

Maybe you should describe what you are trying to do.

still forum
#

yeah. That would be the equivalent to just using call. So just use call

errant jasper
#

Spawning just to wait is 99% likely to mean you actually just want a call as suggested.

late gull
#

yes got it

little eagle
#

The call'ed code will also be scheduled if your original script was scheduled.

late gull
#
[]spawn = {
  _a = []call fncX;
  [_a]spawn fncY;
};
// do something else while the above is running
[]spawn fncZ;
#

that's what i was looking for

still forum
#
private _fncXReturn = [];
private _fncXAsync = _fncXReturn spawn {
  _this pushBack (call fncX);
};
// do something else while the above is running
waitUntil {scriptDone _fncXAsync;}//wait till fncX is done.
(_fncXReturn select 0) contains fncX's return value
#

one sec

late gull
#

scriptDone exits?

#

that helps a lot πŸ˜„

errant jasper
#

See you are also in wish SQF had closures camp.

still forum
#

fixed

late gull
#

great, will save that, thx

little eagle
#

I like it, Dedmen. Well I don't, but it's madness and chaos.

late gull
#

true

#

this private will block it

still forum
#

block what?

errant jasper
#

Wait, you should still "unload" the variable in the spawn.

#

E.g. param

still forum
#

which? why?

#

oh

#

should use _this

#

edited and fixed

late gull
#
private _fncXReturn = []; // <-- this private block the scope
private _fncXAsync = _fncXReturn spawn {
  _fncXReturn pushBack (call fncX); // <-- this is not  the same var
};
errant jasper
#

Yeah, but Dedmen fixed it in his edit.

still forum
#

As I said. Should be using _this and I fixed it already

late gull
#

ahh k

errant jasper
#

But just to be clear, this pattern is only really necessary, if whatever "work" you spawn off actually takes time, as in sleep or waitUntil. or the like.

#

If fncX just does some simply number arithmetic, it is unnecessary.

late gull
#

not using it at all xD

#

i'm curious in how to do that...

little eagle
#

spawn is never necessary.

winter rose
#

πŸ€”

errant jasper
#

Well, he's right, it should never be necessary. But some people (not me) just want to watch the world burn want to run code from event handlers that sleep and the like.

late gull
#

@little eagle u said that call it's already scheduled, so i can use sleep inside of it?

little eagle
#

I'm saying that call has nothing to do with unscheduled. call will be whatever environment the original script already was.

unborn ether
#
{_arr pushBack _x} forEach _arr;

meh-heh

little eagle
#
0 spawn {
    call {
        sleep 1; // sleep inside call
    };
    systemChat "test";
};
errant jasper
#

Hmmm, wonder if, _arr append _arr works. Believe we actually discussed this a month or so ago....

late gull
#

but you can't use sleep in standalone call

errant jasper
#

?? Sure if, in scheduled.

little eagle
#

Depends on the environment of the original script. I don't know what you mean by stand alone.

still forum
#

call doesn't change if scheduled/unscheduled. It keeps whatever was there before the call

#

spawn always moves into scheduled. No matter what was there before

little eagle
#

Yeiij, what is the environment of your original script? Do you know?

late gull
#

no idea

#

think about init.sqf

still forum
#

that is scheduled

late gull
#

so wth, where is not scheduled?

still forum
#

eventhandlers

little eagle
#

^

late gull
#

humm

still forum
#

Just read the wiki page about the scheduler. It tells you everything

little eagle
#

But tbh, I think waitUntil and sleep directly in the scope of the init.sqf is a bad idea.

#

At least put it into a different script instance.

late gull
#

i dont do that, just was an example

errant jasper
#

But it's a classic: waitUntil {player == player} at top of init.sqf, and then wonder why the server doesn't run properly when put on dedi.

late gull
#

well, moving out of that

#

the hell is wrong with bis_fnc_taskPatrol

#

ai walk into water

#

xD

errant jasper
#

Gotta watch out for those divers man.

#

But if it starts with BIS_fnc you got some percentage chance of it working, and some smaller chance of it working as intended, and slightly smaller chance of that actually being useful.

#

I think this one got 2 out of 3 right.

#

Actually it used BIS_fnc_findSafePos, to avoid water.

late gull
#

no no

#

i'm already using safe pos

errant jasper
#

So either it is the pathing itself, or BIS_fnc_findSafePos failed and default to some pos in water.

late gull
#

the problem it's the waypoints goin in to the water

#

and they just walk like there is not water

errant jasper
#

That's what I am saying. BIS_fnc_findSafePos might have failed (called from BIS_fnc_taskPatrol).

late gull
#

sorry xD

#

so i'm using twice the find safe pos

errant jasper
#

That would help. But it is not fully reliable. I use it, and set the objDist high to spawn groups.

#

Apparently the roof of buildings is a suitable place to put a Tank.

late gull
#

xD

#

🀦

lone glade
#

AI follow waypoints to the best of their ability

#

if the best path to the waypoint is water, they'll take it.

unborn ether
#

Through the spawned buildings and beyond!

meager heart
#

also afaik there are no water filters in bis_fnc_taskPatrol at all

#

(default i mean)

limber tangle
#

Hi guys trying to figure this out, not sure if anyone can help but here it goes:

Trying to add an addaction onto this line of code below but unsure on the syntax

private _lampsIn5000m = nearestObjects [player, ["Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F"], 200];
{ [_x, false] call BIS_fnc_switchLamp; } forEach _lampsIn5000m;

little eagle
#

Are those map objects?

meager heart
#

that will return [] ^ if objects not mission spawned

limber tangle
#

Currently tested this with a trigger, which turns off the lamps (objects ive placed on the map) but looking to trigger it instead with a addaction

little eagle
#

Not only that, but I also believe that you cannot add actions to map objects. On the other hand, there is this carrusel on Alits...

#

I have an idea, Gray.

limber tangle
#

sure?

little eagle
#
{
    _x addAction ["Turn Off", {
        params ["_target", "_caller", "_actionID", "_arguments"];

        [_target, false] call BIS_fnc_switchLamp;
    }];
} forEach _lampsIn5000m;
limber tangle
#

Thank you but im not very great with this stuff, i am unsure what "_target", "_caller", "_actionID", "_arguments" would be in the script that i sent

meager heart
#

also maybe

private _hour = date select 3; 
if (_hour > 20 || _hour < 8) then {
    /* night code*/
};    
limber tangle
#

The mission i am working on the team have to go in and turn on the emergency power at the generator, resulting in the surrounding lights to turn on

little eagle
#

What do you mean what they should be? They're inherent to addAction. You don't need to do anything about them.

limber tangle
#

oh right so this would be placed in the object?

little eagle
#

After that nearObject line of yours.

#

@limber tangle And those are terrain objects or placed ones from the editor?

meager heart
#

useful thingy in missions ^

#

also was dir indicator ui thing from a2 afaik that is bis_fnc_dirIndicator and still in the game and works

winter rose
#

@little eagle , we just spawn the script & that's it? yay πŸ™‚

little eagle
#

Yeah. It's a toggle, so you can call it again and it turns the thing off completely.

winter rose
#

may I say… noice

little eagle
#

This is a side product made while waiting for bwa3 to compile...

meager heart
#

lol

meager heart
#

how to make this thing a bit better

#
SORTED_VEHICLES apply { 
    private _units = (fullCrew [_x, "", false]) apply {_x select 0}; 
    if (count (_units select {alive _x}) isEqualTo 0) then {deleteVehicle _x}; 
}; 
#

SORTED_VEHICLES < that is vehicles - <excluded vehicles list>

#

πŸ€”

little eagle
#

Is this supposed to delete empty vehicles?

meager heart
#

yep

little eagle
#
{
    if (crew _x select {alive _x} isEqualTo []) then {
        deleteVehicle _x;
    };
} forEach SORTED_VEHICLES;
meager heart
#

tried with crew and was fails

little eagle
#

What was "fails"?

meager heart
#

with vehicles from addons sometimes it removes vehicles with players in

little eagle
#

πŸ€”

meager heart
#

yep

little eagle
#

Which addon, which vehicle and which slot is not reported by crew ?

meager heart
#

RHS tigr.. without mounted weapons

#

there is FFV for the gunner

#

also one BTR

#

cant tell exactly

#

and .... i think was one more

#

also with FFV

#

for the gunner

little eagle
#

Never seen FFV for the gunner. Maybe they hacked something together with scripts and it's weird. Does fullCrew really report those slots?

meager heart
#

tried exactly what you suggested above ^ but... was troubles, with fullCrew and empty filter it works

#

Does fullCrew really report those slots?
yes with empty filter

hollow thistle
#

This is interesting. There were few reports that in current (legacy) liberation codebase vehicles sometimes vanish. Usually it happened with RHS vehicles. If it is true that crew does not work correctly sometimes for their vehicles I guess this might be a reason. (They were trashed by garbage collector :D)

meager heart
#

about the same here ^

hollow thistle
#

What is meant by "crew" in crew crew command?

#

Do passenger seats count or not?

meager heart
#

yes

#

it counts cargo

#

and afaik dead units in also

hollow thistle
#

And full crew? works the same but returns empty slots too?

meager heart
#

you can filter it as you wish

winter rose
little eagle
#
{
    if ([gunner _x] + crew _x select {alive _x} isEqualTo []) then {
        deleteVehicle _x;
    };
} forEach SORTED_VEHICLES;
#

There. Fixed.

meager heart
#

maybe make macro function for it... that will be called multiple times πŸ€”

#

also don't feel safe with crew πŸ˜€

little eagle
#

It's gunner plus crew though.

meager heart
#

that is the problem afaik with that ffv as gunner but not gunner...

little eagle
#

Yeah, but why bother to add additional checks if this is the simplest?

meager heart
#

hmm don't know man... thanks anyway, will see how it will works

hollow thistle
#

It is kinda shitty when you need to create workarounds for someone else's mod.

vapid venture
#

can someone explain what an event handler is and its functions?

meager heart
#

veteran29, so true

hollow thistle
#

but what you can do... rhs is core for me.

#

But it is a bit broken since tanks dlc i think.

meager heart
#

it is

hollow thistle
#

Today I saw that all gunners of m113 were standing at the top of their vehicles and shooting with rifles πŸ˜„

little eagle
#

@vapid venture It's a piece of code that you put in memory that is repeatedly executed whenever an event happens, E.g. a unit dies or fires a weapon.

vapid venture
#

aight, thanks.

hollow thistle
#

It's a function that is "subscribed" and called when certain event that it subscribed to happens.

#

In simple words.

meager heart
#

event handler

#

lol

hollow thistle
#

so in short it handles an event πŸ˜„

meager heart
#

takes care of it πŸ˜†

vapid venture
#

what about azimuth?

hollow thistle
#

How is this related to event handlers? Do you think about specific event handler?

#

I'm lost.

meager heart
#

azimuth = bearing = direction

vapid venture
#

thanks

#

@hollow thistle I'm just tryig to get a better bearing, I dont know a lot of terms with scripting for arma

hollow thistle
#

Ah you meant "what is azimuth", sry I have misinterpreted your question. My bad.

vapid venture
#

ah

#

I have just one more question

#

So, I have the initmission.hpp for the first mission in the arma campaign, I have it all set up in the editor and I'm trying to change all of the main characters loadouts (E.G. Kerry, Lacey, Adams... etc) but if I just change the loadout in the editor, their loadout stays the same as it originally was. I would assume somewhere in the initmission.hpp would be whats doing it, but I'm not sure what to look for.

little eagle
halcyon crypt
#

should {} forEach nil; throw an error or does it not care? πŸ€”

still forum
#

returns nil

#

silently errors

halcyon crypt
#

having some code that passes over a variable with 2 possible branches (typename or forEach) but further down the script it spits out undefined errors

#

ahh cool thanks πŸ˜ƒ

subtle mauve
#

hello

#

can i get help here about UAV issue?

#

im the owner of Exile server...and cant figure out how to put UAV like sentinel and Greyhawk one in trader for sale

#

sry my english is not perfect i hope u understand my problem

wary vine
#

is there a way for force a ctrlGroup to scroll to the bottom ?

peak plover
#

uhh

halcyon crypt
#

you can set the autoScrollEnabled property on the ctrlGroup object thingy and control it with the ctrlSetAutoScroll* functions

wary vine
#

ill take a look

peak plover
#

So I set the variable for a house and teleported away. I came back and it was still assigned

#

Does it matter if I'm singleplayer to reset building variables when I leave the range

#

or server

halcyon crypt
#

is this related to an earlier question? πŸ˜›

peak plover
#

I asked before, went afk and Now tested

#

I assume that might be a bug on clients

#

But right now local server and single player variable was not reset

#

Even just setting variable reference to the house and checking the variable when out of view works

#

@still forum

halcyon crypt
#

I don't know the original question but buildings going "out of range" keep their variables

#

they're persistent

still forum
#

I don't know where I remember that from that variables on buildings is unreliable

halcyon crypt
#

we rely on building variables on quite a few systems in ALiVE and it seems to be working just fine πŸ˜›

peak plover
#

On server?

wary vine
#

πŸ˜„

halcyon crypt
#

neat ^^

peak plover
#

That looks pretty cool @wary vine

wary vine
#

πŸ˜„

halcyon crypt
#

@peak plover not sure about client/server, the file that I have in front of me sets them globally

wary vine
#

just gotta turn off auto scroll now πŸ˜ƒ

halcyon crypt
#

but the function should be running server side so it should work on just servers as well

wary vine
#

_controlGroup ctrlSetAutoScrollSpeed 0; should do it right ?

halcyon crypt
#

@wary vine in case you haven't figured it out yet, if you set speed to a negative value it'll stop/disable autoScroll

wary vine
#

0 should work shouldn't it

halcyon crypt
#

perhaps ^^

wary vine
#

hmm

#

now its not working at all xD

#

is there a way to wait until its at the bottom then stop ?

peak plover
#

Interesting

wary vine
#

wait what ? this is wierd.

#
If user focuses on the control, autoscrolling is interrupted.
#

thats crap

#

xD

halcyon crypt
#

well I guess it simulates your finger on the touchscreen 😁

wary vine
#

ill show you, gimmie a sec

#

its fucking hiliarius

#

even if i focus the control it doesnt stop the autoscroll

#

I have to fight with it xD

peak plover
#

Some map objects don't support setvariable, some do

#

Same amount no matter where on the map I am

halcyon crypt
#

what kind of objects are you talking about?

#

buildings should always work

peak plover
#

Yeah buildings work

wary vine
#

ill just do onFuckused event handler

peak plover
#

stuff like that

#

I just find it weird

halcyon crypt
#

yeah those properly use a different base class / simulation for performance reasons

#

a bit like the simple object thing

#

you could just keep a global array/hash and store the data in there using the id or reference of the object as a key

wary vine
#

on _ctrlEventhandler onfocus the ctrl is _this right ?

still forum
#

onSetFocus? yes

wary vine
#

ty

peak plover
#

yeh, I'll just save the buildings with buildingPos into an array. thanks @halcyon crypt

wary vine
#
_controlGroup ctrlSetAutoScrollRewind false;
_controlGroup ctrlSetAutoScrollSpeed 0.1;
_controlGroup ctrlSetAutoScrollDelay 0;

_controlGroup ctrlAddEventHandler [
    "SetFocus",
    {
        params ["_controlGroup"];
        _controlGroup ctrlSetAutoScrollSpeed -1;
    }
];
``` so something like that should work ?
halcyon crypt
#

assuming that you want to disable auto scrolling when someone is manually scrolling the screen you could probably use onMouseButtonDown and onMouseButtonUp

wary vine
#

setfocus should work right ?

halcyon crypt
#

I guess

#

do make sure to turn it back on on KillFocus πŸ˜‹

wary vine
#

Dont really need to πŸ˜ƒ

#

only really need it untill all the messages are loaded

#

the controls group gets refreshed when messages are received.

halcyon crypt
#

ahh alright

peak plover
#

Can I find the amount of building positions from the config?

halcyon crypt
#

like positions inside a building or positions of buildings/objects?

peak plover
#

inside building

#

I guess only way is buildingPos

halcyon crypt
peak plover
#

Hmm okay

halcyon crypt
#

_object buildingPos -1; should return an array with all building positions

peak plover
#

Where are these stored 'tho?

#

In the model?

halcyon crypt
#

no clue

#

probably

#

I think they're memory points so probably the model

peak plover
#

okay

#

I'll just use buildingpos for now, but I guess I can make an array of pos in relation to model eventually

peak plover
#

Anyone here know how loot in dayzmod was spawned?

#

clientside afaik

peak plover
tame portal
#

Pretty sure it was a circle around you spawning the loot

#

Clientsided

peak plover
#

Clustering all the buildings and then clustering the clusters

#

I did something like this before

#

But it came out better this time

#

I'm not sure if clientside is the way to go 'tho

#

Updated with total cluster amount

#

Why stop at loot 'tho.
Anything that has excessive amounts of inArea / distance checks can be optimized

#

Layers: 5
Biggest layer amount: 15
Total cluster amount: 868

#

Fun stuff!

unborn ether
#

@peak plover Whats that for, spawning gear in building?

meager heart
#

loot loot loot things πŸ˜€

little eagle
#

What's going on here?

unborn ether
#

Is it possible to have conflicts with publicVariableServer where server handles some code with addPublicVariableEventHandler? Like when few of public commands happen at once?

little eagle
#

They will all arrive and trigger the PVEH, but the variable could afterwards be different on the clients. Depending on who set it first and when the remote value arrived.

#

All messages go through the server, and all messages sent from one machine, i.e. the server, will arrive in order.

unborn ether
#

Well anyways just better to use remoteExec

#

to avoid that probability.

little eagle
#

That has exactly the same behaviour.

#

It's just how the server-client structure operates.

unborn ether
#

But Depending on who set it first and when the remote value arrived. is not true for remoteExec, since it has no remote value

little eagle
#

Sure it has:

[1, {variable = _this}] remoteExec ["call"];
unborn ether
#

πŸ€”

fossil yew
#

How to dynamically add artillery support module to human commander on dedicated server?

#

I tried with little luck

vapid venture
#

so, in a initmission.hpp, what would be forcing the main character to use a certain loadout even when changed in eden?

little eagle
#

Probably nothing, and it is in a different file.

meager heart
#
module_name synchronizeObjectsAdd [player];  //--- requester 
module_name synchronizeObjectsAdd [requester_module_name];  //--- support unit to requester
#

@fossil yew

#

imo even better option with bis_fnc_addCommMenuItem

#

but you will need script it ^

#

and also we have bis_fnc_addSupportLink

#

and x2 don't forget about BIS_supp_refresh = true; publicVariable "BIS_supp_refresh"; after synchronization

fossil yew
#

Thanks

unborn ether
#

What might be the issue where your extensions fail to load with could not be found while its actually both in server addon and root of the server (for insurance)?

#

Server is x64 and extension is x64 ofc

little eagle
#

Battleye, antivir, path is actually wrong.

tall dock
#

I could use a small hint here: How in the hell does the AI use "doArtilleryFire" ? It appears to me that this function only works for a certain artillery range - almost as if the artillery computer was forced to medium range. In my case the AI artillery only covers approx 5km-12km.
Is there a trick to make it work outside of that range / any command to switch the AI's range settings?
When firing the artillery in question manually, I can cover the entire map due to the range settings from near to very far.
// EDIT: when checking "inRangeOfArtillery", it almost always returns true, but still doesn't fire outside of 5-12km.

runic rose
#

Anyone know of any scripts to convert between VectorDirAndUp and Eden Euler angles? Trying to spawn objects in Zeus/Eden and even using BIS_fnc_setPitchBank isn't working reliably at larger angles (ignoring the fact it's not in XYZ format).

molten folio
#

How can i put a Image (paa) on CtrlCreate RscPicture
?

winter rose
#

via CtrlSetText I think

molten folio
#

Ty

winter rose
#

yw

quasi rover
#
_VarName = ("kill_Commander" + _rnum);  //_rnum is random number
_commander setVehicleVarName _VarName;  //_commander was created by 'createUnit'
missionNamespace setVariable [_VarName, _commander];
publicVariable _VarName;

build_Task_objs pushback [_commander];
publicVariable "build_Task_objs";

build_Task_objs get the following value on each server and client-side.:

//build_Task_objs:
Server: [kill_Commander15019339] 
Client: [O Bravo 3-4:1 REMOTE] 

how can I do client-side also get the [kill_Commander15019339] as build_Task_objs element?

still forum
#

call setVehicleVarName on clientside too

ruby turtle
#

Hello. I have a problem. I Build a building complex fully enterable. There are places in it, they are above 100 metres above ground. How I can disable the Halojump falling animation? Everytime a player left a placed object to go to another object the falling animation activates... it sucks a bit. Especially when you want to something above 100metres. Can I global deactivate this automatic vanilla animation switch?

winter rose
#

None that I know of

#

Maybe make them overlap a bit

still forum
#

Everytime a player left a placed object to go to another object What does that mean? Walk between two different buildings? Does the Roadway lod overlap?

digital jacinth
#

is there a way to get doMove or moveTo on dog agents to work on a dedicated server? So far every time I spawn an agent and tell it to move to a position it just runs straight until i pity delete it

#

it does work if I spawn it on a clients machine tho.

late gull
#

guys, i'm using Virtual garage to allow players spawn a vehicle

#

but i want to stop the player from creating more than 1 vehicle at time

#

any suggestion?

#

i been thinking about get the vehicles owned by the player to allow him or not to get another one

#

but how i do that?

unborn ether
#
['string',,'string2'] // invalid number in expression

arma..

still forum
#

correct. It's a invalid number

#

I think "number" is just their "value"

ruby turtle
#

That means there are two catwalk objects for a "bridge construction" and when I walk trough the two objects and "leaving" the first one I automatically going into a free falling animation. (Only above 100 metres) @still forum

#

For example

still forum
#

sounds like the roadways don't overlap

ruby turtle
#

I place them on the exact same height and they are overlaping each other

#

Roadway?

still forum
#

yes. roadway.

ruby turtle
#

Its not possible for some objects to let them overlap for reasons. Is there any way to prevent from changing the animation? There have to be a function that initialise that anination above 100 metres.

still forum
#

no there doesn't have to be.

#

My guess is that it's hardcoded to start when you are above 100m AGL. and ground level is the next roadway lod under you

ruby turtle
#

Can I place a Invisible roadway between the ground and the object?

still forum
#

Place some object with a roadway lod over the border where it happens

#

I don't know any. But I'm sure there are some simple walkable surfaces that aren't too high

#

invisible I guess not

ruby turtle
#

A port concrete block for example? Try and error?

still forum
#

yeah

#

the VR blocks should also work. Maybe you can just place them under the border.
You should also be able to setObjectTexture them to invisible

ruby turtle
#

But I can switch the visibility in the attributes or not? Unchecking a box

still forum
#

I think hideObject also disables collision. But you want collision

ruby turtle
#

Yep

#

Okey I will try this and give a feedback.

#

Aren't VR Objects invisble?

still forum
#

no

ruby turtle
#

Ok. Strange workaround. Should be easier without using double number of objects especially for performance reasons.

austere hawk
#

are there limitations to what you can do with buildings that are on the map regarding scripting?
Specifically, finding objects and attaching objects (using memorypoints ideally) and adding eventhandlers? I'm asking because i'm wondering about to do functional terrain-placed bunkers that are supposed to have turrets in them. I need to spawn the turrets as vehicles in missions, can't place them on the map if they are supposed to work - but the bunkers need to be placed in the terrain otherwise it would look odd.

half laurel
#

any idea of the syntax to use to count how many subclasses exist in a vehicles class Presets and return the displayname for each class present?

#

_name = getText (configFile >> "CfgVehicles" >> typeOf (vehicle player)>> "displayName"); I can do to get a top level string, but how to count subclasses in class presets, and how to extract the displayname from each one?

astral tendon
#

what is the command that i set numbers from 34.444 to 34?

still forum
#

round/floor

astral tendon
#

thanks

half laurel
#

`

#
"( 
    {getText (_x >> 'Displayname')} 
)" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets");
#

something like this i think i need, but damn my coding is rusty

still forum
#
("isText (_x >> 'displayName)'" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets")) apply {getText( _x >> "displayName")};
#

returns displaynames of all subclasses of "Presets" that have a displayName

half laurel
#

thanks! how is it stored?

#

_myarray =...

still forum
#

it's returned yeah

half laurel
#

so for example

#
_presets = ("isText (_x >> 'displayName)'" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets")) apply {getText( _x >> "displayName")};
PRIVATE _count = count _presets;
hint format ["first: %1, count %2", (_presets select 0), _count];
``` returns null and 0
still forum
#

don't see an error in there. As long as the part you gave me (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "Presets") is correct

half laurel
#

well if i do PRIVATE _name = getText (configFile >> "CfgVehicles" >> typeOf (_plane) >> "displayName"); tha treturns the displayname of the plane i am in correctly

still forum
#

don't write private in caps. caps denotes macros

#

ohhhh

#

duh

half laurel
#

ok i missed a class TransportPylonsComponent

still forum
#

"isText (_x >> 'displayName)'" swapped ' and ) at the end

half laurel
#

_presets = ("isText (_x >> 'displayName')" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets")) apply {getText( _x >> "displayName")};

#

works

#

thanks so much πŸ˜ƒ

#

cool so i can now see if i can read the presets and apply them to the plane from a cockpit action.

hollow thistle
#

what is the cheapest way to create new global namespace? (without cba)

hollow thistle
#

Does it matter what do i use as simple object? I guess the less complex model the better?

still forum
#

correct

hollow thistle
#

So another question. What is the least complex model in vanilla? πŸ˜„

still forum
#

I'd say vr block. Atleast that get's close

hollow thistle
#

Thanks!

little eagle
#

@hollow thistle createSimpleObject with this model:
"\A3\weapons_f\empty.p3d"

#

is probably as cheap as you can get.

#

May need to cut off the leading slash. idk.

#

Location is always better than any object though. I suggest "Invisible" as classname. It only renders a text on map, which will be empty string.

#

createSimpleObject is needed when you want to share the namespace with everyone via setVariable public.

hollow thistle
#

I'm was going to create my own custom event system as bis one seems to be slow. I'm not yet sure if i need global or local namespace to hold my handlers.

little eagle
#

Reinvent the wheel. I wish cba could be dropped into mission folder. Arma 4 maybe.

astral tendon
#

Is there a command to get the direction of a object from the player? getRelDir does not do what I need.

little eagle
#

getRelDir is the direction of an object from the player.

#

Or do you want cardinal directions and not directions relative from the player?

#
player getDir _target
astral tendon
#

oh, I did not know that getDir have that alternative syntax

unborn ether
#

Heard a rumors that arma 4 is real..

still forum
#

Yes! it is

#

Did you miss that? wow..

unborn ether
#

Well it sounds like meme for me already, so if thats a fact, i could, yes.

half laurel
#

another question on extracting data from configs:

#
        class Presets
        {
            class Default
            {
                displayName = "$STR_vehicle_default";
                attachment[] =
                {
                    "uns_pylonRack_7Rnd_Rocket_FFAR",
                    "uns_pylonRack_7Rnd_Rocket_FFAR",
                    "uns_pylonRack_6Rnd_Bomb_CBU25"
                };
            };
                   };
#

_newarray = ("isArray (_x >> 'attachment')" configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets" >> (_presets select _i))) apply {getArray( _x >> "attachment")};

#

returns null

#

what i'm after is extracting the array attachment[#1,#2,#3] to be useful in my script.

#

any idea on the correct syntax to extract those magazines?

#

and also how to count the number of items in the attachments array
damn, i'm so rusty, haven't written any scrips for at least a year.

late gull
still forum
#
_newarray = (
"isArray (_x >> 'attachment')"  configClasses (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets")
)  apply {getArray( _x >> "attachment")};

then _newArray contains arrays of arrays of classnames

#

If you want to get the attachments of a specific preset

#
_attachments = getArray (configFile >> "CfgVehicles" >> typeOf (_plane) >> "Components" >> "TransportPylonsComponent" >> "Presets" >> (_presets select _i) >> "attachment");
_numberOfAttachments = count _attachments;
half laurel
#
hint str _presetarray;
``` returns [].
#

ah sorry didn't see you'd replied - thanks once more πŸ˜‰

still forum
#

configClasses get's all subclasses of what you give it

#

your Presets>>Default doesn't have any subclasses.

half laurel
#

ok i'm starting to get it thanks so much

#

never used much more than getting a number or name from config before. mining out classes and arrays is a little confusing.

meager heart
#

i need send multiple pub vars at once, how to do it better ? one by one or with forEach or apply ?

#

for example

GVAR_1 = 0; publicVariable "GVAR_1";  
GVAR_2 = 0; publicVariable "GVAR_2";
GVAR_3 = 0; publicVariable "GVAR_3";
GVAR_4 = 0; publicVariable "GVAR_4";
//--- or something like this 
["GVAR_1","GVAR_2","GVAR_3","GVAR_4"] apply {publicVariable _x};
still forum
#

use setVariable

#

essentially doesn't make a difference

errant jasper
#

So, esoteric question here, if I setVariable missionNameSpace with public set to the empty array (or perhaps just 2), will JIPs get the value - or is it only for true?

meager heart
#

afaik they will get []

errant jasper
#

? No, I mean the 3rd parameter to setVariable.

still forum
#

only people in that array

#

considering it's empty.. no one

#

I think JIP anyway only works for true.

#

If you send it to a specific player he will be a different player wehn he rejoins. so JIP makes no sense

errant jasper
#

I see... I was looking for a way to set a variable for JIPs without overhead of transmitting to current clients.

meager heart
#

just tried with setVariable and apply for multiple vars at once, works πŸ‘Œ thanks man

still forum
#

yeah... of course it works...

#

your other solution above also worked

meager heart
#

lol

#

yes it was working, but not like it does now πŸ˜€

half laurel
#

ok my next question in this quest for true dynamic rearming...

#

is there a way to remove and replace a pylonmagazine / attachment?

#

removemagazine does not appear to work and nor does addmagazine

still forum
#

ACE has a pylon rearming module

#

you can just look into how they are doing it

half laurel
#

i normally try to write my code from scratch tbh, but i guess if it's public information it won't hurt to glance over it πŸ˜‰

#

getPylonMagazines

#

who knew? lol thanks once again

#

nope still not helping. any idea wh owrote this for ACE? they might know the answer

#

@delicate mason it was this fella.

#

ok i messaged him. let's see if he knows.

#

found it

still forum
half laurel
#

what i needed was: removeWeaponTurret and setPylonLoadOut

#

those are what make the mags add and remove in the new system.

#

so after 4-5 hours of tinkering i now have a basic action menu based reload script that finds all the presets and lets you apply each with a single action click. simple but effective πŸ˜ƒ and it's about 100 lines of code. just need to sort out error handling, and i'll post it on the forum somewhere

wary vine
#

since that video was uploaded, have added an event handler to onSetFocus, delete the text.

meager heart
#

good job man, looks nice πŸ˜€

vapid venture
#

So I'm trying to export a scenario to steam, but when I publish it, it never takes my .hpp files or any of the scripts with it. How would I get it to take the scripts as well?

little eagle
#

Binarize it?

vapid venture
#

whenever I binarize it it doesnt take the scripts with it

little eagle
#

How do you binarize it?

vapid venture
#

oh wait

#

nvmnd thought you meant something else by that

#

How would I do that?

little eagle
#

Check [x] Binarize Scenario checkbox when saving the mission.

vapid venture
#

okay

tough abyss
#

Is there a faster way to hint a value, besides using format ["%1", _val];?

peak plover
#

hint str _val

tough abyss
#

thank you πŸ˜ƒ

little eagle
#

Careful.

fringe yoke
little eagle
#

Iff _val is undefined, hint str _val will fail silently, and hint format ["%1", _val] will still print <any>.

tough abyss
#

Sounds good. Thanks guys.

peak plover
#

U should make a function for debugging and then call that

little eagle
#

You should make a macro for debugging, so all your debugging can be disabled by changing one line, and there is zero cost at runtime.

peak plover
#

πŸ‘†πŸ»

little eagle
#

I personally just place diag_log [_val] or systemChat str [_val] everywhere and delete them when I'm done, because no one would debug anyway after they're done, right?!?

unborn ether
#

Is there any way to block BIS_fnc_* the same way CfgDisabledCommands does it for commands?

little eagle
#

Why would you ever do this? Sounds like a dumb idea.

unborn ether
#

Because command I block in CfgDisabledCommands usually can have a BIS_fnc_ alternative which works fucking well.

little eagle
#

Okay, I'm out of this discussion because CfgDisabledCommands itself is a stupid idea.

unborn ether
#

When it comes to something like addWeaponGlobal its very useful.

little eagle
#

Nah, if someone wants to cheat, they'll just buy a memory editing based hack that bypasses battleye or everything the game can do.

cosmic lichen
#

@little eagle How would such a debug macro look?

little eagle
#

Like TRACE_n in CBA.

unborn ether
#

Well that one is not Battleye based, and in common no one from script kiddes think of some CfgDisabledCommands presence, as they usually use some default methods, for example hint menus, where hint|hintSilent is disabled in my framework against some custom replacements.

#

I honestly don't believe there are many script kiddos novadays, but still not willing to ignore the possibility to do such things.

little eagle
#

Get yourself a moderator 24/7 on the server. It is the only way.

#

CfgDisabledCommands and CfgRemoteExec are a joke.

#

Break more than they help.

unborn ether
#

Yeah I get what you say and your point. Im also pretty sure that only human factor can suppress human factor. But still it can make some things easier for people on the watch.

#

By stats there are usually 3\10 script kiddos so outdated or retarded so they hit that basic "walls".

verbal otter
#

@wary vine looks nice πŸ˜ƒ

tough abyss
gray thistle
#

Well this is weird when i try to add an event handler on mines it returns me a -1 is it known why or is that a bug?

tough abyss
#

The top one is the error, the bottom one is the lines around code 2041

inner swallow
#

but which is line 2041?

#

the highlighted one?

tough abyss
#

@inner swallow class LIB_BasicAmmunitionBox_SU; //CUP_RUBasicAmmunitionBox

#

Or its the one right below it

inner swallow
#

ok

#

so. i don't know a lot about config editing

#

but the only difference i can see between that line and the structure of the other classes

#

is that there's no {} after the class name LIB_BasicAmmunitionBox_SU

#

I don't know if that matters, though.

halcyon crypt
#

@tough abyss did you include the mag_xx macro's? πŸ˜›

tough abyss
#

I am a noob at this so bear with me

#

class LIB_BasicAmmunitionBox_SU;

class I_CZSArmedForces1938_AmmoBox : LIB_BasicAmmunitionBox_SU {
    author = ALiVE ORBAT CREATOR;
    displayName = [Czechoslovakia] - Armed Forces [1938] Ammo Box;
    class TransportMagazines {
        mag_xx(CSA38_9mm_8xBrowning,50);
        mag_xx(CSA38_rg34,50);
        mag_xx(CSA38_rg38,50);
        mag_xx(CSA38_Gsmoke,50);
        mag_xx(CSA38_9_mm_36xBrowning,50);
        mag_xx(CSA38_7_92_5xMauser,50);
        mag_xx(ifa3_SMKLS,50);
        mag_xx(fow_e_tnt_onepound_mag,50);
        mag_xx(fow_e_tnt_twohalfpound_mag,50);
        mag_xx(csa38_sm35,50);
        mag_xx(CSA38_7_92_20xMauser,50);
        mag_xx(CSA38_9mm_9xBrowning,50);
    };
    class TransportWeapons {
    };
    class TransportItems {
    };
};
#

There is mag_xx there

#

is there supposed to be anywhere else?

halcyon crypt
#

there should be something like #define mag_xx somewhere

#

but I see this is an ALiVE ORBAT export

#

so it should be included already

tough abyss
#

That is in the config.cpp I believe

#

#include "CfgPatches.hpp"
#include "autogen.hpp"
#define mag_xx(a,b) class xx##a {magazine = ##a; count = b;}
#define weap_xx(a,b) class xx##a {weapon = ##a; count = b;}
#define item_xx(a,b) class xx##a {name = a; count = b;}

#

This is my config

halcyon crypt
#

hmm you can try changing the magazine = ##a bit to magazine = a

#

that's what the BIKI says it should be

#

otherwise, no clue

tough abyss
#

Do I do the same for the weapon?

halcyon crypt
#

sure

half laurel
#

#define backpack_xx(a,b) class _xx_##a {backpack = a; count = b;} also useful - i made that for adding packs to crates

tough abyss
#

Well I will test it when I get home

half laurel
#

can anyone tell me why in editor adding this line to a plane causes "init type script expected nothing" error? i had this working yesterday and then deleted the init line and replaced it, and now it simply refuses t owork...

#

this execVM "rearm_init.sqf";

halcyon crypt
#

aren't you supposed to prefix it with 0 = or something?

half laurel
#

ahhhh

halcyon crypt
#

I'm not entirely sure but I've seen that a lot πŸ˜›

half laurel
#

yeah thanks that fixed it

halcyon crypt
#

πŸ˜ƒ

half laurel
#

mental fart

tough abyss
#

@halcyon crypt yeah that didn't work

#

I was trying to avoid using the CUp weapons crates but I'll just test it with the unmodified version of the export

real herald
#

Hi does anyone know anything about particles headmeat1 , headmeat 2 etc?

tough abyss
#

Well that didn't work either

real herald
#

So annoying as this appears to be basic but I can’t find the info

half laurel
#

is it possible to spawn a function from addaction instead of execVM ing a sqf?

#

am trying to optimise a vehicle based useraction

peak plover
#

yeah that is possible

half laurel
#
        EB_rearm = _plane addAction ["<t color='#FFFFCC'>~"+(_presetarray select _i select 0) +"</t>","uns_missilebox_c\functions\fn_rearm_add.sqf",[_presetarray select _i select 0,_presetarray select _i select 1,_presetarray select _i select 2],14,false,true,"","",5];
#

any idea what is the syntax to spawn it instead?

little eagle
#

Linebreaks.

#

sqf code tags

errant jasper
#

Something more like this Rob,

EB_rearm = _plane addAction [
    "<t color='#FFFFCC'>~"+(_presetarray select _i select 0) +"</t>",
    uns_fnc_rearm_add,
    _presetarray select _i select [0, 3],
    14,
    false,
    true,
    "",
    "",
    5
];```
#

Where you function in this case is compiled into uns_fnc_rearm_add.

#

Though you might want: {_this call uns_fnc_rearm_add} instead. Something about Arma recompiling it anyways - or maybe that was only for event handlers.

little eagle
#

Good question if this applies to addAction. No idea actually. Just a filepath doesn't work, it has to be a compiled function or a string with sqf syntax.

real herald
#

Let me@refeame@#

#

Reframe my question . Is there a script for hit effects ?

#

On people not talking about bullet holes in walla

gleaming oyster
#

Rephrase? :D

royal abyss
#

how does A3 Wasteland save stuff? i remember that it had basebuilding and vehicles and on the servers i played it saved it does it save it because A3 doesnt have internal saving its always a DB can someone link me some Documentaiton on SQF -> SQL stuff? ^^

still forum
#

extDB3 -> google

royal abyss
#

let me see πŸ€”

#

is that right?

still forum
#

yes

royal abyss
#

alright thanks πŸ‘

half laurel
#

@errant jasper thanks! how do i precompile the function?

errant jasper
#

@half laurel commy's link is the official way πŸ‘†

late gull
#

an anyone tell me if i'm doing that wrog?

// init.sqf
#include "config\config.sqf"
if (isDedicated or isServer) then {
  []execVM "actions\playerRespawns.sqf"; // BIS_fnc_addRespawnPosition
  []execVM "actions\vehicleRespawns.sqf"; // BIS_fnc_addRespawnPosition
  []execVM "actions\virtualArsenals.sqf"; // BIS_fnc_arsenal
  []execVM "actions\virtualGarages.sqf"; // BIS_fnc_garage
  []call startMission;
};
waitUntil {time > 0};
if !(hasInterface or isServer) then {
  []execVM "init_HC.sqf"; // spawn ai
} else {
  []execVM "init_HC.sqf"; // spawn ai
};
if (hasInterface) then {
  []execVM "actions\inventoryRespawn.sqf"; // BIS_fnc_addRespawnInventory
};
errant jasper
#

Can you describe what the problem is?

#

Though it seems strange you run init_HC.sqf always.

late gull
#

because test in editor, and if the server does not have HC will work anyway

#

i'm getting no errors, but respawn menu is not working

#

it's working in editor > play mp

#

but not in dedicated

errant jasper
#

Is it added in playerRespawns.sqf?

late gull
#

in that file it's added BIS_fnc_addRespawnPosition to vehicles

errant jasper
#

Can you show me the code?

#

Also isDedicated or isServer can be simplified to isServer.

late gull
#

nope

#

has efect in editor

#

so i can teste there

#

editor return dedicate true, but false to isserver

#

or in the other way, don't remember xD

errant jasper
#

if isDedicated is true then isServer is also. But not necessarily the other way around.

late gull
#

ok, but this is not the problem

#

updated the code with comments

#

all is working good in editor

#

the problem should be in the init.sqf

#

my locality system fail :p

little eagle
#

Please tell me where you got this:

if !(hasInterface or isServer) then {

from, so I can take it down.

late gull
#

idk, bohemia forums, wiki or somewhere

errant jasper
#

Well just in general, I would recommend you use call compile preProcess instead of execVM in init.sqf, so all scripts run in order, so no script intrudes/conflicts with another.

late gull
#

ok, works when i execute w/o HC

#

but it's broken when HC it's present

errant jasper
#

Strange. Do you have any other code that executes when HC present / not present?

late gull
#

nope

royal abyss
#

can someone point me a direction on how to spawn things so only the player who had accepted the mission for example is able to see the bomb

errant jasper
royal abyss
#

Thanks alot πŸ˜ƒ

late gull
#

it seems like HC hates skipLobby=1;

inner swallow
#

probably because that's when it gets slotted

#

maybe try enabling slots to be auto-assigned?

late gull
#

they are

#

HC join wherever but not in HC

#

that was my problem

inner swallow
#

hmm. okay. I've only ever used HC with the lobby, and there it works fine on its own, so i don't know

late gull
#

yes, now it's working fine with lobby