#arma3_scripting

1 messages · Page 492 of 1

dim token
#

Can anyone tell me why the BIS_fnc_findSafePos blacklist argument array containing rectangle markers would work but providing an array of the same rectangle dimensions does not?

#
private _marker = createMarker ["Marker_" + str _blacklistCenter, _blacklistCenter];
_marker setMarkerShape "RECTANGLE";
_marker setMarkerSize [2000, 1000];
_marker setMarkerDir _dir;
_blacklist pushBack [_blacklistCenter, [2000, 1000, _dir, true]]; // Seems to be incorrect.
_blacklist pushBack _marker; // This works as expected.
tough abyss
#
_jetUnit = "B_Plane_Fighter_01_Stealth_F" createVehicleLocal [0,0,500];

_jetUnit setPosASL [0,0,500];

_jetUnit engineOn true;

[_jetUnit, _unitCaptureData] spawn BIS_fnc_unitPlay;
_jetUnit animate ["canopy_open", 1, true];
_jetUnit action ["LandGearUp", _jetUnit];```
hmm... the `animate` and `action` don't work. really making me think
#

oh, can i not animate the canopy (?)

meager heart
#

_blacklist pushBack [_blacklistCenter, [2000, 1000, _dir, true]]; // Seems to be incorrect.

#

[center, [a, b, angle, rect, height]] < height it's a number not bool @dim token

dim token
#

@meager heart That's the rect value. Not providing a height.

meager heart
#

oh crap... my bad.. 😃

tough abyss
#

epic meme

#

here

#

does adding a vehicleCrew to a locally-made unit change its locality??

broken thistle
#

Guys, what I'm trying to do is clear a cargo container or a jeep or anything

#

Just is that the script command doesn't seem to work

#

on a SP mission

#

brb

#

guys My friend said that for some reason the code is picky. We had to use global command like clearWeaponCargoGlobal. This seems to work. The other script command didn't work.

dim token
#

In case anyone was wondering, it's a bug in BIS_fnc_findSafePos where all blacklist array values that conform to the shape of arrays containing two arrays ([[], []]) are handled as top-left corner, bottom-right corner areas. I patched that function and it works as expected.

iron osprey
runic surge
#

why don't you try using the simple object command on the tanoa models?

still forum
#

@drowsy axle is there a command to check what pbo's are loaded on a client no but multiple. Every pbo has to create a CfgPatches entry. So you could just iterate through it

#

@tough abyss , I would go as far as saying do not put it in init period, or even use in postInit only. Very correct that is. But teach that to people who don't know how to create a textfile in explorer, and who's only scripting related skill is copy-pasting stuff from forums into init boxes.

high marsh
#

@still forum Is CfgPatches data automatically generated if the user has not packed a pbo with CfgPatches?

still forum
#

no

#

but that pbo is also not loaded

high marsh
#

Okay, so no CfgPatches no load?

still forum
#

ye

real tartan
#

looking for ideas to get height of tallest hill on map ( to set limit for ambient planes not hit any hill )

still forum
#

Hill's usually have a location marker on their top

real tartan
#

locationPosition returns a position that is altitude zero ASL

still forum
#

ATLtoASL command

thorn saffron
#

Is there a way to get a proxy position via scripting? I want to get the mount location of the side rail attachments (flashlight etc.)

still forum
#

Yes. But no.

unborn ether
#

Is weapon actually a unit proxy?

real tartan
#

@still forum _max = 0; { _dummy = createVehicle ["Land_VR_Shape_01_cube_1m_F", locationPosition _x, [], 0, "CAN_COLLIDE"]; _height = (getPosASL _dummy) select 2; if (_height > _max) then { _max = _height; }; } forEach nearestLocations [[worldSize / 2, worldsize / 2, 0], ["Hill", "Mount"], (worldSize / 2) * sqrt 2]; hint format ["max: %1", _max];

still forum
#

wtf?

#

why?

#

Why not just get the terrain height at that position?

#

Don't see why you need to spam create vehicles at every mountain

thorn saffron
#

Ok, then how about getting the muzzle position for hand held weapons, is that possible?

still forum
#

Not sure. You can definitely get the hands tho.. Which is close-ish?

thorn saffron
#

I need the muzzle, it will be easier to work my way toward the attachment position (I will use array for known weapons and a generic side position for everything else).

vague hull
#

Been doing that a while ago: you need to do it by body/player model memory positions.. no other way around that

north lynx
#

Greetings,

sombody an idea?
I want to set the ACE3 medic variable for a player within an loadoutscript and it must run on dedicatet server

normaly the funktion ist

player setVariable ["Ace_medical_medicClass", 1];

digital jacinth
#

You can also try to set the unit trait for the class

player setUnitTrait ["Medic",true];
neon snow
#

I am using displayAddEventHandler , how could I block it to run it once per key press? It repeats while key is pressed

north lynx
#

@digital jacinth yeah thats works but only lokal with the loadoutscript, becuase the script only fired local but i figured it out now imm using:

[_unit, ["Ace_medical_medicClass",1]] remoteExec ["setVariable", 0, true];```

AFAIK it now works
digital jacinth
#

you do not need to remote exec setVariable...

_unit setVariable["Ace_medical_medicClass",1, true]
#

that last true will broadcast it to every machine

north lynx
#

ahhhh okay, i will give it a try thank u much

drowsy axle
#

@still forum You mentioned a while back, tried searching for in discord, using search function, about ForEach and using an array sqf _objects = [ ["classname",[0,0,0]], ["classname",[0,0,0]] ];
How would I include both in the forEach?

fierce ingot
#

is there anyway to adjust AI view range without editing CFGarray or using a knowsabout

dusk sage
#

Include both? @drowsy axle

#
{
    //_x is ["classname",[0,0,0]]
} forEach _objects;
drowsy axle
#

I found it @dusk sage / @still forum . sqf CAP_units = [ ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]], ["O_Soldier_F", [0, 0, 0]] ]; { _x params ["_classname", "_position"]; _classname createVehicle _position; } forEach CAP_units;

dusk sage
#

👍

drowsy axle
#

lol xD

#

I thought it was params...

#

xD

dusk sage
#

Doesn't have to be params

drowsy axle
#

How else?

dusk sage
#

_x is an array

#

you can grab those values however you want

#

select, for example

#

params is the most elegant though, IMO

#

Depending if you want vars*, of course

#

e.g: ```sqf
{
(_x # 0) createVehicle (_x # 1)
} forEach CAP_units;

runic surge
#

in a script is it possible to wait until a function is done to continue the script?
I thought if I used spawn I could but that doesn't seem to be the case

meager heart
#

that's how call works...

runic surge
#

but call doesn't work with functions that have sleep commands

#

also I need to use sleep in one of my functions because it doesn't wait until the function called before it is done

meager heart
#
0 spawn {
    call tag_fnc_kek;
    call tag_fnc_lol;
    hint "bla";
    sleep 13;
    call tag_fnc_topKek;
};
#

aka you can call and suspend in scheduled...

#

also if call was from scheduled, you can suspend inside of that call'ed function too

runic surge
#
_handle = [var1, var2] spawn tag_fnc_function;
waitUntil {scriptDone _handle}; 

So why doesn't this work? Say 'tag_fnc_function' has a significant delay and sleep commands and I want to wait for it to be completed before continuing

#

I obviously don't understand very well lol

meager heart
#

idk what's inside of that tag_fnc_function

runic surge
#

this seems to have about a 1 second delay

#

it's for setting the pitch/bank of an object that is attached to another object, and after that I delete the host object

#

but if I don't have a sleep command between those two, it doesn't work because of the delay

#

it's a workaround for relative rotation

#

It might be better to just redo the relative rotation function by finding a way to actually calculate it

tame lion
#

how can i look up the Map image of te current map i am on?

#

like what is the config entry for it usually so i can get the image path?

runic surge
#

Map image? You mean the preview image?

tame lion
#

naw, like the map topography when you open your map

#

i want to put it on a screen with setobjecttexture

runic surge
#

You could use the topography cheat

#

Or exportnogrid

runic surge
#

you would have to edit the .emf manually though

#

scale it down, convert it, etc...

meager heart
#
//--- loading screen background map
_image = getText (configFile >> "CfgWorlds" >> worldName >> "pictureMap");
//--- default overview picture
_image = getText (configFile >> "CfgWorlds" >> worldName >> "pictureShot");

worldName it's a command just no discord highlight @tame lion

runic surge
#

pictureMap is probably the one you want to use

#

pictureShot is just the preview screenshot for stock terrains

#

neither have any topography info on them though

meager heart
#

that's the only two in the world config...

tame lion
#

That's fine. I was looking for something quick in a zeus op we were doing that would put the map screen on a display. I just didn't know the config entry

meager heart
#

probably the easiest way is just your custom picture...

runic surge
#

there is no config entry for that

#

and the sat image is split into a ton of small tiles

#

so yeah a custom picture is the best way to do it but that wouldn't work on the fly

tough abyss
#

e.g: ```sqf { (_x # 0) createVehicle (_x # 1) } forEach CAP_units; ``` 🤦‍♂️ The whole idea of adding # was that you didn't have to use brackets around it 😂

south sinew
#

Hello, I'm trying to make a mission where in prison the players have to get to a guard house to open to doors. I'm going to be placing a monitor and add a code that unlock the door. Is it possible?

unborn ether
#

@still forum @meager heart Sorry to mention you, but is there anything better than nearest* commands to grab exactly map objects, since allMissionObjects is a self-explanatory. Trying to grab all gas stations on the map, but scrolling with nearest* with worldSize is a bit nasty way. Thanks.

meager heart
#

i know only one way nearestTerrainObjects + Fuelstation 🤷

unborn ether
#

Damn, yes thats what I use.

#

This way seems to be caching some objects, since it drastically increase the memory pool, don't think that's good in any way.

meager heart
#

maybe you can just get them in b4/"testing mission" and just use array with the positions, if that's for only one map 🤔

#

afaik altis life happens only on altis lol

frigid raven
#

hey guys

pulsar torrent
#

fixed*

nocturne basalt
#

Hi guys. Cant I use action to make AI perform an action added with addAction?

nocturne basalt
#

Yeah ok, then thats what Ill do 😁

frigid raven
#

can anybody explain the difference between the faction NATO vs. BLU_F ?

#

Isnt BLU_F like the parent of NATO ?

digital jacinth
#

is it possible to disable lightpoints which come with a building? I am placing down solar towers and they have a few lightpoints which I do not want to show up.

neon snow
#

I have key press eventhandler like this:

waituntil {!isnull (finddisplay 46)}; 
range=8000;
moduleName_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown",  
{  
if(isNil "button_clicked") then {button_clicked = 0;}; 
 if(inputAction "NextModeRightVehicleDisplay">0.5)then{
    if(button_clicked==0)then{ 
        hint "Click"; 
      button_clicked = 1;
    };  
 }; 
 if(inputAction "NextModeRightVehicleDisplay"<0.5)then{ 
  button_clicked = 0; 
 }; 
}];

It works however when I click other key, and after that the key it is suppose to trigger, it doesnt recognise it, the next click however recognises fine

#

What could be the issue?

nocturne basalt
#

@digital jacinth you could make your own house class that inherit from that class and remove class Reflectors

#

or just put an empty one in there
class Reflectors
{
};

digital jacinth
#

Sadly I cannot introduce new mods, it is for a mission only

nocturne basalt
#

ok maybe spawning it as a simpleObject?

#

If I recall correctly, lights shouldnt work on simpleObjects

#

"Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls), and built in lights."

so it should work

digital jacinth
#

ah, that is good idea, right now i am placing them in the editor but plan on spawning them in at some point during the mission

still forum
#

@tough abyss Please stop teaching people lies.
A params is not a cpu waste if you would do more than 2 or 3 _this select's instead.

@nocturne basalt yes. There is a way to make AI execute actions. Atleast if you control them yourself via the command menu you can make them do it. I guess there should also be a way to script that.

nocturne basalt
#

yeah Im just making a function that I call instead of using the action command

still forum
nocturne basalt
#

ooOO thanks ^^

#

that makes things easier

still forum
#

Don't think so. But please don't teach beginners stuff that isn't true.

proven crystal
#

infantry spawns in the air, when a UAV is spawned as part of the group before them, using Bis_fnc_spawngroup?

dusk sage
#

@tough abyss The whole reason I used # was so I didn't have to use select, nothing to do with parentheses. Just because it's not going to cause an issue, doesn't mean it should be less clear. The person didn't ask for nanosecond improvements

tough abyss
#

addition was never needed as select works, it is confusing, doesn’t cover all cases select covers and potentially can interfere with preprocessor. In other words there is NO REAL BENEFIT, unless you want to avoid parentheses, this is why this is fucking hilarious when someone adds them as well 😂

dusk sage
#

It's not our concern whether it was a benefit to add it to the game, that's not our choice. It exists, it works, it's shorter to write than select, and has the benefit of not having multiple overloads, it was just example code to someone who didn't seem to know another way. The only thing that is hilarious here is your objection to parentheses, take my sincerest apology that clear code upsets you

still forum
#

over select's only real benefit is precendence

dusk sage
#

Better tell BI to remove it then

tough abyss
#

I’d rather BI added something useful, something missing or something community was asking for 15 years

dusk sage
#

People wanted a way to select an element from an array without using select for awhile

tough abyss
#

Total waste of programmers time

still forum
#

without using select for awhile not really.
People wanted to be able to use [] for a while

#

which they didn't give us

#

because they can't

dusk sage
#

Indeed, but we got half way there

still forum
#

Do you also say that when you lost all your money in a 50-50 bet? Well. "I got half way there" ?

#

I'd be way happier if BI chose to not give us crap that's confusing and useless

dusk sage
#

Difference is, not losing anything by them adding commands, I'm happier to write something more succinct

winter rose
#

CODE READABILITY NEEDS INTENSIFY

unborn ether
#

select is better than #

winter rose
dusk sage
#

Also @tough abyss, would parentheses be acceptable in a case like this?

private _a = [5.5, 6.5];
ceil (_a # 0);
proven crystal
#

so if i understand right, any code in the init field of an object will be executed everytime a player connects. das that also happen if that object dead or deleted by the time new players connect?

#

because i have some objects on which i want to run some code from init, but only once. so what i could do is delete the original object during startup and replace it with a new one

#

basically createvehicle on original position, delete original object and run code on that object

#

i suppose another way would be adding them to an array through the init box, and then run code over that array.

#

what would be an elegant way?

mortal nacelle
#

hey guys. can somebody help me out with this? its displaying number: any

#
    private["_player"];
    _player = param[0];

    _getNumber = _player setVariable ["currentNumber", 4];
    _displayNumber = _player getVariable ["currentNumber"];

    hint format["Number: %1",_displayNumber];
};```
still forum
#

That's now how getVariable array works

proven crystal
#

I think you need to add the default return value

#

_displaynumber = _player getvariable [“currentnumber”,<somethinghere>];

still forum
#

Or not use array

#

Anyway.. This code doesn't even make sense

#

_getNumber = that makes no sense. setVariable always returns nil.

#
getNumber = {
    params ["_player"];

    _player setVariable ["currentNumber", 4];

    hint format["Number: %1", 4];
};
#

And that code also won't work. as getNumber is a command. You cannot assign a function to it

#

Have no idea what you're trying to do

proven crystal
#

I think its just supposed to return that number. Setvariable shouldnt even be in there anywhere

still forum
#

If so then it would be

LJ_fnc_getNumber = {
    params ["_player"];

    private _currentNumber = _player getVariable "currentNumber";

    hint format["Number: %1", _currentNumber];
};
proven crystal
#

i suppose... or private _currentNumber = _player getVariable [currentNumber,<somethinghere> ]; for the default return value

#

the friggen spawngroup function gives me headache. no that i use groups with multiple vehcles they collide all the time

#

to i really have to go back to a script that makes sure that all individual units spwan the way they should?

#

also i would rather not have UAVs as group leaders.

mortal nacelle
#

Thank you @still forum

tough abyss
#

Wow! This is even worse than I thought 🤭 Thank you @dusk sage for bringing this up. So arr = [{}]; 123 call arr # 0; //— fine call arr # 0; //— error you need parentheses in second case! So really # allows to type 5 chars less, but comes with a bunch of potential problems. Was this needed? Nope. Basically the usage of it comes down to... “just because you can doesn’t mean you should”

still forum
#

yes. Because unary is always higher precendence than binary

tough abyss
#

When a programmer was choosing precedence for # he thought to himself, this is boring , how can I make it more exciting? Well I suppose I can give it higher precedence than binary but lower than unary... 🤔

#

At least this is also consistently inconsistent

astral tendon
#
player addEventHandler ["HandleDamage", {0}]; // works and player takes no damage
player addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    if (vehicle _unit != _unit) then {systemChat "damage reduced"; _damage = 0;};
}]; //unrealiable, its fires but player still takes damage and dies

Is there something I forget about this event handle?

tough abyss
#

You should read on how HandleDamage EH works

astral tendon
#

I did

digital hollow
#

The code block is not returning _damage

tough abyss
#

If you did what is returned in second case?

astral tendon
#

_damage is supouse to be returning

still forum
#

You don't do that though

#

You don't return anything.

tough abyss
#

And you re returning an assignment

still forum
#

assignments don't return anything. Not even nil. The only real language bug

#

So easy to fix actually.

tough abyss
#

Which doesn’t even represent nil

#

Also HandleDamage fires for each damaged selection and then some

#

You need PhD in Arma if you want to override it, and I am not joking

astral tendon
#
player addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    if (vehicle _unit != _unit) then {systemChat "damage reduced"; 0};
}];

Forcing to return 0 then it works, though I always think that _damage was returning in the end of the event handler

tough abyss
#

Cancelling damage like this will reset the whole damage. So if you had legitimate damage accumulated after you return 0 your old damage is reset

#

I doubt this it what you want

#

PhD

#

I said it, you need it

astral tendon
#

I was thinking about doing some math to reduce damage but never mind that.

unborn ether
#

Just was thinking about code optimization advice: Removing items: myArray set [1, objNull]; myArray - [objNull] has been replaced by deleteAt and deleteRange

#

But that might be misleading, since deleteAt and deleteRange requires index(es).

#

What if I want to remove anything that is objNull in that array?

dusk sage
#

It's suggesting that the two step process has been replaced

still forum
#

then that code is still the best I'd say

dusk sage
#

You need the index for step one still

tough abyss
#

Noob scripter here. Can i execute scripts by pressing certain keys? (for example i click H and enemies spawn)

unborn ether
tough abyss
#

Thanks!

tough abyss
#

Those “has been replaced” statements are not just misleading, in many cases are plain wrong. Nothing is replaced, new commands added that provided improved functionality. Improved != replaced

runic surge
#

is it possible to search contents within nested arrays?

still forum
#

Sure

#

Nested findIf would sure work. If nothing else would

fringe yoke
#

I'm getting a weird issue where 2 of my files are coming up as not found. I know the files exist, and they are in the pbo. I have even tried renaming the files and every occurrence of them being used, but they still say not found. The files are being compiled using PREP with CBA XEH preStart and preInit. The addon is setup similar to the ACE project template.

#

Anyone know what might be going on? It only happens when -filePatching is used

still forum
#

PBO unpackers also unpack these files? And you double checked file paths and stuff?
And with -filePatching the files are also where they should be?

real tartan
#

is there some way to check if location is village ?

still forum
meager heart
#

^ NameVillage < village 👌

proven crystal
#

How can i find out which of my scrips draw most on my performance? Something seems draining

#

Seems to be taking quite a while to spawn in units. I assume those spawns are on some scheduler, and that schedule is maybe crowded

real tartan
#

there is little icon for performance in debug console

proven crystal
#

ok that throws me out a function as result

#

that would be the worst performing one or what_

#

or most called?

still forum
#

what do you mean "draining" ?

#

scripts executing slow. or low fps?

#

no. The profiling button in debug console tells you how long your script takes to execute

nocturne basalt
#

hi guys. Id like to spawn a bomb and cause it to blow up.
this is not working:
"Bo_GBU12_LGB" createVehicle (position _v);

#

guessing its because bomms are not in cfgvehicles

#

Can someone tell me how I should do this?

real tartan
#

@nocturne basalt create bomb with createVehicle then delete it with deleteVehicle _object;

nocturne basalt
#

hmm but nothing happens when I run "Bo_GBU12_LGB" createVehicle (position _v);

proven crystal
#

well i run a regular respawn that spawns between 3 and 6 groups. takes up to 15 seconds per group to spwan. sometmes i see the thrid spawn only finishing after 70 seconds

#

had one of those rounds taking 2 minutes for 6 groups to show up

nocturne basalt
#

I tried adding it in the init script of a unit

#

I've used createVehicle many times

proven crystal
#

i mean, i call the spawns one by one, so they come up after each other beacuse i dont want them parallel. but this doesnt seem normal

#

so im thinking some functions result in delays

#

i use a debug timer now to measuer when spawns start or end

nocturne basalt
#

so are you spawning bombs too?

#

Im trying to spawn something thats inside cfgAmmo

proven crystal
#

so right now it shows me: spawned 6 groups in total in 49.803 seconds

#

that seems reasonable

#

?

nocturne basalt
#

all I want is to spawn something that blows up instantly

#

Im making a suicide bomber

#

when the man is close enough to an enemy

real tartan
#

@nocturne basalt "Bo_GBU12_LGB" createVehicle (position _v); that "_v" is local variable if you are putting that code into init of unit. Try to replace it with "this". "Bo_GBU12_LGB" createVehicle (position this);
`

nocturne basalt
#

ok ty Ill try

#

but bombs should explode when spawned like this right? or do the need to be dropped from a vehicle?

real tartan
#

you are creating "explosion" object

nocturne basalt
#

yea

real tartan
#

you can one use these: "Bo_GBU12_LGB_MI10", "Bo_GBU12_LGB", "Bo_Mk82", "HelicopterExploSmall", "M_Mo_82mm_AT_LG", "HelicopterExploBig", "M_Air_AA_MI02"

proven crystal
#

now i am at spawned 6 groups in total in 102.361 s

#

that does not seem nowmal. time doubled

#

or 2 groups in 80 seconds... getting worse...

#

i mean some of them are larger groups, but this seems too much

still forum
#

creating units is very slow. yes.

#

But you are usually not spawning a unit every couple frames or so

thorn saffron
#

Is it possible to get the laser pos memory point position on the player's current weapon?

#

its on a side attachment proxy (usually)

unborn ether
#

@thorn saffron You can get a mempoint of what is an object, but you can't distinct weapon as an object, neither its attachments, so they are just models.

#

The only way to tracer your lasersight is to manually deal with the offset from player hands as selection.

thorn saffron
#

and that does not work all that well

#

Can't we even get the weapon muzzle position?

unborn ether
#

Weapon muzzle, in short is a weapon meta, since weapon is not an object, it doesn't have any position or whatever.

proven crystal
#

No its not that much time critical. Its spawns based on proximity to an area

#

But 2 minutes is a lot

#

I want to avoid them popping up in cleared areas

still forum
#

You asked the same thing on Friday and got answers by 2 people that it's not possible like that.

proven crystal
#

Oh

still forum
#

That's not gonna change

proven crystal
#

Might not have seen those

still forum
#

Not you. Unless you asked the same thing yesterday?

proven crystal
#

Well i did ask about speeding up spawns before

#

And i might have overlooked answers

still forum
#

how many units do you spawn in these 2 minutes?

#

and how do you measure the time?

proven crystal
#

Varies a bit. I take the time on start of function, and return after the spawn command

#

Unit numbers vary, between 3 and 8. Sometimes with vehicles

unborn ether
#

@thorn saffron Tbh, you can just easily build a laser sight path with vectors, starting ray position, end position, using such things like vectorAdd will make an actual ray.

proven crystal
#

And i have a function in there for finding safe positions to spawn. Not sure exactly how long that one takes. But thats once per batch of units

#

So essentially i return time at start of script, difference to every spawn, and end of script

still forum
#

you cannot profile scheduled code while it's running in scheduled

#

How long your script takes to execute in scheduled. Depends on all other scripts that are running in scheduled

unborn ether
#

@proven crystal scheduled code is not accurate on time or order, so time is irrelevant there and will be based on your VM load.

proven crystal
#

But if i return the time difference from start of script to the time after i call a function?

still forum
#

then what?

#

scheduled is scheduled

proven crystal
#

Shouldnt it return that difference?

still forum
#

scheduled scripts can pause any time. For a arbitrary long time

unborn ether
#

The thing is that if you schedule a 250 units of code the order of execution might be 1,3,5,249,250,15,12 etc.

still forum
#

your 2 line scheduled script. Might take hours to complete

#

Your Sleep 0.1 might sleep for days.

unborn ether
#

Try to avoid scheduled code as much as you can, especially if you wish to get some actual profiling results.

proven crystal
#

So rather not use functions if i can avoid it?

still forum
#

I don't see what that has to do with functions at all

thorn saffron
#

@unborn ether The problem is the starting position. Using the hands as a base does not give me the best position as weapons can have the laser module in all kinds of places. Also the hand moves around and that in turn moves around the laser a bit.

unborn ether
#

@thorn saffron There is a thing that will help you much with that weaponDirection currentWeapon player

#

So if you have starting point as vector, which are hands, and you have an actual vector of weapon direction - small maths with adding them together = +- accurate lasersight tracing.

proven crystal
#

yea so i mean if i use spawn it will run the function in unscheduled environment right?

#

ill then have an issue with return values, but i guess i could work around that

#

but i thought its better to have them done one after the other, to not overload things

#

have i achieved the opposite?

still forum
#

it will run the function in unscheduled environment right no. exactly opposite

proven crystal
#

ah damn so how do i get a piece of code running in unscheduled environment, calling it from a scheduled one?

still forum
#

why do you need unscheduled?

#

isNil executes code in unscheduled

unborn ether
#

@proven crystal It depends on your execution way, so if you have a function in your CfgFunctions executed via preInit flag - it will be unscheduled, if postInit - scheduled. Default init scripts (https://community.bistudio.com/wiki/Initialization_Order) have their own behavior. There are also exceptions to this, for example, any event handler added in scheduled environment has its own environment which is always unscheduled. blah, blah.

#

So if you want all of your initialization chain to run unscheduled, use preInit flag for your function called myInit.sqf or something.

proven crystal
#

i just want those spawns to happen much faster

#

says something there that triggers would run in their own unscheduled environment?

#

maybe i could go that route

unborn ether
#

If you want spawn to happen "faster" you need to decrease your VM load.

still forum
#

"says something there that triggers would run in their own unscheduled environment" no

#

trigger condition might run in unscheduled

#

as I said. You can use isNil to run code in unscheduled

unborn ether
#

Or use Event Handlers, once again, totally depends on your purpose.

still forum
#

any event handler added in scheduled environment has its own environment which is always unscheduled What do you mean by "it's own environment" ?

#

every scriptVM has it's own "environment" scheduled or unscheduled

unborn ether
#

Just to clarify that added event handler code has unscheduled environment, no matter in which environment it was added, in short.

still forum
#

I'd recommend to read the wiki page about the scheduler

proven crystal
#

the isnil thing looks like an option now... ill give that a try

drowsy axle
#

Hello, wondering if anyone can help me.

One of my friends has created/finished off Chernarus 2035. (it's an incomplete map, missing objects.)

He has placed all the CUP buildings and trees (He's created a mission without trees as it brings the editor to around 20 FPS when looking at all these trees)

I want to be able to (in the mission.) grab all the following information, I've already come up with a solution: ```sqf
init.sqf
_objects = [];

for [{i=0}, {!isNil (object + str _i)}, {_i = _i + 1}] do {
str = object+_i;
_objects pushBack _str;
hint str _str;
};;

{
[_x] execVM 'fn_getStuff.sqf';
} forEach _objects; sqf
fn_getStuff.sqf:
// [_thing] execVM 'fn_getStuff.sqf';
params = ["_thing"];

_direction = getDir _thing;
_position = getPos _thing;
_classname = typeOf _thing;
_var = _thing;
_STR = [_classname,_position,_direction,_var] joinString " ";
diag_log str _STR;``` If you have any suggestions. It would be great!

tough abyss
#

Your _objects is an array of strings, how exactly you take getDir or getPos of a string?

halcyon creek
#

Following a helicopter insertion video, have got this: vehicle this land 'land'; if (isServer) then {BW_HelicopterGo = false; pulbicVariable 'BW_HelicopterGo';}; in the activation field of the last waypoint, exactly as its put in the video too, but its returning an error when i click Ok

#

any ideas?

#

States that the error is Missing ;

cold pebble
#

pulbicVariable?

halcyon creek
#

Turns out my speed typing is atrocious

#

Just seen the mistake!

cold pebble
#

🤔

#

Haha fair enough

halcyon creek
#

Overlooked it like 7 times

drowsy axle
#

@tough abyss oh yeah. lol

#

@tough abyss updated

#

Do you see anything else?

tame stream
#

hi all, im trying to force players to walk when they enter briefing area via trigger in act .. sqf if (_unit in playableUnits) then {player forceWalk true;};, but this does not do the trick.
Find it very immersion breaking when player run in briefing area, any suggestions to make this work?

runic surge
proven crystal
#

player -> _unit

#

and use inarea or inareaarray

tame stream
#

inArea via named marker?

proven crystal
#

yep

#

inareaarray returns you an array with all units in it, in case you have use for that

tame stream
#
if (player in playableUnits) then {player forceWalk true;};``` so this rather
runic surge
#
{
    if (isPlayer _x) then {_x forceWalk true;};
} forEach inAreaArray "marker";
tame stream
#

oo ok

runic surge
#

something like that?

#

idk

tame stream
#

ill give it a go

proven crystal
#

with marker name

tame stream
#

yup

runic surge
#

I don't know if I'm using the right syntax

proven crystal
#

thanks @still forum stuff now pops up almost instantly

tame stream
#
{if (isPlayer _x) then {_x forceWalk true}};forEach inAreaArray "marker";``` syntax fixed...testing now
proven crystal
#

allPlayers inAreaArray location_1;

#

its even one of the examples on the wiki

runic surge
#

so just add allPlayers and it should work

proven crystal
#

{_x forceWalk true} forEach (allPlayers select {_x inArea location_1});

tame stream
#

@proven crystal ok trying that one

proven crystal
#

sorry i mean inarea though ^^

#

now there it is

halcyon creek
#

For whatever reasons I cannot get my helicopter to follow its waypoints through an addAction. It has a Trigger synced to the first move waypoint with the condition BW_HelicopterGo; the Helicopters init reads: this addAction ["Training Flight", {BW_HelicopterGo = true; publicVariable "BW_HelicopterGo";}]; and the last waypoint (before the cycle waypoint) is vehicle this land 'land'; if (isServer) then {BW_HelicopterGo = false; publicVariable 'BW_HelicopterGo';}; Any Ideas?

#

Tried it with a few different types of Helicopter and none of them work either

drowsy axle
#

Is this incorrect? _var = call compile _varSTR;

halcyon creek
#

I have had this script working before, and its exactly the same in the video im following so im not quite sure

tame stream
#

i get generic error with this one ...

{_x forceWalk true} forEach (allPlayers select {_x  inAreaArray brief});```
runic surge
#

brief needs to be a string I believe

tame stream
#

still learning proper syntax...please eloborate

runic surge
#

it needs to be in quotes

#

"brief" instead of brief

tame stream
#

ok thx

#

aaah still get generic error in expression

copper raven
#

{_x forceWalk true} forEach (allPlayers inAreaArray brief);

#

or this {_x forceWalk true} forEach (allPlayers select {_x inArea brief});

#

What is brief btw?

tame stream
#

marker

#

briefing area

#

im activating this via trigger set to repeat and player detected

copper raven
#

Put brief in "" then.

tame stream
#

ok testing ... sqf {_x forceWalk true} forEach (allPlayers select {_x inArea "brief"});

#

@copper raven ok this works but now i can ONLY walk 😃 sqf {_x forceWalk true} forEach (allPlayers select {_x inArea "brief"});How would i disable this when player exit trigger 🤔

copper raven
#

How do you have your trigger setup?

copper raven
#

🤔

proven crystal
#

i was waiting for that question @tame stream

#

:D

tame stream
#

seems it activates but nothing is telling it to stop force walk

proven crystal
#

exactly, you dont tell it to stop

tame stream
#

yup, how would we tell it to stop once outside of the trigger

#

lol

proven crystal
#

maybe a while loop in there or so

tame stream
#

TANK run!!!....I CANT

#

{_x forceWalk true} forEach (allPlayers select {_x inArea "brief"}); for 5 seconds repaeted every 5 sec while in trigger???

proven crystal
#

so while player is in area, sleep a few seconds. once that condition is false, set speed back normal

tame stream
#

no idea how to do that

#

any idea how?

proven crystal
#

while (_x inArea "brief) do {sleep 5;};

tame stream
#

trigger timers will only effect activation ... not deacativation

proven crystal
#

{_x forceWalk true; while (_x inArea "brief) do {sleep 5;};_x forceWalk false;} forEach (allPlayers select {_x inArea "brief"});

tame stream
#
{_x forceWalk true} forEach (allPlayers select ({_x inArea "brief"} do {sleep 5;});```???
#

does not look correct 🤔

proven crystal
#

look at my version

#

and look up how a while loop works

tame stream
#

While = Repeats Code while condition is true
but would that disable the code once activated and revert player to normal state

copper raven
#

In condition, player inArea "brief",on activation, player forceWalk true;, and on deactivation player forceWalk false;. If I'm not misunderstanding how triggers work, that should work. 🤔 And make sure that your trigger is not Server Only.

proven crystal
#
{
_x forceWalk true;
 while (_x inArea "brief") do {sleep 5;};
_x forceWalk false;
} forEach (allPlayers select {_x inArea "brief"});
tame stream
#

ok ill try both and give some feedback 👌

proven crystal
#

switches to slow, waits while pkayer still in area, and when that condition is false, leaves the while loop and finally turns speed back normal

tame stream
#

🍻 🍻 🍻 all round

copper raven
#

Your first setup didn't make sense. You ran trigger on each machine, and foreachd through all players. Your current setup will fix locality all together, forceWalk args also must be local.

proven crystal
#

welcome to the rabbithole

tame stream
#

oo im well and true lost in this here rabbithole :)...thx again

tough abyss
#

Is this incorrect? _var = call compile _varSTR; 🤮 Why not _var = missionNamespace getVariable _varSTR; instead?

#

Why have trigger monitoring marker if one can put trigger over marker area and monitor player in that trigger 🤔

copper raven
#

Yeah, that works too i guess. I'm just not into triggers so much xD

runic surge
#

is there a way to see the full version of an error message displayed in game?

#

it cuts off in the .rpt at the same place

#
{
    create3DENEntity ["Object", "BTHBC_A3EM_LongDistanceSphere", _x select 0, true];
} forEach _posArray;

returns:

Error in expression <
{
create3DENEntity ["Object", "BTHBC_A3EM_>
  Error position: <create3DENEntity ["Object", "BTHBC_A3EM_>
  Error Type Number, expected Array

despite the code working exactly as expected

#

_posArray is formatted like this: _posArray = [[[0,0,0]], [[0,0,0]], etc];

#

it creates the entities at the proper positions

tender root
#

create3DENEntity has a return value. Sometimes Arma doesn't like it if you don't safe that return value so just try private _IdontCare = create3DENEntity [...]

runic surge
#

that's what I had originally

#

I removed it for testing

#

it used to be _entity = create3DENEntity ["Object", "BTHBC_A3EM_LongDistanceSphere", _x select 0, true];

#

private too

tender root
#

and that didn't work either?

#

🤔

runic surge
#
Error in expression <
{
private _entity = create3DENEntity ["Object", "BTHBC_A3EM_>
  Error position: <create3DENEntity ["Object", "BTHBC_A3EM_>
  Error Type Number, expected Array
#

everything works as expected and the syntax is correct so I don't know what the issue is

tender root
#

idk either 🤔

#

ever tried the alternative syntax?

runic surge
#

I figured it out

#

I had _posArray = [_originalPosition]; where I initially defined the array

#

_posArray = [[_originalPosition]];

#

it should have been that

#

not sure how I missed that lol

tender root
#

^^

#

not sure how I missed that lol which place is that on the Sentences Devs say most often List?

runic surge
#

I even copied the array to clipboard to see if any positions were wrong and still missed it lol

tender root
#

Does anyone know a way to add a weapon with attachments to a backpack. I know there is setUnitLoadout, but I can't get it working without modifying the rest of the loadout. It always reapplies everything (so the vest, uniform, weapon, etc.) even when passing nil as arguments for everything except the backpack. I just want to modify the backpack.

runic surge
#

I don't think you can

#

configs for soldiers and containers use weapons that have custom class configs

#

so there are classes that have different varieties of attachments

tender root
#

Yeah I know 😄

#

but it works with setUnitLoadout so there is a little bit of hope in me left ^^

#

or someway to prevent setUnitLoadout from touching the vest / uniform

delicate totem
#

You can't prevent setUnitLoadout from applying the uniform/vest, but you can manipulate the load out data so the new uniform/vest exactly matches the old one.

tender root
#

yeah setUnitLoadout even does this for you. It reapplies the same loadout as before when you pass nil instead of a array/string for the specific loadout component

#

but the reapplying causes if I have modified the players vestContainer

#

like attaching something to it or changing the texture or even just setVariable or something

#

because it wont reapply those modifications

frigid raven
#

I have two dialogs loginDialog and registerDialog. Both of them have a Unload event handler. The problem is that my loginDialog Unload handler is stacking. The odd thing for me is that I am actually closing it with closeDialog. Doesn't this release the event handler in this case? See some snippets for reproduction.

When pressing the Register button in my loginDialog the following code executes:

closeDialog 1; // closing the login dialog
[] spawn X11_fnc_registerDialog;

Now when within the registerDialog I press ESC right away to close the the dialog.
That invokes the Unload event handler of registerDialog:

[] spawn X11_fnc_loginDialog; // to recreate the login Dialog

On every call of X11_fnc_loginDialog the Unload event handler is set. Unfortunately this stacks the more often I press ESCAPE in the registerDialog.
My intention was that when I call closeDialog 1 the dialog is destroyed and therefore it's eventHandler...
But since the DisplayControl has an ID I kinda think the event is bound to the id regardless of the display being created or destroyed eh?

delicate totem
#

@tender root If you're applying customizations to the vest, why not put a variable on the player storing the details of the customization at the time it's applied? You can read it later and to recreate the customizations immediately after setUnitLoadout.

tender root
#

@delicate totem I don’t apply customizations. It just that I’m concerned to use setUnitLoadout when it’s behaving like this, of this, because I want to ensure compability with as many mods as possible 😅

delicate totem
#

I have no idea what you're trying to accomplish so I'll shut up now. 👍

still forum
#

@drowsy axle https://discordapp.com/channels/105462288051380224/105462984087728128/501076126714822681
I could swear I already told you a dozen times or more.. getVariable
missionNamespace getVariable _varSTR;
@tender root https://discordapp.com/channels/105462288051380224/105462984087728128/501107203973840912 No.
@runic surge https://community.bistudio.com/wiki/create3DENEntity
https://discordapp.com/channels/105462288051380224/105462984087728128/501106594302656527 Position is an array.
Why do you try to double array your pos? why not just put it in directly. And just use _x ?
Did you try diag_log'ing stuff to see that you get what you think you get?

@tender root "Does anyone know a way to add a weapon with attachments to a backpack" I made a script command for that. But BI didn't want it.
You can spawn a AI. Add the weapon to the AI. And let the AI drop it into your backpack.

https://discordapp.com/channels/105462288051380224/105462984087728128/501117828188078091 just store these modifications manually then

tender root
#

Basically Im trying to add a weapon with attachments to a players backpack, but I don’t want to break anything other mods/scripts are doing in terms of customizing the vest or the uniform.

frigid raven
#

Okay I found my mistake - my code is kinda calling the logic twice!

still forum
#

@frigid raven Unfortunately this stacks the more often I press ESCAPE in the registerDialog. Just set a variable onto your dialog. To mark when the EH is already set

frigid raven
#

please do not react on my post regarding Dialogs

#

MEh too late ;0

tough abyss
#

Why don’t you delete your post then?

tender root
#

@still forum Like I said storing modifications is not really an option. Im just anxious about compatibility not saving my own modifications.

The AI idea is kind of crazy, but I'll give it a try

runic surge
#

@still forum
the double array is just what the function I use to get the list returns for some reason, not sure why

still forum
#

The AI idea is the only possible way currently

runic surge
#

I think there is a second element returned for an optional input

tender root
#

@still forum gotcha ...Arma scripting commands letting me down time after time

drowsy axle
#

Can someone point me to the place where I can learn to put code into an addon that it would normally be put in a mission?

tender root
#

I would start with this

#

Basically everything you normally would put into the description.ext goes in the config.cpp

#

That’s the basic tldr 😅

still forum
#

I can give you the script command to addWeaponWithAttachmentsCargo(Global)

#

😄

drowsy axle
#

What would be the init.sqf so to speak?

still forum
#

But won't be much use for you unless you secretly work for BI

tender root
#

@still forum unfortunately I don’t 😅

still forum
#

replacement config stuff doesn't really have much to do with putting scripts into a mod pbo.

#

@drowsy axle there is no init.sqf in mods

drowsy axle
#

How does stuff happen then?

still forum
#

You have CfgFunctions preInit/postInit. But all the mission event scripts don't work in non-missions

tender root
#

@drowsy axle postInit of a CfgFunction is Oke way to do it

#

Damn the Ninja 😅

still forum
#

Happens about twice per day. Nothing special 😄

drowsy axle
#

Basically, battleye is being a pain, and won't display a message when x minutes to restart.

still forum
#

Why will a mod help with that?

drowsy axle
#

I need to be able to run a script that would print out a message at the certain time (server local time)

#

I've notivced that it's hard or not easy to find a servertime function that gets the time of the server.

tender root
#

With „time of the Server“ you mean what exactly?

still forum
#

And.. How do you think would a mod help with that?

#

I don't see what that has to do with pushing stuff into a mod

tender root
#

We are not taking about ingame time do we?

drowsy axle
#

a mod would help, so that no matter the mission, a message will popup

still forum
#

Ah yeah. You want a serverside mod then. With CfgFunctions and with a preInit function

drowsy axle
#

Right

#

I didn't mean client side mod.

#

How would I be able to get the local time of the server?

still forum
#

Afaik you can't

#

unless you use a extension

drowsy axle
#
class CfgFunctions
{
    class ServerMod
    {
        class main
        {
            class postInit
            {
                postInit = 1;
                file = "ServerMod\server_init.sqf";
            };
        };
    };
};```
#

"real_date" callExtension ""; Let's say I wanted to use this.

#

Would I just have a .dll on the server? and have a file called: server_init.sqf inside @ServerMod/addons/server_init.sqf.

tender root
#

Yeah basically yes

#

You Need a pbo containing the Server_init.sqf and the config.cop

still forum
#

@ServerMod/addons/server_init.sqf no. A pbo

#

ServerMod.pbo

#

And you also need the CfgPatches entry in the config.cpp in your pbo

tender root
#

The Mod Folders are basically irrelevant the only thing that matters to Arma are the pbos itself

drowsy axle
#

I yeah, I read that

#

Sweet

tender root
#

And i don’t know of your path in the cfgFunction will work or if you need a backslash in the beginning

#

Never sure about paths in Arma 😅

drowsy axle
#

How do I get signatures? wait i won't need it as it's on the server.

tender root
#

Yeah you probably won’t need one

#

But just fyi you can create keys with the Arma tools

drowsy axle
#

ok

#

is the config.cpp in: @ServerMod dir or /addons?

still forum
#

neither

#

And your question will answer itself

tough abyss
#

But won't be much use for you unless you secretly work for BI you think this will somehow change things?

drowsy axle
tender root
#

Please put the cfgPatches in the beginning 😅

#

And it still has to be packed into a pbo

drowsy axle
#

I know thanks

tender root
#

But the rest looks fine 😅

drowsy axle
#
initServer.sqf:
[] spawn {
    while {true} do {
        sleep 7200;
        hint "Server-side Script is working!!";
    };
};```
tender root
#

Sleep won’t work because the script is called not spawned

#

So just enclose it in [] spawn {} if you’re lazy 😅

drowsy axle
#

I did 😃 ^

tender root
#

And you won’t see the hint because it just has a local affect

drowsy axle
#

??

still forum
#

Also that script is postInit

drowsy axle
#

Oh right yeah

still forum
#

sleep will work

#

but it will screw up ALOT of stuff

tender root
#

Really? It will?

#

Interesting 🤔

high marsh
#

Delay mission start?

still forum
#

postInit is scheduled yes

#

but all other postInit scripts and the loading screen will wait for you to finish

#

also known as endless loadingscreen bug

tender root
#

Ahh okay

drowsy axle
#
if (time == 7200) then {
    diag_log "Server-side Script is working!!";
};
``` What about this?
tender root
#

You still won’t get a hint on the client 😅

drowsy axle
#

Changed

tender root
#

👌

drowsy axle
#

But I need player to see the message? Maybe: ```sqf
systemChat "Server-side Script is working!!";

tender root
#

Same thing

#

Use remoteExec

drowsy axle
#

Never used that before.

#
"Server-side Script is working!!" remoteExec ["systemChat" -2];```??
tender root
#

[“Server side script is working”] remoteExec [“systemchat”, -2];

#

I don’t know what’s the default value for the target

#

So yours could be correct as well

#

Writing code on a mobile phone sucks 😂

drowsy axle
#

lol

still forum
#

neither is correct

#

syntax error

#

default value is everyone

errant jasper
#

Also I assume if (time == 7200) then { is a joke?

tender root
#

@still forum the missing comma?

still forum
#

yes

#

@errant jasper the if is in a while true loop

tender root
#

Fixed it 😅Like I said. Writing code on a mobile 😅

drowsy axle
#

it's not anymore

#

if (time == 7200) then {
    "Server will restart in 10 minutes!" remoteExec ["systemChat"];
};```
errant jasper
#

@still forum Sure but don't you have to be incredible lucky for the time to be exact 7200?

tender root
#

Fair point

drowsy axle
#

I'm assuming that the mission has been ran for 3 hours. Which is the normal case

still forum
#

oh lol

#

yeah missed that

#

it's not in a while loop?

#

how do you expect that to work then?

drowsy axle
#

The server restarts every 3 hours and 10 minutes

still forum
#

The time won't be 7200 right at mission start.

drowsy axle
#

oh right

#

duh

errant jasper
#

Time might go from say, 7199.94 to 7200.09 in a frame?

high marsh
#

= <=
🤷

#

waitUntil

still forum
#

Why don't you just keep the Sleep?

#

Why do you all of the sudden want to change that perfectly working code? to something that won't work.

tender root
#

😂

drowsy axle
#
[] spawn {
     while {true} do {
         if (time >= 7200) then {
            "Server will restart in 10 minutes!" remoteExec ["systemChat" -2];
        };
    };
};```
errant jasper
#

Now you just spamming the network for 10 minutes straight after two hours

tender root
#

Yep

high marsh
#

ExitWith?

tender root
#

Change the then to a exitWith

drowsy axle
#

Somehow my math was off: sqf [] spawn { while {true} do { if (time >= 10800) then { "Server will restart in 10 minutes!" remoteExec ["systemChat" -2]; }; }; };

tender root
#

😂

high marsh
#

add exitWith + server restart code

tender root
#

I guess it’s just a warning not intended to really restart the server

drowsy axle
#

Just a warning

#

Yup thanks

still forum
#

Now you constantly check a condition which will only be true every 3 hours and then only for a couple minutes

#

Again. Why did you remove the sleep and try to do that instead?

drowsy axle
#

I could do....

high marsh
#

^ Sleeeeepppp...

errant jasper
#

ExecVM sqf sleep 10800; "Server will restart in 10 minutes!" remoteExec ["systemChat", -2];
or use a waituntill.

drowsy axle
#
[] spawn {
    while {true} do {
        sleep 10800;
        "Server will restart in 10 minutes!" remoteExec ["systemChat" -2];
    };
};```
high marsh
#

How accurate is the suspension time?

tender root
#

Midnight is asking the real question here

drowsy axle
#

suspension?

high marsh
#

Sleep <-

errant jasper
#

If it needs to be "somewhat" accurate I would use something like: waitUntil {sleep 1; time > 10800}.

drowsy axle
#

we were in the middle of a fob hunt and the server goes down. from my guys.

high marsh
#

That's really no different though flash.

still forum
#

sleep accuracy matches time accuracy combined with the general scheduler accuracy

drowsy axle
#

Basically want to give them a warning

still forum
#

so.. You'll be between 0 second and a couple hours accurate

tender root
#

Good luck @drowsy axle with your script. I’m gonna head of to bed 😊

drowsy axle
#

Thank you

high marsh
#

uh. Doesn't time degrade in accuracy? 0-0

still forum
#

yeah

#

same as sleep

high marsh
#

Ouch.

still forum
#

But. The scheduler accuracy is the same for a waitUntil with Sleep 1. Or a while true that constantly checks a condition without any sleep

errant jasper
#

Yes. But the error in accuracy from a range from 0 to 10800 should be almost unnoticable.

drowsy axle
#

so sleep is the most accurate?

still forum
#

no

#

but the simplest

drowsy axle
#

Okay

still forum
#

you don't need to be accurate to the second anyway

drowsy axle
#

obvs I don;t want to spam: Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes! Server will restart in 10 minutes!

#

So anything is good I guess

#

ServerMod\servermod\initServer.sqf or ServerMod\initServer.sqf PATH: @ServerMod/addons/servermod/initServer.sqf

#

lol ded

still forum
#

pboname\filenameinsidepbo

#

ServerMod.pbo and initServer.sqf inside it
->
ServerMod\initServer.sqf

neon snow
#

Is there a way to trigger a script when weapon is changed?

sturdy cape
#

hello fellow arma´ed people.anyone a quick alternative for an eventhandler?i have one that is overriding a default file of a mod but this will cause trouble so i need an alternative

neon snow
#

How it is overriding? Maybe just another eventhandler?

sturdy cape
#

i made a vehicle locking plugin that has an eventhandler for checking if a vehicle is locked and closing the inventory dialog.the same eventhandler minus my edits ( which work) is running inside of a mod which has an override function.so i am basically executing the default code plus mine and the building system of the same mod says NO.

#

so i need a workaround

#

inventoryOpened EH

still forum
#

@neon snow do you have CBA?

neon snow
#

yep

still forum
#

CBA_fnc_addPlayerEventhandler has a WeaponChanged EH

#

use inventoryOpened @sturdy cape just close the dialog one or two frames later

neon snow
#

Thank you Dedmen 😃

sturdy cape
#

the problem is a closedialog wont work for some reason and the file does a breakout

#

no,no.i wanted to say i use InventoryOpened @still forum

tough abyss
#

Why not create a trigger and set timeout on it for activation

still forum
#

I know..

#

That's what you said

sturdy cape
#

i am german,we have to be more careful regarding the language barrier then everyone else 😉

still forum
#

I'm german too

#

I don't have any language barrier

meager heart
#

Dedmen just said nijet to all language barriers long time ago... 😃

#

so no problema 👌

still forum
#

ne panimaju

meager heart
#

see ^

tiny flame
#

LMAO

neon snow
#

How could I check if missioneventhandler with particular name exists?

still forum
#

explain "exist"?

neon snow
#

Is added with addMissionEventHandler

still forum
#

add a new one

#

if ID is bigger than 1 then.. Others already existed

meager heart
#

also you can store the id maybe

#

and check if it's nil

still forum
#

🤔

neon snow
#

I checked with nil but it dropped me error I think

still forum
#

how do you check a number that you don't have with nil

#

🤔

neon snow
#

Dedmen, I am not sure if I understand you correctly, I have a missioneventHandler with ID "JHMCS", how could I check if it is bigger than 1? sorry if stupid question

meager heart
#
private _id = addMissionEventHandler ["", {}];
missionNamespace setVariable ["tag_myEH", _id];
```🤔
still forum
#

wat

#

no you don't

#

mission eventhandler ID's are numbers

#

What you are saying doesn't make sense

neon snow
#

JHMCS = addmissioneventhandler ["Draw3d",
{ };

still forum
#

so variable

neon snow
#

oh

still forum
#

well. If the variable is not nil. Then it's probably set

#

isNil "JHMCS"

meager heart
#

^ imo ez way 🤔

neon snow
#

thank you so much 😃

high marsh
#

What path would I use in cfgFunctions folder search if I had a addon structure of:
P:\@clientlogger\addons\functions ?

#

pboprefix.txt:
logger\functions
no dice

#
Warning: rapWarning: **********missing file(s)***************
Warning: \@clientlogger\addons\functions\config.cpp Line 21: logger\functions
rapWarning: **********missing file(s)***************
    fn_logClientState.sqf :scanning
    pboprefix.txt :configuring
</end entries>
Missing File Summary
config.cpp : logger\functions

pboProject output

meager heart
#

just functions folder ?

high marsh
#

yup

meager heart
#

🤔

high marsh
#

I'm not sure what you're asking

#

P:\@clientlogger\addons\logger_functions <- Source directory being packed.
Contains:
config.cpp,
pboprefix.txt,
functions (folder),

#

inside functions contains fn_logClientState.sqf

#

in config.cpp:

class CfgPatches
{
  class clientLogger_functions
  {
    name = "Client Logger - Functions";
    author = "Midnight";
    url = "";
    requiredVersion = 1.80;
    requiredAddons[] = { };
    units[] = { };
    weapons[] = { };
  };
};

class CfgFunctions
{
  class logger
  {
    class logger_general
    {
      file = "logger\general";
      class logCLientState{preStart=1;};
    };
  };
};
still forum
#

@high marsh didn't we just talk about how folder structure works?

#

pboname\filenameinsidepbo

#

unless you have pboprefix

#

in that case
pboprefix\filenameinsidepbo

#

also your pdrive layout is wrong

#

the files are supposed to be P:\<pboprefix>\fileinsidepbo

#

so P:\logger\function..

meager heart
#

also config.cpp Line 21: logger\functions not found, but you set functions folder as > file = "logger\general"; 🤔

high marsh
#

@meager heart I mistook the log file for another

#

thank you both for the feedback

#

if we talked about this before i don't remember

still forum
#

Talked about this with capwell just a few hours ago

finite jackal
#
_zoneDelete = player addEventHandler ["Killed", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    // what should go here?    
}];```
Trying to use the killed event handler to delete a local marker using deleteMarkerLocal for the player who was killed. How would I go about putting that into the event handlers command parameter?
glad edge
#

how do I make players spawn with a specific custom loadout/respawn with them in multiplayer

real tartan
#

I don't want to re-invent a wheel so asking here. Does someone have function to draw a line via markers on map? Define startPos and endPos and it will create rectangle marker between those 2 positions on map facing direction of those 2 positions.

meager heart
still forum
hollow thistle
#

cfgfunctions postinit/preinit

#

not sure if it works in preinit tho.

compact maple
still forum
#

no_animals_Init_Var = what use does that thing have?

#

it's useless

#

also your XEH is wrong

#

you need a subclass for your addon

#

By telling him why his code doesn't work and how to fix it?

#

okey.

#

Cool.

#

Oh also @thorn saffron you need to call your event init inside your subclass. Like on the ACE one I linked

#

What spectrum?

thorn saffron
#
    {
    class no_animals
        {
        requiredAddons[] = {"CBA_Extended_EventHandlers"};
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        version = 1;
        };
    };

class Extended_PostInit_EventHandlers 
    {
    class no_animals 
        {
        clientInit = "call compile preprocessFileLineNumbers '\no_animals\init.sqf'";
        };
    };```
#

better?

still forum
#

Yep. Don't see anything wrong

still forum
#

If it's just one line of code you could also place it cirectly in the config

finite jackal
#

rK helped me, no more worries!

tough abyss
#

You can create custom loadout config in mission config and setUnitLoadout it in respawn EH. And use forceRespawn command to make respawn EH trigger on join as well @glad edge

shy flint
#

That is exactly what I'm trying to do, if only I understood it. Haha

fossil yew
#

How to play certain music in main menu? I know it has to be some mod.

thorn saffron
#

In main menu? I think its done via scenes

fossil yew
#

ok cheers

tough abyss
#

Main menu is just like mission

compact maple
#

really ? you can custom it then ?

#

there is files being loaded in the main menu then ?

slender halo
runic surge
#
_fnc_SetVariables = 
{
    _posN   = _pos;
    _numRow = _cnt;
    _numCol = _numRow;
    _cntRow = 0;
    _cntCol = _cntRow;
    _offset = [0,0,0];
};

call _fnc_SetVariables;

I use this function to reset these variables after a specific task is done so it they can be used in similar tasks.

Should I use the private command inside the function or outside, or at all?
I use the private command for all of my variables including these ones but I figured I could simply have them be defined in the function and call the function instead of having them defined in two separate places right next to each other where they aren't necessary

unborn ether
#

@runic surge Honestly I didn't get the reason of that, since:

private _var = 0;
diag_log _var; // 0 
private _DT_fnc_yourFunction = {
    private _var = 1;
    diag_log _var; // 1
};
call _DT_fnc_yourFunction;
diag_log _var; // 0
runic surge
#

oh

#

of course

#

should have been obvious lmao

#

actually those variable ARE used outside of the function

#

it only exists to reset them, so I don't need to private them inside the function

tough abyss
#

Underscored vars are destroyed at the end of the scope they were defined in, so manually resetting them doesn’t make much sense tbh

runic surge
#

I am resetting them within the same scope

#

I need to use the variables for several different tasks but they are changed within some of those tasks

tough abyss
#

Pretty sure you are, otherwise it would make even less sense if you were resetting them outside of their scope

#

If you don’t want variables with the same name to be affected in nested scopes, use private keyword in nested scopes

#

Or do not assign to them

runic surge
#

I have 4 different tasks that need those variables in their original state
each task modifies them during their calculation

Instead of resetting them at the end of each task, or having 4 different sets of variables that are identical, or redefining them as private variables, it would be more efficient to just use a single function so I have a 'universal' set of values

#

at least that's my logic

tough abyss
#

No idea, but sounds convoluted, maybe you need to rethink the design

runic surge
#

each task is only slightly different than the other, with the exception of one, so I feel keeping each individual task as simple as possible would keep things simple

#

also each task depends on the previous being completed before it

#

there is probably a better way but I couldn't think of one

frigid raven
#

I see GVAR in ACE3 and ALiVE but did not yet figured out what it is? Is it a convention for a specific macro best practise?

#

Does it stand for GENERATE VARIABLES?

#

Because the macro kinda has some array logic

still forum
#

GVAR -> Global variable

#

modname_modulename_varname

#

GVAR(blood) in medical module -> ace_medical_blood

thorn saffron
#

is it possible to call an inline function defined in one sqf in another sqf?

hollow thistle
#

what do you mean by inline? If you assign it to global var you can.

high marsh
#

even local you should be able to in say your init.sqf

neon snow
#

How could I get angle difference between forward look and freelook?

tough abyss
neon snow
#

Thanks 😃

#

Also, is there any eventhandler to handle event of weapon switching in a vehicle?

tough abyss
#

Not in vanilla

neon snow
#

Tried the CBA and no luck aswell

gilded garden
#

Does anyone know of a way to check the animation source for the AFM wheel brakes?

neon snow
#

@gilded garden you mean heli animationSourcePhase "wheel" ?

gilded garden
#

I want to find a way to animate an object based on the RTD Wheelbrakes On/OFF

neon snow
#

Ahh

gilded garden
#

Yeah, its a bit harder than i though it would be too 😛

tough abyss
neon snow
#

Any idea why this code:

_vector1=eyedirection player; 
_vector2=vectorDirVisual vehicle player; 
acos(_vector2 vectorCos _vector1)

returns wrong angles? When I look up at approx 80 deg it shows 40

#

And maximum seems to be 59.999

tough abyss
#

I doubt you could look up 80 degrees

neon snow
#

I did, in cockpit with edited ViewPilot

tough abyss
#

Maybe you need camera direction not eyedirection

neon snow
#

Will try

#

Works flawlessly, thank you @tough abyss

gilded garden
#

@tough abyss thanks ill have a look at that

meager heart
#
acos (getCameraViewDirection player vectorDotProduct vectorDirVisual vehicle player)
acos (getCameraViewDirection player vectorCos vectorDirVisual vehicle player)
``` @neon snow
#

also vectorDirVisual < direction vector in world space

still forum
#

@thorn saffron if the variable of the function is visible. Sure.

iron osprey
#

Is it possible to get the position of all simple objects that I have spawned? I am trying to randomly spawn trees that aren't too close to each other.

#

I'm trying to get the position of other trees that I've spawned (example: createSimpleObject ["a3\plants_f\Tree\t_FraxinusAV2s_F.p3d", _pos])

iron osprey
#

thank you! I was messing with "nearestObjects" and "nearestTerrainObjects" and was coming up short

#

seriously, 60mins of debugging

#

working on distribution algorithms for scenery

shy flint
#

Hey, is anyone able to help me with controlling respawn loadouts? I want to setup custom ones but I cannot even seem to control the loadout on respawn using existing ones from a .ext. Currently testing this using the example code from the arma 3 respawn wiki page. Always respawns me with the character that was selected, rather than the specified kit. (Which I want a custom loadout ultimately) Help greatly appreciated! Please note I am a very inexperienced coder. :/

digital jacinth
#

When are you applying the initial loadout after mission start?

#

one way of doing it is to exec this AFTER you applied the loadout on mission load

myLoadout = getUnitLoadout player;
player addEventhandler ["Respawn", {player setUnitLoadout myLoadout}];
proven crystal
#

Id like to try and save some data for players. I hear i could do that with profilenamespace?

#

Any tips on that?

#

Also could i store some data on the server that way?

dusky pier
#

@proven crystal ```sqf
// write to profile
profileNamespace setVariable ["variable",/some data/];
saveProfileNamespace;
// load from profile
profileNamespace getVariable ["variable",/default data/];
// delete from profile
profileNamespace setVariable ["variable",nil];
saveProfileNamespace;

#

profile is good for save player settings, but for more data - need use inidbi or extDB3

wet hornet
#

Oh no

#

Cyborgs

dusky pier
#

@tough abyss hm... but variable not contain anything

compact maple
#

extDB3 pretty good

proven crystal
#

For players id probably like to save last position and loadout or so

#

On the server side i have some objects which all have several variables.

#

Would like to store the state of those vars on the server

#

In terms of volume, this would probably amount to roughly 300 objects with mabe 10 variables each. Most just numbers or true/false state, one is an array with several unittypes. Dont know if that counts as a lot of data

dusky pier
#

@proven crystal you can save last position and loadout on profilenamespace. But players can back up position, or loadout and connect to server all the time with saved position.

proven crystal
#

you mean if they edit the file then

#

?

digital jacinth
#

Yes.

#

if you want to prevent cheating then you are bound to safe these things on server only

still forum
#

@tough abyss setting the var to nil doesnt actually delete the var still shows up in (allvariables profilenamespace)
Don't you find it kinda weird that literally every reply that I give to your statements is telling you that you are wrong?

https://s.sqf.ovh/arma3_x64_2018-10-16_14-01-08.png

unborn ether
#

@tough abyss First of all "" is not a nil, nil is nothing, nothing cant be something. If you are getting it with default value of "" or even nil itself, it doesn't mean it's existing:

profileNamespace getVariable ['variable',nil]; // if nil - doesnt exist
profileNamespace getVariable ['variable',""]; // if "" - doesnt exist

So I don't know how can you dump nothing literallly.

proven crystal
#

i wouldnt be worried about cheatin. it would be for the purpose of a unit to save the state of the map at mission end

#

i dont think people would mess around with it

#

so but generally in terms of overall volume, am i hitting the limits of what shouldbe done with profilenamespace?

#

i.e. should i figure out to use iniDB or whatever?

digital jacinth
#

i wouldnt be worried about cheatin
if you plan on playing this on a public server, then you should. If you are just playing it within your gorup then you can scold the person cheating.

#

As a dev for a monolithic application, never trust the client

unborn ether
#

There are not that much of exploits novadays, most of them are probably private and expensive, but to start with... If you are worried about your server security you have CfgRemoteExec + CfgDisabledCommands and whole bunch of BE filters like script.txt to close the plain execution of some code, that doesn't belong to your framework. In other plans, you should be wise when you script something and just not let people do something that shouldn't happen. Some commands like remoteExecutedOwner for example, will prevent sending code back to substituted destination. I'm still seeing some frameworks allowing client to RE spawn|call straight to a server which is total bs. Anyways, at the end of the day, people who knows SQF close to perfect will still be able to use your framework security against itself, this just gives more errors rate. and more time to accomplish. Arma was never 100% secure.

proven crystal
#

I am not worried about cheating. Closed server. And even if someone were to cheat it wouldnt be much concern right now

#

My only concern would be data volume for the server parts.

#

No idea for how much this option could/should be used for

burnt cobalt
#

i have searched the web extensively and been testing for weeks now. There is threads and answers, but they no longer work. Just trying to get a paradrop to work. I use unAssignVehicle, moveOut and even leaveVehicle + [_x] ordergetin false . It all works, the chopper spits out the units, they parachute to the ground and while airborne they return their chute as their assigned vehicle. However, as soon as the units hit the ground, they get re-assigned to the helicopter w3hich makes it land and wait for the units to re-board. Even if I execute unAssignVehicle on these paratroopers again, i can see the debug return them as unassigned for one second, before being reassigned to the heli. I can not interrupt this process. Any ideas?

proven crystal
#

are they in the same group as the helicopter?

#

if so, try creating a separate group for the jumpers

#

how can i find out if 2 areamarkers overlap?

#

i could probably create a few kind of sensor spots around the edges, but is there a better way? cant seem to find a command or function for it

burnt cobalt
#

i tried every scenario, some work but what does not work is getting an AI controlled to stay out of the chopper they paradropped from. Or, keeping the piolot from assigning them again, I don't really understand who's responsible

proven crystal
#

do you run vcom and do they have a waypoint far away?

digital hollow
dusky pier
#

is possible to prevent drop item to weaponHolder? I tryed use onPutItem eventhandler, but weaponholder is already created.

unborn ether
#

@dusky pier Weapon holder is created at the stage of opening a gear display, not putting an item.

#

So the only way is to block gear dialog with InventoryOpened

#

Which is... ridiculous.. obviosly.

dusky pier
#

@unborn ether thank you! I tryed find source of gear dialog scripts, find that: addons\ui_f\scripts\handleGear.sqf. But i think something wrong.

unborn ether
#

InventoryOpened is Event Handler.

olive gull
#

:prevent:

#

How u do dad

#

dat

#

{hello}

#

[hello]

#

[[hello]

hollow thistle
#

`text`

dusky pier
#

@unborn ether i know 😄 that works fine.

unborn ether
#

I was mostly wondering how do you escape the markdown tile escape

still forum
#

@dusky pier there is no source for gear dialog scripts. As the scripts don't exist

high marsh
#

@olive gull Please reserve whatever brain cells you have left for intelligent questions. Thanks

frigid raven
#

I have two Killed Event Handler. One on every CAManBase and one on my player. When my player dies - both are called. How can I prevent the CAManBase Handler to bubble up?

#

I tried a lot of this return true stuff, but somehow I fail

high marsh
#

@frigid raven Uhhhh....what? can you just post your code and tell us your problem? Bubbling up? Return true stuff?

still forum
#

set a variable onto the object. If variable is already set, the other handler already ran

frigid raven
#

k will do then - thought would be too hacky somehow

still forum
#

Don't see why you need a second handler on your player

#

your player is CAManBase too

#

Could just check if object is the player in your CAManBase handler

frigid raven
#

I know but somehow things do not work

#

Like I grenaded myself out of the world beneath a neutral faction guy

#

in the handler logic isPlayer _unit was in both calls false

#

because my player respawned too fast

#

I assume

#

is there something like... wasPlayer 😄

still forum
#

isPlayer is not the same as object==player

frigid raven
#

I am on the server side tho

still forum
#

oh

#

¯_(ツ)_/¯

frigid raven
#

cannot compare to player therefore eh

#

Yea a bit tricky

tough abyss
#

Why not use EntityKilled mission EH and ditch the rest?

#

Or even better, MPKilled

frigid raven
#

Gonna check these ones anotehr time - I fixed it and put the problem to sleep now

#

devs gonna dev

#
vehicles select {_x isKindOf 'air'}; // yields: [B Alpha 3-5:1 REMOTE,testair,B Alpha 3-4:1 REMOTE]
{driver _x setVariable ["VCM_Disable",true];} forEach (vehicles select {_x isKindOf 'air'};

driver testair getVariable "VCM_Disable"; // nothing

Can anybody explain what I am missing?

still forum
#

missing )

frigid raven
#

hate my life

tame lion
#

Question regarding creating custom ui dialogs. I've built a dialog but under seemingly random circumstances, the dialog will crash the game for users. I can't figure out what is causing the issue cause in my own testing everything works fine. It's also not asst specific times either when it happens for them; sometimes it's when making a selection in a list box, sometimes hitting a button, sometimes when just opening

#

Ate there unwritten engine limitations for ui dialogs?

tough abyss
#

Without seeing the code it is anyone’s guess

tawdry harness
#

Hey is there anyway to capture what the player said in chat and turn it into a string?

tough abyss
#

Yes, disable chat and make your own, this way you are in control

#

With remoteExec you can make chat BI could not have dreamed of

tough abyss
#

i can't wait until we switch to a real OOL with arma 4

iron osprey
#

what is OOL?

#

oh, nvm

high marsh
#

EOL

#

I really don't understand why people just improve and enjoy the current platform

meager heart
#

Hey is there anyway to capture what the player said in chat and turn it into a string?

0 spawn {
    waitUntil {!isNull findDisplay 24};
    findDisplay 24 displayCtrl 101 ctrlAddEventHandler ["KeyDown", {
        params ["_control"];
        hintSilent str [
            ctrlText (findDisplay 63 displayCtrl 101),
            ctrlText _control
        ];
    }];
};
```into debug console ^ @tawdry harness 😃
#

also there was KK's "who's talking" thingy

junior stone
#

@tough abyss Where they confirms that? Dont think so

tough abyss
#

BI confirms SQS/SQF will be used in a potential future arma title Do you have any official quote to substantiate your claim?

still forum
#

I didn't see it in the last spotrep atleast. So far the only thing that BI said about a future Arma title was it being Enfusion engine. But after that they denied they had any plans for a future Arma title yet everywhere.
So it seems really weird to have them say that Fookin SQS will be included in a thing that's not even planned yet

#

@tawdry harness CBA also has a eventhandler for chat messages I think. If you are using CBA that might be easier

meager heart
#

cba_events_chatMessageSent iirc 🤔

queen cargo
#

i personally would be perfectly fine with it (sqf-vm for the win!)
though ... reworking SQS/SQF into something more ... "robust" could be needed

#

something that actually implements stuff like if etc. as actual language elements

#

the language actually would be perfect for putting A FUCKING LOT into actual language keywords instead of all being some weirdo operators

#

--> more assembly instructions that actually handle everything + some very simple optimization

#

hah

#

haha

#

HAHAHAHAHAHHAA

#

no

#

i remind you of famous stuff like: domination, insurgency or whatever other popular A2 mission/mod comes to your mind

#

all broken beyond repair

#

when "ported" to A3

proven crystal
#

Still at least i wouldnt have to start from scratch

high marsh
#

why does it matter if you have to start from scratch? Should we really limit ourselves because someone doesn't want to have to restart?

little oxide
#

Lol

high marsh
#

the logic is so flawed quick

#

I do not want to be limited in creative ability because someone else decided they just wouldn't be damned to take the time to remake their old crap

#

AI is a fundamental part of the game, visuals have been cut. None of this adds up.

#

Saying no one uses AI because you see a handful of people aren't, is a stupid generalization.

#

Server browser tells you nothing, you're closed minded if you think this is a determination of tendencies in the community

#

There is no hidden majority, AI is used in I&A as a main premise of the gamemode!

#

If each AI lover in arma could kick you in the balls if AI were removed, you'd have no balls!

#

Why do you think that's so Quik? Because kids and manchildren love instant gratification

#

It isn't a reflection of the arma community as a whole

#

and it's extremely dull to be making blanket statements like this

#

You remind me of someone starting off for the first time

#

they look at the browser and assume this is what the community is

#

Did you even read my comment on I&A? HAM?

#

For fks sake man, you take no credit for making teamwork against ai playable

#

So what? Why the hell would we just drop AI because you don't think there isn't enough players?

#

How many do you need? 1,000? 2,000? 1,000,000?

real tartan
#

is there a way to add Faces to custom virtual arsenal ?

high marsh
#

config mike

#

You give absolutely zero to the idea of humor with this

real tartan
#

@high marsh can you elaborate more how?

high marsh
#

@real tartan CfgIdentifes in mission config may be picked up in VA, I doubt it though. Otherwise, it may just have to be in player faces or in config

real tartan
#

@subtle ore I am asking in general, that includes mainly A3 default faces. is there a way to select those in arsenal that is custom made ( that means that I add weapons, magazines manually with BIS_fnc_addVirtualItemCargo etc )

high marsh
#

unless addVirtualItemCargo does the trick, then I doubt it.

#

the "unlocked" initialization of the arsenal function may give information

#

as it does index all the faces in a3

real tartan
#

hmm, they remove ctrlDisplay for those sections 😦 if arsenal is not full

#
            {
                _tab = _x;
                {
                    _ctrl = _display displayctrl (_tab + _x);
                    _ctrl ctrlshow false;
                    _ctrl ctrlenable false;
                    _ctrl ctrlremovealleventhandlers "buttonclick";
                    _ctrl ctrlremovealleventhandlers "mousezchanged";
                    _ctrl ctrlremovealleventhandlers "lbselchanged";
                    _ctrl ctrlremovealleventhandlers "lbdblclick";
                    _ctrl ctrlsetposition [0,0,0,0];
                    _ctrl ctrlcommit 0;
                } foreach [IDC_RSCDISPLAYARSENAL_TAB,IDC_RSCDISPLAYARSENAL_ICON,IDC_RSCDISPLAYARSENAL_ICONBACKGROUND];
            } foreach [
                IDC_RSCDISPLAYARSENAL_TAB_FACE,
                IDC_RSCDISPLAYARSENAL_TAB_VOICE,
                IDC_RSCDISPLAYARSENAL_TAB_INSIGNIA
            ];
mortal wigeon
#

Nobody uses the AI because they suck

high marsh
#

Not true

#

Just because you don't think so doesn't mean it is so

mortal wigeon
#

The AI don't suck?

high marsh
#

Not really, they're pretty above industry standard in many ways

mortal wigeon
#

Lmao

#

Ok

high marsh
#

Laugh all you want, because it's popular to shit on the AI. But I can find satisfaction in utilizing AI in the way I like to use them

mortal wigeon
#

Just because you don't think [they suck] doesn't mean it is so

high marsh
#

It's more about lack of utilization

#

and to say we should remove AI from the game is completely regressive.

#

a lot is to be said about how far AI has come in arma, and how well it works if used properly. A lot of people miss out on the chances to use AI properly in their game modes.

earnest ore
#

Can you provide an example of a mission with properly used AI that doesn't show it's obvious defects?

queen cargo
#

@mortal wigeon they are literally better then pretty much All other AI in games... Name one where the AI works better, promise ya that is just due to a 100% scripted scene

high marsh
#

@earnest ore H&I ?? HAM??

queen cargo
#

guess you cannot name such a thing @mortal wigeon 🤷
ArmA AI is far from being human like
but there is none human-like AI in any bloody game

earnest ore
#

Hearts and minds and what sorry?

meager heart
#

🍿

high marsh
#

@earnest ore Invade and Annex, you know this guy Quiksilver? He made it all work seamlessly. Go play on a server and tell me you anticipated AI being where they were and that they don't function effectively or overly effectively. It's so perfectly blended, and it's great on performance as long as server owners don't bloat it with extra crap

earnest ore
#

Oh, i'm familiar with that one - unfortunately through strayagaming. If i remember it correctly, they implemented something in their mission that wouldn't allow you to use the esc menu on death, thus you'd have to quit via task manager / pkill.

#

Why in the flying fuck that is allowed at all is beyond me.

high marsh
#

It's just a loophole. Same goes for editing profile data. But this has nothing to do with AI. It kind of pisses me off that we've gotten to the point where the majority of players would rather complain than make the most of what they have.

still forum
#

To the Arma 4 SQF conversation.
Yeah it would be truely awesome if people would port their completely fucked up crap scripts to A4 without having to change or improve a single thing.

#

Makes me kinda happy thinking that people cannot just copy-paste some 10 year old OFP bullshit that they found on some forums into their great mission framework

high marsh
#

You don't even have to look that far back

earnest ore
#

I was trying to see where you were coming from by what missions you've been playing. Our group uses Zues controlled missions exclusively with and without AI modifications. Handling these monsters to do the deed correctly against human players has been a real pain in the ass for us more than half the time - things ranging from garrisoned units shooting through doors and walls, units not using their arsenal (grenades), suicidal tendencies, zues being unable to force units to retreat as a group or as individuals, air units... let's not talk about air units.

#

About the only thing i've seen them do well at is suppression.

#

Which is about good enough to make the game enjoyable.

tough abyss
#

I am all for a clean break if we get a programming model that is faster and has more scope, it must contain a model for multithreading which both justifies the change and provides us with a lot more performance in the future.

queen cargo
#

"i want magic that works" ? @tough abyss
more scope
multithreading wich both justifies the change and more performance
wut?
multithreading in game-engines would be a "nice to have" feature in theory but practically, it will lock objects, update stuff on them and unlock afterwards
if the update process takes too long or too many are done, rendering will be halted and micro-fps-lags will occur

tough abyss
#

Still waiting to see official source for this insane claim @tough abyss

#

I really don't understand why people just improve and enjoy the current platform
because SQF is a pretty bad language and has a lot of quirks about it that you don't see in other programming languages

#

like how you dedicate one function per file

queen cargo
#

that is pretty much BS darling

#

you do not need to
unless you want to use CfgFunctions

#
SomeFunc = { ... };
OtherFunc = { ... };```is perfectly valid
tough abyss
#

yeah but depending on location those aren't compiled at preinit

#

which bothers me

compact maple
#

yikes

queen cargo
#

fixing that for ya too:

// In CfgFunctions this file is put as TAG_fnc_PreInit with PreInit = true
SomeFunc = { ... };
OtherFunc = { ... };```
tough abyss
#

interesting

queen cargo
#

single file, multi ops

tough abyss
#

either way

#

i don't like it

#

also the way SQF does local and global variables really makes me hmm

compact maple
#

thats just a " _ "

queen cargo
#

SQF is perfectly fine, just your expectations are false due to the language not behaving like "you would expect" as all who say that are literally expecting a C-Like lang

#

though .. SQF is slow AF

#

which is indeed something that could be improved upon

#

@tough abyss why do local and global vars make you "hmm"

compact maple
#

arma4 👀

tough abyss
#

as all who say that are literally expecting a C-Like lang
please god give us a C-like language