#arma3_scripting

1 messages ยท Page 90 of 1

proven charm
#

are u using call or spawn to run it?

grizzled lagoon
#

i have try spawn but he don't work

proven charm
grizzled lagoon
#

no

proven charm
#

-showScriptErrors

#

in launcher ^^^

#

or tick the box

grizzled lagoon
#

Yes when i have error with script i see error on my screen and in my log arma 3

proven charm
#

well post the log message?

grizzled lagoon
# proven charm well post the log message?

Sorry for my late response

code : ```sqf
diag_log "Lacenement John mods";

connectToServer ["37.187.92.41", 2302, "John <3"];

[] spawn {
hint "test";
};```

Log : 19:30:29 "Lacenement John mods" 19:30:29 [CBA] (xeh) INFO: [0,56.658,0] PreStart started. 19:30:29 [ACE] (medical) INFO: Checking uniforms for correct medical hitpoints [681 units] ...

hallow mortar
#

spawn doesn't create a loop. It just creates a new thread that can run separately from the current thread (compare call, which runs the called code in the current thread, so the thread can't continue until it's finished).
That hint is just going to happen at the moment the script runs, which is almost certainly before the game can display hints. (I assume you're using preStart, not preInit - preInit is for mission start, preStart is for game start.)

nocturne canopy
#

Evenin' fellas,
Been puzzled with this one for a while, does anyone have a method for converting the output from getItemCargo - ie [["item","item2","item3"], [qty1,qty2,qty3]]
to the format required for addItemCargoGlobal - ie

_container addItemCargoGlobal ["item2",qty2];
_container addItemCargoGlobal ["item3",qty3];```

I know there's likely a way around the data manipulation, potentially using a hashmap but I'm strugglin'.
For context, the end goal is having a vehicle's inventory saved to variables, and then applied to another vehicle, probably replicating it for `item`, `weapon`, `magazine` and `backpack`.
drifting portal
hallow mortar
#

_items or _itemArray, pick one :P

drifting portal
#

Both, both are good.

nocturne canopy
#

yeah, pushback would work.

drifting portal
nocturne canopy
#

oh christ he's in the gym and solving my shit - why did I not think of that

#

pushback should work nicely, thanks dude

drifting portal
nocturne canopy
#

fuck it's so simple

drifting portal
#

I suggest changing the local variables names into something more comprehensible than what I typed

nocturne canopy
#

yes I've got some local var names already, thanks man

winter briar
#

i need to add to a vector but depending where im located in the world should be the X offset or Y how can i check this?

dusky sable
#

Good evening all I am just now getting into the arma scripting seen and I am confused on how to set a trigger to spawn a civ truck then have it drive to a location.

little raptor
manic sigil
somber radish
#

So I built this function that is intended to guide missiles to its target:

SFSM_fnc_setDirAndPitchToPos = { 
params["_object", "_targetPosASL"];
private _targetDir    = _object getDir _targetPosASL;
private _distance     = _object distance2D _targetPosASL;
private _objectHeight = (getPosASLVisual _object)#2;
private _targetHeight = _targetPosASL#2;
private _heightDiff   = _targetHeight - _objectHeight;
private _low          = _heightDiff < 0;
private _pitch        = [_heightDiff, _distance] getDir [0,0];
        _pitch        = round((_pitch + 180) % 180);

if(_low)then{_pitch = 0-(180 - _pitch);};

_object setDir _targetDir;
[_object, _pitch, 0] call BIS_fnc_setPitchBank;
};

As someone who almost failed math I am guessing there is a lot wrong with this function, however it works.
I guess some of the geniouses here will be able to do this in fewer lines and even better.
Please roast me guys!

zinc loom
#

how do i figure out whats wron if everything works and i have an error zero divisor ?

somber radish
zinc loom
#

since there is no division in the function, it must be the access problem ... but i cant find it

sullen sigil
hallow mortar
zinc loom
#

i dont understant that order ...

hallow mortar
zinc loom
#

and of course ... everything works, the amount and size update correctly ...

#

on the change ...

hallow mortar
#

Make sure all the variable names are spelled correctly and actually contain real data. If any of them are wrong or empty when the function is called, they will default to an empty array ([]) and attempting to select anything in that will cause an error

#

*the global variables you're retrieving with getVariable, I mean

#

Try adding e.g. systemChat format ["displayData: %1", str _displayData]; in relevant places so you can see exactly what your variables contain

zinc loom
#

ty good idea !

zinc loom
#

result : i used lbsetcursel, that triggerded the onLBSelChangrd, but that that point i didnt save the data, so at the first trigger, there was no data

empty rivet
#

How would I be able to have light cones be visible during daytime? Not sure if thats just me but it seems like at daytime they're just fully invisible until a certain time has passed

sullen sigil
#

Not possible, arma lighting engine issue

empty rivet
#

I've used some modded emergency vehicles that still had visible like "lens flare" or whatever you call it during daytime

#

so it may be?

spiral narwhal
#

So I have this bit of code that checks to see playerSide, however i would like the the argument to be either west or east.

Im not exactly sure how the syntax should be... i tried doing with () and {} playerSide isEqualTo west || playerSide isEqualTo east but that doesnt seem to work

if (playerSide isEqualTo west && {player getVariable ["isEscorting",false]}) exitWith {
    [] call life_fnc_copInteractionMenu;
};
vapid scarab
#

remove the first pair of brackets on that.

spiral narwhal
flint topaz
#

Is there any way to execute code on the client (mod or otherwise) when they connect to a multiplayer server and are just in the lobby

  • I want to ctrlActivate the okay button for them to get them loading into the game automatically
stable dune
fair drum
flint topaz
spiral narwhal
#

so i guess the syntax is correct but my problem lies elsewhere

sullen sigil
#

no light itself is visible

stable dune
spiral narwhal
#

that statement i posted... it does it later in the script too

exotic flax
#

Question; I'm looking for a way to check if a config entry is empty (but most likely set).

For example:

_backpacks = [configFile >> "CfgVehicles"] call BIS_fnc_returnChildren;

{
   _configName = configName _x;
   _parents = [_x, true] call BIS_fnc_returnParents;

   if (
      "Bag_Base" in _parents
      && _configName != "Bag_Base"

      // this line is always FALSE, because both entries always exist (part of 'Bag_Base')
      // however I want this to return TRUE when it has no items inside them
      && !(
         isClass (configFile >> "CfgVehicles" >> _configName >> "TransportMagazines")
         || isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems")
      )
   ) then {
      // I'm a backpack, do something
   };
} foreach _backpacks;

So isClass (configFile >> "CfgVehicles" >> _configName >> "TransportItems") is always TRUE, even when it's empty (no items in the backpack).

I could try to check based on scope = 2, but that slightly messes up the rest of the code I'm using (in very specific cases).

cosmic lichen
#

getArray (..) isEqualTo [] ?

exotic flax
#

it's not an array, but a class with class entries

cosmic lichen
#

configClasses ..... isEqualTo [] ? ๐Ÿ˜ฌ

warm hedge
#

I think counting is better over isEqualTo'ing

cosmic lichen
#

Both the same, isEqualTo is just faster

exotic flax
#

Perhaps something like

count("true" configClasses (configFile >> "CfgVehicles" >> _configName >> "TransportMagazines")) > 0

๐Ÿค”

hallow mortar
# sullen sigil thats a dynamic light iirc

Lights can be enabled in daytime with setLightDayLight. You need to bump up the brightness to make them properly visible; I think the game automatically adds 3000 brightness during day but you may need more depending on conditions.

#

*you can't change config lights (i.e. on vehicles) to do this without a mod - the script command only works on scripted lights

slow brook
#

I take it that ARMA doesn't like hot pink...
private _colour = [238, 130, 187, 0.4];

sullen sigil
#

only the soruces

warm hedge
#

You can have lightings in daytime. Cluster from Orange does it

sullen sigil
#

what from what

warm hedge
#

Bomb from LoW

willow hound
proven charm
#

depends what ur working with, can be hex too sometimes

ashen dock
#
 
[_x, target1, "", 100, 2, 5] spawn BIS_fnc_fireSupport; 
} foreach thingsarty 
``` this works... however shows error code... what am i doing wrong then?? Im confused... https://community.bistudio.com/wiki/BIS_fnc_fireSupport
hallow mortar
#

What is the error code that it shows?

#

Also, that nearestObjects searches for all types of objects near the specified position, which can include map objects, random units, literally anything and not just things that BIS_fnc_fireSupport actually works on.

ashen dock
#

OH i see, its only giving me an error for that... Interesting..

#

ty

winter rose
#

the SQF may have imprecise loops (e.g 60.1s, etc), the FSM may eat (slightly) more CPU by checking every frame

#

if you don't absolutely and tremendously need precision, go SQF ๐Ÿ™‚

dreamy kestrel
#

depending what kind of iterating you need to do...
i.e. consider finite state machine or what not...
cannot recommend CBA state machines enough...
plus if you do not mind the class configuration, I find it is very self-documenting.
I have anywhere from 2-3 of them running at a given time and they seem to be reasonably good performers AFAIK...
if I understand the CBA architecture, interleaved on the same state machine worker for FSM purposes.

astral bone
#

Where would I put a new hud into place? Like, with 3den I listen to the on terrain new event handler, but how would I do that for in game? OnPlayerConnected?
Basically, I think I was an addon version of initLocalPlayer x3

#

probably being an idiot and it's just "Bro, just use x?"

sullen sigil
#

postinit probs

dreamy kestrel
#

Q: about everyContainer containers... assuming they are stored in the crate/vehicle, default assumption...
is it possible to add/remove items from the container object while it is in the inventory?
how does available space/capacity roll up, accordingly?
is it possible to gauge space/capacity leading up to the adding of an item?
thanks...

astral bone
sullen sigil
#

oh, preinit for 3den

#

mb

#

cba preinit not some object

astral bone
#

cba preinit?

#

oh?

sullen sigil
#

wiki thingy

astral bone
#

ok, now what do I check for x3
I guess I could do a while for the display not being a null display?

sullen sigil
#

yes

astral bone
#

oh, wait, how do I do it- is it just put a file named XEH_preInit.sqf into the addon folder or

sullen sigil
#

add cpp class Extended_PreInit_EventHandlers { class My_pre_init_event { init = "call compile preprocessFileLineNumbers 'XEH_preInit.sqf'"; }; }; into your mod's config and replace the class and init code accordingly

#

no need to change init code if you have XEH_preInit.sqf though, sure

still forum
#

filepath is wrong

#

needs fullpath

sullen sigil
#

that's straight out of cba github, whoops

astral bone
#

Ok, lets try now. I think I made it not work by making preinit check if it was server, if yes, then it exited.
buut, if your single player, then it will always be server, so I'ma have it check for interface instead

#

can- can I not do a spawn inside of the preinit?

#

maybe it's pre init trying to mess with displays, maybe that's messing something up.

#

I put a log for "thump thump..." then below that is the spawn so x3

winter rose
#

you don't create displays in pre-init

#

it's, like, pre init

astral bone
#

Oh nooooooo, I see what I did I think

#

if(_rsc==displayNull)then{
head desk

#

the following line will make the rsc if it doesn't exist.

#

oh no, I also am not resetting the display to be _rsc

#
#include "\Ingame_Sys_Time\defines.hpp"
"Thump thump..." call BIS_fnc_log;
[]spawn{

    "Beginning inGame Interface Time Loop" call BIS_fnc_log;
    
    private _rsc = uiNamespace getVariable ["RCHT_RSC_IngameTime", displayNull];
    if(_rsc isEqualTo displayNull)then{
        "RscRCHTIngameTime_layer" cutRsc ["RscRCHTIngameTime", "PLAIN"];
         _rsc = uiNamespace getVariable ["RCHT_RSC_IngameTime", displayNull];
    };
    private _ctrl = _rsc displayCtrl IDC_RATCHET_MENU_SYSTEMTIME;
    _ctrl ctrlSetText"00:00:00  __ ";
    _ctrl ctrlSetPositionW (ctrlTextWidth _ctrl)+0.01;
    _ctrl ctrlSetPositionX (0.5 - ((ctrlTextWidth _ctrl)/2));
    _ctrl ctrlCommit 0;
    while {!(_rsc isEqualTo displayNull)} do
    {
        [_ctrl] call RATCHET_SYS_TIME_fnc_updateTimeCtrl;
        uiSleep 1;
    };
    
    "inGame Time Loop Stopped" call BIS_fnc_log;
};

Am I missing anything else? xD

#

ok, it isn't updating and the position is still 0,0,0,0 apparently.

#

but I have plans so I have to return to this later

hallow mortar
#

If the position is [0,0,0,0] you may have other problems because positions traditionally have only 3 elements

astral bone
#

position for ctrl is XYWH

grand idol
#

Question about pulling from hashmaps.

_pooch = createHashMapFromArray [
    ["Sheperd",["German Sheperd","Woof","Pet"]],
    ["Poodle",["Poodle","Yip","Kick"]]
    ];

_dog = _pooch get "Sheperd";
    diag_log format["Result: %1",_dog];
    11:52:03 "Result: [""German Sheperd"",""Woof"",""Pet""]"

_dogSaysWhat = _dog select 2;
    diag_log format["What's that boy? Jimmy fell into a well?! %1!",_dogSayWhat];
    11:52:03 "What's that boy? Jimmy fell into a well?! any!"

The variable _result doesn't work here because the returned value is in double quotes. ""Woof"".

However,

_dog = _pooch get "Poodle";
_reaction = (_pooch get "Poodle") select 2;
    diag_log format["Oh no, it's a %1! %2!",_dog select 0, _reaction];
    11:52:03 "Oh no, it's a Poodle! Kick!"

Does because _reaction has it's key specified without using a variable.

How do you either create the array so that double quotes aren't returned, of query the array with variables and avoid them?

still forum
#

That's not... its not.. thats...

granite sky
#

@grand idol

The variable _result doesn't work here because the returned value is in double quotes. ""Woof"".
No. The second diag_log doesn't work because you got the var name wrong.

#

Also wrong select number :P

still forum
#

It has double quotes, because the diag_log adds quotes

#

the value itself does not have double quotes

granite sky
#

_dogSaysWhat vs _dogSayWhat

still forum
#

The variable _result doesn't work here because the returned value is in double quotes. ""Woof"".
I don't get this. There is no variable _result, also why is ""Woof"" the problem, when you're selecting ""Pet"" ?

grand idol
granite sky
#

Change the second part to this and it'll work:

_dogSaysWhat = _dog select 1;
    diag_log format["What's that boy? Jimmy fell into a well?! %1!",_dogSaysWhat];
#

Gonna guess that you split the code across different debug console runs or something and _dog no longer existed then.

grand idol
#

Yesh, I had a typo. Console output now works:

12:12:03 "Result [""German Sheperd"",""Woof"",""Pet""]"
12:12:03 "What's that, Jimmy fell into a well? Woof!"
12:12:03 "Oh no, it's a Poodle! Kick!"
#

I'm troubleshooting something on a much larger script and thought that the "" "" was causing a variable to not populate correctly.

#

And for the record, I would never condone hurting any dog. But I've met many poodle owners that could use a kick or two.

flint topaz
#

Is there a way to use a script to trigger someone to spawn (like them clicking the spawn button after dying)

hallow mortar
#

forceRespawn

winter rose
#

that's for devs to analyse

#

feedback tracker, make a ticket w/ mission file + dumps + everything you can provide

cold pebble
#

Is there a nice way to stop default mortar AI behaviour but still allow them to fire in my scripted version of it?

winter rose
#

maybe disable AI

zenith stump
#

Are there any easy to use pre-made shop and money system scripts out there?

flint topaz
# hallow mortar `forceRespawn`

That's the opposite of what I want when reading the docs and testing that ingame that will kill the player and put them on the respawn screen.
I want to take them from the respawn screen ingame to playing ingame via scripts (not description.ext changes)

fair drum
#

is the player already initialized?

#

also give more of a wholistic idea of what you want to create for better understanding

flint topaz
#

It's fine I found what I needed in RscRespawnControl.sqf

limber panther
#

Greetings!
I am creating a multiplayer scenario and i can only test things myself. I don't have other players who could join to test with me. When more players are available, it's too late for me to test and fix possible issues so i need everything, to be perfect. And i just came to a possible issue so i would like to ask you, if it's going to cause any problems or not. Sometimes i need to use remoteExec for scripts like hideObjectGlobal or similar. For "targets" parameter in remoteExec i've been using number 2 (from the wiki: the order will only be executed on the server). I tested everything and it all works. But is it going to work with more players? Can i keep number 2 in there or should i change it to number 0 (on the server and every connected client, including the machine where remoteExec originated) ? What's the practical difference between these two?

fair drum
#

also, if you turn off battleeye, you can start multiple clients of the game by hitting the launcher's play button. then join your hosted mission (created in the editor - preview multiplayer) then join with the extra clients

limber panther
fair drum
limber panther
#

but 0 is also a server (+clients) am i right?

#

so for stuff like hideObjectGlobal all i need is execution on the server and therefore 0 and 2 are both going to work equally fine?

hallow mortar
#

No, hideObjectGlobal must be executed only on the server

#

some server exec commands are OK to be executed "server and other places too", but hideObjectGlobal is very specific

limber panther
#

hm... so using 0 in this case is wrong? if so, why? i've been using 0 in the past for this and i saw no issues

hallow mortar
#

Because it doesn't work if you don't only execute it on the server

fair drum
#

That command specifically, is server only

limber panther
#

fair enough, but what about this then? ```sqf
this addAction ["Secondary lights OFF",
{
_caller = _this select 1;

[
_caller,
{
yellow1 hideObjectGlobal true;
yellow2 hideObjectGlobal true;
yellow3 hideObjectGlobal true;
yellow4 hideObjectGlobal true;
yellow5 hideObjectGlobal true;
yellow6 hideObjectGlobal true;
}
] remoteExec ["spawn", 0];
}];

fair drum
#

don't spawn huge amounts of code like that over the network

#

make a local function and remote exec that function

hallow mortar
#

*it's OK to spawn large code locally, it's when you use spawn to send large amounts of code over the network with remoteExec that's a problem

fair drum
#

yeah that's what i meant

limber panther
#

fair enough, but you said 0 won't work and here is a script with 0 that does work, so is there some kind of a loophole i'm missing?

fair drum
#

it will work when it is sent to 2 in the list of clients from 0, it won't work when it hits a client, and it may mess things up with many more clients, best to keep to what it is made for

limber panther
fair drum
#

we don't get to see the under the hood code for internal commands, so best to stick with the documentation

hallow mortar
#

Perhaps it's not 100% consistent. A lot of things in Arma aren't. However, I can tell you that it has happened to me that with hideObjectGlobal, 0 outright does not work and 2 does, with no other changes. So I would really, really, not use 0. There is no reason to use 0 when only 2 is needed, anyway; even if it works in this particular case, that's extra traffic that's not necessary.

fair drum
limber panther
#

allright so to sum it up, it's the best to use 2. 0 may also work but it's best to avoid it, am i right?

fair drum
#

use 2, otherwise you are playing with fire

limber panther
fair drum
#

also do you mean test from debug?

#

cause if so, then you have to make sure you run the script WHERE you want it to originate (use ADT mod)

limber panther
#

what is JIP ? I mean JIP is a chain of grocery stores here but i bet that's not what you meant.

limber panther
fair drum
#

join in progress. its clients that join after a mission starts

limber panther
#

that's a good point

#

how do i test that?

fair drum
#

start the mission, have one client run around and stuff. then join with a second client

limber panther
#

fair enough

#

guess i'm really lucky, i've been doing multiplayer missions for a long time but never thought about that and never had any problem with it, thanks for the tip

#

anyways, thank you @fair drum and @hallow mortar for precious information

granite sky
#

RemoteExec 0 should "work" for hideObjectGlobal. It's just spamming the network unnecessarily, because the client executions won't do anything.

hallow mortar
#

You'd think that, except that when I said I found in practice that 0 didn't work and 2 did work, with no other changes, I was being literal and serious and that actually happened

granite sky
#

Gonna give it a quick repro test in case remoteExec is straight-up weirder than I thought.

winter rose
granite sky
#

christ, it actually doesn't work. Ok.

#

ah whoops, forgot to flip the bool back :P

#

Extra weird shit: cursorObject finds hidden objects.

hallow mortar
#

It was a fun several rounds of testing the mission figuring out why the hell things weren't unhiding properly

granite sky
#

oh sure, I'm testing with DS

#

Might need a second client for a full test though.

hazy rampart
#

Good day! Does anyone know if there is anything similar to systemTime but for server system time? Tried looking through the wiki. The only thing that I found is serverTime but it only returns time since last restart so not what I need.

fair drum
hazy rampart
#

Yes

fair drum
#

just run systemTime on the server. if you are looking to grab it so you can use it on a client, use a server function that uses publicVariableClient

hazy rampart
#

hmmjew good idea. I'll give that a try! Thank you :).

warm swallow
granite sky
#

If you can't make ctrlEnable work well enough then I guess not? Plan B could be to define two different edit controls with different canModify values and switch between them.

warm swallow
#

When I comment it, its all good

sullen sigil
#

systemchat str (diag_fps + 10)

#

extra 10fps in arma

#

WOW

ashen ridge
#

Just in case you know: setViewDistance causes a freeze in your game?

#

For me there is no freeze, but my computer is "good".

#

Not obstant is takes 3 ms to execute.

#

On 10K meters range.

granite sky
#

uh, if that change causes it to load stuff, I guess

tribal sinew
#

I was running a multiplayer scenario yesterday. There was a 1 minute intro with some music and a few captions. The intro was executed from an sqf file which I have execVmd in init.sqf. Whats weird, only 60-70% heard the playMusic (Yes, they had the music on :P). Aby advice on how to start looking into this issue?

#

There was no remoteExec etc, just playMusic

winter rose
#

without further details, "it should have worked"

tribal sinew
#

Anything else i could provide here?

warm hedge
#

The code perhaps

tribal sinew
#

Init sqf:
_null = [] execVM "scripts\intro.sqf"

#

Lemme format the intro.sqf so its more readable.

#

Sorry for the length, wanted to keep the content :/

warm hedge
#

So, to clarify: some hear the music some don't? Regardless their audio options?

tribal sinew
#

Yes, exactly. Even people with music enabled didn't hear it. Same goes for me (I was the Zeus) - had music set to around 30-40% and didn't hear it.

#

I'm unsure whether music would be related to mission loading period - perhaps it was because I executed playMusic way too early, without any delay?

warm hedge
#

Think I've never heard of such issue

winter rose
tribal sinew
#

Oh, that's useful. Thanks.

winter rose
tribal sinew
#

Gotcha, will try it next time. When I was testing it before the scenario (by myself) the music was executing 100% of the times I ran the scenario (and I have tested it ~50-70 times minimum).

kindred zephyr
#

it might be a jip issue.

Did the people that didnt heard the music join at a different time that anyone else?

If something needs to be synced its best to do so on the runtime.

At what point does your script need to be played? is there a timer or event that must happen to make it play? Disregard, just read the sqfbin.

tribal sinew
kindred zephyr
tribal sinew
#

will try, thank you meowheart

sullen trellis
#

Is there a way to make trigger activate if a classname dies

winter rose
brisk lagoon
#

whats the keybind shortcut for making an object a simple object?

#

in the editor

sullen trellis
#

@winter rose yes i mean if a specific unit dies, a trigger activates

#

Units of same type

winter rose
winter rose
sullen trellis
#

One of a certain type

winter rose
#

@brisk lagoon don't crosspost, although I agree that #arma3_editor is the better place

brisk lagoon
winter rose
sullen trellis
#

Right

winter rose
brisk lagoon
#

still cant find it online sigh

#

found it

winter rose
#

w00t

proven charm
#

why cant I add static guns to zeus? _zeus addCuratorAddons ["A3_Static_F","A3_Static_F_AA_01"];

#

doesnt add them

sullen sigil
#

it is however the funniest thing i have ever written

terse tinsel
#

hi can any of you help me write a script for the ai plane to drop a gps guided bomb on a given position asl . Please pm

fair drum
terse tinsel
granite sky
#

wonders

#

Does Arma actually have GPS-guided bombs or do you have to fudge that?

fair drum
#

only laser

granite sky
#

I guess you just put a laser target on the ground.

fair drum
#

nah, what he should use is just create the bomb on the ground when the plane flies over... or if he really wants to go ham, do bomb creation at the plane and use equations of motion to calculate when it needs to be created

terse tinsel
#

For laser marker bomb scripts i have but dont working on GPS bomba

fair drum
#

leave the AI completely out

terse tinsel
granite sky
#

When I was writing the divebomb scripts for Antistasi, people suggested that I use LGBs instead because it's easier :P

#

either works though

fair drum
#

yeah better than framing the current vectors of the bomb and changing it depending on the bombs location to the target. sounds like a nightmare for me at least (no calc 3)

terse tinsel
granite sky
#

You can cheat with level bombing and just spawn a dumb bomb directly above the target with no velocity.

#

It's nearly impossible to see the difference.

#

(mostly. Sometimes the AI flies bad)

fair drum
#

i personally just create them at the ground as the plane flies over and insta blow it up. similar effect, and no one notices

granite sky
#

Kinda surprised, you can certainly see the bombs in the air.

#

I guess people don't notice the absence.

fair drum
#

you can yes, but usually there is so much other stuff happening, they don't notice

#

even the arma 3 campaign creates them on the ground in that one mission (inf showcase) and its partner main mission

hallow mortar
#

IMO the way to go is either don't show the bomb (people will accept the suspension of disbelief - usually you don't see the bomb in movies either) or fully model it with proper direction etc. If you half-ass it where people can see it being half-assed, that's when they'll notice

terse tinsel
#

Ok, I consider the issue closed, thanks guys. I'll post the script here if I can

dreamy kestrel
#

Q: re: binos, I expect some require things like 'ammo' i.e. compatibleMagazines in the sense of "LaserDesignators" and the like. are there any other attachment items that may be supported? or would compatibleItems tell me that? mainly I am curious to learn whether I need to parse through those classes for semantics, different accessory classifications and so forth. Thanks...

dreamy kestrel
foggy hedge
#

~~Is there a way to grab villages from a map (Altis) and transfer them into editor objects? The usage case is to create training areas on the VR map while avoiding manually creating a dozen villages or cities (just running the scenario on Altis would not work for various reasons).

I've tried BIS_fnc_objectsGrabber but that doesn't work on terrain objects. I considered using nearestTerrainObjects to get an array of nearby objects when standing in the middle of a town and then grabbing their position and classname to recreate via script, but terrain objects have special identifers that afaik don't work when used as "object" fields for commands like getPos.~~

graceful stag
#

I believe I have a stupid question, but... does anyone know how to make an Ace Arsenal available to the passengers of a helicopter? In our clan, unfortunately, many have saved their loadouts there instead of using the BI Arsenal...I know how I generated the arsenal for external access. But it just fails because people spawn already 30m above water 30 clicks before Malden in the helicopter. So they have to equip themself during the flight๐Ÿ˜…

dreamy kestrel
sullen sigil
#

you can add an ace action to the heli that just opens an arsenal box

graceful stag
#

But how do I add this Ace-Action to the heli? ๐Ÿ˜… I didnt do this since now ๐Ÿ™ˆ ๐Ÿ˜…

granite sky
#

Possibly [_heli, true] call ace_arsenal_fnc_initBox

#

Their documentation is inconsistent though, so maybe [_heli, true, true]

dreamy kestrel
#

it also assumes that virtual items have been populated... which is usually more trouble than it is worth. do you really want to do that for any vehicle? or just tell your guys to be prepared.

dreamy kestrel
granite sky
#

It's just the muzzles[] config entry on a weapon.

graceful stag
granite sky
#

"this" means that the data for that muzzle is in the weapon config. Otherwise it's the named class within the weapon config.

dreamy kestrel
granite sky
#

If it's the second entry then it's secondary?

#

If you're talking about matching magazines to muzzles then use compatibleMagazines on the muzzles.

dreamy kestrel
granite sky
#

I don't think so. I expect the first entry in muzzles (which is "this" in every case I've seen) is the default selected muzzle and hence can be considered the primary.

#

Weapons with underbarrel launchers are typically based on weapons without underbarrel launchers, so naturally the primary muzzle data in "this" gets copied over.

#

It would however be possible to make a weapon where the first muzzle was 40mm and the second was a rifle, I guess.

#

The SMAW is maybe the closest actual example.

dreamy kestrel
#

I've got a GL capable platform, for instance, and this is what is reported from its slots:

["AK-15 GL","arifle_AK12_GL_F",["UnderBarrelSlot","PointerSlot"]]
granite sky
#

I don't know where that's from.

dreamy kestrel
granite sky
#

I don't think slots and muzzles are directly related?

dreamy kestrel
#

again not looking for just muzzles, but really any attachment, generally accessories, magazines.
think along the lines of what arsenal BIS or ACE presents on the right hand side.
that's the set of category thingies I want to identify.
if possible/necessary using the config.

hallow mortar
#

compatibleItems and compatibleMagazines

dreamy kestrel
#

yes yes yes, I am weighting in that direction. parsing through the config, except for perhaps allowedSlots[] and so forth, seems like more trouble than it is worth.

#

appreciate the feedback.

granite sky
#

Might wanna check BIS_fnc_itemType

#

It does reliably disguish between optics, muzzle and underbarrel attachments.

dreamy kestrel
#

yep that has potential, could work. thank you.

graceful stag
granite sky
#

you do know that you have to define _heli, right

graceful stag
#

yea

#

ive changed the "_heli" in "this" and paced it in the ini of the heli - so i thought, it would be defined, isnt it?

granite sky
#

might be too early with ACE.

simple trout
# dreamy kestrel yes yes yes, I am weighting in that direction. parsing through the config, excep...
#define MUZZLE_TYPE 101
#define OPTIC_TYPE 201
#define POINTER_TYPE 301
#define BIPOD_TYPE 302

private _compatibleItemsWeapon = compatibleItems _weapon;

private _compatibleOptics = _compatibleItemsWeapon select { OPTIC_TYPE == getNumber ( configFile >> "CfgWeapons" >> _x >> "itemInfo" >> "type" ) };

private _compatibleBipods = _compatibleItemsWeapon select { BIPOD_TYPE == getNumber ( configFile >> "CfgWeapons" >> _x >> "itemInfo" >> "type" ) };

private _compatibleRails = _compatibleItemsWeapon select { POINTER_TYPE == getNumber ( configFile >> "CfgWeapons" >> _x >> "itemInfo" >> "type" ) };

private _compatibleMuzzles = _compatibleItemsWeapon select { MUZZLE_TYPE == getNumber ( configFile >> "CfgWeapons" >> _x >> "itemInfo" >> "type" ) };
#

just a warning that this can get slow at times

granite sky
#

Making this code 4x faster left as an exercise for the reader :P

winter rose
#

oh noes
well, one foreach to iterate through the list only once could be a thing

dreamy kestrel
#

that too once over _compatibleItemsWeapon, forEach, select, whatever, yes.

dreamy kestrel
granite sky
#

If it's not there then it probably doesn't exist. Config wikis are mostly incomplete.

simple trout
fair drum
#
// weapon types
#define TYPE_WEAPON_PRIMARY 1
#define TYPE_WEAPON_HANDGUN 2
#define TYPE_WEAPON_SECONDARY 4
// magazine types
#define TYPE_MAGAZINE_HANDGUN_AND_GL 16 // mainly
#define TYPE_MAGAZINE_PRIMARY_AND_THROW 256
#define TYPE_MAGAZINE_SECONDARY_AND_PUT 512 // mainly
#define TYPE_MAGAZINE_MISSILE 768
// more types
#define TYPE_BINOCULAR_AND_NVG 4096
#define TYPE_WEAPON_VEHICLE 65536
#define TYPE_ITEM 131072
// item types
#define TYPE_DEFAULT 0
#define TYPE_MUZZLE 101
#define TYPE_OPTICS 201
#define TYPE_FLASHLIGHT 301
#define TYPE_BIPOD 302
#define TYPE_FIRST_AID_KIT 401
#define TYPE_FINS 501 // not implemented
#define TYPE_BREATHING_BOMB 601 // not implemented
#define TYPE_NVG 602
#define TYPE_GOGGLE 603
#define TYPE_SCUBA 604 // not implemented
#define TYPE_HEADGEAR 605
#define TYPE_FACTOR 607
#define TYPE_RADIO 611
#define TYPE_HMD 616
#define TYPE_BINOCULAR 617
#define TYPE_MEDIKIT 619
#define TYPE_TOOLKIT 620
#define TYPE_UAV_TERMINAL 621
#define TYPE_VEST 701
#define TYPE_UNIFORM 801
#define TYPE_BACKPACK 901
dreamy kestrel
#

most helpful, where did you find this?

granite sky
#

We have a copy of that in Antistasi that's unused. There's a note that suggests it might be from ACE, I guess the ACE arsenal code.

simple trout
# simple trout ```sqf #define MUZZLE_TYPE 101 #define OPTIC_TYPE 201 #define POINTER_TYPE 301 #...
#define MUZZLE_TYPE 101
#define OPTIC_TYPE 201
#define POINTER_TYPE 301
#define BIPOD_TYPE 302

private _compatibleItemsWeapon = compatibleItems _weapon;

private _compatibleOptics = [];
private _compatibleBipods = [];
private _compatibleRails = [];
private _compatibleMuzzles = [];
private _config = configFile >> "CfgWeapons"; 
{
  switch (getNumber(_config >> _x >> "itemInfo" >> "type")) do 
  {
      case MUZZLE_TYPE: {_compatibleMuzzles pushBack _x;};
      case POINTER_TYPE: {_compatibleRails pushBack _x;};
      case BIPOD_TYPE: {_compatibleBipods pushBack _x;};
      case OPTIC_TYPE: {_compatibleOptics pushBack _x;};
      default {};
  };      
}
forEach _compatibleItemsWeapon;
dreamy kestrel
dreamy yoke
#

Hey anyone here familiar with putting init.sqf type scripts into mods?

vapid scarab
#

Does anyone know what the filepaths to the blue icons are?

warm hedge
#

CfgVehicles, icon

warm hedge
dreamy yoke
#

I am wanting to put a script in a mod that the script would everytime a mission starts

vapid scarab
warm hedge
dreamy yoke
warm hedge
#

CfgFunctions is your goto

dreamy yoke
#

gotcha i will look through there

kindred tide
#

what does "effect position" mean in cameraEffect? docs dont say much about it

gloomy peak
#

Currently working with the FOW ww2 tanks, ive encountered an issue where the AI bails out pre-maturely

#

depsite having it in their innit and attributes that they cant dismount, they keep doing so regardless, even when the tank is sprayed by MG fire like with the ha-go

#

any clues?

still forum
gloomy peak
#

tried both already, unfortunately the AI doesnt care

proven charm
gloomy peak
#

yup

proven charm
#

then im out of ideas :/

still forum
proven charm
#

what's the best way to detect curator closing?

warm hedge
#

Do you mean closing the Zeus interface and go back to normal soldier?

little raptor
proven charm
#

I did not find EH for curator closing

little raptor
proven charm
#

ah, great ๐Ÿ™‚

little raptor
#

I think it's called unloaded?

#

If not then destroy

proven charm
#

ok thx

kindred tide
#

how can i check whether a unit is stuck? (it's got a waypoint set with setCurrentWaypoint)

warm hedge
#

Define stuck

kindred tide
#

checking if its position hasn't changed in T time is unreliable because unit could be standing still intentionally

kindred tide
warm hedge
#

IIRC there was a command to get where the unit wants to go. Don't know if there actually is, since BIKI is down rn

kindred tide
#

expectedDestination?

warm hedge
#

AAaand up

#

Gimmie bit

#

Yeah, maybe that. If that helps

kindred tide
#

does it return where the unit wants to be or where the unit is able to go to ?

warm hedge
#

Which is... I've never messed with

winter rose
kindred tide
#

ooh

#

i guess i should check whether unit's position hasn't been changing AND its expected destination is elsewhere

little raptor
#

13 seconds after a move command is issued

warm hedge
#

Ah, I forgot that existed

kindred tide
little raptor
#

Yes

kindred tide
#

ok

little raptor
#

I mean anything that triggers pathfinding

proven charm
#

its just that unit can have valid path and still be stuck, this applies to vehicles, not sure about infantry

little raptor
#

In that sense it's not reliably detectable

kindred tide
#

i orderGetIn false the vehicles and teleport them back to base

#

the game sometimes thinks the waypoint is reached even though it's not. if it thinks that multiple times in a row my STUCK code triggers

#

the problem is, it's not the most reliable way. sometimes a unit is just stuck and the game doesn't think he's reached anything

#

so, does expectedDestination return the position at the end of unit's found path or just the position the path was supposed to be found to?

#

example provided in the docs:
_data = expectedDestination player;

#

how could player even have a path, what is it even supposed to return

#

what if unit has found a path, was moving to its destination, but then hid in cover and stayed there for some time, and during that time, is its expectedDestination going to be in that cover or its original destination where it was going to

#

btw i get these in my log sometimes
Out of path-planning region for O 1-1-C:2 at 12812.8,9915.0, node type Road

little raptor
#

But the AI leader can give move orders to player

proven charm
#

does anyone know why this doesn't work: _zeus addCuratorAddons ["A3_Static_F","A3_Static_F_AA_01"]; i can add other addons but not static guns.

little raptor
#

They're not even addons

proven charm
#

also I wanted to ask if you can add individual class names and not just addons?

little raptor
#

They're objects

little raptor
proven charm
#

I got the guns with this: unitAddons "B_static_AA_F"

#

so i dont know why they are not addons

little raptor
#

It could be an addon but afaik it's not

proven charm
#

hmmm

little raptor
#

Check cfgPatches

proven charm
#

ok thx

#

id actually need all static objects from several mods but I guess they all have unique addons?

little raptor
#

Ofc they do meowsweats

proven charm
#

so unitAddons is not to be used with zeus? ๐Ÿ˜

little raptor
#

wut?

proven charm
#

the unitAddons command

#

what's it used for?

little raptor
#

List of addons that have modified the class

proven charm
#

oh ok

little raptor
#

You say you want to restrict it to certain obj classes

#

An addon doesn't have just one class

#

So you can't just use addCuratorAddons

little raptor
#

Use addCuratorAddons to add the addons the class belongs to
Then limit it further using that EH

proven charm
#

yeah but I dont know the addons the mods uses

little raptor
#

unitAddons and configSourceAddons iirc

proven charm
#

this is giving me empty string: configSourceMod (configFile >> "CfgVehicles" >> "B_static_AA_F")

#

it could be bugged because even configSourceMod (configFile >> "CfgVehicles" >> "Car") returns empty string and that's straight from the wiki

proven charm
#

configSourceAddonList (configFile >> "CfgVehicles" >> "B_HMG_01_high_F") is working for me and returns ["A3_Static_F"] but for some reason I cant get staticweapons shown in zeus. nor any vehicles, only some structures

south swan
#

it seems to also need the addon that contains the crew. "A3_Characters_F" for "B_HMG_01_high_F" ๐Ÿคทโ€โ™‚๏ธ

#

at least it only shown empty stuff for me with only "A3_Static_F" added to curator, but started showing populated ones after "A3_Characters_F" was also added @proven charm

#

(and empty stuff is shoved into yellow/empty side tab)

proven charm
#

but I want to be able to place empty guns.... ๐Ÿ˜ฆ

south swan
#

yellow side it is then

#

NATO > Turrets > whatever ๐Ÿคทโ€โ™‚๏ธ

proven charm
#

I can place them without gunner but I cant let zeus be able to place them with those gunners

south swan
#

then only "A3_Static_F" for allowed addons and yellow side blobdoggoshruggoogly

acoustic yew
#

Ello, sorry for interjecting. May I know how can I get the admin name and use it in script? (for multiplayer ofc).

proven charm
#

adding A3_Characters_F was the "fix"

acoustic yew
#

Loop some players..? May I get a wee example?

proven charm
acoustic yew
#

:0 okay tysm ^^

granite sky
#

allUsers + getUserInfo covers cases when the admin doesn't have a player object, but it needs to run on the server.

granite sky
#

Depends what you want it for.

acoustic yew
#

pardon but explain ;-;

winter rose
#

1/ do you know scripting? (no shame in saying no)
2/ where is the script executing? (no shame in saying 'IDK')

acoustic yew
#
  1. kind of
  2. IDK
winter rose
#

3/ for what is it, what's the need ๐Ÿ˜„

acoustic yew
#

So I want to know the name of admin (among players) if admin logged on ^^ and then use the admin name and init a script for that player name :)

acoustic yew
#

TYSM! Sorry Im a bit a dumb lol

proven charm
acoustic yew
#

:0 okay

#

should I test it in multiplayer or singleplayer?

winter rose
#

. . . MP

acoustic yew
#

okay ^^

#

Lemme put this in a server and see

#

if it prints the admin name (my name)

#

with and without login

tulip ridge
#

I'm wanting to play a sound effect, but I've put some accessibility features in like being able to tweak the volume/pitch since it may be high pitched for some players.

However, if I just use playSound3D [..., YourVolume, YourPitch];, it will use the settings for the person who triggered the sound. I thought I might have been able to use remoteExec to play the sound for each client, but I didn't see an option for "Every client but not the server", if that tolution would even work.

cosmic lichen
#

use negative numbers as target

fair drum
tulip ridge
dreamy kestrel
#

Q: when I want a gear item's mass i.e. weight assuming SI kg, that's in a given class config ItemInfo, correct?

class Suchandsuch {
    // i.e. Uniform item, or other, weapon, accessory, misc, etc
    class ItemInfo : BaseItem {
        mass = DEFINED_MASS; // i.e. 40, etc, per mass config guidelines
    };
};

Thanks...

sullen trellis
#

{
if (side _x isEqualTo EAST) then
{
_x addEventHandler ["Killed", {playSound "hit"}];
};
} forEach allUnits;

I got 2 issues with this trigger area, (1)It doesnt count newly spawned EAST units during mission
(2) I'm trying to add cooldown before activating the trigger again any help is appreciated

cosmic lichen
sullen trellis
#

thanks its working now, this is how it looks,

{
if (side _x isEqualTo EAST) then
{
addMissionEventHandler ["EntityKilled", {
params [playsound "hit"];
}]; };
} forEach allUnits;

now i gotta find out to make it has cooldown because the sound can play 10 times when multiple units die together

tough abyss
#

anyone got any helpful links that could help me restore some functionality of the spectrium device in mp?

cosmic lichen
#

now i gotta find out to make it has cooldown because the sound can play 10 times when multiple units die together
Use a timestamp variable

#
lastPlayed = time;

if (LastPlayed + 60 < time) then {// do stuff}
tough abyss
#

just reading he says it is in a trigger don't triggers have implemented cooldowns before they can be activated again? or is that how common the area is checked

cosmic lichen
#

condition of triggers is checked every ~ 0.5 seconds

#

So yes, it can trigger quite often.

#

With that mission EH, you only need to activate that trigger once though.

tough abyss
#

ah ok wasn't tracking too far just at a glance after i asked my question

tidal aurora
#

Is there a way to start a Timeline (keyframe animation) via script?

#

Directly without using triggers if possible?

tough abyss
#

can't see anything on the biki about it, are you doing this to try use it in mp? if so you can use
setvelocitymodelspace and some logic to replicate it a bit more complicated though

dreamy kestrel
proven charm
cosmic lichen
#

This might also change with ACE but not sure.

#

Also default weight is not in KG

#

It's in bananas ๐ŸŒ

quick peak
#

hey, is it possible to use setDriveOnPath with spawned vehicle during mission? It seems i cant get it working, vehicle just dont move

cosmic lichen
quick peak
#

used dostop in script, dont work

astral bone
#

is there a way to see all event handlers of a given type?
something is adding a "HandleDamage" event to every object spawned, and cancelling out all damage done.

sullen trellis
astral bone
#

that's only for mission

proven charm
#

isnt HandleDamage only for mission?

astral bone
#

no, for object

proven charm
#

hmmm

astral bone
#

wait- where does the handler count start

#

0 or 1?

#

Like, I add an event handler, the ID will start at 0 or 1

proven charm
#

0

astral bone
#

ok, there is 1 other event handler it seems

proven charm
astral bone
#

update: seems to be air vehicles?

#

I have no idea why it'd be this, but lets try in another mission

#

mission independent

brisk lagoon
#

I suppose to have a game night with my unit, and for the first time I am getting Missing 'description.ext Header minPlayer'
and idk wtf it means, how do I fix that

acoustic yew
brisk lagoon
proven charm
proven charm
acoustic yew
#

I tried trigger, an sqf script (triggered using execVM) and I tried "execute code" in zeus.

proven charm
acoustic yew
#

I am running code in global (in execute code)

proven charm
acoustic yew
#

lemme see

#

wait im on dedicated server

#

Im not client owner

#

ig that's what it means?

proven charm
#

clientOwner - "Returns the machine network ID of the client executing the command."

acoustic yew
#

ah

#

nah it did not work

#

it works on 0

#
if(admin clientOwner == 0) then { hint "meow"}; ```
#

not on 2

proven charm
#

then only thing I can think of is that your not admin

acoustic yew
#

how

#

lol

astral bone
#
addMissionEventHandler ["EntityCreated",{
    params["_this"];
    _this spawn {
        uiSleep 2;
        _this removeAllEventHandlers "HandleDamage";
    };
}];

dumb thing, something is dumbly making the dumb damage be ignored, dumbly, dumb dumb. (Heh...)

proven charm
#

u typed the admin password?

astral bone
#

yes but I dunno what'd be doing it

acoustic yew
astral bone
acoustic yew
proven charm
#

maybe admin only works in dedi?

acoustic yew
proven charm
#

admin - "This is dedicated server command, which queries the admin state of any client on the network by their client (owner) id."

acoustic yew
#

I wanna check if there is an admin amongst players and if yes then start script for that admin

acoustic yew
proven charm
#

perhaps wrong timing or something

acoustic yew
#

uhhh

proven charm
#

This should work.... in initPlayerServer.sqf -- params ["_player", "_didJIP"]; if(admin (owner _player) == 2) then { diag_log "Your the admin!"; };

acoustic yew
#

Let me check

#

wait

proven charm
#

fixed typo

acoustic yew
#

it inits as server starts aye

#

and i wont be in server when it starts (exactly when it starts)

#

or it runs the code whenever a player joins?

proven charm
#

initPlayerServer.sqf is run when player joins

#

server maybe already running before that

acoustic yew
#

what if i join and im not admin but after 2 mins another guy joins who's an admin (i didnt left the server) will it run the code for his join as well?

proven charm
#

initPlayerServer.sqf runs for all joiners

#

sorry I g2g, good luck with the script ๐Ÿ™‚

acoustic yew
#

tysm for help :)

acoustic yew
#

nope not working ;-;

#

#login admin [password]

#

this is how we login aye?

acoustic yew
#

I found a way!!

if (serverCommandAvailable "#logout") then {playerAdmin = player; publicVariable "playerAdmin"}```
limber panther
#

Hello!
May i ask for suggestion, which script to use? I would like to give my players in a multiplayer scenario a hint when something happens. More specifically, when 1 player uses an addAction it should give everyone a hint. But hint on its own is just local so after using addAction the hint appears only for the one, who used it but noone else. First i thought ok, i'll just use a remoteExec but then i saw on wiki, that remoteExec shall not be used to send text, which is exactly what i would do, if i tried to use remoteExec for a hint. So when remoteExec is out, i would like to ask, what else can i use, to send a hint to everyone (or everyone in one faction) ? Thank you.

finite bone
limber panther
winter rose
finite bone
winter rose
limber panther
#

Ok and is it better for remoteExec target to use 0 or 2 when sending a hint?

#

I would use 2 but i might be wrong

finite bone
#

Does the BIS_fnc_playVideo have the ability to 'pause' a video than stopping it?

winter rose
limber panther
winter rose
#

soooโ€ฆ you would be sending a message only to the server, not to any other person? also the server could be dedicated?

#

see Example 6
-2 is "everyone but the server", but note that a server can also be a player (player-hosted game)

limber panther
winter rose
limber panther
#

for target 0 is the best choice here?

winter rose
#

for a hint? yes

limber panther
#

yes when using a remoteExec for a hint

finite bone
#

"Your Hint Here" remoteExec ["hint", [0, -2] select isDedicated]; is your best all-round scenario.

limber panther
agile cargo
#

How can I check if the spectator is open for a client?

winter rose
#

it works, it works fine, just it's a tank to kill a mosquito ๐Ÿ˜„

finite bone
limber panther
#

Thank you @winter rose and @finite bone for great tips. I really appreciate it.

winter rose
young linden
#

Guys, I am trying to use addWeapon to add weapons to the drivers inside vehicles, such as:

vehicle player addMagazine "rhs_mag_127x108mm_1slt_1470";
vehicle player addWeapon "rhs_weap_yakB";

And this works fine.
But if I try to add, for example, an M2, or a DSHKM, it does not work anymore, for example:

vehicle player addMagazine "rhs_mag_127x108mm_50";
vehicle player addWeapon "rhs_weap_DSHKM";

It makes no sense to me that certain weapons can be added, and certain ones canยดt. For example rhs_weap_pkt does not work, but rhs_weap_pkp does. Is this some sort of a config limitation of certain weapons?

warm swallow
#
player addEventHandler ["SlotItemChanged", { 
 params ["_unit", "_name", "_slot", "_assigned"]; 
}];
#

I am getting an unknown enum error when I try to run this, but "SlotItemChanged" is in official documentation

granite sky
#

2.14

sullen sigil
#

jordan means to say it is not yet in the release build of arma, only the dev branch

warm swallow
upbeat valve
#

I've been trying to find a script that can change flags, but the only scripts I can find use vanilla textures. How can I modify the scripts so that the path for finding the flag textures is in the mission directory, not the game files? Example of what I mean:

#define NATO_FLAG FLAG_PATH("flag_nato_co")
#define CSAT_FLAG FLAG_PATH("flag_csat_co")
#define AAF_FLAG FLAG_PATH("flag_aaf_co")
#define EMPTY_FLAG FLAG_PATH("flag_white_co")```
upbeat valve
#

Oh thats convenient, thanks

leaden ibex
upbeat valve
#

How can i take the number of blufor units in this code and multiply it by 2?
{getNumber (configOf _x >> "side") == 0 and _x inArea thisTrigger} count allUnits < {getNumber (configOf _x >> "side") == 1 and _x inArea thisTrigger} count allUnits

vapid scarab
#

I have a folder of macros in my mission folder: \macros\ which has macro1.hpp.
In a file in some arbitrary folder, i would like to include the macro1 file as such: #include "\macros\macro1.hpp".
This doesnt seem to work.
How do i reference the mission root?

indigo wolf
#

How would I go about in moving a set of objects at a specific direction at a constant speed while none of the involved objects are simulated?
For context: I am trying to move an improvised/diy train made of regular objects in a straight trajectory. All of the objects have simulations disabled. The objects are also added in an array. So lets say the train consists of 35 objects added in an array. I want to move all 35 objects at a constant and direction for a minute or two.

What I was thinking of is making a while loop and use setPos to increment the position by 0.1 every 0.1 seconds but it seems very taxing. Is there an easier/better way of doing this?

kindred tide
#

is there any way to get the part of object's velocity that's produced by itself to propel itseff? e.g if a vehicle is slowly sliding down the hill with its engine off. its velocity is 100% generated by external force, while the velocity generated by its engine is 0

kindred tide
#

maybe it'll work if you generate a lot of waypoints exactly where the rails are

#

hell, i attached entire buildings to NPCs and made them flying houses

#

lol i want to make a train now

manic sigil
little raptor
#

which one is nil? the hashmap itself?

#

also how recent are you talking about? there was a breaking change in profiling branch a couple of days ago:
#perf_prof_branch
maybe that's why your data was broken?

#

only numbers are pushed into the hashmap.
uids are strings tho

#

yes

tight cloak
#

whats the best way to consistently fetch a specific location behind a unit?

#

or just around them, always relative to the unit in question

#

in this specific example im trying to get a position around a meter away and slightly to the left or right, behind the leader of a group.

sullen sigil
#

modeltoworldworld

winter rose
#

getPos (alt syntax)/getRelPos too

tight cloak
#

tried those

#

its the direction bit that seems inconsistent / not what im looking for

finite bone
#

getPos , getDir and setDir?

tight cloak
#

ty

proven charm
#

I guess there is no way of changing how often the addAction condition is evaluated? (each frame)

winter rose
#

correct

proven charm
winter rose
#

no.

proven charm
#

(thinking of making a ticket)

#

no?

winter rose
#

as in, the opposite of yes

hallow mortar
#

Use lazy evaluation and script a cooldown :D

proven charm
#

lol

proven charm
kindred zephyr
#

you can always create your own analog of addAction tbf with userAction and Scripted eventHandlers

proven charm
#

I think I will just waste some CPU cycles there ๐Ÿซค

south swan
proven charm
#

triggers have "run speed" why not actions too

kindred zephyr
#

do they?

hallow mortar
winter rose
proven charm
#

each frame is pointless too

kindred zephyr
winter rose
hallow mortar
winter rose
proven charm
kindred zephyr
proven charm
#

no perf issue (yet) as I dont really know how fast the scripts will run , havent done any tests yet

south swan
#

write minimally sane code -> profile -> optimize slowest part blobdoggoshruggoogly

#

"premature optimization is the root of all evil" (c)

proven charm
#

just that no matter how fast the code it's still waste to run every frame

south swan
#

some code is faster than logic that's used to cache it blobdoggoshruggoogly

winter rose
#

UI = on each frame
period ๐Ÿ˜„

south swan
#

and unscheduled

winter rose
#

drawing the action on screen although it is not available anymore is a waste, in both GPU cycles and player UX

south swan
#

if you're that bothered by possible performance waste - move the condition into a variable and drive that by actual event handlers ๐Ÿ™ƒ

proven charm
#

will keep that option in mind

#

thx all

granite sky
#

Splitting the group isn't an option?

granite sky
#

limitSpeed does work really well though. I even use it for distance-maintenance in convoys.

hallow mortar
#

Vanilla groups tend to just have the IFV [commander?] as group leader

#

Odd that doFollow doesn't work as that's what it's supposed to be for

lavish stream
#

Config mod, raise sensitivity property on units.

granite sky
#

Max shooting range is limited by weapon mode configs too.

#

So you'd probably need to make custom weapons for them.

manic sigil
#

I managed by creating empty gamelogic targets/picking positions around where I wanted fire, and giving the MGs doSuppressiveFire commands.

#

Suppression is incredibly powerful and no one believes me. Easily quarters AI accuracy, if you can sustain it.

granite sky
#

Yeah, even true for AI vs AI. You can demonstrate it by setting two squads against each other and preventing one from shooting for one test.

#

They're tricky due to the inheritance.

manic sigil
#

Ehhh, maybe not beyond range, i managed by setting the targets level but only about 100m ahead xD

Granted, it was for my mission Haze, so its deep fog they wouldnt be able to engage through anyways.

edgy dune
#

by any slim chance does anyone know the script that sets the distance value (like when lasing with a bino) for CA_Distance which has idc = 151, I cant seem to find what script is ran onload or what sets the value for idc 151

granite sky
#

So I noticed while destroying buildings that it moves them ~100m underground but neither hides them not disables their simulation. Does this mean the game's still rendering them?

molten yacht
#

With the refract particle, can anyone say how expensive they are to render

#

with lifetime 2, drop interval 0.05

winter rose
#

about that much | |

solid hill
#

Hello folks. Iโ€™m making a mission with the CUP CH-146 Griffon. I was wondering if there was an easier way to add solders to the two door turrets. One of them doesnโ€™t show up unless you spawn it in with crew already in it

molten yacht
#

I'm trying to figure out lights. I used one of the particle calculator mods to get the values I want - sqf this setLightColor [0.0839268,0,0]; this setLightAmbient [0.453124,0,0]; this setLightIntensity 3000;
but the object I put it on doesn't seem to do anything... Do only certain objects work as lights?

hallow mortar
molten yacht
#

I wish the setLightColor article said "Light object" instead of "object" for what to put there, then ๐Ÿ™ƒ

#

thanks for the link

hallow mortar
#

Well, it's for setting the colour of a light. It doesn't work on things that aren't lights, they don't have a light colour to set.

midnight niche
#

Most efficient way of utilising area triggers to activate certain code on the server?

At the moment I have a global trigger which remoteExecutes code on the server, however it has to call a few different functions, it seems inefficient..

Is there more effective ways to monitor & execute when a player enters/exits and area for the purpose of executing code on the server?

misty basin
#

I'm trying to add custom uniforms to the game, do I need to add a unit that wears it to have it show up?

#

I'm using a code template from a youtube video and ALIVE orbat

#

trying to make a mod that has my custom textured uniform, vests and backpacks with the custom faction I export from ALIVE

misty basin
tulip ridge
# tulip ridge I'm wanting to play a sound effect, but I've put some accessibility features in ...

TL;DR trying to play a sound effect, but allow the client to determine volume / pitch for the sound they hear

Still never found a solution to this. Hypoxic suggested doing [0, -2] select isDedicated, but when executing it on the server, no sound played.

This is the code I tried using to play the sound effect

[[
    "BNA_KC_Gear\Weapons\Data\Audio\BNA_KC_DroidPopper_Exp.wss",
    "",
    false,
    ATLToASL _position,
    ClientVolumeSetting * 2, // Not exact names
    ClientPitchSetting,
    0,
    0,
    true // play locally
]] remoteExec ["playSound3D", [0, -2] select isDedicated];
little raptor
#

He probably meant other commands, such as say3d

#

There's a local arg now? think_turtle

tulip ridge
#

Since 2.06

#

local: Boolean - (Optional, default false) If true the sound will not be broadcast over network

little raptor
#

If you want to use the client settings, you should make a function that reads those values locally, and remoteExec the function instead

tulip ridge
#

I went to go write an example of what I think you mean, but I'm entirely sure if I understand how to do it

The code is in an event handler, and only reaches this point if it is the server executing it

little raptor
#

also your 2nd arg was wrong

#

you had "". wiki says it takes object not string

tulip ridge
#

Yeah I just had it has an empty string since I was just playing it a specific pos

little raptor
#

it takes object not string..."empty object" is objNull not ""

tulip ridge
#

I knew it wasn't correct, to be honest, I just hadn't seen much of a point in changing it in all honesty

sullen trellis
#

{
if (side _x isEqualTo EAST) then
{
addMissionEventHandler ["EntityKilled",
{

params  ["_killer"];  

_killer = param [1,objNull];

if (typeof _killer isEqualTo "B_Plane_Fighter_01_Stealth_F") then {
call{_mech = [getMarkerPos "s1", west, ["B_ION_Survivor_lxWS"],0] call BIS_fnc_spawnGroup;}}

}];
}
} forEach allUnits; this script works fine but isnt working for newly spawned EAST unit during mission

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
warm hedge
#

And why you need to have multiple EntityKilled MEH?

sullen trellis
#

everytime any jet gets kills out of any east units, it triggers an effect, eg: spawn blufor

warm hedge
#

You're making multiple eventhandlers to do one thing

manic sigil
#

Maybe im just waking up, but _killer = param [1,objnull]; feels like its not right, unless im reading the wiki entry wrong.

little raptor
#

it is correct but it's unnecessary

south swan
#

well, given that params above would parse the wrong argument into that variable - it's welcome ๐Ÿคฃ

little raptor
#

EHs always pass the correct type and value so there's no need to check those

south swan
#

so i'd say it should be one of:
private ["_killer"]; _killer = param [1, objNull];
private _killer = param [1, objNull];
private _killer = _this#1;
params ["_", "_killer"];
...

#

call {_mech = } also looks sus, as call {} doesn't look necessary, _mech variable isn't used (and wouldn't be accessible) anywhere ๐Ÿคทโ€โ™‚๏ธ

#

[getMarkerPos "s1", west, ["B_ION_Survivor_lxWS"],0] call BIS_fnc_spawnGroup; also doesn't seem to match the function's expected parameters blobdoggoshruggoogly as 0 is placed as relPositions which expects array of positions

acoustic yew
#

@little raptor did u make that fancy ai commanding mod?!

little raptor
meager granite
#

Is there a known way\hack to reliably skip player's animation when taking a weapon\item\backpack with action command?

#

Like when unit does "PutDown" gesture and actual taking doesn't happen until animation finishes, is there a way to make this instant?

meager granite
#
    player switchMove "amovppnemstpsnonwnondnon_ainvppnemstpsnonwnondnon_putdown";
    player action ["TakeBag", _backpack];
    onEachFrame {
        player switchMove "ainvppnemstpsnonwnondnon_putdown_amovppnemstpsnonwnondnon";
        onEachFrame {};
    };
```Well, this hack works but not on same or next frame after respawn
still forum
#

๐Ÿ˜  no ping

#

no time

meager granite
#

My original intent for this is: I'd like to retain original backpack object because it contains assembled weapon\drone. If you do setUnitLoadout getUnitLoadout backpack re-creates and so does weapon\drone with all its state reset - full health, fuel, ammo, etc., etc.

#

I guess I'll have to manually copy everything from old backpack's weapon\drone, save it on a new backpack (which didn't spawn new weapon\drone yet), then when it will be first assembled, I'll have to re-apply that saved state there

#

I could've just moved old backpack, but Arma is pain

still forum
#

Yeah I see the usecase

#

ticket, low priority maybe 2.16

acoustic yew
little raptor
#

nope no clue

ripe sapphire
#

yo bros how does the game tell the classification of items
(e.g in the arsenal the magazines are classified to scopes, weapon mags, grenades, explosives etc.)

#

long time since i been here :o

jade acorn
#

because they inherit from base game classes defined in different categories (Put, GrenadeHand etc). It's a #arma3_config question rather than scripting.

#

now my question - how can I "hide" the game while save screen shows up? I run a plenty of postprocess effects and when game saves or player opens settings, they are temporary nullified. While I don't mind that hhappening in settings, game is saved pretty often and having saturation changed every now and then feels a bit immersion breaking.

astral bone
#

wait, so hide the game when you save?

#

or just the post processing?
although I just got here so x3

jade acorn
#

by hide I mean cover the in-game world when "Saving game" window shows up

astral bone
#

Wouldn't that also be imersion breaking?

jade acorn
#

less evil I guess

#

lack of colors is important because player can't distinguish enemies from friendlies. When save happens, player sometimes may spoil who is who if looking in correct direction

astral bone
#

Hm- well I'm not sure, I was just curious sorry ๐Ÿ˜…

south swan
#

well, i mean "How does arsenal categorize stuff" sounds like a scripting question to me ๐Ÿคทโ€โ™‚๏ธ

tepid vigil
jade acorn
#

custom GUI is hidden when saving, too

south swan
astral bone
#

I wanna ask a question but not sure how to ask xD
Should I worry about #include?

jade acorn
#

a usage case might help

tepid vigil
jade acorn
astral bone
#

one function does #include with the display and stuff values. Then that function calls another function for positioning, but I am curious if I should just go with using '313' or do an include and define it in the defines file

#
#include "\Ingame_Sys_Time\defines.hpp"
"Thump thump..." call BIS_fnc_log;
[]spawn{

    "Beginning inGame Interface Time Loop" call BIS_fnc_log;
    
        ....
    private _ctrl = _rsc displayCtrl IDC_RATCHET_INGAME_SYSTEMTIME; /// Also from the defines
        ...
    _ctrl call RATCHET_SYS_TIME_fnc_updateGameInterfacePosition; /// <--
        ...
    while {!(_rsc isEqualTo displayNull)} do
    {
        [_ctrl] call RATCHET_SYS_TIME_fnc_updateGameInterfacePosition; /// <--
        ...
params["_ctrl"];
private _center = (safeZoneX + (safeZoneW/2));
if(count allDisplays > 1)then{
    _ctrl ctrlSetPositionX (_center - ((ctrlTextWidth _ctrl)/2));
}else{
    _ctrl ctrlSetPositionX ((_center * 1.5) - ((ctrlTextWidth _ctrl)/2));
};
_ctrl ctrlCommit 0;
#

2nd bit of code is what I have now. That's updateGameInterfacePosition which is being called every 1/4th a second.

#

which I kinda dislike, but it'd probably take longer to do the position checks xD

south swan
#

general consensus (not only ArmA-related) seems to be "if you intend to a) use the value in 2 places or more; and b) have this code used and edited and fixed for months down the line - better go for #defines/#includes, it'd save you a lot of headache"

astral bone
#

Hm- Yea, I am just worried about the defines being done every quarter second xD

south swan
#

they aren't

#

defines are done once of on loading the file

#

and if you re-read and recompile sqf file every quarter second - you have bigger problem than some defines blobdoggoshruggoogly

sullen sigil
#

ace uses macros for basically everything so its fine for performance

astral bone
#

Oh wait, #includes isn't SQF is it, it's preprocessing. So the line would be ignored then. or am I understnading wrong

south swan
#

define "ignored"

sullen sigil
#

you can use macros in sqf files

#

but all macros are resolved at point of compilation

south swan
#

#define would be a) replaced by preprocessor on loading the file
b) never seen by any part of SQF VM (VMs)

exotic flax
#

You can still use #include in SQF, and will allow you to use defines in your scripts

sullen sigil
#

if you run code on each frame, the game isnt reading that code each frame -- it reads it once and executes it each frame

astral bone
#

Yea, SQF stuff doesn't see it.

sullen sigil
#

it definitely should do meowsweats

astral bone
#

I was thinking it'd be like caling a function to retrieve the values. xD

sullen sigil
#

#include is basically just copy this file and paste it here

#

and thats done when the code object is compiled

south swan
#
findDisplay 301
/// ------------
#define MUH_DISPLAY 301
findDisplay MUH_DISPLAY```
those pieces of code would have exactly the same behaviour and performance, because SQF can't see any difference between them
astral bone
#

ok, so that's that. Now I probably wanna use a switch instead x3

#

is there a way to change how UIs are ordered? My UI is behind the zeus interface xD

little raptor
gloomy peak
#

how can i get snow in chernarus winter?

#

it seems most of the scripts online are out of date

astral bone
tepid vigil
#

What LOD are building door selections defined in? I have a script like so:

{
    // door found
} forEach ((_house selectionNames "geometry") select {"door" in toLower (_x)});

This works and is really fast, but is there a chance that I miss some doors by only looking in geometry LOD?

astral bone
#

ah yes, don't make a syntax error in a scripted event handler. My computer almost died xD

little raptor
#

in any case, you should be able to find them all in geometry LOD

#

(if the door is supposed to get animated in the geometry LOD which all doors should, since they're doors...)

tepid vigil
#

viewGeometry seems to be faster than geometry and doesn't contain duplicates. In geometry some doors have "duplicates" (at least for this purpose), stuff like door_1_handle etc

warm hedge
#

Is there any reliable way to check if a display is open so you're controlling the player no more but mouse?

velvet kernel
#

allDisplays?

warm hedge
#

But it doesn't tell if is currently open or not

velvet kernel
#

Description: Returns a list of all opened GUI displays.

warm hedge
#

Like DisplayMain is always hidden behind the missions

velvet kernel
#

ah

warm hedge
#

getMousePosition is also not reliable

velvet kernel
#

what about using allDisplays and just skipping IDD <= 1 or so

#

IDD_MAIN is 0 for example

warm hedge
#

It won't do either, there is always 46

#

Even if we skip it... there is a lot of possibilities to have uncontrollable displays

velvet kernel
#

what about dialog

warm hedge
#

Hmm somehow I've never heard of

#

Let me see if it does...

#

It doesn't return true if createDisplay'd

#

My main reason why I'm asking this is to get controlled unit and if you're really controlling it

velvet kernel
#

so you want to check for ANY open display/dialog or a specific one?

warm hedge
#

Any

#

eg Camera, Spectator, etc

velvet kernel
#

because with display you can move still, with a dialog you cant

warm hedge
#

Doesn'tsqf findDisplay 46 createDisplay "RscDisplayEmpty"make you to control mouse?

velvet kernel
#

that would capture the mouse but not key input

warm hedge
#

True ๐Ÿค”

velvet kernel
#

if you createDialog "RscDisplayEmpty" then both are captured

#

the player cant move anymore

warm hedge
#

So hmm, let me sort everything out:

  1. I want a way to tell if the mouse click AKA defaultAction does the weapon fire before I fire the weapon
  2. There is no way to tell if
  • Camera is on
  • remoteControl is on (workaround exists but I don't want to use it)
  • Zeus or any other Display is on (getter for createDisplay)
  1. dialog exists but checking only that wouldn't fit the all cases
weary smelt
#

Anyone here knowledgeable or experienced with camera editing and PIP (picture in picture) / RTT (render To texture) in UIs - I have a question for you. Why is it that when I run cam cameraEffect ['internal', 'FRONT', 'M9_testRTT']; with the Zeus display open, it switches view to my player with Zeus still open? What I am trying to do is have a small feed that the zeus can monitor while setting up objectives. I have already added the ui elements but for some reason the moment I run that command above to create the RTT source, it messes up the zeus camera and also makes it so I can't open the player list. I did some research myself and found this warning about cameraEffect on the wiki: "One cannot mix and match cameraEffect and can either have multiple r2t (rtt) cameras or a single camera for the whole screen." Does this mean that since zeus uses a full screen camera, I can't overlay an rtt ctrl on the zeus display?

little raptor
weary smelt
# little raptor yes that's what the wiki means

I managed to semi-work around the issues by using switchCamera. I can now control zeus and have the overlay, BUT the FOV is locked at like 120 degress. I tried using curatorCamera camSetFOV 0.7; curatorCamera camCommit 0; but it had no effect. This is the biggest issue, since I was able to get the player list working.

#

I'm just wondering if you have any ideas on how I could fix the FOV but if this is a dead end let me know.

little raptor
#

dunno

vapid scarab
#

is there a way to create a custom item and object inside of a mission file?

granite sky
#

I don't think so. Missions can only change mission config, and none of the creation functions look in there.

south swan
#

well, you can shove a .p3d into a mission and createSimpleObject it to have a mission-specific object in the world... but no inventory items and no simulated objects i know about

pale glacier
#

Hi!
Is there a way to disable the dust effect created by a helicopter with engine on on ground?
I tried this, no go

this setParticleParams [["", "", []]];
fair drum
#

DustEffects config, but you are going to be creating a mod

pale glacier
#

Ha, so no "easy" way of doing it..don't want to actually disable it, just for a short video

#

Thanks anyway ๐Ÿ‘

indigo wolf
#

or does it only work on NPC which are turned invisible

fair drum
indigo wolf
#

thats interesting

fair drum
#

you can get pretty silly with it.

parent: littlebird (hidden)
child: MRAP (hidden)
child of child: lightSource creation

attach the mrap to the littlebird then attach lightsource to the mrap. if you attach the light directly to the littlebird, even though the littlebird is hidden, you will still see the shadow of the cockpit, but it doesn't happen if you use the MRAP as the attachment point

indigo wolf
#

thats pretty wild thanks for the info ill have to try it out

fair drum
#

now with light source modifications, you can make a flying/floating navi from zelda or whatever you want

indigo wolf
#

this also means you can technically launch rockets

fair drum
#

correct

#

i have a mission around here somewhere. let me see if i still have it. i might have deleted it. it was a holloween special that featured an attacking flying demon boss battle

indigo wolf
#

that'd be great if you still have it around

#

speaking of attaching objects, is there an easier way to attach a bunch of objects to a parent rather than individually selecting each and attaching it?

#

its just time consuming ๐Ÿ˜…

fair drum
#

eh looks like it was lost to the void. I'm sure its out there on someone's computer but I've helped out with so many communities idk where to start lol.

#

yeah, you create an array of children and their attachpoints, then you attach them all with an apply or forEach

indigo wolf
#

what do you mean by attach points?

fair drum
#
[
    // object | offset
    [obj_1, [1,2,3]],
    [obj_2, [4,5,6]],
    [obj_3, [7,8,9]]
] apply {
    _x params ["_obj", "_offset"];

    _obj attachTo [obj_parent, _offset];
};

external in a file/function

indigo wolf
#

oh and another question (sorry for the dumb one) would hiding model also disable the effect?

fair drum
#

effect of what

indigo wolf
#

like if I attach an invisible car and it drives would it produce the dirt / smoke from the terrain?

fair drum
#

haven't tested cars, but heli's yes. also if hiding a flying object with a pilot, it will disable the vehicle. you need to use unitcapture/play and don't use any crew and have it fly around invisble by itself

acoustic yew
#

Hello sorry for interjecting, may I ask how do I reference the disabledAi in my script (for playableUnits)?

fair drum
#

start with what you want accomplish first, not enough info

acoustic yew
#

I have a few playableUnits that needs to be disabled (so they wont spawn unless players are on that role) and I made a script that disables the slots for unauthorised players so now if the playableUnits are not spawned and are disabledAi it will throw an error, any help?

warm hedge
#

isNull?

fair drum
#

what you got so far

acoustic yew
#

here is my script :)

// Unit names
private _uid_SL1 = getPlayerUID SL_1;
private _uid_SL2 = getPlayerUID SL_2;
private _uid_RTO_1 = getPlayerUID RTO_1;
private _uid_RTO_2 = getPlayerUID RTO_2;

// Unused SteamID 
private _allowedUID_Unused = ["76561198350976093"]; // J.Powell

// Allowed Slots 
private _allowedUID_SL1 = ["76561198105370015", "76561198846755720"]; // SgtDevRupesh, HaddenHD
private _allowedUID_SL2 = ["76561198105370015", "76561198846755720"]; // SgtDevRupesh, HaddenHD
private _allowedUID_RTO_1 = ["76561198105370015", "76561198846755720"]; // SgtDevRupesh, HaddenHD
private _allowedUID_RTO_2 = ["76561198350976093"]; // (test SDR not included)SgtDevRupesh, HaddenHD

// for SL_1
if ((isPlayer SL_1) and (_uid_SL1 in _allowedUID_SL1)) then {
    // if allowed
    sleep 10;
    hint "Welcome";
} else {
    // if not allowed
    sleep 1;
    serverCommand Format["#exec kick %1", name SL_1];
    // hint "Restricted slot!";
};

// for SL_2
if ((isPlayer SL_2) and (_uid_SL1 in _allowedUID_SL2)) then {
    // if allowed
    sleep 10;
    hint "Welcome";
} else {
    // if not allowed
    sleep 1;
    serverCommand Format["#exec kick %1", name SL_2];
    // hint "Restricted slot!";
};

// for RTO_1
if ((isPlayer RTO_1) and (_uid_RTO_1 in _allowedUID_RTO_1)) then {
    // if allowed
    sleep 10;
    hint "Welcome";
} else {
    // if not allowed
    sleep 1;
    serverCommand Format["#exec kick %1", name RTO_1];
    // hint "Restricted slot!";
};

// for RTO_2
if ((isPlayer RTO_2) and (_uid_RTO_2 in _allowedUID_RTO_2)) then {
    // if allowed
    sleep 10;
    hint "Welcome";
} else {
    // if not allowed
    sleep 1;
    hint "Unauthorised slot!";
    sleep 1;
    serverCommand Format["#exec kick %1", name RTO_2];
    // hint "Restricted slot!";
};```
#

now if Im the only player in the server and those other playable slots are disabledAI = 1 in description.ext then I would get this error saying "undefnied variable in expression".

warm hedge
#

Then isNil

acoustic yew
#

hmm

#

Lemme check how I will use isNil :D

#

btw what does params do?

warm hedge
#

params?

acoustic yew
#

ye

warm hedge
#

I see no params there

acoustic yew
#

I read documentation about it and was confused cuz a lot of mods and scripts uses params

fair drum
#
params ["_apple", "_egg"];

//same as

private _apple = _this select 0;
private _egg = _this select 1;
acoustic yew
acoustic yew
warm hedge
#

More faster, more options

acoustic yew
#

as in processing?

warm hedge
#

And more easier

fair drum
#
[5, 2] call {
  params ["_int", "_multi"];

  _int * _multi
};

// returns 10
acoustic yew
#

ah

#

I see

#

Tysm for this explanation, helping me with the issue and again sorry for the trouble ^^

acoustic yew
#

server ig?

#

maybe global...

#

idk

fair drum
#

like in a init field? in a script file? in init.sqf?

acoustic yew
#

ah it has its own file but its executed through initPlayerServer.sqf

warm hedge
#
params [
    ["_apple",obj_apple,[objNull]]
];

//same as

private _apple = if (isNil (_this#0) and {(_this#0) isEqualType objNull and isNull (_this#0)}) then {
    obj_apple
} else {
  _this#0
};```Another params example
acoustic yew
#

Lol tysm I will add all this to my github so I can reference in future ^^

#

btw initPlayerServer will run everything in it everytime a player joins?

#

or once a player join

#

tho I am using onPlayerConnected

#
onPlayerConnected "[_id, _name] execVM 'checkSlot.sqf';
";```
#

I hope this will work

if (isNil SL_1) then {
    private _uid_SL1 = getPlayerUID SL_1; // UnitNames
    private _allowedUID_SL1 = ["76561198105370015", "76561198846755720"]; // SgtDevRupesh, HaddenHD (SteamIDs)

    // for SL_1
    if ((isPlayer SL_1) and (_uid_SL1 in _allowedUID_SL1)) then {
        // if allowed
        sleep 10;
        hint "Welcome";
    } else {
        // if not allowed
        sleep 1;
        serverCommand Format["#exec kick %1", name SL_1];
        // hint "Restricted slot!";
    };
};```
winter rose
#

isNil takes a string
"SL1"

acoustic yew
#

Null takes an object?

winter rose
#

yes

warm hedge
#

isNull does, isNil doesn't

winter rose
#

also, if not isNil

warm hedge
#

Do you know what is the difference between Null and Nil?

acoustic yew
acoustic yew
warm hedge
#

No, the entire idea of Null and Nil

acoustic yew
#

took me a while to realise there are 2

acoustic yew
#

I know

#

if it doesnt exist

warm hedge
#

No

acoustic yew
#

checks if something exists

#

oh

granite sky
#

nil means the variable doesn't exist.

warm hedge
#

Nil = completely non-existent variable
Null = the data has the data type, but no usable info

acoustic yew
#

yeah rn im checking object so isNull

granite sky
#

nulls are typed, so there are a load of different ones. objNull, scriptNull, grpNull etc.

#

isNull detects them all though.

acoustic yew
#

:0

#

wait so if I use objNull will it work?

#

tho Im checking variable = object so ig isNull is best thing here

granite sky
#

isNull is generally the correct approach.

acoustic yew
#

okay ^^ lemme take screenshot of this chat and save in github lol

warm hedge
#

And this convo makes me to realize I don't know how it behaves when the player object doesn't exist per disabledAI = 1;

#

I mean terms of variable

acoustic yew
#

oof testing is the only way to know ig

granite sky
#

Editor-assigned variable?

warm hedge
#

Yeah

acoustic yew
# winter rose also, if _not_ isNil
if (isNull SL_1) then {} else {
    // 
    private _uid_SL1 = getPlayerUID SL_1; // UnitNames
    private _allowedUID_SL1 = ["76561198105370015", "76561198846755720"]; // SgtDevRupesh, HaddenHD (SteamIDs)

    // for SL_1
    if ((isPlayer SL_1) and (_uid_SL1 in _allowedUID_SL1)) then {
        // if allowed
        sleep 10;
        hint "Welcome";
    } else {
        // if not allowed
        sleep 1;
        serverCommand Format["#exec kick %1", name SL_1];
        // hint "Restricted slot!";
    };
};```
hope this will work
granite sky
#

Yeah not sure. I try to avoid those :P

acoustic yew
#

I see

#

Well I am experimenting XD

winter rose
acoustic yew
#

wow that's fancy

fair drum
# acoustic yew wow that's fancy

here is a very compact way of doing the same thing:

// initPlayerLocal.sqf

[] spawn {
    scriptName "Unit Authorization Script";

    private _allowedUIDs = [
        ["SL_1", ["76561198105370015", "76561198846755720"]],
        ["SL_2", ["76561198105370015", "76561198846755720"]],
        ["RTO_1", ["76561198105370015", "76561198846755720"]],
        ["RTO_2", ["76561198350976093"]]
    ];

    private _index = (_allowedUIDs apply {_x select 0}) find vehicleVarName player;
    /* keep in mind, find is case sensitive so the SL_1 in above needs to be exactly how it is in the editor, for example */
    if (_index == -1) exitWith {};

    private _accepted = (
        getPlayerUID player in (_allowedUIDs select _index select 1)
    );

    if (_accepted) then {
        sleep 10;
        hint "Welcome";
    } else {
        sleep 1;
        hint "Unauthorised slot!";
        sleep 1;
        ["myPassword", format ["#kick %1", name player]] remoteExec ["serverCommand", 2];
    };
};
acoustic yew
#

means a lot!!

#

TYSM

fair drum
#

you don't need any of the extra onplayerconnected based stuff, just use initplayerlocal.sqf

acoustic yew
#

alr ^^

granite sky
#

Arbitrary clients can kick themselves with serverCommand?

fair drum
#

i think he just needs to add the password argument

#

ah thats a server only syntax. one sec...

acoustic yew
#

You fixed a bunch of my broken code ๐Ÿ˜…
tysm :)

#

Btw why spawn is different from normal? (normal = writing code without spawn in this case?).

fair drum
#

cause I want it to run independently of whatever else is in the initPlayerLocal.sqf

acoustic yew
#

:0

#

okay

fair drum
#

and so it terminates itself if the index is -1, instead of terminating all of initPlayerLocal.sqf

finite bone
#

Is there a way to get the rotation of an object? (Yaw, Pitch, Roll) to hardcode it / set it later using BIS_fnc_setObjectRotation?

fair drum
finite bone
#

It seems to not maintain the right slope i want it to be

#

Basically, im trying to create a ramp by tilting the object in the 3DEN Editor, noting its rotational values and replicating it to its exact precision

fair drum
#

oh then you want to use attributes

#

using set3DENAttribute

#

if you are staying inside of the editor

finite bone
#

Its for outside the editor once I note the values in the editor

#

Like I get the readings from the eden editor, go into the server, create the object with the values from the eden editor (includig yaw, pitch and roll)

granite sky
#

vectorUp & vectorDir to read, then setVectorDirAndUp.

finite bone
#

I might have messed up somewhere then - Ill try again with vectorUp, vectorDir and setVectorDirAndUp. Thanks! ๐Ÿ‘๐Ÿป

granite sky
#

You want to be careful with setPosXXX because they often reset orientation.

#

best bet for exact placement is getPosWorld/setPosWorld, then do the setVectorDirAndUp afterwards.

finite bone
#

Ah so setPosASL maybe the culprit here then ill try it out thanks

zenith stump
#

Once i host a server and fire up the map, the game downloads all the necessary scripts from the mission folder to players right? I don't have to manually give those to them right?

sullen sigil
#

yes

#

you are right

zenith stump
#

I see. Then there is another reason for why the script is not loading for players. Time to troubleshoot.

warm hedge
#

It maybe easier to share the script here if you don't mind

zenith stump
#

Well, it's not my script. It's the simple shop script I found online. It has tons of different things to go through.

#

This one

molten yacht
#

Can manual respawns be disabled mid-mission?

polar belfry
#

what must I put on the trigger to start it the moment the mission starts

finite bone
#

(sorry for ping)

south swan
#

is there any specific reason to not use BIS_fnc_attachToRelative (or whatever that's called)?

#

and precise positioning and rotation in arma is funky thing

#

rotating and then moving may help

finite bone
#

I tried the other way too - setting vectors and then setposworld - still the same result

#

the objects are offset by 5 - 10 meters compared to its initial position

finite bone
#

it actually works wow

#

thanks

south swan
#

also, i'm not really sure about using PosWorld for attached stuff. I am under impression that model coordinates should be used in that case

finite bone
#

Both biki and John adviced on using it ๐Ÿ˜