#arma3_scripting

1 messages · Page 345 of 1

still forum
#

end

#

no

#

end.

#

After execution successful or not it will be pushed at end

digital pulsar
still forum
#

no

digital pulsar
#

why not

still forum
#

try it out

vague hull
#

it worked some time ago

#

just the year was wrong

native siren
#

thank you

digital pulsar
#

according to comments on wiki it works as i would expect

still forum
#

Som ething was wrong with that. Dunno. But I know that there is no was to retrieve current real-life time without extension

rotund cypress
#

@still forum you can get serverstart time and then work your way from there

still forum
#

But why does everyone say there is no way besides extension then?

rotund cypress
#

Maybe cause doing it with extension would be less of a hassle

#

Or they do not know

tough abyss
#

Command was broken for longtime. Plenty of extensions that return time, offset times etc

rotund cypress
#

The command is not broken, you can get serverstart time with date and everything

#

AFAIK

#

Pretty sure I used it the other day

tough abyss
#

It was fixed in arma 3 1.5 i.e it was broken for long time.

rotund cypress
#

This Syntax: missionStart Return Value: Array - real local date and time (similar to date format but with seconds)

#

Then you know, you just plus the time on that and you are all good

#

However, using an extension is most likely the best way

tough abyss
#

Plus need to code handle seconds/minutes/hours/days/months etc.
Code if you want to use a different timezone to what the server is using
Just easier to just use an extension imo, prob will end up faster aswell

rotund cypress
#

Yep

outer scarab
#

How would I go about adding an eventhandler to an object (curator module) that's spawned by a script?

indigo snow
#

Well add it where the script spawns it

outer scarab
#

I should've mentioned, it's part of an addon, ie in a .pbo

#

but, fortunately, that script does look for free curator modules and if not, spawns a new one

rotund cypress
#

Hey guys, does anyone know if it's possible to set a scripted waypoint that is not the normal waypoint? Just the one you add to yourself when you click ctrl and then on map?

outer scarab
#

Alright @indigo snow the final nail's in the coffin this addeventhandler ["CuratorGroupPlaced",{params ["_zeus", "_group"]; {_x setIdentity "ZSEC"} forEach (units _group);}];. Thanks

rotund cypress
#

Use count @outer scarab it's faster.

indigo snow
#

NO

#

Cease and desist

rotund cypress
#

You do not need the functionality of forEach either way

#

I.e. _forEachIndex

indigo snow
#

Stop this sillyness immediately

rotund cypress
#

What? 😂

#

forEach fanboy?

indigo snow
#

forEach is perfectly fine, you don't run the chance of unexpected behaviour, and for people new to sqf is 400% more readable

#

Using count over foreach is one of those "cool tricks"

#

It serves no real use

rotund cypress
#

Sure, I can see that. However unexpected behaviour?

indigo snow
#

Return values for example

#

Count will error if theres a nonboolean / nonnil return value

rotund cypress
#

Yes, exactly.

#

Cause it needs something to be returned for element to be counted.

#

Not unexpected behaviour tbf.

indigo snow
#

I understand why

#

Its just completely unecessary

#

Youll save a millisec over 10 years

rotund cypress
#

I can see how for beginners it can be a bit wrong to use it, however IIRC it's like much much faster?

indigo snow
#

Its not

#

You only miss an increment

#

You miss out on _a = _a+1

#

As soon as you add code , so not an emptt codeblock, the difference is negligible

#

And if you dont keep in mind the return values of each command you can run into errors you might not understand

#

I swear every time people tell new guys to use count and its the silliest thing ever

#

Sorry for the rant

#

I should go sleep

rotund cypress
#

Heheh, I understand what you mean.

#

It can be pointless, but for me even if it's saves me 0.0001 milliseconds I will use it, cause why not?

#

And yes, I should also go to sleep to be fair.

indigo snow
#

Because if it errors and you have to fix it, youve just lost more time than youll ever win with the foreach to count replacement

#

You make your runtime improvements in different areas, not silly ones like this

rotund cypress
#

I'm not doing it for me to save time, but more the players playing the mission.

#

Like imagine using a loop in a OEF handler, then you would want to use count instead of forEach surely.

#

I am not writing optimal code for myself to save time, but rather for the performance of the guy who enjoys playing the mission.

indigo snow
#

Again it wont save them anything. If at 10fps you shave of 0.0001 ms, youve won 0.001 ms. Thats still a minimal fraction of the frametime

#

And if you do anything worthwile inside the loop, thats were you shouls optimize

#

Cache calculations and the likes

#

If you understand the traps of using count as a foreach, youll be doing fine, and i wont try and stop you or anythinf

#

But its a useless gospel to preach to people new to scripting

rotund cypress
#

Yes, as I said - I can understand that it might be overwhelming for beginners

tough abyss
#

is forciing a vehicles rardar off possible?

#

no mods

manic sigil
#

Is there a method for making an ai pilot slingload im just missing?

blissful wind
manic sigil
#

Tried that, but it insta slings :/ i was hoping to avoid scripting in extensive "when close, attach, now fly away" shenanigans.

blissful wind
#

yea...

#

probably someone made a script for that already

manic sigil
#

Was hoping LIFT CARGO waypoint woulda worked.

blissful wind
#

hey set waypoint lift cargo

#

and since its not going to work straight away

#

just ( for example ) if distance is less than now set sling load

manic sigil
#

I have, setwaypointtype "LIFT CARGO", but it stays like 30m up and 20m away, very obviously not going in for it :/

blissful wind
#

it wont

#

only if you have a very large opne space

#

and even then

manic sigil
#

Okay, moved the helipad object to an open field, changed wp type to land... flies to the same spot. My problem may not be with lift cargo...

blissful wind
#

"Lift Cargo
In Arma 3, this waypoint lets AI helicopters pick up vehicles that their helicopter is capable of lifting. The behaviour seems to be very inconsistant, and the AI pilots seem almost completely incapable of picking up the cargo or dropping it off (They have a tendancy to circle if other entities are nearby)."

#

from BIS

#

no your problem is with the AI

manic sigil
#

What is the Side for civilians? Like for Create Group.

blissful wind
#

CIV

#

if im not wrong

manic sigil
#

Im trying to spawn in a civ pilot for the chopper, but cant without a center and group. So i have CivHQ = createCenter CIV, similar for civpilots and group

#

But its not creating the pilot anymore :/

blissful wind
#

just place a civ down and set its presence to 0

#

_civGroup = [args] call BIS_fnc_spawnGroup

#

no

#

spawnGroup doesnt work for civs but im not sure will have to look into CfgGroups

manic sigil
#

Hum, didnt think about presence... i did that but immobilized him, and moved him - helicopter moved to his groups position and hovers. Troubleshooting!

blissful wind
#

dont do it to the civ you want to manipulate

#

just place a dif civ down and then do the presence

#

he wont show in game

#

sorry im just taking peeks at my second monitor but i am trying to help

manic sigil
#

Thats as i did, but removing his presence stops the pilot from spawning :/

#

Its fine, youre a great help :)

#

At least gives me ideas to play with.

blissful wind
#

yea most of the times you already kow it you just need to bounce off ideas

#

i get that

#

one can get tunnel vision sometimes

#

so if you place a second CIv down and set his presence to 0 the first CIv which is the pilot wont spawn ? @manic sigil

manic sigil
#

I have a civ down as the side's center and group CivPilots. He's off nearby, hemmed in with boxes. The script creates a Huron and a civ pilot, added to CivPilots' group.

#

Now I'm just playing with having the pilot already spawned in, the 'screwit I'm done' option.

#

But now the waypoint deal ain't working right ;?

blissful wind
#

not sure

#

i would try

#

place a CIV down and set his presence to 0 to have a side center

#

then on script

#

_civGroup = createGroup CIV

#

then spawn in the pilot

#

and then assign pilot to group

#

ofc this is not clear as day

#

but i ope you get the picture

manic sigil
#

Yeah, I see what you're going for.

#

I'm just tantalizingly close but every change cascades into a hundred problems :/

blissful wind
#

HAHA

manic sigil
#

Scripting!

blissful wind
#

isnt that why we are here

#

😛

manic sigil
#

_wp1 =_grp addWaypoint [position Helipad, 0,1];
_wp1 setWaypointType "LAND";

#

I have a helipad named helipad, but the pilot just straight up hovers as soon as the helicopter is formed.

#

... Poop, I think I know what I did.

blissful wind
#

just turn off his engine let him crash

#

😃

manic sigil
#

Durrrhurrr

#

I made the initial WP into WP 1, forgot WP 0 was a thing.

#

He was getting it cued behind his nonexistant starting waypoint.

blissful wind
#

never had a problem with that

#

_wp1 works fine for me

manic sigil
#

I meant in the array - position helipad, 0, 1

#

I mean, it worked once... but then he flew immediately to the second waypoint I had right after that, bypassing the landing :/

#

And then back to his initial position.

#

Now I'm going crazy.

blissful wind
#

yea ? try MP scripting

manic sigil
#

Play As as the pilot... has a waypoint in the helicopter, so yeah, adding waypoint and setcurrentwaypoint isn't working :/

#

... and deleting the 0th waypoint works.

#

But then he flies to where I had the 2nd waypoint.

#

There is no code for the second waypoint, I deleted it for troubleshooting.

#

:wonk:

blissful wind
#

@manic sigil still having probs ?

manic sigil
#

@blissful wind yeah, abandoned it for now.

blissful wind
#

hope its only until it sparks in you again

manic sigil
#

.. am I crazy, or did they used to have "LAND" as a waypoint type?

blissful wind
#

no you´re not crazy

manic sigil
#

.... FFFFFFFFFFFFFF

#

Further dwon the waypoint type page:

#

With the new sling loading in Arma 3, 2 new waypoint types are added aswell being: Drop Cargo and Lift Cargo. The names for these 2 waypoints are:** "UNHOOK" and "HOOK".**

#

And it immediately starts working as planned.

blissful wind
#

great!

#

you didnt abandon it

manic sigil
#

Eh, just finnicky with the actual hooking. Base may be too cluttered.

blissful wind
#

im off @manic sigil good night!

manic sigil
#

Have a good night, thanks for the guidance :3

#

@blissful wind

still forum
#

@tough abyss https://community.bistudio.com/wiki/setVehicleRadar
@outer scarab just use https://community.bistudio.com/wiki/allCurators and add it to all of them
@indigo snow count vs forEach does not "only miss an increment" as you said. If you look at what count does you can clearly see that it increments something. The different is that count doesn't set the _forEachIndex variable. Which is setting a variable. Setting a variable means looking up if such a variable is already there. If so then update it else insert it. Inserting means hashing the name, finding the right place and maybe reallocating an array.
I have to agree thought that this is nothing for beginners. People who read the code performance guide can do that.

indigo snow
#

Bam, got your morning coffee out of the way? 😄 thanks for the extra bit.

still forum
#

I don't drink coffee.. I probably should start tho

outer scarab
#

Yeah I wouldn't know where to put that

#

I'm too deprived of sleep to even think about this shit now

#

What we ended up with works, maybe not perfectly (Due to our setup, there may be more than one zeus - allcurators would probably would work better for that), but it gets the job done for something that won't see much use anyway

#

Since the curator modules are created when someone's assigned a zeus though, wouldn't a script using allcurators have to loop to ensure new curators have the eventhandler added?

#

Or worse, run on creation of a curator (Which means more eventhandlers)

still forum
#

More eventhandlers is better :3 No scripts running needlessly

outer scarab
#

The thing with eventhandlers is I need my hand holding more than with needless scripts

#

I need my hand holding with anything Arma except playing it

rotund cypress
#

@still forum +1

digital pulsar
#

do you know any trick to acquire current solar azimuth?

#

i copied coords from cfgworld to a calculator but there are discrepencies up to 20 deg

still forum
#

squint That script is a little big to post here. Would recommend gist.github.com

waxen jacinth
#

sorry!

still forum
#

just name the file .sqf on gist and you will get proper highlighting too. Which your script here didn't seem to have

waxen jacinth
#

Like in the description, i can't seem to get the string for _DropRespectThreshold in line 194, it always gives out "any" but it's working for _DropRespectThreshold in line 64

#

getting it for _DropPrice, _DropType is working flawless - i'm a bit confused 🤔

still forum
#

Did you check what APOC_AA_Drops actually contains at line 194?

peak plover
#

How can i check if control does not exist?

waxen jacinth
#

ah sorry i think i just expressed myself a bit wonky - what i actually wanted to say - if you look at line 80 _DropRespectThreshold returns the correcet value out from APOC_AA_Drops but if you look at line 239 _DropRespectThreshold returns "any"

#
APOC_AA_Drops =[
    ["Vehicles",
        [
            ["Quadbike",         "Exile_Bike_QuadBike_Black",         10000,     "vehicle", 1],
            ["Offroad",         "Exile_Car_Offroad_Red",            20000,     "vehicle", 2],
            ["Strider",         "Exile_Car_Strider",                 30000,     "vehicle", 4]
        ]
    ],

    ["Weapons",
        [
            ["Sniper Rifles",         "airdrop_Snipers",             50000, "supply", 0],
            ["DLC Rifles",             "airdrop_DLC_Rifles",             45000, "supply", 0],
            ["DLC LMGs",             "airdrop_DLC_LMGs",             45000, "supply", 0]
        ]
    ],

    ["Supplies",
        [
            ["Food (small)",        "airdrop_FoodSmall",            1000, "supply", 0],
            ["Food (large)",        "airdrop_FoodLarge",            5000, "supply", 0]
        ]
    ]
];```
still forum
#

Yes.. Because the variable is not defined in line 239

waxen jacinth
#

It's defined in line 194, like _DropPrice is defined in 192 and returns currect value at 233

still forum
#

it was defined in a lower scope.. Scope exited so variable became undefined

indigo snow
#

((APOC_AA_Drops select _i) select 1) there are no two sub arrays

#

if you go over array bounds by one, doesnt it return nil?

still forum
#

yes

#

but the variable is still undefined

#

Also. I actually do see 2 sub arrays

indigo snow
#

the formatting is hurting my head a little

peak plover
#

ctrlNull does not exist...
_ctrl isEqualTo objNull ?

indigo snow
#

what no, nigel

waxen jacinth
#

but how is it possible dropPrice wich is also defined in that lower scope returning the correct value, that's what i don't understand (not yet)

indigo snow
#

ah

#

its logical

still forum
indigo snow
#

its never defined in the main scope

#

so it stays private to the lower scope

#

see lines 175 - 179

#

theyre all defined except for the threshold

still forum
indigo snow
#

you gotta work with the new private keyword man

peak plover
#

Thanks @still forum

waxen jacinth
#

just for my understanding of that, _DropType isn't defined either but returning the right val

indigo snow
#

it is tho

#

line 147

waxen jacinth
#

ah

#

dang, my eyes

still forum
#

It is defined. Check the links above.

#

Just read what we write ^^

waxen jacinth
#

hehe, sorry - i just overlooked _droptype - guess i need new 👓

indigo snow
#

use the private keyword syntax

#

no more huge array at the top needed

waxen jacinth
#

i'll give it a shot - thanks guys, helped me understanding that stuff a bit more 😘

indigo snow
#

maybe rewrite //Initializing some variables to //Initializing ALL variables 😛

waxen jacinth
#

haha..well it's not my script i just trying to modify and make it running properly but tbh i didn't understood at all why it was written that way, seems a bit inconvenient to me (but hell, if its working)

vague hull
#

@peak plover why not isNull it?

digital pulsar
#

I have a planted claymore charge _charge which can be detonated by player or on timer, how do I detect when it explodes?

indigo snow
#

when it no longer exists

digital pulsar
#

there can be other reasons for that

#

like defusal

#

i'm interested in detonation only

queen cargo
#

the handledamage event handler might work

digital pulsar
#

@queen cargo hmm no luck

rotund cypress
#

@peak plover controlNull

#

Controls are not objects 😦

peak plover
#

I thought it's ctrlNull, so for the stupidity of myself I couldn't find 😄

#

yeah, thx controlNull works

#

For some reason the blood effect from ace3 turned out to be controlNull sometimes, therefor players didn't see blood when bleeding...

vernal elbow
#

Can someone tell me how to trigger a outro init? I tried initIntro.sqf but it doesnt trigger on intro start like described on the Wiki: initIntro.sqf | Executed when intro, outro win or outro lose is started.

peak plover
#

Whenever you want to end the mission, call myoutro2.sqf. And in the end of that one, have endmission "END2";

queen cargo
#

is diag_log 1 + 2 working?

#

or is it producing an error?

peak plover
#

checking

queen cargo
#

wondering as 1 + 2 could be rated higher then diag_log

#

if that is the case ... i got a problem 🙈

peak plover
#

21:58:35 1
21:59:00 1
#
diag_log 1+1
//1
diag_log (1+1)
//2
queen cargo
#

kk

vague hull
#

diag_log is unary, therefore higher rated as the binary +

queen cargo
#

i know

#

still could be SQF magic

#

which made me wondering

#

if SQF handles diag_log special orn ot

#

but as it does not, this still is valid:

1.000000
ERROR: STACK UNDERFLOW
ERROR: TYPE MISSMATCH```
indigo snow
#

Math operators are special kind just like else

#

Foxhound international have a pdf with all the priority numbers

queen cargo
#

i know

#

still diag_log could have been handled specially

#

would need to hand-code that into my VM if it was

#

in case one is bored: i still need some SQF AST generator for C

indigo snow
#

only binary commands have special precedences

#

(thus far)

queen cargo
#

current parser works perfectly fine for that project
just a few "edge" cases ... eg. [[1]] select 0 select 0 are not working

#

([[1]] select (0 select 0))

#

but that is due to wrong build sequence of equal elements ...

subtle ore
#

Quick question here, if i write a .h file for definitons and #include it in the description.ext would i be able to use these definitions across all of the new scripts i make or do i need to include for each script?

queen cargo
#

#include is only telling the preprocessor to append whatever is in that file

subtle ore
#

Right

#

So i will need to include for each script then

queen cargo
#

you could name it "my_long.ding.dong" and fill it with 8=====> and #include could not bother more

#

just that you then would have scripts etc. scattered with those lil tiny things

#

only thing you need to be careful is: if your included file contains sqf instructions (not those in the #define but as simple plain text) the config parser will complain and vice versa

subtle ore
#

Gotcha. Will the rpt tell me or will i have to do something further to diagnose a preProcessor problem?

queen cargo
#

you will notice

#

game will crash if the preprocessor is actually the problem

#

if the config parser encounters issues, game also will crash

#

only sqf wont complain until you use compile on the file (or execVm or any other way to give that file to the compiler)

subtle ore
#

Okay, thanks for the info.

vernal elbow
#

@peak plover sorry, I didn't quite get it. If I do it like this is all from the myoutro2.sqf script executed at outro start? And if so, shouldnt the endmission be executed somewhere else but the outro init?

subtle ore
#

@vernal elbow end mission should be triggered by end of outro, but should be setup during outro execution in my opinion

vernal elbow
#

oh no you got me wrong

#

in the editor you can select outro scenario intro... you know? and on endmission scenario it launches the outro - if there is one

subtle ore
#

We are talking about the endMission bis function right?

rotund cypress
#

Hey guys, what exactly can Headless Client access? I would assume it can access server namespace?

#

And the server side addons?

still forum
#

@rotund cypress Headless client is just like any other client

#

besides being headless

#

It can access its own addons and it's own script namespace

#

It's a completly seperate client

rotund cypress
#

I know it's a completely separate client

#

However, how does it know what it's own addon is?

tough abyss
#

Think of HC like another user

still forum
#

You tell it that via the command line

tough abyss
#

Users can't access the server namepace etc

rotund cypress
#

I know what a HC is, what it can access is shady, thats all

still forum
#

Just like you do when you start a server or a client

#

It's really not shady

rotund cypress
#

Nah, but for me

#

It's a bit grey for me what it can access atm

still forum
#

A HC can access exactly the same as any other normal player client

vernal elbow
#

@subtle ore I dont think it has anything to do with the way of how the scenario is ended. If there is an outro it will launch after mission is ended by any command/module

rotund cypress
#

Also, if I want both server and HC to be able to remoteExec variables, do I just whitelist that on remoteExec as client if only HC and other clients, and then anyone if HC and clients?

#

Do you know @still forum ?

still forum
#

Nope

#

My guess is HC doesn't have remoteExec restrictions.. But I dunno. Never used that

tough abyss
#

I dont think it does.
You might be able use remoteExecutedOwner to check if its HC.
But i avoid HC, since when they break tends to be awhile till gets fixed

queen cargo
#

can one do some testing for me?
need to know following things:

typeName (for "_i")
typeName (for "_i" from 0)
typeName (for "_i" from 0 to 1)
typeName (for "_i" from 0 to 1 step 1)

if i am right, the first one outputs "FOR"
and the rest "ARRAY"
but also could be that all of that is "FOR"

my arma still needs one hour to download fully ...

still forum
#

sec

#

Intercept probably has most the info you want already

#

"FOR"
"FOR"
"FOR"
"FOR"

As expected by me.

queen cargo
#

kk

#

ty

subtle ore
#

Wow, just now looking at this intercept project. How the hell is that even possible?

queen cargo
#

research

subtle ore
#

Impressive research. Any mods using it yet?

still forum
#

Nothing really public yet. I have my test Project implementing a part of LUA scripting and some performance improvements for TFAR. There are a couple guys building stuff. But nothing that is publicly used yet or out of experimental stage

subtle ore
#

Cool to see at least TFAR is going that direction

still forum
#

To be honest I did expect more projects to start popping up. Back when Intercept was still a WIP concept that didn't really work yet there were a TON of people showing interest and begging for it to become reality. Not it's there. Out of alpha stage and working good so far. And most of the people that showed interest in the beginning now don't seem to care anymore

subtle ore
#

Unfortunate to say the least

still forum
#

Intercept was developed by ACRE devs (before I joined atleast) and was planned to be heavilly used for ACRE. Which could benefit ALOT from it.

#

Kinda ironic that now TFAR is the first using it 😄

subtle ore
#

LOL.

waxen tide
#

is there a simple way to have a constant display of some variable contents on the screen ingame?

queen cargo
#

systemChat @waxen tide

#

alternative: create a dialog, display it as overlay (cutRsc) and run a spawn/pfe to update it in background

waxen tide
#

i know about that but i would like something that is really permanent

#

that sounds more like it, will research. thx

#

if i try to run a script that is already running, will arma run a second instance of it in parallel?

still forum
#

if you spawn/execVM then yes

waxen tide
#

whats the best way to make sure a script can't be run twice under any circumstance?

still forum
#

set a variable at start. And if it was already set then just exit

waxen tide
#

i tried that, but i failed to properly exit the script. i tried exitwith{}; is that the correct way?

still forum
#

if (<condition>) exitWith {}

#

exitWith is a binary command. It doesn't work without the if

waxen tide
#

if (mission_loop_running) then {exitWith;};

#

is that correct syntax?

still forum
#

No...

#

I just wrote the correct syntax

#

and as I said.. exitWith is a binary command

#

exitwith{}; is unary so wrong.
exitWith; is nulary so even more wrong

waxen tide
#

i did i'm just not very bright.

#

i don't want to execute any code, i just want to exit the script

#

i think exitwith isn't the right choice

still forum
#

Scripts are code.

#

Okey.. Then find another choice if you are sure there is a better way

waxen tide
#

if i were sure i wouldn't be asking stupid questions.

still forum
#

So. Do you trust yourself or someone who has years of experience with SQF?

waxen tide
#

I was confused because in the wiki it says exitwith exists the current scope, and i was under the impression the scope is whatever code i put in the {} behind exitwith. But apparently this is not the case, the whole script seems to be the scope as it is apparently being exited.

#

I never questioned what you said, i just didn't understand it.

still forum
#

yes. It exits the current scope.. Not the next one that might be opened somewhere in the future

#

inside the {} after exitWith is a new lower scope yeah

#

but the exitWith itself is outside

waxen tide
#

makes much more sense.

manic sigil
#

How many players can be zeus in any given mission?

queen cargo
#

12^10

#

na lil joke
probably something around 2^32

#

but i doubt your server will be able to manage that

manic sigil
#

Thanks, i know how to put it in, but AFK and unable to test if it has sone hardcoded "only two zeus per side!" Mechanic

subtle ore
#

does setPlayable in arma 3 work as of recent?

outer scarab
#

Can face= in cfgIdentities be an array?

winter rose
#

Hi gents, I am looking for a way to turn an empty car's wheels by script. I tried animateSource, animate, even animateDoor on wheel_1_1, and some other selections, and IDK exactly what to do. Do you happen to have any idea here? Thank you

winter rose
#

I can't really get anything from animationNames, all I can get is animateDoor with Door_LF/RF etc. I can't even trigger wheel disappearance, I am a bit out of ideas now

peak plover
#

How can I make it so a key will work if disableUserInput has been set to 1

#

*true

winter rose
#

you would have to cover all the keys BUT this one I am afraid

blissful wind
#

BIS_fnc_holdActionAdd ( https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd ) takes a bool to remove on completion but if I set it to -2 (everyone but server) on the remoteExec i won´t be able to see the action button since it´s not a dedicated server. If I set it to 0 (everyone including the server) I see the it but in multiplayer it doesn´t remove the action. I ´ve tried to also follow it with BIS_holdActionRemove but no luck. Any ideas?

winter rose
#

see AlWarren note at the bottom; it might help you here... else maybe publicVariable a bool that should be in the showCondition, hiding it instead of removing it (quick and dirty workaround)

blissful wind
#

Thank you @winter rose

winter rose
#

np, I know how to dirt code ;-p

blissful wind
#

oh

#

yea i ´ve seen the AIwarren note

#

i ´ve set it to 0

#

the action is there for the server and for the client

winter rose
#

run it everywhere, if it's on the dediserver it's not a big deal anyway

blissful wind
#

but there´s the bool true to remove but it doesnt remove the action on completion

#

its true for remove on completion and false for unconscious state

winter rose
#

I don't know much more about the holdActions I'm afraid =\

blissful wind
#

i mean if its remoteExec

winter rose
#

I may test it tomorrow if you ping me then

blissful wind
#

hm...

#

cool thanks 😉

winter rose
#

👍

#

and good night ^^'

blissful wind
#

good night

#

hey duh

#

_this select 2

#

omg

blissful wind
#

seems to be working in multiplayer but i need a client to connect since my friend is now away... but it´s working so far whereas before it wasnt

peak plover
#

do ```sqf

blissful wind
#

oh there´s sqf

peak plover
#

and finish with ```

blissful wind
#

yup i know just didnt know bout sqf

#

thank you @peak plover

#
    0 = [DataTerminal,"Download mission",     
 
    "\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", 
 "_caller distance _target < 3", 
 
    {}, 
 
    {}, 
 
    {[(_this select 0), (_this select 2)] remoteExec ["BIS_fnc_holdActionRemove", 0];[]execVM "somekindofInit.sqf"}, 
 
    {(_this select 0), (_this select 2)}, 
 
    [], 
 
    2, 
 
    0, 
 
    true, 
 
    false] remoteExec ["BIS_fnc_holdActionAdd", 0, DataTerminal]; ```
#

loooks prewwwty

#

i know "readable"

#

😛

#

i also just set the bool to false to not remove the action after the button is complete, and let the code execution do it´s thing and yea seems to be working in MP now

waxen tide
#

is it possible to overwrite the config of a weapon from withhin a mission script?

#

or do you have to do an addon

manic sigil
#

I have a trigger that spawns and equips a single enemy rifleman - can I have it spawn the rifleman at the trigger's location without naming the trigger, thus making it a simple (single) spawner?

#

I tried position this, but it throws a fit :/

#

Otherwise, a way to repeat the whole spawn and scatter them amongst several locations would be equally useful. At each location with "Rifleman" in it's name, for "_i" from 1 to 20 {spawn unit}, for example.

#

... Man, even just blunt stating it it's dumb, dropping up to 20 units at each location. Durr.

waxen tide
#

so all you want to do is spawn a bunch of soldiers together in one spot ?

#

i guess you put the code to spawn and equip the rifleman into the triggers init? rather put it in a .sqf file and simply call the file multiple times

manic sigil
#

Not all together, but spread out - filling a combat course without having the units spawned in at the start.

#

So players step into the entryway, it triggers the course to fill with enemies in predefined positions.

waxen tide
#

so the player progresses thru the combat course, and at certain points you put triggers that spawn a soldier?

manic sigil
#

Nearestobjects?

#

Yeah

waxen tide
#

well why not simply make an .sqf file that spawns a soldier with the equipment you want and then simply call it with the trigger and pass the position of the trigger as an argument to the script

#

i'm a noob btw.

manic sigil
#

That's probably a lot smarter than I'm thinking - I still am getting the hang of the concept of passing things to outside files 😛

waxen tide
#

it is a bad idea to copy&paste the same code into 20 different triggers if you can put the code in one place and simply call it. when you want to make a change, you do it once and not 20x

#

you can even define a function in the sqf script, that might be a good idea if you call it a lot.

#

might save some performance

manic sigil
#

Yeah, that's a perfectly valid point :/

waxen tide
#

if you look at https://community.bistudio.com/wiki/spawn or execVM, both can pass any argument you want to the script and you can access the arguments with _this inside the script. i would simply fetch the coordinates of the trigger inside the trigger init, and then call the external script and pass the coordinates as argument. then inside the script use the coordinates to spawn your soldier

#

and ofc do whatever you want to the gear

#

idk if spawn/execVM is the ideal command but it should work

#

t. noob

manic sigil
#

_SRM = [getpos this] spawn {"SpawnRifleman.sqf"}

SpawnRifleman.sqf is my previously functional script, but with 'position Rifleman' replaced with just '_this'

#

Feels like I'm messing something up, but then, still entirely new to script-passing so hell do I know other than it's not working with that.

waxen tide
#

i think you're passing the args wrong, but i must check myself how to do it.

#

ah, i found it

#

you need to use _this select X;

#

X being 0,1,2,3 ...

#

0 = first argument you passed

#

1 = second arg ..

#

position Rifleman = _this select 0;

#

so lets say _SRM = [getpos this] passes an array containing X,Y,Z coordinates, then _this select 0; contains that array as well inside your script. i think.

manic sigil
#

Ahh, I think I follow

#

I brute forced it (trigger that has five copies of the spawn and arm script with five distinct getpos markers) so I can fall back to that, but I'mma give that a try.

waxen tide
#

oh so you have one trigger that spawns all the soldiers at once on different markers?

#

then i would just uhm generate a list of all markers inside your script, and go thru them with a for loop and slap a solder on each position

#

you can do getmarkerpos inside the script, no problem

manic sigil
#

Yeah, passing the argument to the script with '_this select 0' in the position section, no dice.

waxen tide
manic sigil
#

Ooh, that's more like what I was originally thinking. How would I parse it down to just, for example, the Rifleman markers, the Grenadier markers, the MG markers etc?

waxen tide
#

uhm

#

well with allMapMarkers you get a list of all markers. so you need to write a bit of code to filter out the ones you're looking for. probably regex but thats black voodoo magic

manic sigil
#

Because that'd be the same, right?
_Riflemanmarkerlist = allmapmarkers blackmagichere
{spawn unit [type, _x, etc], equipment script} foreach _Riflemanmarkerlist

waxen tide
#

well yes

#

the blackmagic part is interesting tho

#

arma has no regex natively, but killzonekid wrote dlls for them. i think that might be overkill, but i dont know any simpler solution

manic sigil
#

Hrm... but aren't markers limited to the 2d plane? I'm not sure if I'd be able to have them positioned elsewhere, upwise.

waxen tide
#

Returns the position of a given marker in format [x,y,0]. Array element 3 (height above ground) is always zero.

#

looks like it.

#

if you want soldiers in some second building floor, you'll need to add a height offset if you want to place it with a marker

manic sigil
#

At which point I

#

I'd be back to hand-placing them :/

#

Well, hand-directing-the-spawn-script

waxen tide
#

well whats your goal, placing soldiers at exact locations or just nicely spread out in buildings?

#

there is some occupation script floating around that automatically places soldiers in buildings

manic sigil
#

Preferably exact locations. Dang. It'd be fun setting that up, or I could just brute force it in small batches of troops to keep server load down, and hand-place each gamelogic I'm using as marker (probably gonna regret that one too.)

blissful wind
#
    0 = [DataTerminal,"Download mission",     
 
    "\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", 
 "_caller distance _target < 3", 
 
    {}, 
 
    {}, 
 
    {[(_this select 0), (_this select 2)] remoteExec ["BIS_fnc_holdActionRemove", 0];[]execVM "somekindofInit.sqf"}, 
 
    {(_this select 0), (_this select 2)}, 
 
    [], 
 
    2, 
 
    0, 
 
    true, 
 
    false] remoteExec ["BIS_fnc_holdActionAdd", 0, DataTerminal]; ```
#

^^^ not working if me and a client are on, just when the server is on (me)

#

why isnt this removing the action ?

#

TIA

still forum
#

It should 100$ remove the action for you. Because of the removeCompleted parameter set to true.
Is it not removing it for both of you or only the guy that didn't activate it

#

OUUHHH I know

#

player1 and player2 will have different ID's for the action.
Let's say player1 has ID 5 and player2 has ID 7.
If player1 is done with the action it tells player2 to remove the action with ID 5. But player2 doesn't have such action

atomic epoch
#

It uses a script to redirect players to a new server by expoiting UI

#

Does anyone have any idea how he found the displays to achieve this?

#

Because there has to be access to each button in the Arma 3 menu

#

And if we do, we could in theory make a player unwillingly exit his game

robust hollow
#

everything in arma is available for you to view. the server hop is a very cool script, in comparison its too easy to force quit someones game.

still forum
#

@atomic epoch Config viewer.

atomic epoch
#

@still forum lol that wilderness? That is a solution, but a rough idea of where to start in config would be very usefull

#

@manic forge How would you force someone to quit thier game? I'm intrigued

robust hollow
#

for UIs i look in the actual config files in the ui pbos. find it easier to search for what I'm after that way.
the ways I have seen for force quitting a game arent exactly graceful. the one ive seen most is to include a file that doesnt exist.

peak plover
#

ui_f.pbo contains most of the UI elements that you see in arma.
They allow for a moddable game, that's what arma is about!

atomic epoch
#

@robust hollow Thats awsome. At least now I now where to start

peak plover
#

A full conversion mod is possible, so that it changes the main menus etc...

atomic epoch
#

@peak plover If you don't mind me asking, how would does one dig into ui_f.pbo with config viewer?

#

I can't find the name >.<

robust hollow
#

the config viewer shows everything from the configfile. it doesnt show it from which pbo it comes from.
ui_f.pbo refers to the pbo file in arma 3\addons

indigo snow
#

youd unpack the actual game pbo file with a tool and then browse with a text editor

robust hollow
#

the actual pbo itself that holds the config.bin

peak plover
#

It's not illegal to unpack the PBOs. All DLC / expansion are release as EBO (encrypted). Those are illegal to unpack.

#

But in time they usually change from EBO to PBO, so people can make skins for guns etc.

atomic epoch
#

Thank you all, your all most helpful

tame portal
#

skins for guns

peak plover
#

Or just see how that epic APEX mission was made 😄

tame portal
#

csgoing Intensifies

atomic epoch
#

From what I've read in the updates, BI has already converted the EBO's back to PBOs?

#

At least those for APEX

robust hollow
#

for older dlcs yea, not the newer stuff

#

apex is half pbo half ebo looking at my 1.76 rc,

peak plover
#

But you are only allowed to use assets from arma in arma... Meaning you are not allowed to unpack, take anything and then use it in different engine/game. (as in port the weapons to Insurgency)

#

Yeah, I'm pretty sure missions are PBOs. So those can be useful to get some tips and tricks for your missions, to improve them 😄

atomic epoch
#

But... I'm batman 😦

#

I do what I like

still forum
#

@peak plover it's not really illegal to unpack EBO's afaik. Or do you have a link to somewhere stating that?

peak plover
#

Well, they are probably encrypted for a reason...

#

Reason being, they don't want them to be extracted...

still forum
#

Yeah. So they can't be unpacked. But I didn't read anywhere yet that it is actually forbidden

peak plover
#

I'm not sure. Fair point

#

Also all the displays etc. show up in config viewer

atomic epoch
#

Neat!

tough abyss
#

@peak plover - them spaces 😋

peak plover
#

Probably looks good on whatever they edit configs with?

tough abyss
#

Notepad.

peak plover
#

Hey, that's an update from command prompt

#

A splendid™ one at it

tough abyss
#

Or paint.

peak plover
#

😮

still forum
#

@tough abyss them spaces
Macros.

peak plover
#

Must be macros for their ui editor

#

It all makes sense now...

#

I was always wondering about that one..

tough abyss
#

@peak plover - Poseidon brother...

blissful wind
#

@still forum Thanks for the insight! Yes its surely confusing, I´m going to have to test some more until i get it right. Thing is, there is not much information out there about the function.

spice kayak
#

Hey all! Would someone mind telling me if a certain script I'm writing would work or not? I'm using a forEach within a forEach, and I'm really not too sure if it'll work out or not.

still forum
#

Just post @spice kayak

spice kayak
#

I tried to explain what it's doing at the top there.

#

I'll be able to test it in a few hours, but I wanted to write down what was on my mind while it was there.

#

(Edited a quick mistake, thanks to lazy copy/pasting)

still forum
#

won't work

#

your _x in alive _x is a string

#

alive doesn't take a string

spice kayak
#

Ah, shit. You're right.

#

I didn't mean to make it a string array.

still forum
#

Are the strings variables?

#

don't do ("m"+ _x) so often. Just do it once and store it in a variable

spice kayak
#

Was meant to be vehicleArray = [vEscort1,vEscort2,vTruck];

#

Good point!

still forum
#

Otherwise I don't see anything wrong

#

2 for loops can be a problem if the inner for loop overwrites _x but that's not the case here as you never use the _x of the outer loop. Besides that one check before the inner for loop

spice kayak
#

Ah, sweet. That's what I was hoping for / worried about.

zenith totem
#

Eh, KK's server transfer annoys me, not for the code, but for the implications regarding security

#

The fact you can manipulate main menu UIs and do whatever you want to a user after they've left the server (i.e. delete their profile)

atomic epoch
#

LOL

#

Don't give me, or anyone else here any ideas XD

zenith totem
#

Oh god

#

Configure the view distance to basically 0

#

Set all graphics settings to the lowest

atomic epoch
#

I can imagine the look on my face if that ever happens to me XD

#

Now I have to make it happen!!

zenith totem
#

I'm so conflicted, it should be reported as a security issue but the ability to transfer servers is such a useful tool

atomic epoch
#

😂

#

It means we can have some (i)responsible fun!

still forum
#

@zenith totem I have the same concerns. You could also make players join malicious servers. And do way worse things to them than just deleting their profile

atomic epoch
#

I've never met a malicious server. What are they like?

still forum
#

I also didn't

atomic epoch
#

Arma 3 Life perhaps?

still forum
#

XD You could count that as malicious yeah 😄 Not what I meant though ^^

zenith totem
#

@still forum I'm suprised KK didn't notice the risks involved

#

Or maybe he just didn't care since he's leaving, who knows

still forum
#

KK also didn't notice the risks when he gave full debug console access to anyone on any server

zenith totem
#

wut

#

How did that one work

still forum
#

The big debug console security update. If you started your game with -mod=stra3_debug and just made stra3_debug an empty folder then you get debug console on any server

#

Battleye also doesn't do anything against it

#

Was fixed in a security hotfix shortly after I reported it.

#

Apparently KK never tested his security "improvement" and QA also didn't notice. Aaaand no one seemed to do code reviews on what KK wrote

zenith totem
#

is stra3_debug the internal name for the revised debug console? How on earth did that load it

still forum
#

no

#

there was a stra_debug console back in Arma 2. My guess is KK has updated that to Arma 3 for some reason. And his code checked if you load that Mod. And if you do it circumvents all security checks and gives you instant access to debug console anywhere

zenith totem
#

Ah, never played A2 extensively

still forum
#

After I discovered it to test it out I started my game with an empty stra3_debug folder loaded as Mod. Joined a 2 player russian Battleye protected Server. And could just setDamage 1 everyone on the server with one CTRL+V and a click on execute globally

zenith totem
#

I can already see that resurfacing in the future if they change something security related with dev console and don't apply the same to that

still forum
#

Won't happen anymore now that KK is gone

zenith totem
#

Unless they removed it entirely, it's still there and possible to be neglected

still forum
#

The bug was somewhat fixed... Kinda..

#

The tickets for that bug are still open because it turns out it is not really 100% fixable unless BI does a major change.

tough abyss
#

so KK left BI?

zenith totem
#

Yup

spice kayak
#

Quick question; triggers in an array wouldn't have quotes either, would they?

zenith totem
#

Nope

spice kayak
#

I'm an idiot. Thanks.

zenith totem
#

the variable is a reference to the object, not a name

spice kayak
#

Yeah, I realized that. I was just looking over what i wrote earlier and thought about it.

#

Actually, I don't think it'll work. Damn it.

#

Hmm, I'm really not too sure how to word this, but is there any way to get the _x value to draw from the array being used outside of the forEach statement?

indigo snow
#

draw?

spice kayak
#

Sorry, draw from is how I'd say, load? I guess?

#

read?

still forum
#

You can save the last _x value

#

but there are many _x values inside the forEach

spice kayak
still forum
#

Yes.. ofcause

#

you mean you need the _x from the outer loop inside the inner loop?

spice kayak
#

Yes!

still forum
#

then use private _outerX = _x; before you enter the inner loop

#

and then you can use _outerX

spice kayak
#

I could facepalm myself right now for not thinking of that.

#

Thank you.

still forum
#

facepalms @spice kayak

#

facepalm is such a funny word 😄 It's like arschgesicht.. Guess I'm too tired again

spice kayak
#

Ha, it is.

#

I'm thinking, with the way I've written the script, it'll only do one vehicle at a time?

#

Actually, you know what, that doesn't matter. I'll only need it to mark one.

still forum
#

You're probably far better off asking in ACE Slack

cosmic kettle
#

Will try that, ty.

warped mist
#

I know theres gotta be someone who can quickly solve my mind from being bent out of shape here.

this script: https://pastebin.com/U7hJGitM

will spawn smokegrenades inside my hawk and produce smoke, but it creates a gap between plumes as it were and I was wondering whether someone can help me with putting in a timer for each group of 5 Smoke grenades. So I create a continuous ;ine of smoke instead of the gap type trail that is created atm.

http://steamcommunity.com/sharedfiles/filedetails/?id=1119823966

waxen tide
#

I was under the impression that you can create tasks that will automatically pop up on the screen with a notification? or do i have to script that manually with hint etc?

indigo snow
halcyon crypt
#

@warped mist all your smokes spawn at the same time so the gap is more likely caused by the speed of the plane and the particle system being what it is

#

in any case, just put in a sleep between the groups I guess

warped mist
#

Yeah had a feeling it was the simultaneous spawning.

I tried that. I keep getting a generic error message for the sleep command.

halcyon crypt
#

did you give it a number for the time it needs to sleep?

warped mist
#

Yes

#

Sleep 0.5

halcyon crypt
#

what was the error exactly? Something about suspension?

warped mist
#

Just the sleep command and error generic expression

halcyon crypt
#

I guess you'll have to post your code with the sleep stuff added

#

and perhaps the error you get from the RPT

warped mist
#

All I did was put the sleep command every other 5 groups of nades.

halcyon crypt
#

sleep doesn't throw errors unless you did something wrong and we'll have to see it before we can tell what's wrong ^^

warped mist
#

Ok wait out

vestal mortar
#

Ive added this coding to the init of cop npcs of what they spawn in how do i make it so this also makes 3 other addActions called Threat Level Amber and Red? so far when you hit Threat Level Menu it only makes the Set Level Green here is my coding https://pastebin.com/yHuby5zS the custom coding as seen in the pastebin did not work either

halcyon crypt
#

@warped mist back in a bit though, someone else will probably help you out

warped mist
#

@halcyon crypt I'll pm you after restart it up

vestal mortar
#

ive tested out just player addAction ["Threat Level Menu", {player addAction["Set Level Green",life_fnc_levelgreen];}]; on its own and it worked any ideas?

waxen tide
#

@indigo snow thx thats exactly what i was looking for

waxen tide
#

sleep (0.5);

warped mist
#

nope still the same error

still forum
#

You cannot sleep in unscheduled

warped mist
#

and I need to possibly do what?

waxen tide
#

you need to run the script scheduled with like execVM

dusk sage
#

execVM is scheduled

#

Not unscheduled

warped mist
#

I already run the script from execVM in the init of the plane in the editor.

dusk sage
#

Why would you want to run it on init?

#

Unless that's intended of course

warped mist
#

so the options to turn smoke on and off are there for you at the start

dusk sage
#

You create the smoke instantly, I'm not sure what action you are referring to

waxen tide
#

well i just tried part of your code just on a soldier and it works. i can't see what line you're getting an error on btw.

#

yeah it spawns smoke grenades right away on the soldiers position.

warped mist
#

yeah it does on the plane too.

dusk sage
#

So this as far as your script goes, it's working correctly

#

What's the issue?

warped mist
#

read my first post about it and you will see my issue

#

I don't like repeating myself

dusk sage
#

You had an issue, which somebody told you to use sleep for, and should technically be fixed?

#

Now you're referring to actions

#

Good attitude though, good luck 👍

warped mist
#

It as plain as day I put in what was suggested, it still didn't work how I'd expect it too. I'm not referring to actions, I'm back where I started.

#

but thanks for your input!

waxen tide
#

your first post doesn't really help, obviously your sleep 0.5 lacks a ; and when i fix that that code part works fine.

dusk sage
#

Try adding semi-colons to your code

halcyon crypt
#

I see we all saw the issue at the same time 😛

dusk sage
#

I thought it was working when he said:

Spooky - Today at 6:20 PM
yeah it does on the plane too.
spice kayak
#

Curious, do attributes set through the Eden Editor override those set by the description.ext file? Like the Name, author, etc.?

indigo snow
#

reverse

spice kayak
#

That's what I was initially thinking, but it doesn't seem to be the case for me currently. Would settings within the description.ext (3rdPersonView, AutoSpot) also override server's settings?

#

Yeah, if I leave the attributes blank but have relevant information in the description.ext, when I'm on either the lobby role selection screen, or the map screen, the name would be 'missionnamehere.malden.' If I have both the attributes and the description.ext filed out, with different information, it'll use the attributes over the description file.

#

Ultimately, I'm not sure it's even using the description.ext file at all.

#

I'll add a loading image to see if that'll at least show.

#

Okay, having the image and adding it to description.ext results in the image loading, but none of the information or settings.

delicate totem
spice kayak
#

Sorry, last message; seems all mission information loads. The only things that don't load is the Scenario Name (for the lobby and map screen but not the loading screen), and the settings defined in there for the server (3rd Person, Autospot, weaponCursor)

waxen tide
#

certain BIS functions take data in the type of "side", like side west for example. how can i store that in a variable? if i just put the string "west" in a variable and then try to use that variable instead of manually typing west in the spot it doesn't seem to work at all.

steep gazelle
#

How to change the side of USS Freedom turrets? ex: I want turret to be friendly to opfor and enemy to blufor.

tough abyss
#

Also no need to ask question in 2 different channels at same time

pulsar anchor
#

🤐

still forum
#

Some guys like me are real assholes and don't answer a question although they know the answer very well if people show not a sense of effort or patience when asking a question

#

It's not that bad because you now learned and won't do that again. Also Extension questions are better in #arma3_tools Because all the C++ Programmers are in there

pulsar anchor
#

I thought there was a extension_makers channel, but then I wasn´t sure where to put it

still forum
#

If you don't know. You still knew callExtension was a script command. So #arma3_scripting

vestal mortar
#

@delicate totem thanks man

still forum
#

no.

#

downgrade your arma

#

legacy branch is 1.68 apparently

#

That doesn't change facts...

#

Answer is not possible.

rotund cypress
#

Always wondered why not just do a function instead

still forum
#

BIS scripted Eventhandler system

#

like CBA eventhandlers

#

This is a script implementation of eventhandlers. Just like CBA has.. Just way worse than CBA's code 😄

subtle ore
#

👀

rotund cypress
#

But why would you ever use it?

still forum
#

Because if you want these eventhandlers there is no other way

peak plover
#

event handlers? just use

//fnc_waitfor_event
[] spawn {
    my_event= false;
    while {!my_event} do {
        sleep 0.03; // how often to check if event has fired
    };
    call fnc_something;
    call fnc_waitfor_event;
};
#

😉

#

(constantly checks if player is close to the fish trader)

tame portal
#

@peak plover Remove the sleep = infinite more performance

subtle ore
#

@peak plover well things like end game spectator changes? Arsenal opened and closed?

#

You would need to script those events afaik, this is just a tad easier

#

@tame portal more performance? What is the difference between with and without?

turbid thunder
#

Hello. Anyone has a clue how I can have an AI jet drop bombs / cluster bombs in a scripted way so that I dont have to pre-place it but instead so that I can decide that when certain conditions are met, the AI automatically does a bombing run on the objective (both friendly and enemy)?

subtle ore
#

forceWeaponFire , or the bis fnc fire.

still forum
#

@subtle ore @tame portal was joking about performance

subtle ore
#

@still forum figured...

#

Discord really needs /sarcasm

turbid thunder
#

@subtle ore I did try that but depending on the terrain, the distance at which the bomb needs to be dropped is different every time

still forum
#

👡

peak plover
#

we need syntax highlighting for sarcasm

subtle ore
#

Hahaha...

turbid thunder
#

I mean, if I can get the plane to lock onto something with the bomb so that it is guided...

still forum
#
cookies are evil
#

sarcasm highlighting doesn't really work that well

subtle ore
#

:(

peak plover
#

I wish that was a thing 😄

#

Also let's teach AI sarcasm 😄

subtle ore
#

@turbid thunder speed, distance, how heavy the bomb is. All factors that need to be conditioned. Iirc someone has made as script to calculate bomb distance

#

@peak plover afaik google deepmind has already done something like that

peak plover
#
_group setBehaviour "SAFE" // sarcasm
{_x disableAi "AUTOCOMBAT";}count unts _group;
_group setBehaviour "SAFE"; // not sarcasm
subtle ore
#

@peak plover 😂

peak plover
#

There's a zeus module for bomb runs ?

#

Also you could just script in something fake or try to remove all ammo from AI except bombs and disable targenting, assign a target manually...

subtle ore
#

@peak plover ewww....i would rather have ai act on their own rather than a player control it all

peak plover
#

But you want ai to use a bomb...

#

A good alternative to skip past the scripting in arma 3 is to use zeus and just remote control and drop bomb yourself 😉

turbid thunder
#

Actually

#

I figured out how I can do it myself 😄

peak plover
#

Elabortae 😄

turbid thunder
#

Basically what I have to do is spawn a "laser", disable its simulation so it doesnt just despawn and have the pilot of the airplane target it

#

Though, I have to use fireAtTarget to actually make it drop the bomb

peak plover
#

That works?

turbid thunder
#

Yeah 😄

peak plover
#

Whoa, great

turbid thunder
#

But you still have to manually make him drop it but thats okay

#

Atleast the bomb will then be guided so it cant miss

#

Now I just need to have some sort of failsafe in case there is terrain in the way

#

Hmmm

#

Apperently the laser target needs to be the same side as the plane I want to use, so LaserTargetW for blufor, LaserTargetE for opfor, LaserTargetC for, civilian (yes that classname exists) but what is for i... ohwait mayby LaserTargetI is for indipendent?

#

nope

peak plover
#

hah!

turbid thunder
#

Well it isnt LaserTargetG or LaserTargetR either

peak plover
#

It's pretty much a unit that can be targeted.

#

You can setrating or set it as enemy

turbid thunder
#

I need to find out the lasertarget classname for indfor

#

Problem is that the airplane bombs need a laser to lock on

peak plover
#

_laserTarget addRating -20000;

#

It will be targeted by everyone

turbid thunder
#

ehm

#

Apperently my WEST laser target is side == EAST

peak plover
#

Exactly

turbid thunder
#

Oh

#

OH I GET IT

#

i get it

#

I just need to place a laser target for whoever is hostile towards greenfor

peak plover
#

yeah, but addRatitng -20000; will make it sideEnemy

#

Which is enemy to everyone

turbid thunder
#

Fun fact: The AAF spotter uses a laser designator that spawns LaserTargetW

peak plover
#

does it appear in allUnits?

turbid thunder
#

it appears in nearestObjects and I spawn it in as a vehicle

#

Addrating was a mistake

#

Side == UNKNOWN

peak plover
#

hmm

turbid thunder
#

Buuuuut its fine

peak plover
#

ai does not target?

turbid thunder
#

Yeah but greenfor will probably not be friendly towards both sides

#

So there will always be one lasertarget that I can use

peak plover
#

createGroup sideEnemy?

turbid thunder
#

Nvm I'm an idiot let me just correct that

peak plover
#

Yeah, it's nice that it actually works

turbid thunder
#

well

#

Group

#

I dont know what happens if I spawn it as a unit

#

I guess that'll be good enough

#

I think the limitation of not being able to use that with indfor units when they are friendly towards both sides is good enough 😄 For my mission I will only need two sides anyways so that'll do

peak plover
#

I wish I had more sides sometimes... But then I realize that the times that more than 3 sides would be in open conflict is tiny.

turbid thunder
#

It would be nice if you have gang or mercenary groups that are their own side, or have certain AI only being hostile towards certain players while other AI is still friendly with those players ect

#

But yeah, usually in conflicts you usually only have two sides

#

You have one side with faction A, B and C and the opposing side with faction X, Y and Z

peak plover
#

Yeah, but that can be done by spawning them, just to give an illusion of more than 3 sides

waxen tide
still forum
#

That command doesn't exist yet

#

We are still on Arma 1.72 feature wise

#

the features from 1.73 are not in 1.74 and will only be in 1.76

#

I know.. Just don't ask

waxen tide
#

okay. thanks.

#

Is there a way to get the index of the selection when using selectRandom on an array?

still forum
#

You could go back and use find if the array doesn't include duplicates

#

Otherwise I don't think so

waxen tide
#

well basically i want to output random answers from an array where all answers but one are wrong, and when the right answer is given i need to trigger some stuff so i need to know. I could just compare the string of course but comparing a long string seems bad for performance so i thought i would just compare the index and have the correct answer be index 0

tough abyss
#

Just generate a random number based of length of the array.
That way you already have the index value

#

Hell you can avoid rounding the number aswell, since select works with numbers with decimal points etc

waxen tide
#

i was about to do that but i was wondering about a more elegant solution

subtle ore
#

@peak plover Rating degrades over time, will reset after a certain amount of time. I believe setFriend is the best option

rotund cypress
#

If I want to move in as driver into a vehicle, a vehicle in which I am a passenger off, is that possible?

#

I tried with both moveInDriver and assignAsDriver which both did not seem to work.

#

You can take into account that there is no driver in the vehicle already.

subtle ore
#

@rotund cypress doesn't matter who is the passenger.

#

If the driver seat is empty you suould be able to move in

rotund cypress
#
player moveInDriver objectParent player
#

That does nothing when I am in the vehicle.

#

As passenger

subtle ore
#

Maybe move them out then back in?

rotund cypress
#

Thing is when doing the action it takes about a second before I am able to move in the driver again.

#

Which will be a bad result for me.

#

Using moveOut command seems to work

#

And was instant

winter rose
#

dang, I didn't know about objectParent thing...
Also, for the in-vehicle position: yup. moveOut, or setPos [0,0,0] then moveInDriver.

#

I have a question about animation, I saw in the Orange minicampaign that an empty vehicle could have its wheels turned. does any of you know how to do this?

[01:27] Lou Montana: Hi gents, I am looking for a way to turn an empty car's wheels by script. I tried animateSource, animate, even animateDoor on wheel_1_1, and some other selections, and IDK exactly what to do. Do you happen to have any idea here? Thank you
[01:47] Lou Montana: I can't really get anything from animationNames, all I can get is animateDoor with Door_LF/RF etc. I can't even trigger wheel disappearance, I am a bit out of ideas now

#

I will try with Simple Objects, it might be that normal objects are too tied to animation sources. if you have an idea, please share! I am out of any (:
I will let you know the results

#

to no avail.

waxen tide
#

I'm glueing an "addaction" to a group of units with foreach. How can i add a delay so that addaction can't be spammed on a single unit?

tough abyss
#

You can utilize the hideonuse command @waxen tide

#

But depending on what it's calling, you can have the function disable the action using the condition field by setting the condition to false and then enabling it again after x seconds in the script.

austere granite
#

Anyone know some magic way to load in a given mission in Eden?

#

just wanna give in a mission name / path and have it load

waxen tide
#

@tough abyss i tried but it doesn't appear to do anything?

waxen tide
#

Is there a pastebin service with proper syntax highlight or is it okay to paste 60 lines of code in proper code block directly into the channel?

#

@austere granite maybe launchoptions?

peak plover
#

There's a way. Same way kk did the server to server thing

fallen notch
#

hello guys. I got a problem

#

i want to despawn vehicles on a marker (or helipad?)

#

i used that code

#

waah

austere granite
#

yea i'll have to read the mission tree in the IDD displays

#

pastebin

#

and then just check if text is okay with what i need

fallen notch
#
this addAction ["<t size='1.3' color='#00c700'><img image='\a3\ui_f\data\igui\cfg\Actions\unloadAllVehicles_ca.paa' size='1.3'/> Fahrzeug entfernen</t>",
  {     private _vehs = (getPosWorld del_pad01) nearEntities [["Car", "Motorcycle", "Tank", "Air"], 6.5];
        if (count _vehs isEqualTo 0) exitWith {hint "Nichts zum entfernen in der Nähe."};
        private _veh = _vehs select 0;
        private _vehName = getText (configFile >> "cfgVehicles" >> typeOf _veh >> "displayName");

        if (isEngineOn _veh) exitWith {
          hint format ["Bitte den Motor von %1 ausschalten",_vehName];};

        if (count (crew _veh) > 0) exitWith {
          hint format ["%1 ist nicht leer",_vehName];};

        if (!isTouchingGround _veh) exitWith {
          hint format ["%1 ist nicht auf dem Boden",_vehName];};

        [5, [_veh, _vehName],{
            deleteVehicle ((_this select 0) select 0);
            hint format ["%1 wurde entfernt",((_this select 0) select 1)];
        },{"Action abgebrochen"}, format ["%1 wird entfernt",_vehName], {true}] call ace_common_fnc_progressBar;
  },[],6,true,true,"(isNull objectParent player) && ((player distance _target) < 7)"];```
#

3:24:21 Error in expression < private _vehs = (getPosWorld VVS_armored_1) nearEntities [["Car", "Mo>
3:24:21 Error position: <VVS_armored_1) nearEntities [["Car", "Mo>
3:24:21 Error Nicht definierte Variable in Ausdruck: vvs_armored_1
3:32:34 Error in expression < private _vehs = (getPosWorld VVS_armored_1) nearEntities [["Car", "Mo>
3:32:34 Error position: <VVS_armored_1) nearEntities [["Car", "Mo>
3:32:34 Error Nicht definierte Variable in Ausdruck: vvs_armored_1

#

what did i do wrong here?

#

i got an undefined variable at vvs_armored_1 what can be a variable here?

gray thistle
#

since vvs_armored_1 isn't a comand normaly and isn't called or spawned it is declared as global variable what did you want to do with this?

fallen notch
#

vvs_armored_1 is a marker that i want to check if there is a vehicle on it

gray thistle
#

have you declared vvs_amored_1 as a variable on the marker you placed?

fallen notch
#

yes instead of "del_pad01"

#

that one after getPosWorld

#

(line 3)

gray thistle
#

did you change it in the mission file on the marker?

#

becuase if you only change del_pad01 it is clear why it can't work

fallen notch
#

yes for sure

gray thistle
#

check again since it is a global variable it should be declared and the error should not show up

fallen notch
#

so

#

i check

#

vvs_armored_1 is an empty marker

#

there is no init text in that marker

#

just the variable name

gray thistle
#

alright sounds good still would you have me a pic about the attribute site?

fallen notch
#

of the marker?

gray thistle
#

yes

fallen notch
#

sure

#

(i think "Variables" is the actual position of that marker on the map)

#

hangon doing screenshot

blissful wind
#
terminalAvailable = true;
publicVariable "terminalAvailable";

0 = [DataTerminal,"Download mission",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"terminalAvailable",
"_caller distance _target < 3",
{},
{},
{[]execVM "someInit.sqf"}, 
{},
[],
2,
0,
false,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, DataTerminal]; ```
#

is working correctly in MP (not a dedicated server)

#

Thank you @winter rose for "else maybe publicVariable a bool that should be in the showCondition". You are correct in your "quick and dirty workaround".

#

i know this way it shows even from far away but for this purporse the terminal is inside a room anyway

subtle ore
#

@blissful wind Dedicated and listen servers are two different things in terms of what is local to which machine.

waxen tide
#

I want to spawn a bunch of civilians and have them stroll around and on some conditions go into (individual) houses. should i have them all join the same group with a group leader or will that only cause issues?

indigo snow
#

If youre controlling every way they move by script, id group them all up.

tardy wagon
#

I should make a game engine called uinty where everything is a uint32

winter rose
#

@blissful wind I think you can also put a distance in the condition, or somewhere else in the params

digital pulsar
#

@fallen notch if it's a marker then use getMarkerPos "markername";

spice kayak
#

When something is optional in a function, how would you skip over using it? I'm having a bit of trouble messing around with addAction. If anyone could help out, that would be great!

scarlet spoke
#

If it's optional and you don't need to set that argument (or one after that) just don't

spice kayak
#

Yeah, I got that, but it's if I need to set one after. Would I just write in what the defaults are?

scarlet spoke
#

Yeah

#

So consider the argument of format [one, two, three, four] of which two to four are optional. If you need to set three it would be [ValueOne, DefaultTwo, ValueThree]

spice kayak
#

so, for example, if I wanted an action only on the player and no one around, I'd decrease the radius, so I'd end up with something like player addAction ["Action","Script.sqf",nil,6,false,true,"",true,-1]; ?

scarlet spoke
#

Is that a real application of yours or is this just for the sake of making an example?

spice kayak
#

Sake of making an example.

scarlet spoke
#

As an example yes that would work

#

Ok

spice kayak
#

Thank you.

scarlet spoke
#

You're welcome

spice kayak
#

Well, I've gotten it to work, minus the radius thing haha. I can still walk up to the unit that also has the script and execute it, which isn't what I wanted, sadly.

#

I've got the radius set to -1, which is what I thought would work.

indigo snow
#

The radius seems really broken. Use the condition to cheat by checking the distance between object and player.

spice kayak
#

Well I only want the action on one player, and for only them to have access to it. I'm not sure distance between object and player would work in that sense.

peak plover
#

Ugh, is there an _array in _array ?

#

arrayIntersects seems to kind of do what I want; )

still forum
#

arrayIntersects removes all duplicates if you use the same array on both sides

#

and yes... there is an _array in _array.. It's called in

peak plover
#
["a","b","c"] arrayIntersect ["a","b","d"];
//["a","b"]
waxen tide
#

I have a string stored in a variable and i want to create an array which has that string as name. I'm a bit lost how to do that. var = "array name"

peak plover
#
call compile "myArrayName";
still forum
#

@waxen tide setVariable

peak plover
#

Took me ages to figure that one out

still forum
#

@peak plover getVariable

peak plover
#

That won't work in some cases

#

with dynamic scripts

still forum
#

not for local variables

#

Otherwise I don't see a reason why that wouldn't work

peak plover
#

I've ran into same issue as asdfghj, but I can't remember why

#

I needed to save something that I didn't know what it was

#

and getVar/setVar wouldn't do it

still forum
#

you don't need to for setVar... It accepts any type

peak plover
#

setVar [UNKOWN,_myvar];

#

that was my issue I thinnk

#

I think the variable and value were the same or sth...

#

But yeah, call compile helps

waxen tide
#

Thanks @still forum @peak plover i think i got it working

blissful wind
#

@winter rose yea, thats how it was originally with the distance in the condition. I just wanted to make sure it worked. I tried to add a second condition but there was something wrong with my syntax so i just delete the distance for now until i figure it out. only later because now i have to go to work. ttyl

winter rose
#

np! cya

blissful wind
#

cya 😃

waxen tide
#

maybe thats a tad too many.

manic sigil
#

Can you concatenate variables? Like dir100 = 2, dir10 =0, dir1= 5, dirtotal = 205?

waxen tide
#

just convert them to str?

#

you can concatenate strings with +

manic sigil
#

I know strings would work, just wrapping my head around converting it back into a variable :p a hamfisted way of selecting a heading using player input.

waxen tide
#

probably there is a better solution, but i guess that should work.

#

uhm

#

so you have like 3 selection menus where you can select 0-9, one for the first digit, one for the second digit, and one for the third digit ?

manic sigil
#

Yeah

waxen tide
#

just multiply dir100 input with 100, and dir10 input with 10, and then add dir100 + dir10 + dir1

manic sigil
#

Thats the plan at least.

waxen tide
#

2*100 = 200, 0 *10 = 0 -> 200+0+5 = 205

#

no concatenation necessary, just math

#

dirtotal = ((dir100*100) + (dir10 *10) + dir1))

manic sigil
#

Durf. Why do i always ignore the obvious t_t

spice kayak
#

When I add an action to a player, and it has "script.sqf" as the action, would that execute the script only for the player? I figured it might, just wanted to ask though.

waxen tide
#

hands ☕ to @manic sigil

still forum
#

Cuz somehow people think programming hsa to be hard

#

@spice kayak It executes the script for the one that activates the action

spice kayak
#

Thank you, I thought that might be the case. So, if in the script that is executed on the client, it turns out a light nearby. Would that light only go out for the client that executed the script?

#

I'm mostly confused because despite it being a client-executed action, it affects other objects.

still forum
#

depends on how you turn off the light

manic sigil
#

@still forum or i just pick an option that seems to work and ignore obvious easier solutions :p

spice kayak
#

Not going to lie, I copied and pasted this bit of code here; { for "_i" from 0 to count getAllHitPointsDamage _x - 1 do { _x setHitIndex [_i, 0.97]; }; } forEach nearestObjects [ pOperator2, [ "Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F" ], 100 ];

still forum
tame portal
#

@manic sigil What are you trying to do?

#

@manic sigil What are you trying to do?

spice kayak
#

So, everyone else would see it? :D

tame portal
#

Urgh discord sending my messages multiple times. Forget about it shining, my discord didn't load the newest messages until I already sent one ^^

manic sigil
#

@tame portal a proper JTAC scenario, full 9-line implementation.

spice kayak
#

So that's interesting. With the code I pasted earlier, it turns out every light, except for one bulb on one type of light, as shown here http://i.imgur.com/o4J4dhR.png

#

I'm not entirely sure why, though I feel it has something to do with setHitIndex, or how it counts the hitpoints.

waxen tide
#

I'm slightly annoyed by the sloppyness of the BI maps. not all military places are marked as military, airfields are inconsistent, etc.

spice kayak
#

There's a lot of inconsistency in every element of A3 :P

#

Which makes me wonder if set/getDammage still works.

#

Okay, I fixed my issue, though now I have another one. The code works wonderfully to set the damage of the lamps to the point of turning off, then back on 30 seconds later. Issue is, if I shoot out one of the lamps before the script is run, the game will then repair the light when it turns on, because that's what is written to do. I'm not sure how to get around that.

blissful wind
#

@waxen tide what do you mean by the airfields are inconsistent?

waxen tide
#

on tanoa airfield locations have the class airfields, on altis they don't, they're under local

blissful wind
#

Oh Ok. .thanks for clarifing

#

And good to know

spark sun
quasi rover
#

Is there a way that house is not destroyed by any attack?

spice kayak
#

You could constantly set it's health to 1 every second or so.

#
for "_i" from 0 to count getAllHitPointsDamage _x do {
        _x setHitIndex [_i, 0];
    };
} forEach nearestObjects 
[
    <GameLogicNameHere>, 
    [
        "<TypeOfHouseHere>"
    ], 
    10 //Distance in meters from the logic to look for house
];
sleep 1;```
#

Not sure if that'll work. It's similar to what I'm currently working on, so.

still forum
#

maybe allowDamage works for houses.. never tried

spice kayak
#

I'm not sure on that one. You'd have to experiment with it.

chrome mason
#

I need this:

_pos = position vehicle player;
(count (_pos nearEntities [['Man'],15]));
``` to search for specific class names such as O_soldier_F rather than 'man' anyone got any ideas?
still forum
#

Just... use the classname instead of "man"

#

Don't see the problem

peak plover
#

Is the curator camera saved somewhere as variable?

spice kayak
#

Aww, so I wrote this whole script about one team having flashlights that run on battery, waited til the battery drained only to find out that enableGunLights "ForceOff" doesn't work :(

peak plover
#

You could move the item to inventory if battary is full

#

*empty

spice kayak
#

Yeah, guess that could work. Was just a little gimmick I thought might make the mission a little more interesting, but it's not necessary or anything. Still having issues with the other gimmick from earlier, but I can't seem to figure it out :(

waxen tide
#

how do i mark up code in discord as sqf?

subtle ore
#

@waxen tide
three ticks sqf at the end of the first tick
then whtiespace,
then end with the other three ticks

#
systemChat "This is sqf syntax highlighting";
spice kayak
#

For multiline code, use ` three times at the start and end.

waxen tide
#
_array = ["array_name_1","array_name_2","array_name_3"];
{
    missionNamespace setVariable [_x, [1,2,3]];
    _x = [1,2,3]; // how do i access this?
} forEach _array;
spice kayak
#

You got it!

subtle ore
#

there yo ugo.

waxen tide
#

thx

cold pebble
#
Code here
subtle ore
#

afaik syntax highlighting only supports multiline

cold pebble
#

Thanks discord for double putting it

#
If (discord_trash) then {hint "cry"};
subtle ore
#

Well obviously you didn't click the link initially, I was just bringing downwards a ways after some people had answered...

waxen tide
#

what's the "you'll be shot for pasting so much code lines" limit?

spice kayak
#

If you need to post a lot, use Hastebin. I love that site.

tame portal
#

@waxen tide Around 2k

spice kayak
#

if you change the filetype at the end of the addess, it'll change the syntax highlighting.

tame portal
#

Hastebin, pastebin, ghostbin

#

You're right, hastebin has sqf highlighting

rotund cypress
#

Hastebin is easiest by far and best IMO

#

Clean and simple

#

Paste and Save

spice kayak
#

Exactly why I love it so much.

#

:D

waxen tide
#
_types = [["NameCityCapital", "ColorWhite", "Capital City"],["NameVillage","ColorRed","Village"],["NameCity", "ColorRed", "City"],["NameLocal", "ColorPink", "Point of Interest"],["NameMarine", "ColorBlue", "Bay"],["Hill", "ColorGreen","Hill"]];
{
    _temp_list_name = [];
    _temp_location = (_x select 0);
    _temp_color = (_x select 1);
    _temp_text = (_x select 2);
    {
        _temp_list_name pushBackUnique [_x, text _x, position _x];
    } forEach nearestLocations [player, [(_x select 0)], 50000];
    missionNamespace setVariable [((_x select 0) + "List"), _temp_list_name];
    {
    _mkr = createMarker [format ["dmkr_%1_%2", _forEachIndex, _temp_location], position (_x select 0)];
    _mkr setMarkerShape "Icon";
    _mkr setMarkerType "hd_flag";
    _mkr setMarkerColor _temp_color;
    _mkr setMarkerText format ["%1 - %2", _temp_text, text (_x select 0)];
    _mkr setMarkerAlpha 1;
    } forEach _temp_list_name
} forEach _types;
#

is this acceptable, or did i do horrible things?

rotund cypress
#

Use params instead of select

#

Use privates

#

_temp_location = (_x select 0);
->
_x params [["_temp_location", [], [[]]]]

spice kayak
#

Okay, I've tried to stick together a solution to my issue from earlier today, though I'd have no idea if it'll work, so if someone could glance over it, that would be great. Basically, I'm using the suggest method of turning out all the lights in a certain radius, then turning them back on again. That part was simple. The harder part was keeping damaged lights, damaged. For example, if you shoot the light before using the script, the light will break, then heal itself once the script reaches the point to turn the lights back on again. That's not what I want. If it's broken, it should stay broken, which is why I've written what I've written.

Code here: https://hastebin.com/ikacivayag.sqf