#arma3_scripting

1 messages ยท Page 481 of 1

drowsy axle
marble valley
#

So there's a new update that allowed the AH-1Z to utilize it's MFD's. It has stuff like weapon systems, Fuel distribution and time of flight left, the and a few others.

However, the only way i know to change each panel's display is by using the mouse wheel over and over again for each one.

Anyone know how to use custom controls to make a keybinding to change both the right and left MFD in the AH-1Z?

tough abyss
#

@fierce ingot what do you mean by works. If you mean will command accept values more than 1? Sure. Will it make AI more skilful? Hell no.

outer fjord
#

Could anybody assist me with the Dynamic Pylon functionality?

#

I have it written as _vehicle setPylonLoadOut [1, "PylonMissile_1Rnd_BombCluster_03_F"];

#

It's based on the UCAV, issue is when it spawns it, you have no driver control anymore.

#

Seems like you still need to define the turret, but I'm not sure how

meager granite
#
_vehicle setPylonLoadOut [1, "PylonMissile_1Rnd_BombCluster_03_F", true, []];
outer fjord
#

Whats the extra[] for?

tough abyss
#

no forced turret

meager granite
#

Command needs empty array to specify that pylon is controlled by driver

#

turret = [] (empty for pilot)

#

numbers inside will mean turret

outer fjord
#

ah

#

Also, anybody have a none-ACE recommendation for toning down the NVGs?

meager heart
#

also just google "nvg script arma 3"

chilly wigeon
#

Glanced around google but didn't find an answer, is there any way to do loose comparison in A3? ie. 1 == true

long hatch
#

Hi, how can i create a RPT entry with diag_log on the Server after using a local function?

tough abyss
#

"whatever" remoteExec ["diag_log", 2];

#

1 == parseNumber true @chilly wigeon

wary vine
#

@still forum is it possible to overwrite one of your tfar functions with a mod ?

fossil yew
#

Does civilian presence module work in multiplayer?

outer fjord
#

Yes

fossil yew
#

thanks

still forum
#

@wary vine If you are lucky yes..
Usually not tho..

wary vine
#

I got it working

still forum
#

If you are the first to register a function then you won. If not then.. not.

wary vine
#

you can overwrite

#

I added it to required addons then ```
//Function Overwrites
class CfgFunctions
{
class TFAR
{
class Radio
{
class canUseSWRadio {file = "\Lega_xPhone_Client\overides\tfar\fn_canUseSWRadio.sqf";};
};
};
};

still forum
#

Ahhh .. You gotta say whether old or new TFAR :u

wary vine
#

new ?

#

wait wut ?

#

i just downloaded the latest from the website, and the functions are defined the same ?

still forum
#

latest from the website is old tfar

wary vine
#

where is the new ?

still forum
#

github or workshop

wary vine
#

the github linked on the website ?

still forum
#

ye

wary vine
#

last updated 2 years ago o.O

still forum
#

yeah.. old TFAR

wary vine
#

Where is the new I can't find it ?

wary vine
#

ahh ty

#

I think ill stick to the old version, until I have looked through this some more xD

calm bloom
#

Hello guys, is there any way to detect nearby simple objects?

long hatch
#

i don't know if this is the right section, but since 1.71 it's possible to use enableDebugConsole[] = {"81273982178973213"}; in a Mod, but there is no example how to use it or write it down. Just i need to put a config.cpp with these two lines in the pbofile?

enableDebugConsole[] = {"81273982178973213"};```
quartz coyote
#

Hello, could someone link me a good tutorial about safeZones and how to uses them ?

#

I tend to loose myself when I use them

copper raven
#

Is there a way to go past "maximum" ammo count in a magazine without mods? e.g _vic addMagazineTurret ["magazine_Cannon_Phalanx_x1550",[-1],2000]; ammo is capped at 1550, anything below 1550 works (as expected)

slender halo
#

@copper raven you can fill the magazine after every shot

#

i belive

copper raven
#

Yeah, just wondering if there is a cleaner way

digital jacinth
#

Not really, you can do your own bullet count however.
e.g. make a mag count with 90 bullets for a 30 one
so you linear convert 0 to 90 towards 0 to 30 and just set ammo.

It is how I made an mg42 have around 1000 rounds instead of like 50 per belt.

#

it kinda melted halfway through tho

copper raven
#

๐Ÿ‘Œ

digital jacinth
#

downside is obviously if you reload and need to calculate the new virutal bullet count, you either gain or lose some rounds

round scroll
#

now I have the first log results for exportJIPMessages - I guess the long ------- lines mark a single JIP event? A quick grep shows that there are 27300 of these lines - is that excessive?

#

seems command (String) = bis_fnc_settasklocal is most numerous with 6274 occurences

long hatch
#

@tough abyss yes i am on this page and was read it. But i don't understand how to build a Mod with it, so how it looks like i a complete Mod, so where is this line to be typed down. So is it enough to make config.cpp that looks like this:

cfgPatches {
    some cfgPatches Stuff
};

delete enableDebugConsole;
enableDebugConsole[] = {"81273982178973213"};
hollow thistle
#

it is enough.

vernal mural
#

let's say I want to modify the appearance of a vehicle during the mission. Like adding ractive armor on an APC or a camonet on a tank. What should I use ? Is it considered as an animation, just like opening a door or a hatchback ?

#

nvm, I got it

tough abyss
wide hamlet
#

is the 50 in [(getPos player), ['Land_fs_feed_F'],50] how close to the object the player is

still forum
#

You provided no useful context whatsoever

#

We can't know what that is supposed to mean

wide hamlet
#

condition = "(count (nearestObjects [(getPos player), ['Land_fs_feed_F'],50]) >0)";

#

interaction condition

#

would the 50 be the distance to the object

wide hamlet
#

ty

ruby breach
#

There's also no reason to use nearestObjects there. Use nearObjects

unborn ether
#

Does canMove return false when the helicopter rotors are damaged?

tough abyss
#

Who knows

#

That command is inconsistent

still latch
#

hi.
Can some one explain to me how CfgRemoteExec works?
If I have server addon that implement function my_func. And I want to call this function by clients.

Should I define my_func in CfgRemoteExec on client or server?

orchid saffron
#

Hello guys, do you know any way of returning all the segments of a rope?

#

I donยดt really know if it is possible because ropeยดs segments are CfgNonAIVehicles

#

player nearObjects ["RopeSegment",10] returns the segments but how do i check the segments are from my original rope?

wide hamlet
#

so i assume the condition is returning false although im within range. ANy ideas?

orchid saffron
#

Do you get any objects if you test in debug console: nearestObjects [getPos player, ["Land_fs_feed_F"],50]

wide hamlet
#

@orchid saffron nearobjects returns "ANY" nearest returns "[216aaa7c100# 1170348: fs_feed_f.p3d REMOTE]"

orchid saffron
#

So when nearest returns more than 0

#

Your condition is not working, right?

wide hamlet
#

correct. As is, in range, it does not return true

orchid saffron
#

Have you checked if it binarized correctly?

wide hamlet
#

sorry im still new/learning scripting. What are you referring to

orchid saffron
#

If not try opening the config and looking for your condition

#

Your making an addon, right?

#

I suppose in your context, condition is a UserAction parameter

wide hamlet
#

no sir. This is being added into my existing config.cpp of my mission file. Where the class is an interaction menu for the scroll wheel that should only show up when the condition = true. However when the condition should be true, the option in the menu is not displayed

orchid saffron
#

Can you provide a full pastebin?

#

Also, are you saying you have a config.cpp inside a mission folder?

wide hamlet
#

yes. here is the .cpp pastebinned: https://pastebin.com/GnvY6LMR
it is an exile mod mission so yes it does require the cpp inside of the mission pbo

still forum
#

config.cpp's don't work in missions

wide hamlet
#

exile requires it. ig ill go ask them. Sorry for the waste ๐Ÿ˜›

inner swallow
#

A: Yes and no, the Enforce is very different from the SQF and porting scripts from one to another can sometimes lead to re-design the feature and/or architecture itself.```
still forum
#

Context?

#

Did BI just officially announce Enfusion based Arma 4?

inner swallow
#

ah no ๐Ÿ˜„

#

Q/A related to dayZ modding

#

they seem to be comparing and contrasting it with A2/A3 a lot so figured it would be of interest

#

for example

#

In last weekโ€™s announcement we already mentioned, that DayZ is a hybrid between the RV and the Enfusion engines. While the packing and the asset creation are mostly unchanged and will go through the same process as for Arma 3, the rest (script, particles, animations, UI etc.) will be handled via the Workbench, which is a powerful all-in-one tool developed to handle everything Enfusion related.

still forum
#

that DayZ is a hybrid between the RV and the Enfusion engines That's a lie though

#

It's not.

#

we already knew the workbench tool
We also already knew that DayZ got completly rid of SQF

#

but as said many times here that might not be Arma relevant at all

#

DayZ has no legacy mods that want to be ported. They don't need to care about any backwards compatability

inner swallow
#

yeah but i'd be very surprised if A4 won't be similar - in fact it could well be even more distant from RV4 since they'll have more time

still forum
#

Considering they don't even know how their own engine came to be.. I wouldn't believe any word they are saying there

inner swallow
#

lol

#

is it not possible they're simplifying it, as opposed to lying?

still forum
#

They just have to replace a word

#

the sentence wouldn't get more complicated by writing it correctly

waxen tide
#

Why do i have the strong feeling that BI will just replace old problems with new problems.

still forum
#

Because we've already seen that they did.

#

They are "minor" problems that can still be fixed

waxen tide
#

dreams about a community overhaul of arma

inner swallow
#

heh that may be downplaying BI's own efforts though

bright shore
#

Hi guy's im new at arma, so i'm playing with the guns and stuff in virtual arsenal and one thing annoys me. I don't have infinite ammo, once i'm out of bullet i have to go to main menu and reload? How can i fix that

still forum
bright shore
#

I've red this one, but not sure where to put this code so it only would affect Arsenal VR

still forum
#

Does VR Arsenal have access to debug console? When you press Esc?

bright shore
#

Yes it does, i did paste it in. But doesn't seem to take an effect

still forum
#

replace the this at the start with player

bright shore
#

Thank you, seems to be working now

obsidian kiln
#

ahh the joys of learning arma scripting for the first time

velvet merlin
#

is use of waitUntil instead of while really meaningful for performance reasons?

obsidian kiln
#

depends on what you are checking

velvet merlin
#

how does this matter?

#

is the eval time not the same?

obsidian kiln
#

should be the same

#

performance wise

#

i think

tough abyss
#

They are 2 different commands, canโ€™t really compare them without context

meager heart
#

should be the same
no they're not...

0 spawn {
    private _t = 0;
    while {time < 20} do {
        _t = _t + 1;
        hintSilent str _t;
    };
};
//--- vs
0 spawn {
    private _t = 0;
    waitUntil {  
        _t = _t + 1;
        hintSilent str _t;  
        time >= 20
    };
};
```into the console ^
(edited ^ changelog: added comment ๐Ÿ˜€)
velvet merlin
#

what if you add sleep 0.1; to both? is the difference then negligible?

robust hollow
#

yes with sleep they both loop at a similar frequency but at that point you should just use while imo. with that example above on 20fps the while loop increases at a few thousand per second and the waituntil is closer to 20 per second which supports the wiki's statement saying waituntil will loop on almost every frame.

velvet merlin
#

cheers fellas ๐Ÿ‘

lament grotto
#

hey guys I got a question, I want to do a thing where the ai i hacking a door and the player must defend the ai while hes doing it (playing an animation). However becuase they are trying to breach a placed object I want the doors on it to be locked. is there a script I can use that will lock the door? this setVariable ['bis_disabled_Door_1',1,true] Using that right now and it doesnt seem to work

dim terrace
#

with the ai?

#

probably placing some object could solve it - I don't think AI is checking for userActions conditions at all

still forum
#

@velvet merlin while with a very short sleep is equal to a waitUntil.

#

waitUntil is just a while loop with integrated suspension. You can just fake the suspension with a very short sleep

#

but with the while loop you can also control the minimum sleep time. For waitUntil the minimum is a single frame

lament grotto
#

I dont want the player opening the door. AI wont enter it due to how Ive made it

dim terrace
#

where did you put that code? in building init?

lament grotto
#

ye

dim terrace
#

which building it is?

tough abyss
#

A little late to the party but I think my two big concerns around what has happened with DayZ, their statements about consoles and everything we so far know is that Arma 4 probably wont change the threading model enough. We are extremely limited in what we can do right now, a lot of mods just have loops to check some aspect periodically and they ought to be running parallel or have a much better event system. Throw in console like interfaces and you have a recipe for worse than current

still forum
#

IMO console stuff is irrelevant for A4

#

I just hope Arma/Linux/Mac

tough abyss
#

Moving to another unknown language isn't going to be great, a lack of genuine improvement in concurrency will limit modding and performance once again. Console just means really bad limited control systems.

inner swallow
#

Well, here's the thing - either they make a clean break and a lot of modding effort needs to start from scratch (apart from the models and terrains probably, but i assume config stuff will need an overhaul) or they retain significant backwards compatibility without much improvement to the threading model

#

i'm unsure they can do both

#

I think a clean break on the engine side will be the best in the long run, if a bit painful

still forum
#

I don't know what backwards compatability has to do with threading model

#

Configs don't matter concerning multithreading.

#

And Enscript won't be multithreaded, same as SQF

inner swallow
#

they don't but they're interfacing with the engine, finally

still forum
#

interfacing?

inner swallow
#

configs i mean

#

i'm using the word "interfacing" in the general english sense ๐Ÿ˜„

#

the engine reads the configs and makes sense of the values it reads

#

if they overhaul that system then i assume configs will need to be redone

#

along with class inheritance etc

still forum
#

Where can I see that new config stuff? never heard of that

inner swallow
#

i'm speculating

#

but i assume config stuff will need an overhaul

#

assume

still forum
#

actually kinda weird.. We didn't see any new config stuff at all till now

inner swallow
#

re: threading and backwards compatibility - i'm no expert, but played around with Open MP a few years ago. I remember there were certain procedures to be followed while spawning new threads, marking serial sections, syncing threads, etc. If the engine has some expectations about this that the SQF-to-native compiler/converter/translator/whatever doesn't do, then there probably won't be backwards compatibility.

still forum
#

So far we have 0 multithreading in Enscript

#

But it's alot faster and alot of other stuff was moved away from mainThread

#

so we'll be able to do a F-ton more stuff. Yeah sure. We are still limited in the end. But I don't think that matters much

queen cargo
#

adding real threads to stack-based languages is fairly complicated
just to note this here

#

mostly has to do with the way variables and methods are accessed though

#

and with garbage collection

#

and with other stuff i do not think of right now

still forum
#

garbage collection is irrelevant for Arma. As refcounting makes sure no one else can have access

queen cargo
#

refcounting would also have to be made concurrent safe

#

it is not done with a simple ++ and -- like now

#

"like now"

still forum
#

Putting a mutex or similar onto every variable/method and stuff would hurt speed sooo much

#

refcounting is already atomic

queen cargo
#

stuff like objects would still need mutex

#

unless you want wanky problems that occur randomly due to renderer receiving old x and new yz coordinates

still forum
#

They would probably still split script/simulation/render

queen cargo
#

๐Ÿคท
tbh ... anything faster than SQF will be useful ๐Ÿ˜„

still forum
#

than*

queen cargo
#

<@&105621371547045888> *

open vigil
#

Gone

queen cargo
#

๐Ÿ‘

ruby turtle
#

is this possible for MP?

{ _x allowDamage false; } forEach units group player;
sleep120;
{ _x sallowDamage true; } forEach units group player;

I want that players are having godmode for the first 2 minutes at the mission beginning

queen cargo
#

Arguments have to be local to the net-client executing
effects are global

ruby turtle
#

initplayerlocal?

queen cargo
#

for example
just that then it is not at mission start but rather everytime a player gets init

#

as alternative, use a more complicated script involving time

#
private _deltaT = 200 - time;
if _detaT > 0 then {
    _deltaT spawn {
        player allowDamage false;
        sleep _this;
        player allowDamage true;
    };
};```
ruby turtle
#

it just need to be prevent damage when the "mission intro" in First Person view starts and the player base are under rocket artillery attack with danger close impacts.

#

what means private?

queen cargo
tough abyss
#

Surely the use of Enscript is going to ruin compatibility anyway, it is at least on the scripting side a clean break. We aren't just going to be able to port SQF, even A2 to A3 with the same basic language we couldn't do that and I don't think we can expect it. But given all the rewriting necessary and combined with the lack of progress on the threading model it is going to be a lot of porting effort with no improvement in the model.

#

It is another language with the same basic problems of SQF, an otherwise unsupported language with a poor performance lifecycle and no tooling.

ruby turtle
#

X39 what does your script exactly do

queen cargo
#

i might be able to provide a fairly simple SQF->Enscript tool
even though BI does not have such a utility, i doubt that most commands used do not have such capabilities

errant jasper
#

sleep _this not _delaT

ruby turtle
#

X39 what does the first two lines do in your script, don't really understand

queen cargo
#

@ruby turtle exactly what you want if you put it into initPlayerLocal.sqf

ruby turtle
#

okey xD

queen cargo
#

if you do not understand a command, check out the wiki page or get into more detail ๐Ÿ˜ƒ

#

@errant jasper mhh? it is

#

ahhh

#

wait

#

fuck

#

i see now ๐Ÿคฆ

ruby turtle
#

syntax I mean. _deltaT = 200 - time. What does this do?

errant jasper
#

Don't worry, we all do it.

queen cargo
#

@ruby turtle fixed a tiny little error ๐Ÿ™ˆ

ruby turtle
#

when I exec a script trough initplayerlocal in a seperate .sqf it still stay local?

#

I meant does the locality change when i exec a script in a script of a script?

ruby breach
#

when i exec a script in a script of a script do what now?

queen cargo
#

uhm ...
@ruby turtle

//Assign a variable a value
<variable> = <value>;
_deltaT = <value>;
//Assign a local variable a value
private _deltaT = <value>;
//Calculate deltaT, see https://community.bistudio.com/wiki/time for more info about time operator
//deltaT being the remaining time to allowDamage false
200 - time```
errant jasper
#

Scripts don't really have locality. I mean they are always local to the machine they are executing on (I guess you could say). Objects, like vehicle, AI and players have locality.

queen cargo
#

really need to start writing that damn SQF book ...

#

but not even the chapter drafting is done yet ๐Ÿ˜ฆ

errant jasper
#

I would just do:

[] spawn {
     player allowDamage false;
     waitUntil {time > 200};
     player allowDamage true;
};```
ruby turtle
#

initPlayerLocal.sqf:

[] execVM "script1.sqf";

script1.sqf:

[] execVM "script2.sqf";

does this still execute local?

still forum
#

Where else would it execute?

#

As long as you don't remoteExec/publicVariable everything is local

queen cargo
#

@errant jasper hah ... theoretically, that is the more simple and easier to understand code .. though ... my approach is more clear technically ๐Ÿ™ˆ

ruby turtle
#

same with initServer in this example everything is execute on server?

still forum
#

initServer only runs on the server

#

and as every script runs locally

#

and this only runs on the server...

ruby turtle
#

My question just was, if arma knows when a script in a script in a script based on initplayerLocal still knows that it was local. but thanks for the answer :=)

still forum
#

if arma knows when a script in a script in a script based on initplayerLocal still knows that it was local no it doesn't

tough abyss
#

@queen cargo perfect time to have a book when no more updates or fixes are expected that could alter or change functionality, but at the same time pointless for a dying title that soon will be played by 3 people and their dog

queen cargo
#

doubt we will see arma 4 that soon

#

if the whole thing gets done before end of 2018, it actually can help loads of ppl

peak plover
#

is it going to be arma 4 even?

queen cargo
#

you do not let a brand die for no reason @peak plover

tough abyss
#

Doesnโ€™t matter, sqf will die just like sqs once did and if enforce is as fast as they claim it to be who would need sqf ever again?

peak plover
#

Maybe like

#

Arma BLUE

#

or whatever

#

It doesn't have to be a higher number

#

Doesn't even need a number

queen cargo
#

ArmA - Live Service

#

@tough abyss so what? you still will have plenty of people till then learning SQF

peak plover
#

Just Arma

#

That's it

#

All the other games are doing that ๐Ÿ˜„

queen cargo
#

i also did not stopped developing my sqfvm just because arma 4 might come at some point

peak plover
#

Also arma 1 was arma armed assault

#

so 4th arma could be Arma

formal vigil
#

ArmaSoft, ArmaOrigin, DeArma, Good 'ol Arma

peak plover
#

Yeah, sqf still has years until it's completely gone

#

Arma still lives ok

formal vigil
#

Wouldn't mind if they've switched it to C#

peak plover
#

I hope the community DLC bring new game modes in 'tho

queen cargo
#

also, arma 4 will need to have most features arma 3 has nowadays
which is ... quite hard to do if one looks at how long it took em

#

thus either they release without stuff like the radar things etc. or they wait till they have that implemented too

#

thing is: either they underdeliver, or they take their time

peak plover
#

yeah, that's why having a great platform is good

queen cargo
#

and looking at how long it took communities to just switch to arma 3 from arma 2 ...

formal vigil
#

underdeliver

queen cargo
#

SQF will be with us a long time

peak plover
#

So if you add stuff like bipods you can use them for a while

formal vigil
#

omg. made my day ๐Ÿ˜‚

peak plover
#

I think they did great with arma 3 so far

#

Bipods and stuff were worth the investment in time and will be used for many years

#

Plus 3den

#

Zeus

#

Great things, but I imagine a new game would start without those

queen cargo
#

now, what if they would launch without all of that into arma 4?
community would outcry like babies on a canibal bbq

formal vigil
#

idk

#

as long as there would be documentation, im fine

peak plover
#

The smartest thing in case of at least zeus would be to re-create it, knwoing the shortcomings of the current one. But it's nice no matter what

#

Yeah

queen cargo
#

that is why i personally think SQF will stay way longer then some think with us

peak plover
#

Documentation

#

Loss of .sqf and all the documentations ๐Ÿ˜ข

formal vigil
#

That's why I'd melt in my chair if they've moved to i.e. C#

queen cargo
#

documentation wise, enscript looks ok

#

they will never @formal vigil

#

problem is: c# is not suited for what arma needs

formal vigil
#

interesting. please elaborate

queen cargo
#

serialization

#

got covered hundrets of times already

formal vigil
#

first time hear

#

got any sources?

#

would love to read

queen cargo
#

all in discord
would require loads of searching
long story short is: serializing stacks is hard
SQF allows to serialize the stack and thus continue with scripts wherever you have been

#

Enscript also will allow that fairly easy

#

in C# etc. however, you serialize the objects and stop the whole script execution

#

sooo ... it mostly is about savestates, code transfer etc.

#

some things could be solved in C# and i personally think, even the stack saving could be solved ... though ... will require a deep dive into mono, but it is not on us to decide

formal vigil
#

why mono, tho?

queen cargo
#

can guarantee ya that BI 100% checked not only once if developing enscript was cheaper then just using an existing one

formal vigil
#

.net core baby

#

runs natively on everything

queen cargo
#

never worked with .net core

formal vigil
#

I do recommend

#

Finally I was able to host my ASP.NET MVC sites on Linux

queen cargo
#

also, mono is open source and has large community which will be vital if you want to actually check stuff like if you can serialize the stack somewhere

formal vigil
#

.net core is also open source and has a growing community

#

don't want to sound like I'm arguing about anything

#

I'm too old for that ๐Ÿ˜‚

queen cargo
#

๐Ÿคท anyways ... SQF sticks with us for a few years
ppl from BI might shine some more light into when we can expect SQF to die out, but doubt we would ever get something like that

#

seeing how the transition from A2 to A3 worked out, it also will take a year or two until most groups switched the game

#

and as A4 was not even announced yet, SQF probably will be with us for at least next 4 years

#

thus: SQF book can still help ppl the next three years

#

buuut ... that would need that thing to be done in this year ๐Ÿ™ˆ

halcyon crypt
#

just make a dump of the wiki and sell it as a book ๐Ÿ˜›

formal vigil
#

as couple of 1000s pages encyclopedias, FTFY

queen cargo
#

ha
hahaha
no @halcyon crypt

formal vigil
#

hmmm

#

how can I generate a text version of map contents?

queen cargo
#

wut?

formal vigil
#

let's say I make a mission in the editor

#

put some stuff on the map: sectors, markers, triggers, etc...

#

now I want to have that being generated on a blank map by mission code (sqf?) instead

queen cargo
formal vigil
#

like, ['myfile.txt'] call exportAllStuffToSqf;

#

design first

#

have them pre-located

#

and then get the positions

queen cargo
#

but why?

formal vigil
#

portability

#

once I'm done with the mission on one map it would be easier to move to another, wouldn't it?

queen cargo
#

CTRL+C and CTRL+V will help you for that
as alternative, there is also merge

so lemme repeat my question: what is your goal you want to achieve?

formal vigil
#

oooh this is interesting

#

my goal is to be able to quickly migrate from one map to another with a mission

dusk sage
#

A different map?..

formal vigil
#

Yes

#

Imagine you're working on Altis with your mission

#

and suddenly you decide to have the same mission on i.e. Tanoa

#

That's what I mean by porting to a different map.

dusk sage
#

Like X39 said

#

CTRL+C CTRL+V

formal vigil
#

yeah, I know

#

just wanted to avoid it, but guess there's no better way of doing that than using the old and wisdom mr. Copy Paste

queen cargo
#

there is, also as i said, the option to merge missions

formal vigil
#

I was thinking more about programistic way, thus was asking for entities dump w/ positions and properties

#

well, before even that I'll need to sit tonight to my mission and figure out what's causing the problem of not being able to join/rejoin the mission after a while

polar folio
ruby turtle
#

on current asking in other discord, there is no help.

if (behaviour _grp2 == "COMBAT") then { { doGetOut _X} forEach units _grp2; }

but _grp2 is a spawned group over script with no single unit names. how I can use an array for doGetOut for the whole _grp2?

ruby breach
ruby turtle
#

I don't really knows much about scripting... ๐Ÿ˜ฆ but an array of units are not possible because the _grp spawned from this:

_grp2 = [[7003.69,5255.72], East, (configfile >> "CfgGroups" >> "east" >> "oksv_army_wood" >> "40th_wood_infantry" >> "40th_platoon_butan")] call BIS_fnc_spawnGroup;

still forum
#

You already have an array of units

#

Do you know what forEach does?

ruby turtle
#

it summarize something of something

ruby breach
ruby turtle
#

thats my current work. but i have no idea how i use _grp2 with doGetOut

#

doGetOut ("_grp2") won't work.

ruby breach
#

Well, for starters ("_grp2") isn't even an array, much less an array of units

ruby turtle
#

("_grp","")

#

better?

still forum
ruby turtle
#

["_grp2"] ? O.O'y

ruby breach
#

That is an array of string(s), yes

ruby turtle
#

so I need to use [_grp2]

still forum
#

That would be an array with one group inside

ruby turtle
#

I just need one group at once.

ruby breach
#

You don't need the group at all. Not for behaviour or doGetOut

#

You need a single unit from the group, and you need an array of the units in the group, respectively.

ruby turtle
#

it also says type group expected object. it will not work.

but there is no varibale for a single unit of the group.

ruby breach
#

Because you have to make it

still forum
#

there is a command to get a single unit out of a group

ruby turtle
#

is there no easy way to simply get _grp2 out of a vehicle?

meager heart
#
_grp2 leaveVehicle _vehicle;
ruby turtle
#

they just have to leave the vehicle if combat mode changes to combat.

still forum
#

In ArmA 3 this command will not force a player to exit from a vehicle @meager heart nvm player != unit != AI != banana

grizzled rain
#

Could someone help me set up a script? I am trying to get a video to play on multi tv's at the same time. I got it to play on a trigger. it goes full screen. But I want it on the TV's

ruby breach
meager heart
#

Dedmen, k, rgr ๐Ÿ˜„

ruby turtle
#

how i can get a return of a single unit if I spawn a predefined group from cfggroups and the single units have no name?

#

of a single units behavior

ruby breach
#

You get an array of units from the group, and then select one

still forum
#

or you just take the leader

#

there is always one

ruby turtle
#

where i can find these special array?

ruby breach
#

You've already used the command to return the array of units before

still forum
#

you already have it in your code

#

What did you think the units command does?

#

I already sent you a link to it's wiki page before.. Here it is again. just read

#

But as I already said.. Just take the leader

ruby turtle
#

is there a special command to get the leader?

still forum
#

yes

ruby turtle
#

I currently I did this: but I know it is wrong:

behaviour units group _grp2;
if (behaviour units group _grp2 == "COMBAT") then { _grp2 leaveVehicle _veh1;}
still forum
#

Completely wrong yes.. But why are you showing us that?

ruby turtle
#

I have no idea anymore how I realize it correctly

peak plover
#

behaviour array

#

that can't be right

#

group group

#

๐Ÿค”

still forum
#

๐Ÿฟ

ruby breach
#

It's one step closer than behaviour group... maybe

still forum
#

I'd say two steps further away

#

As I already said.. Use the group leader

ruby breach
#

actually, just saw the group group, definitely not closer

still forum
#

It really isn't that hard at all

ruby turtle
#

how?

peak plover
#

@ruby turtle You need to google basic coding

#
behaviour units group _grp2;
meager heart
ruby breach
#

If the command to get units is units, what do you think the command to get leader is?

still forum
#

@peak plover we are working on this for more than an hour.. He stopped writing at a different discord and cross-posted to here because I got fed up with the idiocy

peak plover
#

oooh

#

I scrolled up

#

I see now

ruby turtle
#

leader?

still forum
#

ding ding ding ding

ruby breach
#

โœ”

still forum
ruby turtle
#

_b = behaviour leader _grp2;

peak plover
#

or even better, memorize it @still forum

still forum
#

Insane!

peak plover
#

@ruby turtle Use a more self explanitory variable name

#

_behaviour

#

Unless you are dslycxi there is no reason to use a single letter

still forum
#

Performance tho! But I don't know anyone who cares that much ๐Ÿ˜„

ruby breach
#

_superLongVariableNameBecauseINeedToBeSuperSpecificForThisThing

ruby turtle
#

and then: if (_behaviour == "COMBAT") then { _grp2 leaveVehicle _veh1;}

#

?

ruby breach
#

Assuming the group is in that vehicle, that should work

#

Probably want to end the statement with a semicolon though

ruby turtle
#

it works more or less thanks. leaveVehicle dosnt work in combat siuation. can I use instead this?

if (_b_grp2 == "COMBAT") then { doGetOut [_grp2]};

ruby breach
#

no

still forum
#

we already talked about why that doesn't work

ruby breach
#

doGetOut requires an array of units

minor lance
#

Hello!

ruby turtle
#

how I get a return of the group units?
_grp2 = [[7003.69,5255.72], East, (configfile >> "CfgGroups" >> "east" >> "oksv_army_wood" >> "40th_wood_infantry" >> "40th_platoon_butan")] call BIS_fnc_spawnGroup; is that you meant`?

still forum
#

Ohayo gozaimasu!

ruby turtle
#

blabla forEach units _grp2;?

still forum
#

Do you know what forEach does?

ruby breach
#

Did someone say recursion?

ruby turtle
#

I don't really understand it

#

only it returns an array. but cant interpret the thing with _x magic variable

still forum
#

it doesn't return an array

ruby turtle
#

if (_b_grp2 == "COMBAT") then { doGetOut [_x] forEach units _grp2};

#

maysbe this?

ruby breach
#

You do not need forEach

still forum
#

Now you are back at where we were 1,5 hours ago

ruby breach
#

Stop trying to use it

still forum
#

Just a little worse

ruby turtle
#

if (_b_grp2 == "COMBAT") then { doGetOut [_x] units _grp2};

ruby breach
#

closer

ruby turtle
#

if (_b_grp2 == "COMBAT") then { doGetOut [_x] units group _grp2};

still forum
#

Are you gonna spam every possible combination now and wait till someone says you're right?

#

in that case read #rules first.

ruby turtle
#

dedmen you didnt help with that...

still forum
#

I didn't help with trying to prevent you from being banned?

#

We already gave you everything you need.. But okey.. Here we go again

ruby breach
#

if _grp2 is a Group, and units returns an Array of units within a group. What might you need to do in order to achieve doGetOut <Array of Units within _grp2>?

still forum
#

watch what one returns and what the other wants as parameter

ruby turtle
#

units?

still forum
#

units command returns an array of units..
And what does doGetOut want as parameter?

ruby turtle
#

if (_b_grp2 == "COMBAT") then { doGetOut [units] _grp2};

#

thats right now?

still forum
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

high marsh
#

What do we want? Units! When do we want it? Now!

ruby turtle
#

Iam wrong again`

#

-.-

still forum
#

No. Not again

#

you are still wrong

#

Can't remember you ever being right today ^^

high marsh
#
if(_b_grp2 == "COMBAT") then {
    doGetOut (units _grp2);
};
ruby turtle
#

together in that ?! lol....

still forum
#

Btw parenthesis aren't needed here

ruby turtle
#

() instead of []?

still forum
#

No

#

nothing instead of []

ruby breach
#

To be fair, they aren't needed in 90% of the places that I use them either. Just a habit from one too many array errors

still forum
#

I always put them down when I have binary commands

ruby turtle
#

if (_b_grp2 == "COMBAT") then { doGetOut units _grp2};

still forum
#

but you can stack unary commands as long as you want

ruby turtle
#

finally that?

ruby breach
#

This is what I wrote when we started an hour ago: ```sqf
private _group2Units = units _grp2;
if (behaviour (_group2Units select 0) == "COMBAT") then { doGetOut _group2Units};

still forum
#

if (behaviour selectRandom _group2Units == "COMBAT") then { doGetOut _group2Units};
๐Ÿ˜

ruby turtle
#

so my (Midnights) Version is wrong?

still forum
#

no

peak plover
#

Param 0, default objNull, just in case group is empty

still forum
#

Oh right. Yeah

ruby breach
#

In this case, the group is created a few lines above this

still forum
#

if (behaviour ([selectRandom _group2Units] param [0, objNull]) == "COMBAT") then { doGetOut _group2Units};

ruby breach
#

But yes, good idea

#

And let's not get started on the lack of a for do loop on the ~20 waypoints at the bottom of his script

still forum
#

Yeah better not

#

someone might get the idea to use call compile format there to get the variables

high marsh
#

The parentheses I added was more of a beginner habit I never broke and causes me slight anxiety when I don't lol

meager heart
#

just one forEach for those wp's at the bottom, also skills are broken there

halcyon crypt
#

nothing wrong with adding parentheses

#

parentheses are good

#

makes things a lot more clear

#

IMO

#

same with math.. screw precedence, trust parens ๐Ÿ˜ƒ

still forum
#

(5*5)+5

#

๐Ÿ˜„

ruby turtle
#

mh the AI wont move after being out of the vehicle after attack -.-

halcyon crypt
#

exactly ( @still forum )

meager heart
#

quick mafs

ruby turtle
#

they all stay in front of the vehicle ramp and let flip it in the air

high marsh
#

What?

still forum
#

Do they have any reason why they should be moving?

ruby turtle
#

the are being attacked by infantry and sould form standard formation or something?

#

they creating a flipping BMP :/

still forum
#

do they shoot at the attacking infantry?

ruby turtle
#

yes of course but still stand still and after the 5th leaving infantry the vehicle starts to flip in the air

still forum
#

You told them they cannot flee

ruby turtle
#

they dont should retreat but should move or soemthign to have hide behind cover

high marsh
#

@halcyon crypt Meh, it's one of those things that if I don't need it there i would rather it not exist there. Readability is great, but it makes by brain itch.

halcyon crypt
#

it makes my brain crunch when I don't see parens

#

have to actually think ๐Ÿ˜›

high marsh
#

Crunch? Like shinrk? How tf does that happen? :D

halcyon crypt
#

more like gears doing their things

still forum
#

If you got problems with crunching. I heard mikero can help with that

halcyon crypt
#

is what I meant ^^

high marsh
#

Sounds painful

#

Mikero can crunch anything really

halcyon crypt
#

I'm unfamiliar with this skill of Mikero

still forum
#

never used pboProject?

halcyon crypt
#

nope

still forum
#

that explains it ^^

halcyon crypt
#
Crunch:

Should be obvious.
still forum
#

packing pbo's with it is called "crunching" and it often throws problems

halcyon crypt
#

uhhhhhh ok ๐Ÿ˜›

#

ah I see

ruby turtle
#

I think the disableAI pathing is stil active but tried out this:

_b_grp2 = behaviour leader _grp2;
if (_b_grp2 == "COMBAT") then { {_x enableAI "PATH"} forEach units _grp2; };
if (_b_grp2 == "COMBAT") then { doGetOut units _grp2};
_grp2 setFormation "WEDGE";
high marsh
#

Yikes, you need some new lines between your brackets. They're all over the place.

ruby turtle
#

how do you mean that?

queen cargo
#

@high marsh get sqfvm
can now pretty print stuff for ya

still forum
#

I don't see brackets in there. Only parenthesis and curly parenthesis

halcyon crypt
#

lol

queen cargo
#
_b_grp2 = behaviour leader _grp2;
if (_b_grp2 == "COMBAT") then {
    {
        _x enableAI "PATH";
    } forEach units _grp2;
};
if (_b_grp2 == "COMBAT") then {
    doGetOut units _grp2;
};
_grp2 setFormation "WEDGE";```
ruby turtle
#

change this anything in execution of my code?

queen cargo
#

nope
just makes it prettier

high marsh
#

@queen cargo I vested time in using your SQF bot before, although at that time it was very limited in features :(

ruby breach
#

Also not really sure why you need two if-thens there

#

If we're going for pretty

high marsh
#

@still forum ๐Ÿ–• ๐Ÿ˜‘ ๐Ÿ–•

queen cargo
#

it still is
pretty printing is not in the actual commandset yet :D
the latest standalone also got released already @high marsh

#

with fancy features like a debug interface (JSON, no client yet afaik) and stuff like pretty printing files

high marsh
#

@queen cargo When my pc works, I will snatch a build and try it out.

ruby turtle
#

I just don't know why the AI still have no pathing, they turning around and fireing on enemy and lying down but cant move a inch

queen cargo
#

just head to x39.io and then in the navbar projects -> sqf-vm ๐Ÿ˜ƒ latest build is always there (including snapshots)

#

alt probably as you know on the sqf-vm discord

high marsh
#

Yep yep, I'll look at it now. For some reason i am not a part of the sqf vm discord. Fixed.

halcyon crypt
#

@ruby turtle did you tell them to move somewhere?

#

AI in combat are really stubborn

ruby breach
#

I have a suspicion that it's because he's running these checks once right after assigning the waypoints, and never again

#

But I don't have his entire mission, so...

ruby turtle
#

there is the whole script you are right I think

halcyon crypt
#
[_grp2] spawn {
    private _group = param [0, grpNull];

    waitUntil {
        sleep 1;
        behaviour (leader _group) == "COMBAT";
    };

    {
        _x enableAI "PATH";
    } forEach (units _group);

    doGetOut (units _group);
    _group setFormation "WEDGE";
};
#

something along those lines should help you

#

I think

#

get it before everyone jumps on it to point out everything that is wrong and what not and confuse you even more ๐Ÿ˜‹

still forum
#

points at wrongness

halcyon crypt
#

haha

queen cargo
#

can be improved, no need to wrap into array and add params @halcyon crypt

#

just use _this

still forum
#

only thing the params does prevent is if _grp2 was nil

#

if you pass directly then Arma will error when you try to spawn

queen cargo
#

silent error*

still forum
#

in unscheduled yes

#

but I think in scheduled it's a loud error

tough abyss
#

I'm trying to make a trigger zone to repair wrecked vehicles where they can be ACE repaired afterwards. Specifically on a carrier resupply area. I'm not very proficient with scripting and I've been trying to find whatever I can to mash together code, but best I've managed so far is to make a zone that will damage only the first unit that enters it. It needs to be repeatable and work on a server.
What I have so far, which is the damage first entity script:
Type: None
Activation: Anybody
Activation Type: Present
Condition: this and ((getPos (thisList select 0)) select 2 < 1)
On Activation: {_x setdamage [0.85, false]} foreach thislist;

#

I honestly have no idea what I'm doing

#

behaviour can take group argument and will autoextract leader from it

still forum
#

To the wiki!!

tough abyss
#

No it can but it is limited to object

still forum
#

Huh?

#

It can take group but it can't because it's limited to object?

high marsh
still forum
#

@tough abyss where did you get your infomation from?

#

I cannot confirm that using any of my tools

#

Arma only has a single behaviour command. And that takes object and returns string

high marsh
#
Although behaviour is called on an individual unit, what you are really getting back is the behaviour of that unit's group. Behaviour is a group setting

MadRussian note

still forum
#

that's something different though

meager heart
#

better just delete that comment...

tough abyss
#

setBehaviour takes either, because the argument is ObjectOrGroup behaviour has just Object. If it was ObjectOrGroup it would have worked for both

still forum
#

but it isn't. And it doesn't.

tough abyss
#

One can always ask for a tweak

meager heart
#

maybe > Return the behaviour of a unit > Description: Returns group behaviour mode. ๐Ÿค”
(behaviour page ^)

ruby breach
#

But is that across all games, or just Arma 3?

meager heart
#

not sure about minecraft tho ๐Ÿ˜ƒ

halcyon crypt
#

@queen cargo I was avoiding _this on purpose in expectation of comments about using _this

#

lol

queen cargo
#

๐Ÿ˜„

high marsh
#

@meager heart minecraft behaviour is arma behaviour on steroids.

meager heart
#

in cubism style

winter rose
#

@meager heart as far as I remember, even in OFP you could setBehaviour only one unit ๐Ÿ˜

meager heart
#

we was talking about how to get it with >behaviour and argument has to be unit not a group, but it returns group behaviour... and for setBehaviour you can use both (unit/group)... so maybe change description on behaviour page somehow, to make it clear @winter rose ๐Ÿค”

tough abyss
#

When a vehicle is destroyed, is it still a vehicle, but with a damage of 1, or does it turn into a different class?

still forum
#

It depends

#

it can be

#

but usually it turns into a wreck model

winter rose
#

@meager heart tests indeed have to be done, and pages to be updated
will do tomorrow hopefully

still forum
#

Also wrecks usually have a damage of 1.. but they don't have to

tough abyss
#

I've got my zone repairing a vehicle just short of switching to the wreck model, such as when dropping from 100m, but it doesn't do shit if it's already a wreck

still forum
#

correct

#

you'd have to delete and recreate I think

#

the wreck model might have some config entry that tells you what the non-wreck class is

obsidian kiln
#

getdir unit - pos1 getdir pos2 < 10 and distance2D < 10

#

sorry, abs(getdir unit - pos1 getdir pos2) < 10

#

where pos1 the position of your unit and pos 2 the position of the friendly unit that is near

#

although it's performance intensive too...

#

you could use findif to see if a friendly player is close before executing any script first to save some fps...

#

or add a check for a keypress before showing hud and executing code so people only use it when performance isn't a big factor

austere granite
#

allUnits and worldToScreen combo

#

Or well allUnits within a small range

tough abyss
#

Does anyone know any cute little tricks using attachTo to make it look like the Liberty is moving/

#

?

austere granite
meager granite
#

Try cursorObject instead?

#

Store previous cursorTarget in case current one is null?

meager heart
#

๐Ÿค”

#

cursorObject has the same issue as cursorTarget with freelook (doesn't work unless moving)

if (freeLook) then {/* update position/change alpha */};
```maybe
minor lance
#

Is there any way to close the game vรญa scriptยฟ?

tough abyss
#

Sure, make an extension that would kill your game process when you call it

minor lance
#

without extensions

#

or includes inside sqf

tough abyss
#

Yes, if it is a server you can shutdown with server command

minor lance
#

Its local

#

๐Ÿ˜ฆ

tough abyss
#

Can try hacking UI then

minor lance
#

I already did

#
disableserialization;
uiNamespace setVariable ["EXITPLS",""];
(findDisplay 6600) closeDisplay 0;
[] spawn {ctrlActivate ((findDisplay 0) displayCtrl 106);};
#

This closes the game from main menu

#

taken from Desolation

#

dunno why XD

#

but doesnt work inside a mission

#

or editor

tough abyss
#

Then hack UI to drop to the main menu first

minor lance
#

mmm

#

how ยฟ?

meager granite
#

Execute some command to crash the game?

#

You could createVehicleLocal "access" before, but I think its been patched out

fossil yew
#

I have an agent in a car. I'd like to tell him to move to point X. Is setDestination enough or do I need to issue doMove after?

minor lance
#

createVehicleLocal "access" ?? @meager granite

minor lance
#

and btw what command does insta-crash the game?

digital jacinth
#

if you want to be a dick, you can send the player into the stratosphere. If the player is running the 32 bit executable then the game will simply crash with out of memeory. But if that player is running the 64 bit executable....
Well let's say as long their ram provides.

runic seal
digital jacinth
#

is that dog spawned on a headless clieant or on a dedicated server? (or doesn't it work in sp as well?)

runic seal
#

doesnt work on SP

#

havent tried on multioplayer yet

digital jacinth
#

just a heads up, dogs are weird things in arma, I have not managed to make them work on a dedicated server or headless client. Seems the machine contorlling them needs an interface

runic seal
#

its nnoying cause i looked at other dog scripts that work but cant get it working onmine

digital jacinth
#

oh first of you do not need such a complicated random function, digs have a random class

if(_type == "random") then {
  if(floor (random 2) == 0) then {
    _type = "Alsatian_Random_F";
  }else{
    _type = "Fin_random_F";
  };
};
runic seal
#

ah right

#

so i can just delete the chance thing

digital jacinth
#

pretty much, unless you want it weighted

runic seal
#

nah

#

ill do that

digital jacinth
#

I take it the dog just stands around? IIRC you need to actually apply the walking and running animations for it. doMove and the like will work, but dogs are not units (even when created as unit and not as agent) they are inheriting from class "MAN" and not like units from "CAManBase" as well. thus they are kind of limited

#

The way I programmed my feral dogs is to send them a doMove command and set the appropriate animation if they are not in the desired animation state.

runic seal
#

ah ok

#

so like a while loop with not in amination > set animate > doMove

digital jacinth
#

a loop like youhave right now is needed as it is the base logic of your dog. You also should not set the animation again and again, your best option is to safe the currently applied animation onto the dog object with setVariable. then you can check if the dog is in another animation state and then apply the new desired animation

#

btw animationStatedoes not work on dogs, thus you need to manually document the current state

runic seal
#

ok ty

#

Ok ill pastebin what i have now but it doesnt span the dog?

digital jacinth
#

go ahead

runic seal
digital jacinth
#

_type is not defined,it was part of my example becaus ei copy pasted a code snippet of mine

#

the whole if(_type == "random") then { can be dropped

runic seal
#

ah ok xd

#

stupid me

#

// Spawn dog
_dog = createAgent ["Fin_random_F", getPos player, [], 5, "CAN_COLLIDE"];

// Disable animal behaviour
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];

// Following loop
0 = [_dog] spawn {
params ["_dog"];

// Force dog to sprint
_dog playMove "Dog_Sprint";

while {alive _dog} do 
{
    _dog moveTo getPos player;

    sleep 0.5;
};

};

#

thats on the BI Wiki but doesnt seem to work

#

NVM it does

digital jacinth
#

the important part in this snippet is _dog playMove "Dog_Sprint";

#

without it the dog will either stand around or do one set of animation that you do not want

runic seal
#

if ((_Dog distance2D playableUnits) < 10) then
{
if (weapons player != []) then
{
_Dog playMove "Dog_Idle_Bark";
};
};

#

will that get the dog to stop if the player has a gun

#

?

digital jacinth
#

No, playbaleUnits is an array for one.

runic seal
#

{
if ((_Dog distance2D playableUnits) < 10) then
{
if (weapons player != []) then
{
_Dog playMove "Dog_Idle_Bark";
};
};
} foreach allUnits;

digital jacinth
#

Weapons player returns all the weapons a unit has. So the unit would need to drop all weapons I their inventory

runic seal
#

i tried a foreach but doesnt seem to work either

digital jacinth
#

Yeah because replace playbaleUnits with _x

runic seal
#

the other way i thourght of is

#

to list an array of all weapons in the game and count them

#

is there a way to do that?

#

if ((count (nearestObjects [_dog,
[
"" // CfgWeapons master class?
], 10])) > 0) then

austere granite
#

Weapons aren't objects

runic seal
#

sorry

#

is it an entity?

#

if ((count (nearEntities [_dog,
[
"" // CfgWeapons master class?
], 10])) > 0) then

austere granite
#
private _nearbyWithWeapon = (allUnits inAreaArray [_dog, _range, _range, 0, false, _range]) apply { primaryWeapon _x } select { _x != "" };
if (count _nearbyWithWeapon > 0) then {
    // meow
};
#

probably something like this is what you want

runic seal
#

wow

#

thank you very much

austere granite
#

make sure to set _range to whatever (or just replace the 10)

#

Keep in mind this only checks for primary weapon, if you want to check if theres anything in inventory, or also include weapons stored on the ground and so it changes

#

There's no direct way to just detect "weapons" in arma

runic seal
#

thats annoying

#

i get "Error Type Object, Expected Array"

austere granite
#

exact code?

runic seal
#

_dog = createAgent ["Alsatian_Random_F", getPos player, [], 5, "CAN_COLLIDE"];
private _nearbyWithWeapon = (allUnits inAreaArray [_dog, 10, 10, 0, false, 10]) apply { primaryWeapon _x } select { _x != "" };
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
0 = [_dog] spawn {
params ["_dog"];
_dog playMove "Dog_Run";
while {alive _dog} do
{
_dog moveTo getPos player;
sleep 1;
if (count _nearbyWithWeapon > 0) then {
playSound3D ["A3\Sounds_F\sfx\blip1.wav", _Dog, true, _Dog, 7, 1, 50];
_Dog playMoveNow "Dog_Idle_Bark";
};
};
};

austere granite
#

use code block

```sqf
runic seal
#

how

#

xd

austere granite
#

add another ```

at the end

runic seal
#
 _dog = createAgent ["Alsatian_Random_F", getPos player, [], 5, "CAN_COLLIDE"];
private _nearbyWithWeapon = (allUnits inAreaArray [_dog, 10, 10, 0, false, 10]) apply { primaryWeapon _x } select { _x != "" };
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
0 = [_dog] spawn {
    params ["_dog"];
    _dog playMove "Dog_Run";
    while {alive _dog} do 
    {
        _dog moveTo getPos player;
        sleep 1;
        if (count _nearbyWithWeapon > 0) then {
            playSound3D ["A3\Sounds_F\sfx\blip1.wav", _Dog, true, _Dog, 7, 1, 50];
            _Dog playMoveNow "Dog_Idle_Bark";
        };
    };
}; ```
#

there u go Xd

austere granite
#

Well for starters you're not passing _nearbyWithWeapon as an argument in your spawn

#

plus..... you'r eonly detecting if theres nearby units once, i expect you want that WITHIN the while

runic seal
#

_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
0 = [_dog] spawn {
    params ["_dog"];
    _dog playMove "Dog_Run";
    while {alive _dog} do 
    {
        _nearbyWithWeapon = (allUnits inAreaArray [_dog, 10, 10, 0, false, 10]) apply { primaryWeapon _x } select { _x != "" };
        _dog moveTo getPos player;
        sleep 1;        
        if (count _nearbyWithWeapon > 0) then {
            playSound3D ["A3\Sounds_F\sfx\blip1.wav", _Dog, true, _Dog, 7, 1, 50];
            _Dog playMoveNow "Dog_Idle_Bark";
        };    
    };
};```
austere granite
#

playSound3D ["A3\Sounds_F\sfx\blip1.wav", _Dog, true, _Dog, 7, 1, 50];
pointer ๐Ÿ˜‰

#

soundposition is supposed to be positionASL (which is an array), but you give it _dog (which is an object)

#

playSound3D ["A3\Sounds_F\sfx\blip1.wav", _Dog, true, getPosASL _Dog, 7, 1, 50];

runic seal
#

ok i changed it to playSound3D ["A3\Sounds_F\sfx\blip1.wav", _Dog] for now and will look into more later - however i still the array/object erro

austere granite
#

eh my dad, i got the inareaarray from a function in which i tranform object to position, didnt realize it only accepts position

#

_nearbyWithWeapon = (allUnits inAreaArray [ASLtoAGL getPosASL _dog, 10, 10, 0, false, 10]) apply { primaryWeapon _x } select { _x != "" };

#

if you don't ever expect to the over water, just replace the ASLtoAGL getPosASL by getPosATL

runic seal
#

dude i cant thank u enough

#

all working fine

#

your the best

still forum
#

@minor lance preprocessFile a script file with a non-existent #include is probably the easiest method. But you need to have that script file in your mission then

minor lance
#

But in the error text, it appears the name of the script, and the route

#

so players can remove the addon and problem solved ๐Ÿ˜ƒ

austere granite
#

just spawn lots of while true

still forum
#

Ah yeah...

private _this = {
    while {true} do {
        _this spawn _this;
    };
};
_this spawn _this;
austere granite
#

I also believe the game crashes in some weird cases in combination with ctrlDelete and missing return somewhere

minor lance
#

uh

still forum
#

ctrl stuff is very flaky yeah. Also UI eventhandlers. Clear all eventhandlers inside a eventhandler, and if there are still eventhandlers after yours Arma tries to execute the just deleted eventhandler

austere granite
#

unless that's fixed now, but unlikely, can't remember the exact case though and too lazy to look it up, but its a bug i came across and after a while i found out that it happens when you don't have a return in a specific function

still forum
#

I reported it 2 years ago. Didn't hear of any fix

austere granite
#

Yeah it's with a eventHandler, and then if you do ctrlDelete there and don't return a handled, it'll keep trying to run the EH with on the deleted crtl and crash

#

something like that

minor lance
#
private _this = {
    while {true} do {
        _this spawn _this;
    };
};
_this spawn _this;
#

doesnt work

#

I just need to crash the game when entered eden editor

#

the include works

#

but it says the path

austere granite
#

... why

still forum
#

Why does that not work tho ๐Ÿค”

#

Well... Just use this then ๐Ÿ˜„

#
_this = {isNil _this;};
isNil _this;
minor lance
#

doesnt work either

#

๐Ÿ˜ฆ

still forum
#

huh :U

minor lance
#

well

austere granite
#

Why would you want to crash eden though?

minor lance
#

not working when executing

#

but yes in variable visor

#

I have some easter eggs on my map and i want players to play blind

#

not to see the map

austere granite
#

i wonder if hideObject works then

#

cleaner solution tbh

#

just hide your easter eggs when someone loads into eden

minor lance
#

They are map easter eggs

#

like terrain things

austere granite
#

yes i know, but you can hide terrain objects though right?

still forum
#

Why not just remove the 3DEN button from main menu then ๐Ÿ˜„

minor lance
#

because you can enter 3den via launcher

#

I have custom menu without button

meager heart
#
0 spawn {
    {_x closeDisplay 1} forEach (allDisplays - [allDisplays param [0, displayNull]]);        
    ctrlActivate ((finddisplay 0) displayctrl 102); 
    (finddisplay 3) closeDisplay 2; 
    ctrlActivate ((finddisplay 0) displayctrl 106);
};
```๐Ÿค”
austere granite
#

ah ye thats the exit game one ๐Ÿ˜„

minor lance
#

lets see

austere granite
#

i think you should just hide the objects if possible in 3den

#

and im pretty sure it is possible, you can detect terrain objects fine in it at least

minor lance
#

I know, but i have some places in my map

#

not objects

#

like fields with caves, etc

#

i just want them to play blind

#

doesnt work @meager heart

meager heart
#

well it does, but not for the host/admin without "continue button" in debriefing screen ๐Ÿ˜ƒ

minor lance
#

hmm

#

I need when eden editor is started

meager heart
#

oh

#

well allDisplays do not includes eden idds

#

and maybe you can just close the eden ? or you really need close the game ?

minor lance
#

Just go back to the main menu or close the game

#

dont mind

austere granite
#

eden is idd 313

meager heart
#

that will close all IGUI stuff {_x closeDisplay 1} forEach (uiNamespace getVariable ["IGUI_displays", []]);

minor lance
#

nothing happens

meager heart
#

lol

austere granite
#

grab from that what you need

#

you can close eden by activating the exit buttons

#

you just need to figure out what the IDCs for the buttons is

#

you can also adopt that, to just make it reload into Virtual Reality whenever someone loads into your terrain

#

up to line 28 or so

minor lance
#

But they can change to my terrain then

austere granite
#

yes, but when they load in your terrain they'll instantly be swapped to another terrain ๐Ÿ˜‰

minor lance
#

I can do do3DENAction "Exit3DEN";

#

and figure out with button is the Yes button of the prompt dialog

meager heart
austere granite
#

to make it a bit cleared and 'user friendly' you could also set the text in that dialog and disable the no button

minor lance
#

YOu execute and it closes the game?

meager heart
#

yeah

minor lance
#

not for me ๐Ÿ˜ฆ

meager heart
minor lance
#

tried with spawn and without it

meager heart
minor lance
#

Does nothing D:

#

whyy

#

WTF is happening to my game XD

#

๐Ÿ˜ฉ

#

Also if I put the function as PreInit, it executes in the mainmenu as there is a mission there XD

still forum
minor lance
#

mmmm

#

gonna try something

#

even making a execvm with a included file is not working wtf

#

is there any way I can set the text in the debuf console in 3den?

#

in the variable viewer

austere granite
#

How are you actually executing your code?

#

just debug console local exec? Or functions? If functions, make sure you do with uiNamespace, because missionNamespace doesnt exist when you load into eden the first time

minor lance
#

oh

#

maybe that

#

is ....

#

nope

#

not working

#

any idea?

austere granite
#

percussive debugging

minor lance
#

omg Im doing diag_log and its not doing it either XD

#

if I just put an execVM with an include works

vernal mural
#

When using animateSource, only the given animation is played. For example _badger animateSource ["showCamonetTurret", 1] shows only the camonet on the turret whereas it is supposed to also show the part of the net on the front part of the cannon. It is defined in config as forceAnimate[] = {"showCamonetCannon",1};. However, using Eden and clicking the box to show camonet on the vehicle make it appears normally. Is there a way to reproduce the behaviour of Eden, and also show the cannon camonet when asking for the turret camonet ?

dim terrace
#

@vernal mural have you already tried using export button in virtual garage?

vernal mural
#
_veh = createVehicle ["LM_MARSHALL",position player,[],0,"NONE"];
[
    _veh,
    ["altis",1], 
    ["showBags",0,"showCamonetHull",0,"showCamonetTurret",1,"showSLATHull",0,"showSLATTurret",0]
] call BIS_fnc_initVehicle;
#

only turret seems to be called, but with another function

#

it's probably this function that extract the anim data

#

Yeah this is it private _forceAnimate = getArray(_cfgAnimationSources >> _source >> "forceAnimate");

runic seal
#

how do you delete a dog in script. i have deleteVehicle _dog; Im trying to do it in an addAction

#
_range = 3;
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
_DogOut = 0;
player addAction ["Put Away Police Dog", "deleteVehicle _dog; player removeAction 0;"];```
vernal mural
#

You need the action to know waht is _dog

#

by passing it as a parameter

runic seal
#

so param [_dog]; at the top of the script

#

params

vernal mural
#

firstly, params uses an array of string as an argument. And secondly, no, you need your action code to know what object is _dog, because even if it is defined in your script, it is not defined in the scope in which the action code is executed. Look at the addAction doc I've pasted the link. What you need is the "arguments" part.

bright shore
#

So yesterday i installed VCOM AI & want to know what AI are being used (VCOM or Default) ones, any command that could help me out?

digital hollow
#

Really easy way to check is VCOM groups are always in Combat mode.

vernal mural
#

are always in Combat mode ==> which is painful, in terms of performances

digital hollow
#

That's the cost of checking more things all the time, I suppose.

bright shore
#

They are in aware mode

#

So i'm guessing something is wrong here ๐Ÿ˜„

bright shore
#

So i installed again and in addon configuration window i dont see it. :/

digital hollow
#

Are you using mod version or script?

bright shore
digital hollow
#

Ok. Are you launching the game with it active?

bright shore
#

yes i can see in mod section with checkmark

digital hollow
bright shore
#

nothing that would be named vcom

#

there was VCM_Core_Initialization,VCMFnc idk if they are part of vcom

digital hollow
#

Yeah, if you look at the github link all the VCOM functions are vcm_fnc.

#

So it's loaded. You're still not seeing any AI behaviour change?

vernal mural
#

Is there a way to manipulate the turret of a vehicle with script command ? The animateSource doc page seems to imply that it's possible, but no success until now. None of the animationSources are able to control the turret of a vehicle, apparently

#

(the vehicle being a marshall)

meager granite
#

Animation has to be defined in config for the command to work, Marshall doesn't have any

#

And Arma being Arma there is no command specifially to aim turrets

vernal mural
#

Sad. And I assume that there is no way to create a complementary addon and define those animations ? It is probably defined in P3D ?

meager granite
#

Should be possible with addon, just add AnimationSources for turret similar to UGV

vernal mural
#

mh, looks hard to do

meager granite
#

Its actually very easy, selection and source names are probably identical so its mostly copy-paste.

vernal mural
vernal mural
#

is there a way to influence by script or config on vehicles variables ? Like engine temperature, for example ?

tough abyss
#

@vernal mural setVehicleTIPars

digital jacinth
#

anyone knows if BIS_fnc_taskCreate is global and i only need to set them on server?

#

basically any of the task functions

ruby breach
#

owner: Boolean, Object, Group, Side or Array - Task owner(s)

#

True might equal global? Would be my guess

halcyon crypt
#

it's global

meager heart
#

better option > bis_fnc_setTask

digital jacinth
#

does it also work with jip?

#

even for creating?

halcyon crypt
#

BIS_fnc_taskCreate calls BIS_fnc_setTask though

#

with global being set as true ๐Ÿ˜›

meager heart
#

afaik most of those "tasks" functions is just bis_fnc_setTask with different params ๐Ÿคท

digital jacinth
#

as long it is global and jip compatible i cannot complain honestly

bright shore
#

How do you guys check if something is not? if (!something) or if !(something)

vernal mural
#

both are valid

#

first check if !something is true, second check if something is false

still forum
#

I use the first.. That way you don't get any precedence problems

#

with "first" I mean the ! outside of the ()

ruby breach
#

I'm pretty sure (but can't test) that something like ```sqf
if (!1 == _num) then {_code};

still forum
#

yeah exactly

queen cargo
#

you actually could test
using sqf-vm โค

ruby breach
#

I did, but I'd still like to test in-game before stating it as fact lol

vernal mural
#

of course, ! is a boolean operator, negating a number makes no sense. Need more ( ) or place the ! outside

bright shore
#

I'm going through somebody else code. editor spits expected '(' if it's if !(something) but if i swith to if(!something) error goes away but that way logic changes?

vernal mural
#

depends on something I guess ?

obsidian kiln
#

how performance friendly is unitplay unitcapture?

vernal mural
#

@tough abyss thanks. This can influence on temperature of given parts of the vehicle. Is there similar commands for other variables, such as the ampere meter or the volt meter which seems to be functionnal on some vehicles ?

obsidian kiln
#

can you record a path with unitcapture and use with other starting positions?

#

like recording the path of a flying bomber and then using it for dynamically spawned bombers in different directions

queen cargo
#

@bright shore what editor are you using? if does not requires parenthesis in arma

vernal mural
#

@obsidian kiln I don't think so. Those commands are "dumb", only reminding the position and attitude of a unit at a given moment. It d'ont even switch on the engine, you have to do it manually

queen cargo
#

if your linter complaints, raise an issue at whoever created it (this part is important) and to fix it just add an outter () around

obsidian kiln
#

ah that's a pity, i thought it recorded paths and input, but if it records positions it probably doesn't work

queen cargo
#

adding additional () will not affect your performance in any meaningfull way

#
_res = ((((((((((1 + 1)))))))))); // Same speed in execution as
_res = 1 + 1; // This here```
vernal mural
#

@obsidian kiln if it's for a simple mutli bomber script, simply dynamically placing waypoints should be enough ?

obsidian kiln
#

yes i think just addwaypoints is the way to go

bright shore
#

TypeSqf @queen cargo

queen cargo
#

and to fix your problem: if (!(something))

minor lance
#

Why if I do [] execVM "\testaddon\x.sqf"; x.sqf file contains ```#include "

             [Error Reborn] 

"```

It does nothing ๐Ÿ˜ฆ

high marsh
#

Because include copies the contents of the file, I don't know what you want it to do.

minor lance
#

crash the game

high marsh
#

You want it to crash the game???

still forum
#

Yes..

#

Exactly as he said

high marsh
#

But, why?

meager heart
#

answers is \โคด there ๐Ÿ˜ƒ

#

(scroll up)

minor lance
#

hahahaha

#

I dont want 3den to be usable

high marsh
#

Why.....

minor lance
#

Weird things

#

hahaha

#

The thing is if I do the include inside my function with the preinit = 1, the game crashes when loading the mainmenu and never start

#

i I use some Ifs and the the execVM never gets executed

still forum
#

@high marsh Again. Answer is up there

#

why execVM?

#

I thought I told you to use preprocessFile

austere granite
#

is there a non 3d / position sound playing command that uses filepaths? i feel like im blind

#

or maybe i'm just drunk

high marsh
#

Okay, I understand the reason. But, it's just very weird in my mind.

still forum
#

Yeah same.. As I also already said I'd just remove the 3DEN button from main menu

high marsh
#

something about a launch option bypassing this?

meager heart
#

Adanteh, createSoundSource ?

#

oh nvm... non 3d...

#

just playSound maybe

minor lance
#

@high marsh Yep, @still forum Not working either

#

Should i use [] call compile preprocessFileยฟ?

still forum
#

That doesn't make any sense

minor lance
#

why not?

still forum
#

because you can't call a string

austere granite
#

ye that requires cfgSounds

#

guess i'll just make a quick config writer then

minor lance
#

@austere granite Look at this ```sqf
_path = format ["\addon_path%1.ogg", _soundname];

playSound3D [_path, player, false, getPosASL player, 5, 1, 10];

austere granite
#

MP and position

#

there's no option i think, so im not drunk

minor lance
#

ah srry

meager heart
#
findDisplay 313 closeDisplay 1;     
```edited*
minor lance
#

lets see

still forum
#

Why waitUntil? it should already know at preInit if it's 3den

meager heart
#

oh.. yes ^

#

edited

minor lance
#

hahaha yep forgot

meager heart
#

i guess that mean... nope ? ๐Ÿ˜ƒ

minor lance
#

I was eating something im back and gonna test

high marsh
#

๐Ÿ” Yum.

minor lance
#

not working

#

does nothing ๐Ÿ˜ฆ

#

๐Ÿ˜ฆ

#

Whats the param that inits the function before the mission

#

preinit right?

#

pregame is just after addon loading right?

still forum
#

functions are always initialized before the mission

#

aka before preInit

#

pregame doesn't exist

minor lance
#

prestart*

still forum
#

preStart*

#

yes that's before game start. Before main menu

minor lance
#

And does not work

#

in main menu and eden mission

#

none of them are closed when loading

#

if I try

#

IThe game closes with include error (The error I want now as no one is working for me)

still forum
#

with (uiNamespace) do { wtf?

#

_nil = wtf?

#

preprocessFile preprocessFile wtf?

#

add a diag_log in your script and check what is3DEN is

minor lance
#

ups

#

copypasted the wrong files

#

no logs showing

#

I already did it

still forum
#

if there are no logs showing.. Then it's not the code's fault that it's not working

minor lance
#

I dont know whats happening