#arma3_scripting

1 messages Β· Page 240 of 1

shadow sail
#

and if I wanted multiple objects the array would simply be "tag_object","tag_object"

#

private _objects = _unit getVariable ["atag_forthis","atag_forthat" []];

#

yes?

#

or "atag_forthis, atag_forthat"

little eagle
#

no, "atag_forthis" is an array

#

atag_forthis = [obj1, obj2, ... objN];

shadow sail
#

ohhh okay

little eagle
#

you can add to the array with pushBack, but you have to always synch the variable with setVariable public again

shadow sail
#

so I can just "thearray" as "thearray"

little eagle
#

yes

shadow sail
#

leave it*

#

thanks

#

I'm having issues and it's because I don't understand what's happening here: private _objects = _unit getVariable ["thearray", []];

#

I understand that you're making _objects local then getting a variable from a Unit, but if I just leave "thearray" as is how does it know which variable to get?

#

is it getting all variables?

#

and putting them in to "thearray"?

little eagle
#

how does it know which variable to get?

#

there is only one variable named "thearray"

shadow sail
#

so do I put the varibles I set in place of "thearray" or leave it like you said before? I don't understand

#

variables*

little eagle
#

"thearray" is the array that contains all those objects you want to delete

#

[obj1, obj2, ... objN]

shadow sail
#

I understand that

#

im asking how that array gets filled

little eagle
#

private _array = player getVariable ["array", []];

#

_array pushBack _object;

#

player setVariable ["array", _array, true];

#

It's verbose, but that is SQF for you

shadow sail
#

oh so your example wasn't a copy paste, my apologies, I assumed it worked out of the box so to speak to handle this

#

alright so im even more lost now

little eagle
#

No, you have to think for your self too.

shadow sail
#

Clearly.

little eagle
#

I don't test any of this

#

So there could be mistakes

shadow sail
#

Yea, none of this is working. I'll try it again later.

agile pumice
#

can someone tell me how I can replicate the arsenal camera?

#

with a controllable rotation and zoom?

fallen locust
#

MouseMoving + MouseButtonDown + MouseButtonUp across a control that spans the whole screen

agile pumice
#

So there isn't a function already that creates it?

fallen locust
#

Not that im aware of

native hemlock
#

You should be able to check in the arsenal script

agile pumice
#

stripping it down now

#

3076 lines to 330 lines lol

shadow sail
#

Are there any repo sites aside from github/bitbucket/playwithsix that regularly host arma code that I can look through? Just out of curiosity.

jade abyss
lone glade
#

want some code examples ?

shadow sail
#

That would be nice, alganthe.

lone glade
#

If you want an example of what NOT to do check the MCC repo

shadow sail
#

lol thanks πŸ˜ƒ

zealous solstice
shadow sail
#

thanks ;p

austere granite
#

Shameless self plugs are the best plugs

vagrant badge
#

can turn off the rock symbol - player slowdown if climbing on hills ?

shadow sail
#

Using an example off of the forums, does this look legitimate for saving score data to the client machine?

profileNameSpace setVariable ["nt_score", _score];
saveProfileNamespace;```
That would ideally go in onPlayerRespawn.sqf right? And then this next part in initPlayerLocal
```if (isDedicated) exitWith {};
waitUntil {!(isNull player)};
_score = profileNameSpace getVariable ["nt_score", 0];
player addScore _score;```
#

Is there anything glaringly wrong with that code?

lone glade
#

looks fine

#

saveProfileNamespace isn't necessary tho, it's done even if you alt F4 anyways

vagrant badge
#

@shadow sail if i know SQL i say you but i dont know this crazy language πŸ˜› i too old to learn SQL

shadow sail
#

oh saveProfileNamespace is automatic then?

#

fancy

#

im aware how dumb it is to store anything client side but since its a coop mission im not too concerned

#

Thanks for the input, @lone glade

shadow sail
#

to have an either in a condition for an if statement can I do

#

if (blah || blah)

lone glade
#

if (BOOL || {BOOL})

shadow sail
#

what about or?

#

if (BOOL or BOOL)?

#

i.e. if either condition is satisfied proceed

lone glade
#

woops

#

didn't looked when I typed :p

#

fixed

shadow sail
#

πŸ˜›

#

thank you!

shadow sail
#

hmm profilenamespace doesnt persist after server restart?

lone glade
#

it does

#

since, you know, info is stored on player

shadow sail
#

right, my bad, forgot the isServer check

#

hmm

#

in onPlayerRespawn.qf I have:

if (!isServer) then
{
profileNameSpace setVariable ["nt_score", _score];
};```
and in InitPlayerLocal I have:
```waitUntil {!(isNull player)};
_score = profileNameSpace getVariable ["nt_score", 0];
player addScore _score;```
#

yet it doesnt seem to work, no RPT errors, no script errors showing

#

thoughts?

#

do I need to be putting these elsewhere?

zealous solstice
#

you need to save the profileNamespace

shadow sail
#

oh I thought it did it automatically, okay

#

so I just need to add save profileNameSpace;

zealous solstice
shadow sail
#

ah ha

#

hmm still nothing

#
if (!isServer) then
{
profileNameSpace setVariable ["nt_score", _score];
saveProfileNamespace;
};
#

this is on a dedi

lone glade
#

the profileNamespace is saved when the game is quitted

#

saving it is useless

shadow sail
#

with or without that it doesn't seem to work unfortunately

#

but that's alright

#

gonna look at Arma2Net since I need to get other forms of persistence up eventually

#

Thank you all for your help πŸ˜ƒ

dusk sage
#

give up with extDB?

shadow sail
#

I managed to get extDB3 up and running, but i know so little about how to interface with it I decided to look at other options, still havent decided

#

OO-PDW with inidb might be an option

#

I think extDB3 will be a long term goal

dusk sage
#

extDB3 is playing up at the moment

#

For me at least

#

Try using extDB2 v71

shadow sail
#

Well, in ideal world I would know how to actually utilize it, that's the part I am stuck on. Every DB or persistence mod seems to require understanding the calls that are native to each mod

#

I can get it installed but I don't know the first thing about passing a player score to the DB and returning it on server load.

#

So that might just not be an option for my machine

dusk sage
#

This has examples in SQF

shadow sail
#

Yea, that's somewhat of a help.. I still am not sure how to even begin. I'll stare at this stuff some more I guess.

vagrant badge
#

how to remove FOG ?

native hemlock
prime valve
#

@shadow sail summon @tough abyss

shadow sail
#

No worries.

tough abyss
#

@shadow sail extDB2/3 is more aimed low level.
You decide the database scheme & querys to run to store/fetch the data.
extDB just plays dumb and acts a middle person.

If you are completely confused about SQL & Databases..
Check out the following, they are both alot easier to implement

https://forums.bistudio.com/topic/173743-stats-server-and-client-api-with-support-for-sql-and-nosql-databases/
or
https://forums.bistudio.com/topic/186131-inidbi2-save-and-load-data-to-the-server-or-your-local-computer-without-databases/?hl=inidb

Bohemia Interactive Forums

Page 1 of 2 - Stats Server and Client API with support for SQL, and NoSQL databases - posted in ARMA 3 - COMMUNITY MADE UTILITIES: What is this ?Β [/HR]It's a stats/persistence system for Linux or Windows Arma 3 dedicated server. The following database/storage systems are supported: MongoDB CouchDB Cassandra MySQL Redis File-System (if you don't have a database)At its core, the stats server exposes a key-value store that has this kind of structure:
{ player1_id : { name: pl...

Bohemia Interactive Forums

Page 1 of 6 - iniDBI2 - Save and Load data to the server or your local computer without databases! - posted in ARMA 3 - ADDONS & MODS: COMPLETE: INIDBI2 Lastest Version : 2.05Β  by Code34Β Direct Download from DropboxDirect Download from ArmaholicLike to Donate ? Donate with paypalΒ inidbi2 is a rebuild from scratch of inidbi project with C# and SQF++ for windows client/serverΒ Major improvements:New architecture oriented object supportimprove differents methodsprelo...

shadow sail
#

Thanks πŸ˜ƒ

stiff juniper
#

Hello
I made an addon that contains a file with lots of #define xxx (file path myaddon\macros_include.macro)
and in the mission description.ext I have #include "\myaddon\macros_include.macro"
this works when I am hosting the server and trying the mission
but a dedicated server crashes with "Include file myaddon\macros_include.macro not found."
I did some reasearch and couldn't find the cause
the only solution I found so far is to add a userconfig folder on the dedicated server
and modify the description.ext in the mission #include "\userconfig\myaddon\macros_include.macro"
Anyone has a better solution ? Is the userconfig trick the only solution to include files from addons ?
I would like to avoid having users manually create this folder since I want them to get updates automatically through the Workshop

tame portal
#

You cannot include something inside description ext if the mod is only accessible for either the server or the client

#

as it will be executed on both and one of the two parties will crash

#

In this case the mod is not being loaded by the server

stiff juniper
#

the mod folder is installed on both server and client

#

what is strange is that there is no crash when I create hosted server and list the mission
but there is a crash when i connect to dedicated server (that has the mod folder too) and i use #missions

tame portal
#

Is the server loading the mod?

stiff juniper
#

i checke the logs it does

#

21:53:19 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
21:53:19 Zengin | @ZDB_Zengin | false | GAME DIR | 02452a06b59e30067d8c46763f04be9d16a2fef4 | 7fac2533 | D:\docs_big\arma3_ded_serv@ZDB_Zengin
21:53:19 Arma 3 DLC Bundle | dlcbundle | true | NOT FOUND | | |
21:53:19 Arma 3 Marksmen | mark | true | GAME DIR | 8a8bc2a7d7ad8251bcc82f29aea6d3f34ebffb3d | 1c11a244 | D:\docs_big\arma3_ded_serv\mark
21:53:19 Arma 3 Helicopters | heli | true | GAME DIR | 1614a75b4d3cceb5d296ca4101a589fba596aa5e | 9a800f11 | D:\docs_big\arma3_ded_serv\heli
21:53:19 Arma 3 Karts | kart | true | GAME DIR | 41f70c200a668f39e52eedf55e0c6f494aef1903 | c9867676 | D:\docs_big\arma3_ded_serv\kart
21:53:19 Arma 3 Zeus | curator | true | GAME DIR | fb1eec1e78a39cd021a71a293ae4ae1e00c98686 | 44f886e | D:\docs_big\arma3_ded_serv\curator
21:53:19 Arma 3 | A3 | true | NOT FOUND | | |
21:53:19 ==========================================================================================================================================================================================================

#

the addon is called Zengin

#

I can send you the mission and addon if you want to check it out

#

both are less than 3 MB

#

I just made another test and it looks like the issue comes from indirect include

#

CRASHES DEDICATED SERVER (indirect include)

  • description.ext (#include "macros\toto.ext")
  • toto.ext (#include "\myaddon\macros\blabla.ext")

DOES NOT CRASH DEDICATED SERVER (direct include)

  • description.ext (#include "\myaddon\macros\blabla.ext")
vapid frigate
#

@stiff juniper: looks like the path to the mod is messed up? D:\docs_big\arma3_ded_serv@ZDB_Zengin

#

missing a \

runic spoke
#

found in (773,615).
Client: Remote object 3:0 not found
"ETSERVER: OWNER:<null>:"
"ETSERVER: PLAYER OBJECT:any:"
"ETSERVER: PLAYER CLASS:any:"
"ETSERVER: PLAYER TEAM:any:"

#

Anyone have any idea why arma is giving me a null 'Owner' id?

agile pumice
#

who's all around this time a day/night?

runic spoke
#

o/

agile pumice
#

where you at in the world stokes?

runic spoke
#

Murica

agile pumice
#

east coast?

runic spoke
#

Yep

agile pumice
#

I hope you enjoy scripting arma at 3:30 am as much as I do

runic spoke
#

I would if arma would actually be nice to me

agile pumice
#

put it in its place :<

runic spoke
#

You seen the error i got right? lol

agile pumice
#

i briefly looked over it, have no idea

runic spoke
#

I could send you some of my code to see if you can work it out lol

agile pumice
#

im really not your man for owner stuff lol

runic spoke
#

it's just onPlayerDisconnected, or i should say HandleDisconnect

agile pumice
#

maybe it cant fetch the data in time

runic spoke
#

addMissionEventHandler ['HandleDisconnect', { _this call ETServer_OnPlayerDisconnected; }];

#

_owner = _this select 4;

agile pumice
#

and its reporting null, eh?

runic spoke
#

Yep

agile pumice
#

are you sure the object that's reporting null is you

#

and not the headless client or something stupid? (I'm taking shots in the dark here)

runic spoke
#

_owner = _this select 4;
diag_log format ['ETSERVER: OWNER:%1:',_owner];
_player = _owner call ETServer_Utility_GetPlayerObjFromOwner;
diag_log format ['ETSERVER: PLAYER OBJECT:%1:',_player];
_class = _player getVariable ['ETClient_Player_Class', ''];
diag_log format ['ETSERVER: PLAYER CLASS:%1:',_class];
_team = _player getVariable ['ETClient_Player_Team', ''];
diag_log format ['ETSERVER: PLAYER TEAM:%1:',_team];

#

RPT:

#

2:09:34 found in (773,615).
2:09:52 Client: Remote object 3:0 not found
2:09:52 "ETSERVER: OWNER:<null>:"
2:09:52 "ETSERVER: PLAYER OBJECT:any:"
2:09:52 "ETSERVER: PLAYER CLASS:any:"
2:09:52 "ETSERVER: PLAYER TEAM:any:"

agile pumice
#

is this recent behavior?

runic spoke
#

yep

agile pumice
#

so you think the update broke it then?

runic spoke
#

worked even before the update.

#

after*

agile pumice
#

hmm

#

i dunno dude, your wasting your time asking me haha

runic spoke
#

what kind of stuff do you work on?

agile pumice
#

life type stuff

runic spoke
#

specifically ?

agile pumice
#

not really sure how to give specifics

#

I'm working on terrain object harvesting atm

#

if that counts

#

kinda experimenting with diff methods

#

I had it drop 4 logs when you chop the tree and made you able to carry/load them with ace

runic spoke
#

specifc would be like, 'code, gui, map, assets, etc..'

agile pumice
#

little bit of everything really

#

I'm helping with the australia map

#

i mostly do code

#

Im not really a gfx artist or modeller

#

got somewhat good with manipulating already made objects in object builder

#

most of my object builder experience has been with buildings and stuff ported from other games

#

I did some cars back in A2

#

Havnt had much like with A3

#

I did most of the work on the Sydney Opera House (aside from actually modelling the thing) but I had to clean up a lot of bad geometry

runic spoke
#

cool

#

I'm kinda new to arma scripting, but i can get the job done, it's just errors like what i have there i have no clue... lol

agile pumice
#

id be stumped too

#

nothing to be ashamed of

#

its shit like that that makes me want to quit

#

If I could trade the time I've put into learning a3 modding (3-4 years) for experience with Unity, I would

runic spoke
#

That's the only thing that sucks in the monring, is people that know what they are doing isint on 😭

#

go to unreal engine πŸ˜›

agile pumice
#

nah, ive done my "shopping"

#

I like unity

runic spoke
#

but blueprints πŸ˜›

agile pumice
#

thats what 3dsmax is for

#

lol

agile pumice
#

anyway, off to bed with me, goodluck with your issue

runic spoke
#

i fixed it ;P

jade abyss
#

Tweaked: The addAction command’s functionality was extended (WIP)
Anybody knows, what's been added?

jovial nebula
#

Hi guys, i'm trying to switch a doorphase on a Land_Garage_V1_F using BIS_fnc_DoorClose

I took the statement from the config viewer but no way to have it working

Anyone has a workaround?

tame portal
#

I guess theres no BIS function for 3d text on the fly?

#

Like having an actual object with text on it

#

but only the text is visible. hnn

prime valve
#

3d marker ?

queen cargo
#

@tame portal what do you mean exactly ... there is the draw3d mission EH where you simply can render the text then inside

tame portal
#

Like uhm

#

Wait let me post what I mean

queen cargo
#

example use to show playernames & ranks:

    _x = cursorTarget;
    if(isNull _x) exitWith {};
    if(_x distance player > 100) exitWith {};
    if(side _x == playerSide) then
    {
        _dst = (cursorTarget distance player);
        _size = 1 - (_dst / 100);
        _pos = position _x;
        _pos set[2, (_pos select 2) + 2.25];
        if(_dst < 50) then
        {
            drawIcon3D [format["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _x], [1,1,1,1], _pos, abs sin (time * 100) * _size, _size, 0, name _x, 0, 0.1 * (_size * 0.5), "PuristaSemibold"];
        }
        else
        {
            drawIcon3D [format["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _x], [1,1,1,1], _pos, abs sin (time * 100) * _size, _size, 0, "", 0, 0, "PuristaSemibold"];
        };
    };
    false
}];```
tame portal
#

But drawIcon3D cannot be hidden behind an object right?

#

But I guess its not possible without actually creating an object and giving it a texture

peak epoch
#

is it possible to create area markers with create3DENEntity? i havent managed to figure it out

queen cargo
#

thats possible @tame portal ... but not as simple as this lil call

#

simplest way is creating an object ...

#

hard way would be creating the objects as UI ...

#

i recommend you to just forget about that completly πŸ˜ƒ

tame portal
#

meeeeeh

#

back to simple on screen texts with the texttiles function

jade abyss
#

ooohh mmmyyyy

tame portal
#

what happened dscha

jade abyss
#

ooohhh mmmyyyy happend

lone glade
#

he saw today's dev branch changelog I guess πŸ˜›

jade abyss
#

Nah, i have seen "oohh mmmyyyy" - Ask @queen cargo πŸ˜„

#

He has seen it too

tame portal
#

Wat

#

I only know that sexy voice "Ohh myy" sound effect

#

OKAY

#

Whatever you do

#

DO NOT ASK DSCHA what "Ohh myy" means

queen cargo
#

well @tame portal ... you had to check it dont you?

jade abyss
#

he did.

stiff juniper
#

quick question: is it normal that a dedicated server crashes when a pbo packed mission includes Γ  file from an addon (#include "\myaddon\abc.hpp")
and the dedicated server does NOT crash when the same mission is not packed in pbo
?
are there any problems leaving a mission as folder (not packed as pbo) in mpmissions folder on a dedicated server?

sterile ravine
#

maybe you missed the filepatching parameter in the launch paramters of the dedi server. therefore the server can't locate the .hpp outside the pbo and crashes

bronze trellis
#

any idea why "classname hideObject true;" doesn't work in the editor?

dusk sage
#

it takes the form object hideObject boolean

#

So using a classname (which for a start is a string, and also not pointing to any object), wont work

bronze trellis
#

ah ok, so how would i hide all objects of the same type?

dusk sage
#

loop through all map objects with the certain classname

bronze trellis
#

how do i see the object name or do i have to set a name for each when i loop through all objects ?

torn juniper
#

What are you trying to do?

#

Just hide one type or multiple?

prime valve
#

On the init of the object, use this hideObject true;

#

or else declare the objects within a variable

#

for multiplayer, better to use hideObjectGlobal

bronze trellis
#

sorry guys was afk, I want to hide several of the same object

vagrant badge
#

why this dont work:

#

// The above array was built using the following code snippet called from the mission editor debug console:
/*
_atms = [];
{
if ((str x) find ": atm" != -1) then
{
_pos = _x modelToWorld [0,0,0];
if (surfaceIsWater _pos) then
{
_pos = _pos vectorAdd ((getPosASL _x) vectorDiff (getPosASLW _x));
};
_atms pushBack _pos;
};
} forEach nearestObjects [player, [], 999999];

copyToClipboard str _atms;
*/

#

after use code atms=... nothing in clipboard

little eagle
#

because it is commented out?

#

/* comment that is removed by preprocessor */

torn juniper
#

That would be my guess

vagrant badge
#

i use

#

atms = [];
{
if ((str _x) find ": atm" != -1) then
{
_pos = _x modelToWorld [0,0,0];
if (surfaceIsWater _pos) then
{
_pos = _pos vectorAdd ((getPosASL _x) vectorDiff (getPosASLW _x));
};
_atms pushBack _pos;
};
} forEach nearestObjects [player, [], 999999];

copyToClipboard str _atms;

torn juniper
#

Isnt it array find "blah" ?

vagrant badge
#

dont work on tanoa who know how to edit this for tanoa ?

torn juniper
#

Either way use systemchat to output if its found or not so you can see if it works while running

#

And the code wouldnt change depending on the map, you have nothing that requires a map there?

vagrant badge
#

on altis work but dont work on tanoa

torn juniper
#

Probably because there is nothing with :atm in the name?

vagrant badge
#

in SQL can use * for all syntax ?

#

maybe i must add atm

#
  • atm *
vagrant badge
#

WTF no ATM-s on tanoa

dusk sage
#

That sounds like your issue

#

πŸ‘

torn juniper
#

Thats exactly what I said lol

agile pumice
#

where can I find a list of dik codes to use for keydown/key up handler?

native hemlock
#

You probably don't need to look at the bisimulations one

earnest valve
#

BIS' site isn't bad. I still use the site today (bad habits :P )

agile pumice
#

thanks

#

I got tired of looking and wrote a handler to tell me what key i press lol

jagged halo
#

i need a script to put an AI into a players group from scroll wheel. How could i do this?

#

Like a player would be able to walk up and get make him recruitable. Preferabily not using MCC.

agile pumice
#

have you done addaction before?

runic spoke
#

Hi eagledude4 o/

agile pumice
#

this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player)'];
the addaction would go in the unit's init

#

heya stokes

jagged halo
#

oh awesome

#

and if i wanted to limit it to a select group of players what would i do

#

say they were named S1,S2,S3,S4

agile pumice
#

_x addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player)'];

jagged halo
#

haha ok

#

ill try to figure it out

agile pumice
jagged halo
#

ok cool

agile pumice
#

take a crack at it and ill tell ya if you did it wrong

jagged halo
#

so how do i establish an array

#

nvm found wiki

agile pumice
#

this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player) && player in [s1,s2,s3,s4,s5]'];

jagged halo
#

okay thank you. Whats a good resource to learn scripting if you dont mind me asking?

jagged halo
#

thanks man i apreciate it

#

hmm, thats script goes in init right? Does not seem to be working.

agile pumice
#

the foreach loop script would not go in the unit's init

#

it would go in init.sqf. or alternatively, have this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player)']; in each unit's init

jagged halo
#

ah ok

#

so how would i assign it to the unit that i wanted recruitable?

#

So i have like 5 units that i want recruitable and say i only want players s1,s2,s3,s4 to be able to recruit those units.

agile pumice
#

oooooooooooh

#

i understand now

jagged halo
#

yeah i think i explained it badly

#

haha

agile pumice
#

this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player) && player in [s1,s2,s3,s4,s5]'];

jagged halo
#

awesome!

#

wiocked that worked

#

thank you very much

agile pumice
#

np

placid root
#

[ (getPos this select 0) + ((-17.502) * cos (-getDir this) - (-17.920) * sin (-getDir this)), (getPos this select 1) + ((-17.502) * sin (-getDir this) + (-17.920) * cos (-getDir this)), 1 ] hey guys do you know if i have calculated it right? is is a vector from the position of a building pointing at a certain point of the building. it is calculated depending on the roataion of the building

#

the position i usually get is always a bit of. i got the values from placing a building at [0,0,0] and getting my reference by another object's position places at the desired point.

#

so building @ [0,0,0] and the position of the reference object @ [-17.502,-17.920,1] ( the vector points to a door is want to attach a useraction to)

#

orientation = 0Β°

jade abyss
#

wasn't there a bis_fnc_getVector (or something similar)?

placid root
#

well i need a vector and it has to bo rotated if the orientation of the building is not 0

#

there is a bis_fnc by kilzonekid but it should look the same

jade abyss
placid root
#

and `[[123,123],getDir this] call Bis_fnc_rotate2D select 0 does not look nice ^^

#

i do not have a fix memorypoint

jade abyss
#

(haven't rly read the function :P)

#

why memorypoint?

placid root
#

so i have nothing to go to.

jade abyss
#

Okay, another Q: What do you want to achieve?

placid root
#

it is a useraction condition. so if the player is next to a door of a building the condition ios met

#

the problem is that the dor has no memorypoint

jade abyss
#

lineInterSectsWith

#

then check from the Geo the "door_*"

placid root
#

there is no "real" door. it is just texture

jade abyss
#

oO

#

confused

placid root
#

it is a closed building. i wanted to do the teleport to roof script someone released on the forum to work without triggers

jade abyss
#

I currently think about the door script

#

ah, yeah

#

modelToWorld

#

with pre-cached Coords

#

+distanceCheck

agile pumice
#

sorta like this

#

player addAction ["Access ATM",life_fnc_atmMenu,"",0,false,false,"",' _CL = (nearestObjects [player, ["Land_Centrelink"], 20]) select 0; _modelPos = [5.53125,-11.1084,-0.881197]; (life_role == "civ") && (player distance (_CL modelToWorld _modelPos)) < 2 '];

jade abyss
#

For example

placid root
#

[ (getPos this select 0) + ((-12.385) * cos (-getDir this) - (-17.991) * sin (-getDir this)), (getPos this select 1) + ((-12.385) * sin (-getDir this) + (-17.991) * cos (-getDir this)), 7.4 ] distance getPos player <= 8

#

this is my actuial condition

jade abyss
#

Its "overcomplicated"

#

Go with the modelToWorld thing, easier and less heavy πŸ˜›

placid root
#

this should work with all buildings of this type anywhere and with any rotion

agile pumice
#

Dscha, is my example what he's looking for?

placid root
#

but i will look into modeltoworld

jade abyss
#

I think so @agile pumice

#

I mean, thats how i would do it. Easier & faster πŸ˜›

agile pumice
#

you can get the modelposition using (getpos building) vectorFromTo (getpos player)

jade abyss
#

oO

#

worldToModel + modelToWorld πŸ˜›

placid root
#

modeltowirld sounds nice. it uses the some mechanics as attachto doesn't it?

jade abyss
#

combined with cursorObject

#

yes and no

#

The array looks almost the same

#

or wait, yeah.

placid root
#

well something attached to an object rotated with the object

jade abyss
#

Yep

placid root
#

ok

jade abyss
#

No need to Dir/Vector/etc

lone glade
#

beware modelToWorld is in posAGL

jade abyss
#

If you use worldToModel from the player + get the modelToWorld from the cursorObject -> nothing to think about πŸ˜›

placid root
#

z will always be 1

jade abyss
#

No

lone glade
#

nope

jade abyss
#

Since the center of the mtw obj. is always different

#

Just play around a bit, its pretty easy

placid root
#

ok thx for the tip

jade abyss
#
  1. get the WTM.Pos of the Player related to the cursorObject MTW
  2. check the Dist
  3. magic happens
#

(brain is not rly awake yet, wtm and mtw could be switched :P)

placid root
#

πŸ˜ƒ

jade abyss
#

+my name is spelled: "Dscha", not Dascha πŸ˜„

#

j/k

tame portal
#

Daschar

vagrant badge
#

Land_Centrelink - australian map πŸ˜›

muted tapir
#

Is it possible to create the name of a variable out of two things (something like this "xyz" , _target = ...)

vapid frigate
#

not sure if you can with private variables, but with namespace variables you can (if i understand correctly)

#

ie missionNamespace setvariable [format['target%1', "xyz"], ... ];

muted tapir
#

Yea that works. Thanks!

pliant shell
#

how can i check if the player is copilot in a vehicle?

lone glade
#

oh I have something for that

pliant shell
#

i always assumed checking for gunner would be ok but apparently it's not

lone glade
#

You're fine with CBA functions ?

pliant shell
#

i need that as condition in a useraction

#

yes its ok

lone glade
#

If you have ACE3 in your mod pack there's a function for that

pliant shell
#

nuh, it's for cup, CBA is ok but ACE is not πŸ˜›

lone glade
#

then gimme a sec for copying the code

#
private _coPilotTurret = [_vehicle] call {

            params [["_vehicle", objNull, [objNull]]];

            fullCrew [_vehicle, "turret", true] apply {_x select 3} select {
                getNumber ([_vehicle, _x] call CBA_fnc_getTurret >> "isCopilot") == 1
            } param [0, []]
};
#

calling _coPilotTurret will return the turret which is the copilot seat

#

(ported cba func so I use a different tag for it)

pliant shell
#

i see

#

it's weird though that the game doesnt recognize the copilot as gunner 😦

#

since he technically is a gunner

lone glade
little eagle
#

copilots are always "turret gunners"

#

But the gunner command is only about the "primary gunner"

#

"primary gunners" cannot be copilots

pliant shell
#

oh that explains it

#

thanks

lavish ocean
#
Bohemia Interactive Forums

AI Driving - Feedback topic - posted in ARMA 3 - DEVELOPMENT BRANCH: They told me to explain what is new AI driving and how it works. Weve been working on it for many months, in almost complete secrecy (excluding occasional Oukej talking about vacuum cleaners).
It is mandatory to mention, that it is still Work In Progress, has few bugs I know and many which I dont know about yet. Also, currently this new AI driving works only for wheeled vehicles, otherwise known as Cars.
Now let me try to...

lone glade
pliant shell
#

is this going to be in 1.62 @lavish ocean ?

lavish ocean
#

it's not announcement, just for those who want give feedback

pliant shell
#

ok, thanks

shadow sail
#

I'm trying to use _assignedItems = assignedItems player; and keep getting an undefined variable. This is part of a modified Quiksilver restrictions.sqf called in init.sqf. I'm not sure why this is happening?

lone glade
#

because it's called in init.sqf .......

#

use initPlayerLocal for that stuff

shadow sail
#

its a while {true}

#

for multiple restrictions

lone glade
#

............

shadow sail
#

hey I didnt write it

#

dont yell at me lol

lone glade
#

Your players obtain their gear via arsenal ?

shadow sail
#

yea

lone glade
#

no VAS right ?

shadow sail
#

correct

shadow sapphire
#

Today, I am trying to make a radio trigger that, on activation, will change the loadout of players already in a mission. I tried the simple approach of just having the radio trigger run a loadout.sqf, but it did nothing.

shadow sapphire
#

I want a trigger area that will regear players as they enter the trigger zone.

shadow sail
#

Is there a more effective way to offload ownership to an HC than:

waitUntil {!isNil "HC"};
 ["HCS_addToHC", "onEachFrame", {
    if (isNil "HC") ExitWith{};
        _HC = owner "HC"; //"HC" denotes the name of the unit in-game
    {
        if ((!isPlayer _x)||(!( _x in units group _HC ))) then {
         _x setGroupOwner _HC;  //adding all units that aren't player or aren't already under HC to HC
         };
    } forEach allUnits;
}] call BIS_fnc_addStackedEventHandler;```?
#

That was a script from reddit but anytime a majority of AI on the mission are aware of one unit my server FPS just shits the bed

#

No RPT errors aside from "Destroy waypoint not linked to a target: Near target acquisition is slow and may even select friendly unit."

indigo snow
#

arma doesnt like setGroupOwnering AI too much, since it wont switch over stuff like their danger.fsm

#

best bet will always be to just create those AIs on the HC

shadow sail
#

ah okay

shadow sapphire
#

Is there a fairly easy way to have one group create waypoints, then another group basically copy that same waypiont a few seconds later? I'm trying to create an AI platoon that moves like a real platoon, with fire teams in wedges, squads in column, platoon in column, but without having to mod formations. Preferably, if it could use BIS_fnc_taskPatrol, that'd be awesome. I could have a scripted platoon spawn and conduct a platoon size patrol.

jovial nebula
#

Hi guys,is there a clean way to terminate the whole script and not the current scope?

tame portal
#

terminate

tough moth
#

Any super scripting Gurus know of a way to make the actual in-game map stream to a settexture? Had an idea to have the map, with all current mission markers and drawn lines displayed on a briefing screen. Is this possible? I've done it before with UAV streams, but never tried a map. Any help, or suggestions appreciated!

night void
#

Hello Lords! help us please a bit, tell me how to simulate kills player Xkilled by player Z? I heared varinat with create bullet and set owner?!

jovial nebula
#

@tame portal , what about doing it inside the script to be terminated?

tough moth
#

@night void Maybe make a simple trigger, name the unit a specific name like "man1" and use setDamage 9;

#

@night void Unless you are trying to do it in a script, or more complex event

tough abyss
#

if (X) exitWith {player sideChat "F**k it"};

night void
#

no no

#

i need to simulate real kill

#

likes unit was killed by bullet from rifle

tough moth
#

Oh, you want side chat to pull up Player InsertName killed PlayerNoName?

night void
#

or smashed by car πŸ˜ƒ

#

what about create bullet, set owner and throw it to target head?

tough moth
#

or make car explode.

night void
#

i need owner! for count points, traitor side, etc...

tough moth
#

not sure on that one. sorry! You'll no doubt have to use set owner

night void
#

how to make the game thing one player killed another on command?

night void
#

Damn! Im setting reward on that shit! who solve it i will pay!

little eagle
#

how to make the game thing one player killed another on command?
you can't

#

there is no API for that

shadow sapphire
#

If I was setting a waypoing like this:

_wp1A = _Group1A addWaypoint [getpos leader _Group16, 0];

But I wanted the waypoint to be exactly twenty meters west of leader _Group16. How would I do that?

little eagle
#

(getpos leader _Group16) vectorAdd [0,20,0]

#

I think y+ is west. not sure though

tough moth
#

Anyone know of a way to lock ammo boxes? I don't want players to be able to access the inventory of the boxes.

little eagle
#

yes

#

player addEventHandler ["InventoryOpened", {

#
unit: Object - Object the event handler is assigned to
container: Object - connected container or weaponholder
#

use setVariable, getVariable on the ammo box

#

do your checks

#

and then return true with the event

#

That will abort / overwrite the box opening

tough moth
#

Okay, and what about changing the color of an add action?

this addaction ["Remove All Weapons","removeall.sqf"];

Want to make that blue or something

little eagle
#

I don't think that is currently possible

#

Oh, wait

tough moth
#

I know it is, I have done it before

little eagle
#

let's see

tough moth
#

just cant remmber how hehe

little eagle
#

first argument on the right side of addAction:

title:
String - The action name which is displayed in the action menu, may contain XML like syntax. Because of that < and > symbols will be interpreted as opening and closing XML tags. To avoid this use &lt; for < and &gt; for >. The title text can be changed with setUserActionText
tough moth
#

there is a way to do it all literally in the init.

#

this addaction ["Remove All Weapons","removeall.sqf"];

#
  • color ref
solar geode
#

"<t color='#00FF00'>Remove All Weapons</t>"

tough moth
#

<------ not the best with scripting. How can that be correctly added to the command I am using?

little eagle
#

you replace your title with the one with "xml" tags from sniperwolf

tough moth
#

yes, but it needs to execute the sqf

solar geode
#

this addaction ["<t color='#00FF00'>Remove All Weapons</t>","removeall.sqf"];

tough moth
#

^^ Thank you very much for the help guys. Appreciate it

little eagle
#

wow, the spoon feeding

tough moth
#

Well, this channel is for help from others is it not?

#

Asked a simple question, got an answer. No need to get snarky

little eagle
#

sure, but you could've replaced that title too. I believed in you T_T

tough moth
#

πŸ‘

solar geode
#

It's more of a "Give a man a fish / teach a man to fish" kinda thing. πŸ˜‰

tough moth
#

Understandable. Outside of very simply init lines, I am total noob at scripting. Mission creation, community development, and storyboarding is more my thing. Trying to learn more advanced topics, hence why I sometimes need a push in the right direction, or examples to go off of. Regardless, thank you guys for the help!

little eagle
#

yw

lean tiger
#

Perhaps it wasn't meant to be -- but I can't figure a way that a client-local action can trigger a serverside ExecVM ?

#

unless I just have a massive waitUntil processing a stack of formatted garbage

#

pushed over publicVariable*

vapid frigate
#

@lean tiger would this work?
[[],"your.sqf"] remoteExec ["execVM", [0, -2] select isMultiplayer];

#

(last param is just to make it work single player as well)

vapid frigate
#

if not, could make a function to do it easily enough

hallow spear
#

does eventhandler "EpeContact" not work on a player unit?

native hemlock
#

Probably not because players don't use physX

hallow spear
#

bum crum. ok thanks

jovial nebula
#

Guys does anoyone have a good indenter?

#

I'm trying to useTm_4 one,but often is crashing

night void
#

@little eagle DeathlyRage did it in Breaking Point, when u guting enemy. Or any way to simulate roadkill?

#

@signal flume it looks like php and c++ πŸ˜‰ she is so far to html πŸ˜‰

little eagle
#

pardon?

#

Oh

#

No, @night void you absolutely CAN NOT set the killer of the killed event handler via SQF

night void
#

EventHandler ?

little eagle
#

what you can do is disable the vanilla message and make one via systemChat yourself

night void
#

or any some hackz?

little eagle
#

"hackz" ?

night void
#

can i create car, then make player getIn inside it and then smash target, but not mount attacker inside it?

#

likes roadkill by empty vehicle but with owner (BF4 style)

little eagle
#

Sorry, I don't understand you

#

what is "BF4 style" ?

#

battle field 4 ?

#

I thought 3 was the last one

#

I never played that

lone glade
#

not possible in arma anyways, getting out of a moving vehicle is a surefire way to die

little eagle
#

Like that mission in GTA 2, where you have to kill that one dude by racing a car over pier?

#

You jump out just before you let the car fly into the water

night void
#

mean SENSE!

#

if was a driver of vehicles in BF nad jumped out from it and then vehicles smash enemy, u got points

little eagle
#

sure

#

but that is not how arma operates

#

GL detecting in a killed event that you were overrun by a car

night void
#

how it works in Battle Royale?

#

they have message Player X smashed Player Y + chat kill message on my native language!

little eagle
#

via systemChat

night void
#

on my native language,!

#

?!?!

little eagle
#

systemChat format [localize "STR_blah_message", name _killed, name _killer];

night void
#

Ρ…ΠΌΠΌ, ΠΎΠΊΠ΅

#

and how they get info about friendly fire?

#

its handeling on game side

#

did u played BR?

little eagle
#

idk, there are many ways

#

did u played BR?
no

night void
#

thats it πŸ˜ƒ

#

o!

#

can i make fake weapon, then give it to hands of ataker, and shoot to target?

#

i can make it in config

little eagle
#

probably not

night void
#

Oo ?!

little eagle
#

you don't actually use the killed event handler for messages like these

#

it's most likely done some other way

night void
#

"
//_current = currentWeapon player;
// player addWeapon "MOCAP_FakeWeapon";
// player selectWeapon "MOCAP_FakeWeapon"; player switchMove "";
// player forceWeaponFire ["MOCAP_FakeWeapon", "MOCAP_FakeWeapon"];
// player selectWeapon _current; player switchMove "";
// player removeWeapon "MOCAP_FakeWeapon";
"

little eagle
#

If the scripts for BR were open source, I could take a look

#

I don't think that is the case though

night void
#

lets try to trick with this way

little eagle
#

doesn't look promising to me, but go ahead

night void
#

but i dunno, how to create invisible weapon 😦

little eagle
#

you give it an invisible model I guess

#

wait ...

night void
#

likes ACE/RHS have a fake weapon for "Safe mode"

little eagle
#

model = "\A3\Weapons_f\empty";

#

no, ACE does not use a fake weapon for safe mode

#

It uses a different , rather convoluted method I developed for AGM back in the day

#

Otherwise it wouldn't work out of the box with any weapon out there

#

And I think RHS uses a weapon mode or muzzle without magazine instead of a fake weapon, but I haven't looked at their stuff lately

night void
#

i need something same, no sense how it works, i just need results πŸ˜‰ player X killed by player Y, handeled by default game mechanics

#

@little eagle pm me please, when u find something to test, i have a offer for u πŸ˜‰

little eagle
#

player X killed by player Y, handeled by default game mechanics
Well you cannot script that

#

Sorry

night void
#

not script

#

need to "simulate"

little eagle
#

shrug. the only way to influence the games behaviour at that level is scripting

jade abyss
#

What do you want to achieve?

night void
#

one way what i see its kill target by fake weapon

little eagle
#

because nothing you could change in config can make this work

#

He wants that roadkills with a car are displayed even though the player jumped out of the vehicle a second before

#

I think

night void
#

not only roadkill

jade abyss
#

forget it. Without Scripts not possible.

night void
#

i just need to simulate player X was killed by player Y, and do it by game mechanics

little eagle
#

forget it. Without Scripts not possible.
exactly

night void
#

no!

#

a lot of dudes told be Melee and takedowns is impossible in arma! BUT i DID IT!!!

little eagle
#

congrats. you seem to know more than we then

night void
#

and many other things

little eagle
#

you probably should help us in that case

night void
#

one way what i see, its fake weapon

#

@little eagle thank u very much for ur help, but no sarcasm here please, im really wish to make great things likes melee in arma

jade abyss
#

Still: He is right. You can't do it without scripts.

little eagle
#

Yes, sorry.

#

I don't think I can help you though.

night void
#

/\

#

@jade abyss @little eagle ??

jade abyss
#

*script

night void
#

yes, but its Weapon and she shooting to target!

#

and game will do requred things of kill detection

#

can i aim bullets to required target by script?

#

now need to know how to make config for fake weapon 😦

shadow sapphire
#

What is the easiest way to put a group in "DISMISSED" waypoint behavior for a set time, before forcing them to move on to the next waypoint?

noble ether
#

Does anyone know if it's even possible to rotate a player with a script that is triggered by a trigger?

#

I've tried setDir and setVectorDirAndUp, nothing seems to be working

still forum
#

im very sure it should be possible.... dont know why setDir doesnt work tho

noble ether
#

Yeah I've had a look around, and just tried doWatch too

#

everyone seems to have success with at least one

#

there must be something that I'm doing wrong

jade abyss
#

setDir is working oO

noble ether
#

does it not work?

jade abyss
#

No, that was a fact. It is working.

#

quote: I've tried setDir and setVectorDirAndUp, nothing seems to be working

noble ether
#

right, well I'm still lost on why it's not working for me then

jade abyss
#

I assume, that trigger triggered by a trigger didn't triggered

noble ether
#

I thought that too, but I put music to trigger with it, the music came on

jade abyss
#

OR didn't triggered the right person in the trigger. So the Trigger was triggered, but the Person inside the Trigger isn't triggered.

#

(Yeah, sounds like i am trolling, but its correct :P)

#

(i just like the word Trigger atm^^)

noble ether
#
_unit setDir 180;

Is what I think that I put in there

#

the script now

#

I can't remember as I deleted it to try other things

jade abyss
#

Server Executed?

noble ether
#

playing in single

jade abyss
#

systemchat str (name _player);

#

add this below _unit decleration

#
_unit = _this select 0;
systemchat str (name _player);
_unit setDir 180;
noble ether
#

will give that a try, 2 secs

jade abyss
#

I bet, there comes no msg πŸ˜ƒ

#

@noble ether
Try this in the Trigger:
(exp Cond)

{systemchat format ["NAME: %1", (name _x)]}forEach thislist;
noble ether
#

okay so a little progress

#

the script is now throwing errors, when it wasn't previously before

#

this is good

jade abyss
#

The one i posted?

noble ether
#

I tried just _unit = _this select 0; _unit setDir 180;

#

_unit in line 2 is not recognized

#

lol wut

jade abyss
#

Yep

#

Try mine

noble ether
#

I did also try with
systemchat str (name _player);

#

_player not recognized

jade abyss
#

...

#

Try this in the Trigger:
(exp Cond)
{systemchat format ["NAME: %1", (name _x)]}forEach thislist;

noble ether
#

sorry for the lack of response, been trying a load of different things

noble ether
#

right I got somewhere, but I'm off to bed now, going to try to finish ti tomorrow

#

thanks for all your help @jade abyss, much appreciated

jade abyss
#

o7

hallow spear
#

what is the procedure for requesting a variable from the server box?

vocal mantle
#

Has anyone noticed that fadeRadio seems to effect playMusic? Only fadeMusic should

little eagle
#

@noble ether

  1. it never matters from where the SQF code is executed. triggers, event handlers, init sripts... It's all the same.
    The only thing that does matter, is on what machine a command is executed.
  2. you cannot carry over local variables from your script into the scope of your trigger. You have to use thisList or some other kind global variable when using a trigger. You can define a new set of local variables in the triggers scope though.
  3. setDir is a command that has only local effects. If your trigger only runs on the server, the unit will only be rotated on the server too. Either make the trigger execute on every machine (create the same trigger on every machine) or use the common work around to emulate a global setDir:
    Use "_obj setDir getDir _obj;" after the setDir. getObj has global effects in contrast to setDir and the rotation carries over.
  4. setVectorDirAndUp does not and probably will never work with soldiers. Soldiers are always facing upwards in Arma
winged thistle
#

I can't seem to get my custom difficulty settings to work on my dedicated server.

#

In server.cfg, I have a mission cycle defined with difficulty = "custom"

#

I have defined class CustomDifficulty under class DifficultyPresets in my server profile

#

What am I doing wrong?

tame portal
#

Any idea how to resize the cover module via script?

indigo snow
#

it creates markers, so youd have to delete those markers and re run the function with different parameters

tame portal
#

Ohhh

#

Is there a function to create the module on the fly?

#

Hm there is a BIS_fnc_moduleCoverMap, might have a look into it later

indigo snow
#

that function is the function the module calls

tame portal
#

Well looks like Im not coming far with that then

lean tiger
#

@vapid frigate Thanks for the tip Friday with remoteExec

#

I understand localization, happy there's a function to help me punch through the client-server barrier πŸ˜ƒ

vapid frigate
#

then you can remote exec it directly, instead of remote execcing execvm

tough abyss
#

hey guys. I got the following code on the init of an object:

#

while {!isNull (_this select 0)} do {
_dist=player distance (_this select 0);
if (_dist < 6) then {
player setVariable ['tf_sendingDistanceMultiplicator', 4, true];
}
else { player setVariable ['tf_sendingDistanceMultiplicator', 1.0, true];
};
sleep 10;
};

#

this works pretty good but what i did not think about is if i have two objects of that type. If there's more than one the loops will "overwrite" themselves. I'm a bit at a loss right now how to solve this issue. any ideas?

zealous solstice
#

runing a loop on the player and check if there is a object of the class in the distance?

tough abyss
#

the loop is on the object itself with an init eventhandler.

zealous solstice
#

yes and why not only have one Loop on the player running? that is way easyer

#
[{
        private _object = (getPos player) nearestObject "AwsomeClassName";
        player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];
}, 10] call CBA_fnc_addPerframeHandler;
#

like that?

tough abyss
#

hm.. I like the idea but unfortunately it doesnt work. The mulitplicator doesn't get reset if you're further away than 6 meters

indigo snow
#

it does?

zealous solstice
#

it does

#

i just put the 4 lines in 1 line

indigo snow
#

to be fair, [a,b] select BOOL isnt a syntax you see often πŸ˜›

zealous solstice
#

πŸ˜ƒ yeah i like it because its so short

tough abyss
#

hm.. i might be doing sth wrong but this

#

[{private _object = (getPos player) nearestObject "Land_PaperBox_open_full_F"; player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];}, 10] call CBA_fnc_addPerframeHandler;

#

doesnt work for me

#

multi stays at 10

zealous solstice
#

oh wait invert it > to a <

tough abyss
#

ok

#

its inverted and i think those brackets are too many

#

getPos player nearestObject "AwsomeClassName";

queen cargo
#

[<any>, <any>] select <bool> is actually more or less the equivalent of SQF which other langs do with <bool> ? <any> : <any>

indigo snow
#

ok

queen cargo
#

but preferably you always should use if in both cases ... in the first one even more due to the fact that this crap just confuses and is inconsistent

tough abyss
#

thx @zealous solstice

little eagle
#

How is ARRAY select BOOL confusing?

#

pretty clear what it does. You also use it mainly to pick out the value for a variable and that looks shitty with stuff like _var = if ...

queen cargo
#

sigh ... commy commy commy ...
select is the index access operator of ArmA (more or less ... just like everything else in SQF it is just a command like so many others)
saying that the index access operator is consistent when you allow it to be used with bool ... is simply bollocks

little eagle
#

Yes. And false picks index 0 and true picks index 1

lone glade
#

and here is why you're in muted trolls X39

little eagle
#

that is consistent

#

please write this with an if:

queen cargo
#

we also can start using local instead of private again ...

little eagle
#

private _clientID = [0, 2] select isMultiplayer;

queen cargo
#

was logical and consistent if this is too

little eagle
#

shush alganthe

queen cargo
#
if (isMultiplayer) then
{
    _clientID = 0;
}
else
{
    _clientID = 2;
};```
alt.
`private _clientID = if(isMultiplayer) then {0} else {2};`
#

the first should always be prefered

lone glade
#

the first is also badly indented

#

and several lines longer than the second

zealous solstice
#

commys version looks way more elegant and nice

#

and clean

little eagle
#

The = iftriggers me

jade abyss
#

Hmm, i dont think there would be a noticable Perf. Difference.

little eagle
#

But, tbh ... I do the same with switch all the time

jade abyss
#

Still, i agree, looks cleaner

tough abyss
#

allright that's what i ended up with now

#

[{
private _object = getPos player nearestObject "tfw_rf3080Object";
if ((_object distance player) < 6) then { player setVariable ['tf_sendingDistanceMultiplicator', 4, true];}
else { player setVariable ['tf_sendingDistanceMultiplicator', 1, true];};
if (isNull _object) exitWith {(_this select 1) call CBA_fnc_removePerFrameHandler;}
}, 10] call CBA_fnc_addPerframeHandler;

zealous solstice
#

what no?

#

why did you do this

#
        private _object = (getPos player) nearestObject "AwsomeClassName";
        player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];
}, 10] call CBA_fnc_addPerframeHandler;```
#

this is enoth

little eagle
#

looks like a wall of text

zealous solstice
#

you dont need more

lone glade
#

use `

zealous solstice
#

just call the lines that i wrote you in the player init and than you are done

#

you dont need anything more

little eagle
#

doesn't nearest objects already accept objects?

zealous solstice
#

yeas

little eagle
#

player nearestObject ... ?

zealous solstice
#

oh waht

little eagle
#

then scrath the getPos

zealous solstice
#

no that i dont knnw

#

yes it take object

#

@tough abyss only call this in the init from a player that is enoth:

[{
        private _object = player nearestObject "tfw_rf3080Object";
        player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];
}, 10] call CBA_fnc_addPerframeHandler;
```
#

more you dont need

queen cargo
#
    private ["_object"];
    _object = player nearestObject "tfw_rf3080Object";
    if (_object distance player > 6) then
    {
        player setVariable ["tf_sendingDistanceMultiplicator", 4];
    }
    else
    {
        player setVariable ["tf_sendingDistanceMultiplicator", 10];
    };
}, 10] call CBA_fnc_addPerframeHandler;``` and now you even can understand the code without fully reading everything
little eagle
#

Not a fan of puting newlines before these curly brackets

lone glade
#

also that PFH isn't self terminating

zealous solstice
#

and make it around 10x larger

little eagle
#

I don't think it's supposed to be

queen cargo
#

just copied and altered what @zealous solstice posted @lone glade

zealous solstice
#

@lone glade the PFH dont need to terminating it self

runic spoke
#

Anyone have documentation on the 'SEL' command?

#

or willing to share their knoladge about it

little eagle
#

SEL command ???

zealous solstice
#

what SEL? this not look like a command

little eagle
#

Never heard of that

zealous solstice
#

that more look like a custom Macro

runic spoke
#

Example

native hemlock
#

macro

little eagle
#

Yeah, that is a macro

zealous solstice
#

macro

little eagle
#

#include "....\script_macros.hpp"

native hemlock
#

Look in this file #include "..\..\script_macros.hpp"

#

lol too many cooks, I'll leave it to you guys

runic spoke
#

#define SEL(ARRAY,INDEX) (ARRAY select INDEX)

little eagle
#

I think he can figure it out now haha

runic spoke
#

ya

little eagle
#

there you go

velvet merlin
#

typical macro misuse

queen cargo
#

better do not start with it @velvet merlin you will receive loads of hate in this channel for such opinions

#

up to the point where they just will call you moron

little eagle
#

dude

#

but yes, that SEL macro is dumb

#

It's the same thing, but ordered differently

#

I guess he really hates the binary commands

warped thicket
#

x39, select vs if-else for variable assignments is personal preference, no need to be insulted because someone doesn't do it the way you deem it correct

little eagle
#

understandable

velvet merlin
#

that guy is just lazy - sel = 3 chars, select = 6

#

however that makes him also not willing to learn better ways to save typing/time

queen cargo
#

@warped thicket the select thing is just inconsistent ... nothing else with it

#

anyway ... i head of to watch football

foggy pike
#

tbh I always prefer _var = switch (true) do { case (isMultiplier): {2}; case (isMultiplier): {0}; };

zealous solstice
#

@foggy pike did you want to troll?

little eagle
#

private _var = [0,2] select call compileFinal str if isMultiplayer;

#

sue me

indigo snow
#

scrub

#

compileFinal

indigo snow
#

that is your nitpick with that???

winter rose
jade abyss
#

It does

#

Last line

high plume
#

@here guys, what in your opinion is the best way to to restart the currently running mission (eden editor) there is no script command like "restartMission"

runic spoke
#

serverCommand #restart ?

thorny monolith
#

Reassign?

gusty comet
#

#restart

thin pine
#

lol using 'here' should be banned on these servers πŸ˜„

#

damnit

sullen cedar
#

^ agreed.. but also yes #restart command would be best

graceful pewter
#

happy i have the channel muted

vagrant plover
#

I guess it's veterans that can use it haha

graceful pewter
#

but yea it should be removed

runic spoke
#

serverCommand "#restart";

sullen cedar
#

^

thin pine
#

Someone inform Dwarden aboot this πŸ˜›

jade abyss
#

wow... "here" for such a bs question... rly?

native hemlock
#

I think he is able to use it because he has the member tag

sullen cedar
#

i forgot there was a scripting channel in this discord haha, i literally tabbed out of the arma scripts i'm writing to see what the notification was xD

thin pine
#

You just woke up 600 people lol

thorny pagoda
#

So much hate for "here" ? :D

spare crest
#

Agree'd

runic spoke
#

^^

rancid canyon
#

^^^

high plume
#

im sorry.

jade abyss
#

@thorny pagoda It pings fkn everyone...

thin pine
#

@high plume you caused public outrage πŸ˜„

blissful sparrow
#

@high plume I think the next development from scripting will be how to strip you of using that command

high plume
#

haha πŸ˜„ guys sry im awake since yesterday 13 o clock (so around 30hrs), my brain is fried.

sullen cedar
#

I like to compare using the "here"command to whacking a wasp nest with a baseball bat

thin pine
#

^hahaha

#

@lavish ocean please

inland cipher
#

do enyone know how you add text to youre brefing in arma 3 edditorn?

thorny pagoda
#

Yeah but still :D ping doesnt kill you or it does? :D

runic spoke
#

Couldnt you just use the mission briefing?

inland cipher
#

@runic spoke yea sur thx

high plume
#

gonna use endMission for now. better than nothing.

im basically editing sound configs, using arma3diag.exe, merging configs and trying to restart mission asap.

but i think im dead for "today"

thx guys. gn8

runic spoke
#

mega, serverCommand "#restart"; litreally πŸ˜›

high plume
#

@runic spoke it works in eden editor as well? didnt know that. ill try thanks.

runic spoke
#

uhm, if you are playing the mission yes.

high plume
#

@runic spoke nope. cant put #restart into a radio trigger, also executing locally via dev console does not do anything.

runic spoke
#

it needs to be executed server side

#

not on the client

zealous solstice
#

serverCommand "#restart"

native hemlock
#

Has anyone successfully used any of the road commands or nearestTerrainObjects to get the actual p3d name of a road? All I ever get is the object ID followed by " "

runic spoke
#

Hmm, let me see if i have all the p3d file locations written down.

finite temple
#

@ here be dragons

native hemlock
#

Well I'm looking more for getting the names and locations of roads for Tanoa p3ds

runic spoke
#

I don't have Tanoa stuff yet.

finite temple
#

so.... I'm a Veteran here ? how strange.

runic spoke
#

looks like i know what i'm wroking on πŸ˜„

native hemlock
#

And they are in EBOs so it's not as easy as just looking at it

runic spoke
#

Does cursorObject not work?

#

That worked for me on altis.

native hemlock
#

Nope, they are null objects to it

zealous arrow
#

cursorObject doesn't work for roads or map-baked buildings anyway IIRC

#

Trees etc seem to work fine on other maps, I personally have yet to test anything on Tanoa

native hemlock
#

It does work for buildings, jsut not roads

#

From everything I've seen cursorObject will tell you the p3d of any object, other than clutter or roads

runic spoke
#

I'll see if i can get them for you once i switch to dev branch

high plume
zealous solstice
#

add a nil to the end

high plume
#

@zealous solstice servercommand "#restart" nil; ?

zealous solstice
#

no ; nil;

#

i think but i dont know

#

that is ugly Editor shit

high plume
#

fml
doesnt work.

man i suck at scripting. i cant even get a sript to run from the trigger. jeez.

runic spoke
#

Triggers run client side i'm pretty sure.

high plume
#

i thought maybe put the commands into a script and run that script from trigger but i cant remember, spawn something... mhmh

indigo snow
#

nul = servercommand ...

runic spoke
#

The mission makers chat is probably better for your needs

indigo snow
#

servercommand returns a BOOL

#

@high plume see ^

high plume
#

@indigo snow thanks mate. but mission still does not restart (testing in editor)

youre right, ill go to mission makers. maybe throw in another @ here or something haha

gn8 folks and thank yall.

thin pine
#

@high plume don't you dare jk xD

finite temple
#

if you suck, it might be time to swallow some documentation ? ( sorry :p )

high plume
#

πŸ˜ƒ funny

runic spoke
#

wow, wow, just wow. @finite temple

high plume
#

hahaha πŸ˜„ the internet.

finite temple
#

he word itself is quite inapropriate : semantically, there isn't much link between that and being bad at something random

runic spoke
#

proof you have a dirty mind πŸ˜›

high plume
#

we all do.

zealous arrow
#

@runic spoke @high plume Triggers will work on server or client IIRC but they're not very well optimized as the condition checks run on each frame

lone glade
#

not if you change the last arg

zealous arrow
#

^

#

I just checked the icons at the top, forgot to check args

sullen cedar
#

well i WAS coding.. and then i remembered e3

#

rip

little eagle
#

triggers trigger me

lone glade
#

welcome to the club

lone glade
#

inArea made them less useful

full phoenix
#

bujl od

queen cargo
#

@zealous solstice nope more like extremly strict 3DEN editor ...
@indigo snow is correct about it ... BOOL != "Nothing" (aka NIL)

but that topic was already communicated to you via some forum posts ...

vapid frigate
#

I thought trigger checks were every 0.5 seconds, not every frame?

little eagle
#

I don't get why you have to return nothing in the init boxes. That just seems annoying.

#

Maybe someone can write a 3DEN patch , so it automatically applies a nil

#

or just skip this useless check

#

All you'd have to do is add a ;nil at the end. ... redundant

queen cargo
#

as said @little eagle ... extremly strict

little eagle
#

but why? what's the point?

#

Good thing I never use the init box

#

I can't debug anyway with all those macros

noble ether
#

quick question is arma 3's 'and' && and 'or' || when using logic?

#

nvm just found the wiki

torn juniper
#

Anyone know how to hide/disable the rsclistbox on the map that shows players etc

#

I tried but litterally everything can be hidden but the listbox

dusk sage
#

@noble ether

You can use && || or literally just 'and' or 'or'

noble ether
#

|| wasn't working for me for some reason and I couldn't find the wiki page

#

then as soon as I posted here, I found the wiki page, found out I was right and it worked

#

this always happens when I code πŸ˜›

dusk sage
#

haha

#

If it's easier just use 'and' 'or' 'not' etc

#

if (IAmAwesome OR not lame) then {

dusk sage
#

error: Type Array, expected Bool

marsh storm
#

Does anyone know if it's possible to give a darter a hellfire either by attachto or some other command?

#

Uh... Asking for a friend

#

Definitely not trying to make hunter killers

#

I'm OK with there not being a "visual" weapon on the drone

#

Would addweapon work for this?

deft zealot
#

Are dialogs opened with createDialog always blocking input like player movements (W, A, S, D)?

velvet merlin
#

i think you need createDisplay for non blocking

#

but its been some years since i last used that stuff

jade abyss
#

nah

#

Even that blocks it

velvet merlin
#

@deft zealot what do you have in mind?

#

in Blitzkrieg i have made a passive interface (display only). or check out the ShackTac Hud thingy

deft zealot
#

i want something like the inventory display, which closes automatically when you move

#

but is still interactable

velvet merlin
#

might be wrong here, yet its probably engine functionality

#

you have to script a monitoring system or event based with animStateChanged or sth similiar

silent terrace
#

Is it plossible to get rid of [eg spectator](EG Spectator) ui without losing player markers?

#

derp

#

come on

queen cargo
#

its not full markdown @silent terrace

silent terrace
#

Sadface

queen cargo
#

just basic formatting

silent terrace
#

Ah, answer in link i provied, thank you guys! πŸ˜„

fallen skiff
#

is it possible to adjust heli collective controls with scripting?

high plume
#

guys,

i am trying to get an all in one config dump into clipboard using this script: https://forums.bistudio.com/topic/188332-eden-all-in-one-config-dumps/?p=3005357

but it does not finish and i see a scripterror:
http://i.imgur.com/vctrJ3y.jpg

how do you guys make all in one configs?

Bohemia Interactive Forums

EDEN All-In-One Config Dumps - posted in ARMA 3 - ADDONS - CONFIGS & SCRIPTING: I generated some all-in-one dumps of the config tree for the new Eden update.
Β 
NeoArmageddon, who provided a workaround for a recent breakage in the script to generate these via his MapBuilder FileIO extension (Thanks!), suggested I should post them up;
Β 
http://ionwerks.net/...inoneconfigs.7z
Β 
There are four dumps;
Β 
Vanilla Only:Β arma3-156.134627.aio.cpp
w. CUP Terrains:Β arma3-...

little eagle
#

My guess is that you are running so many addons that the number of classes to print exceeds the maximum size of an array.
Which is weird because the array limit is somewhere between 1E6 and 1E7

#

is it possible to adjust heli collective controls with scripting?
no

fallen skiff
#

I am learning programming, with my first chosen language, Python. Just curious, is arma scripting done in python?

lethal wolf
fallen skiff
#

farmer, I am just a beginner programmer, could you tell me what language arma uses for scripting?

#

It seems to be BI's own scripting language?

#

n/m I think I get it now -- "SQF syntax"

lethal wolf
#

yea I think its sqf, it is called a .sqf

#

@vagrant cliff but do you know how to make it just check if a player in a land or boat vehicle, it runs on all vehicles which i dont want air vehicles to be spawning fog in the air

dusk sage
#

@lethal wolf

_vehicle isKindOf "Car"|"Ship"|"Air"

He's asking if ARMA uses Python, did you expect him to answer that?

lethal wolf
#

oh, and how would I put that statement in where? on top of this? " _inVehicle = (vehicle player != player);"

#

then add the _to vehicle

#

I dont know much coding, so im new to this

dusk sage
#

Do you want to exit out the whole script if they are in a heli/plane?

#

or just not run 'dooFog'?

lethal wolf
#

I don't want it to run dooFog when in heli/plane, but cannot exit

dusk sage
#

and still sleep for 120?

lethal wolf
#

yes

dusk sage
#

I assume that helped then @lethal wolf, you're welcome.

lethal wolf
#

@dusk sage Yes, it did work, thanks very much πŸ˜ƒ

agile pumice
#

can someone explain to me how I'm using disableSerialization wrong here?

#
20:42:06 Warning Message: Variable '_money' does not support serialization. Call 'disableSerialization' in the current script (maybe 'life_fnc_numberText') if you need to use it.
20:42:06 Warning Message: Variable '_bank_text' does not support serialization. Call 'disableSerialization' in the current script (maybe 'life_fnc_numberText') if you need to use it.```
#

i renamed the variables. _money is now _moneyText, and _bank_text is now _bankText

dusk sage
#

So how are we meant to help

#

If you renamed the variables

agile pumice
#

_money is now _moneyText, and _bank_text is now _bankText

dusk sage
#

What happens if you try add disableSerialization inside the while scope?

agile pumice
#

That's what I was thinking of doing, but I wanted it explained to me why Its needed in the loop

#

"_moneyText ctrlCommit 0; and _bankText ctrlCommit 0;" is outside the loop, so thats why I left the disableserialization outside as well

dusk sage
#
_moneyText = LIFEdisplay displayCtrl 10051;
#

Is in the loop

agile pumice
#

is there a generic ruleset for knowing when to use disableSerialization? (aside from when you get the error)

dusk sage
#

When you're using UI data types

vapid frigate
#

i thought having the one up the top should be enough

#

the error sounds like it wants disableSerialization in life_fnc_numbertext though

agile pumice
#

nah, I got rid of the loop and its gone

#

so it depends on the scope apparantly

dusk sage
#

@vapid frigate
Nothing to do with life_fnc_numberText, it's purely passing a scalar to a function

@agile pumice
It would seem to be loop specific

runic spoke
#

@agile pumice you figure it out?

agile pumice
#

yeah

#

stick it in the loop if you have one πŸ˜›

#

but i didnt need the loop so

runic spoke
#

I was going to tell you that πŸ˜› but since you figured it out.. lol

agile pumice
#

ya, my buddy likes to tap into scripting sometimes and doesnt always do the best job lol

dusk sage
#

'my buddy', gotcha, mums the word πŸ‘Œ

agile pumice
#

can moms not be friends? lol

torn jungle
#

when using removeMagazines, And i would like to remove allmagazines, can i just do "this removeMagazines;" without indicating any classname?

#

because the syntax is supposed to be unitName removeMagazines magazineName

dusk sage
#
{
    player removeMagazine _x
} forEach (magazines player);
torn jungle
#

thanks

#

oh that was in the wiki. sorry i didnt notice

runic spoke
#

If you "_player setVariable ['...', code..];" on the server is the server only able to access that information?

indigo snow
#

Yes, unless you add a third true argument

runic spoke
#

Yeah, to globalize it. was just making sure it was only accessable by the server.

lean tiger
#

Bleh -- this isn't SQF, but for Arma2Net plugin writing -- getting a TargetInvocationException if my function uses "params" for a variable number of arguments

#

did my due diligence googling, but no luck -- anyone have experience with that?

#

Not running it in a mission yet, just demoing in the Arma2Net Explorer

tame portal
#

Does anybody know

#

why the hell disableChannels[] isnt working again

#

disableChannels[]={{0,true,true},{1,true,true},{2,true,true}};

#

results in all channels being accessible, von and text..

fallen locust
#

becouse true?

shadow sapphire
#

@tame portal, change the trues to false to disable.

tame portal
#

didnt work either

#

tried that before because it was more logical

#

but in the end nothing worked ^^

jade abyss
#

works for us. You just broke it πŸ˜„

tame portal
#

Well thats interesting I guess :S

full sorrel
#

Can anyone help me, i have a array of strings, each one is the variable name of one of my objects in the missions, i now need to move these objects from my script but i cant convert the string name so that it uses the object by that name

tame portal
#

Well the dirty way would be call compile

full sorrel
#

Well gimmie the dirty way please πŸ˜„

tame portal
#

Well

#

if your missionfile creates a reference to your eg helicopter

#

with the name myheli

#

and your array contains "myheli"

#

you just do

#

_heli = call compile "myheli"

#

Since call compile makes whatever is inside the string into code and executes it

zealous solstice
#

that is slow with compile

tame portal
#

and since your mission saved a reference under myheli it will assign the value of myheli to _heli

#

Better is missionNamespace getVariable

zealous solstice
#

yes

tame portal
#

_heli = missionNamespace getVariable ["myheli",objNull];

#

objNull in that case is just a default value in case your heli doesnt exist for whatever reason

full sorrel
#

Tried both of those now, not working