#arma3_scripting

1 messages ยท Page 461 of 1

late gull
#

they should drop the "drop" in this center, they will come from let's say 5km away but random degree

#

and then when they reach the center they go let's say again 5km way in random degree

#

or optionally straight

#

isn't that a kind of vectoring?

#

i would say in Spanish "Vectores en el plano cartesiano" ( vectors in cartesian plane )

dry egret
#

it is in the math sense

#

vactor is the direction of travel from a point in space to another point along a line

#

what you need to do is first generate a random position on the map or specific position and work from there

late gull
#

remember it has to be 5km away from the center given

dry egret
#

say you want the copter to land at a specific point

late gull
#

it's easy to made it 1 time manually

#

but the thing it's make a formula/script/function whatever to do that dynamic just giving the center and the distance

dry egret
#

for example you have a marker at the spot, grab its position and chose a random direction and add 5km along its x, y cords

late gull
#

how do i chosse a ramdon direction?

#

i can getDir/setDir but i can't say, hey in this direction giveme a random position from 5km away :p

#

or do i can?

dry egret
late gull
#

yes, this will spin the "choppers" to this direction

#

but how u will get the position 5km away in this direction?

meager heart
#

@late gull

late gull
#

and another thing, how do you sping choppers pointing to the center given?

dry egret
late gull
#

will read them

#

well, going to bed, cya around, thx for the talks

dry egret
#

found it

#

@late gull i think thats the command youre looking for

#

it will return a position from the object you want at a minimum distance you specify, then all you have to do is use createVehicle at that possition

#

then set the waypoint to the object you run the relPos off of and do it again to get a new position for the next waypoint out.

#

or you could just make the copter return to its starting location

winter rose
#

@dry egret check the page: use getPos's alternative syntax

dry egret
#

you could use that if you combined it with a random number for the direction

#

donno what one is faster though if we are talking about speed though

winter rose
#

getPos is faster.

dry egret
#

i have not learned how to speed test scripts just yet
< still learning the arma scripting

winter rose
#

you can use the editor debug and use the benchmark button (bottom left of the input field) ๐Ÿ˜‰

dry egret
#

๐Ÿ˜ƒ

#

does arma scripting support nested execution?

#

like in c++ how a function parameter can have a function as a parameter?

winter rose
#

well, you can have code as parameter

little eagle
#

Did someone say vector?

dry egret
#

@little eagle i think me and Lou got him pointed in the right direction

warm bronze
#

Vectored in the right direction*

dry egret
#

@warm bronze lmao, perfect name for that comment

warm bronze
#

๐Ÿคทโ€โ™‚๏ธ

little eagle
#

No, irony deals with opposites. This is just a coincidence.

wary vine
#

got a small issue here.

cursorObject addAction [localize"STR_MAR_Drug_Dealer",lega_fnc_openDialog, ['Drug Dealer','drugdealer'],0,false,false,"",'isNull objectParent player && player distance _target < 5 && playerSide isEqualTo civilian'];
``` is working fine through debug console on the server yet 
```sqf
this addAction [localize"STR_MAR_Drug_Dealer",lega_fnc_openDialog, ['Drug Dealer','drugdealer'],0,false,false,"",'isNull objectParent player && player distance _target < 5 && playerSide isEqualTo civilian'];
``` isnt working in the init in the mission.sqm, the option shows up but does nothing.
#

now this is fucked xD

#

changing lega_fnc_openDialog for {_this call lega_fnc_openDialog} works xD

meager heart
#

the syntax should be addAction [<string>,<string>,... or addAction [<string>,<code>,... and you have addAction [<string>,lega_fnc_openDialog...๐Ÿ˜€

robust hollow
#

lega_fnc_openDialog would be code i imagine

meager heart
#
#define LEGA_DIALOG    (call{\
    /*something */ \
})
``` like zo... maybe will works ๐Ÿ˜„
robust hollow
#

lega_fnc_openDialog probably isnt set when the addaction is added

meager heart
#
#define FUNC_CALL {\
    hint "IT WORKS";\
}
test_fnc_call = {hint "IT WORKS AGAIN";};
player addAction ["Test", FUNC_CALL];
player addAction ["Test 2", test_fnc_call];

actually both works ๐Ÿค”

meager heart
#

so addaction script is just call compile <string> or call <code>๐Ÿค”

#

never tried it that way ^

still forum
#

@meager heart addAction converts the code to a string or takes the string directly. And then call compile's each time the action is executed

#

code is code. No matter if in a variable or directly.

#

variables are resolved sooner. The command can't even see that you passed a variable

meager heart
#

i see, ty for the clarifications

#

i thought there is something more than just typeName checks

rancid pecan
still forum
#

@rancid pecan link no work

rancid pecan
dry egret
#

This is my current command im exicuting and id like to know how to do this using the new commands that replace BIS_fnc_MP... iv looked at the wiki but i cant figure it out.

[[[],"cys_tasking\missionCombat.sqf"],"BIS_fnc_execVM",false] call BIS_fnc_MP;
still forum
#

It's a html link inside the structured text

#

@dry egret

rancid pecan
#

@still forum is ti link working ?

still forum
#

yes. I already answered you ^

#
[[],"cys_tasking\missionCombat.sqf"] remoteExec ["BIS_fnc_execVM", 0]; 

Why BIS_fnc_execVM? why not execVM or spawn

meager heart
#

also 0 < for the targets is default

dry egret
#

@still forum Thanks a ton, i could not figure out the syntax for the life of me

#

@still forum Iv always used the BIS_fnc_execVM.
is their a better way of calling this? should i be using one of the others instead?

meager heart
#
params [["_args1", []], "_args2"];

// --- input format: "script" or ["script"]
if (isNil "_args2" && _args1 isEqualType "") exitWith {[] execVM _args1};

// --- input format: [param, "script"]
if (!isNil "_args2" && {_args2 isEqualType ""}) exitWith {_args1 execVM _args2}; 

// --- error and suggest supported format
[_this, "isEqualTypeParams", [nil, ""]] call (missionNamespace getVariable "BIS_fnc_errorParamsType");

scriptNull

BIS_fnc_execVM ^ ๐Ÿ˜€

still forum
#

just use execVM

dry egret
#

really wanting a facepaml emoji right now

peak plover
#

๐Ÿค” ๐ŸŒด

dry egret
#

lol

inner swallow
#

๐Ÿคฆ ?

late gull
#

๐Ÿ•ต

versed steppe
#

Anyone knows how to get a helicopter to pickup a car reliable half way into a mission where the have moved?

#

I done s pickup waypoint which works when i put it on the car, but then if I drive away.. it doesn't

#

So then I tried a setwppos at the car position, helicopter flew there. But no pickup

late gull
#

AI can lift vehicles? xD

versed steppe
#

Yeah :)

late gull
#

that's pretty

versed steppe
#

I don't know what kind of magic happens when you put a waypoint on top of a vehicle /building but in the editor it can sorta attach.

#

Wonder if I can do the same but dynamically ingame?

late gull
#

maybe with attach

versed steppe
#

Found a thread that seemed to kinda solved it.

#

Gives some new input to test tonight

daring pawn
#
{
    if ({_x distance _x < 5} count allPlayers > 0) then {doThings};
} forEach array;

I have an issue with the above as it requires two _x's to be used. What is the solution to this?

still forum
#

move your first _x into a variable

daring pawn
#

I get what you mean but im not sure how I can do that due to the nature of {_x distance Object} count AllPlayers > 0

robust hollow
#
{
    _v = _x;
    if ({_v distance _x < 5} count allPlayers > 0) then {doThings};
} forEach array;
daring pawn
#

wow does that really work?

#

Wow it sure does...

dry egret
still forum
#

"Wow you can really set a variable?" "Wow. You really can set a variable"
seriously? ๐Ÿ˜„

daring pawn
#

No i understand that Dedmen and how it looks dumb, but I saw it as seeing both as just _x and doing _v = _x doing nothing

#

But I've misunderstood that

#

no need to take the piss man ๐Ÿ˜ƒ

still forum
#

you mean you thought _x changing would also overwrite _v then?

jade abyss
#

prolly

dry egret
#

i dont think arma scripting has pointers lol

still forum
#

they.. do... kinda

daring pawn
#

Yes essentially, but also no

still forum
#

That doesn't happen because the = operator creates a "copy"

jade abyss
#

If you are unfamiliar with it, and doesn't know that _x gets created again and again (inside the {}forEach Part), it would look like: Compare A with A (with another name :D)

velvet merlin
#

can someone tell why BI now is using the second approach to compute mapSize

    _bbr = boundingBoxReal _object;

    _maxWidth = abs (((_bbr select 1) select 0) - ((_bbr select 0) select 0));
    _maxLength = abs (((_bbr select 1) select 1) - ((_bbr select 0) select 1));
    _mapSize = _maxWidth max _maxLength;
    _mapSize = (round (_mapSize * 100)) / 100;

    _maxWidth = abs ((_bbr select 1) select 0)) + abs (((_bbr select 0) select 0);
    _maxLength = abs ((_bbr select 1) select 1)) + abs (((_bbr select 0) select 1);
//same
    _mapSize = _maxWidth max _maxLength;
    _mapSize = (round (_mapSize * 100)) / 100;```

for most vehicles the result is the same, but some get different results
unborn ether
#

@velvet merlin if got you right, you are asking why bbr is different for same class of vehicle - then it's not possible to be that way. If that was around that bbr is not accurate, well yes. I've seen vanilla signs to be in a size of a car

storm crow
#

Does anyone know how to make automatic generated variables? E.G. A variable that changes names every time the script loads.

robust hollow
#

just generate a random string then assign the value to it?

storm crow
#

I can only find documentation on the variable 'random' which generates a number?

robust hollow
#

give me a sec and ill write out what i mean

hollow thistle
#
private _name = "someName";
missionNamespace setVariable ["prefix_" + _name, <value>];
// global variable "prefix_someName" is available
#

But you need to think if you really need dynamic variable names. Usually it can be a sign of code that could be written in better way.

robust hollow
#
{
    _characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" splitstring "";
    _output = [];
    _output resize 10; // 10 is the length of the string
    _output apply {selectRandom _characters} joinString ""
};

that kind of thing to give you a random string. take note of what veteran said though ^

wary vine
#

anyone know anything about handle damage being buggy asf

12:45:20 "T 1122.98 : [[civ_1,""spine1"",2.15749,civ_2,""B_9x21_Ball"",4,civ_2,""hitabdomen""]]"
12:45:20 "T 1122.98 : [[civ_1,""spine2"",2.15749,civ_2,""B_9x21_Ball"",5,civ_2,""hitdiaphragm""]]"
12:45:20 "T 1122.98 : [[civ_1,""body"",0.000252492,civ_2,""B_9x21_Ball"",11,civ_2,""incapacitated""]]"
12:45:20 "T 1122.98 : [[civ_1,"""",0.089633,civ_2,""B_9x21_Ball"",-1,civ_2,""""]]"
12:45:20 "T 1122.98 : [[civ_1,""spine1"",1.08835,civ_2,""B_9x21_Ball"",4,civ_2,""hitabdomen""]]"
12:45:20 "T 1122.98 : [[civ_1,""spine2"",1.08835,civ_2,""B_9x21_Ball"",5,civ_2,""hitdiaphragm""]]"
12:45:20 "T 1122.98 : [[civ_1,""body"",0.000124828,civ_2,""B_9x21_Ball"",11,civ_2,""incapacitated""]]"``` thats one shot
#

bullet travels through

#

that is understandable

#

but 2.15749 damage from 1 9mm shot o.O

storm crow
#

@hollow thistle @robust hollow That's perfect, thank you chaps!

rough heart
#

@wary vine Close range,,, long range... ?

wary vine
#

close range

#

its a 9mm and its one shotting

#

as a temp fix I added if !(_index isEqualTo -1) exitWith {0};

#

seems to work

storm crow
#

@robust hollow @hollow thistle A pretty stupid question but how would I call the variable after?

robust hollow
#

well... you can get it again doing missionNameSpace getvariable [<string>,{}] but you need to know the variable name for that

storm crow
#

Well, this is the setup I'm attempting to do to obviously get the variable name and call the variable function.

_name = []call _generateStringBro;
missionNamespace setVariable ["jh_" + _name, "hint ""potato"";"];
_callMeBitch = missionNamespace getVariable ["jh_", _name]; 
[]call _callMeBitch;
still forum
#

you can't call a string

#

you can only call code

#

also your getVariable is wrong

#

You are getting the variable jh_ and if it's undefined it returns _name

#

You need to combine them.

storm crow
#

Bingo, thank you. It's all working as wanted now โค

dry egret
#

in the editor under groups >> empty, there are groups of objects defined. Is their a way to spawn them via scripting?

compact maple
#

Hello, i am using ace3mod, and i was wondering if i can prohibit the access to the gas station, can you help ?

still forum
#

@dry egret sure. You can do almost everything through scripting. The question is just if it's easy or hard

dry egret
#

@still forum im still googling but im not finding much on it.

#

since the object compositions are under the default arma groups, im not sure if its considered an eden composition.

still forum
#

they aren't

#

groups are a Arma2/ old editor thing

dry egret
#

yeah im not wanting to spawn AI units.... im looking into the object groups that are under the group of props

#

like Fuel_dump

hollow thistle
#

(other than considering to run it as PFH)

#

Feel free to shittalk this code it was written at 1am after long day of work ๐Ÿ˜„

still forum
#

No don't PFH that.
_players = _players - [_x];
make an array
private _checkedPlayers = []; the pushBack into it inside the loop. And then after the loop
_players = _players - _checkedPlayers

#

also I'd recommend to keep that variable always the same datatype. You'll forget to check that at sooome place and trip over it

#

use empty string for no FOB and non empty for some FOB

#

What is that useless call on Line 43?

hollow thistle
#

it is here to remind me that i should move this into function propably.

#

As I will check more similar things in this "event loop"

still forum
#

If you don't reuse that elsewhere I don't see the need for a function. But just personal preference

hollow thistle
#

Thats true as calls are a little bit of perf loss.

#

Thanks for the array tip. I don't need to create new arrays so many times.

still forum
#

alternative for my arrayTip to get rid of the pushBack.
.... waiit..

#

You are doing that for every _x. You don't need an extra array. You already have _inFob

#

or you can move that array even above the forEach (KPLIB_sectors_fobs) and inside just _checkedPlayers append _inFob;
and at the end forEach (_players - _checkedPlayers)

hollow thistle
#

Right. I will take a look at it later.

meager heart
#

also private _players = allPlayers select {alive _x}; > playableUnits and you have uiSleep on the server side ๐Ÿค”

still forum
#

playableUnits also returns AI. Which you don't want

#

also playableUnits still needs the alive check

#

Bad idea

peak plover
#

Cba players > allplayers

still forum
#

uiSleep vs Sleep don't make a real difference on server. Doesn't matter which one you use

peak plover
#

Uisleep is good when u want to sleep during briefing phase on swrver

dry egret
#

WOOOOOOOOOOT

test = [getMarkerPos "marker_4", empty, (configfile >> "CfgGroups" >> "Empty" >> "Military" >> "HQLarge" >> "Headquarters_OPF_F")] call BIS_fnc_spawnGroup;
peak plover
#

Normal sleep waits for briefing to close and game tonstart

dry egret
#

๐Ÿ˜‚ it works @still forum

hollow thistle
#

"The sleep precision is given by a framerate". So from what i understood uiSleep can be more "precise"(?).

still forum
#

yeah

#

that's what I mean with "real"

#

but for scheduled it doesn't matter anyway

dry egret
#

since youre talking about sleep commands, for spawning in small side missions.... would their be any performance gains if i changed the sleep command to use the cba wait and execute?

still forum
#

your precision is between 20ms and several hours

#

@dry egret CBA_waitAndExecute is something completly different

#

Sleep sleeps in scheduled. The CBA func registers a unscheduled function to execute after that time and is potentially checked every frame if it should execute

meager heart
#

๐Ÿ˜€

still forum
#

it's a framework. You cannot be sure if someone enables AI again

meager heart
#

well... that's true

still forum
#

How about allPlayers - allDead?

meager heart
#

maybe

#define ALL_PLAYERS     ((allUnits + allDeadMen) select {isPlayer _x})
still forum
#

suuure

dry egret
#

thanks for the help @still forum , im out for the night ๐Ÿ˜

winter rose
still forum
#

also returns dead

meager heart
#

there vehicles also, Lou

still forum
#

and sounds like it does the same as allPlayers ๐Ÿค”

peak plover
#

(allUnits + allDeadMen) select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}}

#

Source

winter rose
#

@still forum oh

still forum
#

That's only because
In player hosted game, the complete array of allPlayers may get delayed at the start. Use BIS_fnc_listPlayers if you need it earlier
Which is not relevant here

#

allPlayers is perfectly fine here. Doesn't matter if it's delayed by a minute

hollow thistle
#

^ - I only need to filter out headless clients as support for them will be added later.

meager heart
#

and dead units ^

still forum
#

So what about allPlayers - allDead instead of allPlayers select {alive _x}?

#

first one should be faster

meager heart
#

allDead > allDeadMen

#

without vehicles

hollow thistle
#

will it still be faster after some time when there will be a lot killed units?

#

They will be garbage cleaned after some time but i guess we can expect to have some of them being around for some time.

#

Also is BIS corpseManager and wreckManager any good?

meager heart
#

addMissionEventHandler "EntityKilled" < custom corpseManager ๐Ÿ˜€

tiny adder
#

why isn't this working? I only get 12km viewdistance

winter rose
#

you may have another mod/object/setting setting it back to 12km?

still forum
#

Because you didn't read the wiki

#

Read last note on the wiki page

winter rose
#

@tiny adder does it work in Eden?

still forum
#

also the description says it's limited to 10km. Which was already wrong for Arma2

winter rose
#

@still forum 10km in A1, 15km in A2, 40km in A3

#

(not sure about A1 though)

astral tendon
#

were is in the pbo files the icons for the weapons?

tiny adder
#

setViewDistance 40000 works fine in the extended debug console

winter rose
#

in Eden or in MP, again?

tiny adder
#

uh, isn't the pic I posted Eden?

#

the editor

still forum
#

Eden can be SP or local MP or dedicated MP

#

which one?

tiny adder
#

I'm trying in SP

#

but I also want it to work in MP

#

I've gotten it to work before

#

could it be some mods causing it?

tough abyss
#
[_veh, ["Medical Treatment", _fnc_heal, nil, 1.5, true, true, "", "true", 5, false, "", ""]] remoteExec ["addAction", 0, _veh];
[_veh, ["Combat Supplies", {["Open",true] call BIS_fnc_arsenal;}, nil, 2, true, true, "", "true", 5, false, "", ""]] remoteExec ["addAction", 0, _veh];```
Any specific reason why the second overwrites the addaction formed by the first one? ๐Ÿค”

If I comment the 2nd line out, the first one appears without issues. If neither are commented out, only Combat Supplies appears
still forum
#

As Lou already asked... you may have another mod/object/setting setting it back to 12km?

winter rose
#

@tiny adder drop the mods, test again? it's usually a mod

tiny adder
#

I disabled all mods and now it works, hmm

meager heart
#

lol

winter rose
#

ยฏ_(ใƒ„)_/ยฏ

#

he he he
I have close to no experience about mods, so I don't know which could change your VD

tough abyss
#

reckon a sleep 5 between them would help?

#

nvm that's not the solution

#

nothing in the documentation though

shadow sapphire
#

Hmm...

Tom addwaypoint [getmarkerpos "Origin", 0];
Tom addwaypoint [(getmarkerpos "Origin"), 0];```

Neither of these work. What is the correct syntax and why is it correct. How could I figure out proper syntax on my own if I needed to do it without trial and error.
frail ledge
#

you need to use (group Tom)

#

If you want the unit to move you need to use setWaypointType as well. eg.

_wp setWaypointType "move";```
astral tendon
#
openYoutubeVideo "watch?v=T4LweM7quxI";

This still returns false even though i have steam overlay activated

twilit field
#

A recent script command let's you open a YouTube video directly in the Steam overlay (if enabled). openYoutubeVideo gives quite a bit of control over the various options, since you don't just provide the video ID, but other playback parameters as well. For security reasons we have restricted its use to outside scenarios only (e.g. in the game's UI or a mod's UI). We'll be using it ourselves to link & play the Community Guide series from within the game in Bootcamp Update.
http://dev.arma3.com/sitrep-00061

astral tendon
#

Any work around to that?

still forum
#

create a UI and let the player click

#

Or call that in a UI eventhandler.. I guess that should work too

little eagle
#

Was geht?

late gull
#

umm yup

#

i found a thing

#

why when i use "NONE" in trigger wont detect PRESENT if you are insinde a vehicle

#

but it does with "EmptyDetector"

#

by script, but in editor u can use "NONE" and it works

late gull
#

@still forum i got the solution in triggers, i make it work

#

compiling the function in initPlayerLocal.sqf instead of init.sqf

#

locallity business -.-

frail ledge
#

Is there a better way of checking if a large number is equal to another large number other than == or isEqualTo

12345678911234567 == 12345678911234567 // true // these are the same number
12345678911234567 == 12345678000000000 // true // these are not the same number

I'm trying to check player UIDs against an array of admin UIDs and realised that there are potentially over 100,000,000 numbers that could return true in my condition check.

still forum
#

playerUID's are strings for a reason

#

keep them as strings

noble pond
#

exactly what I was just thinking lol, they are strings to prevent that problem

frail ledge
#

oh. That makes so much more sense. ty.

noble pond
#

there is no reason to convert to number, if anything you are shooting yourself in the foot :p

still forum
#

Floating point precision is what you are missing

viral gust
#

Yep

#

Thought about it after I asked lol

late gull
#

guys, how i'm supossed to get Vehicle display name

#

i'm doing that:

_vehName = configfile >> "CfgVehicles" >> _vehType >> "displayName";
#

but it's giving me a route

frail ledge
#

getText (configPath)

late gull
#

oki

#

worked thanks

#

what about turrets

#

do i need use getArray? i'm already testing w/o and seems not necesary

frail ledge
#

to get arrays you need getArray to get numbers getNumber for text.... etc.

late gull
#

but i mean

_vehMagazines = configFile >> "CfgVehicles" >> _vehType >> "magazines";
#

this is working well withouth getArray

lone glade
#

and this returns a config path

#

not the actual content of the entry

late gull
#

problem :S

// actions\vehicleRespawn.sqf
[respawn_west_helicopter, 10, -1, -1, nil, 0, 0, 2, true] call BIS_fnc_moduleRespawnVehicle;

// init.sqf
#include "actions\vehicleRespawn.sqf";
#

the vehicle respawn twice

#

i tried moving the include to initPlayerLocal and to initServer, but then wont work

inner swallow
#

why...are you using include though?

late gull
#

it does matter?

#

only for organization

lone glade
#

dude

#

init.sqf runs on ALL machines

late gull
#

and then?

late gull
#

i dont relly understand that thing

#

doing

// init.sqf
 if (isServer) then { code... };

is not the same

// initServer.sqf
code...
gleaming oyster
#

in practice it is. Since the init.sqf will run on the client and the server all you're checking in the init.sqf is that you're running on the server and not the client

#

and initserver.sqf will always execute on server regardless of checks

late gull
#

the thig is: i used BIS_fnc_moduleRespawnVehicle in intServer and was not working

#

then i move it to init.sqf and uset isServer and worked

#

so this is making me like crazy

#

everything in SQF makes me crazy

#

๐Ÿ˜„

gleaming oyster
#

why tf are you using module fncs in the first place

#

no less the respawn vehicle module fnc?

late gull
#

why not, it works good

gleaming oyster
#

no it does not

late gull
#

why?

gleaming oyster
#
Can confirm, reading through \a3\modules_f\Multiplayer\functions\fn_moduleRespawnVehicle.sqf was an issue in frustration. I envy a mind that can create such confusion that surprisingly works part of the time.
In some cases it doesn't even respawn stuff at all: https://feedback.bistudio.com/T123940  , and then when you tell them exactly the problem, the cause, and even offer a solution, nothing gets done...(edited)
But stay away from it, not worth your time, you deserve better: https://feedback.bistudio.com/search/query/TE.8rf7URd7Z/#R
late gull
#

so u suggest me use them in editor?

gleaming oyster
#

No, I suggest you don't use them at all

#

all the module does is feed parameters to the function

little eagle
#
#ifdef DEBUG_BUILD
    if (_optic == "BWA3_optic_debug") then compile preprocessFileLineNumbers "\bwa3_optics\scripts\debug_reticle.sqf";
#endif
wary vine
#

best way of referencing a controlsGroupctrl when you create the controlsGroup in a foreach ?

#
{
    private _group = _display ctrlCreate ["EmerMessageGroup", _idcStart, _controlsGroup];
    _idcStart = _idcStart + 1;
    private _background = (_controlsGroup controlsGroupctrl 1);
    systemChat str _background;
    (_controlsGroup controlsGroupctrl 1) ctrlSetText "Lega\Lega_xPhone\Images\dialogImages\emerMessageBackground2.paa";
} forEach EMS_Messages;
``` always returns the same control
#

nvm

#

i fucked up

dry egret
#

need some help figuring out how to spawn editor prop groups correctly

_radiohq = [getMarkerPos _markerAO, empty, (configfile >> "CfgGroups" >> "Empty" >> "Military" >> "HQLarge" >> "Headquarters_OPF_F")] call BIS_fnc_spawnGroup;

^ this spawns the objects as needed but causes a lot of errors.

shadow sapphire
#

What is the command to make AI characters speak recorded, already in game, vanilla dialogue lines and where are those lines configs found??

dry egret
#

@shadow sapphire im not sure how to use the built in but if you wanted to run custom voice overs i can tell you how to do that

shadow sapphire
#

I know how to do custom voices, but thanks for looking out, @dry egret.

dry egret
#

if you can find the audio location, you could just set the custom voice over to use the stock audio file

daring pawn
#

Is there an alternative or better way to call a function on a server other than

waitUntil{[_mkr] remoteExecCall ["my_Function",2];}
``` because it returns a string not the same as if I just did 
```SQF
waitUntil {[_mkr] call myFunction}
tame portal
#

@daring pawn those two examples dont necessarily do the same

#

You can only call the function on the server directly if you're already in a script on the server

#

If you're running anywhere else you will need remoteexec to specify to run the call on the server

ruby breach
#

Not to mention that call will return the last value given in the function (regardless of what it is). remoteExecCall will return a string, but it's either an empty string or the JIP ID, which has nothing to do with what the function itself is doing

tough abyss
#

Anyone familar with

[ "#rev", 1, player ] call BIS_fnc_reviveOnState;

daring pawn
#

@tame portal Yea i'm aware of the difference as to where to call them
@ruby breach Yea i know, thats my issue. I know call returns the last thing given to it, so its useful with waitUntil if the function has true at the end so it waits until that. Its obviously not the same with remoteExecCall

#

I need a way to call the function from the player to the server and still get the result of true so i can waitUntil with it

tame portal
#

So you want to repeat calling your function until it returns true?

#

I don't know if there's any proper way to wait for network calls to be done but I believe there isn't

daring pawn
#

Uh no not necesarilly. So i want to wait until the function that is called is completed before moving on

tame portal
#

So you would have to make a server function send the result back to you

daring pawn
#

I can achieve that no worries with call

#

but with remoteExecCall its a drama

tame portal
#

Why wait until then?

#

call already makes sure it doesn't return before the function is done

#

The script you're calling is run in the same context or "thread"

#

So it will finish the call and then return the value before it does anything that's written behind the call

#

So you can remove that waitUntil in this case

#

In your example code you would keep running the whole function over and over again until it eventually returns true

#

but like I said over network you will need to implement a mechanic that sends the data back to the requester

#

as remoteExecCall has no implementation to get the returned value over network (sadly)

meager heart
#

maybe just setVariable before RE and change variable in that function, wait for variable change on the client ๐Ÿ˜€

daring pawn
#

So im using it to spawn units when you get within a radius. If you end up getting in radius of two areas at once or more, it sometimes gets jumpy cause it dumps spawning units. When I use waitUntil, it waits the the first set of units is spawned before the next.

#

Its not completely horrific without WaitUntil but its a bit more ideal

meager heart
#

for that spawning function, maybe just spawn and scriptDone

daring pawn
#

hmm the thing is the function is only known by the server, so hence me remoteExecCalling it

peak plover
#

So basically u are calling function on server to spawn units for the area

#

Re that from client

#

So issue ?

#

Lag when spawning?

daring pawn
#

thats correct. The player checks if they are close enough to the area to spawn the unit. Then calls the function on the server to spawn it (all checks to make sure every single player doesn't call it are done and bla bla bla)

I want to wait until that particular area or script that spawns the units is done, before it can loop back and spawn further units if in the case of it setting off several areas

peak plover
#

Make a handler for ai spawner

winter rose
#

dumb question maybe (I am not sure I read the whole topic here) but why isn't it the server that checks distance? the client would just "endure" server decisions, not trigger them?

loud python
#

Goooood morning vieeetnaaaaaaaaaam!

#

I have an ACE-related question

late gull
#

๐Ÿคท

loud python
#

I have a unit placed in eden

#

and I want to add a bullet injury to their head

#

so that players can have a medic look at him and find out he was shot

#

(it doesn't look like he was, and that's part of the plot)

#

any ideas how I can do that?

late gull
#

take a weapon, aim to head, pull the trigger ๐Ÿ˜„

little eagle
#
[this, 0.8, "head", "bullet"] call ace_medical_fnc_addDamageToUnit;
loud python
#

thank you very much ๐Ÿ˜ƒ

#

can you link me to where I can find more of that?

late gull
#

in ACE web u have full docummentation

loud python
#

404 ๐Ÿ˜

late gull
loud python
#

@late gull yeah, I looked there and didn't find anything

#

thanks commy ๐Ÿ˜ƒ

daring pawn
#

@peak plover how do you mean? As in something to prevent too many ai spawning at a time?
@winter rose because in a situation where theres many players, theres also many many positions that need to be checked if players are in relevant distance. Its less strain for the player to check if they themselves are closer

#

Im using NearestLocations

loud python
#

it still says "no injuries to this body part" ๐Ÿ˜ข

#

oh, okay, advanced medical mode was only enabled for players

#

still no injuries to this body part...

little eagle
#

Try:

#
[{
    [_this, 0.8, "head", "bullet"] call ace_medical_fnc_addDamageToUnit;
}, this] call CBA_fnc_execNextFrame;
loud python
#

okay, I'll try that

#

that was about my next guess; throw it into a block, put a sleep before it and spawn it

#

okay it works now

#

again, thanks a lot ๐Ÿ˜ƒ

little eagle
#

yw

winter rose
#

@daring pawn a distance check is performance-wise close-to-nothing.
Only the server should be the reference for unit distances and positions, so you should definitely let it do the job

hollow thistle
#

I dont belive it is worth the hassle to do distance checks on the clients.

#

But if u insist you want to do it your way, I think you could remoteExec it on server and notify client when you are done via publicVariableEventHandler

winter rose
#

โ†‘ hassle it is

hollow thistle
#

It is.

winter rose
#

is.

meager heart
#

it

winter rose
#

.

#

hah, beat that!

hollow thistle
#

<period>

winter rose
#

ย 

#

better: \0 ๐Ÿ˜„

meager heart
#

KTHXBYE

winter rose
#

ARGH

#
</html>
_tcpClient.Close();
#

/quit doesn't work in Discord, right? ๐Ÿ˜„

daring pawn
#

@winter rose @hollow thistle cheers gents i'll sort something out

little eagle
#

bad channel

winter rose
#

?

little eagle
#

ikr

winter rose
#

@daring pawn with pleasure, tell us here if you need help for a server-side check

peak plover
#

@daring pawn spawn function on server adds required to spawn units to N array. The function spawns first unit, updates array and if there is another unit in the array, cba execute on next frame the same function, but this time don't add more units

So this time the function spawns a unit from array and removes the spawned one from array, deletes from array and runs same function again

#

On next frame, cba bless

daring pawn
#

So im back (sorry) with another semi issue.

15:44:05 Performance warning: SimpleSerialization::Write 'PMF_ActivatedLocations' is using type of ',LOCATION' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types

When saving the location to an array then publicVariable that array

winter rose
#

PMF_ActivatedLocations
?

#

what is it

daring pawn
#

An array

#

created by _nearbyLocations = nearestLocations [position player, ["Invisible"],800];

little eagle
#

willi, some data types are not meant to be sent over the network. E.g. TEXT and LOCATION.

daring pawn
#

I assume its bad for delay?

little eagle
#

LOCATION transfered doesn't make sense anyway, because locations are local things.

#

I assume its bad for delay?
It doesn't really matter for traffic unless you sent them in loops or something. But for LOCATION, it will be locationNull everywhere else anyway.

daring pawn
#

It's related to my lack of knowledge and doing something in a way that'd probably cause you to throw up

#

In regards to that, all the locations i've got on both client and server

peak plover
#

Locations are c
Local obly

#

Local only

little eagle
#

They're different objects on all machines though.

daring pawn
#

Oh i see

amber eagle
#

hello, is there any simple option to hide all messages when someone is joining server, killed by someone etc

errant jasper
#

For the latter set DeathMessages to 0 on the server profile.

amber eagle
#

thanks @errant jasper but i need to disable chat totally

errant jasper
#

AFAIK that is not possible. You might disable most ingame chat by disabling the channels for players, but do not think you can remove the player joined server messages.

amber eagle
#

im thinking about client side mod to disable this

storm crow
#

There is a way to remove player joined server messages but I cannot remember the way.

little oxide
amber eagle
#

@little oxide i tried this but not working

little oxide
#

That's working for me

amber eagle
#

you are this in script like init or description.ext?

peak plover
#

Lock the server, no players = no messages

amber eagle
#

๐Ÿ˜

little oxide
#

in the initplayerlocal, i'm waiting the spawn of player, and executing it

amber eagle
#

ok, thanks

winter dune
#

by creating a simple object on client side, the client will create that object only locally?

winter rose
winter dune
#

thanks

#

missed the global pic

grizzled cliff
#

yawns

still forum
#

Ze Nou is bak

#

First message for... 14 months ๐Ÿ˜„

grizzled cliff
#

haha

little eagle
#

๐Ÿ‘€

modern snow
#

How do I connect to a server with a button in sqf?

winter rose
modern snow
#

@winter rose Thanks

winter rose
#

๐Ÿ‘

gleaming cedar
#

How do I make it whenever I shoot on a tank it instandly explodes?

#

I currently got this

#

this addEventHandler["Hit", {"setDammage 1"}];

#

Anyone knows how to make a tank explode even when you hit it with like a pistol

#

its for a mission

still forum
#

spawn a bomb AND setDamage 1

#

also setDamage not setDammage

winter rose
#

also (_this select 0) setDamage 1

gleaming cedar
#

What do you mean by spawn a bomb

little eagle
#

setDamage is also a binary command.

earnest path
#

Hey guys. What is the right command to use to play sound from the server onto an object in the 3DSpace if you have an ogg file

gleaming cedar
#

Wow wow its my first missions guys haha XD

modern snow
#

lol

gleaming cedar
#

this addEventHandler["Hit", {"(_this select 0) setDamage 1"}];

#

So like this?

winter rose
#
myTank addEventHandler ["Hit", { (_this select 0) setDamage 1; }];
gleaming cedar
#

Thanks let see if that works ๐Ÿ˜ƒ

little eagle
#

Hey guys. What is the right command to use to play sound from the server onto an object in the 3DSpace if you have an ogg file
If the object moves or it is a mission, remote exec say3D, if the object stands still and it's an addon, local playSound3D.

earnest path
#

Thank you commy2 i will try say3D with remote exec

little eagle
#

Even for mission, of the sound is inside the game files and the objects stands still, playSound3D.

earnest path
#
class CfgSounds
{
    class SndExileNGRobbery
    {
        name = "";
        sound[] = {"\sounds\shop_robbery.ogg",1,1};
        titles[] = {};
    };
};
["SndExileNGRobbery"] remoteExec ["say3D", _playerObject, false];
#

I have this code but it does not play anything in game so weird

#

the file is in the mission pbo

#
[player, "SndExileNGRobbery"] remoteExec ["say3D", player, false];  =>DOES NOT WORK
player say3D "SndExileNGRobbery"  => WORKS
little eagle
#

Check CfgRemoteExec if say3D is white listed,

earnest path
#

[_playerObject, "SndExileNGRobbery"] remoteExec ["say3D",-2]; THIS WORKS

inner swallow
#

@little eagle playSound3D needs an absolute file path, so kinda tedious to get working in a MP mission

little eagle
#

Did you read what I wrote and understand it? Doesn't sound like it to me.

earnest path
#

I did thank you for your help i was just doing things wrong

inner swallow
#

I didn't read properly ๐Ÿ˜…

little eagle
#

I meant SuicideKing. : /

astral tendon
peak plover
#

๐Ÿ‘๐Ÿป

gleaming cedar
#

Hello, how can I make AI shoot out of car in unit capture?

winter rose
#

Try captureFiring maybe

tough abyss
#

I think playSound3D is global, not sure about Say3D. On mobile atm

digital jacinth
#

playsound3d is indeed global. say3d needs to be remoteExec'd for all clients to hear

hollow lantern
#

can someone tell me why thats not working? sqf [(theHeli),["AddTread",1,"AddTread_Short",0, "AddHoldingFrame",1,"AddGunHolder",1,"BenchL_Up",0,"BenchR_Up",0]] call BIS_fnc_initVehicle; The benches of the MH-9 is still there

winter rose
#

2nd parameter should be third, add nil between theHeli and the array

#

@hollow lantern

hollow lantern
#

oh wow I missed that, thx

winter rose
#

๐Ÿ‘

hollow lantern
gleaming cedar
#

Guys

#

I want to attach a player to a car

#

But I still want the guy to be enable to look around

#

Is this possible?

winter rose
#

@hollow lantern the MH9 is not supposed to have guns, that's why I think

hollow lantern
#

@winter rose Guns? I just want to remove the benches

#

no guns at all

#

yes my code above is old, my new one is ```sqf
[air1, nil,["AddTread",1, "AddHoldingFrame",1,"BenchR_Up",1,"BenchL_Up",1]] call BIS_fnc_initVehicle;

winter rose
#

set gunHolder to zero then

hollow lantern
#

that does not change anything abviously

#

Benches != GunHolder

meager heart
#
_heli animateSource ["addbenches", 0, 1];
``` ^ https://gyazo.com/3a5e36528c7f9452312013981cc5d9c4
hollow lantern
#

nice thanks

inner swallow
#

Why not do this from the editor, btw?

#

Seems like a less painful way to go about it...

hollow lantern
#

because its not applying

winter rose
#

โ€ฆ?

hollow lantern
#

... if you try to apply that via vehicle customisations (editor) its not saving and when loading the mission the benches are still there

turbid thunder
#

Somehow for us, the editor doesn't apply the removal of benches when using the vanilla ingame vehicle appearance change menu

#

Unsure why that is, that's why we're looking for a workaround

meager heart
#
0 = this spawn {
    _this animateSource ["addbenches", 0, 1];
};
```into init filed ^ don't working ?
hollow lantern
#

this is working

#

we were talking about the vehicle customisations menu

#

so to answer why we took the scripted approach

winter rose
#

initVehicle page has been updated, look it up: Example 4, you can use a BIS_fnc var

meager heart
#

also you can do the same with this way

copyToClipboard str (animationNames cursorObject);     //--- Animation names
copyToClipboard str (getObjectMaterials cursorObject); //--- Materials
copyToClipboard str (getObjectTextures cursorObject);  //--- Textures
```and then this commands > `animateSource, setObjectTexture (Global) , setObjectMaterial (Global)`
#

well... up2u

unborn ether
#

How can you properly read getCenterOfMass? Does it return an offset array values as 0..1 of the possbile car size, or its not a coefficent?

winter rose
#

like "your mass centre is shifted 3m to the left"

#

[3,0,0]

unborn ether
#

So you can basically shift it to 10000 meters away and get some marvelous results?

#

bbr not again..

winter rose
#

bbr? bouncy bouncy rhino?

unborn ether
#

boundingBoxReal to get a max possible car width and lenght ๐Ÿ˜ฆ

meager heart
#

boundingBoxForReal๐Ÿ‘€

meager heart
#

is there any issues with addMusicEventHandler "MusicStart" ?
sometimes do not detects, when music played first time and works as expected on second and xx times for some reason...

unborn ether
#

@meager heart It might happens sometimes, if to be correct in two cases:

  1. Previous music interrupted with a new one (end of the track was not reached).
  2. When you start a music track from a specific second.

I think it's an engine issue of how the time is handled.

#

You also may notice that some music might interrupt randomly at this point.

meager heart
#

probably the second option in my case

unborn ether
#

Altho its floating, it happens in some random conditions

#
cursorObject setCenterOfMass [0,-100,0]

Made my pickup fly away and splash into a.. water on the ground to disappear totally

#

๐Ÿค” ๐Ÿ˜„

#

harry potter music here

meager heart
#

that against the law... the newton's law, don't try this at home arma

fossil yew
#

What would be the smartest way to design and develop some kind of generic "civilian job" feature? Using compositions with scripted behavior or something else?

#

For example, to help immersion, you want to add a market seller or a mechanic fixing the car or ... you get the picture

#

Adding these 'life' features so far is too much work with scripts

tough abyss
#

Anyone know how to use BIS_fnc_reviveOnState?

fringe yoke
#

@tough abyss I couldn't even find that function on the community wiki

tough abyss
#

Its not on there afaik

#

I've seen people post snippets of code using it but i can't figure out anything beyond what they posted because it's not documented

fringe yoke
#
Description:
    Used to execute specific code localy on every client whenever unit's state changes.

    Parameters:
        _this select 0: STRING - Variable that carries the state value over the network, defined by macro VAR_TRANSFER_STATE.
        _this select 1: SCALAR - State.
        _this select 2: OBJECT - Unit to set the status for.


    Returns:
    True if successful, false if not.

    States:
        #define STATE_RESPAWNED            0
        #define STATE_REVIVED            1
        #define STATE_INCAPACITATED        2
        #define STATE_DEAD                3

That's about all you're going to get for documentation

late gull
#

yup

#

can anyone point me what's wrong here:

_mkr = createMarker [format["grpMkr_%1", _index], [0,0]];
_mkr setMarkerPos _pos;
_mkr setMarkerShape "ICON";
_mkr setMarkerType "Flag";
_mkr setMarkerColor "ColorBlack";

allGrpMkrs pushBack format["grpMkr_%1", _index];
#

i can't see these markers

meager heart
#

your position is [0,0]

late gull
#

_mkr setMarkerPos _pos;

#

if that was the problem i should see it in 0,0 atleast xD

#

hmm, seems like "Flag" does not exits in arma 3

meager heart
#

also maybe type is wrong ? should be "hd_flag" or "mil_flag"

late gull
#

only arma 2

meager heart
#

yeah

late gull
#

hd_objective

#

another one

meager heart
late gull
#

do you think that

format["grpMkr_%1", _index]  setMarker... ...
#

will work?

#

yes, thanks, i was looking there, but i take one from arma 2 xD

meager heart
#

for the marker name with format

private _marker = createmarker [format ["marker_%1", _index], _markerPos];
late gull
#

yes but i'm want avoid creating var

#

i does not matter, just curious :p

little eagle
#

Never understood why people write it like this.

private _marker = format ["marker_%1", _index];
createmarker [_marker, _markerPos];
_marker setMarkerShape blah...

Seems nicer.

late gull
#

oki, will test that

meager heart
#

yep looks better and readableier* ๐Ÿ˜€

late gull
#

but in this way, will work with pushing back inside an array and then use that array to delet them dinamically?

little eagle
#

The marker? Sure, why not.

late gull
#
private _mkrName = format["grpMkr_%1", _index];
createMarker [_mkrName, [0,0]];
_mkrName setMarkerPos _pos;
_mkrName setMarkerShape "ICON";
_mkrName setMarkerType "mil_objective";
_mkrName setMarkerColor "colorOPFOR";
_mkrName setMarkerDir 0;
_mkrName setMarkerSize [0.25, 0.25];
_mkrName setMarkerAlpha 1;

allGrpMkrs pushBack _mkrName;

{
    deleteMarker _x;
} forEach allGrpMkrs;
little eagle
#

Yes.

late gull
#

oki, ty

little eagle
#

Not only is this more readable, it also explains what a marker type actually is. Just a string.

meager heart
#

with marker name

little eagle
#

It could be any string, maybe even one that doubles as object netId/ vehicle var name.

#

I'd tag them though, as marker names are global and they should interact well with other scripts, missions and mods.

fringe yoke
#

I'm a little confused with a script I am creating

private _counter = 0;
while {_counter < 360} do {
  _counter = _counter + 1;
  [-1,{systemChat format ["Created %1", _counter]}] call CBA_fnc_globalExecute;
};

I just get Created any in system chat

late gull
#

yes

#

you are using "private" outside from the while

#

private _counter and _counter are not the same var

fringe yoke
#

๐Ÿคฆ

late gull
#

this private _counter is not reachable inside the while loop

fringe yoke
#
_counter = 0;
while {_counter < 360} do {
  _counter = _counter + 1;
  [-1,{systemChat format ["Created %1", _counter]}] call CBA_fnc_globalExecute;
};

Still get Created any

#

Nevermind

late gull
#

double check that you recompile(pbo) xD

fringe yoke
#

globalExecute

still forum
#

@late gull please stop lying

cosmic lichen
#

use remoteExec

still forum
#

private prevents variables from higher scopes from being overwritten. That's it.

late gull
#

@still forum in whaT?

still forum
#

@fringe yoke local variables don't carry over into new scripts

#

@fringe yoke keep the private

fringe yoke
#

I've already reverted after I saw that globalExecute was the cause

late gull
#

so killzonekid lyed to me, that's what i read from the blog

still forum
#

globalExecute still works fine. I always use that.

#

no that's not what you read from his blog

#

you probably missinterpreted something

late gull
#

yep so, or it's too old

fringe yoke
#
private _walls = [];
private _counter = 0;
while {_counter < 360} do {
  private _w = _wall createVehicle (_pos getPos [150, _counter]);
   _w enableSimulationGlobal false;
   _walls pushBack _w;
  _counter = _counter + 1;
};
[-1,{systemChat format ["Walls: %1", _this]}, count _walls] call CBA_fnc_globalExecute;

I get Walls: 0

#

not sure why

still forum
#

0 doesn't make sense

#

oh wait

#

๐Ÿค”

fringe yoke
#

_wall is "VR_Billboard_01_F" which is just a simple VR wall

still forum
#

what if you check the content of _walls before the globalExecute?

late gull
#

can i ask, where this _this comes from?

fringe yoke
#

replacing _wall with "VR_Billboard_01_F" worked, not sure why it didn't like _wall. It was defined. Doing diag_log _wall showed "VR_Billboard_01_F" in the rpt

still forum
#

what?

#

no _wall was not defined

#

_w was

#

oh wait. That _wall up there

#

no. according to your script that was not defined

fringe yoke
#

That wasn't the entire script

private _wall = "VR_Billboard_01_F";
private _pos = [nil, ["water"]] call BIS_fnc_randomPos;
missionNamespace setVariable ["MISSION_CENTER", _pos, true];
private _lighthouse = "Land_LightHouse_F" createVehicle _pos;
_lighthouse enableSimulationGlobal false;
sleep 20;
missionNamespace setVariable ["MISSION_STARTED", true, true];
[-1, {
  [300, "#00ccff"] spawn synixe_scripts_fnc_countdownTimer;
}] call CBA_fnc_globalExecute;
//walls
private _walls = [];
private _counter = 0;
while {_counter < 360} do {
  private _w = _wall createVehicle (_pos getPos [150, _counter]);
  _w enableSimulationGlobal false;
  _walls pushBack _w;
  _counter = _counter + 1;
};
#

Not sure why it didn't like _wall on the createVehicle line, but replacing it with the string literal worked, so whatever I guess.

late gull
#

just to get 100% that i read wrong somewher, can u remove private?

still forum
#

removing private can break scripts that call your script

#

if you have the same variable name as them. You'll overwrite their value

#

also private makes your script faster

fringe yoke
#

what?

#

why would it make it faster?

#

oh nevermind, smaller variable scope* probably

still forum
#

because when you set a local variable. It looks through all scopes, going upwards trying to find if anyone was already using that variable

#

because it would've to overwrite the variable in a higher scope if it existed

#

with private it knows it doesn't have to do that and immediately set's the variable

late gull
#

hmm, that help's me to understand

#

i should had test that time ago:

private _a = "ok";
if (true) then { hint str _a; };

๐Ÿคฆ

#

i swear, i read somewhere that _a will be not reachable inside this if

errant jasper
#

You should not read such things.

late gull
#

hahaha

#

god bless discord

#

btw, when you are getting params, u don't need to use private for those params huh?

#

they are supossed to not be overwrite

still forum
#

params does it internally

late gull
#

ok

still forum
#

params ["_var"] is equal to

private _var = if (_this isEqualType []) then {
if (count _this > 0) then {_this select 0} else {_defaultValue};
} else {_this};

or private _var = _this param [0, _defaultValue]

where _defaultValue is nil in this case

late gull
#

ok, thx

little eagle
#

Wew, this chat is hard to stomach for me ๐Ÿคข

meager heart
#

(ใคยฐ_ยฐ)ใค๐Ÿ’Š

errant jasper
#

In that case you should give a blue pill instead of a red pill.

late gull
#

@errant jasper it's you Morpheus?

errant jasper
#

Unfortunately no, i'm just, "It's a me, Mario".

late gull
#

๐Ÿ˜ฉ ๐Ÿ˜„

meager heart
#

hides

earnest path
#

Any ideas why when i do this on the server as a script i get numbers like 486311 but when i do it from the client i get the number i expect ?

        _timeout = floor(serverTime) + 300;
        _group setVariable ["NG_Timeout", _timeout, true];
errant jasper
#

If you are using CBA you might try CBA_missionTime. Personally I just do #define time CBA_missionTime.

earnest path
#

I do not have CBA. I would like to not be dependent on mods

#

Do you have any suggestions to alternative time pointer i could use for this

errant jasper
#

AFAIK time is still not reliable in MP since it drifts away.

#

Depending on what you need the timeout for, e.g. if only the server checks anyway, you don't need synchronized time. When the timeout is up the server just does it's thing.

earnest path
#

I just want to kill a group after a while

#

So exact time is not a must.

#

However with my current script i get 400311 rather than 380 for instance so its a lot different

errant jasper
#

If you don't need exact then just use time .

earnest path
#

Thank you i will try it now

inner swallow
#

can't you just use sleep though?

winter rose
#
[myGroup, 120] spawn {
   params ["_group", "_duration"];
   sleep _duration;
   { deleteVehicle _x } forEach units _group; // or setDamage 1
   deleteGroup _group;
};
errant jasper
#

And if you need to remove any vehicles crewed by the group:

private _vehicles = (units _group) apply {vehicle _x} - (units _group);
_vehicles = _vehicles arrayIntersect _vehicles;
{deleteVehicle _x} forEach _vehicles;```
gleaming cedar
#

Guys
I want to attach a player to a car
But I still want the guy to be enable to look around
Is this possible?

meager heart
#

afaik no

gleaming cedar
#

I want to capture ai on a car shooting and moving around in unit capture

#

Thats what I am trying to make

#

So I though what if I attach the AI to a car, record it shooting and then play it

#

But when I attached I couldn't look around with the AI

#

So anyone maybe know a method I can get this working?

astral dawn
#

Hello guys. What's the best way to write object-oriented SQF? oop.h seems pretty good out here, did anyone try to use it?

gleaming cedar
#

Anyone??

astral dawn
#

So you want him run over a car and shoot around?

#

oh wait sry i wasn't aware of unitcapture

gleaming cedar
#

Like I want to attach a player to a car

#

But still enable him to look around

winter rose
#

you may have a solution with remoteControl, and setDir

#

it will be ugly though

loud python
#

does anybody happen to know what class editor Modules are so I can filter them out from an array of objects?

gleaming cedar
#

Guys

#

Is it possible to like disable the sound of a helicopter?

#

Like if my heli is called heli1

loud python
#

none that I know of

errant jasper
#

Believe they are logics. But right-click on one in editor, and open config viewer and check.

loud python
#

oh, that's right, you could open config editor from context menu...

gleaming cedar
#

What config should I disable just sound?

loud python
#

it's Module_F>Logic>All

#

thanks โค

gleaming cedar
#

Is there a way to force lights off?

inner swallow
gleaming cedar
#

A thanks

#

Is there a way to remove recoil off a gunner?

#

I have a script that a unit shoots

#

But when it shoots automatic

#

It goes all in the air

#

XD

#

this setUnitRecoilCoefficient 0.3;

#

I tried this doesnt work

#

got it

#

i use now

#

player6d fireAtTarget [player3d,"LMG_Minigun_Transport"];

hollow thistle
#

So I've scripted event that is executed globaly from server. Handlers for this event receive player that triggered it as param.

Will checking if _paramPlayer == player be enough to determine if local client is the one that fired the event?

inner swallow
#

if you're doing that check on the server, then no, because player is not defined on the server

wary vine
#

is it not possible to do isClass (missionconfigfile >> "blah") on serverside on startup ?

still forum
#

preInit

wary vine
#

yup

#

I just worked around it

#
[] spawn {
  waitUntil {time > 0};
  private _check1 = isClass (missionconfigfile >> "Lega_xPhone_usablesMain");
  private _check2 = isClass (missionconfigfile >> "xPhoneMain");
  diag_log format ["FUCK ARMA %1 -- %2", _check1, _check2];

  if !(_check1 || _check2) exitWith {[] execVM "\Lega_Core\errors\MissionError.sqf"};
};
#

should work right ?

still forum
#

why the spawn and waitUntil?

wary vine
#

in the preinit .

#

it doesnt seem to be working anyway xD

still forum
#

should though

wary vine
#

im gunna start without it a second just to make sure the paths are correct on the includes/.

inner swallow
#

doesn't time only progress after init?

still forum
#

yeah.

wary vine
#

i had a ; on my include my phone is finally finished

late gull
#

guys, how i can add a BIS_fnc_holdActionAdd to a object

#

not in editor/init

#

object spawned by script

#

doing:

[
  device2,
  "Hack",
  "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",
  "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",
  "_this distance _target < 3", "_caller distance _target < 3",
  {},
  {},
  {device2Done = true;},
  {},
  [],
  5,
  0,
  true,
  false
] remoteExec ["BIS_fnc_holdActionAdd", [0,2] select isDedicated, device2];
#

does not work

#

got this in RPT
Trying to target client #2 during JIP when calling RemoteExec(Call) 'bis_fnc_holdactionadd'. Target must be 0 for JIP

still forum
#

you are passing device2 as JIP parameter.. why?

late gull
#

example in de function documentation, i dont understand remoteExec

still forum
#

Well. Just read what it says

#

you are passing 2 ([0,2] select isDedicated) But you are only allowed to pass 0

late gull
#

so that example it's wrong?

still forum
#

yes

late gull
#

i did test it in editor, and works without problem

#

hmm ok

still forum
#

Yes.

#

Because editor is not isDedicated

late gull
#

ok, thanks

still forum
#

that code is complete nonsense..

#

isDedicated returns true when you are on a server. And 2 only executes on the server.

#

So that thing says. If you are the server then only execute locally.

#

just remove that and just pass 0

late gull
#

ahh oki, thanks

#

but wait, what about device2 in the end?

#

nvm, it's ok

#

i readed the remoteExec docs

inner swallow
#

@still forum it should be [0,-2]

still forum
#

I think @little eagle knows something about why that's useless

inner swallow
#

well, if using -2 is also useless then that's news to me

#

because When number is negative, the effect is inverted. -2 means execute on every client but not the server

winter rose
#

someone here said that [0,-2] select isDedicated was stoopid and should not be used, period - commy2 maybe indeed

#

@inner swallow your comment may disappear if we correct/remove the example part

little eagle
#

Yes, I did, because yes, it is.

winter rose
#

while I tend to agree on the matter, may I ask you what makes you think it is always a bad idea?

little eagle
#

I haven't found one time where it is a good idea, where as I found lots of times where it was a bad idea.

winter rose
#

scenario case, when you have to use a script calling "player"?
(but I agree, the script itself should check if isNull player)

little eagle
#

A script like that should just use

if (!hasInterface) exitWith {};

as first line in the script.

#

That way it also not-runs on a headless client.

winter rose
#

I think the point of this issue is
you could, but are you sure you need

in a way, be sure to know what you do else use 0

little eagle
#

There is absolutely no point in using -2 though. And every time you do use it, you open yourself up for bugs, even if small ones, and faulty code.

winter rose
#

OK, anyway no-one brought up a good use of it so far

#

removing it from holdActionAdd

inner swallow
#

wait hold on

#

so the point is

#

using 0 means it's run everywhere

#

including on the server

#

which is pointless

errant jasper
#

Depends... Server might have a player.

inner swallow
#

yeah, hence the select statement

#

on a dedicated server asking it to run at all seems like a waste of cycles

#

but, if the engine optimises for it, then i guess it's useless

#

i.e. doesn't add actions to things without an interface

little eagle
#

on a dedicated server asking it to run at all seems like a waste of cycles
Same for a headless client. The only safe way is to use a hasInterface in the script. -2 method wastes cycles on hc's.

inner swallow
#

or for example if you wanted to setObjectTexture to all players

#

so you're suggesting putting the addAction/setobjectTexture/whatever thing in a separate script that has a hasInterface check in it?

#

and then running the script via remoteExec?

little eagle
#

The C++ check that aborts setObjectTexture is less computation time than the select isDedicated.

#

Also, bad example, since we have setObjectTextureGlobal which is JIP compatible.

winter rose
#

(deleted wrong code ;^)

inner swallow
#

setObjectTextureGlobal can be unreliable

#

it doesn't set the JIP flag afaik

little eagle
#

That's the first time I've heard of that. I have my doubts about that.

inner swallow
#

I've been complaining about this for years now, and we've discussed this before

#

Been experienced by a lot of people

little eagle
#

You mean any global command executed from the init event?

inner swallow
#

yeah

#

basically

little eagle
#

Who does that?

inner swallow
#

A lot of us try ๐Ÿคท๐Ÿฝ

#

although now i try and use initPlayerLocal

little eagle
#

The only way to use init events is to write the config or use CBA. I have my doubts lot of people here do that regularly.

inner swallow
#

but even then, if you use initPlayerLocal, and need to change all player textures, it's not reliable to use setObjectTexture global

#

wait i misunderstood you

#

i thought by init event you meant init box

little eagle
#

initPlayerLocal is some scheduled script, not an init event.

#

Yeah, and the init box isn't the init event either. Init box is compatible with global commands.

inner swallow
#

it's not reliable though, because players don't initialise at the same time.

errant jasper
#

Well, sort of. You probably want to wrap the init box in isServer then.

inner swallow
#

even then.

#

We've seen this happen consistently

little eagle
#

it's not reliable though, because players don't initialise at the same time.
Do you have a repro for that? Because that doesn't sound real to me.

inner swallow
#

the repro depends on enough people joining the mission

little eagle
#

And how would RE help that? This doesn't sound right to me.

inner swallow
#

because it sets the JIP flag

#

okay, i'll type out the full context

little eagle
#

Idk what JIP flag you're refering to.

inner swallow
#

the last argument of remoteExec

#

which you can set true/false

little eagle
#

I know, but you don't need to use the RE JIP stack if the command itself causes the server to tell a JIP client what texture to use.

inner swallow
#

yes, i'm saying i highly doubt it does that (the command)

little eagle
#

You doubt that setObjectTextureGlobal has global effects that persist for JIP?

inner swallow
#

yes

#

no

#

wait

#

i don't doubt it has global effects

#

i do doubt it persists for JIP

little eagle
#

Luckily this can be tested.

errant jasper
#

Well, Sxp2hiiigh disagrees.

#

I do too, but I wouldn't bet my money on it though.

inner swallow
#

who?

errant jasper
#

See the comment section for setObjectTextureGlobal

#
  • notes section
inner swallow
#

i dunno, maybe it broke along the way?

little eagle
#

All* global commands are synched on JIP in Arma 3 afaik.
*stuff like playSound3D

inner swallow
#

I've even had issues with setPosATL

errant jasper
#

Can you repro that? In that case would be a serious bug in the engine

inner swallow
#

I can, but i don't have access to arma until august

#

so i can at most describe a test case

little eagle
#

Well, position will not synch if you disable simulation.

inner swallow
#

I had to do this, basically

[UnitCSAT_SUR1, _spawnLocation] remoteExec ["setPosATL",UnitCSAT_SUR1,true];```
#

this is a script that's execVM-ed at the end of init.sqf, runs only on the server

#

wouldn't work without remoteExec

errant jasper
#

Well it runs only on one machine regardless ?

little eagle
#

This sounds only "useful" if UnitCSAT_SUR1 had it's simulation disabled, therefore network synching of the positions disabled.

inner swallow
#

i have not explicitly disabled it so i dunno about that.

errant jasper
#

Is it playable unit?

inner swallow
#

yup

#

it would work fine on localhost

#

crapped out on dedicated server

errant jasper
#

How did you do it before, when it did not work?

little eagle
#

To get back to the original topic, this overuse of RE seems to cause a lot more wasted network traffic than not doing -2 loses computation time on the server.

inner swallow
#

just setPosATL

errant jasper
#

Where? init.sqf ? init box?

inner swallow
#

this is a script that's execVM-ed at the end of init.sqf, runs only on the server

#

same

#

These were two units in the same group. On localhost, both get teleported. On DS, if i slot one, i would not get teleported, whereas the AI would, if my memory servers me correctly.

winter rose
errant jasper
#

Well, in that case if the slot was taken by a non JIP it would be interesting, since that would mean the player was not ready at the time - and that should be fixed in the engine. For JIPs it is obviously broken with just using setPosATL on the server.

inner swallow
#

I will admit i can't make much sense of the conversation on that talk page

#

is KK asking him to do exactly what he's doing?

#

actually no, nevermind, i think i see the difference.

winged narwhal
#

dose anyone know how to set refuel point/function?

errant jasper
#

Yeah, he ran the global command globally, and did not know it did not work with mission paths.

inner swallow
#

but then... if he's using (isServer) then is he not using the global command just once?

errant jasper
#

Yes, then he is using it once.

#

But that was the local command using RE.

inner swallow
#

or is the problem that the paths are different and the server is now asking clients to use the wrong path?

meager heart
#

imo that setPosATL will fails 100% you need isNull check first, SuicideKing

[UnitCSAT_SUR1, _spawnLocation] remoteExec ["setPosATL",UnitCSAT_SUR1,true];
```โ†“
```sqf
if (!isNull UnitCSAT_SUR1) then {
    [UnitCSAT_SUR1, _spawnLocation] remoteExec ["setPosATL",2];
};
```also you can stop using init.sqf already ๐Ÿ˜€
errant jasper
#

There were two problems.

  • Initially he was using the global command globally.
  • The global command does not work well with mission paths since they differ on clients.
#

The solution to the first is to wrap in isServer. A solution to the second is to apply the local command with the same arguments globally.

#

Because there were two problems, is also the reason the discussion page can be a bit confusing.

inner swallow
#

ahh, i see

#

yeah i think it's possible then that the second problem is what we keep running into

errant jasper
#

So for a non-mission image, what I believe (and commy2 if I got that right), is that you only really need to run the global setObjectTextureGlobal once, say on the server, and it would also remain JIP compatible (assuming no other script modifies stuff).

little eagle
#

Yes.

inner swallow
#

i see

#

thanks

little eagle
#

Doesn't mean I'm saying it could not be bugged, but I've never seen it bugged.

inner swallow
#

I can't be sure now, since i think we were running into the second issue, as we always use isServer

#

will ask people to try it KK's way and see what happens

#

@meager heart the full segment was

if !(isNil "UnitCSAT_SUR1") then
{
    //UnitCSAT_SUR1 setPosATL _spawnLocation;
    [UnitCSAT_SUR1, _spawnLocation] remoteExec ["setPosATL",UnitCSAT_SUR1,true];
    _flag1 = 1;
};```
i just posted the most relevant part. Although i'm using isNil for whatever reason ๐Ÿคท๐Ÿฝ
peak plover
#

^

#

U need isNil

#

If unit is not slotted

#

the variable is not defined

#

isNull would error

errant jasper
#

Also after first JIP leaves? Won't it get nulled then?

inner swallow
#

I dunno. But this is known to work ๐Ÿ˜„

#

i was probably checking for it existing, while sldt1ck was checking for the player being initialised

#

i think

peak plover
#
private _unit = missionNamespace getVariable ['unitcsat_sur1',objNull];
if (!isNull _unit) then {
//fun stuff
};
#

Also where does this run?

errant jasper
#

I would use that ^^ just so I don't have to do elaborate testing to discover the true behaviour ๐Ÿ˜ƒ

#

You run that in init.sqf in an isServer check correct?

inner swallow
#

ah, i see i have commented out the old code that wasn't working

#

yes

#

actually no wait

#

the script has an isServer check

#

but the script is run from init.sqf

#

not inside init.sqf

#

if you know what i mean

errant jasper
#

Okay, but it runs from init.sqf on the server only?

inner swallow
#

er. no... but it quits on the clients.

#

first line is if (!isServer) exitWith{};

errant jasper
#

okay then.

meager heart
#

also if runs on the server why re ?

inner swallow
#

because it wasn't working without RE

peak plover
#

Argments global Effects global

inner swallow
#

I know

peak plover
#

Also works without RE on my machine ๐Ÿคท๐Ÿป

inner swallow
#

purportedly

errant jasper
#

Well, I admit I have worries that:

  • If no player takes that slot when the mission starts, then the server won't RE the setPosATL because isNil.
  • If there is a player on that slot, then it will RE and the JIP tag will be set. But when the player disconnects, according to remoteExec the JIP "ticket" is removed. Then when another takes the slot, nothing will happen.
inner swallow
#

note how i've commented out the part without RE

#

Muzzleflash that's fine

#

it just needs to happen once

#

in fact that's intended

#

actually, i must add that we enable AI slots

#

so if a player leaves, teh AI still exists

errant jasper
#

Oh alright then. Well that fixes my second bullet point, but does not consider the first one? Perhaps it does not need to happen there either?

inner swallow
#

Ah, no it does

#

It's a rescue mission and stuff

#

so they're being moved to a randomised location (among a set of hand picked locations)

#

if they're in the open they'll probably die pretty soon ๐Ÿ˜„

#

So if i don't have the isNil check, i'm assuming it'll complain about not being able to find the target unit

#

or maybe it just fails silently, i don't remember

#

but yeah it seemed dumb to try and move something that doesn't exist

#

hmm coming back to the setObjectTextureGlobal for a moment

#

would the path differences between server and client also matter in the case of textures that are included in the game?

errant jasper
#

Not for addon textures

inner swallow
#
if (local _unit) then
{
    [_unit, [0, "\a3\characters_f\OPFOR\Data\clothing_rus_co.paa"]] remoteExec ["setObjectTexture", 0, true];
    [_unit, [1,"\a3\characters_f\OPFOR\Data\tech_rus_co.paa"]] remoteExec ["setObjectTexture", 0, true];
};```
like this for example?
errant jasper
#

That path should be fine for the global version

inner swallow
#

hmm. it wasn't working.

errant jasper
#

These are vanilla items? Looks like it.

inner swallow
#

yeah

errant jasper
#

Gimme 2 mins - firing up the old computotron.

inner swallow
#

unused russian uniform textures

#

thanks

#

wasn't working in dedicated, particularly

#

i think the easy way to test this would be to make some 14 or so CSAT rifleman slots, and plop that code into initPlayerLocal.sqf

#

and change _unit to player

errant jasper
#

How are you running it?

inner swallow
#

well, tried in many ways. directly from the init field, execVM-ing a script from the init field, then eventually added it to F3's Assign Gear script since we use F3.

#

Since I'm on my laptop, this is an older version of the mission, at which point i think i was using the second method.

#

I think I started off by execVM-ing the script from init.sqf

#

(oh, F3 assign gear is called from the unit's init box)

#

and change _unit to player
that won't work with AI obviously, though.

#

since that was the most elegant way to do it

meager heart
#
[cursorTarget, [0, "\a3\characters_f\OPFOR\Data\clothing_rus_co.paa"]] remoteExec ["setObjectTexture"];
[cursorTarget, [1,"\a3\characters_f\OPFOR\Data\tech_rus_co.paa"]] remoteExec ["setObjectTexture"];
```on local host ^ https://gyazo.com/8c25fa9c362ca96ce2b4c2789df744f3
inner swallow
#

it's for CSAT uniforms

#

that's not a CSAT uniform ๐Ÿ˜›

meager heart
errant jasper
#

Hmm, it does seem it can be run too quickly. In my test case (not using RE) it works for JIPs but not for non-JIPs.

#

I try both the local and the global (on different subjects).

#

If I run

this setObjectTexture [0, "\a3\characters_f\OPFOR\Data\clothing_rus_co.paa"]```
in init box of soldier, I can find no reason why it should not work for player joining dedicated as non-JIP, but work for JIP. If I spawn a 1s sleep before doing it, it works.
meager heart
#

spawn it maybe ^

errant jasper
#

As I say, yes then it works.

#

But you shouldn't have to.

inner swallow
#

people would either run the command 5 times consecutively

#

or like me add a sleep thing

#

i found the former too un-elegant though

#

don't remember why i stopped using sleep

#

probably found the RE method nicer

#

we also had the issue where JIP clients (slotting into AI enabled slots) couldn't see the texture on other players

#

it was very messy, some had the textures and some didn't

meager heart
#

anyone have experience with scripted guard points in a3 ? what is default area radius ?

#

createGuardedPoint < this point i mean

gleaming cedar
#

Guys

#

player6d fireAtTarget [player3d,"LMG_Minigun_Transport"];

#

Why is this now working

#

player6d is the shooter and player3d is the person beeing shot

#

I put this in a loop

#

But the player6d shootes but it doesnt aim on player3d

meager heart
#

afaik fireAtTarget < for vehicles only

gleaming cedar
#

I did got it working

#

I put this in an ai

#

And it works

#

Or should I not name the player but the vechile

#

Like

#

car1 fireAtTarget [player3d,"LMG_Minigun_Transport"];

#

Like this?

#

?

frail ledge
#

fireAtTarget wont target the object by itself. You need to use doTarget before.

meager heart
#

something like this maybe

//--- vehicle
_gunner doWatch _target;
waitUntil {_vehicle aimedAtTarget [_target] > 0.5};
_gunner fireAtTarget [_target];
//--- unit
_unit doWatch _target;
waitUntil {[objNull, "VIEW"] checkVisibility [eyePos _unit, aimPos _target] > 0.5};
_unit forceWeaponFire [weaponState _unit select 1, weaponState _unit select 2];
runic rose
#

@inner swallow Put this command in your gear script with a sleep after you've assigned the players uniform;
_unit spawn { sleep 0.1; _this setObjectTextureGlobal [0, "\a3\characters_f\OPFOR\Data\clothing_rus_co.paa"]; };

fringe yoke
#

Is there a way to display the IDs for the game ui. I have a few IDs I have found online, but is there some tool to find them myself?

inner swallow
#

@runic rose thanks, although now for me the question is, why do this over remoteExec?

still forum
#

@fringe yoke you usually look into the config viewer to find them

wary vine
#

is there a way to check if a postion is actually on the map ?

meager heart
#

with mapGridPosition maybe

wary vine
#

hm

robust hollow
#

as in if it is in the marked map or out in the black?

wary vine
#

ye

#

im trying to make it work on anymap xd

#

[[(worldSize / 2),(worldSize / 2),0],0, (worldSize / 2), 10, 0] call BIS_fnc_findSafePos; what im using to find the positions

#

but sometimes its outside the map

robust hollow
#

check ur x and y coords if they are < 0 or > worldsize.

wary vine
#

ye

#

good point

meager heart
#

no idea what it does lol

wary vine
#

old version of worldSize I guess

#

call BIS_fnc_mapSize; // equivalent to worldSize

winter rose
#

But you can grab other worlds size with this one

fringe yoke
#

Is there an event handler for a marker being placed in the map?

winter rose
#

User marker I guess?

fringe yoke
#

If a person opens up their map, and creates a marker