#arma3_scripting

1 messages · Page 619 of 1

ripe sapphire
wet shadow
#

Is indeed that, but the EH is linked to the curator object. Not an insurmountable problem but not ideal

ebon citrus
#

how can i make a sound/source follow an object? i.e. attach a sound to a moving object

winter rose
#
myCar say "mySound";
#

@ebon citrus ?

ebon citrus
#

yep, that did it

#

im jsut struggling with the titles

#

this doesnt work anymore, does it?

titles[] = {
            0, <t color="#ff0000">Red text</t>,
            1, <t color="#00ff00">Green text</t>
        };```
#

never mind, you have to designate titlesStructured = true;

#

albeit, the titles dont ever fade

winter rose
#

don't you need "quotes" ?

ebon citrus
#

no

#

it's a structured text

winter rose
#

also is titlesStructured documented on the wiki 🤨

#

yes!

#

good

ebon citrus
#

i'll just spawn BIS_fnc_showSubtitle; at the end of ym script

#

with an empty string

#

the subtitles never fade

#

well, they fade after a considerable time

#

never mind that

#

doesnt seem to work either

slim oyster
#
addMissionEventHandler ["MPEnded", {/*code*/}];```
doesn't seem to be firing at the end of an MP mission, is this a known bug?
winter rose
#

It's not called on clients when client disconnects from server (and mission continues).
though

in which case did you encounter this issue @slim oyster?

slim oyster
#

EH put on server during preInit, endMission command remoteExec'd to server.

#

I can see that the clientstate changes, and the mission ends via the command

winter rose
#

try in initServer.sqf or in a postInit? it may be too early, although I don't know about it

ebon citrus
#

when using setPos on an object that is attached to another object, the position argument for setpos is relative to the parent object, right?

#

never mind, cant use setpos for an attached object

jade abyss
#

Yep.
simply use attachTo again

ebon citrus
#

yep

#

is there a command to wakeup and object's physx simulation?

#

after i detach an object, it remains floating there

#

but as soon as i touch or shoot it, it falls

#

would giving it velocity work?

#

nope, didnt work

#

ok, setvelocity works, so long as the velocity is not a zero-vector

split coral
#

enablesimulation true; should also wake it up

ebon citrus
#

that doesnt do it, since the simulation is already enabled

#

also, biki is down, once again

#

how do i select the last element of an array?

little raptor
#
array select (count array - 1)
ebon citrus
#

uhhh...

#

i jsut reversed the array

little raptor
#

dont

#

it changes the array

ebon citrus
#

that's the point

little raptor
#

If you need it later, it will be bad

ebon citrus
#

i reversed the array and took the first member

little raptor
#

That's slower

ebon citrus
#

i dont need anything else

#

it is

#

but im not running it 1000 times per second

#

infact, im expecting to run it once an hour

little raptor
#

how many elements does it have?

ebon citrus
#

probably 1 to 3

little raptor
#

ok.

#

it won't matter

finite sail
#

22:18:48 Error 72 elements provided, 3 expected

#

oops

#

setpos didnt like that

little raptor
#

No it never does!

copper needle
#

How do I select backwards in an array? For instance: sqf _array = [1,2,3]; _array SELECTBACKWARDS [0, 2]; // returns [3,2]

warm hedge
#

Do reverse?

copper needle
#

That's all I could think of as well, but I just wanted to check if there was something I missed since using that makes things slightly more complicated. Thanks for the confirmation!

copper needle
#

How do I check if a player has closed a dialog?

robust hollow
#

you could check if the display is null. eg isNull findDisplay idd

warm hedge
#

Or maybe unload EH

copper needle
#

Ill look into both thanks!

fair drum
#

do mission event handlers have to be executed on every machine? or can i keep it in a initServer?

robust hollow
#

depends where you need them to execute.

robust brook
#
if (_cashString != "cash") exitWith {};
if !(_cashString isEqualTo "cash") exitWith {};
#

anyone know which is faster for evaluating?

robust brook
#

ty

#

it's literally a 0.0001ms +- difference 😦

high marsh
#

¯_(ツ)_/¯

sudden yacht
#

Hello all. I was wondering if anyone had a work around. Im trying to attach objects to a helicopter. The command works however the AI bugs out while flying the helicopter litterally trying to fly to the moon. I was wondering if anyone had a work around?

oblique arrow
#

Do you need the heli to fly a set route or with different waypoint positions each time? @sudden yacht

sudden yacht
#

@oblique arrow i want it to still be dynamic. I dont want to use unit capture. 😛

oblique arrow
#

Yeah thats what I was going to recommend if it was a set route heh

#

You'll have to wait for someone smarter than me with that problem then Hap

raw scaffold
#

Looking for someone that knows how to make the ocean scripted to have much bigger waves then max settings in default arma.

warm hedge
#

You have to make a config. So no luck via scripting

raw scaffold
#

ahhh... oh snap this the real POLPOX

warm hedge
#

?

raw scaffold
#

you made a ton of awesome mods right?

warm hedge
#

No

raw scaffold
#

=] retextured cbrn suits, blurry laser!? polpox's quick death screen

winter rose
#

artwork supporter, too

still forum
#

anyone know which is faster for evaluating?
@robust brook
the first, less commands

winter rose
#

also case insensitive

compact maple
#

Hi, are global variables still "alive" when going back in the lobby ?

winter rose
#

I believe so

compact maple
#

Alright thanks

daring sentinel
#

_emptyModel setPos [_emptyModelpos select 0, _emptyModelpos select 1, 0.1];
Do get anything wrong?

#

the setpos is incorrect

winter rose
#

if _emptyModelPos is defined somewhere, no
but you can do otherwise:

private _emptyModelPos = getPosATL _emptyModel;
_emptyModelPos set [2, 0.1];
_emptyModel setPosATL _emptyModelPos;

// or

_emptyModel setPosATL (getPosATL _emptyModel vectorAdd [0,0,0.1]); // if you want to only up it
daring sentinel
#

_emptyModelpos = getPos _plane; _emptyModel setPos [_emptyModelpos select 0, _emptyModelpos select 1, 0.1];
like this ?

winter rose
#

for example yes

#

otherwise, you don't know what is _emptyModelpos

#

_emptyModelPos, btw

daring sentinel
#

private ["_plane"]; _plane = _this select 0; _emptyModel = "\A3\data_f\ParticleEffects\Universal\Universal"; _emptyModelpos = getPos _plane; _emptyModel setPos [_gpos select 0, _gpos select 1, 0.1];

winter rose
#

@daring sentinel
params ["_plane"];

daring sentinel
#

that's the problem??

winter rose
#

no

#

but you are trying to set position of a string… won't work

daring sentinel
#

I see~

#

thx

ebon citrus
#

How do i get the opposite-vector for vectordir and vectorUp?

#

multiplying them by -1 doesnt cut it

winter rose
#

vectorMultiply -1 ?

ebon citrus
#

doesnt work

winter rose
#

shouldn't it? 🤔

ebon citrus
#

or there is some magic at play

#

to my knowledge, it should

#

what im trying to do is place an object on another object

#

and i have a preview of this object placement

#

i then get the model-to-world of that preview object and attach a copy of it to the parent object at that position

#

and then i copy the vectorDir and VectorUp of the preview object

#

but they are flipped, so i tried to multiply those vectors by -1, which... does nothing

#

there's a lot wrong with it atm, but try to diregard that

#

i get the object to attach to where i want it to, but the rotation on both vertical and horizontal axes are flipped

#

as in, the dir and up

winter rose
#

maybe it is relative to the attach object - same as setDir

little raptor
#

yes

#

they are

#

@ebon citrus You should convert the vectors to model coordinates.

#

Relative to the object it's being attachedTo

#

obj2 attachTo [obj1, ....]

winter rose
#

or set before attaching

little raptor
#

Rotation is in obj1 model coordinates

#

or set before attaching
Yeah. This is better

ebon citrus
#

@winter rose rotation set before attaching doesnt translate to the attached object

#

the transforms get reset when you attach an object

#

@ebon citrus You should convert the vectors to model coordinates.
@little raptor how?

little raptor
#
vectorWorldToModel
ebon citrus
#

exactly the command i was looking for

vernal mural
#

is there a way to make an object spottable via a radar ?

#

(via script I mean)

ebon citrus
winter rose
#

(@vernal mural reveal, to force a spotting)

vernal mural
#

will make active radar aware of an object ?

ebon citrus
#

alright, that worked it out for me. Thanks @little raptor

little raptor
#

np

#

@vernal mural If the radar has an "AI", yes.

#

Use the alternative syntax

#
_radar reveal [ _target, 4]
#

@ebon citrus I'm not sure how you plan to use that, but do not use the attachTo command every frame or something. It's slow

young current
#

whazzat?

oblique arrow
#

also what does this have to do with this channel? @harsh vine

harsh vine
#

figured some smart guy was gonna gonna say something ...but i will remove it to make u happy ...plus i was just showing how my process bar turned out that the guys helped me with.

winter rose
#

@harsh vine no flame-baiting 👀
it is not to make anyone happy, if you want to share your progress say it, it's not unwelcomed

oblique arrow
#

if you want to share your progress say it, it's not unwelcomed
Yeah if you had said that you want to show what you've managed to do I wouldnt have said anything blobdoggoshruggoogly

ebon citrus
#

@little raptor where's attachTo and eachframe?

little raptor
#

I was just pointing it out

#

In case that's what you wanted to do

ebon citrus
#

never would cross my mind

little raptor
#

I didn't read your code

ebon citrus
#

no no, that's why i have the preview

#

so that i have to attachTo only once

copper needle
#

How do I prevent a dialog from being closed with Esc?

little raptor
#

If you have a safe method for closing it, I think you can do it with keyDown event handler

#

If it returns true, the vanilla game keybindings are ignored.

tough abyss
#

Does anyone have experience with createSoundSource ?
I'd like to play my sounds within a random area (or randomly from a set of premade markers).
createSoundSource ["hissing", position mytrigger, ["hissmarker","hissmarker_1","hissmarker_2"], 0];
But the above code will only play the sounds from the origin. Changing the value of the "placement" argument does nothing either.
Anyone have any ideas?

ebon citrus
#

is there a way to stop vehicles from doing their ejection-animations when getting out?

#

more specificly, the RHS c130j

#

every time you get out, even with moveOut, the back doors animate

tough abyss
#

Isn't an action animation like that defined in a vehicle config?

ebon citrus
#

i cant find it

#

never mind, i was looking at the wrong class

#

here it is

class RHSUSF_EventHandlers {
                getIn = "_this call rhs_fnc_C130_doors";
                getOut = "_this call rhs_fnc_C130_doors";
            };```
#

ok, so looking through the scripts, i can use doorhandler_R/L respectively on the doors to keep them open

ebon citrus
#

how would i remotely spawn a function?

#

["param", "my_fnc_function"] remoteExec ["spawn", target]

#

will that work?

willow hound
#
["Some parameter string"] remoteExec ["X_fnc_Y", 42];
ornate marsh
#
[player,    [ 
  "Teleport players on Pad", 
    { 
    params ["_target", "_caller", "_actionId", "_arguments"];
    [player] remoteExec ["removeAllActions",0,true];
    [] spawn {
    [teleFrame, "teleport"] remoteExec ["say2D"];
    ["teleportIn", ["","BLACK", 2]] remoteExec ["cutText", 0];
    sleep 5.3;
    _players = nearestObjects [teleFrame, ["Man"], 5, true];   
        {
        _location = getPosASLW telePosition; 
        _x setPosASLW _location;
        } forEach _players;
    ["teleportIn", ["", "PLAIN"]] remoteExec ["cutText",0];
    };
    }, 
    "", 
    1.5, 
    true, 
    true, 
    "", 
    "player inArea teleTrigger", 
    5, 
    false, 
    "", 
    "" 
    ]
] remoteExec ["addAction",0,true];

This is not appearing for each player. Am i using player wrong?

#

its called from an sqf file ran on the server

ebon citrus
#

what is the practical difference between getDir and getDirVisual?

#

can i attach a camera to an object? Or do i need to set the camera pos each frame?

#

no idea

#

i tried to attach a camera object to a fast moving object

#

but the camera object gets real jittery

crude vigil
#

Due jittering, I would advise you to continuously change position with a smooth commit time.

#

You do not need to set pos each frame and I believe that would still cause an annoying effect like attaching does (may be dependent on certain circumstances though), although I have never tried it.

ebon citrus
#

ok, so i tracked down the cause of the jitter, and it is SOLELY caused by the camSetDir command

#

if i drop that out, all jitter disappears

#

if i add even 0.01 cam commit time, the camera wont rotate, since im running on each frame

#

and i mean the cam wont rotate AT ALL

#

fps is static, but the camera is jittery as all hell

#

the vector im giving it is changing smoothly, but the camera refuses to rotate without jittering

#

the camera direction updates every 0.5~ seconds

#

moving the setDir into a while-loop that runs at a lower frequenzy fixed the jitter

crude vigil
#

Yes, that is what I meant that it would still cause an issue running it in each frame :)

ebon citrus
#

i see

#

albeit, the setpos needs to run on each frame

#

but! another question

#

how can i make the camera disregard collision?

#

atm, it refuses to collide with some objects and just sort of jumps around when it has to

crude vigil
#

setPos or camSetPos?

#

dunno about collision, I did not experience anything regarding that.

#

as far as I can remember, at least..

ebon citrus
#

because, at the moment im having the issue of the camera dropping to sea-level as soon as it is placed inside an object by camSetPos

mortal nacelle
#

Are hint messages local?

warm hedge
#

Yes AFAIK

mortal nacelle
#

Okay, on that note, how would I globally hint everyone? E.g., if somebody opens a restricted door it lets everyone know

warm hedge
#

remoteExec?

mortal nacelle
#

oh, thank you

next marsh
#

Not sure if this is a script thing and I have no idea how to do scripting and sadly not wanting to really learn it. Does anyone have a quick thing that can make a box spawn ai, so for instance you could walk up to it and have it spawn you a riflemen or something to join your group?

ebon citrus
#

Ok, what i have found:
When using attachTo on a fast moving object, the attached object very briefly (in render time scope) teleports to the center of the parent object before being moved to its designated position, even when setting the offset in the attachTo command

young current
#

what are you attaching? why not do it before its moving?

ebon citrus
#

I'm taking a look at RHS's moveInside script

#

Theyre moving the object inside the aircraft relative to it

young current
#

ah.. the holy grail

ebon citrus
#

It was a good read on vectors

#

Anyways, it bugs out like hell if the plane is moving

#

I just came out of shower, but i wonder if using simulation time scope would fix it

#

Otherwise it would have to be fixed engine-side

young current
#

its not really something the engine is meant for

ebon citrus
#

I suspect the parenting of an object is being reinitialized every time the attachTo command reruns

#

This could be avoided by simply changing the offset if the parent is same

#

A little bit of smarts

#

@young current arma was not meant for a lot of things, but because people took it outside its intended purpose, we have gotten a lot of nice things

young current
#

I know. I do that myself too.

#

Just wanted to make sure you know it might not be attainable

ebon citrus
#

Yes, i am very aware

young current
#

You could try using setpos commands after the attachTo

ebon citrus
#

This is more of a study than a priject

#

Setpos doesnt work when using attachTo

#

If the problem is as i suspect

#

It could be remedied with an easy engine side chabge

#

Change*

young current
#

"easy"

ebon citrus
#

That would not break any existing scripts

#

Easy as in one if-check

#

If the parent is already the parent, you dont need to reparent

young current
#

I would not make assumptions like that though

ebon citrus
#

It is a conjecture, yes

#

From logical standpoint, IF the issue is as i suspect, it would be easy

#

But i dont know the details

#

Arma 3 isnt open source

#

Pliz Bohemia, open source arma, plox

#

(Just a joke, dont take it seriously, i know the security implications this would have)

#

OR!

#

it could be that the plane's movement-position is not being updated synchronously with the attachTo command and the attached object briefly has incorrect location

#

or i might just be entirely wrong and it's something else

oblique arrow
#

so for instance you could walk up to it and have it spawn you a riflemen or something to join your group?
@next marsh That sounds like it would be relatively easy to make even without scripting knowledge and there are already some scripts that do stuff like that out there

#

The basic steps would be to
add the recruiting actions to the box (addAction)
when someone executes one of the actions:
create an ai unit
get the player that exxecuted the action
add the ai unit to the players group

#

it looks like you can do the last 2 steps using createUnit although I havent used that command before

next marsh
#

Would you be able to walk me through how to add all that in qhen I have a chance tonight?

ebon citrus
#

Is the script responsible for the Radar-display open already? Or is it engine-side/encrypted?

winter rose
#

engine-side I believe

ebon citrus
#

heck

#

i wanted to add altitude-indicators to the radar-display

#

well, i guess i'll make my own radar-display then

winter rose
#

with blackjack &…

#

maybe you can grab the display? idk

ebon citrus
#

cardgames* and professional street artists

#

yeah, i was scrolling through the Rsc configs

#

ion ui_f

#

and ui_f_jets

#

but couldnt find it with a long scrub

#

might be the AAR?

#

air-to-air-radar?

#

🤷‍♂️

winter rose
#

AAR = After Action Review no?

ebon citrus
#

okay

#

makes more sense

#

i didnt look inside

winter rose
#

an unfinished A3 feature

ebon citrus
#

i found all the radar icons

#

but i cant find the RscDisplay

#

arma 3 does a lot of their UI in sqf instead of configs, is there a reason for that?

winter rose
#

I suppose it prevents reloading to check/debug the config🙃

ebon citrus
#

maybe RscDisplayArcadeSensor

#

for the radar

winter rose
copper needle
#

Im trying to use sqf onButtonClick = player customChat [_channelD, format ["%1 folded!", name player]]; but it keeps coming up with an error saying it expects an "=" sign rather than "%". Any ideas?

cold glacier
#

Is that in a config? Or in a script?

copper needle
#

In a dialog

cold glacier
#

You probably need to wrap the whole thing in quotes, and change the quotes around %1 folded! to single quotes.

#

You might also have an issue with _channelD not being defined.

winter rose
#

^

copper needle
#

Perfect thanks! Didnt realize using " could cause an issue

fair drum
#

do the loiter waypoints actually work combat wise? it seems that aircraft loiter with its radius but won't engage any threats

mortal nacelle
#

How would I pull the value out of a while loop? E.g. while {_doingTest} do { _pos = getPos player; systemChat str(_pos) };

I would like to get _pos out so I can use waituntil

little raptor
#

@fair drum No. Loiter shouldn't be used for aircraft

#

@mortal nacelle Which value?!

mortal nacelle
#

the coordinates of the player from getpos

little raptor
#

Do you want to use it in the same handle?

mortal nacelle
#

Uhm, I can try and explain what I am doing so it will make more sense - I am trying to get the players position until they reach a certain area

#

so then I can delete the instruction marker and place another

little raptor
#

So only get it once they've reached there

mortal nacelle
#

okay, but how do i know when they have reached that point? waituntil?

cosmic lichen
#

inAreaArray

mortal nacelle
#

oh

cosmic lichen
#
waitUntil {getPos player inArea _marker; sleep 1};
mortal nacelle
#

got it, thank you. i thought i was over-complicating things

little raptor
#

@cosmic lichen It's inArea

#

It's just a single position

mortal nacelle
#

actually, if inareaarray uses the whole location of a trigger i'd prefer that

#

means there is more room for error for the person driving

cosmic lichen
#

yeah, inArea is enough

little raptor
#

@mortal nacelle If you use triggers, there's no need for inArea either

#

Just set the trigger completion statement to deleting the marker

mortal nacelle
#

alright

cosmic lichen
#

You could also work with waypoints.

#

They automatically get removed once player is close. Then the next one gets shown.

mortal nacelle
#

Is that in the editor?

#

Or do I define those locations in the script

fair drum
#

yeah just normal move waypoints that you would give to AI. if you give it to a player, it just shows them where to go

mortal nacelle
#

but how would i get that to show only when the script is called

ionic orchid
#

shouldn't that sleep 1; be at the start?

little raptor
#

yes

#

it MUST be before the end. otherwise it won't return anything.

#

how would i get that to show only when the script is called
Show what?

fair drum
#

whats the ACE command to cause surrender script wise?

#

cause if I do the surrender action from base arma, then they cannot use handcuffs

#

might be...

[unit,true] call ACE_captives_fnc_setSurrendered;
copper needle
#

How do I count the number of the same element in an array Arma 3? For instance: _1sInArray = 1 countAmountInArray [1,1,1,1,0,9,0,3] //returns 4

exotic flax
#

Probably something like this

TAG_fnc_countInArray = {
   params [["_array", [], [[]]], "_search"];
   _filtered = _array apply {_x isEqualTo _search};
   _inArray = count _filtered;
   _inArray
};
_result = [[1,1,1,1,0,9,0,3], 1] call TAG_fnc_countInArray;

btw... never say any programming language which has a function like this by default...

mortal nacelle
#

Are we able to ask questions regarding CBA functions here?

exotic flax
#

why not; a lot of people use CBA in scripting so perhaps we can also supply an answer to your question. And if not you can always ask the CBA devs directly through their official channels.

mortal nacelle
#

👍

Okay, well, I am trying for better practise to use the function 'CBA_fnc_waitUntilAndExecute' instead of waitUntil.

But, I am not getting the hang of it, and was wondering if somebody could point me in the right direction.

[{getPos player inArea p3area}, {hint "test"; deleteMarker "Driving Test"}] call CBA_fnc_waitUntilAndExecute;

exotic flax
mortal nacelle
#

Yes, I am on that documentation and I am passing the parameters that are required, the other 3 are saying optional.

I am expecting it to wait until I have reached the trigger position p3area, which worked fine with waitUntil, however, with this function, it is literally just flying through the whole of my script.

exotic flax
#

keep in mind it works differently than waitUntil

#

waitUntil blocks the code will it is allowed to run, CBA_fnc_waitUntilAndExecute will wait till _condition is true and will then run _statement

#

any code after CBA_fnc_waitUntilAndExecute will still run normaly (non-blocking)

mortal nacelle
#

Oh, how can I stop that?

exotic flax
#

put the code you want to have on hold in the _statement code 😉

mortal nacelle
#

Uhmm, confused 😦 There is like 50 lines of code though? And I am using that function 4 times within the script

#

If I put my code into pastebin you'll see what I mean

exotic flax
#

if you have a lot of code, put it in a function and call that

mortal nacelle
exotic flax
#

so you want to place the first marker, wait till person is there, and than remove the first marker and place a second one

mortal nacelle
#

yes

#

exactly that

#

until they get to the fourth marker, then i delete the vehicle and teleport them back to the spawn point

exotic flax
#

I would make 4 functions, one for each marker:

TAG_fnc_point1 = {
   // place marker etc.
   [{getPos player inArea p1area}, {deleteMarker "Driving Test"; call TAG_fnc_point2}] call CBA_fnc_waitUntilAndExecute;
};

Where you call the first function directly, and the last function will not call for the next point but remove everything and TP player.

#

although you might need to use the _args part to send data to the next function

mortal nacelle
#

which data?

exotic flax
#

the vehicle for example, since the code is executed outside of the script scope, meaning _veh does not exist inside the code block of CBA_fnc_waitUntilAndExecute (which is required to remove it again)

#

or you can simply store it with missionNamespace setVariable ["TAG_vehicle", _veh] before running the functions and then retrieve it at step 4

mortal nacelle
#

so i'd store it when i create it at the beginning of the script?

exotic flax
#

yes

mortal nacelle
#

I see, thank you

potent dirge
#

Evening fellas, is there a way to sync AI that have been spawned post-mission start to sector control?

#

Or something with a similar effect on AI behaviour

mortal nacelle
#

@exotic flax I'd need to store the location where the vehicle came out as well right?

#

Because I am teleporting to that point

exotic flax
#

in that case yes

mortal nacelle
#

👍

exotic flax
#

unless the position is always known (which is seems to be at getMarkerPos "drivingTestStart")

fair drum
#

if i do a "entity killed" mission event handler, and I run it in init.sqf with 20 people, will that code execute 20 times when someone kills a unit? theres no mention of if its global, local, or server on the wiki

exotic flax
#

Mission event handlers are specific EHs that are anchored to the running mission and automatically removed when mission is over. These events fire only on the machine where they have been added.

tough abyss
#

for years I've never been able to get in thisList to work

#

so I make a trigger with the condition dude in thisList
create a unit called dude
he enters the trigger, nothing happens

exotic flax
#

and what are the other settings of the trigger?

tough abyss
#

everything is default

#

except for whatever I put in on activation

#

for testing purposes I put hint "complete"

#

activation drop down is set to none

exotic flax
#

make sure the trigger activation is with of "Present" type

#

otherwise will always be empty (since it doesn't check for anything)

exotic flax
#

well, that won't work... since it doesn't check for anything to activate on

#

like I said; put Activation to "Any Player" and Activation Type to "Present"

tough abyss
#

I got it to work with infantry using that method, I had to set trigger owner to get it to work on vehicles

#

it's strange you have to have 2 activations instead of just the in thislist condition

#

I'd assume putting whatever in thislist is the activation

exotic flax
#

that's to prevent having EVERYTHING in thisList (like animals, objects, etc.), and to make sure the trigger is only active when needed (eg. with the Radio triggers it won't run any code until the radio command has been given)

#

it's simply to improve performance

#

and the wiki would have explained that 🤷‍♂️

tough abyss
#

didn't find that in the wiki

exotic flax
#

Any reason why this wouldn't work inside a UI 'onLoad' script:

// working code

diag_log "-- before Spawn";
0 = [_display] spawn {
   params ["_display"];
   diag_log "-- inside Spawn";
   // do some stuff with display/controls
   while { (ctrlVisible 42420001) } do {
      diag_log "-- inside While";
      // do some stuff with display/controls
      uiSleep 3;
   };
};
diag_log "-- after Spawn";

// working code

The above only prints "before Spawn" and "after Spawn", while the rest is ignored

#

and yes, I know spawn is unscheduled so the order might differ, but at the moment it's not printing anything from inside the spawn.

tiny wadi
#

Not sure whether this is scripting or not but I was curious how Arma 3 Epoch made it so when there are items on a shelf, it displays them. I am assuming its scripted, but perhaps its in the model. So my question is how do you do that?

exotic flax
tiny wadi
#

🤦‍♂️ That made too much sense, lol.

copper needle
#

How do I turn this array [[1,2], [3,4]] into an array like this [1,2,3,4]?

tiny wadi
#

you can add the two of them together

#
_mainArray = [[1,2], [3,4]];
_mainArray = (_mainArray select 0) + (_mainArray select 1);```
copper needle
#

Ill give it a go thanks!

potent dirge
#

Does anyone understand how bis_fnc_moduleSpawnAI and bis_fnc_moduleSpawnAISectorTactic work and how they cause the AI to capture sectors. I'm trying to replicate the same thing but with AI spawned after mission start.

little raptor
#

@exotic flax Because you're not referencing the control properly

exotic flax
#

which control? it doesn't even execute the spawn
I simply removed all other code (like getting the _display and _control)

little raptor
#
while {ctrlVisible (_display displayCtrl 42420001)} do {...}
exotic flax
#

the rest of the script is running file, and everything is shown/hidden properly

#

I can't use while since I need a sleep

little raptor
#

You're giving a number there

#

ctrlVisible Number

#

That's wrong

exotic flax
#

still doesn't answer my question

little raptor
#

What question?

exotic flax
#

The above only prints "before Spawn" and "after Spawn", while the rest is ignored

little raptor
#

Because you're doing it wrong. It doesn't even enter the while

exotic flax
#

so spawn is not executed at all

little raptor
#

Are you sure?

exotic flax
#

yes

#

otherwise I would asked why the while isn't working 😉

little raptor
#

Remove 0 =

#

It's not needed

potent dirge
#

@exotic flax afaik spawn creates a separate thread independent of the current script loop

little raptor
#

Not sure if it helps

#

@potent dirge That's not the reason

exotic flax
little raptor
#

That doesn't make sense tho

exotic flax
#

@potent dirge I know spawn creates a separate threat, but it should still print stuff in my RTP

little raptor
#

Displays could have the same IDC

exotic flax
#

I can fix that the moment it actually gets there 🤷‍♂️

potent dirge
#

replace (ctrlVisible 42420001) with true just for testing sake

little raptor
#

Is that a code you put in onLoad?
onLoad = "spawn thatFnc"

#

He said it doesn't even get there @potent dirge

exotic flax
#
onLoad = "[""onLoad"",_this,""RscDisplayMain"",'UNITAF_NewMenu'] call (uiNamespace getVariable 'BIS_fnc_initDisplay')";
#

and my code is in RscDisplayMain.sqf (within 'onload' case)

#

PS. I know it's also a #arma3_gui question, but since it's a script which isn't doing what I'm expecting I placed it here

#

but changing it to while {true} do { still doesn't make the spawn work

little raptor
#

have you defined _display?

exotic flax
#

yes and is used before and after my code

little raptor
#

Although it should work even if you havent

#

A silly question. Isn't the scheduler busy or something?!

#

diag_activeScripts

exotic flax
#

it shouldn't, but testing now

little raptor
#

You can spawn a simple code, see if that works:

[] spawn {
systemChat "ScriptDone"
}
#

If not, the scheduler is busy

#

Maybe due to a while loop without sleep

exotic flax
#
22:09:04 "-- before Spawn"
22:09:04 "[0,0,0,0]"
22:09:04 "-- after Spawn"
22:09:04 "[1,0,0,0]"
little raptor
#

Did you try a simple spawn, just to make sure that it doesn't work at all?

#

Like what I posted above?

still forum
#

what is "scheduler is busy"?

little raptor
#

If it has too many scripts running, it will be busy

#
for "_i" from 0 to 100 do {
[] spawn {while {true} do {}}
}
#

Now it is busy

still forum
#

what does "busy" imply?

#

scheduler is always "busy" if it has atleast one script

little raptor
#

It means it has too many scripts before reaching a code

#

I mean in relative terms! 🙂

still forum
#

newly spawned scripts are executed immediately

exotic flax
#

before the spawn it has none, after the spawn it has 1 🤷‍♂️

little raptor
#

No they're not

still forum
#

they never ran, so they have the longest time since they last ran, meaning they execute next

little raptor
#

What if it is at the end of the queue?

still forum
#

what end?

#

I just told you how it works

#

so they have the longest time since they last ran, meaning they execute next

little raptor
#

Last one added

still forum
#

That's not a thing

#

I just told you, new script executes right away

exotic flax
#

the only thing I can image is that the scheduler is not running when in the main menu, and therefor not running spawned code... but that doesn't sound logical

still forum
#

main menu with world loaded in background? or world=empty?

little raptor
#

But if you do this:

for "_i" from 0 to 1000 do {
[] spawn {while {true} do {for "_i" from 0 to 1e5 do {}}}
}

And then spawn a new code, it won't execute right away @still forum

still forum
#

could make a difference

#

scheduler sorts by last execution time. newly spawned script has "0" so is supposed to execute right away

exotic flax
#

I've got world=VR and intro is running

#

@little raptor that code will never run properly, since _i inside the spawn doesn't exist 🤷‍♂️

still forum
#

don't think I ever tried running scheduled in main menu

little raptor
#

That number was too big!

still forum
#

since _i inside the spawn doesn't exist 🤷‍♂️
huh? why would it need to?

exotic flax
#

true... the for loop has it's own _i

little raptor
#

@exotic flax Yes it does

exotic flax
#

anyhow... seems that spawn simply doesn't work in the main menu

still forum
#

And then spawn a new code, it won't execute right away
yeah as I said, it sorts by last execute time, there you spawn 1000 new scripts with last exec time of 0

#

so spawning one more with time 0, they are all equal

little raptor
#

I'm sure it didn't. Let me test

#

I could be wrong

still forum
#

for "_i" from 0 to 1000 do {
[] spawn {while {true} do {for "_i" from 0 to 1e6 do {}}}
};
[] spawn {hint "test"; };
this won't hint "test" immediately, because you have 1001 scripts with last exec time of 0.
But when many scripts are running, and have been running for a while, new script gets "prio"

little raptor
#

This is how I tested:

for "_i" from 0 to 1000 do { 
[] spawn {while {true} do {for "_i" from 0 to 1e4 do {}}} 
}

I closed the menu, waited for 2 seconds:

[] spawn {systemChat "processed"}
#

And it didn't execute immediately

still forum
#

when I do that I drop to about 2fps

little raptor
#

I reduced the number!

#

it was too big

still forum
#

and you get one script execute per frame, so you need 1000 frames to get to the last spawn

little raptor
#

now it is 1e4

still forum
#

its weird, that for loop seems to not suspend after 3ms

#

it should not be able to run more than 3ms

little raptor
#

Yeah

#

That's what I meant

exotic flax
#

ok, so I can see that the spawn is added to the scheduler with diag_activeSQFScripts, but is not running...

still forum
#

probably because the NewExpression instruction is missing

little raptor
#

Maybe scheduler doesn't work in the main menu

still forum
#

for "_i" from 0 to 1000 do {
[] spawn {while {true} do {for "_i" from 0 to 1e6 do {1;}}}
};
[] spawn {hint "test"; };
this suspends correctly now that it has the NewExpression instruction in the loop

little raptor
#

Oh

#

But still it doesn't show the systemChat for me

#

Use 1e4:

for "_i" from 0 to 1000 do { 
[] spawn {while {true} do {for "_i" from 0 to 1e4 do {1}}} 
}
queen cargo
#

Sooooo
A new way to haxor in arma I guess
Making the game freeze essentially

still forum
#

which freeze?

queen cargo
#

The 2fps thingy

still forum
#

2fps is not a freeze tho

#

and you can just crash the game if you want, so why freeze it

queen cargo
#

Can promise ya that most people would report it as "random freezing"

potent dirge
#

Hey, while you're here please is there anyway to sync AI to Sector Control after mission start. I've looking into BIS_spawnAI and BIS_spawnAISectorTactic functions but can't seem to find anything relating to AI behaviour.

little raptor
#

this won't hint "test" immediately, because you have 1001 scripts with last exec time of 0.
But when many scripts are running, and have been running for a while, new script gets "prio"
That's what I meant by "queue". So technically, the scheduler is "busy"

exotic flax
#

in short; when those modules are called it will run some FSM files to manage the AI

#

That's what I meant by "queue". So technically, the scheduler is "busy"
Although I can see the scheduler is empty, so that's not my issue

little raptor
#

Maybe it simply doesn't work in the main menu

#

Or maybe it gets terminated immediately after running

exotic flax
#

I see it in diag_activeSQFScripts, so it's there

little raptor
#

Or maybe the scheduler gets "cleared" and reset

#

I'm not sure what's going on. But normally your code should execute as it is correct and I can't think of any other reason why it doesn't work. Maybe Dedmen can check if what I said is true?

still forum
#

script simulation seems to always run, can't see anything that would disable it in main menu

little raptor
#

@exotic flax How does your display get created?

exotic flax
#

automatically 😉

little raptor
#

If you create it during a mission, does it work? (I mean the spawn)

exotic flax
#

it removes the default main menu, and replaces it with a custom one

little raptor
#

^

exotic flax
#

when using createDialog "RscDisplayMain" is does run the spawn

little raptor
#

ok. So whatever it is it is related to the scheduler not working in the main menu

#

Maybe you can find a more "creative" way to work around it?

#

Like, instead of using onLoad, use an init code that gets executed in the main menu

#

And if your display exists, it does whatever it should

still forum
#

you checked that diag_activeScripts lists it after you added it

#

try logging a second later and check if its still there

#

maybe the display is loaded before the background mission is loaded, on mission load, scheduler list is emptied. Maybe it gets emptied right after you added your scirpt

little raptor
#

Exactly what I was thinking!

exotic flax
#

when checking diag_activeScripts about 100 lines of code later it still exists

still forum
#

100 lines of code in unscheduled is still instant

little raptor
#

It doesnt matter how many lines after

exotic flax
#

so how to do that... I can't execute scheduled code, so can't wait a second in that code...

little raptor
#

Do what I said

#

^

still forum
#

a button

little raptor
#

Use an init function that gets executed in the main menu

still forum
#

or maybe b button

little raptor
#

Yeah but that would be weird since he's trying to replace the main menu!

still forum
#

I'm sure he can add a quick button just for testing

little raptor
#

For testing, yeah of course!

exotic flax
#

at least someone is helping

little raptor
#

which one?! 😅

exotic flax
#

exactly 😉

#

onLoad:

22:52:32 "-- before Spawn"
22:52:32 "[0,0,0,0]"
22:52:32 "-- after Spawn"
22:52:32 "[[""<spawn>
params [""""_display""""];
_control = (_display displayctrl 42420001);

diag_log """"-- inside Spawn"""";
diag_"","""",true,1]]"

onButtonClick:

22:52:58 "-- some button --"
22:52:58 "[37,0,0,1]"
22:52:58 "[[""<spawn>
private _display = displayNull;
waitUntil {
_display = if is3DEN then {findDisplay 313} else {findD"",""cau\discordrichpresence\fn_init.sqf [DiscordRichPresence_fnc_init]"",true,110],[""<spawn>
while {TRUE} do {
sleep 300;
skipTime (_this - dayTime);
};
"",""a3\map_VR_scenes_f\scenes\intro1.VR\initintro.sqf"",true,9],[""BIS_fnc_displayMission"",""A3\functions_f\respawn\fn_initRespawn.sqf [BIS_fnc_initRespawn]"",true,33],[""<spawn>
while {!isNull _this} do {
_this setDir (direction _this + (_this getVariable """"BIS_VR_speed""""));
sle"",""A3\functions_f_bootcamp\VR\fn_VRSpawnSelector.sqf [BIS_fnc_VRSpawnSelector]"",true,40],[""<spawn>
while {!isNull _this} do {
_this setDir (direction _this + (_this getVariable """"BIS_VR_speed""""));
sle"",""A3\functions_f_bootcamp\VR\fn_VRSpawnSelector.sqf [BIS_fnc_VRSpawnSelector]"",true,40],[""<spawn>
while {!isNull _this} do {
_this setDir (direction _this + (_this getVariable """"BIS_VR_speed""""));
sle"",""A3\functions_f_bootcamp\VR\fn_VRSpawnSelector.sqf
#

so doesn't exist anymore 🤔

little raptor
#

Yeah

#

Did you try an init?

exotic flax
#

on what?

little raptor
#

create a function

#

And set:
postInit=1

#

and let it do what you're trying to do with your display

#

It will work

#

AFAIK

#

@exotic flax Something like:

[] spawn {
  _maxTime = 3;
  waitUntil {!isNull findDisplay IDD || time > _maxTime};
  //now do what you want
}
exotic flax
#

that should only work when there's no -world=empty

#

but will try

#

so the spawn is now working, and the while

#

not doing what I want, but that's another problem I have to tackle

little raptor
#

What do you mean?

#

If it works, you can do whatever you want

#
[] spawn {
  _maxTime = 3;
  waitUntil {!isNull findDisplay IDD || time > _maxTime};
  _display =  findDisplay IDD;
  // working code

diag_log "-- before Spawn";
0 = [_display] spawn {
   params ["_display"];
   diag_log "-- inside Spawn";
   // do some stuff with display/controls
   while { (ctrlVisible 42420001) } do {
      diag_log "-- inside While";
      // do some stuff with display/controls
      uiSleep 3;
   };
};
diag_log "-- after Spawn";

// working code

}
exotic flax
#

but what I want is not working yet, but at least I can now make that work

little raptor
#

🤷‍♂️

exotic flax
#

the code is executed correctly, but the code itself is not working yet (as in, I made a mistake somewhere inside the spawn

little raptor
#

ok

#

does it work when -world=Empty?

exotic flax
#

doesn't look like it

#

probably same issue as CBA Settings

#

because only preStart = 1 should run even without a mission loading, but is too early

little raptor
#

Are you sure?

#

I said postInit because I was sure it wasn't early

#

But I'm not sure about preStart

exotic flax
#

preInit works

little raptor
#

Good!

exotic flax
#

but not with -world=empty, which is the least of my problems

little raptor
#

oh

#

Yeah

#

screw it

#

😝

fair drum
#

so when respawn tickets reach 0, and I add more tickets, it changes the spawn typee to on dead body instead of base... anyone know why?

mortal nacelle
exotic flax
#

as in; got hit by vehicle driven by another player, or getting shot by a gun on a vehicle?

#

although _source is the part you want to be checking

#

and perhaps _instigator

mortal nacelle
#

yeah, exactly that, the area will be closed so nobody will be able to shoot however, people might just think its funny to ram eachother

#

and when the vehicle gets damaged i have it set to fail instantly

#

but i'd like to exitwith if the damage is done by another vehicles player

winter rose
#

if damage zone is "", it is either a fall or a vehicle collision
if damage zone is "" and there is an instigator, then it is driver's fault

exotic flax
#

why not simply player allowDamage false when in the area?

#

or out for that matter

broken forge
#
hint "Objective Alpha has been taken by BLUFOR."; 
redalpha1 call BIS_fnc_removeRespawnPosition; 
redalpha2 call BIS_fnc_removeRespawnPosition;```

Doesn't actually delete the respawn points given. Anyone know why? (Using the 3den editor respawn module)
broken forge
fair drum
#

where should I define variables if init.sqf is too slow by the time they need to be used?

fair drum
#

im aware and have been reading it

#

but expressions of eden editor are not JIP

#

which would be a init box in the editor correct?

copper raven
#

no, init boxes are one level below that

fair drum
#

I just created a function with the variables and put a preinit value to it

#

should be the fastest correct?

quartz pebble
#

Anyone can point how to use setVelocity in a junction with setVectorDirAndUp ?

//eachFrame
_vel = velocity _vehicle;
_vehicle setVectorDirAndUp [...];
_vehicle setVelocity _vel;

results into _vehicle rotating on its position without movement;

willow hound
#

@quartz pebble What are you trying to achieve?

little raptor
#

@quartz pebble
If you're trying to rotate the object then set its velocity so that it moves in the new direction:

_veh setVectorDirAndUp [...];
_veh setVelocityModelSpace [0,_speed,0]

this causes the vehicle to move forward
Alternatively:

_speed = vectorMagnitude velocity _veh;
_veh setVectorDirAndUp [_dir, _up];
_veh setVelocity (vectorNormalized _dir vectorMultiply _speed);

To preserve last relative velocity:

_vel = velocityModelSpace _veh;
_veh setVectorDirAndUp [...];
_veh setVelocityModelSpace _vel
quasi cobalt
#

Hey, I'm syncing a support requester module to the player with "player synchronizeObjectsAdd [Support_Requester_01];" using a trigger and it's working perfectly. Can I do something similar but syncing a provider to the Support_request_01 module? As in, I have added a some arti and CAS to the support requester already but I want to add a bombing run later on in the mission with a trigger.

little raptor
#

yes

quasi cobalt
#

How would one do that?

#

I've tried "Support_request_01 synchronizeObjectsAdd [NewProvider];" but that didn't seem to work.

little raptor
#

You have to sync the provider module to the provider unit

_providerUnit synchronizeObjectsAdd [Support_cas_provider];

, then:

[player, Support_Requester_01, Support_cas_provider] call BIS_fnc_addSupportLink;
quasi cobalt
#

If the Provider is a virtual one, I don't have to sync it to a unit right?

little raptor
#

I'm not sure

exotic flax
#

you still have to sync it with the (virtual) provider

quasi cobalt
#

BIS_fnc_addSupportLink; worked a treat! 😄

#

YEah, I have the virtual provider setup and sync'd to the trigger (Not sure that is needed but it's working) and then using BIS_fnc_addSupportLink; on the trigger.

surreal anvil
#

Hi guys! Trying to achieve a thing here:

I have a truck named truck1.
I attach an ATV called ATV1 to it
I add a HoldAction to truck1 that detaches ATV1

I now want this script to attach an ATV and add the HoldAction to any object with a variable name that containts "truck". Is there a way to do that?

Here's the script in its current form.


goose1 = "OPTRE_M274_ATV" createVehicle position truck1;
goose1 attachTo [truck1,[0,0,1]];
goose1 setVectorUp [0,2, 1];

goosePodList = 
[ 
goosePod1, 
'Unload Mongoose', 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
'(_this distance _target < 3)', 
'_this distance _target < 3', 
{}, 
{}, 
{ 
goose1 attachTo [truck1,[0,-3,1]]; 
detach goose1; 
}, 
{}, 
[], 
3, 
12, 
true, 
false 
] 
call BIS_fnc_holdActionAdd;
winter rose
#

@surreal anvil ```sqf

surreal anvil
#

Yass, working on it

#

There we go 😄

little raptor
#

I now want this script to attach an ATV and add the HoldAction to any object with a variable name that containts "truck". Is there a way to do that?
So if I understand correctly, you've set up some vehicles called "truckX" and you want to add the hold action to all of them?
And also attach the ATVs?

surreal anvil
#

Yeah, regardless of their name. So for instance, I have truck1, truck2, truck3, all the way up to truck15.

I'd like the script to attach an ATV and add the HoldAction to any object that has a variable name that contains "truck"

little raptor
#

its easy

#
{
  if ("truck" in vehicleVarName _x) then {
    _x call _script
  }
} forEach vehicles;
surreal anvil
#

Oh my

little raptor
#
goose1 = "OPTRE_M274_ATV" createVehicle position _this;
goose1 attachTo [_this,[0,0,1]];
goose1 setVectorUp [0,2, 1];

goosePodList = 
[ 
goosePod1, 
'Unload Mongoose', 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
'(_this distance _target < 3)', 
'_this distance _target < 3', 
{}, 
{}, 
{ 
goose1 attachTo [_this,[0,-3,1]]; 
detach goose1; 
}, 
{}, 
[], 
3, 
12, 
true, 
false 
] 
call BIS_fnc_holdActionAdd;
surreal anvil
#

I'm gonna give this a try right now 😄

little raptor
#

Also, don't use position for createVehicle. It requires an AGL position. You're providing an AGLS position.

surreal anvil
#

Though won't this script still just add more HoldActions to goosePod1?

little raptor
#

Yes

#

I'm saying the position format is wrong

#

Since you're attaching the atv, it won't matter

#

It was just a tip

#

You could even put [0,0,1e3] or any other position

surreal anvil
#

sqf createVehicle getPosASL _this;

little raptor
#

No

#
"AAA" createVehicle ASLtoAGL getPosASL _this;
surreal anvil
#

Oh, AGL. I can't read

little raptor
#

There's no getPosAGL command, so you have to use that

surreal anvil
#

Thanks for the tip. Will likely save me headaches down the road 😄

little raptor
#

No problem! If you didn't intend to place the vehicle on top of an object, it wouldn't make much difference

velvet merlin
#

is there a way to close/kill the two cutRsc from the main menu?

["MainMenuDummy","MainMenu"]

#

BIS_fnc_rscLayer is not yet available in main menu

surreal anvil
#

So! I've managed to get the script to add ATVs to all the "trucks", now renamed "goosePod".

The issue I'm having now is telling the HoldAction how to detach the ATV from the goosePod.

Here's the script snippet:

{
  if ("goosePod" in vehicleVarName _x) then {
    _x call {
        
    goose1 = "OPTRE_M274_ATV" createVehicle position _this;
    goose1 attachTo [_this,[0,0,1]];
    goose1 setVectorUp [0,2, 1];

[ 
_this, 
'Unload Mongoose', 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
'(_this distance _target < 3)', 
'_this distance _target < 3', 
{}, 
{}, 
{ 
{
  detach _x;
} forEach attachedObjects _this;
}, 
{}, 
[], 
3, 
12, 
true, 
false 
] 
call BIS_fnc_holdActionAdd;}
  }
} forEach vehicles;

I'm getting an error saying that _this in the following snippet is of type array but it's expecting of type object. I'm a bit confused right now. 😄 ```sqf
{detach _x; } forEach attachedObjects _this;

little raptor
#

_this is not defined there

#

I mean its definition is different

surreal anvil
#

So it's not implicitly referring to the goosePod in this case?

little raptor
#

in other words, that's what _this now is

#

simply put, the truck is now _target, or _this#0

#

If you change the code to either of these, it'll work:

params ["_target"];
{detach _x; } forEach attachedObjects _target; 

or

{detach _x; } forEach attachedObjects (_this#0); 
surreal anvil
#

And what I wanted to say by that is, it's working

little raptor
#

Yeah 😅

surreal anvil
#

And if I wanted to grab the actionId it'd be _this#2?

little raptor
#

yes

#

Or just use params

surreal anvil
#

Thanks a lot, Leopard. Being able to iterate through a session's list of vehicles has opened a lot of doors for me 😄

little raptor
#

@surreal anvil By the way, you didn't need to do : _x call {...} there. I only said that in case you wanted to execute that as a function. If you only want to use that code there and don't need a function, you can write:

{
  if ("goosePod" in vehicleVarName _x) then {
    goose1 = "OPTRE_M274_ATV" createVehicle position _x;
    goose1 attachTo [_x,[0,0,1]];
    goose1 setVectorUp [0,2, 1];
...
...
...
surreal anvil
#

Even more efficiency? Don't mind if I do! ❤️

ebon citrus
#

what would be the scripting command to get the path of the user's profile-directory?

#

Or is this even possible?

#

can script even access content in the profile-folder?

young current
#

afaik, no

ebon citrus
#

let's say, i take a screenshot and it is saved in the profile folder, i cant then use that ascreenshot in the mission?

young current
#

that would be pretty unsafe

ebon citrus
#

fair enough

young current
#

could be wrong. just my gut feeling

ebon citrus
#

i mean the arma 3 profile folder

#

i dont see how that could be unsafe

winter rose
#

no can do, anyway.

ebon citrus
#

unless you store your passwords in the arma 3 profile folder

#

ok

winter rose
#

you could get it while developing, that's it

ebon citrus
#

can i capture the user's screen in some way and use that?

winter rose
#

no

ebon citrus
#

shame

#

i wanted to be able to take screenshots during the mission and display them in the credits

winter rose
#

a nice idea indeed, limited by the technology of our time

ebon citrus
#

welp, i' guess i'll have to be satisfied with saving some components of the scene and creating them in the same place and use PIP to display that scene

#

just people with PIP disabled wont have such a good experience

winter rose
#

if in credits, you can use a camera?

tough abyss
#

hey guys i was trying to make a scene for a screenshot, im searching for a script to light up the lights of empty vehicles

ebon citrus
#

@winter rose i had a poke around the credits script

#

and i managed to make the background transparent

#

so i can paste texture-surfaces behind it in the scene

#

and then project camera-content to that texture surface by PIP

#

and i also added my own twist to the credits scene

#

once im done with it, i'll post a preview of what im doing

#

just making a story-mission for a unit

winter rose
#

…why not using a camera behind the credits scroll?

ebon citrus
#

?

#

because i want the "pictures" to be offset

#

so that there is a main-scene

#

and then the "pictures" to the sides

winter rose
#

oh, ok then
indeed PiP for two different pics

ebon citrus
#

the main scene doesnt need pip

#

i use the main camera for the main scene

#

and then i create 2-polygon surface in the view of that camera

#

and project the view of another camera to that surface using PIP

winter rose
#

the main scene doesnt need pip
…I figured that much

ebon citrus
#

this is a bit hacky-way

#

but it will work

winter rose
#

and then i create 2-polygon surface in the view of that camera
if you have access to controls, you could display PiP on one?

ebon citrus
#

controls support PIP?

#

wait! ofcourse they do

winter rose
#

I believe so, even ogv

ebon citrus
#

im so stupid

#

excellent

#

yeah, so i'll make a control

#

with some polaroid-edges

#

and then add PIP to the center of it

#

blur the camera effect enough to that it's not obvious

#

BLAM!

#

picture

#

because the idea of the story is that one of the player characters is a photographer

#

and "takes pictures" throughout the story

winter rose
#

is the main scene static?

ebon citrus
#

and i want it to display the player's gear and positions correctly

#

fairly static, yeah

#

but not STATIC

#

there is movement to the main scene

#

wind blowing trees and grass and the sky

winter rose
#

I would say… you could invert PiP ←→ real render (if it is easier to you)

ebon citrus
#

the PIP is static

#

the PIP scene

#

and no, it's not easier

#

this way is easier

surreal anvil
#

I've been googling a bit trying to find how to execute pre-existing actions on objects like turning on the lights, opening a door, etc. Can somebody point me in the right direction?

willow hound
#

For vehicles, reading the subentries of UserActions in the config viewer usually yields all readily available animations.
For map building doors, the Edit terrain object module works best in my experience.

Lights are trickier, especially if AI is in control of the vehicle. The AI will do whatever it wants with all vehicle lights, so the easiest workaround for turning (collision) lights off in AI controlled vehicles is to damage them with the setHit command. For lamps like street lights, switchLight is available.
There are a few other light commands for other use cases here: https://community.bistudio.com/wiki/Category:Command_Group:_Lights

shell cipher
#

setpilotlight and setcollisionlight with the disableai "lights" command will force lights on/off and stop ai from changing it.

reef edge
#

Any idea why the return of canAdd would change from false to true after dropping and picking up your backpack? The value from loadBackpack does not change. In case it has any effect, I increased the maximumLoad config value for the backpack. addItem will still work even though canAdd returns false, but I use canAdd to check available space before adding gear.

tough abyss
#

is there a script to check for 0 respawn tickets?

#

I'm using the respawn tickets module but I want to have a custom mission end when it reaches 0

reef edge
#

Alright, there's some voodoo going on. Adding a launcher weapon seems to mess with things. With a half-full backpack and no launcher weapon, player canAdd "item" returns true. After adding a launcher weapon, which automatically takes a round out of the backpack, player canAdd "item" returns false, even though there is more room in the backpack now.

gilded rover
#

does setViewDistance hardlock the view distance in a way that others cannot change it , or will they be able to lower it. in a mp scenario

finite sail
#

be aware that in MP, the view distance is set by the server,

#

players changing their own viewdistance has no effect

#

unless the mission allows them to use a script or mod that does it

little raptor
#

@reef edge If you're sure it's a bug, report it on feedback tracker so it can be fixed.

winter rose
short flame
#

ok thanks

compact maple
#

Hi, extdb3 bitbucket link got removed ?

#

Im not able to retrieve it

ionic orchid
#

fairly sure the answer is no, but does anyone know of a way to stop enabled UI controls being brought to the front when you click on them?

quasi cobalt
#

Jesus christ. They have made the editor so much better since last time I used it properly...

little raptor
#

@ionic orchid Yes. Add an event handler to it, and when it's clicked on, set the focus on some other control:

onMouseButtonDown= "ctrlSetFocus (ctrlParent (_this0) displayCtrl IDC)"
tiny wadi
#

Any idea why vehicle player is returning the player even though I am in a vehicle?

winter rose
#

@tiny wadi mods perhaps?

outer fjord
#

So trying to read up on applying PIP's into monitors. I noticed there was talk about Laws of War updating some sort of functions to this? Or is it still the 'create a fake camera' the most used method like in Killzone's tutorial?

tiny wadi
#

@winter rose Not sure, I am running mods but I tested it in the default offroad and got the same result

ionic orchid
#

@little raptor cheers, I'll see if it helps

little raptor
#

@tiny wadi vehicle player might be the same as the name of the player, but it's not actually the player. Did you test: vehicle player == player?

#

Typically, when vehicles don't have varNames and you use : vehicle player, the command returns the effectiveCommander's name

tiny wadi
#

Ahhhhhh okay, that could be it. Let me check

#

Yeah that was it. Thanks!

little raptor
#

So you just make sure the focus is on that control. No need to add onMouseButtonDown to every control.

ionic orchid
#

I haven't tried it out, but my worry is if I have more than 2 controls stacked then I'll have to ctrlSetFocus on them all to get them into the proper order
I've already moved onto a different answer to my problem, but it's worth checking out anyway because I've run into this in the past

#

I don't know if you remove the focus if it puts the control back where it was

quasi cobalt
#

Normally my Google-Fu is pretty good but when it comes to Eden stuff it's hard.
Can someone link me something about the best way to go about creating large missions?

#

I have a mission that I want to last for a long time with heaps of different little missions that will require loads and loads of different units. I'm asusming just placing them down over the map on mission start is going to lag out everything. Like do you need to delete certain triggers and objects and the sorts once a mission is complete?

#

I

young current
#

Id wager there is not such thing written down for such a complex thing

#

so its not your google-fu failing, there just isnt such full guide in existence

quasi cobalt
#

I've have a script that seems to work so I can call it and it spawns units on a trigger but my issue is I can't find information about the cfggroups or what not.

#

The "path" to the units I want.

young current
#

then you need to figure out smaller question like that and try look for them or ask them here

quasi cobalt
#

@young current Thanks mate. Was killing myself googling the same things over and over -.-

young current
#

"how to make a large mission" however is too general

quasi cobalt
#

Yeah I was googling things like "Eden large missions clean up" and the sorts. Few random forum posts but nothing useful.

#

Does the Eden editor spawn in the objects even if they are out of spawn / view range?

#

Or the engine or whatever handles that side of things haha.

little raptor
#

@ionic orchid No. You only set the focus on a control that is NOT one of those stacked on top of each other (only one control can be in focus at any time).
You can even use a fake button that is either hidden or off-screen as focus ctrl

#

Once you change the focus, the control orders are reset

#

I know this for sure because I use it in my mod

ionic orchid
#

coolio

ebon citrus
#

Can i use doTarget on a player using a tsrgeting pod?

#

I want to set the target fo the targeting pod

ionic orchid
#

it's a bit awkward in my case (and I've already ditched this idea) as I've created a new RscMapControl to overlay the existing 12/51 main map
I have extra controls in that display, and when I click on the new map it pops on top of everything
so it'll be interesting to see how fiddling the focus affects the map

quasi cobalt
#

What language is this scripting in btw?

little raptor
quasi cobalt
#

I gotta go learn some syntax. It's almost the complete opposite of other languages I'm used to.

ebon citrus
#

@little raptor oh cheers

#

I was going to try `lookAt

`

#

I'll take a look at this tomorrow

#

Thank you!

little raptor
#

@ionic orchid If you happen to have used my AIO commanding, menus, that's exactly the problem I had with the waypoint menu. That's what I did to fix it

ebon citrus
#

@quasi cobalt it's SQF

#

Here's some light reading on getting started with sqf

ionic orchid
#

good to know you've been in the same position! thanks for the help

little raptor
#

@quasi cobalt It's a custom-made language.

#

And it bears a lot of similarities to C IMO

quasi cobalt
#

Was gonna say, never heard of SQF before.

#

Thanks for the link @ebon citrus

#

"Scripting is not a solution to everything." Hahaha could have fooled me.

#

As the language / functions changed much over the years? If I find a script from like 2015 am I going to have to look over it and update?

cold glacier
#

Not really @quasi cobalt - I'm pretty sure 99% of anything you come across is going to work just fine.

#

In some cases, it'll just be using older syntax/techniques, which by itself isn't a bad thing, but better ways may have come along since then.

#

I have a mission that I want to last for a long time with heaps of different little missions that will require loads and loads of different units. I'm asusming just placing them down over the map on mission start is going to lag out everything. Like do you need to delete certain triggers and objects and the sorts once a mission is complete?
@quasi cobalt - Also, yeah, Arma really isn't a fan of large numbers of AI - though the biggest performance hits come from the number of AI that are in combat. Usually then followed by AI that are actively moving, then AI that are idle.

Personally, I always try to stick to a hard limit of 200 AI at any one time, though the number depends on how good your server is. IMO less than 100 is generally advisable, particularly if you can stick to < 100 in combat at any one time.

One thing that might be of use to you is https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation - it allows you to set it up so simulation is disabled on any AI that are too far away from players. This can help improve performance, though bear in mind units won't move, fight or take damage when simulation is disabled.

#

However, if you're building a large, relatively static mission, it might save you from going too far down the scripting rabbit hole, and doing full dynamic spawning of AI like a lot of missions do.

quasi cobalt
#

@cold glacier Thanks mate. Having some trouble getting a Heli service script to work.

#

It's from 2017 so not as old as some of the others I've found.

ionic orchid
#

@cold glacier cheers for mentioning that system, I had rolled my own dynamic unit handler and following that page will let me delete a bunch of code

quasi cobalt
#

That Dynamic Simulation looks amazing. Thank you.

#

That was my thinking Spoffy. These other huge missions that I can't see spawning all the enemies you encounter at the start of the missions

cold glacier
#

No worries! Sometimes it's worth going with a custom solution, really does depend on your use case. But if you want to place a big number of AI up front, and no have then lag your server, it's a solid bet. :)

quasi cobalt
#

ServiceHeli.sqf


_veh = _this select 0; 

_vehType = getText(configFile>>"CfgVehicles">>typeOf _veh>>"DisplayName"); 

  

if (_veh isKindOf "helicopter") exitWith {  

  

                _veh sidechat format ["Servicing %1.", _vehType]; 

                _veh setFuel 0; 

                sleep 3; 

                 

                _veh setVehicleAmmo 1;               

                _veh sidechat format ["%1 Rearmed.", _vehType]; 

                sleep 3; 

  

                _veh setDamage 0;           

                _veh sidechat format ["%1 Repaired.", _vehType];             

                sleep 3; 

  

                _veh setFuel 1; 

                _veh sidechat format ["%1 Refueled.", _vehType]; 

                sleep 2; 

  

                _veh sidechat format ["Service Complete", _vehType]; 

};```

Trigger Condition

`call{{_x iskindof "helicopter" && isTouchingGround _x && speed _x < 1} count thislist > 0  } `

OnActivation

`call{_handle = [(thisList select 0)] execVM "scripts\ServiceHeli.sqf";}`
#

Woo, sorry... Thought it made it smaller. Should this work or am I wasting my time trying to work it out?

cold glacier
#

Yeah, right idea, no reason something like that shouldn't work.

#

Couple of issues with it off the top of my head (literally about to sleep, so can't really go into too much detail)

#

Condition and OnActivation - Suppose thisList consisted of two objects: [Man, Helicopter]

#

Your Condition would loop through the list, and find that the helicopter met all of the requirements.

#

So it would activate the trigger.

#

However, the trigger passes the very first item in thisList every time - in this case, the man.

#

So you'd end up with the wrong object being passed to ServiceHeli.

#

Now, the second issue is that setFuel, setVehicleAmmo, both require the vehicle to be local to the computer that the SQF is running on.

#

(You can see 'A Local' in the top left of the wiki page, meaning the arguments to the command need to be local to the machine it's running on)

#

However, vehicle locality is passed around a lot. Usually, vehicles are local to whoever is driving them.

#

So if your trigger runs on the server, and the pilot lands in the trigger zone, the vehicle is on the pilot's machine, but the code is on the server. Those commands then won't work properly.

#

(This is all assuming your mission is multiplayer)

#

I recommend having a read of this page to get a grasp of those concepts.

#

Other than those issues @quasi cobalt, I don't see any real reason why that script wouldn't work. But I'm tired, and might have missed something!

quasi cobalt
#

@cold glacier You're a legend! Thanks heaps mate.

#

I understand what you mean so that gives me something to look at. Thank you 🙂

quasi cobalt
#

I understand yet can not get it working. I tried 2 other scripts as well with no luck, similar concepts.
Has anyone got a heli rearm/repair script that they know works so I can at least 100% confirm it's me missing something haha.

daring sentinel
#

Is there any to make delay due to the vehicles speed differentness
(I want to make particle effect rear of the vehicles)

copper needle
#

How do I filter arrays with nested arrays to remove duplicates like:
[[[1,2],[3,4]], [[3,4],[1,2]], [5,6]] into [[[1,2],[3,4]], [5,6]]

gilded rover
#

be aware that in MP, the view distance is set by the server,
@finite sail yes , thats the problem , when i host an MP server , view distance drops to 1km (start of the fog) , regardless of my view and object distance (I host non-dedicated) thats why i wondered if there is a way to hardcode view range

tough abyss
#

@copper needle you could organize that array into a tree, keep all the path information like this:
[[[ [value: 1, path: [0, 0, 0]], [value: 2, path: [0, 0, 1] ], [ [value: 3, path: [1, 0, 0] ... etc ... ]
and then filter out the duplicates, then reconstruct an array using the paths. that way all duplicate leaf items are gone but the structure of the array is still kept
duplicates can be checked by like so:

checked = []
for item in list-to-check:
  count_before = count checked
  checked pushBackUnique item
  if count checked > count_before:
    the item isn't a duplicate
  else
    the item is a duplicate

from my experience pushBackUnique has decent performance

#

the issue is [[1, 1]] counts as a duplicate and will become [[1]], don't know if thats what you want

copper needle
#

I appreciate it thanks!

#

Another question

#

If I have an array like this: [5, 87, 8, 6, 7, 14, 4] How do I detect that there are 5 numbers that go sequentially (4, 5, 6, 7, 8)?

winter rose
#
private _array = [1,2,3,4,3,2,1,0,6,7,9,10,11];

private _wantedLength = 5;
private _currentSequence = [];

{
    if !(_currentSequence isEqualTo []) then
    {
        private _previousValue = _currentSequence select (count _currentSequence -1);
        if (_x != _previousValue + 1) then
        {
            _currentSequence = [];
        };
        _currentSequence pushBack _x;
    } else {
        _currentSequence = [_x];
    };
    if (count _currentSequence == _wantedLength) exitWith {};
} forEach _array;

_currentSequence; // or count _currentSequence == _wantedLength if you want a boolean
```(fixed and working)
winter rose
#

@copper needle ↑

compact maple
#

Hello, if I connect on my server, then I use the cmd _marker setMarkerPosLocal [-999999,-999999,0];
then I go in the lobby (without disconnecting), then spawn again, the marker is still at [-999999,-999999,0]

is there a way to reload markers?

#

So if I decide to change my slot, the marker position will reset according to his position in the sqm mission

still forum
#

is there a way to reload markers?
you can have the server use a global setMarker* command on it

compact maple
#

I would like not to use a global cmd for every one. But it's ok I figured it out. I'm going to sort all the markers at the server start, then share that array with JIP ON

cold glacier
#

I understand yet can not get it working. I tried 2 other scripts as well with no luck, similar concepts.
@quasi cobalt - Might want to check that:
A) your triggers are firing
B) The script is being executed.

To test the first, make the trigger OnActivation into something like:
["Fired trigger"] remoteExec ["hint", 0]. That should cause a hint on your machine when the trigger fires.

To test the second, put the same thing at the very top of your script (with different text, like "Script ran"), and try again and see if you get that.

#

If both of those things work, the issue is with the logic of the script. If not, it's most likely something to do with your trigger or the location of your script file

#

Make sure you also check the .RPT file for script errors, or turn on 'Show Script Errors' in the launcher.

#

Disclaimer: 'Show Script Errors' may cause awareness of how badly a lot of scripts are written in Arma.

little raptor
#

@winter rose There was a better way tho. You could just sort the array, start from the first and keep going while diff=1.

winter rose
#

@little raptor right, I didn't get he wanted a sequence in a scrambled array, figured it now

#

all I miss here is a sort

surreal anvil
#

Hi guys! I remember asking a few months ago about why a script adds one holdAction per client to an object.

If I recall correctly it's because remoteExec runs ones per client and server. Does it do that even if it's in an .sqf-file and not in the init of an object?

winter rose
#

remoteExec is used to remote execute something
if you call it in an init field, it will simply call remoteExec multiple times

little raptor
#

@surreal anvil Add a variable to the unit when you add the holdAction:

unit setVariable ["AddedHoldAction", true, true]
#

So you can always check whether it's already added and only add hold action if it's false

compact maple
#

When you want a server-side on a mission, I can make a pbo with scripts inside, but how do I call that script when the server start ?

little raptor
#

See the event scripts page on the biki

compact maple
#

Yes I read it

#

But I dont see how a client can execute something for the server

#

like initServer ?

little raptor
compact maple
#

y, so I can create a initServer.sqf in my pbo, right ?

winter rose
#

the question would be: what do you actually want to do?

compact maple
#

Instantiate extdb3

#

on my server side

#

just want to get how it works, try some queries...

vague geode
#

What's the ideal way to use BIS_fnc_ambientAnim in multiplayer so that all players (JIP included) can see the animation but you also avoid countless logic entities?

ebon citrus
#

@compact maple are you familiar with SQL?

compact maple
#

@ebon citrus y

ebon citrus
#

is that yes or why?

compact maple
#

it is yes, sorry

ebon citrus
#

not sure on the validity of that article or if it's up to date

compact maple
#

I'm already on that website x)

ebon citrus
#

extdb3 is in laymen's terms an API for sql in arma

compact maple
#

My problem is to get my server side pbo working

ebon citrus
#

uhhhh... what?

#

a server side pbo? so a mod?

#

mods work like mods work

compact maple
#

I mean, I dont even know if it's supposed to be a pbo, but if I want a server-side on my server, what should I do

ebon citrus
#

it's jsut a mod that is not necessary on the client. i.e. not referenced in the mission

compact maple
#

right

ebon citrus
#

or not set as "required" by the mission

#

works just like any other mod

winter rose
#

@vague geode server-side

vague geode
#

@winter rose I have tried to do that but they just didn't do anything. Should I spawn the code with a 10 sec delay?

compact maple
#

initServer.sqf Executed only on server when mission is started. See Initialization Order for details about when the script is exactly executed.
Where should I create this file so ? Im a little bit confuse

little raptor
#

In the root of the mission folder

compact maple
#

every players will be able to see it then ?

#

as it's client side

ebon citrus
#

yes

#

every player needs to have a valid copy of the mission

compact maple
#

alright thanks

tough abyss
#
sleep 10;player call CFP_main_fnc_randomizeUnit;

How would I make this execute only on one player when he initializes. As right now it executes the script on everyone when someone initializes into the game

ebon citrus
#

couple of ways, actually

#

you can either check if the player is the unit in the init-field, if youre lazy

#

remembler to use spawn if you want to use that sleep

#

as the init field is non scheduled

#

the reason you want to check if the unit is the player is because the init-field executes on every connecting player's client

tough abyss
#

So I need to do:

spawn sleep 10;if (isPlayer _unit01) then {call CFP_main_fnc_randomizeUnit;};
#

Would that be correct?

ebon citrus
#

no

#

[this] spawn {params ["_unit"]; sleep 10; if (_unit isEqual player) then {[] call CFP_main_fnc_randomizeUnit}}

#

Something like that

tough abyss
#

I'll try it out in a bit on the server and come back

#

Error Missing )

#

Hmmm

still forum
#

isEqual
that no exist

tough abyss
#

Then there should be (isPlayer _unit)?

still forum
#

_unit isEqualTo player

tough abyss
#

Oh 😅

winter rose
#

isPlayer is to check if a unit is a player, not especially the local one 😉

tough abyss
#

I see, welp I'm testing it now, let's see if it'll do

#

Does not seem to work

winter rose
#

full code?

tough abyss
#
[this] spawn {params ["_unit"]; sleep 5; if (_unit isEqualTo player) then {[] call CFP_main_fnc_randomizeUnit}};
#

Just changed the isEqual to isEqualTo and the sleep duration to 5 instead of 10

winter rose
#

and what does it say? error Script, expected Nothing?

tough abyss
#

Nothing at all so far

winter rose
#

it seems to be a proper code - if put in the init field```sqf
[this] spawn {
params ["_unit"];
sleep 10;
if (_unit isEqualTo player) then
{
[] call CFP_main_fnc_randomizeUnit
}
};

tough abyss
#

Might be due to the fact that CFP randomization doesn't seem to work in multiplayer on players, and only in that instance, it just doesn't work when executed by a dedicated server unless I directly execute it on players via Console

#

The original code was working, unfortunately executing it every time someone connected

#

I'll just have to do some more testing and see if it'll work then

ebon citrus
#

yeah, sorry

#

isEqualTo

#

im too used to the autocomplete

#

😅

#

you remember what you write

tough abyss
#

Alright I've tried modifying it and using it in the form you've provided, here's what I got so far:

  • It doesn't give any sort of feedback, no error
  • It works only so far when called in as 'player call CFP_main_fnc_randomizeUnit;", of course that has the previous mentioned issue
winter rose
#

not here indeed; not related to scripting. Try finding help regarding L*fe on their Discord server, listed in #channel_invites_list @warped dew

warped dew
#

Thank you!

cold glacier
#

You set up your script as a function using Cfgfunctions, and set it to postinit as described in that link.

#

PBOs need to be a part of a mod which you load. You can use a custom mod and load it only on the server, to make sure the code only runs serverside.

compact maple
#

Y, I added my func to CfgFunctions

#

But I used call compile preprocessFileLineNumbers in my initServer file on the client

#

Should I change to this pre/post Init ?

cold glacier
#

Depends if you want it in a mod, or in the mission.

compact maple
#

I want the script to be initialized in a mod (server side)

#

Basically Im setting up extdb3 and I dont want it to be in the mission folder

cold glacier
#

Then try postInit in your CfgFunctions.

compact maple
#

So I dont need that initServer file in the mission folder, right ?

cold glacier
#

And build your scripts as a PBO, and part of a mod

#

You wouldn't then, no.

compact maple
#

Will test that, thank you

cold glacier
#

No problem!

inland rampart
#

would anyone have a script that allows players to access zues? its a modded server and the mod that allows players to access zues is touchy and is broken more then it works, it would be nice if i had a program that i can run when the mod doesnt work.

#

theres already 2 player slots that allow zues access however the rest of my unit cant use it.\

cunning crown
#

What you need to do is:

  1. Create as many Zeus modules (ModuleCurator_F) as you need during the mission preInit. iirc, Zeus Modules created after preInit will not work but I'm not sure about that
  2. Later in the mission, assign players to a "free" Zeus module (or you can assign them from the start, doesn't really matter)

All of these steps have to be executed on the server side, otherwise it won't work.

You can take a look at https://www.github.com/Heyoxe/Echos-Sandbox-Everywhere/tree/master/addons%2Fmain%2Ffunctions%2Fsystem%2Ffn_preInit.sqf and also the fn_postInit file, it usually works fine

quasi sedge
#

How to attach "ACE_IR_Strobe_Item" and turn it ON since start of the mission?

winter rose
quasi sedge
#

well it seems i need scripted implementation thru "ace_interaction" module

#

[car, car, ["ACE_IR_Strobe_Item"],true] remoteExec ["ace_attach_fnc_attach"];

#

i'll try

#

working as intendedblobcloseenjoy

ebon citrus
#

@little raptor lockCameraTo doesnt work

#

neither does lookAt

#

or doWatch

#

is there really no way to turn the targeting pod camera to look at a position/target?

ebon citrus
#

ok, issue

#

the turret of the targeting pod does not show up on allTurrets

#

-1 doesnt work either for lockCameraTo

tough abyss
#

shitty idea: what if you make targeting pod UI from scratch using your own camera and rsc overlay

ebon citrus
#

not possible

#

i need the targeting pod features

brave jewel
#

Hey there, does anyone know how to script a rotating lightcone?

tough abyss
#

if it's only sideways rotation like the cop car lights you can use a while loop
while {true} do { cone setDir (getDir cone + 1); sleep 0.1; }

warm hedge
ebon citrus
#

🙏

#

you man

#

are a god-send

brave jewel
#

I guess if I want it to rotate upwards or downwards I have to use vectordirandup?

ebon citrus
#

@warm hedge can i kiss you?

warm hedge
#

Not here, dude

ebon citrus
#

ooo, that's so goood

#

it works just perfectly

tough abyss
#

@brave jewel you only need setVectorDir you're right setVectorDirAndUp

brave jewel
#

😄 I was like:"WTF? How am I supposed to do it with only dir?" 😄 But thanks mate, you helped me out

tough abyss
#

@brave jewel im wrong again, you do only need dir or up to rotate the cone

#

this shit's so confusing

#

just set the cone's dir to wherever you want it to point (assuming the light aligns with the cone object's vectorDir)

brave jewel
#

indeed this stuff is really confusing

ebon citrus
#

Vectordirandup is confusing indeed

#

Kilzone has an article of it

#

Best to read it

robust brook
#

is there a function or bis function that can change my string of a weapon classname to its actual name? ex: "srifle_DMR_03_khaki_F" to "Mk-I EMR 7.62 mm (Khaki)"

warm hedge
#

displayName

fair drum
#

is BIS_fnc_typeText global or local?

winter rose
#

local

#

usually, everything that is UI related is local

fair drum
#

kk

quasi rover
#

I placed Spartan SAM in our base to defend attack from enemy jet. Not always, but sometimes this SAM attacks our fighter jet. Is there a way to prevent it?

fair drum
#

the base arma SAMs? if not, what mod?

quasi rover
#

Vanilla mod, Mk-49 Spartan SAM

fair drum
#

ah yes the boat one. I'm surprised it can get a lock on a friendly unit. whats the current setup you have?

quasi rover
#

wait a minute.
just give them lock true, allowDamage false, setfuel 1, setVehicleAmmo 1

quasi cobalt
#

Would disabling AI autocombat and cover effect waypoints and triggers?

#

My AI are following the waypoints but ignoring the triggers. Just running straight the end from the get go.