#arma3_scripting

1 messages ยท Page 234 of 1

lone glade
#

same for rope physics

tough abyss
#

heh true

#

Woah, Take on Helicoptors was released 27OCT11?

#

I honestly thank TKOH for making me a good ArmA pilot

torn jungle
#

I have some walls, around 12 of them and i would like the ability to have the walls dissappear and reappear at the push of a button. So i gave them all names and added an 2 addactions to a button, one for dissappearing the walls and one for reappearing it. they would call "wallsaway.sqf: and "wallscome.sqf"

#

this is what walls away would have: wall1 setVectorUp [0,0,-10];
wall2 setVectorUp [0,0,-10];
wall3 setVectorUp [0,0,-10];
wall4 setVectorUp [0,0,-10];
wall5 setVectorUp [0,0,-10];
wall6 setVectorUp [0,0,-10];
wall7 setVectorUp [0,0,-10];
wall8 setVectorUp [0,0,-10];
wall9 setVectorUp [0,0,-10];
wall10 setVectorUp [0,0,-10];
wall11 setVectorUp [0,0,-10];
wall12 setVectorUp [0,0,-10];

#

and then vice versa for wallscome.sqf

#

my question is, is this gonna work? :p Am i missing a step, like putting those wall objects into some sort of group so that i just setVectorUp that group instead of the walls individually?

torn jungle
#

oh didnt know that command. so wallscome.sqf would be:

#

wall1 hideObjectGlobal true;
wall2 hideObjectGlobal true;
wall3 hideObjectGlobal true;
wall4 hideObjectGlobal true;

nocturne bluff
#

@torn jungle

params ["_open"]
_walls = [wall2,wall3,...];
{
_x hideObjectGlobal _open;
} foreach _walls;

[true] execVM "walls.sqf" to open

false to close

tough abyss
#

copying this over from Config Editing

#

not sure if this would be the right place to put this. HCPookie's Camo Nets don't show up in the Virtual Arsenal, and I'd like to add a CFGPatches or whatever to get them to show up. Anyone know how to do that?
heck, I'd be fine just being able to place down the box in Zeus

deft lion
#

@lone glade @tough abyss At last check the VBS trio used their own version of SQF (including VBS-exclusive scripting commands) while DayZ SA's Enfusion is supposed to have (had) a code merge with the engine from Take on Mars (TKOM)

keen stream
#

DayZ is using some kind of C-like scripting language.

deft lion
#

Which based on interviews/Q&A came from TKOM

nocturne bluff
#

yes, and it exists in TKOM

#

if you wanna try it

delicate mason
#

Does arma allow $ in identifier names?

pliant stream
#

i thought dayz used java

nocturne bluff
#

noone uses java

lone glade
#

it's me or the Z axis on modelToWorld , modelToWorldVisual , worldToModel and worldToModelVisual are utterly fucked ?

#

it seems to be the case with nearly all buildings for me.

timid zealot
#

Double checked the position format? (i.e. AGL, ASL, etc)

lone glade
#

The conversion from model to AGL and vice versa is broken

lone glade
#

seems to always use something around 0 for Z, even If I use -70 or 90

deft zealot
#

for me _unit modelToWorldVisual (_unit selectionPosition "pilot") works fine

lone glade
#

i'm using a house model offset to place a cache, I obtain the pos by doing

copyToClipboard format ["%1", (testHouse worldToModel (getPos cursorObject))]
#

and placing by doing

_box = (selectRandom ["Box_FIA_Wps_F", "Box_FIA_Ammo_F", "Box_FIA_Support_F"]) createVehicle (_building modelToWorldVisual [0.537109,2.24023,-2.90897]);
#

note that the third value doesn't matter, be it -7 or 1 it doesn't matter, the position barely move.

keen stream
#

@lone glade have you tried creating it somewhere and then moving it to its desired position? I had similar issues with it during the Alpha.

lone glade
#

same issue, I only got it working for one building

vapid frigate
#

alganthe: Pretty sure createVehicle will create it on the ground (or nearest surface). I think you'd have to do a setpos after that.

lone glade
#

I tried creating it a 0,0,0 then moving it, same result.

vapid frigate
#

the third parameter would make a difference with setPos though?

lone glade
#

thing is, I need to have the proper offset from the model.

#

so i'm still going to use modelToWorldVisual or modelToWorld for the position

vapid frigate
#

is it over land or sea?

lone glade
#

land.

#

it works fine, but I'm forced to use the first floor, can't use the second floor of any house.

#

(except one type)

vapid frigate
#

testpos = testhouse worldToModel (getposATL player);

#

player setpos (testhouse modelToWorld testpos);

#

that seems to work even though it doesn't match the docs

lone glade
#

I'll give it a check tomorrow ๐Ÿ‘

vapid frigate
#

it's sort of impossible for it to work properly when providing an AGL, because the height will be 0 nomatter what floor you're on.

lone glade
#

unless you're doing ridiculous magic there's no way to get that pos.

slim trout
#

any way of detecting all vehicles spawned by zeus, including jets, helis?

#

and so that it's not the `

CuratorObjectPlaced

` event handler since it catches ammo boxes as well

vapid frigate
#

Could just put an if statement in that event handler?

slim trout
#

Oh, yea. Seems it's what i was looking for, thanks.

deft zealot
fallen locust
#

using it right now with no issues

#

literally right now

deft zealot
#

can u send me your code for comparision (just the line with the command)

#

i tried:
player action ["moveInCargo", vehicle player];
while sittin in slammer as driver

#

it might be a problem that i am already inside the vehicle which i pass as an argument

fallen locust
#

yes

#

you need to be out of vehicle

#
player moveInCargo [_vehicle,_i];
uiSleep _sleeptimer;
_positionArray pushBack (_vehicle call _fnc_get_pos);
player setPos [100,120,0];
uiSleep _sleeptimer;
deft zealot
#

ok so i just do moveOut player before

fallen locust
#

i just do setPoss becouse i cba

#

im bruteforcing something

deft zealot
#

cargo positions nice

fallen locust
#

all vehicle positions

#

for all vehicles....

deft zealot
#

thanks for your help

still forge
vapid frigate
#

have you set a variable called 'setViewDistance' on them?

still forge
#

hold on

vapid frigate
#

it works for me

#

maybe it's talking about the outer switch?

still forge
#

uhh idk

vapid frigate
#

i just set my view distance to 500 and put that inner switch in the debug console

#

and it increased by 500 each time i ran it

still forge
#

yeah

#

in process of making it a sqf file

vapid frigate
#

that's the whole SQF?

#

you need a switch around that case 15:

#

or to get rid of the case 15:

still forge
#

k ill try

#

error zero devisor

vapid frigate
#

how are you calling it? as an event handler?

still forge
#

as a sqf in init.sqf

#

[] execVM "viewDist.sqf";

vapid frigate
#

it will give zero divisor because of the select lines at the start

#

_key = _this select 1;

#

but _this == []

still forge
#

uhh

vapid frigate
#

[objnull, 15, true, true, true] execVM "viewDist.sqf";

#

that should stop that error because then _this == [objnull, 15, true, true, true]

#

so it can select 1,2,3 and 4

still forge
#

i see

#

testing

vapid frigate
#

it looks like the script is meant to be in an event handler

still forge
#

well

#

it's meant to go in a keyhandler file that's already defined everything but i didn't want to setviewdistance in that file

#

hmm

#

undefined variable in mf_notify_client;

vapid frigate
#

means it can't find that function

still forge
#

so could i uhh setViewDistance 1000; ["NEAR View Distance (1000m)", 5] hintSilent "Ear Plugs 90%";

#

something like that

#

but ofc calling for vd

#

or defining it i mean.

vapid frigate
#

well that syntax is wrong, but you could do something like a hint there

still forge
#

hmm

vapid frigate
#

then from your key handler script, you can just call [-500] execvm "viewdist.sqf";

#

or [500] execvm "viewDist.sqf"

still forge
#

uhh ok let me try

#

so i should remove call mf_notify_client; from the end of each

vapid frigate
#

i don't know what that does

#

guessing it's a custom hint thing

still forge
#

yes i put uhh

#

and if i dont setViewDistance 500; it does nothing

vapid frigate
#

you using ace3?

still forge
#

nope

#

its wasteland

vapid frigate
#

with that switch, if the viewdistance doesn't start at one of those numbers, it won't do anything

#

like i think default view distance is 1600

still forge
#

ah

vapid frigate
#

so you might need just setViewDistance 500; in your init script

#

but not in this script

still forge
#

hmm

#

doesn't work.

#

eh i give up lol case (_key == 2): //Key "1"
{
setViewDistance 1000;
["NEAR View Distance (1000m)", 5] call mf_notify_client;
};
case (_key == 3): //Key "2"
{
setViewDistance 1500;
["MEDIUM View Distance (1500m)", 5] call mf_notify_client;
};
case (_key == 4): //Key "3"
{
setViewDistance 2000;
["FAR View Distance (2000m)", 5] call mf_notify_client;
};

spice arch
#

question, if i set the respawndelay in the description.ext to -1 does that prevent respawn?

still forge
#

like in a basic mission?

vapid frigate
#

if you set it to 1e10 they'll respawn after 317 years

spice arch
#

ah k thanks Lecks

still forge
#

does anyone know how to create some sort of autorun hotkey?

#

script wise for all players

spice arch
#

Hey I'm having trouble finding this if anyone knows it. Basically I'm looking for the command that BI uses to respawn playable units. I've been digging through their BIS_fnc's in the respawn templates but none of them seem to use any code to actually respawn a unit.

lucid anchor
spice arch
#

@lucid anchor Yep, been through that doc and went through the cfgRespawn configs that it mentions as well. Basically it lets you configure the respawn properties but doesn't have a command like respawnPlayer (args).

nocturne bluff
#

Pretty sure its hardcoded.

thin pine
#

@spice arch yep but what's stopping you from killing the guy?

nocturne bluff
#

but you can get the same effect but just createing the unit and selectplayer into it

thin pine
#

@nocturne bluff selectplayer doesn't transfer your name to the new unit afaik, and I'm pretty sure there's some other downsides to using that

nocturne bluff
#

Sure.

#

That's how it is with arma ;)

thin pine
#

:D

nocturne bluff
#

I think the name is fine in A3 btw.

thin pine
#

Maybe in single-player.. I can't remember Tbh

nocturne bluff
#

I remember being fine in MP.

#

Just ACE nametags dosent catch it, but i think thats because they cache the name somewhere.

thin pine
spice arch
#

Thanks guys. I was able to approximate the behavior I was looking for by using respawn = "BASE" and then writing a custom template to mess around with the respawn timers.

keen stream
#

You can turn of the kill messages in the server difficulty settings.

slim trout
#

Hi, I wrote 2 functions to delete all cargo from vehicles. 1 for zeus spawned objects and the second for all editor placed objects. First one is working, but the second one not - could someone take a look at it?

#

{ if((_x isKindOf "landVehicle") or (_x isKindOf "Air") or (_x isKindOf "Ship")) then { clearWeaponCargo _x; clearMagazineCargo _x; clearItemCargo _x; clearBackpackCargo _x; }; }; forEach allUnits;

zealous solstice
#

what is the other?

slim trout
#

_vehicle = _this select 0;
if((_vehicle isKindOf "landVehicle") or (_vehicle isKindOf "Air") or (_vehicle isKindOf "Ship")) then
{
clearWeaponCargo _vehicle;
clearMagazineCargo _vehicle;
clearItemCargo _vehicle;
clearBackpackCargo _vehicle;
};

#

this one works without any problem with eventhandler attached to zeus curatorObjectPlaced

lone glade
#

missing a _ on the first one

#

three actually

slim trout
#

Perfect time to facepalm.

#

actualy not - visual bug

#

if you copy paste it, they are there

#

checked with the function file as well "_" is there

lone glade
#

dafuq, discord

#

also ;between the code block and the foreach

slim trout
#

Oh, I keep making those small mistakes i cant see. Fixed it - cargo items are still not being deleted

lone glade
#

also, where is this ran?

slim trout
#

separate function, called in init.sqf

lone glade
#

run it in initServer (or else shit will get deleted non stop when players JIP) when it start working

#

also landVehicle include CAManBase

slim trout
#

yea, im testing it localy so far

lone glade
#

and also use the global variants for the clear commands

slim trout
#

CAManBase is attached to Land->Man

#

not to landVehicles

lone glade
#

not in A3 afaik

#

Man also include animals too ๐Ÿ˜„

slim trout
#

did some testing on our server with the function for zeus, seemed to work properly, aka units were not stripped from gear

#

๐Ÿ˜„

#

okay, maybe im calling the function in a wrong way, simply put call bwi_fnc_clearcargoeditor

lone glade
#

nope, but allUnits works only for infantry.

slim trout
#

oh, so here's the problem

lone glade
#

use vehicles

slim trout
#

works now, beautiful. Much appreciated

slim trout
#

One more question. The function to clear cargo from zeus spawned vehicles needs to be run from the zeus' module init like this: this addEventHandler ["CuratorObjectPlaced", {[_this select 1] call BWI_fnc_ClearCargoZeus}];

#

Is there a way to do this to init.sqf, so that we don't have to run trough all the templates we have and add this line to every zeus module we have?

lone glade
#

replace this by the module var name

slim trout
#

they are not named, thats the problem

nocturne bluff
#

just use the handy allcurators

lone glade
#

doesn't work

#

you need the logic var

nocturne bluff
#

This returns all curator logic units, not the units assigned to the logic.

lone glade
#

this return the name (not var) of the curators no?

nocturne bluff
#

this -> logic

#

Since i assume its the module init there.

#

{ applycode} foreach allcurators;
should work fine

lone glade
#

oh wait I was confusing allCurators by an other command

slim trout
#

Oh, nice. That works. I created a new function out of that, to be called in init.sqf.

lone glade
#

don't call it in init

#

use initServer

slim trout
#

Yes, im just testing it in the editor so far.

lone glade
#

doesn't matter, put it in initServer.sqf

slim trout
#

what about onplayerrespawn.sqf?

#

In case zeus dies? Or i dont have to, since its attached to the module not the player?

lone glade
#

it's added to the logic

#

only need to be ran once

slim trout
#

Aight, sounds clear to me. Thanks again. I learned a lot today, like always when I ask over here. Love the work you do guys here.

lone glade
#

adding it in initPlayerLocal will add it every time someone joins

#

thus why it's REALLY a bad idea to do so.

#

just add it in initServer and it'll run fine, and it won't be added non stop.

#

......... what don't you get in it add the event to the logic not the player ?

#

not only that but you remove all curatorPinged EHs ......

#

I made something that kills players after 5 pings within 15 seconds

#

after the 4th they get a hintC warning, at the fifth they die

#

nope, they have to click on the warning, thus they really want to die if they spam

#

oh I just noticed I didn't added my tag to those setVars.

zealous solstice
#

@lone glade is your tag derp?

lone glade
#

ofc

zealous solstice
#

๐Ÿ˜ƒ

lone glade
#

here we go, derpyfied

blazing trench
#

how can i replace stamina/fatigue bar (the one which decrease when running)? i would like to set it vertically and change color default as blue

still forge
#

@blazing trench altis life yes?

blazing trench
#

@still forge yep

jovial heath
#

Hey guys, does anyone happen to know an ASL-based FlyInHeight either in vanilla or CBA? A friend is trying to figure out a way to direct an AI to fly in a straight line in order to support a paradrop. FlyInHeight is based off of AGL, so it's dipping and diving all over the place. Even setting the waypoints at a height and leaving the AI to figure it out results in the AI diving straight into the ground, he claims. I'm not able to test it myself at the moment, but I know there has to be a way. Any suggestions?

blazing zodiac
#

Yea, I would love to get an answer on this myself. The VBS flyInHeight has a bool in the params that switches it to ASL mode. I would love to see that implemented as part of the scripting commands and functions overhaul initiative.

jovial heath
#

Nnnevermind, apparently he didn't leave enough room for the plane to climb so it was freaking out. It's apparently flat enough that the terrain doesn't impact it much. ASL would still be nice, though.

trim trout
#

ANyone around who can help me out with a function I have thats failing?

#

It claims I am missing a ; so I am sure that's the issue, I just don't know where..

spice arch
#

Can anyone tell me what .hpp and .h files are typically used for and what a typical file structure for those look like?

vapid frigate
#

For arma, both are just used as files to #include. There's not really a standard structure for them.

#

Sometimes they're used to move common #defines to another file so they can be included from multiple other files

#

Sometimes they're used to split up configs into smaller files

#

the extension doesn't really matter.. i think .h and .hpp are just borrowed from C/CPP header files (which are the most common thing to include)

blazing trench
#

im using altis life, how can i replace stamina/fatigue bar (the one which decrease when running)? i would like to set it vertically and change color default as blue

spice arch
#

Thanks again Lecks!

split coral
#

@jovial heath There's a new command "FlyInHeightASL". I haven't checked, but it might be in the next stable update in a week or two.

still forge
vapid frigate
#

Looks like a custom dialog/menu, not something for checking locations

still forge
#

yes it is, id like to be able to edit the x and y locations without having to reload my whole mission to see actual locations?

split coral
#

Location usually means map locations.
You could use ctrlSetPosition in a script and add a temporary button to run it. Or add it in the onbuttonclicks.

blazing trench
#

no support here about altis mod guys? :/

queen cargo
#

@blazing trench as nobody plays altis here ... kind of no
however ... to answer your question: the fatigue bar is most likely provided by native arma and not reimplemented --> you cannot do this without a mod
or: you can do this without a mod if the UI element has a UUID (still ... you might need a mod depending on a lot of things you would have to investingate)

hope i could help

blazing trench
#

@queen cargo ok thanks, yeah that helps me enough because im starting with modding in a3

compact galleon
#

@trim trout Did you fix it?

blazing zodiac
#

@split coral where did you find info on the "FlyInHeightASL" command?

lunar lichen
zealous solstice
#

wait

#

what is that command

#

i never saw this befor

lunar lichen
#

will let you connect to a server from within another server

#

bouncing between servers similar to the bungee system for MC

zealous solstice
#

you mean like server instances?

lunar lichen
#

does other things too but thats what i want

#

ys so you could have 2 servers 2 diff maps and "fast travel" between them

#

for example get on a boat in altis and travel to statis

#

but the command is totaly dead

#

apparently was never added

jade abyss
#

Yep, tried to make it work about a year ago, gave up since nothing worked.

grizzled cliff
#

i mean it looks like it is implemented...

#

yea so all that functionality is for is some never really implemented autoupdater for arma

#

it doesn't do anything with servers

#

i mean game servers

#

so yalls wrongs ๐Ÿ˜›

jovial heath
#

@split coral Is it on the dev branch? If so, man, what timing.

split coral
#

@blazing zodiac @jovial heath It's on the dev branch and the release candidate.
heli1 flyInHeightASL [200, 100, 400]
parameters are [height careless/safe/aware, height combat, height stealth]

lunar lichen
#

yeh @jade abyss it just simply is not there, ive tried tracking the system but cant find anything ๐Ÿ˜ญ

jade abyss
#

Yep

zealous solstice
jovial heath
#

@split coral Sweet, thanks so much!

queen cargo
#

can we get self referencing arrays for SQF @lavish ocean ?
eg arr = [[]]; (arr select 0) set [0, arr];

lone glade
#

what we need the most atm is a working +=

queen cargo
#

not rly @lone glade ... that is litterally the least we need

#

_i = _i + 12345125125125 works totally fine too

#

not that nice

#

still it works

#

+= would be quite with a overhead also

lone glade
#

say what? so you're telling me that native cross compatibility for ammo between multiple mods isn't a big thing?

queen cargo
#

you mean the config thingy?

lone glade
#

yeeep.

queen cargo
lone glade
#

a config version of + is what I want.

queen cargo
#

wasnt there such an operator already introduced?

lone glade
#

it's borked

queen cargo
#

no

lone glade
#

BIS says it works as they intended but it's borked.

queen cargo
#

its just the arma variant

lone glade
#

(ofc)

queen cargo
#

just like == is not what you would expect in SQF ๐Ÿ˜ƒ

lone glade
#

SQF doesn't care of what other languages do, SQF is pants on head.

queen cargo
#

thats why i develop OOS @lone glade ... no more inadequate behaviour

lone glade
#

then you have intercept, that goes around SQF because fuck it.

queen cargo
#

intercept wont run in missions

#

and needs extra dependencies

lone glade
#

eeeeeh, I know for missions, for dependencies it's just a .dll

queen cargo
#

yup

#

thats the difference to OOS

deft lion
#

And why SQF is supposedly going out the window in Enfusion... whether or not one likes the replacement (the C++ like Enforce Script)

lone glade
#

SQF is still going to be here for a little while.

#

arma4 isn't coming anytime soon.

deft lion
#

arma4 isn't coming anytime soon.
As Bi_Raptor declared earlier, I remember ("Guys, let me assure you - we're not even remotely thinking of something that could be described as Arma 4. Arma 3 is here to stay for quite some time, with continuous support." https://forums.bistudio.com/topic/186770-arma-4-upgrade/ )

earnest valve
#

Well obviously, lol. I mean, the developers already have enough on their plate working on a VR game and the APEX expansion. Not only that, unlike ArmA 2, the game can be easily updated and improved on thanks to Steam's updating system.

#

Idk why people are already demanding an ArmA 4. Maybe perhaps they are trying to say "We want APEX graphics now" or something, lol.

warped thicket
#

people want deep changes in the system, those that are simply not viable to do in Arma 3, like replace SQF, that's the main reason I'd say

#

I am not counting those who are just complaining without arguments btw

lone glade
#

or those who don't understand why we need some changes

#

(pls more missionEH and less addstackedEH)

nocturne bluff
#

^

#

and

#

createNamespace

#

and a decent vehicle armor system

#

less herpderp boom

still forum
#

createNamespace #HYPE

lone glade
#

use the cba workaround, locations as namespaces ๐Ÿ˜„

earnest valve
#

Tbh, I love working with .sqf code.

still forum
#

:x but i need the engine part of createNamespace ._.

lone glade
#

we all do.

grizzled cliff
#

locations as namespaces is the best solution for now (and i am not saying that out of bias for me writing that wrapper)

#

i literally tested every other method of doing hash maps

#

course the absolute best solution is intercept ๐Ÿ˜› then you can use whatever hash mapping implementation that you want

compact galleon
#

@nocturne bluff It's not vaporware

nocturne bluff
#

Then where is it D:

compact galleon
#

@nocturne bluff Right here

#

On my computer

#

Actually, my bot on my Discord server uses my analysis engine to provide feedback on posted SQF code

#

So I guess, that's a small preview "release"

nocturne bluff
#

๐Ÿ‘

compact galleon
austere granite
#

Is there a way to retrieve the full folder path of a loaded mod?

vapid frigate
#

I think the closest thing is the FILE preprocessor command

still forge
thin pine
#

#lightpoints are local. their effects are local. So create the lightpoint on everyone's computer and set the attributes on everyone's computer. There's many ways to do that, one being remoteExecCall

#

You could put all the _light stuff in an inline function with two parameters, _chemColour and _obj

still forge
#

sounds confusing

vapid frigate
#

It is, but it's a vital part of scripting anything for multiplayer

thin pine
#

Yep, welcome to locality.

lunar lichen
#

lol i tried using #lightpoints and remoteExecCall and filed lol, crashed my system ๐Ÿ˜›

thin pine
#

then you must've done it wrooooooooooooooong ๐Ÿ˜‰

lunar lichen
#

ya think? lol

grizzled cliff
#

does anyone know if ctrlCreate actually works with 3D objects?

austere granite
#

What's the recommended course of action when adding server settings into a mod? I prefer it if the client doesnt need to copy userconfig or so.

tough abyss
#

Hello I'm having trouble getting ACE3 and Infistar to play nicely together, but nothing I've done works. The problem I'm having is the ACE3 Menu's (Medical Menu, ect.) dissapearing after popping up, I've tested it with Infistar not loaded and it works perfectly. I've tried disabling most of the Anti-Hacks settings and this problem still persists. Any help would be greatly appreciated.

grizzled cliff
#

Not really the right place to ask Kyou, might wanna try the ACE3 slack

tough abyss
#

okay thanks

#

sorry ๐Ÿ˜ƒ

blazing zodiac
#

Anybody have a good way to return the closest door to you?

prime valve
#

Hey, anyone has a way to syncrhonize animals between all the players on the server ? Like not spawning animals via the editor, but via a script. The goal for this is hunting, and rabbits and such appears to not be syncrhonized for everyone.

mossy sorrel
#

@prime valve you first need to remove them from terrain config or disable their simulation (not sure that is possible by script). Than you just spawn them like normal units (createunit or createagent). They will than be global.

prime valve
#

Well, actually then don't move..

mossy sorrel
#

You need to call the ai fsm

#

Or write your own behaviour script

#

Checkout the ambient animal module

prime valve
#

Okay thanks, will try this out !

tough abyss
#

Animals dont respond like normal to movement commands, they just rotate on the spot. Animal movement is caused by the idle animation randomly selecting idle/run/walk animation.
The walk/run animation is what causes animal to move forward.
So basically you need to call playMoveNow to force animal to move & loop it.

blazing zodiac
#

Well I figured out a way I can get the closest door to a player but now I need a way to create multiple of the same object in a for loop but still be able to have the objects named. My current problem is since the objects are being created and then moved into position using _helperObj as the name it's moving them all to the same spot (the last position in the loop) or possibly only creating one. Any help here would be fantastic, it seems like something simple I'm overlooking.

celest rivet
#

Question: Is there a way to disable ragdolls in ArmA 3? All I've been able to find thus far is "improving them".

split coral
#

Hello!

#

Q: Is it possible to open the browser or steam overlay to a page from the game? There are some vanilla buttons that do that, but I can't find how they do it.

#

or is impossible due security reasons?

robust geyser
#

It is possible.

#

Numerous games do so.

#

You are trying to have the ability to open a certain URL path, from the game itself, such as clicking on a "Buy" button or such, yes?

#

@split coral

split coral
#

Yes, exactly. Any idea how it's done?

robust geyser
#

Well. I do know there are numerous protocols that are usable.

#

An example can be something like...

split coral
#

Yeah, but with Arma 3 scripting? ๐Ÿ˜‰

robust geyser
#

For arma 3, I don't know.

split coral
#

๐Ÿ˜ƒ

robust geyser
#

But in general, steam://url/CommunityFilePage/112030991 would be an example.

agile pumice
#

Can someone help me with an issue I'm having with setvariable? http://pastebin.com/raw/vKngZ8kD
The marker is created fine, so the _uid variable can't be the issue, but when i try to get the variable from the client, its nil. My third param is true, so it should be global. The script is ran server side.

still forum
#

or maybe not.. thought there was a command to do that but.. seems like there isnt

#

@agile pumice how far is the client from the house?

#

when too far away houses get unloaded with that all variables on them (Atleast i heard that when someone wanted to hide a house)

split coral
#

Youtube doesn't quite cut it though. I know of htmlLoad also, but I was looking for a proper browser opening solution.
I've looked at the vanilla configs and gui scripts, but it looks like they're hard coded. Or i'm just blind.

still forum
#

how about htmlLoad with an href in it?

#

yeah... i think you cant open links with script commands.. but if you have an href in a structured text on a UI element.. and you click that link it opens in browser

#

not overlay tho

split coral
#

yeah, I think you're right.

agile pumice
#

right infront of it, using cursorTarget, and cursorTarget is returning the house

still forum
#

so while you are setVariabling you are right there and cant read the variable?

#

then i have no idea... :x

agile pumice
#

nor do I

#

its weird

keen stream
#

Odd question maybe, is there a way to detect if a unit has gear assigned via Arsenal when a scenario is made with 3DEN?

agile pumice
#

did

#

same thing

cedar nebula
#

how hard would it be to make a dog that follows you?

#

so I can make him sniff for IEDs?

#

I have no idea I never wrote a script lol

#

it would be nice if I have a dog that follows me or that i can order to sit down

agile pumice
#

i think they'll follow you if you add them to your group

#

or atleast they used to I think

robust geyser
#

im a dog

cedar nebula
#

pretty dog

#

can I even place dogs in the editorรŸ

#

*?

robust geyser
#

they no exist

cedar nebula
#

but why are there dogs running around my communities base then? O.o

agile pumice
#

might be related, but my rpt is being spammed with: Update of nonlocal object 2:4684 called

agile pumice
#

okay so, interesting turn of events, when I made sure the map files were exactly the same on both the server and my client, the setvariable/getvariable issue went away

agile pumice
#

When is 1.57 expected to release?

still forum
#

never

#

1.57 is only dev branch. next release will be 1.58

agile pumice
#

gotcha, when's that expected?

split coral
#

It's been in public testing for a week now, so probably releases next week.

blazing zodiac
#

Does anyone know of a way to add an action to an invisible object?

meager granite
#

Add action to player and do your own check whether action is visible or not

blazing zodiac
#

That was the work around I had but there would be many of them ~100. I'd imagine that many while loops would start to be bad for performance or are the actions added with addAction already while loops themselves?

timid zealot
#

From the wiki page on addAction: "[The] condition is evaluated on each frame in non-scheduled environment"

jade abyss
#

Is there already a function, that checks if a player is inside of a bouningbox?

jade abyss
#

nvm, wrote my own

frozen zinc
#

Hi

fallen locust
jade abyss
#

hmm, gonna take a look at it.

tribal crane
#

If you aren't on DEV you'll want BIS_fnc_inTrigger by the way.

tender fossil
#

Can you create a link in game that opens in Steam ingame browser?

lunar mountain
#

Hey guys. What can cause player spawning as seagull? (player -> objnull). It's not the group number limit that's checked.

native hemlock
#

In what ways did you check the group number limit? count allGroups when the issue was happening?

lunar mountain
#

Indeed

#

47 is far from the limit as far as I know

#

Seems to be tied to specific slots

native hemlock
#

Yeah the limit is 144 per side, is it a slot that someone disconnected from and later someone else joined?

lunar mountain
#

probably, yes

#

100% yes, it's a persistent server with respawn

#

wondering

native hemlock
#

I've never encountered it personally but I'm assuming is that the player tries to take control of that unit but they can't so they are assigned to spectator

lunar mountain
#

having a handleDisconnect EH set up which deletes the body

#

can that f-up stuff?

#

yet again, the playable slot doesn't disappear

#

we had problems like players disconnecting and the unit becoming AI, so I added the handleDisconnect EH

native hemlock
#

Yeah I think this issue is in the realm of that

#

I think in theory in the vanilla game if a player disconnected an AI would take control and the player would be able to reconnect and take off where the AI left off, but I could be wrong

#

Do you have disabledAI = 1; in your description.ext?

#

And what respawn template are you using?

lunar mountain
#

yes, it is disabled, that's why I was surprised when this happened in our previous version

#
    {
        Removeallweapons _body;
        deleteVehicle _body;
        
        //If it's in a vehicle
        if !(vehicle _body == _body) then
        {
            [vehicle _body,_body] remoteexec ["deleteVehicleCrew",vehicle _body];
        };
        
        //killing the "body" as a last resort - as they might stuck in vehicle alive
        if (alive _body) then
        {
            _body setdamage 1;
        };
                
    };
    false```
#

this is the handleDisconnect eh code

native hemlock
#

Yeah I've seen the ghost AI walking around before from a previous player, in some cases they swam kilometers to try and regroup from debug islands

lunar mountain
#

oh yeah, player's unit being stuck in a vehicle -> that happened as well ๐Ÿ˜ฆ

#

anyways... gonna try to remove this and see if this still happens

native hemlock
#

I would think with disabledAI it couldn't, but I've seen first hand the AI taking control

lunar mountain
#

Yes, the mysteries of Arma 3

native hemlock
#

Try and see if you can narrow down the way the player disconnects before the slot is bugged, kicked, hit disconnect button, game crash, etc

#

Maybe under some weird condition their body isn't getting cleaned up and then that slot is unusable because they are dead, but I don't know why the respawn template wouldn't take care of that and give them a new unit

opal helm
#

Hey! I copied a script which runs on the whole side (OPFOR in this case) yet I need to make an exception for 4 characters (2 groups) how do I do that? this particular script basicly spawns a parachute for each player and moves the players into them. This is the script: http://pastebin.com/dyjytQN2

nocturne bluff
#

@opal helm This page is no longer available. It has either expired, been removed by its creator, or removed by one of the Pastebin staff.

jade abyss
#

gnah.. what was the fkn command for removing the " from a string...

#

not parse...

indigo snow
#

....compile?

jade abyss
#

ah

#

had a huge brainfart, enough for today. Was sitting here for 10min, trying to find out the % -.-

vapid frigate
#

or (_string splitString '"') joinString ""

jade abyss
#

compile was the right one.

thin pine
#

I wonder why createVehicleLocal never had the alternative array syntax that its global counterpart createVehicle has. :/ The CAN_COLLIDE parameter would've been nice

winged thistle
#

I have a variable assigned to an object. I can call the variable locally, but I can't seem to be able to pull it when I move everything to the server. Object variables are public, no?

still forum
#

setvariable has a parameter to automatically publish the variable over the server

jade abyss
winged thistle
#

Thank you guys. I'll give that a shot.

#

Is the default value false?

jade abyss
#

Yes

winged thistle
#

Ah, that makes sense now.

#

Thanks again.

winged thistle
#

I even read that yesterday and it didn't register at all...

#

I've been looking for something like that. Sweet!

#

๐Ÿ˜„

jade abyss
#

๐Ÿ˜‰

winged thistle
#

The mission I'm writing is gonna be tits.

still forum
#

btw @winged thistle not everyone likes tits

winged thistle
#

T.I.T.S. = This is the shit

jade abyss
#

Yeah, its the same, just with the possibity to check, whats in the Dev Branch^^

winged thistle
#

Ah, I'll use that if I ever start using the Dev Branch ๐Ÿ˜›

grizzled cliff
#

I always dev against dev branch, test against release.

#

But often in my projects release cycles pace Arma release cycles pretty closely.

quick summit
#

Can me help anyone, please. I would open gates by using key "O" for Cops, Medics and specific PlayerIDยดs

#

The script sahows

{
    if (!_shift && !_alt && !_ctrlKey && playerSide in [west,independent]) then {
        [] call life_fnc_opener;
    };
};
#

What is to change?

indigo snow
#

without knowing _shift, _alt, _ctrlKey and life_fnc_opener, everything looks fine

jade abyss
#

He needs to define it to Button O

quick summit
#

thanks

tough abyss
#

Anyone figure out the new EDEN menus yet?

indigo snow
#

sure

#

ask questions

tough abyss
#

any clue how i could dynamically create one with ctrlCreate?

#

or rather, how to make the menu work

#

and what commands like what menuAdd, etc take as params

indigo snow
#

are you talking about adding a new attribute or a new item to the menu bar on top?

tough abyss
#

a new item

#

i want to dynamically create one with just scripts for now

indigo snow
#

a new item where

winged thistle
#

@jade abyss & @still forum ty that fixed my issue.

indigo snow
#

item is not eden terminology

#

you cant add attributes dynamically btw

#

needs to be an addon

winged thistle
#

For some reason assumed the object namespace would be global by default

tough abyss
#

ctrlMenu has items entry

#

i dont want to add them to eden

winged thistle
#

Never assume with Arma. Check.

tough abyss
#

i want to add them to my custom menu, not related to eden

indigo snow
#

cool

#

cant help you with that

tough abyss
#

ok, thanks. i'll check if i have better luck tomorrow :)

ivory nova
#

Sorry for the ignorant question

#

Does fog affect NPC visibility?

tough abyss
#

Yes, it does. Both fog and overcast do. Set the time to midnight, put a heavy overcast(but not heavy enough that it rains) and set a large amount of fog. Place down Enemy AI with out Night Vision. They won't be able to see you until you're relatively close. Do the same thing with no overcast and no fog, and they'll be able to see you from farther away. Now, do the exact same thing with heavy fog, heavy rain, and a heavy overcast. The AI won't be able to see you until you are pretty much right on top of them. And due to the Rain, they won't be able to hear you until you are close too.

#

I know this for a fact because I use Zeus and Dynamic Weather to create stealth missions. I have night vision and the enemy AI have no night vision and sometimes no flashlights either. I can see them from far enough away to kill them without them knowing that I'm there.

humble badge
nocturne bluff
#

the second

#

KZ works quite well

humble badge
#

Ok thanks. I will give it a try.

ivory nova
#

@tough abyss Thank you!

vagrant kite
#

@humble badge if you want to write and read files as a database, use something like extDB2

humble badge
#

Thanks but I am exporting script and config data to a file.

lunar mountain
#

Anybody knows how to use the Posters module? Not even sure what does it do (placing posters? ๐Ÿ˜„ )

#

Nvm, got it working ๐Ÿ˜„

grizzled cliff
#

working with dialog 3D objects is about the most frustrating thing ive ever had to do in Arma

#

first off the coordinate space is insane, its x,y,z but x and z are screen coordinates (as in within the bounds of the safeZones), but y is in meters from the screen.

#

so here is the really confusing part, 1 meter is not one meter when translated from world space to screen space, to model dialog 3d space

#

its a function of the UI size and I have no idea what it is.

#

so maybe then y isn't actually meters from the screen, but some entirely made up unit

#

anyway, @biminions if you could do me a huge favor and add a ctrlModelAnimate, ctrlModelSelectionPosition, and ctrlModelAnimationPhase command I'd be forever indebted because writing my own animation system, while fun (and animating things isn't the hard part), it is an exercise in total frustration.

agile pumice
#

I'm looking for a way to replace every instance of "\" in a string and replace it with "\\"

#

thinking of splitting and joining strings but finding all the indexes is giving me a headache

agile pumice
#

see if I can figure out killzone kid's regex dll's

tough abyss
#

test = "omg/123" splitString "/";
test2= test joinString "//";

#

No need for a blocking callExtension

grizzled cliff
#

a callExtension is just as blocking as any of those commands

#

๐Ÿ˜

agile pumice
#

I'm working with a dynamic string with any number of backslashes

#

the splitstring/joinstring method I initially mentioned wont work in that case, so I'm using killzone kid's regex_replace dll

agile pumice
#

trying to work out the math for _cpRate and the sleep

native hemlock
#

In what amount do you want the percentage to increase between sleeps? And is _seconds the total time you want the progress bar to last?

#

If I assume you want to increase the bar by 1% at a time you would want _cpRate = _seconds / 100 and no matter the length of time you would add 0.01 to the _cP between each sleep

agile pumice
#

1%, corrected: _cP = _cP + 0.01;

#

and yes seconds is the total time for the progress bar to last

native hemlock
#

Then that should work

agile pumice
native hemlock
#

You could diag_tickTIme before and after to see how long it is

#

It could also be slowed down if you have a lot of scripts running since it's using sleep vs uiSleep

agile pumice
#

its close enough I guess, im not gonna fuss with milliseconds

native hemlock
#

It's pretty simple math

agile pumice
#

ill be using uisleep though

native hemlock
#

You want 100 intervals so 5/100 = 0.05, so every 0.05 seconds you want to add 1

snow pecan
#

Here's what I use for a flexible function

native hemlock
#

The only thing I don't like about that is the lack of a sleep

#

For however long the bar is there you are setting its position multiple times a frame

snow pecan
#

Easily modifiable to do so

#

All depends on what you're doing with it

native hemlock
#

True ๐Ÿ˜ƒ

ivory nova
native hemlock
#

I've never seen this forum post but it looks decent, I think the best list of commands you can find is from Killzone Kid's website (http://killzonekid.com/arma-2-arma-3-scripting-commands-list/) as it usually has the most up to date commands as well as commands from Arma 2 and OFP (they still work). So you can ctrl + F search for a command and it'll lead you to the wiki which will have a description of the command, syntax, paramters, return values, and sometimes examples and notes. Killzone Kid's website also has some miscellaneous tutorials but some of the information is dated.

ivory nova
#

@native hemlock Awesome, thank you so much ๐Ÿ˜ƒ

#

when I see this in a script, e.g. (driver this) setBehaviour..., is "this" referring to the object name?

#

e.g. if I name a Huron huron_01, should I then write (driver huron_01)...?

agile pumice
#

thats correct

ivory nova
#

trying to script a heli to transport some crates form one place to another, but very early days scripting for me

#

@agile pumice awesome, thank you!

agile pumice
#

although I wouldnt call it "name"

ivory nova
#

I see

#

better to refer to it as variable name? something else?

agile pumice
#

variable name sure

ivory nova
#

cool, thank you ๐Ÿ˜ƒ

agile pumice
#

you'll see "this" and "_this" in different contexts

ivory nova
#

if i understand correctly, one is global and the other local?

vapid frigate
#

'this' is generally used in init/trigger scripts in the editor

ivory nova
#

(still wrapping my head around it)

#

ahh I see

vapid frigate
#

_this is what you pass to a script

agile pumice
#

well you dont pass _this to a script, lecks

vapid frigate
#

yeh, it's what's been passed in to a script

agile pumice
#

"this call myfunction", inside myfunction, what your passing becomes _this

snow pecan
#

If you do
[player,"string"] execVM "somescript.sqf";

Inside somescript.sqf, you would access those passed variables by doing

_player = _this select 0; // player
_string = _this select 1; // "string"```
vapid frigate
#

yeah, except select 1 for string

snow pecan
#

ah yah, typo

#

good catch

ivory nova
#

Ahh, I think I understand a bit better

agile pumice
#

"params ["_player","_string"]" is a better alternative to spyder's code

vapid frigate
#

instead of doing _this select 1; though, you'll usually see people use BIS_fnc_param in old scripts or 'params' in new scripts

snow pecan
#

well yeah, many many different alternatives

#

_this select 0 is just simpler for beginners imo

agile pumice
#

i wouldnt say its simpler

snow pecan
#

From the perspective of trying to read the wiki page, for someone new to scripting it is easer to comprehend instead of picking apart the optional parameters

#

But yes, once you know what you're doing -> params > select

vapid frigate
#

best to know both anyway so you can understand other scripts

ivory nova
#

i have a lot to learn by the looks of it (:

vapid frigate
#

have you done other scripting/coding?

#

in other languages

ivory nova
#

C and C#, a little Obj C and Cocoa

#

But all as a hobby

#

Hard to find a lot of time to dedicate unfortunately ):

vapid frigate
#

you'll probably pick it up pretty quick

ivory nova
#

I hope so! (:

#

I will bash away at this idea until I understand better

#

Thanks for your help guys

vapid frigate
#

and arrays that can contain any combination of them (so that's what people usually use as objects)

ivory nova
#

Ahh I see

pliant stream
#

SQF OOP is rather similar to C OOP

#

except without structures ;D

ivory nova
#

๐Ÿ˜ƒ

#

is there a way to check the age of a unit? e.g. if x unit is y minutes old, spawn z object?

agile pumice
#

after you spawn the object

#

define a variable _startTime = time;

#

then compare time to _startTime later. if (time - _startTime > y time) then {spawn z object};

#

or something like that ๐Ÿ˜›

snow pecan
#

You can use the setVariable and getVariable commands to store information to a unit/object and retrieve it later as well

#

So when the unit is created

agile pumice
#

that would be the better way

snow pecan
#
_initTime = time;
_unit setVariable ["creationTime",_initTime]; // [key,value]```
#

Then when you need to retrieve that information in another script, pass the unit (or have a global variable to reference it) to the script

#

And retrieve it inside the script using _initTime = _unit getVariable "creationTime" // reference key from above;

ivory nova
#

Thank you very much!

vapid frigate
#

you can use sleep 60; to just pause a script for a minute too, but from my understanding it's best to not have too many scripts sleeping at a time

ivory nova
#

Ahh, also useful, thanks!

vapid frigate
#

and it only works if scripts have been spawned or execvmed (in which case they run in their own thread)

#

doesn't work if they're called

pliant stream
#

that's an SQF thread, not a native one mind you

ivory nova
#

Is it a good idea to use waitUntil if I want to only do something when a unit is within a certain distance of another unit/object?

agile pumice
#

yes

#

but its a good idea to have a break out method in your waituntil

ivory nova
#

E.g. wait until playerPos is within x distance of y object, if true spawn abc?

#

Ahh, I see, thank you!

#

Can I ask what you mean by break out method?

agile pumice
#

here's an example of one of my delivery scripts

ivory nova
#

Great, thank you ๐Ÿ˜ƒ

agile pumice
#

my script waits for my player to take a box, and if 60 seconds elapse and he hasn't itll break out and fail the mission

#

if your having difficulty understanding it I can rewrite it simpler

ivory nova
#

I'll see if I can implement something and will take you up on that if I don't get it ๐Ÿ˜ƒ Thanks again!

agile pumice
#

np

#

i could have used time or diag_tickTime instead of the incremental DeliveryMission_WaitTime but oh well

ivory nova
#

I see, I'll look those up!

#

How long have you been scripting, just out of curiosity?

agile pumice
#

3-4 years, but i never had any fundemental programming skills beforehand, so I'm still a noob

#

i had some basic skills from some java projects, bare bone basic knowledge

ivory nova
#

Awesome, thank you ๐Ÿ˜ƒ

agile pumice
#

Half the vets in here probably think im retarded.

ivory nova
#

I've done almost nothing, but thinking about what I could do with the editor makes me want to dedicate a lot of time to learning

#

Haha

agile pumice
#

im still using the wiki a lot though

ivory nova
#

Does the distance command return in metres?

snow pecan
#

Yes

ivory nova
#

Awesome, thank you

#

Does this make sense at all?

#
_heliPos = getPos huron_01;
_distanceToHeli = pilot_01 distance huron_01;

_moveCheck = if (_distanceToHeli >50) then [{pilot_01 doMove (position _heliPos);} else {pilot_01 setBehaviour "CARELESS"}];```
#

Without the misplaced ;, I think

agile pumice
#

any reason your defining _moveCheck, and simply not running the conditions? Usually when you have if conditions in a variable, its to return a value

ivory nova
#

Not for any good reason ๐Ÿ˜ƒ

#

So I can just run the if statement without defining anything there?

agile pumice
#

yes

ivory nova
#

Awesome!

agile pumice
#

also

#

not sure what you're doing with the [ and ]

ivory nova
agile pumice
#

if (_distanceToHeli >50) then {pilot_01 doMove (position _heliPos)} else {pilot_01 setBehaviour "CARELESS"};

ivory nova
#

awesome, thank you so much

#

can i call this from a units init field?

#

or would it be better to do so from the init file?

agile pumice
#

you can stick it in the init field, sure

ivory nova
#

great, thank you!

agile pumice
#

try not putting massive chunks of code in the init lines though

#

especially if its repetitive code

ivory nova
#

if i wanted to call this from a file instead, is it possible to simple reference the file name in the init field?

agile pumice
#

[myUnit] execVM "myscript.sqf"

#

either in the unit's init box or init.sqf in the mission directory

ivory nova
#

great! going to try it now, thanks again! ๐Ÿ˜ƒ

agile pumice
#

any code in the mission sqm will run before the init.sqf

ivory nova
#

ahh, good to know

agile pumice
#

if you want to run the same code on multiple units

#

a forEach loop would be used

#

{[_x] execVM "myscript.sqf"} forEach [unit1,unit2,unit3,unit4] in the init.sqf

#

if your going to be running myscript.sqf frequently, best to define it as a function and call it if you dont do any sleeping or waiting or while loops

#

time related stuff needs to be spawned

ivory nova
#

I see!

#

Will copy all this down, thank you!

#

Do functions that rely on checking the distance between two objects, etc., eat up a lot of resources?

agile pumice
#

add me on steam for future questions if you want

#

same name

ivory nova
#

Will do!

agile pumice
#

as for the resources question, i can imagine if you have a lot of simultaneous checks

#

to refer back to my if statements in variable definitions, heres two ways:

_variable = if (true) then {1} else {0};

example 2:
_variable = switch (true) do {
    case (some condition 1): {
        1
    };
    case (some condition 2): {
        0
    };
};```
#

I read switch blocks are better for performance, but not worth the time setting up if your only going to need if/else

#

instead of redefining _variable for every condition

ivory nova
#

very interesting, thank you (:

agile pumice
#

I just made the cases up, btw

#

just meant to represent different conditions

ivory nova
#

is there any way to make the error log message larger? i feel i will be running into these a lot

agile pumice
#

not sure

#

but the error is also logged to your RPT file

#

C:\Users\Jordan\AppData\Local\Arma 3

#

its located in there

ivory nova
#

great!

#

thanks again !

agile pumice
#

np

ivory nova
#

I will have to do some troubleshooting

#

Anyway, thank you for your help, really appreciate it!

agile pumice
#

any time

nocturne bluff
#

๐Ÿ‘

ivory nova
#

Sorry for noob question: is it possible to use an && operator in an if statement?

#

Here's what I'm trying to do

#
_pilotPos = position pilot_01;
_heliPos = position huron_01;
_distanceToHeli = pilot_01 distance huron_01;    

if (_distanceToHeli >5) then {_pilot move (_heliPos)} && {_pilot forcewalk true} else {_pilot setBehaviour "CARELESS"};```
#

I tried wrapping move and forcewalk in () and [] but had no luck

#

Here's the error I get: Error &&: Type code, expected Bool

#

Hm, managed to get it working by putting it inside the move curlies, but still get an undefined variable error ๐Ÿ˜ฎ

#

Oh, never mind me, I'm retarded ๐Ÿ˜ƒ

#

Do any of you recommend a certain app to script in?

thin pine
#

@ivory nova for the last two years I've been using notepad++ with the Java syntax

ivory nova
#

Thank you! I'll give that a try then

vagrant kite
#

you can also try Atom with its' language support package

ivory nova
#

Thanks for the recommendations!

#

Is it possible to have a unit shoot at another unit, but always miss? I wanted to test if an AI will automatically leave "CARELESS" when engaged

split coral
#

Set his accuracy to zero

#

He will still hit occasionally though

ivory nova
#

Ahh, nice, I will try that now (:

split coral
#

Or if you just want him not to hurt anyone, you could disable damage on the target

vagrant kite
#

you set CARELESS behavior via setBehavior or waypoint's behavior?

ivory nova
#

via setBehaviour

split coral
#

Does it matter which you use? I always thought they simply won't snap out of CARELESS ever....?

ivory nova
#

๐Ÿ˜ฎ

vagrant kite
#

Groups in careless mode do not switch to a more alert mode if enemies are encountered

ivory nova
#

Ahh, that answers my question then, thank you ๐Ÿ˜ƒ

ivory nova
#

is it possible to say "do nothing" after an if statement fails?

vagrant kite
#

(I'm not 100% sure if it's the same for setBehaviour, it should but it's Arma)

#

you just ommit else

ivory nova
#

woah, didn't even think of that

vagrant kite
#

if (condition) then { do_stuff };

ivory nova
#

great, thank you ๐Ÿ˜ƒ

#

Is this the correct syntax to change a sub skill? _enemy = setskill ["aimingAccuracy", 0];?

vagrant kite
#

almost: _enemy setskill ["aimingAccuracy", 0];

ivory nova
#

perfect, no more errors, thank you ๐Ÿ˜ƒ

vagrant kite
#

using camelcase is a good practice in sqf so I'd write setSkill

ivory nova
#

i had _enemy defined as the unit name, but guess it got borked

#

will do that from now on, thank you

vagrant kite
#

unit name as in the 'name' field in units atributes?

ivory nova
#

yep

vagrant kite
#

you can't use local variables there (ones starting with _)

ivory nova
#

named a unit enemy_01 in game, then _enemy = enemy_01

vagrant kite
#

use enemy instead (which is global var)

#

oh

ivory nova
#

alrighty, thank you ๐Ÿ˜ƒ

vagrant kite
#

named a unit enemy_01 in game, then _enemy = enemy_01
that works

ivory nova
#

i only went there when i saw other errors, but i probably just made some dumb syntax errors somewhere that i didn't notice ๐Ÿ˜ƒ

#

TIL even a man with no accuracy can fall back on grenades, lol

#

hm

#

I have a unit doing this if (_distanceToPlayer <100) then {(_pilot move (_heliPos)) && (_pilot forcewalk true)}; but suddenly stopped walking with his gun down

#

is this just arma being arma? is there a way to force them to be relaxed but still able to respond when engaged?

#

Oh

#

"Safe" does the trick ๐Ÿ˜ƒ

#

@vagrant kite Atom is real nice

vagrant kite
#

๐Ÿ‘

#

BTW. if you want more than 1 command inside a block of code, use ; between them instead of &&
e.g.
{_pilot move _heliPos; _pilot forcewalk true}
or multiline:

    _pilot move _heliPos;
    _pilot forcewalk true;
}```
ivory nova
#

oh, great idea!

#

will do that now!

#

Is there a way to resume a previous behaviour or function if a unit hasn't been engaged for a certain amount of time?

#

a unit will break out of a routine to engage an enemy when set to "safe"; possible to have them wait x seconds/minutes in alert state, then resume whatever it was they were doing?

vagrant kite
#

I belive they go back to AWARE state after some time without contact. If you want to make sure they do use sth like:

    sleep 60; //wait 60sec
    _this setBehaviour "AWARE"; //change unit behaviour
};```
ivory nova
#

thanks! lemme try this out

ivory nova
#

Having trouble getting a unit to spawn, is anyone able to tell me what I'm doing wrong here?

#

"B_Helipilot_F" createUnit [getMarkerPos "heli_spawn_marker_01", "Delta", "newUnit = heli_pilot_02", 0.6, "CAPTAIN"];

snow pecan
#

I believe the class name for the pilot unit is B_Helipilot_F, try it with the underscores

vagrant kite
#

group is not a group name ("Delta") but a variable of type group; one that you create by createGroup command, or (if you want unit to join existing group) taken from the other unit: group _unit

ivory nova
#

also doesn't work with underscores ๐Ÿ˜ฆ

#

oh! okay, i will try that

#

thanks for the explanation ๐Ÿ˜ƒ

#

Perfect, works now, thank you!

vagrant kite
#

๐Ÿ˜ƒ

meager granite
#

What would be the way to get building floor with lineIntersectsSurfaces ?

#

I went through GEOM, VIEW, FIRE lods and found position is always ~20 cm under the building floor

#

Walls and ceilings are intersected properly though

#

Test code that I used:

#
onEachFrame {
    _cam1 = positionCameraToWorld [0,0,0];
    if(!surfaceIsWater _cam1) then {_cam1 = ATLtoASL _cam1;};

    _cam2 = positionCameraToWorld [0,0,5];
    if(!surfaceIsWater _cam2) then {_cam2 = ATLtoASL _cam2;};    

    _pos = lineIntersectsSurfaces [_cam1, _cam2, player, objNull, true, 1, "GEOM"];
    _pos = (if(count _pos == 0) then {nil} else {_pos select 0 select 0});

    hintSilent format ["%1", ASLtoATL _pos];

    if(!isNil "_pos") then {
        intersectobj = createVehicle ["Sign_Sphere10cm_F", ASLtoATL _pos, [], 0, "CAN_COLLIDE"];
        intersectobj setPosASL _pos;
        deleteVehicle intersectobj;
    };
};
#

Am I using wrong LOD? FIRE and VIEW give even worse results

split coral
#

I think it's an issue with some building models. I have almost exactly the same script, and it doesn't work on some vanilla buildings. On most it does.

agile pumice
#

having issues using callExtension on a dedicated server, works fine when ran on the client. To be specific its killzonekid's regex_replace .dll

#

@meager granite can you not use the roadway lod?

native hemlock
#

From the wiki:
Since Arma v1.51.131920 it is possible to indicate primary and secondary LOD to look for intersection. Available options are:
"FIRE"
"VIEW"
"GEOM"
"IFIRE" - ("I" stands for Indirect, almost the same as FIRE)
"NONE"

#

Roadway would be ideal but not an option. In most cases the view, fire and geometry would be at the same position for floors below you

#

What about the callExtension isn't working? And is it a dedicated server run from your computer or remote?

agile pumice
#

remote

#

its just not returning the same way as it does on my client

#

returning a blank string

#

ran it through my debug box and it worked

native hemlock
#

Any framework requirements? Like .net

agile pumice
#

I run extdb on the server so I can't imagine this particular dll has a different requriement

#

as far as I know it used c++ libraries

#

and i'm confident that the redist packs are installed

#

yeah, multiple copies of the c++ redists

native hemlock
#

@meager granite Possible solution to your problem if I'm understanding it correctly. The parameter for positionCameraToWorld uses [x,z,y] so I think you'd want to do
_cam2 = positionCameraToWorld [0,5,0]; instead of _cam2 = positionCameraToWorld [0,0,5];

#

Doing that I am always getting a value for the array with the exception of some awkward staircase positions

#

@agile pumice

#

I was thinking he might have been using .net framework since he did a tutorial with it but that's not the case with the regex it looks like

#

Do you have the dlls in your root folder and you're running them as a mod?

#

I know for extDB you can put it in a mod folder and then use the -mod parameter, and then you can put it in the same directory as the arma3server.exe and then you don't have to use -mod.

#

I'm off to bed though, good luck

agile pumice
#

had it in a mod folder that was already running, goodnight. When i tested the dll on my end it was in the arma3 root so ill try the same for the server

agile pumice
#

That must have been it, its working

tough abyss
#

extDB2, just requires vc2015 x86 and you need to put the tbbmalloc.dll in your arma3 root directory.

#

Besides that you can have the extension in your arma3 root directory or an addon directory

meager granite
#

@native hemlock [0,0,5] is there to get position in front of the camera, [0,5,0] would be above it in camera's model space

spring stone
#

Can I somehow forbid a unit to be able to open a door while other units still can? (Not every door on the map but on specific buildings)

prime valve
#

Please someone help me with UI, I'm literraly gonna kill myself. I'm trying to re-do the main menu interface, and I configured all my buttons. For some reason, no buttons appear except for the "Exit" one. It was made with the same way as the others, but somehow, the other buttons just doesn't apepar.

zealous solstice
#

i just rediscoverd the pre and post Build events in VS ๐Ÿ˜ƒ

tough abyss
#

do you know any envent Handler that is triggered between the moment when a unit take damage, and the moment when it dies ?

tough abyss
#

or something that is triggered when a unit take a shot but with allowDamage False ?

indigo snow
#

handleDamage handles the damage

#

and thus whether a unit will die from it

#

its return value is the damage taken

agile pumice
#

I'm trying to put weapons that can't be picked up in the editor, is that possible?

#

tried this enableSimulation false; clearWeaponCargo this; clearMagazineCargo this, but the thing disappears completely

#

just enableSimulation false didnt work

agile pumice
#

I know I would if I were to spawn the function, I was just curious to know if I needed to if I wanted to call it

cerulean cargo
#

Ok I've got a kind of ace3 specific question. I'm putting players into spectator mode when I respawn them, then allowing on a second respawn for them to come back from spectator mode. When they're coming back the drawn dots/names above unit's heads from the spectator mode persist and I'm not sure how to get rid of them

#

I'm a bit of an amateur here, so I'd really appreciate any pointers in the right direction. I think ACE is drawing the dots in fnc_handleIcons.sqf, but I'm having trouble unraveling what they've done

jaunty drift
#

[false] call ace_spectator_fnc_setSpectator isn't working? How exactly are you putting players into spectator mode and how are you trying to get them out?

cerulean cargo
#

I basically have them alternate 1,0 to spawn as spectator or spawn normally

#

on respawn normal, I have

#

[false] call ace_spectator_fnc_setSpectator;
[player, false] call ace_spectator_fnc_stageSpectator;

#

they do respawn normally but they icons they had when in spectator persist

warped thicket
#

fairly sure you are supposed to do stageSpectator before setSpectator

#

to guarantee it

austere granite
#

What's the best way to determine whether an item should be assigned or simply added?

#

If you use assignItem on an item that's not assigned (aka not a radio, map, whatever) then it just simply disappears, so i need to make sure that command is only used for that. Prefer to not use hardcoded class names obviously

#

Also is there a list of what each cfgWeapons >> _randomClass >> itemInfo >> type actually does?

austere granite
#

Figured it out. This seems to work fully. For anayoen wondering:

#define ASSIGNED_ITEM_TYPE 131072
        for "_i" from 1 to (_x select 1) do {
            if (isClass(configFile >> "CfgWeapons" >> (_x select 0))) then {
                // -- Get the type of item -- //
                if (isClass(configFile >> "CfgWeapons" >> (_x select 0) >> "WeaponSlotsInfo")) then {
                    _unit addWeapon (_x select 0);
                } else {
                    _unit addItem (_x select 0);
                    if ((getNumber(configFile >> "CfgWeapons" >> (_x select 0) >> "type")) == ASSIGNED_ITEM_TYPE) then {
                        _unit assignItem (_x select 0);
                    };
                };
            } else {
                _unit addMagazine (_x select 0);
            };
        };
cerulean cargo
#

@warped thicket oh damn, is that all? I'll feel really dumb if that's it

warped thicket
#

I am not sure, I am not too familiar with the spectator system, but I remember silentspike (author of it) telling me that

cerulean cargo
#

Nope, that didn't work. The icons were still there on respawn

winged thistle
#

Is there a way to make a round dialog control?

#

Like a round minimap?

cedar bay
#

Can someone direct me to a topic / tutorial on how to do custom crates for dedicated? Whatever I try it lags the server or crashes arma. A2 scripts dont work no more.

indigo snow
#

locality works exactly the same as always

#

if (isServer) then { /* addMagazineCargoGlobal etc */ };

agile pumice
#

is it possible to get the normal/direction of an intersection point?

vapid frigate
#

I don't think so.. maybe you could do 3 intersections and calculate their normal

#

assuming you mean the normal of the surface you intersected with

agile pumice
#

lineIntersectsSurfaces returns surface normal, [1,-4.37114e-008,-1.19209e-008]. Is this in the format vectorDir?

agile pumice
#

ah, works

#

_graffiti setVectorDir _dir;
_graffiti setDir ((getDir _graffiti) + 180);

hallow spear
#

anyone know why my lbcursel returns 17 for every selection in the listbox? I only have 3 options currently set in the box

halcyon hornet
indigo snow
#

without all the macro's its hard to say but intuitively it would seem that _this select 8is an array and not a bool or string

halcyon hornet
#

It is a default Altis script all I did was add CONST(life_copsiulevel, parseNumber(SEL(_this,8)));
CONST(life_copsrulevel, parseNumber(SEL(_this,9)));

#

and then the CONST(life_copsiulevel, 0);
CONST(life_copsrulevel, 0); to other sides not cops

indigo snow
#

check what _this select 8 actually is

#

it seems to be an array but it needs to be a number or boolean

halcyon hornet
#

which line you seeing this on

indigo snow
#

your screenshot of the error

#

Error parseNumber: Type Array, expected Bool, String

halcyon hornet
#

I assume its reffering to the 8 in CONST(life_copsiulevel, parseNumber(SEL(_this,8)));

indigo snow
#

SEL(_this,8) turns into _this select 8 selecting the 9 entry in the _this array

#

whatever is there is an array instead of a number or boolean

carmine galleon
#

Hey ! Got a problem... It seems when a player disconnects, all his dead bodies disappears, wtf ? Explaining : You die, respawn, then you disconnect, and your body from when you died disappears, is it intended ?

#

If yes, any idea for a workaround ?

carmine galleon
#

Nervermind, personnal corpse removal forgotten function, I'm dumb ๐Ÿ˜ƒ

austere granite
#

Does anyone know where the scriptiing commands are for the Eden context men (And top bar dropdown menus)? I've seen them before but can't find them anymore ๐Ÿ˜ฆ

nocturne bluff
#

?

#

Oh ah

#

I tought it was mostly config based

austere granite
#

Normally they are, but I'm hoping with these commands you can add/remove stuff to dialog controls with that type

austere granite
#

It looks like just a normal set of commands for a certain control type and a very useful type at that. Much along the lines of lbAdd, lbSetData and so on, but in this case for the context menu stuff.

nocturne bluff
#

I meant the context menus

#

Because i didn't see any script commands when i took a quick peak a week ago

austere granite
#

in 3Den they're config based and handled by engine

austere granite
#

Got some plans to make a scripted thing out of it using that control type, but I'll look at it when i can actually start the game ๐Ÿ˜„

#

They were originally posted in a dev branch changelog related to Eden iirc

humble badge
#

Ok sorry not used them , only the config eden menus.

winged thistle
#

Does 3DEN not support inserting area markers on the map or am I just not seeing it?

#

Can't find RECTANGLE or ELLIPSE

humble badge
#

click the other icon , on the right side

pliant stream
#

is anyone able to tell me why many developers seem to use z\addons\my_addon or similar for their addon directory structure, instead of for example my\addon

nocturne bluff
#

isnt it x?

#

:P

pliant stream
#

looks like it's x for cba, z for ace, just wondering why it is, is it just something someone did at some point years ago and it stuck for no good reason

#

seen it elsewhere too

lunar mountain
#

Hey guys, how can I get the pitch from an object poining to another one? It's more like a math question actually, so please try not to answer it with "use math" ๐Ÿ˜„ ๐Ÿ˜„ Basically I want to set a camera to point towards a position, and I'm kind of stuck here, because I hate vectors and stuff. edit: trigonometry, not vectors

pliant stream
#

vectors are great

lunar mountain
#

They are indeed, I just don't like working with them, because I cannot think with vectors ๐Ÿ˜„

pliant stream
#

if you want the angle of pitch from a to b you don't need vectors though

#

just trigonometry

lunar mountain
#

Good to know, thanks

pliant stream
#

ฮฑ = atan(h/x)

lunar mountain
#

Thanks. It was a long time ago. ๐Ÿ˜„

tough abyss
#

Does anyone know how to remove all of a specific object at mission start?

austere granite
#

{ deleteVehicle _x; nil } count (allMissionObjects "whatever you want")

#

In postInit or later

spare crest
#

Does anyone know of a way to use a respawn type other than BASE or GROUP that stops the mission slots from disappearing after a unit's death? I was thinking I could trick the lobby into thinking the slot still existed by somehow manipulating the lifeState value as I believe that is what determines what shows in the lobby if not running in BASE or GROUP mode.

thin pine
#

You could add a handle damage event handler, check if damage is fatal, send player to spectator screen, cancel the damage and cache the ai the player controlled until he left and someone rejoined. This won't work for anything that does setdamage like the manual kill button though

#

Your best bet is to just use one of the actual types that allows respawn and prevent the player from respawning by eg a spectator camera

meager granite
#

@spare crest You can try to recreate player unit on their join

#

Basically copy player's unit as soon as player == player, selectPlayer new unit, delete old lobby-assigned unit

#

If I understand correctly what you want

thin pine
#

Anyone familiar with displayaddeventhandler? I think it may be bugged.

#

[] spawn { (finddisplay 46) displayRemoveAllEventHandlers "KeyDown"; keyDown2 = findDisplay 46) displayAddEventHandler ["KeyDown", "true;"]; };

#

to my knowledge this code is fine. The wiki states that "Returning true in EH code will override default engine handling for keyboard events."

#

however the engine is still handling ALL of the keyboard events..

#

(I also tried it without the removealleventhandlers part, that was just to make sure it wasn't a different eventhandler friggin me over)

#

Can anyone confirm my code should work? If so I'll report it on the forums

#

derp...missing ( bracket...im retrying

#

Nvm it works..ima keep the messages here to emphasize how important it is to thoroughly re-read your code ^^

jade abyss
#

applaus

lone glade
#

Any info on the state of remoteExec atm? does whitelisting works again ?

lone glade
#

For those that wonder, yes whitelisting works now, just tested on my dedi.

#

however the wiki is wrong, remoteExec still return an empty string even when denied
12:51:06 Scripting command 'setdamage' is not allowed to be remotely executed

pliant stream
#

since i didn't get an anwer before.. is anyone able to tell me why many developers seem to use z\addons\my_addon or similar for their addon directory structure, instead of for example my\addon

lone glade
#

symlinks

pliant stream
#

hows that

lone glade
#

ACE3 for example symlink the github folder to the arma3 install and P drive

#

same for CBA

#

It's also necessary to keep that structures for the tools used.

pliant stream
#

i don't see why you couldn't make a symlink with another structure

#

also what tools are those

lone glade
#

python scripts for building a release build / test build.

pliant stream
#

ah but there's no reason those symlinks and the scripts couldn't have been made to use a different path structureยด?

lone glade
#

there's probably a different reason but I don't know it.

#

oh found the reason, it's because of cba versionning

#

then the automation scripts got written, it then kinda became a standard.

#

at least for ACE3 / CBA afaik

pliant stream
#

yeah i was just wondering if it was some arma specific thing, but then it wouldn't even really make sense since the vanilla addons are ca\addon or a3\addon

#

file patching maybe? i never used it but i guess it might require the same path structure as mods i.e. z\addons\my_addon... vs @mod\addons\my_addon.pbo

lone glade
#

it's \z\modTag\addons actually

pliant stream
#

oh that's true

#

i've seen it elsewhere as just z\addons\my_addon

lone glade
#

also, anyone knows why BIS_fnc_execVM is called when a client init?
12:50:38 Scripting function 'bis_fnc_execvm' is not allowed to be remotely executed

#

I really don't want to whitelist it, but I don't use it myself, so it's a default behavior.

#

just checked the doc, seems like initPlayerServer calls it, i'm not using it, no enabling.

jovial nebula
#

Hello guys,does anyone know the correct parameter to use with nearestTerrainObjects to detect wrecks?

cold quartz
#

Anyone know how to tell if a vehicle is an APC and not a tank? It looks like most vanilla apc's come back as true for isKindOf "car" but false for isKindOf "apc" or "tank". So I started checking if the vehicleClass was 'armored' but that doesn't seem to work reliably for mod'd content like RHS's m113. Any thoughts?

#

Eh, I guess the difference between a tank and an apc is one carries soldiers and the other doesn't so ... I'll just check the transportSoldier field and that should be good enough. If there's an easier way, let me know.

#

Good point Tyler.

vapid frigate
#

@cold quartz: I think some tanks carry troops too?

#

I think (_classname isKindOf "Wheeled_APC_F") gets most wheeled APCs. The main difference between "Tank" and "Car" seems to be tracks.

blazing zodiac
#

Does anyone know of a way to return the closest door to you?

tough abyss
#

Lecks The M2A1 and M2A1Up both carry troops.

nocturne bluff
#

The vanilla blufor tanks does as well

cold quartz
#

Yea, I figured an APC is a combination of armor and carrying enough troops to count as a 'personnel carrier' being a primary mission so I set the check to isKindOf "tank" and transportSoldier > 6 to eliminate what I saw as the false positives of the m2a1.

#

But if it's wheels vs tracks, the m113 is a tracked APC and whether it's correct or not, it reports true for isKindOf 'tank' but not 'car'.

#

Again though, if there's a better way to get >90% of it (meaning vanilla and mods) correct, I'd appreciate suggestions.

vapid frigate
#

@cold quartz to be safe, depending on what you're doing, you could have arrays of things to 'force' into categories in the settings

#

that way even if it can't be 100%, people can make it work with anything

#

and check for ((typeof vehicle) in BUS_forceToAPCs)

cold quartz
#

Yea, I might do that as well...kind of like an override of automatic behaviour.

#

Thanks!

torn thunder
#

any1 have a clue why my weapon has it's muzzleflame always visible and not only when I fire with it?

jade abyss
torn thunder
#

thanks

zealous arrow
#

Is there no way to transfer group ownerships in arma 2? That disapoints me :/

agile pumice
#

hey all, question about addPublicVariableEventHandler, will that fire when missionNamespace setvariable (global) is used?

#

I'm guessing no, but thought id double check

zealous arrow
#

It shouldn't do @agile pumice and @tough abyss Is that in response to me?

zealous arrow
#

Roger that ๐Ÿ˜ƒ

ivory nova
#

Hey o/

#

Does anyone know where I can find the full name for smoke grenades?

#

Non shell type

#

Oh, I guess they are under shell type, my bad

#

Is there any way to use attachTo to attach a smoke grenade to a heli and have it activate once called?

#

attempting to use this SmokeShellBlue attachTo [this,[0,0,0]]; while i'm in a heli via the esc debug console, but not sure if that's going to work

lone glade
#

replace this by vehicle player in the debug console.

ivory nova
#

Thank you! I will try it now

#

Hm, it didn't seem to work unfortunately, I will keep trying

lone glade
#

(the shell need to exist, spawn it then use attachTo ofc)

jade abyss
#

@ivory nova

_Bomb = "SmokeShellBlue" createVehicle [0,0,0] ;
_Bomb attachTo [(vehicle player),[0,0,0]];
indigo snow
#

("SmokeShellBlue" createVehicle [0,0,0]) attachTo [(vehicle player),[0,0,0]]; ๐Ÿ˜„

jade abyss
#

pff

#

๐Ÿ˜›

indigo snow
#

debug console dont like local vars

jade abyss
#

Hu? No Probs

#

(+ never had any)

indigo snow
#

ah

#

my bad

lone glade
#

press arrow up to edit

jade abyss
#

+Benefit of doing it with _Bomb = He can delete that thing afterwards.

lone glade
#

no need for a local var

jade abyss
#

("[] spawn{}" just for Console, to use sleep command)

[] spawn{
_Bomb = "SmokeShellBlue" createVehicle [0,0,0] ;
_Bomb attachTo [(vehicle player),[0,0,0]];
sleep 5;
deleteVehicle _Bomb;
};