#arma3_scripting

1 messages ยท Page 256 of 1

tough abyss
#

And about swinging.meatball solution:

#

"@little eagle if you are having problems with positioning ragdolls, just make sure its done locally, and try utilizing it in unscheduled environment with enableSimulation false commands
for instance, _obj enableSimulation false; _obj setPos _pos; _obj enableSimulation true; _obj setPos _pos; Should work guaranteed, because second setpos will be interpolated correctly and broadcasted."

#

This can be garanteed yes, but not garanteed for the client where the body is local, because enableSimulation false does nothing to hin.

#

Next attempt... make the body local to server, and use meattball solution from the server.

#

And i'm so tired to open a bug ticket ๐Ÿ˜› lol

#

i tried nearObjects [["typeName", "typeName2"], radius]

#

but did not work

#

@tough abyss i believe nearObjects only accepts one class name.

#

You can try nearestObjects.

#

It accepts more than one class name.

#

Or you can do many nearObjects and join the resulting arrays.

#

ty

#

I know i ask too much... buta: i have a group that is ONE unit, this unit is hosted in a client. If the unit dies the body continues to be hosted by the client. To change the body ownership to the server i need to use setOwner or setGroupOwner? ๐Ÿ˜„

tough abyss
#

@little eagle hideobject works ok with dead bodyes!

#

Done.

#

For what i want, i don't even need to move the body, but just hide it, and del it after 1 minute. So the weapon felt from the body remains on ground for 1 minute. If the unit have currentWepon == "" when he got disabled so it will drop no weapon on ground and i can safelly delete the body on revive.

broken mural
#

What would the correct syntax be for sending params to an sqf called here?
this addAction["interact", "interact.sqf" ,null, 6];

round scroll
broken mural
#

@round scroll I should clarify; interact.sqf requires a few parameters such as the object that's calling the sqf file. How would I pass that? Where would the array be added?

For example,

#

I'd call interact.sqf by itself like this;
["BluFor] execVM "interact.sqf";

round scroll
#

I'd guess it's ["BluFor"] then as array and you can retrieve the array with _this select 3 in the addAction, please check the wiki page

broken mural
#

@round scroll apparently I wasn't clear enough in my question. I figured it out by trying random crap as the wiki says nothing about calling sqfs with params. The correct syntax for what I was asking about is
this addAction["interact", {["BluFor"] execVM "interact.sqf"},null, 6];

note the portion where I would call the interact.sqf
{["BluFor"] execVM "interact.sqf"}

dusk sage
#

Well, that's executing code

#

you can put the function in, then use the arguments index

broken mural
#

Sorry @dusk sage, I'm new to the language. Where would the params be declared? If all the object contains is this addAction["Interact", "Interact.sqf", null, 6]; how does it know to send, say, the specified location, color, team, etc?

vague hull
#

ok, can somebody confirm that
private ["_blah"]; works but
private _blah = XXXX;
doenst?

#

I am really confused... private _bah = XXX; seems to stop working after a certain depth

dusk sage
#

Arguments - check the wiki @broken mural

vital onyx
#

private _bah = XXX; works for me, make sure you are calling this variable from a proper scope.

broken mural
#

I see what you were talking about now, @dusk sage & @round scroll . Thanks for the patience.

#

Can you use mission parameters in object init fields? I want some objects to only have an addAction if the mission parameter dictates that side.

round scroll
#

@broken mural maybe check isNil and isNull for the parameter variable or whatever it is initialized too

tough abyss
#

I used Baskara function to calculate damage on BRPVP. Yay!

#

d1 = general damage (part "");

#

d2 = average damage of other parts (legs, chest, head etc);

#

D = BRPVP damage D(d1,d2) = d1 + (1 - d1) * d2;

#

If you define D and want d1 = d2 = d, then d = (-2 + sqrt(4 -4D))/(-2);

#

D is a way to represent player damage with one number. "damage _unit" des not suffice because some damages dont generate general damage (part ""), and others damages only generate general damage (part "").

vocal mantle
vague hull
#

@vital onyx i define them at the very beginning of the file, yet they stop working in some scopes

#

What do you mean with "proper" scope?

scarlet spoke
#

@vocal mantle what for do you need an external debug console? Does it have more features than the built-in one?

clear tendon
#

maybe run it without the game running ๐Ÿ˜‰ ? but he said extension based, not external ๐Ÿ˜›

scarlet spoke
#

That would be awesome if someone took the time to write an SQF interpreter... ๐Ÿค”

jade abyss
#

Not that again

vital onyx
#

@vague hull do you have a code sample with not working private var?

indigo snow
#

"certain depth" are you using spawn or eventHandlers ?

vague hull
#

I will pm you tomorrow night or something, currently not at home

vocal mantle
#

@scarlet spoke It was mostly a coding excercise. As a starting point I wanted to make it just as good as the built in one.

vital onyx
scarlet spoke
#

Ah okay :)

broken mural
#

are global variables static? Meaning if incriment the global int by 1, is it seen as incrimented by 1 across all clients ans scripts?

austere granite
#

all clients no. You will always need publicVariable to make it known to other clients again

#
randomVar = 1; 
publicVariable "randomVar"; 
randomVar = 2;

Would make it 1 on all clients other than the one where its ran

#

All scripts yes

tough abyss
#

Good day! Next step of my mod: sell stuff. Can a empty backpack be stored in the uniform or in a vest? Thankyou!

meager granite
#

What can be stored in what is defined in ItemInfo >> allowedSlots

tough abyss
#

I have a dialog called "Introscreen" as in class Introscreen and I need a seperate script to execute a closeDialog on the dialog itself because otherwise "reserved_slot" call BIS_fnc_endMission; doesn't work. unfortunately closeDialog 0; doesn't seem to work in the seperate script. Is there a way around this? either executing the endmission regardless of the dialog for the player or close the dialog from a remote script

tough abyss
#

@meager granite what means allowedSlots [] = {901};

tough abyss
#

The weapon class names returned by weaponsItems are from the base weapon?

worldly zinc
#
player addEventHandler["Fired",{
    projectile=(_this select 6);
    ivelocity = velocity (_this select 6);
    chicken = "Hen_random_F" createVehicle position projectile;
    chicken setPos ((_this select 6) modelToWorld [0, 0.66, -0.15]);
    chicken setVelocity [
        (ivelocity select 0),
        (ivelocity select 1),
        (ivelocity select 2)
    ];
    deleteVehicle projectile;
}];```
Chicken gun. Run in debug. For lulz. Enjoy.
tough abyss
broken mural
#

on init.sqf, is there a way to look for all named assets added to the mission? for example, say I want all land_laptop_closed_F objects on init, how would I grab those?

broken mural
#

bleh. I found allvariables object but I'm not sure how specific I have to be. AllVariables Land_Laptop_Closed_F doesn't get anything despite having several. Same for other things like an M2a1 slammer.

#

oh found it; Vehicles.

worldly zinc
#

@broken mural you'll probably want to use nearObjects

#

_array = [0,0,0] nearObjects ["classname",_radius];

little eagle
#

omg Arma

#

I just enabled XEH for all objects including terrain objects like buildings

#

And apparently buildings at the edge of your view distance are created and deleted every second

#

it keeps creating and deleting the same buildings from the airfields of Stratis

vital onyx
#

How did you enable XEH? modifying configs?

shy bear
#

Hello guys! How to put code in those boxes you guys using on discord?

#

like above _array

scarlet spoke
#

You have to use ยด 3 times

#

On both ends

#

(it's the one next to backslash) @shy bear

shy bear
#

thnks alot found it already ๐Ÿ˜‰

scarlet spoke
#

Just surrounding one word by one of these on each side looks like this

#

Okay ^^

shy bear
#

yeah multi line is ''' + '''

#

right?

scarlet spoke
#

yeah

#

Just try it out ๐Ÿ˜‰

shy bear
#

allright thnks ๐Ÿ˜„

#

haha lol @scarlet spoke didnt work out what did i do wrong? @:

#

'''
class Item2
{
side="LOGIC";
class Vehicles
{
items=1;
class Item0
{
position[]={9762.9512,8.0364285,4894.1582};
class args
{
items=4;
class Item0
{
value="UID**";
parentCls="ModuleCurator_F";
typeName="Owner";
};
class Item1
{
value=" NAME ";
parentCls="ModuleCurator_F";
typeName="Name";
};
class Item2
{
value="3";
parentCls="ModuleCurator_F";
typeName="Addons";
};
class Item3
{
value="0";
parentCls="ModuleCurator_F";
typeName="Forced";
};
};
id=0;
side="LOGIC";
vehicle="ModuleCurator_F";
leader=1;
lock="UNLOCKED";
skill=0.60000002;
text="zeusModule";
};
'''

vital onyx
#

it should be ` which is before 1 (~symbol also there) but not single quote '

#

` vs ' ;)

shy bear
#
    class Item2
        {
            side="LOGIC";
            class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={9762.9512,8.0364285,4894.1582};
                    class args
                    {
                        items=4;
                        class Item0
                        {        
                            value="******UID********";
                            parentCls="ModuleCurator_F";
                            typeName="Owner";
                        };
                        class Item1
                        {
                            value=" **NAME** ";
                            parentCls="ModuleCurator_F";
                            typeName="Name";
                        };
                        class Item2
                        {
                            value="3";
                            parentCls="ModuleCurator_F";
                            typeName="Addons";
                        };
                        class Item3
                        {
                            value="0";
                            parentCls="ModuleCurator_F";
                            typeName="Forced";
                        };
                    };
                    id=0;
                    side="LOGIC";
                    vehicle="ModuleCurator_F";
                    leader=1;
                    lock="UNLOCKED";
                    skill=0.60000002;
                    text="zeusModule";
                };
    ```
#

yay ๐Ÿ˜„ thnks ๐Ÿ˜‰

vital onyx
#

enjoy)

shy bear
#

i will ๐Ÿ˜›

vital onyx
#

in doubt which project to throw all forces at:

  1. Rewrite from scratch vehicle respawn module
  2. Start making a privilege/ACL system (eg kind of selinux for arma)
  3. Or continue total conversion of in game interactions interface

any advices?

shy bear
#

@vital onyx you mean with point 3. the in game Dialogs that pop up or like when u are opening a door or something?

vital onyx
shy bear
#

@vital onyx wow! thats cool ๐Ÿ˜ƒ and u are pretty far already i see

#

What do you want to add?

vital onyx
#

not so far I wanted , still too much work

shy bear
#

haha, perfectionist i see ๐Ÿ˜‰ what is missing?

vital onyx
#

proximity system

#

it is fine working with actions applied to player (like attach, earplugs, explosives)

shy bear
#

checking your slot access control lists video now

vital onyx
#

but things coming hard when you want to interact the same way with external objects

#

like other player, vehicle etc

shy bear
#

yeah, takes a lot mor scripting i gues

vital onyx
#

it takes a lot of brains, its sploding sometimes

#

video is just a concept I made year ago

shy bear
#

haha yeah this looks all magic to me, im still at the basic of scripting

vital onyx
#

since that I rewriteen it twice from top down

shy bear
#

and you want to start over again i understand from "2. Start making a privilege/ACL system (eg kind of selinux for arma)"? ๐Ÿ˜ƒ

shy bear
#

Allright guys i really need some help here as i cant figure this out myself.
I am running an Exile server and im trying to add a script called 'Bon's Infantry Recruitment' but i cant seem to
get the scroll menu pop up. I want to add the menu to an object called: Land_PhoneBooth_02_F
First i tried adding it to the mission.sqm file, but that didnt create any Phonebooths (mission however DID start) now i am doing it serverside,
PhoneBooths are there but the thing i am struggeling with now is how to addAction to this code ?(server side) for all players:

_veh0 = createVehicle ["Land_PhoneBooth_02_F",[10992.3,5511,0],[],0,"CAN_COLLIDE"];
        _veh0 setFormDir 81.216;
        _veh0 setDir 81.216;
        _veh0 setPosATL [10992.3,5511,0];
_veh1 = createVehicle ["Land_PhoneBooth_02_F",[1697.99,7942.54,0],[],0,"CAN_COLLIDE"];
        _veh1 setFormDir 354.747;
        _veh1 setDir 354.747;
        _veh1 setPosATL [1697.99,7942.54,1.52588e-005];
#

Will something like this work, or am i completely wrong?:

_recruiters = [_veh0, _veh1, _veh2, _veh3, _veh4, _veh5, _veh6, _veh7, _veh8, _veh9, _veh10];
{_x addAction ["<t color='#ff9900'>Recruit AI</t>", "bon_recruit_units\open_dialog.sqf", [], 5, true, true, "", "side _this == east"]} forEach _recruiters;

#

i did read something about BIS_fnc_MP but not sure how to apply that..

shy bear
#

@vital onyx Do you might have a clue?

little eagle
shy bear
#

anyone? ๐Ÿ˜ƒ i tried _recruiters = [_veh0, _veh1, _veh2, _veh3, _veh4, _veh5, _veh6, _veh7, _veh8, _veh9, _veh10]; {_x addAction ["<t color='#ff9900'>Recruit AI</t>", "bon_recruit_units\open_dialog.sqf", [], 5, true, true, "", "side _this == independent"]} forEach _recruiters; but that didnt work...

indigo snow
#

look into remoteExec

shy bear
#

Thnks @indigo snow

shy bear
#

@indigo snow something like this would that work?:

{
    _recruit = ["<t color='#ff9900'>AI Mercenarie support</t>", "bon_recruit_units\open_dialog.sqf", {}];
    _vehicles, _recruit remoteExec ["addAction", 0, true];
}    
indigo snow
#

no that is syntactically broken

shy bear
#

how do you mean? sorry for being a complete noob ๐Ÿ˜‰

#

@indigo snow i found this code:

_myAction = ["A Useless Action That Does Nothing", {}];
[_someObject, _myAction] remoteExec ["addAction", 0, true];

but that would mean i have to fire that code like 10 times for each _veh0 - 10
how am i suppose to select all the _veh which are the objects?

shy bear
#
// Server side
_test = CreateVehicle ["Land_PhoneBooth_02_F",[3214.38,6016.39,0],[],0,"CAN_COLLIDE"];
_test setVariable [ "addedAction", true, true];
actionHandler = _test;
{(Owner _x) publicVariableClient "actionHandler"} forEach playableUnits;
#
// Mission init.sqf:
if (! isDedicated && hasInterface) then {
    "ActionHandler" addPublicVariableEventHandler {
        (_this Choose 1) spawn {
            WAITUNTIL {cursorTarget isEqualTo _this};
            if (_this getVariable [ "addedAction", true]), then {_this Addaction ["<t color='#ff9900'>AI Mercenarie support</t>", "bon_recruit_units\open_dialog.sqf"]}
        }
    };
};

like this?

#

any1? ๐Ÿ˜ƒ

#

but how to select all _test at once in this code?

little eagle
#

don't remoteExec that. you can just put it into init.sqf

shy bear
#

@little eagle thnks, yes the first block above here i put in mission init, and the second block i put in server side pbo the first block was wrong

little eagle
#

if (! isDedicated && hasInterface) then {
this makes no sense
the dedicated never has an interface. Should be simplified to just
if (hasInterface) then {

shy bear
#

ah allright thnks! and how should i approach to select multiple test at once?

_veh0 = createVehicle ["Land_PhoneBooth_02_F",[10992.3,5511,0],[],0,"CAN_COLLIDE"];
        _veh0 setFormDir 81.216;
        _veh0 setDir 81.216;
        _veh0 setPosATL [10992.3,5511,0];
_veh1 = createVehicle ["Land_PhoneBooth_02_F",[1697.99,7942.54,0],[],0,"CAN_COLLIDE"];
        _veh1 setFormDir 354.747;
        _veh1 setDir 354.747;
        _veh1 setPosATL [1697.99,7942.54,1.52588e-005];
_veh2 = createVehicle ["Land_PhoneBooth_02_F",[3104.56,4474.35,0],[],0,"CAN_COLLIDE"];
        _veh2 setFormDir 2.628;
        _veh2 setDir 2.628;

@little eagle

#

multiple _veh i mean

little eagle
#

a forEach loop?

#

setFormDir makes no sense here either

shy bear
#

if i would use

_veh0 = CreateVehicle ["Land_PhoneBooth_02_F",[3214.38,6016.39,0],[],0,"CAN_COLLIDE"];
_veh0 setVariable [ "addedAction", true, true];
actionHandler = _test;
{(Owner _x) publicVariableClient "actionHandler"} forEach playableUnits;

i would have to do that on each object? like _Veh0, _veh1 and so on

little eagle
#

the command is for AI groups and not phone booths

shy bear
#

hmm.. but i create the phonebooths with that code ๐Ÿ˜‰
on server side

#

not the second block i mean lol

little eagle
#

that doesn't mean it makes sense

shy bear
#

haha true ^^

#

how should i do it?

little eagle
#

Just to clarify

#

you want to spawn phobe booths at specific positions and they should have an action added to them?

shy bear
#

true, and i tried it within mission sqm, game started then but no phone booths, so i now created the phonebooths server side

#

but not sure how to add the addaction

little eagle
#

oh. i guess "Land_PhoneBooth_02_F" is not available in the editor

shy bear
#

it is, but not the rest of my mission file ๐Ÿ˜‰

#

i created the positions and everything with the editor

little eagle
#

Why not place the Land_PhoneBooth_02_F via Eden-Editor and put the addAction thing into the init box of the objects?

shy bear
#

i did that but then i have to merge that code with my existing mission file, and i tried a lot of different ways most of the time = cannot load mission , and when i get it to start, there are no phonebooths ๐Ÿ˜›

little eagle
#

hmm. I see. You have to spawn them

shy bear
#

do you know how to add the phonebooth code in there? atleast as where to start

little eagle
#

if you spawn them with SQF, then you can ignore the mission.sqm

#

SQF goes into init.sqf and the like

shy bear
#

yeah its better lol ๐Ÿ˜‰ had a headache of that one

little eagle
#

you should consider writing a function for creating the phones. That way you can get rid of lot's of repeating code

shy bear
#

do you know any good site for examples on how to do that? yeah thats my point exactly because now i would have to repeat unnecesary code all the time the way it is now

#

i know that the _veh0 = createvehicle _veh1 = createvehicle can also be a lot shorter

little eagle
#

wait. I'm writing something

shy bear
#

cool

little eagle
#
    private _allPhones = [];

    private _fnc_spawnPhone = {
        params ["_position", "_direction"];

        private _phone = createVehicle ["Land_PhoneBooth_02_F", [0,0,0], [], 0, "CAN_COLLIDE"];

        _phone setDir _direction;

        // set position is faster if done manually and not by createVehicle, also synch setDir direction
        _phone setPosATL _position;

        // adjust object tilting to terrain
        _phone setVectorUp surfaceNormal _position;

        _allPhones pushBack _phone;
        true
    };
shy bear
#

and then _phone1 Phone2 etc

#

?

little eagle
#

then you can go through your "positon-direction-config":

    {
        _x call _fnc_spawnPhone;
    } forEach [
        [[10992.3,5511,0], 81.216],
        [[1697.99,7942.54,0], 354.747] //etc.
    ];
shy bear
#

Aaah!! ok nice!

#

thanks very much!!!

little eagle
#

at the end you synch all phones to all clients, including JIP clients:

#
missionNamespace setVariable ["Mission_allPhones", _allPhones, true];
shy bear
#

then i can call allphones with

little eagle
#

nono, wait

#

on all clients (with hasInterface) you do:

0 spawn {
    waitUntil {!isNil "Mission_allPhones"};

    {
        _x addAction ....
    } forEach Mission_allPhones;
};
#

so you are having a thread waiting for the "all phones" variable to arrive from the server

shy bear
#

init sqf right?

little eagle
#

yes, all init.sqf

#

the spawning obviously behind a isServer

#

and the addAction behind a hasInterface

shy bear
#

yeah the spawning in the same server side pbo

#

awesome, thanks a lot for your time! can i add you as friend? so we dont have to spam here if i have any questions? ๐Ÿ˜ƒ

little eagle
#

I'd prefer if everyone can read it. I'm sure there are always some lurkers that might learn something

shy bear
#

ah yeah ofcourse ๐Ÿ˜‰

#

ive did a lot aswell lol

#

๐Ÿ˜ƒ

#

k thnks a lot i am gonna try and work this out , cya!

little eagle
#

hf debugging it. I'm sure there is a missing semi-colon or something stupid in there

#

there always tend to be

shy bear
#

well yeah there allw... lol ^^

#

thnks!

paper sail
#

is it possible to make a "paintball" gun script for arma 3, as in gives random colour to clothing/vehicle when it gets shot by certain weapon?

vital onyx
#

yes

sweet patio
#

(posting in a few relevant chats) anyone know if I use synchronizeObjectsAdd in order to make sure that a zeus player respawns with an editable area?

paper sail
#

longbow, would you be able to point me in the right direction towards that? im completely blank when it comes to arma scripting and im basically looking on behalf of a friend

shy bear
#

allright so commy2 pointed me a lot into the right direction but im clearly doin something wrong, can some1 have a look to this script ?: http://pastebin.com/bMSVJ58i i suppose it has to do with the _x call _fnc, which i didnt really understand

little eagle
#

missing comma line 29

shy bear
#

wow thats fast ๐Ÿ˜›

#

doh ๐Ÿ˜‰ the rest is ok?

little eagle
#

_x call _fnc_spawnPhone;
just executes the function you defined above with a position-direction pair

#

and forEach does it for all the pairs

shy bear
#

yeah that i did understand

#

but i was confused by the private _phone = createVehicle ["Land_PhoneBooth_02_F", [0,0,0], [], 0, "CAN_COLLIDE"];

little eagle
#

looks ok. but for some reason it is indented

#

that line just spawns the phone and stores the object reference in the "_phone" variable

shy bear
#

yup i already thought it would ๐Ÿ˜‰ awesome

#

understanding a lot more scripts now seriously ๐Ÿ˜„

#

does this mission side init sqf look good:

little eagle
#

you should start your game with -showScriptErrors

#

it will show you the line where you made an error

shy bear
#

i have ๐Ÿ˜‰

little eagle
#

the messages itself will be useless most of the time

#

and the line numbers might be off

#

but it's the best we have

shy bear
#

thnks, but there is some other error aswell that keeps comming up need to fix that first

#

haah yeah it is

#

heres the init:

#
[] execVM "ClaimVehicles_Client\ClaimVehicles_Client_init.sqf"; //ClaimVehicles
[] execVM "bon_recruit_units\init.sqf";            // Initialize recruit mercenaries:
if hasInterface then
{
    [] execVM "VEMFr_client\sqf\initClient.sqf";     // Client-side part of VEMFr
//Recruiting script
0 spawn {
    waitUntil {!isNil "Mission_allPhones"};
    {
        _x  addaction ["<t color='#ff9900'>AI Mercenarie support</t>", "bon_recruit_units\open_dialog.sqf"];
    } forEach Mission_allPhones;
        };
};
//A3XAI Client
#include "A3XAI_Client\A3XAI_initclient.sqf";
little eagle
#

strange formating

#

indentations

shy bear
#

indentations = } ?

little eagle
#

how many spaces you put at the beginning of one line

#

like dent

#

hole

shy bear
#

ah yeah ๐Ÿ˜‰

little eagle
#
if hasInterface then
{
    [] execVM "VEMFr_client\sqf\initClient.sqf";     // Client-side part of VEMFr
//Recruiting script
0 spawn {
    waitUntil {!isNil "Mission_allPhones"};
    {
        _x  addaction ["<t color='#ff9900'>AI Mercenarie support</t>", "bon_recruit_units\open_dialog.sqf"];
    } forEach Mission_allPhones;
        };
};
#

->

#
if (hasInterface) then {
    [] execVM "VEMFr_client\sqf\initClient.sqf";     // Client-side part of VEMFr

    //Recruiting script
    0 spawn {
        waitUntil {!isNil "Mission_allPhones"};
        {
            _x  addaction ["<t color='#ff9900'>AI Mercenarie support</t>", "bon_recruit_units\open_dialog.sqf"];
        } forEach Mission_allPhones;
    };
};
shy bear
#

that does look better!!!!

little eagle
#

you indent after each {

#

and go back after each }

#

one "tab" is 4 spaces

shy bear
#

actually it was copy pasted ๐Ÿ˜›

#

but it looks better readable i agree

#

a lot

little eagle
#

That's the first thing for me. I'm really anal about the formatting. SQF is hard to read already with the unary - binary command mix

shy bear
#

haha thats absolutely true

#

thnks a lot again!

shy bear
#

@little eagle Heya commy2, no phonebooths ๐Ÿ˜ฆ

#

any idea? cant find anything in my rpt aswell

#

nvm i do found somnething in rpt lol

shy bear
#

@little eagle hmm first i had this error:

#
2:58:39     Error in expression <16.39,0], 125.532], 
    [[4555.31,3478.6,0,], 7.582], 
    [[4710.78,8157.54,0], 138.17>
2:58:39   Error position: <], 7.582], 
    [[4710.78,8157.54,0], 138.17>
2:58:39   Error Missing [
2:58:39 File a3_custom\mapcontent\recruit.sqf, line 27
#

so i added a [ before the last code so it looked like [[4710.78,8157.54,0], [138.17],

#

hmm i need double ]] at the end?

#

after first adjustment i get sort of the same error:

 3:34:13 Error in expression <6.39,0], [125.532], 
[[4555.31,3478.6,0,], [7.582], 
[[4710.78,8157.54,0], [138.>
 3:34:13   Error position: <], [7.582], 
[[4710.78,8157.54,0], [138.>
 3:34:13   Error Missing [
 3:34:13 File a3_custom\mapcontent\recruit.sqf, line 27
shy bear
#

@little eagle shouldnt:

    {
        _x call _fnc_spawnPhone;
    } forEach [
        [[10992.3,5511,0], 81.216],
        [[1697.99,7942.54,0], 354.747] //etc.
    ];

Be:

    {
        _x call _fnc_spawnPhone;
    } forEach [
        [[81.216], 10992.3,5511,0 ],
        [[354.747], 1697.99,7942.54,0] //etc.
    ];
#

based on:

    private _fnc_spawnPhone = {
        params ["_position", "_direction"]; 

        private _phone = createVehicle ["Land_PhoneBooth_02_F", [0,0,0], [], 0, "CAN_COLLIDE"];

    
        _phone setDir _direction;
       
        _phone setPosATL _position;

        _phone setVectorUp surfaceNormal _position;
        _allPhones pushBack _phone;
        true
    };
shy bear
#

omg ...lol that i missed that [[4555.31,3478.6,0,], [7.582], comma after that zero ๐Ÿ˜ @little eagle

tough abyss
#

It's too much bad to use a waitUntil inside a waitUntil?

scarlet spoke
#

Not really

#

If you use waitUntil at all it shouldn't make a noticable difference

#

Just make sure you use a sleep inside the waitUntil

tough abyss
#

@scarlet spoke thankyou.

scarlet spoke
#

you're welcome ๐Ÿ˜ƒ

tame portal
#

Quick question

#

How do I allow a control group to expand itself vertically based on it's content with a scrollbar?

#

Or does it do that automatically?

scarlet spoke
#

@tame portal afaik it does that automatically

#

It all depends on the position you set for the group's content

austere granite
#

It does that automatically, as long as you dont use the noScrollBar class ๐Ÿ˜‰

tame portal
#

A'ight thanks lads

vital onyx
#

Hey guys

scarlet spoke
#

Is there a way to disable map marker tooltips?

#

I'm referring to user created ones that have the tooltip of the player having created it

opal thistle
#

Hello there! Whom could I ask about networking in Arma 3 and what actually setVariable and PVEH do on the lower levels (if it's known), which of them better for what purpouses and which has more overhead?

little eagle
#

one is for missionNamespace the other for objects.
if you mean missionNamespace setVariable public then it's basically the same as publicVariable. Both trigger the PVEH now

little eagle
#
// serialize backpack
private _backpackData = getUnitLoadout player select 5;

...

// deserialize backpack
private _loadout = getUnitLoadout player;
_loadout set [5, _backpackData];
player setUnitLoadout _loadout;
#

like this?

tame portal
#

@little eagle wait really?

#

mNamespace setvariable [,,true] triggers PVEH?

#

@little eagle

little eagle
#

yes

tame portal
#

I can't tag commy oO

little eagle
#

you did

#

twice...

wild iron
#

Ok got a big task this time! I want to just take the drag an carry script from the A3 - Wounding system. So far I have found the fn_drag.sqf and put that in with a execVM command (which works) however there are missing vaiables becuase of using "his" death system as apposed to the defult one... any ideas?

#

Even if I could make it so you could drag/drop ai it would be good in hostage missions, so maybe rather than just a injuredperson (which I can't find the normal code for) you could do the same for ai

#

Or even better if you just know a drag/carry code by itself...

tame portal
#

Sorry commy for me it showed invalid user

velvet merlin
#

its bugged at times

tough abyss
#

We can, by script commands, make the Arma memory more complicated to handle? Think in HD defrag, if a file is stored perfectlly between two other files, this is good, but if i make this file bigger it will need to be split in 2 parts, what is bad. Can this happens with arrays in Arma 3 memory (you make an array bigger and it get split in Arma 3 memory)?

mint frost
#

don't drill so deep

vital onyx
#

in case of SQF Arma handles all memory management by itself

#

you cannot influence it

little eagle
#

scripts are text files. their size is negligible compared to stuff like textures

tough abyss
#

But memory get defragmented from time to time or it just get worse, worse and worse?

#

Thankyo for the replyes.

#

Its just for the info now.

#

Uh... Does memory even get fragmented to the point of where you need to think about it at all? It's all volatile storage anyways.

tough abyss
#

I'm considering less restarts on the server per day.

#

Why can't i open the server in 01 jan and close it in 31 dec?

tame portal
#

Because if you run an ArmA server for more than a few days it will eventually result in a nuclear meltdown, experiments on my dedicated server have shown

austere granite
#

So is there a definetive way to turn of the 'Regroup' commands players (not AI) do, plus things like contact reports

#

enableSentences and enableRadio are already used

#

also disableConversation and BIS_noCoreConversations are used already

tough abyss
#

@tame portal this in Arma 3?

little eagle
#

@austere granite not without mods

austere granite
#

I got mod

little eagle
#

all available commands have drawbacks

#

OK. wait

austere granite
#

It's pvp only, 0 ai support needed

little eagle
#

why is enableSentences not an option then?

austere granite
#

those are all used already

#

still no luck

little eagle
tough abyss
#

not sure how the radio chatter works, but if it's a mod, you could probably delete the class for these sentences

little eagle
#

and then use setSpeaker via remoteExec on init.sqf of the player

austere granite
#

Does that persist past respawn or do i need to reapply?

little eagle
#

I think it persists

austere granite
#

sweet, let me try that. Merci

little eagle
#

But setSpeaker does not work on init

#

and it is local only

#

so you have to fight with locality on that one

#

hf

austere granite
#

local argument or local effects too?

little eagle
#

global args, local effects

#

and as I said, it's broken on unit init

#

BI has a function, but it didn't work for me either

austere granite
#

I'll fuck around with it, thanks

tough abyss
little eagle
#

The wiki is wrong

#

how else would you mute remote players?

austere granite
#

Yeah that wouldn't make sense :/

little eagle
#

you can setSpeaker on remote units and it will be changed on the machine where you executed the command

#

== global args

tough abyss
#

makes sense ^^ just said whats on the wiki ๐Ÿ˜›

austere granite
#

I'm still confujsed as to why all the other commands dont seem to work either

#

I wonder if that's something too with needing a delay to run it

little eagle
#

no, they just all do different things than they're advertised to do

manic sigil
#

I'm trying to make a basic real-time-tactical mission with resources, etc (Because I'm sure it hasn't been done before.) However, I'm having trouble understanding sites. I'm sure there must be a way, but how do I have sectors/site control activate triggers?

manic sigil
#

Solved for sectors, was using the wrong module.

stable wave
#

_crate = "Box_East_Ammo_F"; ["Open",_crate] call BIS_fnc_arsenal; What does this syntax do? I can't find it on the wiki

#

On the wiki, the second argument is a bool, not a class

vital onyx
#

Very strange. have this function:

private _index = _this;
disableSerialization;
_display = uiNamespace getVariable "ADIS_MENU_DISPLAY";
for "_i" from 1 to 8 do {
    (_display displayCtrl (66310 + _i)) ctrlSetText "";
};

if you just store it in variable, like fn_selector = {...}, code performance shows 0.03ms
if you define it in CfgFuntions - 0.044 ms
50% overhead, why?

#

ok, found

private _fnc_scriptNameParent = if (isNil '_fnc_scriptName') then {'RWT_fnc_adisSelectorSet'} else {_fnc_scriptName};
    private _fnc_scriptName = 'RWT_fnc_adisSelectorSet';
    scriptName _fnc_scriptName;

provides ~50% difference

vital onyx
#

even more interesting

#
disableSerialization; 
_index = 1;
_display = uiNamespace getVariable "ADIS_MENU_DISPLAY"; 
(_display displayCtrl 66311) ctrlSetText ""; 
(_display displayCtrl 66312) ctrlSetText ""; 
(_display displayCtrl 66313) ctrlSetText ""; 
(_display displayCtrl 66314) ctrlSetText ""; 
(_display displayCtrl 66315) ctrlSetText ""; 
(_display displayCtrl 66316) ctrlSetText ""; 
(_display displayCtrl 66317) ctrlSetText ""; 
(_display displayCtrl 66318) ctrlSetText ""; 

takes 0.0176 ms

#
disableSerialization; 
_index = 1;
_display = uiNamespace getVariable "ADIS_MENU_DISPLAY"; 
if (_index in [1,2,3,4,5,6,7,8]) then 
{ 
 (_display displayCtrl (66310 + _index)) ctrlSetText (format ["addons\longbow\adis\icons\s%1.paa",_index]); 
 rwt_adis_selector_hidden = false; 
};

takes 0.0172ms in code performance

#

but if we merge them like this:

disableSerialization; 
_index = 1;
_display = uiNamespace getVariable "ADIS_MENU_DISPLAY"; 
(_display displayCtrl 66311) ctrlSetText ""; 
(_display displayCtrl 66312) ctrlSetText ""; 
(_display displayCtrl 66313) ctrlSetText ""; 
(_display displayCtrl 66314) ctrlSetText ""; 
(_display displayCtrl 66315) ctrlSetText ""; 
(_display displayCtrl 66316) ctrlSetText ""; 
(_display displayCtrl 66317) ctrlSetText ""; 
(_display displayCtrl 66318) ctrlSetText ""; 
 
if (_index in [1,2,3,4,5,6,7,8]) then 
{ 
 (_display displayCtrl (66310 + _index)) ctrlSetText (format ["addons\longbow\adis\icons\s%1.paa",_index]); 
 rwt_adis_selector_hidden = false; 
};

takes 0.2 ms

wtf?

tough abyss
#

Sqf engine isn't like a compiler that does a bunch optimizations for you.
Whats do you find odd/strange about the timings ?

vital onyx
#

that snippets 1 and 2 takes ~ 0.02ms each, but together take 0.2ms - ~5x performance drop

#

that kills me

#

I agree on minor drop because of CfgFunctions

tough abyss
#

Never though of the overhead from cfgfunctions when it adds the scriptname debug stuff.
Ahh didn't notice the 0.2 assumed it was 0.02. No idea

vital onyx
#

ok, I found a way to get merged function to run in 0.04ms, but still I am damn confused

#
disableSerialization; 
_index = 1;
_display = uiNamespace getVariable "ADIS_MENU_DISPLAY";
_arr = [1,2,3,4,5,6,7,8];

if (_index in _arr) then
{
    _arr deleteAt (_index - 1);
    (_display displayCtrl (66310 + _index)) ctrlSetText (format ["addons\longbow\adis\icons\s%1.paa",_index]);
    _arr apply {
        (_display displayCtrl 66310 + _x) ctrlSetText "";
    };
};

does the same, but in 0.04ms vs original 0.2ms

little eagle
#

WELL OPTIMIZED

vital onyx
#

@little eagle sarcasm?

little eagle
#

yes. you broke the loop. instead of going through all 8 controls, you do only one. no wonder it's faster. you made it worse with every step. also there is no point in optimizing this code. it will probably only execute when you open that menu, so it's pointless.

#

also, if you don't like this call stack thingy _fnc_scriptName, you can use headerType = -1;

vital onyx
#

@little eagle what exactly I made worse? finally I ended with [] apply {}

night void
#

Hello Masters! give me advice please, how i can allow to soldier disarm mines w\o toolkit?

kindred briar
#

^ Could always walk over it ๐Ÿ˜›

scarlet spoke
#

^Well... Guess that's one way of doing it ๐Ÿ˜‚

clear tendon
#

ha. fell right in that one

#

mine...

#

Scripting time! How can i randomize the spawnpoint that's generated by addRespawnPosition? Right now it's deadcenter of the trigger/marker, but you might want some variance inside that area, no? Anybody got some clues?

scarlet spoke
#

Randomization before adding the position or after having added it?

clear tendon
#

i guess after @scarlet spoke

#

Players just need to spawn in randomly in that area, not deadcenter on the marker

scarlet spoke
#

Hm... I think that's not possible (at least not directly). You could however use setPos in the onPlayerRespawn.sqf and randomizer the position there

clear tendon
#

wait, let me show yo uwhat i've got atm

gilded rover
#

does anyone else fail to put a retextured Nato beret into the game , I can see the beret with textures , yet my friends can't even when I run the version i put on workshop

clear tendon
#

dont you all need the same model?

gilded rover
#

beret_02

#

everyone has it

#

its under characters_EPC but thanks

tough abyss
#

I like people trying to go beyond and do wonderfull things

tough abyss
#

Anyone remember to had put a handgun in a vest?

scarlet spoke
#

addItemToVest

#

@Donnovan#6284

shy bear
#

@little eagle you somewhere around buddy?

tough abyss
#

Short Circuit Evaluation turned in something default to me ๐Ÿ˜›

#

Thanks for sharing this nice thing!

little eagle
#

What?

tough abyss
#

This: if (condition1 && ({condition2} || {condition3})) then {...

#

I'm using it allways

little eagle
#

Oops.I meant frenchcoreworldwide

tough abyss
#

Oh sorry.

shy bear
#

Hey! ๐Ÿ˜ƒ

#

need your genius brain again ๐Ÿ˜„

#

am i doin good?

#

i know i miss something havent tried it, but i just know i do

#

(this is the same script AI recruiting) Trying to get it working with exile database - poptabs

#

and a check for 10000 Player "Respect"

little eagle
#

In my expert opinion, this is indeed SQF. ... what was the question?

shy bear
#

LOL

#

shit lost my english

#

lol

#

im not sure if this can work? i think i miss something

little eagle
#

"span class="re5"> recruit_newunit" addPublicVariableEventHandler {

#

this doesn't look right

shy bear
#

hmm the rest looks good?

#

because the script did work ๐Ÿ˜›

little eagle
#

line below that:
"span class="re5"> unit_lifecycle.fsm"

shy bear
#

i just want it to make a unit cost poptabs

little eagle
#

this is not a correct string

#

a string has to begin and end with "

#

but there can't be any unescaped " inside it

shy bear
#

hmm but i dont see those code anywhere

shy bear
#

lol! pastebin screwed it up?

little eagle
#

idk, maybe?

shy bear
#

yeah it did

#

haha

little eagle
#

I use gists. They support SQF

shy bear
#
// *by Bon Inf* <<<
// MODIFICATION for EXILEMOD by FrenchcoreWorldWide 15-10-16
//

RECRUIT_PATH = "recruit_units\";

max_units_allowed = 6;    // Max amount of command-able AI units INCLUDING yourself.

_minScore = 10000;    // Minimum respect needed to use the Recruiter

_unitCost = 2500;        // PopTabs Per Unit.

recruit_queue = [];

//Select false if you want to use a a static unit list
//You can customize static lists in recruitable_units_static.sqf
dynamic_list = false;

if(isServer) then{
    "recruit_newunit" addPublicVariableEventHandler {
        _newunit = _this select 1;
        [_newunit] execFSM (RECRUIT_PATH+"unit_lifecycle.fsm");
    };
};
if(isDedicated) exitWith{};


// Client stuff...
#

thats how it looks ๐Ÿ˜ƒ

#

gists? is that github?

little eagle
#

yes

shy bear
#

hmm not really sure how that works

#

i do have a accaunt i thought lol

little eagle
#

just press "gists" on the top

shy bear
#

ah got it ๐Ÿ˜‰

little eagle
#

and enter a filename that ends with the .sqf extension

shy bear
#

awesome, didnt know that that was possible at github ๐Ÿ˜

#

do you know if there is a way to force the "Recruited AI" to side INDEPENDENCE

#

or Resistance

little eagle
#

What is "recruited AI" ?

shy bear
#

the created AI with that script

#

i have choosen classes from independence

little eagle
#

but they are on opfor, right?

#

east

shy bear
#

they are?

little eagle
#

idk

shy bear
#

ah lol yeah

little eagle
#

Have you tried it?

shy bear
#

first they werent

#

but with the new zombie spawn script

#

it forces everyone hostile to me i think

little eagle
#

ok

shy bear
#

this zombie script spawns zombie around the player (no triggers)

little eagle
#
_dummyGroupEast = createGroup east;

_unitAI = _dummyGroupEast createUnit ['O_G_Soldier_F', _posAI, [], 0,"FORM"];

[_unitAI] joinSilent _groupAI;
deleteGroup _dummyGroupEast;
shy bear
#

i saw that somewhere yeah

little eagle
#

you create the guy on a "east" group

#

it's in recruit.sqf

#

In Arma, the units belong usually to the side of their group

shy bear
#

ah lol i pasted it there because i wanted to use that

#

but without that code it happens

little eagle
#

uhm

shy bear
#

i wanted to change that to independence

#

to see if that works

#

that doesnt belong in the script sorry

#

was code i found online to force ai to a side

little eagle
#

(createGroup independant) createUnit ['O_G_Soldier_F', position player, [], 0,"FORM"];

#

that will make the spawned unit belong to the indep side

shy bear
#

awesome, and wont that get overruled by the zombie spawner? or i have to check

#

these spawn in x - time around players

little eagle
#

I have no idea what the "zombie spawner" does

#

I don't see why it would interfere

shy bear
#

not sure either, but i know it does somehow, because before that zombie spawner they where friendly ๐Ÿ˜›

#

ah yeah and another thing

#

when i wanted to recruit units\

#

i first had to kill all zombies arround because it said max units in group

#

so somehow it counts the zombies at my group =\

#

but about the recruit script, does the code to make a unit cost money looks allright? and the check for -------- respect

little eagle
#

Hmm. You're probably better off asking the guy that made that zombie script. I don't know what it does internally

shy bear
#

i understand that, u need to see that. the guy from the zombie script said that its just arma's way of things... ๐Ÿ˜› but i mean is there a way to force them

#

well i will first try the code above btw ๐Ÿ˜„

#

thnks

little eagle
#

As for Exile... "money" and "respect" aren't aspects of the game by default. And I don't know anything about Exile. I know that they have a forum where you maybe can find help though.

shy bear
#
recruit_recruitableunits = [
"I_G_resistanceLeader_F",
"rhsgref_cdf_para_squadleader",
"rhsgref_cdf_para_engineer",
"rhsgref_cdf_para_autorifleman",
"rhsgref_cdf_para_machinegunner",
"rhsgref_cdf_air_pilot",
"rhsgref_ins_g_saboteur",
"rhsgref_ins_g_grenadier_rpg",
"rhsgref_ins_g_sniper",
"rhsgref_ins_g_spotter",
"rhsgref_nat_pmil_machinegunner",
"rhsgref_nat_pmil_saboteur",
"rhsgref_nat_pmil_hunter",
"rhsgref_nat_pmil_medic",
"rhsgref_nat_specialist_aa",
"rhsgref_nat_saboteur",
"rhsgref_nat_medic"
];
```  thats the recruited unit list, i have to merge your code with that?
#

ah i understand ๐Ÿ˜ƒ ^^

#

thnks for looking tho ๐Ÿ˜ƒ

#

allready found where i need to merge ๐Ÿ˜‰ at the recruit.sqf under unit creation ofcourse ๐Ÿ˜›

#

@little eagle may i ask you 1 thing, where do you fnd good reference for arma's SQF?

#

like maybe you know a site with best info, because i found the wiki not allways that good info...

little eagle
shy bear
#

yeah it does have it there, all scattered ๐Ÿ˜›

#

but i agree, everything is really there

little eagle
#

I have no idea why they made the list alphabetical. That's so 20th century. We have ctrl+f now

#

they should've ordered in groups. whatever belong to each other should've been next to each other

#

like ctrlText after ctrlSetText

#

etc.

shy bear
#

exactly! @little eagle

#

it is a real pain going through there ๐Ÿ˜›

#

but like u said its all we have ๐Ÿ˜„

#

ive found some good tutorials i downloaded gonna read myself into this ๐Ÿ˜ƒ thanks for looking at the script anyway mate!

scarlet spoke
#

@little eagle we have a ordered list in the wiki.
Here they are sorted according to their functionality

west lantern
sweet patio
#

Hate to keep asking, but what's the best method to make sure respawning players will have right modules resynced?

#

based on my research I make a trigger that somehow ties player death with synchronizeObjectAdd

finite silo
#

Hi guys, may I ask approximately how long would it take me to learn SQF at a decent level if I already clocked about a thousand hours in C and python?

scarlet spoke
#

@finite silo shouldn't take too long... maybe a few days to get familiar with the syntax

#

And after that depending on how deep you want to understand ArmA and SQF

finite silo
#

hmm ok. thanks!

scarlet spoke
#

I'd estimate that it should be doable within a week of regular practice and trial and error

finite silo
#

so no courses etc

#

needed

scarlet spoke
#

Well you need to learn how to use the BIKI

sweet patio
#

Maybe Im asking in the right place. Should I ask the Eden editor people?

finite silo
#

hmm ok thank you!

scarlet spoke
#

You're welcome

#

If you were German I could recommend you a good turorial series...

finite silo
#

Ah, sadly I'm not

#

tbh I would love to be tho ๐Ÿ˜›

scarlet spoke
#

Hehe ๐Ÿ˜ƒ

#

Then google for KK's Blog

#

There you go

finite silo
#

thx

scarlet spoke
#

And don't forget to dig into some existing projects in order to see how things can be done... There are some "magic" things that can be done because of how SQF works you wouldn't come up when coming from a language like C @finite silo

finite silo
#

ah, ok. thank you!

#

I think I have a few months to go until I hit a thousand hours

#

and then I'd reward myself with Arma

scarlet spoke
#

๐Ÿ˜ƒ

zealous solstice
#

1k h is close to nothing.

finite silo
#

don't be so mean.

#

๐Ÿ˜ญ

#

lol I knjow

scarlet spoke
#

@zealous solstice behave yourself!

finite silo
#

well 10k hours is, you know, 10k hours ๐Ÿ˜›

#

so that means by 1k hours I'd be 1/10 competent

scarlet spoke
#

^^

finite silo
#

are you guys all Redditrs?

#

Wait, apparently I have almost another year until I reach 1k hours

#

๐Ÿ˜ฆ

#

like 8 months

#

its ok tho ๐Ÿ˜›

scarlet spoke
#

No I'm not

tough abyss
#

@scarlet spoke thanks.

little eagle
#

But the list is incomplete, Raven

tough abyss
#

weaponsItems, weaponsItemsCargo, uniformContainer, vestContainer, backpackContainer are G G functions?

violet vault
little eagle
#

And you have a site for each category -> unusable

scarlet spoke
#

But at least something ^^

#

Well I think it helps if you know what you want to do but don't know what commands might be suitable

little eagle
#

@tough abyss none of these commands have effects that could be considered local or global

#

but all of them accept global arguments

tough abyss
#

@little eagle thanks.

#

so they are G. I understand. Thankyou.

#

not G G.

#

this is not working:

little eagle
#

AG ... "arguments global"

tough abyss
#

_weaponItems = (weaponsItemsCargo backpackContainer _unit) + (weaponsItemsCargo vestContainer _unit) + (weaponsItemsCargo uniformContainer _unit) + (weaponsItems _unit);

#

_weaponItems remain undefined.

#

and i got a var is not defined error

little eagle
#

weaponsItems is broken for null objects

tough abyss
#

Aaaahh! Thanks a lot man!!!

little eagle
#

use: [weaponsItems _unit] param [0, []]

tough abyss
#

Cool! Thanks for the trick!

little eagle
#

yw

#

I tested weaponsItemsCargo and it's broken too. So you'll need 4 of these constructs

tough abyss
#

I'm working in a fast way to collect all dead bodyes items (but not its uniform (ha)) and transfer it to your assigned vehicle if it is near.

#

If the vehicle gear if full the remaining items goes on the ground in a weapon holder.

#

THOUGHTS: if a function like weaponsItems accepts global arguments, then all the client must have complete info about each unit weapons or the client can not have this info and the function need to ask for it to the server.

little eagle
#

depends on what else you're doing in that function I guess

tough abyss
#

more global functions means more traffic

little eagle
#

yeah, but if it's only when someones dies... it's not like that happens all the time

tough abyss
#

but since the workarround for not having global functions must be worse... it deserves.

#

but if a unit 10 km away drop a weapon

#

this need to be updated in all clients

#

because you never know when they will use weaponsItems

little eagle
#

that is what the game already does though

#

simply invoking weaponsItems on remote units does not cause network traffic

#

your client already knows this

tough abyss
#

i believe this not happens about each unit animation state

#

units far away must have a generic animation

#

animation state of each unit is not well know by all players

#

Let me test the change. ๐Ÿ˜„

little eagle
#

sure, that might be the case.

#

if you really want to be sure, you'd have to execute the commands on the machine where the corpse is local

#

that is not necessarily the server

tough abyss
#

@little eagle weaponsItems is not really working. Running from client and the unit is AI hosted on server. I will try to get the info on server and send to client.

#

May be its because i'm using it in a dead unit.

#

Hello, is there a way to wait in a script serverside until the first player is past the briefing?

halcyon crypt
#

specifically MenuInventory

violet vault
#

i need player can select own saved arsenal loadouts

halcyon crypt
#

don't think that's possible

violet vault
#

maybe yes but i dont know how i can implement part of this to MenuInventory
"_data = profilenamespace getvariable ["bis_fnc_saveInventory_data",[]];"

#

this is from Arsenal function to load saved loadout from profile

tough abyss
#

Can someone tell me if I wrote this condition correctly?: (((diag_fps) > 30) && ((diag_fpsMin) > 20))

#

@tough abyss have you tried it in the debugger console in game?

#

Is there a way to test these things without starting the game?

#

You can get an IDE like intellIJ and the Arma 3 scripting plugin, it will show syntax errors

#

In game is the most effective way

#

ok, thank you!

tough abyss
#

This is correct? if (condition1 || {condition2} || {condition3}) then {...

jovial nebula
#

Hi guys
I was wondering if anyone worked a bit with ambientAnimations in MP

I 've just discovered that it could create a lot of issues with performances because of the additional unit created in the function

Anyone has alternatives functions?

little eagle
#

@tough abyss Yes, but there are debates that say:
if (condition1 || {condition2 || {condition3}}) then {
is even better

bright coral
#

Especially when

#

if (true || {player sidechat "lalala";false} || {true}) then {player sidechat "done"}
does not reach the sidechat ๐Ÿ˜ƒ

little eagle
#

10/10 scripting

gilded rover
#

how to replace puzzel piece with an image (both in main menu and arsenal)

turbid jolt
#

Make a mod.cpp for your modfolder and define a picture in that

#

not really scripting related

tough abyss
#

@little eagle oh, thankyou.

vital onyx
broken mural
#

Is there a reason you would call in the init and not spawn? I'm looking at a mod and it's got several spawns in the init, which makes sense to me, but there are calls that aren't being assigned to variables or used after the fact.

vital onyx
#

spawn is usually used to create loops

broken mural
#

So call is standard use in the init to execute some script?

little eagle
#

init box runs in unscheduled environment. You use spawn if you want to enter scheduled environment and call if you want to stay in unscheduled.
The scheduled environment is required if you want to use suspension commands (sleep, uiSleep, waitUntil).

#

@tough abyss cringe. stop spamming the chat with rubbish

#

shitheads in this channel. not even your joke one liners make sense

broken mural
#

Thanks @little eagle for the explanation.

little eagle
#

yw

broken mural
#

Is there a method for condensing switch cases? IE if 5 different cases all do one thing. In .Net the syntax is roughly
`case 1:
case 2:
case 3:
case 4:
{

};`

#

sqf doesnt like that though lol

little eagle
#
switch (_number) do {
    case 1;
    case 2: { blah };
};
broken mural
#

Cheers; I see my problem. ; not :

little eagle
#

Yea

vital onyx
#

@broken mural try this to condense

switch true do {
case (_number in [1,2,3,4,5]): {foo bar};
};
stiff forge
#

Hey, does anyone know of an arrest/detain script that works in Arma 2 on civillians? I can only find a couple that work on PvP or SP, need it for a COOP mission. Any help would be awesome, hitting a wall here

scarlet spoke
#

You could dig into the ACE code... They have such functionality afaik

runic heart
#

Anyone here willing to share a config for a successful melee weapon? Like a mining pick or sledgehammer?

tough abyss
#

Hius!

#

There is anything wrong with this HandleDamage code?

#

It's applyed to AI vehicles and its supposed to damage vehicles only if there are players involved:

#

BRPVP_hdEhVeh = {
_damage = 0;
_attacker = _this select 3;
if (isPlayer _attacker) then {
_damage = _this select 2;
} else {
if (_attacker call BRPVP_isMotorized) then {
_playerEnvolved = false;
{
if (isPlayer _x) exitWith {
_playerEnvolved = true;
};
} forEach crew _attacker;
if (_playerEnvolved) then {
_damage = _this select 2;
};
};
};
_damage
};

#

The function BRPVP_isMotorized check if something is a car, tak, plane, helicopte or boat.

#

This is causing a problem in tanks.

#

Destroyed tanks.

#

Their explosions starts with 1 explosion each 10 seconds then increase to 1000 explosions each seconds, gradually, and increase so on until all the client fps fall to 0.

#

I'm now removing the HandleDamage when the vehicle get killed...

velvet merlin
#

HD still triggers when sth is destroyed if i recall correctly

vital onyx
#

@tough abyss are you overriding handledamage? if yes, the code in EH should return boolean.

#

and I would try break instead of exitWith, to quit from loop

tough abyss
#

thankyou for the help.

#

@velvet merlin and @vital onyx

#

@vital onyx yes, it return a damage value.

wispy kestrel
#

I need some help figuring out a script error. The script error occurs when entering the zeus interface. The error spams the client .rpt with a massive amount of entries. 1:09:20 Error in expression <= _pos distance curatorcamera; if (_dis < _fadeEnd) then { _coef = linearconvers> 1:09:20 Error position: << _fadeEnd) then { _coef = linearconvers> 1:09:20 Error <: Type code, expected Number,Not a Number

vital onyx
#

@wispy kestrel show the script

wispy kestrel
#

No script associated just the vanilla curator game master module

vital onyx
#

looks like a simple type mismatch

#

no mods?

wispy kestrel
#

With mods

vital onyx
#

and without mods?

wispy kestrel
#

slaps-own-hand . Haven't tried it yet...

vital onyx
#

Try to narrow this problem, by disabling mods one by one, when you locate the mod, causing this problem - report bug to mod authors

wispy kestrel
#

Problem is within Ares:Achillies mod

vital onyx
#

so here you go :)

wispy kestrel
#

Thanks @vital onyx ๐Ÿ˜„

tough abyss
#

Hi! There is a way to make all uniforms usable by all units without creating any problem?

#

I read this was not done by BI because of some AI complexity problems...

tough abyss
#

May be this can make AI less effective, since they get confused.

tough abyss
#

By the way, this code will help me to change all modelSides to {3,2,1,0}:

#

diag_log "";
{
_class = configName _x;
if (_class isKindOf "Man") then {
if (isArray (_x >> "modelSides")) then {
_ms = getArray (_x >> "modelSides");
diag_log _class;
};
};
} forEach ("true" configClasses (configFile >> "CfgVehicles"));
diag_log "
";

tough abyss
#

To change the config value modelSides of the unit vehicle B_Survivor_F i need to know its parent class?

wild iron
#

I'm looking for a way to disable fatigue once and for all, whether its a script or server side idk just please help!

dusk sage
#

Did you look on the wiki before asking that ๐Ÿ˜‰ ?

wild iron
#

@BoGuu#1044 Yep, and used the script that it said... still didn't work

dusk sage
#

enableFatigue..?

wild iron
#

@BoGuu#1044 I'll past what I put in:

#

@dusk sage This is what I put in the init.sqf:
if (hasinterface) then {
waitUntil {!isnull player};
player enableStamina false;
player addEventHandler ["Respawn", {player enableStamina false}];
};

dusk sage
#

Disable it before the EVH too

#

Oh you have

#

I've never used enableStamina before, have always just used enableFatigue

wild iron
#

so I just change it to Fatigue?

broken mural
#

when I spawn a respawnposition via BIS_Fnc_addRespawnPosition; is there a way I can hide the marker on the map? I want it useable on the respawn menu, but I dont want to clutter the map with the circle marker.

#

I see in the second parameter it has a value for STRING - marker but doesnt explain what, if anything, it expects.

#

looks like thats just a name for the marker.

tough abyss
#

Accomplished: Everyone to Everyone Uniform use.

wild iron
#

@tough abyss Does that mean non apex people can use the camo's and stuff?

tough abyss
#

Sorry to bother, but if anyone know a side effect of this, please share.

#

@wild iron i believe not.

#

Why? Without mods you can't use Apex clothes?

wild iron
#

@tough abyss Sorry I may have not understood what you were trying to do, right now if you put on Apex Camo you get the whole "BUY APEX" stuff (I'd rather if they just went back to the arma 2 way of making it low res ๐Ÿ˜ฆ ) Anyway yea I thought it might fix that ๐Ÿ˜ƒ

gilded rover
#
    class Mod_Base;
    class SAWRecce: Mod_Base {
name = "SAWRecce ArmA3"
picture = "\SAWRecce_ArmA3\Faction\data\SAWRecce.paa";
logoSmall = "\SAWRecce_ArmA3\Faction\data\SAWRecce.paa";
logo = "\SAWRecce_ArmA3\Faction\data\SAWRecce.paa";
logoOver = "\SAWRecce_ArmA3\Faction\data\SAWRecce.paa";
dlcColor[]= {0.3,0.4,0,1};
overview = "Gear, weapons and vehicles SAWRecce owns and uses to annahilate all enemies";
hidename = 0;
hidePicture = 0;
tooltip = "SAWRECCE";
tooltipOwned = "SAWRECCE";
dir = "SAWRecce_ArmA3";
};
};``` Why do i still have a puzzel piece.... P:\SAWRecce_ArmA3 thats the directory to the mod.cpp file
tough abyss
#

@wild iron what i did don't change that. I believe there is no way to change that.

lime tangle
#

On a slightly irrelevant note theres a sick way to push notifications from your githubs to your discords

wild iron
#

@lime tangle How?

lime tangle
#

webhooks

#

You need channel perms

#

but right click a channel

#

edit channel

#

webhooks

#

create a new one

#

then copy that address

#

go to github and in your repository settings there is a tab called webhooks

#

Add a new one, stick that url in and add /github to the end

#

no secret

#

JSON

#

Configure the rest as you please

velvet merlin
#

@strideynet#9352 does it also work with gitlab?

violet vault
#

Hello, for some time I wonder about one problem.
I'm trying to get to the BIS respawn screen Players saved loadout from the arsenal. I found a function of the Arsenal section where loads from profiles stored loadout but do not know how much good the programming language so I do not know what and how to write there.

this is part of Arsenal function:
//--- Load
_ctrlTemplateValue = _display displayctrl IDC_RSCDISPLAYARSENAL_TEMPLATE_VALUENAME;
if ((_ctrlTemplateValue lbvalue lnbcurselrow _ctrlTemplateValue) >= 0) then {
_inventory = _ctrlTemplateValue lnbtext [lnbcurselrow _ctrlTemplateValue,0];
[_center,[profilenamespace,_inventory]] call bis_fnc_loadinventory;

            //--- Load custom data
            _ctrlTemplateValue = _display displayctrl IDC_RSCDISPLAYARSENAL_TEMPLATE_VALUENAME;
            _data = profilenamespace getvariable ["bis_fnc_saveInventory_data",[]];
            _name = _ctrlTemplateValue lnbtext [lnbcurselrow _ctrlTemplateValue,0];
            _nameID = _data find _name;
            if (_nameID >= 0) then {
                _inventory = _data select (_nameID + 1);
                _inventoryCustom = _inventory select 10;
                _center setface (_inventoryCustom select 0);
                _center setvariable ["BIS_fnc_arsenal_face",(_inventoryCustom select 0)];
                _center setspeaker (_inventoryCustom select 1);
                [_center,_inventoryCustom select 2] call bis_fnc_setUnitInsignia;
            };

            ["ListSelectCurrent",[_display]] call bis_fnc_arsenal;
        } else {
            _hideTemplate = false;
        };

a link to an image where I want to get at least let you know what I mean https://www.dropbox.com/s/j7y1hhf7dup3807/arma respawn.jpg?dl=0

Thanks in advance for any help

vague hull
#

is there any decent funtion to use pitch/bank/yaw relatively?
Like the object already has a pitch of Xยฐ and I want to increse it by Yยฐ

dusk sage
#

@kju#1917 They are adding a GitLab endpoint at some point, but it also supports slack, so should work as is

velvet merlin
#

@dusk sage yep i tried the slack approach but couldnt get it to work - might be me being stupid or something else going wrong though

native hemlock
#

@vague hull look through the BIS functions in game or unpack the function PBOs. I'm fairly certain there was a function that was added somewhat recently that isn't on the wiki that can do pitch, bank, and yaw. Off the top of my head it might be called BIS_fnc_setObjectRotation, but I'm not 100%

vague hull
#

@Pennyworth#2634 Thanks, will have a look :)

vague hull
#

problem is: its inaccurate

#

currently think about anotherway to translate bank or yaw into vector form

#

thinking of it as 3 rotations wouldnt it be as simple as calcing the vector of each (bank, pitch and yaw) and adding it on top of the vectorUp and vectorDir of the object?

little eagle
vague hull
#

yep, its just that I dont exactly need the inaccurate translations back into degrees if I could simply add them together

tough abyss
#

Anyone notice if _x setunitPos "UP"; got broken in last patch?
Unarmed Unit ends up crawling, but is i manually set it to "AUTO", unit is back standing upright

little eagle
#

I dont exactly need the inaccurate translations back into degrees
all math you can do with this is accurate enough

opal thistle
#

anybody knows an estimated overhead of remoteExec over setVariable [varname, varvalue, true] for a numeric value?

#

or remoteExec {setVariable ...} actually does the same?

#

except that you can choose whether to add it in JIP log or not, broadcast or multicast it and so on, of course

little eagle
#

try it

vital onyx
#

I guess that the question mostly is about how to measure the network (how fast public variable propagates or code begins to execute)

thick ridge
#

@opal thistle , what are you trying to build? I'd choose the one that best meets your functional needs and then optimize later if it becomes a problem.

broken mural
#

so I figured out how to spawn a smoke grenade, but when I spawn it, it lights off. This is by calling createVehicle["SmokeShellRed", [getPosATL _x select 0, getPosATL _x select 1, getPosATL _x select 2], [], 0, "NONE" ]; Is there a different name that I'm missing, or some method, to spawn the grenade without it firing off?

vapid frigate
#

you want to spawn a grenade for people to pick up?

#

i think you'd have to use a 'weaponholder' for that

#

which works sorta like an ammo box.. so you spawn the weaponholder as a vehicle like you're doing with that smokeshell

#

then add a smokeshell to the weaponholder like you would with an ammobox

broken mural
#

Thanks ๐Ÿ˜ƒ I went with playing the throw animation and spawning the smoke grenade where I want it to set off lol

opal thistle
#

@thick ridge it's CTI, and I'm trying to figure out what method of propagation to use for simple time-crucial funcs

opal thistle
#

And the guy before me tried to bound the client and server loops and scripts exec to a custom public_time variable, synchronized every second with server time

#

I can't even imagine how it worked before

scarlet spoke
#

That's horrible

#

Take your time and write that command every time you change the variable... Then you don't have unnecessary network traffic and the synchronisation is more accurate

#

Und you don't have an extra loop running on the server

#

Or if you really need the time from the server just use serverTime

velvet merlin
#

yeah one has to do time sync oneself

scarlet spoke
#

I'd still prefer an event system that will sync the time when needed... Like the client tells the server hey I need the time and then the respective function with the time as a parameter will be called... That's most likely more precise than with the sleep

#

And for the countdown I'd do completely server side and work with remoteExecCall for displaying it to the users

#

Or even better... Start it from the server and then use CBA's wait function to decrease the displayed number every second

velvet merlin
#

if you want to display stuff like "runtime/timeleft" you need to sync continuously

#

remoteExecCall = overhead

#

also good design is one main loop obviously (what cannot be done event based) - the above is just a code sample after all

scarlet spoke
#

Well I'm no friend of these continuous loops

#

Because I like to run my code in unscheduled env

#

But that's a different story ^^

#

^^

tame portal
#

For Rush I made the client ask for a time in seconds to be returned to the client and server the seconds added to the clients tickTime to get an accurate timer

#

Everytime the server updated the time for whatever reason it would just send a new time in seconds to all client which would then terminate the old time thread and create a new one with the seconds given by the server

stable wave
#

what is the differences between a vectore [x, y, z] and a position [x, y, z]?

vapid frigate
#

a vector is a direction (usually normalized)

#

ie [-0.5, 0.5, 0] would be NW

#

[0, 0.5, 0.5] pointing nth and up 45 degrees

little eagle
#

[-0.5, 0.5, 0] is not a unit vector

stable wave
#

what do x, y, z stand for? How can I convert degrees to vector and vice versa?

vapid frigate
#

i guess it depends on the context though.. like vectorAdd and stuff will work on positions too

little eagle
#

Uhm. How old are you?

#

This is all stuff you learn in 9th class

vapid frigate
#

i guess u could think of them like offsets

#

trigonometry to convert to degrees and back

#

(easiest in 2d)

stable wave
#

x is the axis x and y is the axis y?

vapid frigate
#

yeah

#

X is east/west, Y is north/south

#

Z is up/down

stable wave
#

numbers means degrees of rotation?

#

Aha, I got it

vapid frigate
#

no, numbers are positions

stable wave
#

Yeah, I thought it too much

vapid frigate
#

offsets

tame portal
#

@little eagle I feel you

broken mural
#

Are there some beat practices/guidelines available for script separation and mission file structure? I'm seeing my mission file becoming a little convoluted, even with a cfgfunctions setup

#

Best* //phone

tame portal
#

Do you mean a folder structure and references to files to keep it organized?

clear tendon
#

/scripts/<dump them here>
mission.pbo

broken mural
#

That seems messy and unorganized to dump everything in one location lol

dusk sage
#

A vector is not just a direction!

#

Gah

velvet merlin
#

structure:
client vs server
modules/components
AI vs player
core vs features
functionality

dusk sage
#

And all your positions are still vectors

velvet merlin
#

you can do a lot meaningful separation. read some guides on good software design

#

@broken mural

clear tendon
#

^

#

/scripts/script1/
/script/script2/

vital onyx
#

my project dedicated to file structure/organization in missions

broken mural
#

@vital onyx thanks! I'll check it out tonight

tough abyss
#

If anyone can help i apreciate:

#

if (_onVehicle && {_isDriver && {_lowFuel && {_hasAccess}}}) then {
_vehicle setFuel 1;
};

#

Is this ok.

tough abyss
#

Looks fine to me.

velvet merlin
#

Fixed: Damaged hit points of vehicles now can be repaired just as any global damage

#

any ideas what this means specifically?

tough abyss
#

I assume its setHitPoint works correctly when object is not local or its when _vehicle enableDamage false.

#

@tough abyss thanks big Vauun! ๐Ÿ˜„

#

โค

#

Oh!

velvet merlin
#

@tough abyss could be. good thinking - anyone wants to test? ๐Ÿ˜›

steep matrix
#

looking for some advice for our optimization gods ๐Ÿ‘ผ

#
  1.      if (!(_vehicle getVariable ["VCOM_VehicleDetectionActive",false])) then {
             if (_vehicle isKindOf "LandVehicle") then {
                 if (local _vehicle) then {
                     if (alive _vehicle) then {
                         private _driver = driver vehicle;
                         if (!(isNull _driver)) then {
                             if (alive _driver) then {
                                 if (_driver != player) then```
#
  1. (finding obstacles for cars)

        if ((_nearestObject distance _vehicle) < 100) then
        {
            _objects = nearestObjects [_nearestObject,["all"],10];//filter differently?```
#
  1. p3d type detection
_bridgeCheck = ["bridge",_p3dName] call BIS_fnc_inString;
_gateCheck = ["gate",_p3dName] call BIS_fnc_inString;```
cedar kindle
#

that's some hefty if

#

order the if-cases after what's most likely to be false, use lazy eval. and you can skip isNull because of the alive check

#

as for the filter, what kind of obstacles?

steep matrix
#

well is lazy eval cheaper? i wasnt sure if alive handle isNull cases well at all times - will try. tx

#

i ordered them the case by potentially simple check - but simple and often false is even better - good point

cedar kindle
#

do you have CBA available?

steep matrix
#

obstacles are usually various kinda of object types (sand bag, trash can, etc) or wrecks or vehicles

#
Bohemia Interactive Forums

Page 1 of 8 - VCOM AI Driving Mod - posted in ARMA 3 - ADDONS & MODS: COMPLETE: VCOM_DRIVINGHey guys, I made some driving improvements in my VCOM AI mod - however I thought (and others) that it would be nice to just have the AI driving enhancements without any other strings attached.This mod simply executes an FSM on all AI and checks if they are drivers or not. If they are actively driving a vehicle they will check for objects/buildings that may get in their way while driving.I could type...

#

it seems to work quite well - at least in simple cases. and as BI doesnt seem to have any interest to fix the issue with scripted/mission objects blocking vehicle path (see video), it is still relevant

cedar kindle
#

i'm guessing that's some loop to detect new vehicles, so if you have CBA you can use a XEH to catch the vehicles instead

steady hawk
#

Do you know how to disable headgear/sunglass randomization on units if I am creating a custom faction? Not just in one unit line but in the entire faction config

cedar kindle
#

_unit setVariable ["BIS_enableRandomization", false];

#

oh config

#

nvm

steady hawk
#

Also..if I'm creating an African faction from vanilla units...how can I only use African models as the base in the config?

steep matrix
#

well i am using a loop to catch new vehicles

cedar kindle
#

i'm guessing it's safest to catch all because of dynamic things moving into the area

#

how often does it run?

steep matrix
#

every 0.5s

#

one thing i want to change is this part:

#
                _Vehicle1 = "Land_CanOpener_F" createVehicleLocal [0,0,0];
                _Vehicle2 = "Land_CanOpener_F" createVehicleLocal [0,0,0];
                _Vehicle3 = "Land_CanOpener_F" createVehicleLocal [0,0,0];
                _Vehicle4 = "Land_CanOpener_F" createVehicleLocal [0,0,0];
                _Vehicle5 = "Land_CanOpener_F" createVehicleLocal [0,0,0];
                _Vehicle6 = "Land_CanOpener_F" createVehicleLocal [0,0,0];
                _Vehicle7 = "Land_CanOpener_F" createVehicleLocal [0,0,0];
                _Vehicle8 = "Land_CanOpener_F" createVehicleLocal [0,0,0];```
#

the way it works is to create these dummy objects (setPos) to make AI avoid that object

#

atm these are created per vehicle and deleted after 9s

#

my idea is to cache them (instead of create-delete cycle), so just reposition them, and to have them globally instead of per vehicle (thats that case already to some extend)

cedar kindle
#

having them globally sounds like it would introduce some nice bugs ๐Ÿ˜›

#

if you want to reuse them for every vehicle

#

but skip deleting them at least

steep matrix
#

well global in the sense shared per all vehicles (but still a local set for each player)

halcyon crypt
steep matrix
#

indeed

#

got one more case right now:


_objectsHouse spawn
{
    sleep 9;

    _this setVariable ["VCOM_DRIVERAVOID",false];
};```
#

this marks a "handled" house and removes again after 9s

#

instead of that one could add the refs to an array, store the timestamp of creation, loop them and remove after the delay (or distance?)

halcyon crypt
#

checking the timestamp would be faster than checking distance I guess, the former is just comparing 2 numbers

#

not that distance is that heavy

cedar kindle
#

why does it remove it?

halcyon crypt
#

because the objects are deleted after 9 seconds

cedar kindle
#

oh i thought it was a house, nvm

halcyon crypt
#

well it is a variable set on a house

#

close enough ๐Ÿ˜„

tough abyss
#

edit: just looking at vcom drive code
Pretty sure you rewrite the code pretty sure you can skip the createVehicleLocal altogether, you just need the positions

#

Since the local object is just beening used for isOnRoad check

halcyon crypt
#

how's that? It's not "directing" AI, it's just placing objects so that the AI avoids them. Making it seem like it's avoiding other objects.

tough abyss
steep matrix
#
                    if (isOnRoad _x) then
                    {
                        _objectsHouseArray = _objectsHouseArray - [_x];
                        deleteVehicle _x;
                    };
                } forEach _objectsHouseArray;```
#

whats the point of using of fsm these days? (aside for design perference)

tough abyss
#

AI Fsm have access to some engine events only to fsm i.e check out the danger.fsm (legend on the ui) i believe.
unScheduled enviroment
Easier to visual branching logic etc

#

Actually i think VCom driver is using the objects to prevent AI from driving offroad ๐Ÿ˜› Anyway need more coffee

velvet merlin
#

engine events only is only for confg launched fsm by the specific parameters

#

while i like in general the visual design idea, it makes coding just very ugly and harder to debug, etc

tough abyss
#

1 sec

velvet merlin
#

in almost all cases ppl code stuff in sqf and just port it at the end to fsm

#

unScheduled enviroment can be also achieved by other means, no?

tough abyss
#

Don't believe you can get this info in sqf. Without using a custom danger fsm to pass it to sqf
_dangerCause
/*
comment "0 DCEnemyDetected";
comment "1 DCFire";
comment "2 DCHit";
comment "3 DCEnemyNear";
comment "4 DCExplosion";
comment "5 DCDeadBodyGroup";
comment "6 DCDeadBody";
comment "7 DCScream";
comment "8 DCCanFire";
comment "9 DCBulletClose";
*/

#

Fsm does have it uses imo, but mainly just for AI logic

bitter magnet
velvet merlin
#

fsmFormation = "A3\characters_f\scripts\formationC.fsm";
fsmDanger = "A3\characters_f\scripts\formationCDanger.fsm";

#

only works for config fsm "EH"s

dusk sage
#

The argument between FSM vs pure unscheduled has occurred alot, usually in the favour of US, IIRC

tough abyss
#

FSM are also alot easier to debug AI issues imo. If you keep a handle for the FSM handle somewhere i.e like setVariable on the unit itself.
That way you can get / set variables inside the FSM while debugging crap

To accomplish the same thing with sqf implementation is harder todo when you got multiple AI running around. Without having a bunch of dynamic global variables.
Anyway back to terrain builder

little eagle
#
    if (!(_vehicle getVariable ["VCOM_DisableDriving",false])) then {
        if (!(_vehicle getVariable ["VCOM_VehicleDetectionActive",false])) then {
            if (_vehicle isKindOf "LandVehicle") then {
                if (local _vehicle) then {
                    if (alive _vehicle) then {
                        private _driver = driver vehicle;
                        if (!(isNull _driver)) then {
                            if (alive _driver) then {
                                if (_driver != player) then

so many redundant checks. If you are the driver, the vehicle IS local. If it's not NULL, then it is alive

velvet merlin
#

have mercy with me. last time i did real scripting was like 3 years ago

#

instead you could focus on the more interesting questions ๐Ÿ˜‰

halcyon crypt
#

@velvet merlin CBA's statemachine is a nice replacement for the FSM(editor) crap ๐Ÿ˜ƒ

#

using it in ALiVE and it's pretty cool ๐Ÿ˜ƒ

#

it can either be done by config or sqf

little eagle
#

@bitter magnet I created that changelog as "draft" 6 days ago. It's only visible to people with push access until it's released. If you actually release a "release", it will show the time of when the draft was created...

#

It's a github thing

bitter magnet
#

ok so that CBA_A3 v3.1.1.1012 is still new today(?). I mean this version was just released.

little eagle
#

Yes. A few hours ago.

#

Maybe yesterday. Depends where you live : )

bitter magnet
#

cool. I'll ignore the "x days ago" next time seeing rss news about release then ๐Ÿ˜ƒ

steady hawk
#

Repost from earlier for the evening crew: When making a unit config....if I want to disable randomization (hats, sunglasses) in the actual config..not in the init of one particular unit...how would I do that within the config itself?

tough abyss
#

How do i play a sound that is inside a mod PBO but not declarated in CfgSounds?

#

With playSound3D?

#

I'm using that playSound3D ["\BRP_sons\wakeup.ogg"... but not works. playSound3D ["BRP_sons\wakeup.ogg"... also don't work.

#

The PBO is BRP_sons.pbo and its prefix is BRP_sons

tough abyss
#

Its should be playSound3D ["BRP_sons\wakeup.ogg",_pos];
If its not working then typo mistake, or mistake with your pbo prefix etc...
Try extract the pbo to confirm you packed it correctly

vapid frigate
#

can check if the cfgpatches exists in the config viewer too to make sure it's running

vital onyx
#

@steep matrix resolved the optimization?

velvet merlin
#

not sure if it needs to be resolved, yet i am still looking for input ๐Ÿ˜ƒ

velvet merlin
#

@little eagle btw you misread the conditions

so many redundant checks. If you are the driver, the vehicle IS local.
this check is for AI - not the player ( if (_driver != player) then)

opal thistle
#

Does setVariable with public flag true essentially means the same as assigning value to variable and then broadcast it with publicVariable?

#

What if you store mission-specific variables in the gamelogic object namespace, does it provide more or less overhead compared to playerNamespace and missionNamespace?

#

I mean get and set operation for this variable

velvet merlin
#

@opal thistle setVar public always goes to all instances; with pV you can limited to server, all clients or specific client
setVar and pV both sync data for JIP (i guess for both always just the last values), pV client/server dont sync with JIP according to KK

#

as for data, i would assume pV is less as it requires no object instance/ID - i doubt anyone has checked this with wireshark or similar tools yet

#

@tough abyss what do you need?

halcyon crypt
opal thistle
#

As of JIP and variables sync, do I get it right that after join and init, all the actions cached in JIP queue, such as publicVariable called, remExec and so on are applied to the client?

#

And this way the joining client does not need to request these variables' current values from the server explicitly, right?

velvet merlin
#

In general yes, but it depends on the specific usage. Like not all are synced (pV client/server, remoteExec only with specific settings AFAIK, setVar public only when the object still exists AFAIK)

little eagle
#

you don't have the variables synched at preInit but from my testing, they'll all be synched at postInit

#

this is for setVariable and publicVariable, no idea about remoteExec. But I don't see why it would be different

#

If by init you mean the object init (event handlers, init box), then no. At that point they won't be synched. If you use CBA then you can use initPost for this

opal thistle
#

By init I mean mission init, and by "after init" - some moment of time between mission init and giving controls to the player

#

And let's assume everything we broadcast is cached in JIP queue for this question

#

Just would like to be sure I understand what JIP queue mean in BIS universe

tough abyss
#

@tough abyss thankyou for the help!

opal thistle
#

thanks for the explanations all!

#

another set of questions I can't find any reliable answer to:

#

if you create a vehicle on the map, its state is constantly broadcasted to the other clients and server, and synched as well. Does it mean that the variables declared in this vehicle' namespace with vehicle setVariable[...] are broadcasted as well? I suppose not, since BIS stated on their wiki the changes on these variables are local and need to be broadcasted again

#

Does this count for a game logic objects as well? Do all the clients automatically aware of them, just like vehicles?

velvet merlin
#

createVehicle vs createVehicleLocal

#

enableSimulation false to avoid/reduce network updates

#

setVar public is required - no auto sync of variables assigned to an object

tough abyss
#

enablesimulation only disables physics. There are still network updates
You need to use createsimpleobject to avoid network updates

opal thistle
#

ah, I see, thanks

velvet merlin
#

its quite old but most stuff still true and valid

#

check this too. i dont think it has network related stuff though

#

if you want to know such low level stuff, you should really run wireshark and do actual checks yourself

opal thistle
#

@tough abyss it's quite good for the instrument I think of

tough abyss
#

lol i thought the purpose of simpleobjects was it didn't need any network updates. except for initally telling the client were it was

opal thistle
#

especially they're synched on JIP if not local

tough abyss
#

I know, but it really doesn't make sense why there is any network traffic at all

velvet merlin
#

could be engine limitation

#

or maybe some kinda of info is to be transferred

#

again a wireshark should tell it, no? afaik all/most arma traffic is plain text

opal thistle
#

the last thing about JIP is, I think with remoteExec you can prevent adding the calls into JIP queue and sync the variables on JIP explicitly by calling the server script and waiting for a callback with values. Seems a lot lighter than executing all the commands from JIP queue

tough abyss
#

@velvet merlin they implement some network encryption (might be to strong a word) now.

velvet merlin
#

yeah i remember it was introduced in OA i think but was broken a few days after

opal thistle
#

meaning if you have a thousand public variables broadcasted thousand times during the game and synced with JIP, the client joining must get all the 1000^1000 setVariables and run them one by one on JIP

#

yes, I love extreme examples))

velvet merlin
#

IMO remoteExec is just for the lazy unless BI has implemented some extra optimization - which i doubt very much

#

someone said its get executed fastest - seems hard to believe too

opal thistle
#

well, it gives you full control on JIP queue

tough abyss
#

It is faster, it also avoids race conditions from using a global variable in PV.

velvet merlin
#

you can use just one pV and pVEH to handle your whole data traffic

tough abyss
#

Depends if you have multiple spawns / unscheduled enviroment sending traffic etc
You can avoid that headache using remoteexec

opal thistle
#

provided I understand the concept of JIP queue right

#

"meaning if you have a thousand public variables broadcasted thousand times during the game and synced with JIP, the client joining must get all the 1000^1000 setVariables and run them one by one on JIP"

or previous setVariable is overwritten by next setVariable for the same variable, e.g. it's a last-state cache?

velvet merlin
#

only last state is sent

#

what you have to keep in mind also, aside if you do really bad coding, the network traffic the game itself send is way more than one usually does

#

like position data, dmg, AI sync and all that kind of stuff

#

also unless you use very long strings, or big array - plus high frequency - scripted network traffic should be low

#

ofc its all a matter of good design and coding

#

most arma coders have no clue about that

#

so you get really bad coding

#

like ppl sending functions over the network

#

or lots of object references

opal thistle
#

well, the only large chunks of data I imagine so far is towns state array, players state array and bases state array. The last 1 not really frequently updated, and a way to insert a variable at a given place in staggered array is scripted already

#

thanks @velvet merlin

#

for the advices

velvet merlin
#

i learnt a lot from CoolBox's design with AAS

#

he had really slick design

inland cipher
#

do u need a script fore refuling , rearming and repering?

little eagle
#

By init I mean mission init, and by "after init" - some moment of time between mission init and giving controls to the player
there is no such thing as "mission init"

vague hull
#

Sending functions over net isnt so bad if you do it for a single target at a time

little eagle
#

well

#

if you do one every second it will take two minutes in a 60v60

vague hull
#

one after another (after sending is done) the client then just needs to wait till it has got all the functions it should

#

receiving all our 180 functions takes way less than a second. Just from the logs i had prepared (diag_log)
I will give it a shot and test it some more

#

since we had many ai and vehicles ingame without disabled simulation (havent prepared a good manager just yet) it hsould be a good test envoirnment even at like 10 players

#

ofc its extra traffic but we speak of a few kB (up to a MB I guesss) thats just nothing.. look at some of those nice 25 MB missions the server needs to send

velvet merlin
#

i guess you have a server side only component; aka you only send the functions once - this is a different matter and, likely, your script design is adjusted accordingly too

tough abyss
#

@tough abyss playSound3D worked, it was a typo indeed. Thankyou!

polar folio
#

does anyone have an idea how the wound textures/materials are applied by the engine?
i'm trying to make a unit look fully wounded via script by using setObjectMaterial. but hte following doesn't work.

_mats = getarray (configfile >> "CfgVehicles" >> typeof player >> "Wounds" >> "mat");

for "_i" from 0 to (count _mats)-1 do
{
player setobjectmaterial [_i, _mats select _i]
};

#

it was just a blind guess. thought maybe someone knows the proper way

tough abyss
#

how to determine if a vest or a backpack can be added to a box? canAdd seens to return true allways for then, even if there is no space on the box.

tough abyss
#

Sorry i was talking cheetos. Found a problem.

#

New release may be today...

#

The best no-players mod out there!

gilded rover
#
            mass = 20;

            class MuzzleSlot {
                iconPosition[] = {0.000000, 0.400000};
                linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
                compatibleItems[] = {"muzzle_snds_H_MG_blk_F"};
            };
            class CowsSlot {
                iconPosition[] = {0.500000, 0.300000};
            };
            class PointerSlot {
                iconPosition[] = {0.200000, 0.400000};
            };
        };``` can someone explain why i cant equip that silencer in arsenal , Always used to work , but now it doesn't help please
vague hull
#

@velvet merlin its part of the init phase, client sets up till its ready to get the fncs, messages the server about it and goes into a control loop to check if it has got all the functions. The server then sends the functions to that specific client when it's 1st place of the queue

velvet merlin
#

sounds reasonable. due pVClient to the new JIP this is alright nowadays

vague hull
#

I going to double check tho.. you never know ^^
Still dunno if it's better to go with remoteExec, yet I couldn't figure out a good way to use it just for defining vars

little eagle
#

@polar folio they depend on hard coded hitpoints

#

HitHead, HitBody, HitHands, HitLegs

#

Bad thing is that these also control limping and weapon sway due to damaged hands/arms

#

before anyone says that these are customizable like in vehicles

#

they are not. class Wounds is different from class Damage of vehicles

livid inlet
#

in the eden editor you can disable foliage by pressing Ctrl+G. Is there a way to do the same via a script?

vital onyx
#

@livid inlet setTerrainGrid ?

livid inlet
#

@vital onyx that works for grass etc but for the tree foliage etc it doesnt have effect.

vital onyx
#

then it may be an animation in tree models

livid inlet
#

ah ya possibly

young current
#

trees are usually map objects so they behave differently from ground clutter.

livid inlet
#

Ya it would be nice to be able to trigger the same functionality via script

#

i guess its possible it can only be done in eden

polar folio
#

@little eagle: i only want the visuals though. but you reminded me of those injury selections which are not (or not necessarily set up as hidden selections) which is the problem. anyways. i have a blind guess that is good enough for what i need.

thx

echo tulip
#

Hey, I'm if anyone can help I am having an issue with the Virtual Arsenal + Whitelisting. Whilst whitelisting items works fine when going through the different categories in the top left such as weapons/clothing etc however when someone clicks random or presses CTRL+R they can be given a random item which isn't in my whitelist such as silencers or bipods. I am lost and cannot find a way to fix this issue and have no idea why it is occuring.

opal thistle
#

anyone knows any drawbacks of storing 200+ named variables in gamelogic object and fetching them with getVariable?

#

Y N BIS GAVE ME HASHTABLE

#

I'm thinking of storing gear prices and mission-related data in 3 gamelogic objects to fetch them by classname when needed

#

a linear search takes a lot of time with such large arrays

#

here a guy states that one can use separate arrays for keys and values and use find command

#

do I miss something in find command?

indigo snow
#

_val = _values select (_keys find _query)

opal thistle
#

"It all comes back down to the command find, which is 100% linear"

#

hmm

velvet merlin
#

Added: A new inAreaArray set of script commands

#

@opal thistle are you familiar with "the general rules of optimization"?

tough abyss
#

I'm doing a GUI and I can't get this button to work, I want it to open the rebel clothing shop which is "reb" but I've no idea how, the normal one is working as an addAction "this addAction[localize ""STR_MAR_Rebel_Clothing_Shop"",life_fnc_clothingMenu,""reb"",0,false,false,"""",' license_civ_rebel && playerSide == civilian'];" but I need it to execute and open life_fnc_clothingMenu, ""reb""; on a click of a button, anyone knows how? cheers

#

nm

#

huh?

#

Sorry was aimed at previous comment above you ๐Ÿ˜› edited it now

#

oh okay ๐Ÿ˜ƒ

opal thistle
#

@velvet merlin not sure I am)))

chrome nebula
#

Hey guys, I'd like to know how I'd be able to add AI kills to the scoreboard during a Zeus mission?

opal thistle
#

inAreaArray? Can't find that in google