#arma3_scripting

1 messages ยท Page 570 of 1

coral owl
#

I will tomorrow, I wasn't expecting a fast reply and wanted to leave this question for the night eheh, after trying everything so far ๐Ÿ™‚

#

can't believe I did not think of checking logging=1

still forum
#

no

#

no

#

operator precedence

#

what you wrote will run like this:
(diag_log _drawUp) vectorMultiply -1;

coral owl
#

will do, thanks!

still forum
#

I meant more like
diag_log ["_drawDown", _drawDown];
so you still know in log which is which

coral owl
#

yes, and so on and so forth for the others

#

those are the problematic ones, the ones where I would set the offset for the above line and below line.. the middle one works

#

ok will test tomorrow, hopefully I get out of this alive eheh, the rest kinda works so far

#

thanks again!

serene robin
#

Hey folks. Im currently working on trying to get a rifle to take on a launcher slot. I have it on my back in the launcher slot, but I am not able to switch to it or shoot it. Any thoughts?

oblique arrow
#

Hm any chance that anyone knows if theres a way to check if a player is currently being flashbanged by an rhs flashbang?

gloomy aspen
#

Hey guys, im hoping to make an effect inside CUP's static C-130 where a trigger activates cam shake to make the feel more realistic

At the moment ive got a trigger set inside the plane (any player, present) with the following

condition : this

OnActivation :
enableCamShake true;
addCamShake [1, 99999, 25];

OnDeactivation :
resetCamShake;

At the moment the camera continues to shake even once you have left the trigger area? Any suggestions?

oblique arrow
#

Only post the question in one chat please blep @gloomy aspen

gloomy aspen
#

Sorry, wasnt sure which one was the right place ... My apologies ๐Ÿ˜Ÿ

oblique arrow
#

No worries, just delete it in the other chat

velvet kernel
#

so im calculating the distance from the center of a square to the border for a random angle

#
#define mapSize 15360

local _angle = random 360;
local _halfMapSize = mapSize / 2;
local _center = [_halfMapSize, _halfMapSize, 0];
local _n = Vector_FromDir(_angle);
private "_centerToBorder";
if (_angle in [0, 90, 180, 270]) then {
  _centerToBorder = _halfMapSize;
} else {
  _centerToBorder = abs (_halfMapSize / cos _angle) min abs (_halfMapSize / sin _angle);
};
#

im catching the special cases where either sin or cos can get zero (to avoid division by zero) seperately

#

however this still throws me division by zero errors every now and then

bright flume
#

throw in a try to catch the occasional div0 and let it pass your vars so you know whats going on at that point?

#

other possiblity is 0 == 360 in terms of rotation. 'maybe' your random 360 is actually picking up a 0 in there?

queen cargo
#

Sqf try catch will not catch Script errors

bright flume
#

yeah sorry too much cross language bleed thru. hmmm well likely Im guessing its the random or _angle in [...] what is the max decimal length that is tracked for this stuff?

errant jasper
#

@velvet kernel Not sure why that happens. But you don't need to resort to trigonometry to solve this:

private _outside = _center getPos [mapSize * 2, random 360];
private _borderX = 0 max (mapSize min (_outside select 0));
private _borderY = 0 max (mapSize min (_outside select 1));
private _centerToBorder = _center distance [_borderX, _borderY, 0];```
velvet kernel
#

what you are doing is for arma 3, im on arma 2

errant jasper
#

Ahh okay... But I think the only issue with that is you do not have the getPos variant.. AFAIK everything else is permissible (of course the private would have to use the command before instead).

#

So something like this (unless I missed another command)

private ["_halfMapSize", "_center", "_angle", "_outsideX", "_outsideY", "_borderX", "_borderY", "_centerToBorder"];
_halfMapSize = mapSize / 2;
_center = [_halfMapSize, _halfMapSize, 0];
_angle = random 360;
_outsideX = (_center select 0) + (sin _angle * mapSize * 2);
_outsideY = (_center select 1) + (cos _angle * mapSize * 2);
_borderX = 0 max (mapSize min _outsideX);
_borderY = 0 max (mapSize min _outsideY);
_centerToBorder = _center distance [_borderX, _borderY, 0];```
velvet kernel
#

i can just round _angle to int to avoid numbers close to 0, 90, 180, 270

finite sail
#

hey @still forum , you remember yesterday I was banging on about buildings and objects that werent taking damage?

#

it turns out, a lot of things that aren't tanks don't take damage from APFSDS.. the round just flies straight through

coral owl
#

oh o/ @finite sail hallow

finite sail
#

hi reezo!

#

once i switched to any HE round, jon done. the geodesic domes at teros fell

bright flume
#

ah AP round...

finite sail
#

its always fun when something you think is a bug actually turns out to be the engine doing its job way better than expected lol

#

yes, discard sabot round, to be exact

tough abyss
#

How do you execute scripts on the fly on a dedicated server? In headless I had a panel when I pressed escape

finite sail
#

if youre logged in, you can get the debug menu with escape

#

other than that, you need a debug/tools addon

tough abyss
#

So, I need a debug addon to get the debug menu?

finite sail
#

such as NSS or 7erra's editing extension

#

yes mate

tough abyss
#

is there no other way?

finite sail
#

is the server yours?

tough abyss
#

Yes but we cannot restart the server now

finite sail
#

why not?

tough abyss
#

Operation ongoing

#

I need to execute a script on the fly

#

I did it in headless without mods

#

I thought I could do it in there too

finite sail
#

can you log in as admin when you're playing?

tough abyss
#

yes

#

ofc

finite sail
#

and when you're logged in, does the escape menu have the debug tools?

tough abyss
#

It doesn't unfortunately

finite sail
#

ok, is the server running sig checking?

jovial whale
#

Hello. Could you tell me where to start, to create invisible anomalies on the stalker server. Where should I start?

oblique arrow
#

@tough abyss Do you have the achilles mod activated?

tough abyss
#

yes

oblique arrow
#

iirc achilles lets you execute code through a module

tough abyss
#

really? I'll check

oblique arrow
#

I think so

#

something with execute in the name I think

tough abyss
#

@finite sail No, there's no sig checking

finite sail
#

then you can install this on your client and execute scripts on the server

oblique arrow
#

Just checked and the module is called 'Execute Code Module' under 'Development Tools' @tough abyss

tough abyss
#

I checked it, it works great! Thank you!

oblique arrow
jovial whale
#

Can anyone please help me with scripting advice in arma 3?

oblique arrow
#

Btw remember to delete the question in #server_admins since crossposting is against the rules @tough abyss

#

Mmh I recommend asking the people on the stalker server, they propably know how their server works the best @jovial whale

jovial whale
#

The problem is that such servers are a closed community that does not share information about their scripts. I myself am a member of such a community and they do not give me any information about this.

#

For earlier, I apologize for bad English, not my native language.

#

And so I decided to learn scripting. As the saying goes, "Do you want to learn something, learn from the best." And everyone knows that the English-speaking community is still the leader in scripting for Arma.

#

And it became somehow very quiet

finite sail
#

i think it's more that these server owners don't share

#

and most chaps in here are not very surprised by that

jovial whale
#

I understand all this very well, and I do not ask you to provide me with ready-made scripts. I ask only to show where I should start and who can help me with advice. That's basically all that I would like to know.

finite sail
#

do you know that what you want to do is not trivial or simple

young current
finite sail
#

yep, it may not be a helpful answer, but it's the way to go

young current
#

For me killzonekid's tutorials were helpulf in getting started with scripting. From there I've just experimented a lot

finite sail
#

i didnt mean to suggest you are unhelpful, @young current , just that he needs to understand what he wants to do is probably reall hard

finite sail
#

heres the pages i open in my browser..

#

oh... tinys.. but thats a good starting place

#

fixed

jovial whale
young current
#

Not the channel but his site that had written tutorials. Not 100% sure if it's online anymore though.

jovial whale
#

I see.

young current
#

Seems like it is.

#

Now you will need to experiment with this stuff a lot to start u derstanding how different commands work alone and together.

jovial whale
#

ths

coral owl
#

@jovial whale It's quite a topic that can easily explode especially in my own hands, my way of writing and the misunderstanding of text-messaging. I'll just say I get what you mean and part of it is endemically natural to the environment and the resources involved in all this

#

Always try and be the least dependent on time-based resources, meaning answers from people, help from people, anything real time.. Use the internet and what is already written to go well beyond what anyone - even chained at a chair - would be able to give you because. in theory the best ones can help you a lot but in practice ain't anybody got time to carry weight, right

#

and by that I mean, a lot of things take priority for those "helpers". Even kids alone can be such higher priority. It's only natural we learn through what's materially available and inanimate, as it's 100% always there. End of my contribution.

finite sail
#

typed, then deleted a minor rant about lack of community spirit in newer server operators

#

generalisation, I know, but there ya go ๐Ÿ™‚

acoustic abyss
#

Cannot disagree with any of the above..

Artists steal, but you'll stay dependent if you don't grow up and make things from scratch.

On that note: I am trying to program an EventHandler that has probably been done many times before.

I want to execute code (some sort of punishment) whenever a player kills a friendly unit. This is what I came up with:

addMissionEventHandler ["EntityKilled", {
params ["_victim","_killer","_instigator"];
if (side _instigator != sideEnemy) then {
hint "you killed a friendly";
};
}];

However, this code will ALWAYS fire whenever an entity is killed, enemy or not. What am I missing?

finite sail
#

I think

#

because deads are always civilian

#

hang on, ive doen this before

#

Instead of the side command

#

oh wait

#

you wrote sideenemy, thats wrong

#

units are made sideenemy only after a teamkilling spree

acoustic abyss
#

Ohhh

finite sail
#

but tbh, i'd use the func i noted above

#

because of the 'deads being civ' issue too

acoustic abyss
#

Thanks. So I am reading your link:
" (i.e. not affected by dynamic changing like rating)"
Is that what you mean with dead units being civilian (and this function ignoring that) ?

finite sail
#

yes

acoustic abyss
#

Will try this. Brb

finite sail
#

gl

acoustic abyss
#

It works! I even managed to narrow it down to civilians! Thanks!

finite sail
#

๐Ÿ™‚

acoustic abyss
#

Here's the code for anybody who is enjoying a lazy Sunday:

#

addMissionEventHandler ["EntityKilled", {
params ["_victim","_killer","_instigator"];
if ([_victim, true] call BIS_fnc_objectSide == civilian) then {
hint "you killed a civilian!";
};
}];

finite sail
#

hehe

#

isequalto

#

rather than ==

#

slightly faster

#

if ([_victim, true] call BIS_fnc_objectSide in [civilian, playerSide]) then {
hint "you killed a freindly!";

#

NB, the above might not work properly on a DS.. playerSide probably doesn't work on a server

acoustic abyss
#

Senpai ๐Ÿ‘ฉโ€๐ŸŽ“ , I eh, not getting the example:

  • if ([_victim, true] call BIS_fnc_objectSide in [civilian, playerSide]) then { *
    The in [civilian, playerSide]) is part of the BIS_fnc_objectSide syntax?
finite sail
#

its the in array syntax.. more or less the same as result == a or b

#

result in [a,b]

acoustic abyss
#

Wait, what is producing this array ( Or, why are we writing out this array) ?

finite sail
#

you don't have to, i was just expanding your example

#

the code you posted ref lazy sunday is more than good enough

#

just replace the == with isequalto

acoustic abyss
#

Also for DS (dedicated server) ? It happens I am running my coop mission from there(!), so good you mention it.

finite sail
#

the golder rule is, players don't exist on DS

#

golden

acoustic abyss
#

Thank you ๐Ÿ‘ฉโ€๐ŸŽ“

finite sail
#

bear in mind that if your players do kill civs, more than 3 or 4, they will become sideenemy

#

and that's tricky, other players wont be able toget in their vehicles for example

#

civs will run away from sideenemy players too

acoustic abyss
#

lol. Well there aren't any friendly AI in the mission. So that's not so bad.
I am coding this to keep the mortar players on their toes.

finite sail
#

ah right, yes

#

wow, ive helped someone and dedmen hasn't come in saying "Tankuster, you're talking bollocks" and had to clear up my mess

#

im sure he's as chuffed as i am

#

never underestimate the ability of players to break your lovely mission

acoustic abyss
#

Also cannot argue with this. But that is why we agree that the mission author plays as a Zeus.

finite sail
#

good call

acoustic abyss
#

Back to my script: where's a good place to put the EventHandler? initPlayerLocal.sqf?

finite sail
#

no, that has to go on the server

#

its a missioneventhandler

#

so, init.sqf or initserver.sqf

#

ah yes, initserver.sqf is best

#

if you put it in init.sqf, it will run on clients unless you put it in a isServer block

#

Ive seen a Zeus go rogue, spawning predator sound fx behind players in dark jungles, and nearmissing them with lightning bolts

winter rose
#

you are using format, I don't understand why you would do this

if you do format ["%1", player] it will stringify it to bob if you named the player "bob" in the editor, or "Alpha 1:1" if you didn't

#

if you don't use call compile format, yes

coral owl
#

I am this close, thanks for confirming this the format idea yes

#

ha!

#

It's the call compile format that is a problem

#

how could I not see that lol I guess...

#

I would not like to give a name to vehicles that have no name as it could screw up missions where names are assigned later..

winter rose
#

good, because you don't have to

coral owl
#

I guess I don't really need call compile format indeed

#

it almost just created a lot of issues and this is a UI mod so no need - usually - to broadcast what the player sees on screen

#

and even then there will be ways to let some variables out in the public to have the headsets dialogue, but not a priority

#

nice, I will get rid of call compile as it's - also noticed - not something I do need

#

I am compileFinal the fnc_ you saw in the init, I don't think it matters whether it's call compile or not

#

yay ok be back later, @winter rose thanks a lot!

coral owl
#

Back from ๐Ÿšถโ€โ™€๏ธ๐Ÿšถโ€โ™‚๏ธ

#

@winter rose it seems not using a compile call format is even worse

#

I'll try with just format without call compile, but so far I am having the same issue.. units with no variable name cannot get the eventhandler

winter rose
#

use Code

#

ยฏ_(ใƒ„)_/ยฏ

#

<

coral owl
#

_unit comes from an array of NearEntities that is in another script.. basically it works perfectly AS LONG AS _unit has a variable name

#

(Disregard the various colors and things which I am experimenting on)

#

whether I use %1 or %2 (in case of %2 I gotta get the object name from the NetID) it all works - AS LONG AS - the _unit has a variable name.

Whenever they are something like "C Alpha 1-1" it all goes to sh.

winter rose
#

stop. with. your. call. compile. string.

#

everywhere

#

this is because Draw3D EH code is a new scope; you would have to reference a global array with your units inside it

#

and use a forEach

coral owl
#

but.. as you said..wrote..

#

Makes sense (and works) and is actually more efficient

winter rose
#
myGlobalArray = [player, otherUnit1, otherUnit2];

private _index = addMissionEventHandler ["Draw3D", {
  {
    // drawIcon3D _x stuff
  } forEach myGlobalArray;
}];
coral owl
#

nice, that was my second question which you already answered... "where to do the forEach". Inside the EH makes sense

#

I don't want ForEach many EHs.

winter rose
#

yes, one EH, multiple units (not the other way around)

#

the less "processes" the better

coral owl
#

fantastic. true true

#

I am gonna shoot it in notepad and report back in 1 sec. It is gonna work I can feel it lol

#

thanks and ๐ŸŒฎ to celebrate if it works

winter rose
#

if ๐Ÿ‘€

young current
#

do everyone get a ๐ŸŒฎ ?

coral owl
#

yes, it's a fish taco, got a truck nearby, hope it's ok

young current
#

Thats ok. theres just about 20k ppl on this channel.

#

the truck owners gonna love you

coral owl
#

sodas are on the other side, there's a small fridge with plenty of stuff

winter rose
coral owl
#

ouch I might have underestimated the capabilities of the taco truck

#

as usual prices on the internet are always log10(real price) just so we all feel more frustrated lol

young current
#

๐ŸŒฎ == ๐Ÿฐ == LIE ๐Ÿ˜ฟ

coral owl
#

Tacos for everyone! It works.

#

BUT... suspenceful music plays

#

no maybe no buts, hold on lol

coral owl
#

no buts, it workz

#

yay, thanks, I can ~~not ~~now focus on other ways to break everything lol

#

๐Ÿ๐Ÿƒ

winter rose
#

w00t w00t!

#

you can again do another global array and pushBack the display, if needed

#

it creates a _display for everyone in the forEach
wait, no

#

oh
well you can always add "if !(worldToScreen _x isEqualTo []) then"

#

you can still do all that, just have to change your code organisation

uncut sphinx
#

if I addPublicVariableEventHandler for JIP players sometime after they've initialized, will it still fire for publicVariables they received at init?

still forum
#

the eventhandler only fires if the variable was received after the handler was added

uncut sphinx
#

so in order to make it work for JIP, I need to make sure it is created at preInit?

#

for public vars received at JIP that is

still forum
#

ye

rustic plover
#

What is difference between $PBOPREFIX$ and $PREFIX$ files?

#

ACE use just $PREFIX$, but wiki has no information about it, only about $PBOPREFIX$

#

RHS uses it too

young current
#

its a thing big projects often use

#

it is not something that is absolutely required

#

for RHS and ACE they are particular for their automated build systems I believe

rustic plover
#

Oh, my mistake. Sry

exotic flax
#

compare with side, or check sideEnemy which checks if someone has a negative rating (too much TK's)

#

technically any .paa or .jpg should work

#

don't think there's a list of all images in Arma somewhere

#

getMissionPath could help to get the correct path to the mission ๐Ÿ˜‰

#

most images are in "/a3/ui_f" but it's all over the place, depending on what you need/want

young current
#

Root of the mission should pick up though?

plain vale
#

basically what i am looking for is an input in a player activated trigger, to join units into the players high command ability

#

basically player has control of unit A and B, walks to new area, get control of C

#

a friend recommended synchronizeObjectsAdd, and i have been playing with it but i dont know enough of what exactly i should be trying to sync up

#

like i assume its something like "sync (new units)--->highcom subordinate module" but i dont know how to phrase that really

alpine ledge
#

could you not just use hcSetGroup ?

plain vale
#

UH oh, i did not even know this was a thing

#

i will try this

violet gull
#

Anyone with Notepad++ happen to get an issue that resets the file's language, forcing you to Select All, click Language, and select SQF to set the file's language to SQF again?

young current
#

I dont think you have to select anything to set the language

#

but I dont think it remembers what language you set a file in

#

you have to set it to use certain language highlighting per file type

violet gull
#

I noticed that SQF isn't a language that can be selected as a default language either, wonder if that's part of the issue

#

File Association doesn't list SQF anywhere either

#

AND its not available in Style Configurator

exotic flax
#

since SQF isn't a language used by anything else than Arma and not well known in the programming world you'll need to install a custom API which can be downloaded here: http://www.armaholic.com/page.php?id=8680

violet gull
#

Yeah I've used that for years, but ever since a few months ago, I let Notepad++ apply an update which caused issues

#

#neverAgain

exotic flax
#

well, I've been using Atom for years now with working SQF support (which also requires a plugin to be installed)

violet gull
#

D:

young current
#

or you can set c++ syntax to be used for sqf etc arma files

violet gull
#

I think I found the problem

#

In settings, auto-completion, and then I set "Function completion" instead of "Function and word completion"

#

So far it feels like that fixed it

violet gull
#

Nope, didn't fix it

unique berry
#

Hello. I am a bit of a script kiddie (i.e. an idiot with some scripting experience, but it doesn't go far at all), and I've a question. I am trying to re-tex a Strider, and I want to add the Strider's texture into one of my scenarios and make it JIP friendly.

If I was to add the command setObjectTextureGlobal, there may be issues with JIP as far as I have read. What should be done in it's place? Should I name all Striders on the map with variables and write some .sqf or script in the init.sqf file that sets the Strider's texture?

bright flume
#

is there any kind of method to dump an objects settings that has been changed from default, like pos, rot, etc given so many objects have different settings hoping there something that allows us to check anything that isnt equal to anything inherited and defined by the objects class.

#

basically a compare of a parent with inheritences vs a child object?

winter rose
#

not really, what is the use case?

bright flume
#

anything... basically need to dump a complete setting for a object so I can spawn a whole layout of something via script with all flags, pos/rot all that set even init scripts etc.

#

ie. without a compare or dumpAllnonDefault fnc... not sure its possible given how many different types of objects there are

#

unless there a way I can spawn a composition with position and all that jazz aligned, but dealing with the root object makes me wanna use a spawner that will just by called by the editterrainobject init and use that as a root point to place it as I can get the buildings placement from that

#

unless Im just not able to find it, this would be simple if I could just output to an array a dump of an object of anything that is defined differently from the parent an object is created from.

#

good example that is 'almost but very lacking' would be Ares's save2sqf function if you familiar with it. problem is flags and code and such

winter rose
#

@bright flume if it is in 3den,you have compositions. If it is in mission you have scripted compositions.

bright flume
#

yeah my concern is a eden maybe if possible zeus? comp placing that photo into that specific building type 'easily'.

#

so I was leaning on script spawned. this way I can use the edit terrain object as a way to create a root point for spawning it

open vigil
#

@violet gull your profanity has been removed, please see #rules

visual quarry
violet gull
#

@Striker It should still work and I'm planning on updating it soon. People using ACE report it isn't compatible; I made it for my vanilla mission/server. The IEDs are actual mines, so if you are an explosive specialist with a toolkit, you should be able to disarm it like a mine. Just approach is via slow crawl to avoid triggering it.

cunning crown
visual quarry
#

I am doing that with a mine detector and toolkit but no action comes up at all, i have tried Explosive spec, Demolitions, EOD Tech from RHS, Mine Specialist. none of these have the option

winter rose
#

@visual quarry try in vanilla?

visual quarry
#

I shall try again

#

@winter rose @violet gull It does not work in Vanilla either, I also tried the example mission and it does not work in that either

bright flume
#

Anyone see why Im not seeing numbered text appear when iterating thru a list? drawIcon3D ["", [1,1,1,1], [(_x select 0),(_x select 1), ((_x select 2) + 1.0)] , 0, 0, 0, str _forEachIndex, 2, 1, "PuristaMedium"];

#

list being [[x,y,z],[..]] just a list of AGL coords

winter rose
bright flume
#

bah okay that explains why seeing EH's examples was hoping just to make a static # over each object spawned without having to go that far as its purely for testing

#

thanks Lou is there any other option given what I need?

winter rose
#

addMissionEventHandler "Draw3D" yes

#

see Examples for details

bright flume
#

ah okay so just ecapsulate it in the EH like the example place it just as in the iteration, thanks trying now

winter rose
#

do or do not - there is no try

bright flume
#

heh its only try when you do something and expect it to likely not work. ie. never count on it. and nope it dont like addMissionEventHandler ["Draw3D", { drawIcon3D ["", [1,1,1,1], [(_x select 0),(_x select 1), ((_x select 2) + 1.0)] , 0, 0, 0, (str _forEachIndex) , 2, 0.75, "PuristaMedium"]; }];

cunning crown
#

You don't have a forEach in there so you cannot use _forEachIndex

bright flume
#

yes I do its not listed.. again its an coord array as stated and stated Im iterating thru it

#

lemme just drop the whole block...

cunning crown
#

Yeah but no, the code in the EH is not aware of whats exists outside of it's brackets

bright flume
#

AH. okay that explains more.

#

but thats okay I can adjust cuz Im storing the array in a global

#

Thanks Heyoxe thought local's worked a bit different in a code 'block'

#

cuz the EH add is in the forEach..

cunning crown
#

You should put the forEach in the EH ^^

bright flume
#

I dont think a create vehicle in that would be pretty.

cunning crown
#

I meant for the icons

bright flume
#

createVehicle is in the forEach, so guess make a second one.

#
    systemChat str _x;
    createVehicle ["Sign_Arrow_F", _x, [], 0, "CAN_COLLIDE"];
    

    addMissionEventHandler ["Draw3D", {
        drawIcon3D ["", [1,1,1,1], [(_x select 0),(_x select 1), ((_x select 2) + 1.0)] , 0, 0, 0, (str _forEachIndex) , 2, 0.75, "PuristaMedium"];
    }];
    
} forEach (_this buildingPos -1); ```
#

thats what Im trying to do

#

okies it works for what I need still get a error but icons there so now I know what the positions are. thanks all for the help

visual quarry
#

@violet gull I fixed it it was another script the mission was running that was modifying the toolkit, my bad dude. Though in the new version have you thought about having a chance to fail the defusal? Maybe with a 10 second timer to run away?

bright flume
#

Okay here's the millon dollar quesiton is there a Eden version of drawIcon3D? as thats where I would prefer to be able to view it, maybe make this into a module expanding on the edit terrain object module

winter rose
#

you can run the code in Eden, now gib million $

bright flume
#

okies. I know the spawning part I can, doing that for the crater in livonia, wasnt sure about hover text. as there no building its referencing but okies thanks

tough abyss
#

any way to disable ai going prone only im playing on a partialy flooded map and the ai looks stupid going prone but i dont want to lock them only to crouch or standing stance

bright flume
#

try #arma3_ai sounds more like a FSM edit if there isnt a check to see if an AI has UW gear on, shouldnt go prone in water above (x) ?

warm iris
#

On arsenal exporting is it possible to use setunittrait medic to assign a medic to such loadout when loaded?

winter rose
#

not that I know, nope

warm iris
#

damn, is there any way that the trait can be set outside of the unit init?

still forum
#

you can set it with any script anywhere

warm iris
#

So I could attach it to a box for example?

winter rose
#

you could use an action that setUnitTrait to the player using that action yes

warm iris
#

Mega

winter rose
#

โ€ฆDeth?

bright flume
#

...Destruction?

oblique arrow
#

Okay stupid question since I've never done anything with variables, if I wanted to know if a player is currently ace unconscious would this
_player getVariable ["ACE_isUnconscious", true]
return true when they player is unconscious or conscious?

#

I'm not sure if it should be true or false at the end

still forum
#

return true when they player is unconscious
variable is isUnconscious
true means "yes"
so if he is uncon, it returns yes/true

#

second value is just default if variable is undefined, it will rarely be undefined, if ever. But "false" as default might be more sensible

oblique arrow
#

Ahh okay thanks for the explanation, and

second value is just default if variable is undefined, it will rarely be undefined, if ever. But "false" as default might be more sensible
So if ace wasnt installed at all it would in that case I posted return true anyways?

winter rose
#

yes

oblique arrow
#

Oky thanks bongocat

shadow sapphire
#

Does anyone know of a relatively simple way to get high command to be given to whichever player is a group leader?

#

Alternatively, it could just be any radio command menu option that a player could use to take command of any allied AI groups. Whatever is the easiest way to have drop in, drop out, JIP high command.

oblique arrow
#

Okay I have another question, I have

if (WHA_NAMETAGS_MOD_ACE && _player getVariable ["ACE_isUnconscious", false]) 
then {exitWith{};};

and its giving me a 'Missing ;' error at the second line of that but I cant see where its missing and its propably something really stupid

distant oyster
#
if (WHA_NAMETAGS_MOD_ACE && _player getVariable ["ACE_isUnconscious", false]) 
exitWith {};
winter rose
#

@oblique arrow ^

oblique arrow
#

Yep seen it, testing it at the moment

#

roohappy It works the way I want it to, thanks @distant oyster

distant oyster
#

np

warm iris
#

Weird thing, player addaction gets removed when the player dies, how do I avoid this?

worn forge
#

@warm iris actually - it doesn't - what's happening is the game is spawning a new unit and putting the player in it, so the action is attached to the previous "body". If there's a corpse lying around, depending on the condition you've set up, you'll still have access to the action

warm iris
#

So whats happening, is the unit dies, body despawns on death, but the action is no longer in the scroll menu for the player

worn forge
#

Well body doesn't necessarily despawn on death, but that's beside the point for your problem ๐Ÿ™‚

#

Set up your actions in onPlayerRespawn.sqf

warm iris
#

So the addaction should exist in onPlayerRespawn?

worn forge
#

That depends on whether your mission uses it

#

In description.ext the flag respawnOnStart determines whether the onPlayerRespawn.sqf script gets called as well as whether the player is considered to have respawned)

#

Sounds like you'll want to use case 0 where the player isn't considered to have respawned, but you'll run the onPlayerRespawn script anyway

oblique arrow
#

Hey any chance anyone can point me in the direction of the right way to check if a unit is an actual player or a headless client/virtual unit (game master as an example)

cunning crown
#

hasInterface iirc

worn forge
#

(!hasInterface && !isDedicated)

oblique arrow
#

hm oki thanks

velvet kernel
#

how often can you use setParticleParams on a smoke for updating it? because for me it despawns after calling it twice

#

arma 2 btw

winter rose
#

it should be "as much as you want" @velvet kernel

velvet kernel
#

thats what i thought

#

is there a parameter that sets the duration the smoking is "smoking" for

#

because i might have gotten that one wrong, but i checked for at least 30 mins with the wiki and i think i got it right

winter rose
#

I suppose you only delete the particleSource

#

you can set for how long the smoke drop will "live", but not for how long the source will emit iirc

velvet kernel
#

hmm because im not deleting it

#

but it stops smoking

winter rose
#

we might need to see your codeโ€ฆ

#

also, be sure to code with the -showScriptErrors flag

velvet kernel
#
  local _heli = _this select 0;
  local _heliPos = getPos _heli;

  _smoke = "#particlesource" createVehicleLocal _heliPos;
  _smoke setDropInterval (0.015);

  local _smokeLevel = _heli getVariable "smokeLevel";

  private ["_lifetime", "_color", "_scale", "_moveVelocity"];
  switch (_smokeLevel) do {
    case 1: {
      _lifetime = 1;
      _moveVelocity = 0.25;
      _scale = [1, 3, 5];
      _color = [
        [0.2, 0.2, 0.2, 0.6],
        [0.4, 0.4, 0.4, 0.5],
        [0.7, 0.7, 0.7, 0]
      ]
    };
    case 2: {
      _lifetime = 4;
      _moveVelocity = 0.5;
      _scale = [2, 6, 10];
      _color = [
        [0.15, 0.15, 0.15, 0.7],
        [0.3, 0.3, 0.3, 0.4],
        [0.6, 0.6, 0.6, 0]
      ]
    };
    case 3: {
      _lifetime = 7;
      _moveVelocity = 1;
      _scale = [4, 12, 20];
      _color = [
        [0.1, 0.1, 0.1, 0.8],
        [0.25, 0.25, 0.25, 0.5],
        [0.5, 0.5, 0.5, 0]
      ]
    };
  };

  local _attachToOffset = [0, 0, 0];
  _smoke setParticleParams [
    ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48],  // File, Ntieth, Index, Count, Loop
    "",  // Animation
    "Billboard",  // Type
    1,  // TimerPer
    _lifetime,  // Lifetime
    _attachToOffset,  // Position
    [0, 0, _moveVelocity],
    0, 0.05, 0.04, 0.05,  // rotationVel, weight, volume, rubbing
    _scale,
    _color,
    [0.125],  // AnimSpeed
    1,  // RandDirPeriod
    0, // RandDirIntensity
    "", "",  // Scrips
    _heli  // Follow
  ];

  _smoke setParticleRandom [2, [0.5, 0.5, 0], [0.2, 0.2, 0], 0, 0.3, [0, 0, 0, 0.1], 0, 0];
#

the script is much longer, tried to only copy out the important parts

#

basically there is a variable "smokeLevel" attached to a heli, and the server calls this script on every client once that changes

winter rose
#

so everytime, you create another smoke emitterโ€ฆ?

velvet kernel
#

no i can try this in singleplayer too

#

just create a smoke attached to a vehicle

#

with the params i posted

#

and it stops smoking after about 1-2 minutes

#

not even calling setParticleParams again

winter rose
#

so if I go to Arma 2 editor, run this code, it will stop after 60-120s ?

velvet kernel
#

correct

winter rose
#

A2, A2OA?

velvet kernel
#

OA

winter rose
#

both?

#

ok

velvet kernel
#

the way i understood this is that the smoke never stops, unless you delete the object

winter rose
#

from what I know, yep

velvet kernel
#

hmmm

winter rose
#

OA makes my PC buggy, interestingโ€ฆ

#

ok, it is smokingโ€ฆ

velvet kernel
#

ok another find i just made, it appears that it only stops smoking if the vehicle it is attached to is moving

winter rose
#

so e.g a driving car?

velvet kernel
#

im trying with helicopters

#

i can give you a minimal working script if you want to test

winter rose
#

please

#

no issue on my side.

velvet kernel
#

it only happens if the vehicle is moving

#

otherwise it stays forever

winter rose
#

negative, it follows my vehicle

#

the code bit you posted earlier at least.

velvet kernel
#

for 1-2 minutes yes

#

one sec ill give you a gist

winter rose
#

I got the "no smoke" thing

velvet kernel
#

hmmm

winter rose
#

but I do think it's because the helicopter is leaving the map area.

velvet kernel
#

no in the full version of the script it picks waypoints that are only inside the map area

#

and it happens there too

#

you can try by adding more waypoints inside

#

yep just tried again, it happens without ever leaving the map area too

#

could this be something to do with garbage collection

winter rose
#

it should not be active by default in A2OA

#

indeed still in the map; going deeperโ€ฆ

#

the object is still here, not deletedโ€ฆ

velvet kernel
#

i think it has to do with the distance from the position of which it was created

winter rose
#

that's an interesting one indeed

velvet kernel
#

because if i dont add any waypoints and the heli just hovers it does not disappear

winter rose
#

where it was "attached" I think

velvet kernel
#

yes

#

you can test this very easy

#

set yourself in heli

#

and teleport away

#

and its instantly gone

winter rose
#

I just noticed, helicopter distance smokeSource is increasing

#

you didn't attach the smoke source to the helicopter?

#

set the origin to [0,0,0] and attach the smoke source to the helicopter, shouldn't be any more of an issue ๐Ÿ˜‰

velvet kernel
#

oh

#

oh my god you are right

winter rose
#

of course!

velvet kernel
#

thank you so much

winter rose
#

;-p
you're welcome, that was a fun one ๐Ÿ˜‰

velvet kernel
#

wow i didnt even think of that

rustic plover
#

Guys, who know how convert vectors dir and up to [x,y,z] rotation format?

queen cargo
#

the easy answer? math

#

there might also be some operator for that already

#

but ... not sure about that one

rustic plover
#

Oh... love math. I searching for function which can transform :D

burnt cobalt
#

hi guys - I am trying to return if the primaryweapon's pointer-slot of a unit has a flashlight, IR-Pointer or even a switchable attachment with both equipped. Does anybody know how these are distinguished? I can't find any clear differences in CfgWeapons except the _generalMacro entry. And for the RHS-attachments that have pointer and flashlight, that will always be 'acc_pointer_ir`

rustic plover
#

Oh, no. I asked for wrong thing... Sry, I found solution:

  1. set vectors to object
  2. get directions from object
    :D
winter rose
uncut sphinx
#

Are there any best practices for what functions should be defined on server vs what should be global? I'm putting everything in CfgFunctions right now, is that the "correct way"? Does it even matter for an 8-man coop?

cunning crown
#

It probably doesn't matter for an 8-man coop.

#

For what goes on the server only vs everyone, if the client use it --> everyone, if not --> server only. And that's rarely needed

uncut sphinx
#

Yeah, that I do know. I register everything in CfgFunctions though, so it's available everywhere even though clients don't use much of it. I was wondering if this is a bad habit and what implications there are besides using slightly more memory than necessary

cunning crown
#

Not really, it only matters (and even at that point I'm not sure how effective it is) for big missions/framework/servers, like KoTH, L*ife and so on. But it goes far beyond does the client uses it or not

burnt cobalt
#

thank you @winter rose ! I also found this for addon attachments (hate how i seek for ages and then when i finally ask it falls in my lap) ```sqf
getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "FlashLight" >> "intensity") != 0 //-- Item is flashlight
getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "Pointer" >> "irDistance") != 0 //-- Item is Laser Pointer

winter rose
#

@cunning crown L*fe

cunning crown
#

Oops, I did it again ๐ŸŽต

sacred slate
#

hello, on mp, how do i make all friendly units playable via unit switch? i have set respawn = 5; . i was able to enable the switch window via enableTeamSwitch true; .

winter rose
#

that's it

#

press U and you're good

sacred slate
#

ye but there are no units in the list, @winter rose

#

i need some how to addSwitchableUnit "all friendly"

winter rose
#

oh, you need to set the units as "playable" in Eden @sacred slate

sacred slate
#

well yeah. i got some sp missions i can only start in mp, cause they are designed that way. in a older sp equivalent you could easy switch, noch i play it in lan, and its all gone ๐Ÿ˜„

winter rose
#

so double-click -> playable (under the "player" checkbox)

vernal venture
#

So, using setpos to spawn players in the sky makes them fall in the standing animation, unable to move. Any idea how to fix it?

sacred slate
#

double click where?

#

i cant touch it in eden

winter rose
#

Why not?

sacred slate
#

good question

winter rose
#

oh, so not your mission. how could you edit Description.ext then?

sacred slate
#

i did all via console

#

maybe i cant set the respawn mit game ๐Ÿ˜

winter rose
#

Can't indeed.

uncut sphinx
#

Does that also mean respawn can't be set from CfgParams?

high marsh
#

Yes it can.

#

setPlayerRespawn as a command exists as well.

#

I believe the confusion was between setPlayableUnit and addSwitchableUnit which I believe the unit switching menu only exists in SP to move between AI after you have died.

#

using selectPlayer might be a effective solution tho.

#

Still would need existing playable units to match the player count.

vernal venture
#

So, I put setpos in onPlayerRespawn.sqf, but it doesn't trigger in multiplayer when players are allowed to choose their spawn location. Any alternatives?

high marsh
#

Can u post the code.

vernal venture
#
_pos = getPos player;
player setPos [_pos select 0, _pos select 1, 2000];```
#

That's the whole code

#

If I put it in initPlayerLocal it works, but then the player is stuck in the standing animation until popping the parachute

#

Should be a simple thing, but it's driving ne nuts

uncut sphinx
#

setPlayerRespawn as a command exists as well.
@high marsh
I don't see such a command in the biki

#

there's one for player respawn time

high marsh
#

*time

uncut sphinx
#

ah, I was hoping there was some straightforward way to select respawn templates

#

from outside description.ext

high marsh
#

Switching them during runtime?

uncut sphinx
#

well just setting them at init

#

i.e. reading CfgParams

high marsh
#

@vernal venture Thats because the script is waiting for respawn. initPlayerLocal will initialize with player.

uncut sphinx
#

this is just me musing though, I haven't dug too deeply into this

high marsh
#

Could always just initialize the UI manually.

uncut sphinx
#

yeah, I was hoping to avoid that ๐Ÿ˜’

high marsh
#

The dialog config has code to populate the loadouts and respawn points.

vernal venture
#

@high marsh Yeah. The script isn't working even after (re)spawning.
Initplayerlocal trips even before spawning, I had to add a sleep

somber garden
#

can anyone play

#

im new and need help

surreal peak
#

@havok716 whats wrong?

#

Ah

sacred slate
#

why is this not working in devel console? Kelly setUnitPos "DOWN";

#

i dont get this.

#

_aiDude = Joseph;
_aiDude playAction "Salute"

#

dosn't work.

#

but

#

_aiDude = player;
_aiDude playAction "Salute"

#

do work.

#

i think its not my syntax fault

verbal saddle
#

It might be the ai's animation fsm causing issues

#

read this

bold kiln
#

In a userAction I'm trying to only allow the driver of a vehicle to see the option to use the userAction.
What would one use in this case?

sacred slate
#

thx

#

can i set disableAI stuff to the real player, and it will stay, when i switch units?

verbal saddle
#

DisableAI is object specific

#

So you would need to use it on both the player and the unit you are switching too

sacred slate
#

hm. i have a problem where lambs force move all units 1 meter ahead. it happens when i am switched to a other unit, without leader control switch. when i switch back to leader, it still happens. all units get moved ahead, with voice command. looks like disableAI "RADIOPROTOCOL"; wont help ๐Ÿ˜„ is there anything i can do?

still forum
#

you cannot sleep in a eventhandler

#

you need to wrap it in

still forum
#

doesn't moduleRespawnVehicle already take care of despawning the wreck?

winter rose
#

@soft niche no crossposting #rules (please delete here)

soft niche
#

SOrry, Deleted

winter rose
#

Thanks!

young current
#

yes if too many are used

#

not really. different things probably affect different amount

#

but if you are building like a city with editor objects that will poop on your shoes quite likely

#

also object density is a big thing

#

dont think so

#

missions are not meant for terrain building

#

not that high density terrains work much better either

#

it is quite delicate balance

#

if they are all in same area then possibly

steady galleon
#

is there a faster alternative to createVehicleCrew or bis_fnc_spawnvehicle

winter rose
#

faster?

steady galleon
#

Probably should just explain the premise... I'm spawning in a UAV with crew currently and noticed that when the script runs there's a hitch. When I remove the createVehicleCrew portion of the script, there's no hitch when it's called.

#

I tried the same with bis_fnc_spawnVehicle and there's still a small hitch when the script is called..

winter rose
#

hitch, as in stutter? well, one has to create AIs so the stutter will remain unless you create AIs first, then the vehicle, then AI in vehicle

but just the time to load the model itself would take a bit of time anyway

worn forge
#

I found when spawning in a bunch of units for a mission that hitching is usually a dead giveaway for the players, so much so I essentially re-created the BIS_fnc_spawnGroup function just to add some sleep statements to it, evens out the stutter

steady galleon
#

Gotcha. So it's just going to be one of those things then. If there'll be small stutter when the AI is created regardless, I'll have to live with it.

winter rose
#

irreducible cost I am afraid

#

though you could create a "pool" of AIs/drones and pick from it from time to time

#

disabling their simulation so they cost nothing in the meantime

steady galleon
#

Good idea, can try dealing with it on the missions init so it's done once and just use from that pool.

#

Alternatively, what I'm doing is spawning these drones to create a target for a Phalanx. If there's a way to force a Phalanx to target an empty vehicle, that would make this easier - but I haven't found a way to do that yet.

#

doFire, commandFire, and forceWeaponFire don't seem to work unless the vehicle is controlled by enemy AI.

winter rose
#

yeah no, forcing fire is not as easy as before now

#

maybe creating a laser target on itโ€ฆ

steady galleon
#

i'll try that. I was about to look and see if I can reuse the AI that is spawned in the drown in some way rather than creating and deleting it over and over. Thanks for the info!

sacred slate
#

i am not into scripting yet, but can some one translate this to remove all non friendly units from the unit switch window?

{
addSwitchableUnit _x;
} forEach (allUnits select {playerSide isEqualTo side _x});

worn forge
#

what side are your friendlies?

sacred slate
#

right now rhs usa. could it be possible to identify the own faction first?

#

while in the script is "playerside" some scenarios have it just pre made.

#

ha maybe i have to tweak some ace unit switch settings, with the script i wont need it anymore.

#

nope didn't fixed it. i disabled ace unitswitch, but in the scenario the list still explodes.

worn forge
#
{    addSwitchableUnit _x;
} forEach (allUnits select {side _x == west});```
#

assuming your rhs usa is side west

#

Oh wait ick

#

Better

sacred slate
#

thx! ๐Ÿ˜„

#

the thing is, in some missions i want this to make units playable, but how can i remove all non west units with that?

#

will take me a week to google this syntax :>

worn forge
#

Well right now what the code I've written does is it only adds units to be switchable if they are side west, so by its nature it is excluding all non-west units

cunning crown
#

Maybe this could work:

{
  addSwitchableUnit _x;
} forEach (allUnits select {side _x isEqualTo playerSide});
worn forge
#

That's exactly the same thing as he posted but you reversed it ๐Ÿ™‚

#

Though from what I see, I don't know why that wouldn't remove non-friendlies

sacred slate
#

cause the list is huge and i cant switch fast enough ๐Ÿ˜„

worn forge
#

I don't understand. What units are you seeing in your unit switch window? From this code, should only be units that are the same side as the player.

sacred slate
#

the hostiiles

#

*hostiles

cunning crown
#

And the friendly too or not?

sacred slate
#

they are there ye, but not in all scenarios

worn forge
#

how are the hostiles generated?

sacred slate
#

its a BECTI sp scenario

#

so quite hard to tell for me

worn forge
#

Ie., if someone is just spamming B_soldier_F and then re-costuming them and re-arming them, then they're gonna be considered western units

cunning crown
#

Removes all the units then adds the firendlies

{
  removeSwitchableUnit _x;
} forEach allUnits;
{
  addSwitchableUnit _x;
} forEach (allUnits select { (side _x) isEqualTo playerSide });
sacred slate
#

epic

#

lets try

#

ha that worked

#

so nice

#

thx!

#

will this break if there are no units to remove in the first place?

cunning crown
#

No, it shouldn't

sacred slate
#

is it possible to add hotkey binds to menu actions like "1 - 6 stop"?

#

some times i want to set stances quickly for single units. all i found has a menu where you first have to navigate. for all units at once i got stuff

worn forge
#

Check out C2 on steam workshop, command & control mod for AI

sacred slate
#

yeah i did. it will get a update soonish i hope. but its too clunky for my taste

full tartan
#

okay super noob question id imagine but i have to scripts 1st will attach a vic ammo box to a flatbed(taken care of) the 2nd will

#

give the ammo box infinite ammo or resupply every say 10mins but i cant seam to get them to work together in the in field

#

this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}] vicammo1 attachto [flatbed1,[0,-3.5,0]]

winter rose
#

; between both statements @full tartan

full tartan
#

thank you

sacred slate
#

how can i add a hotkey to a small code snippet? do i have to write a txt file for that?

#

Removes all the units then adds the firendlies

{
  removeSwitchableUnit _x;
} forEach allUnits;
{
  addSwitchableUnit _x;
} forEach (allUnits select { (side _x) isEqualTo playerSide });

@cunning crown

#

i just want to bind this to a hotkey ๐Ÿ˜„

exotic flax
#

Does someone know a way to (or has a script for it) to identify if a unit is for example walking, running or sprinting based on their current animation?
I know about animationState, but trying to figure out all states manually would be a pain in the ... (see https://community.bistudio.com/wiki/Arma_3_Moves#States).

So if someone has a way to read out those states (format A...P...M...S...W...D[_A...P...M...S...W...D][_Comment]) and make them into something useful, than I would be very grateful ๐Ÿ˜‰

winter rose
#

Mrun = Movement run (wlk = walk, stp = stop, etc) @exotic flax

#

add another filter with Dnon (direction = none = not moving) and you should be good

exotic flax
#

I know, but I want to be able to have functions like isRunning, isWalking, isCarrying

#

so I need a way to figure out if an unit is doing <any>, independent of the current animation

winter rose
#

"mrun" in toLowerANSI anim && !("dnon" in toLowerANSI anim) or something?

exotic flax
#

At the moment I'm writing a script which dissects the string into readable array.
eg. AmovPercMstpSlowWrflDnon becomes ["move","standing","stop","lowered","rifle","non"]

#

and from there I'll make simply if...else statements to check if someone is walking/running/reloading/swimming/dying/etc

#

I guess it is for Arma 2, but not Arma 3 (eg. Aadj exists, which I believe means "Action -> adjust")

winter rose
#

missing some yes

winter rose
#

if you could list themโ€ฆ we could add them

exotic flax
#

that will be a pain to do, but will try and post in #community_wiki ๐Ÿ˜‰

winter rose
#

maybe I could do a CfgAnims parser that would split and pushBackUnique subentries

#

would be faster!

exotic flax
#

you actually would need to parse CfgMovesBasic (and child classes)

winter rose
#

I will find it, don't worry

queen cargo
#

what is the problem with the script you want to develop for animationState?
if debugging is the main issue, then you could use SQF-VM with Arma.Studio integration to develop & test it ๐Ÿ˜œ
Only thing is: animationState is not supported so you need to pass your state yourself to the method

exotic flax
#

already using SQF-VM for testing by manually setting a state, so I've got that going for me... which is nice

#

Arma.Studio crashed on me, so need will test that later on ๐Ÿ˜‰

still forum
#

Arma.Studio crashed on me
better add automatic crash logging, it does wonders. For my .NET projects I use Sentry.io @queen cargo

queen cargo
#

yeah ... it is on the todo list ๐Ÿ˜„

#

the crash problem can be fixed with a version already online, that just catches all unhandled exceptions (still indev version though ... but with fancy features)

#

so it "should" no longer crash, but throw errors around like a madman if something moves wrong

bright flume
#

there some script/setting Im not seeing that lets you set the grid size in eden. really getting annoyed the grid isnt a Div10 grid

distant oyster
#

@bright flume

bright flume
#

thats for snapping I thought? talking the grid on the ground like you see in VR, guess maybe its the terrain map itself.

distant oyster
#

oh okay. no that is the map texture

#

has been bugging me too

bright flume
#

๐Ÿ˜ฆ was hoping it was virtually drawn in there. always throws off my sense of scale

distant oyster
#

each square is 32m if i remember correctly

bright flume
#

You were right 32m, 16 2m blocks.

austere hawk
#

question regarding remoteExecCall
in Biki it states that
remoteExecCall ["func1"]; call func2; // func2 can be executed sooner than func1
i need to to find group owner client in a small function that otherwise needs to run where unit/group is local
the biki note makes me think the following would not work? Is that correct?

private ["_grpOwner"];
if NOT(isServer) then {
    _grpOwner = _grp remoteExecCall ["groupOwner _this", 2, false];
} else {
    _grpOwner = 2;
};

... rest of function...
still forum
#

you don't need the note for that

#

"groupOwner _this"
syntax error. And if it were not a syntax error and it worked like you think it does, it would be undefined variable error and still not work like you think

austere hawk
#

what would be the correct syntax? / is this method the correct one?

still forum
#

remoteExecCall array first argument is the name of the script command or script function to be executed

austere hawk
#

oh, so just "groupOwner"

still forum
#

is this method the correct one?
remoteExecCall never returns any results, so _grpOwner will never be what groupOwner returned on the other machine

austere hawk
#

i see, so its not actually like a normal call

winter rose
#

correct

austere hawk
#

so the only way to get the owner "right there" on a client is with clientOwner on one of the units of that group (that is not a player) - i guess?

winter rose
#

the question would be "why do you need the group owner"?

austere hawk
#

i want to reorganize the positions (index) of the units inside the group
So my plan was to remove all units from the group ( except the leader) to another group and back with a specific ID via joinAs. I dont want to transfer ownership of all units first to another server/client and then back again.

#

so i want that new group to have same owner as the original group owner

winter rose
#

setGroupOwner being server-side only, you are kind of forced to do all that server-side?

#

try brute joinAsSilent and join them to 100+ ids, then sort them back? it might not need to leave group beforehand @austere hawk

austere hawk
#

hm hadnt thought of that, thanks, i'll try that

austere hawk
#

it works, that will make things easier...

winter rose
#

w00t!

velvet merlin
#

is it a relevant optimization to use "remoteExec -2" (send to all but server) when you know there is a dedicated server? (instead of 0/to all and have isDedicated check)

winter rose
#

that I am curious to know! (emphasis on the relevant optimisation)

still forum
#

It's always sent to dedicated anyway. So you're not saving traffic. If you don't want to execute there, then ofc its a optimization, you spare a useless execution

worn forge
#

So -2 excludes player-operated server, but -2 doesn't exclude dedicated server? Might be worth updating the wiki to reflect that.

ebon ridge
#

How can I most reliably set the full rotation of an object? Ideally I would like to set the rotation matrix directly, but whatever is the closest to this would be acceptable. I assumed it was setVectorDirAndUp yet the comments indicate this doesn't do close to what it claims, completely ignoring actual direction and only effecting pitch and roll...

winter rose
#

setDir before that?

worn forge
worn forge
alpine ledge
#

is it possible to interrupt and exit a while loop even if there is still stuff to be executed? surely there's a smarter way other than exitWith after everything

winter rose
#

exitWith, or breakTo

alpine ledge
#

but wouldn't that only exit once it hits it?

distant oyster
#

maybe spawn the while code and use "terminate"?

winter rose
#

make it sqs and use exit

alpine ledge
#

spawn and terminate does the job it seems peepoCheer

#

thank

dreamy kestrel
#

Are there built in A3 thunder sounds we can use? If so, what are they? And/or how might we discover them? Thanks!

worn forge
#

For thunder, check here... "A3\Sounds_F\ambient\thunder\thunder_06.wss" (there are 6 sounds in total, 01-06)

dreamy kestrel
#

roger that @worn forge thank you.

ornate scroll
#

Can someone tell me, how are the profileNameSpace variables actually stored? The BI Wiki says it creates a Vars file inside your A3 profile. However I have searched around on two different machines and can not find these var files anywhere.

Are they hidden?

cunning crown
#

They are in Documents\Arma 3 - Other Profiles\[PROFILE_NAME]\[PROFILE_NAME].vars.Arma3Profile

ornate scroll
#

So its not

myUsername.vars.GAMENAME

As the wiki states?

cunning crown
#

visibly not ๐Ÿ™‚

ornate scroll
#

Okay, that would be why I couldn't find it!

Follow up question, the file appears to be obfuscated. Is there anyway I can view what's been saved without having to individually check the return on stored vars?

worn forge
#

allVariables profileNamespace is probably the only easy way to get at it unless you know how to decrypt that file

hollow thistle
#

it's not obfuscated, it's just binarized

#

you can debinarize it with derap (? I think), armake, armake2 etc.

ornate scroll
#

Yeah I was able to use derap on it before you sent that. Thanks though. Cheers.

#

Just trying to make acex fortify persistent. Was just needing to double check on if that data was being stored.

#

Should be fairly close to having it work.

dreamy kestrel
#

Q: when dealing with particle effects, what's the difference between \A3\data_f\cl_basic and \A3\data_f\cl_basic.p3d? is there any?

winter rose
#

none I think

dense tendon
#

If i remember correctly it's almost none, just saves the server some micro seconds to search for the p3d if you provide the full file

sacred slate
#

hi. i asked that yesterday allready, but i try again, cause no help so far. is there a way for binding a hotkey to set the stance of a individual unit?

#

the menu navigation, even if there are only two buttons is to long for my play style.

cunning crown
sacred slate
#

thx!

ornate sky
#

addEventHandlers do not persist after respawn, correct?

winter rose
ornate sky
#

Thanks!

lapis ivy
young current
#

That would require editting the gamemode files. I would wager it might be quite complicated

#

are you sure you need to change them?

lapis ivy
#

Yes, I need to change them. The fact is that these icons from the flags are taken from the unit, if you change the unit, the flag icon also changes.

#

I would like to display my flag.

young current
#

that would require a new version of the whole gamemode. or change the flag of your unit.

lapis ivy
#

How to change the flag of your unit? Have a script?

lapis ivy
#

I have already tried to change the insignia through the init unit, but he does not take the icon of the flag from there.

dreamy kestrel
#

hello, trying to model a tornado using the particle effects. I think ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 12, 14, 0] might be an interesting place to start with, but I wonder how to gain control over 3D size? For instance, modeling from an F1 through an F5+, making it wider, taller, etc, etc.

young current
#

where are you using cursorTarget?

#

are you running some heavy scripts in the background?

#

ยฏ_(ใƒ„)_/ยฏ

lapis ivy
#

Up

#

How can I make sure that information from the respawn tickets module is displayed in this script?

{
    colorText[] = {1,1,1,1};
    font = "EtelkaNarrowMediumPro";
    y = safeZoneY + .01;
    h = 0.06; 
    w = 0.06;
};

class NoText : ScoreBox
{
    colorBackground[] = {0,0,0,1};
    sizeEx = 0.0; 
};

class ScoreFlag : NoText
{
    idc = -1;
    type = 0; 
    style = 48;
};

class ScoreTxt : ScoreBox
{
    type = 0; 
    style = 2;
    sizeEx = 0.03; 
    colorBackground[] = {0,0,0,.3};
    text = "999";
    shadow = 2;    
};

class RscTitles 
{ 
    class scoreboard 
    { 
        idd = 29290;  
        enableDisplay = 1;
        duration = 9999;
        fadein = 0;
        fadeout = 0;
        onLoad = "uiNamespace setVariable [""ui_scoreboard"", _this select 0]";
        
        class controls 
        { 
            class score_backdrop : NoText
            { 
                idc = -1; 
                type = 0; 
                style = 96;
                x = .355;
                y = safeZoneY;
                h = 0.08; 
                w = 0.29; 
                text = ""; 
            };
            
            class flg_blufor : ScoreFlag
            {  
                x = .365;
                text = "\A3\Data_F\Flags\Flag_nato_CO.paa"; 
            }; 
            
            class flg_opfor : ScoreFlag 
            { 
                x = .435;
                text = "\A3\Data_F\Flags\Flag_CSAT_CO.paa";  
            }; 
            
            class flg_independent : ScoreFlag 
            { 
                x = .505; 
                text = "\A3\Data_F\Flags\Flag_AAF_CO.paa"; 
            }; 
            
#
            { 
                x = .575;
                text = "\A3\Data_F\Flags\Flag_FIA_CO.paa";  
            };

            class score_blufor : ScoreTxt
            { 
                idc = 29295; 
                x = .365;                
            }; 
            
            class score_opfor : ScoreTxt 
            { 
                idc = 29296; 
                x = .435;                
            }; 
            
            class score_independent : ScoreTxt 
            { 
                idc = 29297; 
                x = .505;
            }; 
            
            class score_civilian : ScoreTxt 
            { 
                idc = 29298; 
                x = .575;
            };              
        }; 
    }; 
    
};```
#

This script displays tickets on top

#

I would like to give information from the respawn ticket module

coral owl
#

How can I filter out animals during a NearEntities search? "Man" brings in animals as well

bright flume
finite sail
#

@coral owl , nearentities can accept an array

#

so player nearEntities [["SoldierWB", "SoldierEB"], 100]

#

would not get animals

#

cant remember the parent classname for civs

#

"Civilian"

#

but I think "CAManBase" won't return animals

#

yes, confirmed, CAManBase will only get men

#

"animal" is a child class of "Man", which is why you're seeing your results

coral owl
#

ah sorry Tank, solved it!

#

thanks, exactly here's how I did it in case anyone's interested

finite sail
#

๐Ÿ™‚

coral owl
#

if !((_x call BIS_fnc_objectType) select 1 in ["Animal","UnknownObject","Thing","Seagull","Effect","Logic","Module","Mine","VASI","Camera"])) then { hint "remove dat thing" };

#

I even expanded on it to make sure I am filtering out all the things I don't need PLUS animals

finite sail
#

iskindof is way quicker

coral owl
#

definitely yes

finite sail
#

than fnc_objecttype

coral owl
#

will this work?

_x isKindof ["Animal","UnknownObject","Thing","Seagull","Effect","Logic","Module","Mine","VASI","Camera"]

finite sail
#

there ya go ๐Ÿ™‚

coral owl
#

meaning, can I copy straight up those names? I think so but ๐Ÿ™‚

finite sail
#

no, iskindof willonly accept a single entry

#

so yes, objecttype is the way for you

#

or some trick with select

coral owl
#

I mainly want to get rid of animals but I wouldn't mind making sure stuff like the above is cleared out

finite sail
#

CAManbase will get only men, guaranteed

coral owl
#

ah, that's even faster as I start up with a cleaner array

#

thanks!

finite sail
#

yes

coral owl
#

trying out

finite sail
#

np mste

#

mate

#

what with the demise of the much loved six config browser, surfing the hierarchy isn't nearly as easy as it uses to be

coral owl
#

ah got it yup

#

it werkkkkkkkkz

finite sail
#

cool

coral owl
#

CAManbase seems to return a cleaner array from da start

finite sail
#

yes

coral owl
#

it was nice to scan the animals but oh well not what I needed

finite sail
#

"Animal" will give just the animals, if it's relevant

#

although, i don't think animal returns insects

#

also, animals are locally rendered, so in MP, player a will see a snake/rabbit which other players wont see

coral owl
#

no prob it was still a local matter, not MP so that's ok

finite sail
#

xlent

worn forge
limpid edge
#

i can't get my mod to work

#

i have @Mod/script.sqf

austere sentinel
#

Kind of a noob question; but who has access to a side's command chat? Just players with the colonel rank?

bright flume
#

@austere sentinel command is, if Im not mistaken, given when you are the group leader.

austere sentinel
#

Makes sense. Thanks ๐Ÿ‘

bright flume
#

how and where that is handled, honestly would be nice to know I been looking but havent seen nothing specific for auto assignment/joining channels based on role. likely somewhere hiding in cfg's for IG vanilla roles

still forum
#

@echo yew

cursortarget return objnull for like 4/5 secondes
Correct, did you not read the wiki page for cursorTarget? It needs a while for the player to detect the object.
you could use cursorObject too probably.

bright flume
#

changing a formation leader would let the TL send a group in formation out on a route etc without the TL following them correct?

austere hawk
#

am i stupid?
i put this in unit init field in Eden
[this] execVM "ObservationQuerryTest.sqf";
and get error
"Init: Type Script, expected Nothing" ???

copper raven
#

init boxes don't allow statements with return value

winter rose
#

put 0 = before

copper raven
#

so you should assign the return value to something^

winter rose
#

we never knew why, but here we are ยฏ_(ใƒ„)_/ยฏ

bright flume
#

okay before I take a stab. is that line run and keep going or does it wait for execute completion?

winter rose
#

sorry, what?

bright flume
#

execVM is it run and done keep moving, or do you wait for its completion before the executing script keeps moving.

still forum
#

execVM is spawn

bright flume
#

nvm, was !?...

acoustic abyss
#

Quick question: is there an equivalent command to enablesimulation that works for an entire group? Would save a lot of naming and typing ...

cunning crown
#

You could just do a forEach ^^

acoustic abyss
#

D'oh! Cheers.

quartz pebble
#

Can anyone elaborate on targetsQuery command? wiki says the result is sorted.
Does that mean, that if I query known enemies, the 1st item - is the enemy unit will attack with the highest chance?

winter rose
#

it seems that targetsQuery gets sorted by accuracy @quartz pebble

quartz pebble
#

@winter rose what means accuracy in that context?

winter rose
#

given the description it might be which target is the "best" to attack

#

I don't know if it takes into account target priority as well

cunning crown
#

where the accuracy coefficient reflects how close the result matches the query

#

So my guess is that if you pass "Man" as a target type, it will be higher than a "Tank" despiste the tank being a more *dangerous" target?

quartz pebble
#

where the accuracy coefficient reflects how close the result matches the query
That's the question: What means "matches the query"? If there is a bunch of different enemies in front of AI, which one will have the highest accuracy?

cunning crown
#

I think it's in the same order as the parameters so
1st Every unit of the same side, then it will take into account the type of each unit (for each side individually?), then the position, the closest, the higher it's placed, and finally the age if multiple units are at the same distance?

finite jackal
#

https://community.bistudio.com/wiki/Title_Effect_Type
"PLAIN DOWN" Displays the text, object, or resource given. Plain text is vertically aligned to 25% from the bottom of the screen.
Is this meant to display text 25% up from the bottom of a player's screen? It's barely any different than PLAIN being in the center of the screen still. Used titleText and cutText

cutText ["This is a test text position", "PLAIN DOWN"];
titleText ["This is a test text position", "PLAIN"];```
https://i.imgur.com/2D9FbIc.jpg
winter rose
#

it must depend on your display size and some HUD position too

lapis ivy
#

How do I change the unit's faction via the script?
I try: a1 = ["faction", "IND_F"]; - it doesn't work.
In the unit's init: _faction = "mas_usl_ewint"; - does not work.

What am I doing wrong?

#

Sorry, there are two different factions.
But still, how to change the faction through the script?

cunning crown
#

With setSide command https://community.bistudio.com/wiki/setSide
a1 = ["faction", "IND_F"]; I don't know how you would except this to work but that does asign ["faction", "IND_F"] to the global variable a1 and this is not an "object" (like you see in Javascript, so you wouldn't be able to do a1.faction)
And _faction = "mas_usl_ewint"; well it assigns "mas_usl_ewint" to the _faction local variable but this doesn't mean anything to the engine

lapis ivy
#

I understand, but I need to change not the side of the unit, but the faction, since it contains the flag icon that is displayed on the right in Respawn Tickets

#

Here is a topic on the forum, but I don't know how to make it work.

cunning crown
#

Well you can put that in the init.sqf and change the values by what you want

addMissionEventHandler[ "EachFrame", {
    uiNamespace getVariable "RscMissionStatus" displayCtrl 15283 controlsGroupCtrl 14183 ctrlSetText "#(rgb,8,8,3)color(1,1,0,1)"
}];

/*
  uiNamespace getVariable "RscMissionStatus" displayCtrl 15283 controlsGroupCtrl 14183 ctrlSetText "#(rgb,8,8,3)color(1,1,0,1)"
                                                                                 ^^^^^              ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                 Slot                  Path to icon
*/
lapis ivy
#

Unfortunately, the icon blinks.

cunning crown
#

And if you only put uiNamespace getVariable "RscMissionStatus" displayCtrl 15283 controlsGroupCtrl 14183 ctrlSetText "#(rgb,8,8,3)color(1,1,0,1)" }]; ?

lapis ivy
#

I put only this.

#

What a pity.
I'm tired of looking for a solution. We are making a project in Arma 3 on the type of game Squad, only with increased hardcore. I would like to implement this, but I don't work very well with scripts myself. I have an example of a mission where there are tickets and I would like to add them to my mission, but I do not know how to do it correctly, the script always gives an error.

austere granite
#

@lapis ivy if you want something that's close... youll need to know what you're doing

#

There's a ton of mechanics you'd need to handle

lapis ivy
#

@austere granite
I agree with you. I'm working on a project alone.
All the most basic things are already in the game, we don't use rally points and hub, respawn only on main, it's all ready.

austere granite
#

Maybe check out AAW

#

That's basically PR

#

Or Frontline, but the code isn't open and project is basically shut down ๐Ÿ˜„

lapis ivy
#

AAW?

#

What is?

still forum
lapis ivy
#

class CfgFactionClasses { class rhs_faction_usmc_d { displayname = "ะกะจะ (ะšะœะŸ - ะŸัƒัั‚ั‹ะฝะฝั‹ะน)"; icon = "\mas_usa_lite\cfgfaction_mas_usa_blu_ca.paa"; priority = -3; side = 1; }; };

Can I change the icon in the unit class this way?

cyan pendant
#

am i able to make independent objects into opfor with a script?

distant oyster
#

@cyan pendant ```sqf
_units joinSilent (createGroup [east,true]);

cyan pendant
#

thank you

zinc sorrel
#

i've got a SQF file where i'm having a smoke and chemlight spawn on a air dropped supply crate but it keeps spawning the smoke evcerytime the other one ends. also spawns in the air instead of when it hits the ground. Anyone have any idea what i can add to this to help?

for "_x" from 1 to 10 do

{

_supplyLight = "Chemlight_green" createVehicle (position _supplybox);

_supplyLight attachTo [_supplybox, [0,0,0]];

_supplySmoke = "SmokeShellGreen" createVehicle (position _supplybox);

_supplySmoke attachTo [_supplybox, [0,0,0]];

sleep 30;

};```
winter rose
#

@zinc sorrel remove the for loop and you are fine

zinc sorrel
#

ok thanks ๐Ÿ™‚ will that have it spawn the grenade once the crate hits the ground?

ruby breach
#

Nope. You're going to need a waitUntil check before the above

zinc sorrel
#
waitUntil {speed _supplybox != 0} do

{

_supplyLight = "Chemlight_green" createVehicle (position _supplybox);

_supplyLight attachTo [_supplybox, [0,0,0]];

_supplySmoke = "SmokeShellGreen" createVehicle (position _supplybox);

_supplySmoke attachTo [_supplybox, [0,0,0]];

sleep 30;

};```

something like that? Sorry, still trying to learn all this sqf stuff
tame lion
#

Is there a command/function which will return the relative position of one object to another? Something that would help with getting the cords off an object for a command like attachTo or modelToWorld? Ex: object A is at [1,1,0] and object B is at [0,0,0] and a command would return something like [-1,-1,0]

runic spoke
jade abyss
tame lion
#

I will need it too actually

#

I'm making a FOB system that will allow players to save/load templates of the items they have built

#

Thanks guys

jade abyss
#

Then worldToModel is prolly better suited, for that task.

runic spoke
#

Agreed

jade abyss
#

alternatively:
getDir / getRelPos

tame lion
#

Yeah that will get me the pos of objects. Now to make sure i get the proper vector in relation to the central vehicle that will be the reference point

jade abyss
#

modelToWorld/worldToModel

#

+don't forget to adjust the Z Axis

austere sentinel
#

Is there a way to give a player NVG only when they're a pilot in a helo and remove them on exiting the helo?

#

Trying to enforce flashlights & night fighting but flying is not fun without nvg

jade abyss
#

Some hints:
addItem, vehicle player, removeItem, unlinkItem

austere sentinel
#

unlinkItem Thats probably the one I was missing

jade abyss
#

prolly

robust hollow
#

@hasty violet For my addons that work as both script and mod I created them as a script and used a .bat script to pack them as both a script and mod addon.

worn forge
#

Use the getinman eventhandler to linkitem and then getoutman to unlinkitem

austere sentinel
#

๐Ÿ‘ so much of this stuff is buried for noobs

cyan pendant
#

how to i run a line of code when a variable is True?

#

the only place i know of to put the script is under init

#

is there an option for a while loop?

lost copper
#

Hello everyone! I try to make some magic with TFAR and now i have a question. How does this code affect on
performance in MP if it called once per second?

_radioArray = ["163.1", "34.2", "0.0"]; //this array creates by another function, not necessary for now
_unit setVarialble ["SVT_currentFrequencies", _radioArray, true];
austere sentinel
#

@cyan pendant You'd want to put the code for the loop in it's own file (say scriptname.sqf), and spawn it in init.sqf or initServer.sqf . If you just use a while loop in init it will block other code from being run if I'm not mistaken.

Granted, I'm a noob so someone with more experience is most welcome to correct me.

cyan pendant
#

{
while {1 == 1} do
{
private _combatphase = car getVariable "combatphase";
if (_combatphase == true) then
{
this fireAtTarget [car, "RPG-7"];
};
};
};

#

this is the code im using in init to try and get a dude to blow up a car

austere sentinel
#

At least I think lol

robust hollow
#

@hasty violet i dont think ive shared it anywhere. it isn't special anyway, basically just copy files from the git repo to a temporary directory and then packs the directory into a pbo.

lucid junco
#

Someone knows if theres way to stop auto assigning task when current is done??? I have task which i dont want to have current. And one which is current and after current is done the first one is assigned by system. Is there way to stop it???

lucid junco
#

Ok. -1 do the job!

winter rose
#

BI sucks yet you used the wiki (mostly edited by the community) and you managed to do what you wanted within the gameโ€ฆ ๐Ÿค”

lucid junco
#

Bad description, thats the point. whatever.....

cosmic lichen
lucid junco
#

great! ๐Ÿ™‚

winter rose
#

"with the largest priority >= 0" , I (honestly, not trolling) don't get what was unclear to you? Phrasing?

lucid junco
#

of course its clear. I got it with second run. Its just more clear when mentioned. ๐Ÿ˜„ Im counting my free time for minutes not hours so i go really fast. Technically my fault, yes ๐Ÿ™‚

#

" the system selects the one with the largest priority >= 0" think i got missed by this. From my point when you read it, its 50/50 chance if you can go to negative numbers and what this could do. Just depends if it come up to your mind to try or not. I just catched it for second read..

austere sentinel
#

Wondering if there is a way to modify armor values for a vest during runtime? Everyone on a team will be using the same vest (colored deck crew vests for easy team identification), but I'd like to implement an upgrade system. Do I just have to duplicate & tweak the deck vest for each upgrade on initialization? If so, any info on copying&tweaking would be helpful

exotic flax
#

You can't change config values on runtime, so you either need to create a config for each upgrade (and switch out the vest), or modify the damage event handler which decreases the amount of damage received based on the current upgrade.

austere sentinel
#

Yeah I figured cfg was immutable, didn't see anything confirming though. I'll have to dig for how to copy an item and just use it's model. Thanks!

exotic flax
austere sentinel
#

Exactly what I needed, tyvm ๐Ÿ™‚

winter rose
#

@lucid junco thank you for the explanation! :+1:

potent depot
#

Error appears every time addon options is opened

winter rose
#

well, it seems a boolean is provided instead of a number

#

can't say much more

potent depot
#

yeah got that much XD

winter rose
#

(unfortunately)

potent depot
#

im just not sure where

exotic flax
#

I guess _debugValues can't contain booleans, but need to be integers or strings

potent depot
#

hmm that may be it

winter rose
#

best is to comment what you suppose is "OK" then little by little, find the guilty one(s)

exotic flax
#

CBA wiki is far from useable in my experience ๐Ÿ˜‰

potent depot
#

yeah it tends to be out of date quite a bit.

#

and yeah it seems it is that list

#

welp time to rewrite my checks

#

Thanks for the help

exotic flax
#

that's what this Discord is for ๐Ÿ™‚

winter rose
#

wait, it is?

exotic flax
#

and to make Lou work

potent depot
#

yup though the headless client section is bad as there arent many people with experience

#

and people dont really check it

dusk shadow
#

Anyone has some ideas on the formula that calculates the "mass" bar in the inventory?
Specifically the contribution of items stored inside backpacks, since they contribute more to used mass than their counterparts not in a backpack.

potent depot
#

all items should have a mass value if thats what your looking for

dusk shadow
#

Im aware of those. I can get the mass of items in a container to match up with the maximumLoad fine when the items are sat straight in the container
The issue im running into is to account for items that are inside something like a backpack or vest. They contribute more than if they were "unpacked" inside the container

#

I'm trying to get a calculation that works on the same prinicpals as vanilla arma's inventory

potent depot
#

you mean how much space it takes in a vest?

dusk shadow
#

not quite

#

here an example...

potent depot
#

got an image of that bar your specifically asking about?

dusk shadow
#

1s

potent depot
#

you cant post images directly in here btw you will need to provide a link

dusk shadow
#

Example:
If you put an empty backpack and 5 mags inside a container (the mags are not in the backpack) it will use up say 5%
If you pack the same mags inside the backpack the total amount used will increase by a certain factor.
Its that factor im trying to figure out.

It doesn't seem to be linear from my experiments and it's hard to tell what parameter it's based on.
I just thought I'd ask here before I spend a ton of time on function fitting.

I didnt even know arma did this until today... 5k hours in...

Pictures: https://www.dropbox.com/s/m04d4d0xo31dkuk/ex1.PNG?dl=0
https://www.dropbox.com/s/vdc18f9i02y81t0/ex2.PNG?dl=0
https://www.dropbox.com/s/z7k0noo4yb2b5ia/ex3.PNG?dl=0

potent depot
#

Hmm, yeah didnt know it increased it by that much. Maybe if it has anything in it it uses the maximumLoad value? does it stay the same size with only one mag in it?

winter rose
#

oh wait, the bar is not -just- weight, isn't it also -volume-?

dusk shadow
#

ye

#

its "mass" as defined in config

exotic flax
#

uniform/vest/backpack/vehicle have a maximumLoad, and items have a mass.
So it's maximumLoad / 100 * (mass * n)

winter rose
#

I am talking "volume" as in 3D "size"

#

maybe an empty backpack = "folded backpack",
and a backpack with one single napkin in it = "full-sized backpack"

exotic flax
#

Arma doesn't really have a volume for regular items, only with the Vehicle-in-Vehicle stuff it takes the bounding box (and mass)

dusk shadow
#

Grez what exactly is that formular, the factor?

#

for any specific item

potent depot
#

the question is if it changes "size" depended on the amount of items inside. If it doesnt then there is no dynamic formula

exotic flax
#

it's the percentage of the bar shown; since maximumLoad is 100%, and mass * n (or mass + mass + mass + mass ...) is the number within the 100% (Math 101)

#

and afaik does the weight of an object itself not change when items are put in, however scripts which need to know the weight simply calculate that

dusk shadow
#

ye it really is too bad none of them work on non-unit containers

#

sorry, i wasn't clear in my question about the formula... what i mean is that the % of the entire container or just the backpack? And what does n actually represent? the number of magazines in the example? or all items? cause i cant get those numbers to add upp

#

just so we're clear, the setup is Box > Backpack > Mags

#

I need the how much the Backpack (including the mags in it) take up of the box's maximumLoad

#

when they are packed

exotic flax
#

on the right (large bar) is total "weight" carried by unit, where maxSoldierLoad is 100%

under the containers is the "weight" of all the items inside the container, where maximumLoad is 100%

on the right is will show the maximumLoad of the container you are accessing (eg. crate)

forest ore
#

Testing in dedicated server with debug console. Why does this created _unit not change its side from BLUFOR to OPFOR?

_tempGrp = createGroup east; 
_unit = _tempGrp createUnit ["B_Soldier_F", position player, [], 0, "NONE"];
finite sail
#

IIRC, @forest ore , _unit will take the side of the leader of the group

#

its possible _unit IS the leader of that group

#

you might need to create another unit, an opfor one and make him the group leader first

forest ore
#

Tankbuster, at least _tempGrp should be empty since I create it just before creating _unit. But ok, apparently a created unit doesn't take the side of a created group ๐Ÿค”

#

Just to continue on that: shouldn't a created unit join a group with join or joinSilent?
Any idea why that does not happen with this:

_tempGrp = createGroup east; 
_unit = _tempGrp createUnit ["B_Soldier_F", position player, [], 0, "NONE"];
_unit join (group player);
finite sail
#

No the unit takes the side of the group leader

winter rose
#

[_unit]*

#

@forest ore use -showScriptErrors please ๐Ÿ˜…

finite sail
#

yes, join takes an array of units

dusk shadow
#

@exotic flax i've done the numbers for what you've explained and man it still doesn't add up. Maybe I'm just thick but
Backpack is mass = 60,
mags are mass=10 each,
there's 20 mags in the backpack,
the box in this case is the inventory of a ATV with a maximumLoad = 600

600 / 100 * (20 * 10 + 60) = 0.0299..=> 3%, that doesn't make sense, the increase in weight is not 3%, the total is sure as hell not 3% (more like 80%) as seen in the first picture i linked

finite sail
#

[_unit] join (group player);

forest ore
#

oho, wololooo. Lou to the rescue! ๐Ÿ‘๐Ÿผ
I was reading https://community.bistudio.com/wiki/join and thought that it does not need an array if there's only one unit ๐Ÿ˜…
And just to confirm the created unit now joins player when using [_unit]

finite sail
#

it doesn't say thatr

#

thepage only mentions arrays

winter rose
finite sail
#

hehe

forest ore
#

well gahd damn! ๐Ÿ˜„

winter rose
#

couldn't resist :p

finite sail
#

what about where I said the group needs a leader before you join the unit to it? was I right?

forest ore
#

It would seem so yes ๐Ÿ™‚

finite sail
#

cool

#

if in the editor, I think the usual practice is to give the group leader a zero probability of presence. Not sure how you'd do that in script

winter rose
#

createUnit, deleteVehicle

finite sail
#

*checks own scripts

#

yep, thank you @winter rose

#

lol

#

in a similar vein, I have a mission where I create opfor units, but forceadduniform civvy clothes on them

#

might be an option, depending on @forest ore use case

austere sentinel
#

For some reason I can't get the player to force eject. I get the hint so I know I'm reaching this bit of code at least (this is in a "GetInMan" EH if that matters)

hint "You may not pilot this vehicle. Choose another seat.";
_nul = [] spawn {
    sleep 1;
    if ( vehicle player != player ) then { player action [ "Eject", (vehicle player) ]; };
};
#

Nevermind, figured it out.
player action [ "Eject", (vehicle player) ];
needed to be
player action [ "getOut", (vehicle player) ];

lapis ivy
#

blufor_box_backpack addBackpackCargoGlobal ["B_mas_usl_Kitbag_w", 56];
Hey. I'm trying to add a backpack to a drawer, but this backpack comes right away with the item in the backpack. How can I remove all items from an added backpack in a drawer?

forest ore
#

Strange remote exec. Would need to remote exec join but that wasn't it --> ```sqf
[(group _eastGroup), [_unit]] remoteExecCall ["join"];

but how?
ruby breach
#

Looks like your params are backward

forest ore
#

This seemed to be the case Gnashes. So like so:

[[_unit], (group _eastGroup)] remoteExecCall ["join"];
```The thing that mostly bothers me with this remote exec stuff that I never seem to get a hold of how stuff is supposed to go with it. There's always something the "wrong way" ๐Ÿ˜„
ruby breach
#

It's just the exact same way as if you'd used the command without remoteExec

#

[_unit] join (group _eastGroup) > [_unit] (group _eastGroup) remoteExec ["join"] > > [[_unit], (group _eastGroup)] remoteExec ["join"]

forest ore
#

Hmm, true true indeed. Well maybe some day even I'll understand. And that shouldn't even be a difficult combo to remote exec ๐Ÿคท๐Ÿผโ€โ™‚๏ธ ๐Ÿ˜„

dusk shadow
#

@forest ore I usually find abstracting it a bit helps:
Regular call:
arg1 command arg2;

RemoteExec:
[arg1, arg2] remoteExec ["command"];

In your case:
arg1 = [_unit]
arg2 = (group _eastGroup)
command = join

forest ore
#

Will keep that in mind @dusk shadow thanks ๐Ÿ™๐Ÿผ

tough abyss
#

Hello everyone! I need some help here. So, I'm trying to use UnitCapture and UnitPlay to get two Ghosthawks to move to an LZ and move back to their ships. I've got all the recording from UnitCapture and set it up to be triggered with a radio call, and everything is working fine. HOWEVER, when I trigger the radio call on the helicopters, they instantly move an inch forward and then stop. How can I fix this?

unborn ether
#

2020: Still dreaming about managing non-unit cargos without fully clearing them.
๐Ÿ˜ฆ

finite sail
#

hmmm, am nearly ready to release update of mission... checks to see if I'll be buried by an ACE, RHS or CUP release like has happened the last few times

#

or I could break the habit of a lifetime and release midweek

lapis ivy
#

How can I prevent third-party mods from being used on my server?

oblique arrow
#

Use the mod signature/key system @lapis ivy

lapis ivy
#

The keys are added to the server in the /myserver/keys folder, but players can still log in by connecting a third-party mod.

#

Maybe there is some config that I need to configure?

oblique arrow
#

make sure that signatures are turned on in the server.cfg

lapis ivy
#

How do I do this?

#

I use the TADST server launcher

#

And one more question...

#

I'm trying to add a backpack to a drawer, but this backpack comes right away with the item in the backpack. How can I remove all items from an added backpack in a drawer?

blufor_box_backpack addBackpackCargoGlobal ["B_mas_usl_Kitbag_w", 56];

finite sail
#

is there a particular reason you're using TADST?

lapis ivy
#

@finite sail
Yes, I had a problem with plug-in mods. The launcher made it easier for me.

finite sail
#

What's a plug-in mod?

lapis ivy
#

I connected the RHS, ACE mod, CBA...

finite sail
#

erm... connected?

#

is English your first language m5?

#

because you're using terminology I'm not familiar with

lapis ivy
#

No, I'm from Russia, I use a translator. He doesn't always translate correctly, sorry.

finite sail
#

its ok, i need to have a think about what you're saying ๐Ÿ™‚

lapis ivy
#

๐Ÿ˜„

finite sail
#

ok, so you are using RHS, ACE, CBA mods

lapis ivy
#

Yes

#

But players can connect to the server with other mods.

finite sail
#

yes, this means signature checking isn't working

lapis ivy
#

I want to be able to connect only using server mods.

finite sail
#

yes, I understand

#

Is your server up now?

lapis ivy
#

The server is currently disabled. I can turn it on.

finite sail
#

please do

lapis ivy
#

Okay, wait 1 minute.

exotic flax
lapis ivy
#

Sorry.

finite sail
#

sorted via messaging.. hopefully got him to move to FAST2 too

alpine ledge
#

wondering if anyone has a workaround or something for the following:

i have 4 units in a vehicle that say a line via kbTell all at the same time (simultaneous cheering)
other kbTells in this scene use the VEHICLE radio channel so as to speak over the sound of the vehicle
this does mean however that only one unit can use the channel at a time
in order to get multiple units speaking at the same time, i need to set kbTell to use the DIRECT radio channel
script wise, everything works however i'm unable to actually hear them over the sound of the vehicle K_vPensiveBread

tl;dr - how i make vehicle quiet while preserving speech volume; fadeSpeech does not affect speech from kbTell, already tried that

winter rose
#

โ†’ A3 bug โ†

tame lion
#

What would be a good way to take an object and make its vector match the ground below it? I'm sure it involves surfaceNormal but not sure of how to use the math there

young current
#

setVectorDirAndUp perhaps

tame lion
#

would the up array be the surfaceNormal

young current
#

pooossibly

#

Id test that

tame lion
#

Does the UIEventhandler "ButtonDblClick" not work anymore? I've been trying to make a button have 2 different functions based on single vs double click

austere copper
#

hi all, is there any way to have a custom engine sound from a spaceship to play on a static object .the idea is to have a spaceship that flys with the custom engine sound and have it play on the interior of that ship which is a separate model. it needs to have the same frequency and volume as the flying ship.Any help would be great thanks

young current
#

would playsound3D command work?

austere copper
#

Just like when you're in a helicopter and you start to fly the engine sound changes . Thats what im trying to accomplish. Playsound would just play the sound not change the volume or frequency . When you're in the interior you want to be able to hear that the ship has started to take off as the engine sound will be changing . Hope you get what I mean, thanks