#arma3_scripting

1 messages ยท Page 473 of 1

meager heart
#

afaik it works only with 2 or 3 controls types and same for ctrlTextHeight... ๐Ÿคท

cosmic lichen
#

I know

peak plover
#

I have 30 apples and an unknown amount of players. I wanna split the apples as equally as possible,
but always give out 30 apples

#

What do?

cosmic lichen
#

eat all apples and distribute none, that way they are equally distributed

peak plover
#

๐Ÿค”

#

What if I replace the apples with umm...

#

ACE_bananas

#

I can not eat any bananas

#

I am allergic to bananas

#

how do I give the 30 bananas to unkown amount of players in a way that every single time 30 bananas are given out and they get as close to equal amounts of bananas as possible

meager heart
#

lol

peak plover
#

wait I think I know

meager granite
#
_apples = 30;
_players = allPlayers;
for "_i" from 0 to _apples - 1 do {
    _player = _players select (_i % count _players);
    _player setVariable ["apples", (_player getVariable ["apples", 0]) + 1];
};

Something like this?

cosmic lichen
#

But wouldn't count _players mean that you actually know the number of players?

meager granite
#

Code can be optimized depending on what "apple" is

peak plover
#

ohh, I guess that can work ๐Ÿค” thanks

#

I didn't even think of it like that ๐Ÿ˜„

#

haha

meager granite
#

He means that player number may change each time you run the script

cosmic lichen
#

I see

#

Any idea why (_disp displayCtrl 1600) ctrlEnable false; (_disp displayCtrl 1601) ctrlEnable false; hides my control instead of disabling it?

#

Seems like they are moved behind the background or so.

meager granite
#

Try disabling background too?

cosmic lichen
#

Gonna try that

peak plover
#

A long shot, but maybe there is a color defined for disabled control?

cosmic lichen
#

@meager granite No luck.

#

@peak plover That could be, let me check

#

You were right

#

Why didn't I think about that.

#

Thanks!"

peak plover
#

๐Ÿ‘๐Ÿป

cosmic lichen
still forum
#

"Copy" button should say "Copy Source". Because of the placement it looks like it means "Copy function name"

cosmic lichen
#

Yep, you are right

meager heart
#

looks nice, good job ๐Ÿ‘Œ also no white backgrounds... finally... ๐Ÿ˜ƒ

cosmic lichen
#

Thanks

#

Thanks

peak plover
#

@cosmic lichen looks very good.

#

Wait these are all precompiled, right?

#

*preprocess

cosmic lichen
#

They are added via loadFile

queen cargo
#

need some experienced scripters to help me shape some lil project of mine: https://discord.gg/wbM6u2T
right now, it is mostly creating the chapters properly (yes, it is a text thingy .. not sure what it will end up being ๐Ÿคท)

cosmic lichen
#

What's that about?

queen cargo
#

i plan to write some comprehensive document about SQF

#

that is pretty much the channel to discuss everything

#

not much is yet done
but ... it is in the very early phase anyways ๐Ÿคท

cosmic lichen
#

Sound like alot of work, but the title fits perfectly ๐Ÿ˜„

queen cargo
#

it is
but ... hey ... that crap floated in my mind for ages already
and @gleaming oyster just made me think about it again ๐Ÿคท

#

^this btw. is the reason i need help by experienced scripters
so i cover every topic that may or may not be needed for SQF

cosmic lichen
#

I am going on vacation tomorrow, we can talk about that when I am back. I am generally interested but not sure how much time I can invest.

queen cargo
#

no problem
not sure how fast the whole thing will progress either

#

it may be done in a few month or in a year from now on ๐Ÿคท

tender fossil
#

What's the difference between BIS_fnc_addStackedEventHandler and BIS_fnc_addScriptedEventHandler?

still forum
#

ScriptedEventhandlers are scripted EH's

#

addStackedEventHandler is a old almost obsolete thing for engine eventhandlers

#

For back when you could only have one eventhandler in the engine that was used to be able to bind many functions to the same handler

#

but we now got stacked eventhandlers on engine side. Only thing that StackedEH is useful is that you can directly bind arguments to your handler code

tender fossil
#

I wonder why are both commands used in this snippet of code

tag_vehiclePlayer = objNull;
["tag_customEvents", "onEachFrame", {
    _data = vehicle player;
    if !(_data isEqualTo tag_vehiclePlayer) then {
        [missionnamespace, "vehiclePlayerChanged", [_data, tag_vehiclePlayer]] call BIS_fnc_callScriptedEventHandler;
        tag_vehiclePlayer = _data;
    };
}] call BIS_fnc_addStackedEventHandler;

[missionNamespace, "vehiclePlayerChanged", {
    params ["_newVehicle", "_oldVehicle"];
    systemChat "Changed vehicles"
}] call BIS_fnc_addScriptedEventHandler;
#

@still forum

#

Do you need to like format and prepare the stuff and attach it to "onEachFrame" EH with addStackedEventHandler and then actually add the event handler with addScriptedEventHandler?

#

I'm confused ๐Ÿ˜›

peak plover
#

So hypothetical here

#

Let's say I wanna create a bunch of ambient civilians

high marsh
#

agents

peak plover
#

I can offload some code to the clients to keep server/hc perf higher

#

has anyone here done that?

#

Should I even do that?

tender fossil
#

So you want to offload the civilian AI calculation to clients @peak plover?

peak plover
#

yeah

#

Im thinking of ways of doing it

tender fossil
#

Benny's Warfare (back in A2) used to offload the AI calculation to clients with best performance

#

Let me check, I might even have the code on my PC

peak plover
#

Okay

#

I'm thinking I'll measure fps and ping to the server, then set a variable that allows civilian creation

#

then I can use nearentities and such to make sure one area only has a certain max amount of civilians

#

basically I'd create civilians only around the player that is allowed to run it

tender fossil
#
/*
    Get the available delegators.
     Parameters:
        - Count
*/

Private ["_amount", "_count", "_delegators", "_fps", "_get", "_limit", "_unit", "_units"];

_count = _this;
_units = if (isMultiplayer) then {playableUnits} else {switchableUnits};

_limit = missionNamespace getVariable "WFBE_C_AI_DELEGATION_GROUPS_MAX";
_fps = missionNamespace getVariable "WFBE_C_AI_DELEGATION_FPS_MIN";
_delegators = [];
_amount = 1;

while {count _units != 0 && count _delegators < _count && _amount <= _limit} do {
    for '_i' from 0 to count(_units)-1 do {
        _unit = _units select _i;
        if (isPlayer _unit) then { //--- Only get players.
            _get = missionNamespace getVariable format["WFBE_AI_DELEGATION_%1", getPlayerUID _unit];
            if !(isNil '_get') then { //--- Make sure the client already communicated with the server.
                if ((_get select 0) >= _fps && (_get select 1) <= _limit) then { //--- Check that the client FPS avg is above the FPS min and that it still has room for groups.
                    if ((_get select 1) < _amount) then { //--- Progressive checks to prevent client overloading.
                        _delegators = _delegators + [_unit];
                    };
                } else {
                    _units = _units set [_i, "**NIL**"];
                };
            } else {
                _units = _units set [_i, "**NIL**"];
            };
        } else {
            _units = _units set [_i, "**NIL**"];
        };
        
        if (count _delegators >= _count) exitWith {};
    };
    
    _units = _units - ["**NIL**"];
    _amount = _amount + 1;
};

_delegators
#

Note that this is from Arma 2

#

Then just set the locality of AIs (I think you need to set the locality for AI groups instead of individual AIs in Arma 3)

peak plover
#

Hmm

tender fossil
#

From setOwner A3 Wiki page:

From server machine, change the ownership of an object to a given client. Returns true if locality was changed.
Since Arma 3 v1.40, this command should not be used to transfer ownership of units with AI (agents are an exception to this rule). Using command in an unintended way will display an on-screen warning and log a message to .rpt file.
To transfer ownership of all AI units in a group properly, use setGroupOwner instead. 
peak plover
#

right

#

So basically how does benny do it?

#

he loops through all the players

#

Finds the ones that are suitable for handling the units

tender fossil
#
/*
    Make an object local to a client.
     Parameters:
        - Object
        - Locality target (client)
*/

Private ["_object","_local_to"];

_object = _this select 0;
_local_to = _this select 1;

_object setOwner (owner _local_to);
peak plover
#

Right, but after that

#

the unit gets changed to a different locality

tender fossil
#

But yeah, in Arma 3 you need to use setGroupOwner if you're handling AI groups, with agents setOwner works however

peak plover
#

How does he get waypoints etc.

tender fossil
#

Hmm... Based on the code I'm going through, he seems to track the AI locality with this function:


/*
    Track the delegation of a group.
     Parameters:
        - Client UID.
        - Group.
*/
WFBE_SE_FNC_DelegationTracker = {
    Private ["_delegator", "_group", "_uid"];
    
    _uid = _this select 0;
    _group = _this select 1;
    _id = (_uid) Call WFBE_SE_FNC_GetDelegatorID;
    
    while {!isNull _group} do {sleep 5};
    
    if (_id == (_uid Call WFBE_SE_FNC_GetDelegatorID)) then { //--- Only decrement if the session ID is the same (make sure that the player didn't disconnect in the meanwhile).
        [_uid, "decrement"] Call WFBE_SE_FNC_DelegationOperate; //--- Increment the group count for that client.
    };
};
#

I guess you just need to monitor the locality of AIs (like above) and send the AI commands with eg. remoteExec

peak plover
#

That sounds like waay too much traffic ๐Ÿ˜„

tender fossil
#

I don't know... If you target specific clients instead of spamming it out loud to every client, it should work, no?

still forum
#

@tender fossil why are both commands used Because they do different things. One add's a onEachFrame handler which is a engine handler thus AddStackeEH. The other add's a scripted eventhandler

#

The PFH is executing the scriptedEventhandler. It works like the CBA eventsystem pretty much

austere granite
#

but worse

tender fossil
#

PFH?

austere granite
#

๐Ÿ˜‰

#

per frame handle

tender fossil
#

What's PFH ๐Ÿ˜„

austere granite
#

run code every frame basically

still forum
#

PFH == Per Frame Handler == onEachFrame

tender fossil
#

Ah

austere granite
#

i guess i could've done a stacked mission EH for him, i never wrote vanilla code since those were added

still forum
#
tag_vehiclePlayer = objNull;
tag_vehicleChangedEHID = addMissionEvantHandler ["EachFrame" , {
    _data = vehicle player;
    if !(_data isEqualTo tag_vehiclePlayer) then {
        [missionnamespace, "vehiclePlayerChanged", [_data, tag_vehiclePlayer]] call BIS_fnc_callScriptedEventHandler;
        tag_vehiclePlayer = _data;
    };
}];

[missionNamespace, "vehiclePlayerChanged", {
    params ["_newVehicle", "_oldVehicle"];
    systemChat "Changed vehicles"
}] call BIS_fnc_addScriptedEventHandler;
austere granite
#

but whatever, it'll work for him :3

still forum
#

that would be the more modern variant

austere granite
#

or dedmen can fix

#

โค

still forum
#

stackedEH's are.. mostly useless.. With the direct engine EH you get the EH recompilation bug and you cannot bind arguments

tender fossil
#

Hmm... I think I might've understood it, which is my goal since I'm trying to learn to write such stuff on my own ๐Ÿ˜›

austere granite
#

yea i just couldn't remember the vanilla way of doing them in a couple lines

#

you get the EH recompilation bug

#

this is still a thing?

#

fucking lel

still forum
#

What "scriptedEventhandler" is doing is keep a Array in missionNamespace with all the handlers

tender fossil
#

...and to avoid the vast minefield of bugs

still forum
#

so you essentially have

VehicleChangedHandlers = [{systemChat "handler1"},{systemChat "handler2"}];

and

{call _x} forEach VehicleChangedHandlers
austere granite
#

event systems like that are a nice way of keeping things modular in arma, that means you have one central place for basic events like that, and then in other areas you can add their actual behaviour

still forum
#

To your example.

tag_vehiclePlayer = objNull;
tag_VehicleChangedHandlers  = [];
tag_vehicleChangedEHID = addMissionEvantHandler ["EachFrame" , {
    _data = vehicle player;
    if !(_data isEqualTo tag_vehiclePlayer) then {
        {[_data, tag_vehiclePlayer] call _x} forEach tag_VehicleChangedHandlers
        tag_vehiclePlayer = _data;
    };
}];
tag_VehicleChangedHandlers pushBack  {
    params ["_newVehicle", "_oldVehicle"];
    systemChat "Changed vehicles"
};
#

the scriptedEH functions are just a framework that take care of defining that tag_VehicleChangedHandlers array for you

peak plover
#

// currently including HC
private _players = allUnits select {isPlayer _x};

missionNamespace setVariable ['mission_civ_sent',CBA_missionTime];
{
    //--- runs on the client
    // make sure player exists
    if (isNil 'player' || {isNull player}) exitWith {};
    [[player,(diag_fps)],{

        //--- runs on the server
        params ['_unit','_fps'];
        private _sent = missionNamespace getVariable ['mission_civ_sent',0];
        private _ping = CBA_missionTime - _sent;
        _unit setVariable ['unit_civ_fps',_fps];
        _unit setVariable ['unit_civ_ping',_ping];

    }] remoteExec ['call',2];
} remoteExec ['call',_players];

// give time for players to return their stuff
sleep 1;

// limits
private _pingLimit = 0.3; // in seconds
private _fpsLimit = 50;

// select only the players which surpass the requirements
_players = _players select {
    private _unit = _x;
    private _ping = _unit getVariable ['unit_civ_ping',10];
    private _fps = _unit getVariable ['unit_civ_fps',0];
    (_ping < _pingLimit && _fps > _fpsLimit)
};

if (_civPlayers isEqualTo []) exitWith {systemChat 'civ: error no _civPlayers'};

// init the players
[true] remoteExec ['civ_fnc_initLoop',_civPlayers];

#

I got this so far

compact maple
#

Hello, whats the best way, to play a sound when a player is near an specific object ?

peak plover
#

@compact maple

https://cbateam.github.io/CBA_A3/docs/files/network/fnc_globalSay3d-sqf.html
compact maple
#

Thanks you, but it say this is deprecated

peak plover
#

yes, it also says what to use

#

use that

compact maple
#

right tnx

still forum
#

@peak plover <link that's not supposed to embed here>

peak plover
#

oooh, yes

still forum
#

also your's can't embed anyway

peak plover
#

Dedmen, what do you think of the sqf posted above

#

I wanna make players run scripts

#

Basically

#

Agents that run on players

still forum
#

My brain probably can't right now.. I just spent 3 hours with vectors and normals and degenerated edges

peak plover
#

๐Ÿ˜ฎ

#

Aite, I'll keep crackin' at it.

#

Trying to figure out clever ways to do this, without too much hassle.

meager heart
#

imo better option will be just keep all mission flow stuff on the server only and "something ambient" on hc, if hc is on the server... so those ambient things is optional/required hc, nigel

peak plover
#

Well

#

I use HC for normal Ai

#

server always has shit to do

#

Clients are complaining of high fps

#

I'll just use the clients

tender fossil
#

Why not to offload everything on HC only?

#

"Clients are complaining of high fps" What? ๐Ÿ˜„

peak plover
#

Beats me too

#

"Man my fps was so high in that mission"

#

๐Ÿคท๐Ÿป

tender fossil
#

But is it a complaint?

peak plover
#

sure

tender fossil
#

Sounds like happy dude to me

peak plover
#

A happy dude has no business playing arma

meager heart
#

also possible > Man my fps was so high in that mission Man i was so high in that mission ๐Ÿ˜ƒ

peak plover
#

That is quite possible

tender fossil
#

My brain is generating endogenous high when I have high FPS in Arma, does it count?

meager heart
#

i mean.... "to high fps issues... " do not exist afaik ๐Ÿ˜„

peak plover
#

Ever play on a wonderful place called takistan ? ๐Ÿ˜„

#

This badboy can fit so many FPS

tender fossil
#

60 FPS... Mmm drools ๐Ÿคค

peak plover
#

You can get more fps simply by following a couple of simple rules

meager heart
#

with Dedmen unlocked exe you can have 500+ fps on the server, but if fps will be higher, i don't mind at all ๐Ÿ˜ƒ

shadow sapphire
#

How would I define _this in this?

_this addweaponglobal "arifle_Mk20C_plain_F";

Which is called from an ammo box in my mission with this in the init:

Null = execvm "script.sqf";
winter rose
#

this execVM "myscript.sqf" ๐Ÿ™‚

shadow sapphire
#

Oh. That explains a lot, actually. This shit used to work.

peak plover
#

Never give ai weapon attachments.
Never give ai backpacks(unless absolutely necessary)
Limit the amount of total units in players view distance at any time as much as possible.
Delete dead bodies.


^ free fps above this line

meager heart
#

cool mods ^ also... i mean play with just normal addons... ๐Ÿ˜„

shadow sapphire
#

@winter rose, there isn't an error being thrown anymore, but the box is still empty...

#

I gotta go to work, so I guess I'll have to work on this later, haha.

winter rose
#

try _this setDamage 1 and see if there is an effect; if there is, the script has an issue ๐Ÿ˜„

shadow sapphire
#

Yes. That worked. Will explore later, thanks!

peak plover
#

:^)

#

execvm

#

๐Ÿคข

shadow sapphire
#

@winter rose, was using addweaponglobal, should have been using addweaponcargoglobal.

meager heart
#
_this addWeaponCargoGlobal ["arifle_Mk20C_plain_F", 1];

try this ^ DEL-J ๐Ÿ˜ƒ

winter rose
#

๐Ÿ‘

shadow sapphire
#

That was it, @meager heart. It's been a loooong time since I messed with equipment crates haha. Damn... Anyway, thanks a bunch, @winter rose and @meager heart. Gotta run!

tawny island
#

Hello, I am having an error output show up on testing a mission I've created. I am not sure what it wants for me. Are there any editors out here who can help me make sense of it so I could fix the issue?

winter rose
#

we are, yup

tender fossil
#

@tawny island Yes, it's best to just paste your issue/output here

winter rose
#

between these
```sqf

tawny island
#

I am not sure how i can copy the text from the little black square, or how I could expand it to copy it

tender fossil
#

Do you know how to access your .rpt file? The errors are logged as text there

winter rose
#

:
```sqf
hint format ["you are %1", name player];
```
โ†“

hint format ["you are %1", name player];
tawny island
#

No, how do I access this file?

peak plover
#

%AppData%\..\Local\Arma 3
^ put that into start

#

or run

#

windows key + R

#

Look at the logs

tawny island
#

Should I paste the entire file here? Thats kind of spammy.

#

I can upload it to a pastebin

digital hollow
#

Try out %LocalAppData%

hollow thistle
#

@nigel "%LOCALAPPDATA%" :P

digital hollow
#

boom!

peak plover
#

๐Ÿ˜ฎ

tawny island
#

I found the file, I am talking about the text

tender fossil
#

I guess pastebin is cool?

peak plover
#

Search the file for the portion of the error that you did see

tawny island
#

Ok, thanks, one moment please.

#

I am attempting to set up a zeus enabled mission. I am running all the CUP mods as well as VCOM-AI while editing.

#

I've unpacked a copy of the ZGM missions to copy the zeus setup, as well as copied the init and desc files to my mission folder.

#

But I think this kind of raw copy paste is what caused this error to start, so maybe I am missing a certain parameter defined somewhere.

digital hollow
#

Probably the init is trying to reference something that doesn't exist in your mission. Go into the init and comment out everything except what you're familiar with.

tawny island
#

the only thing in my initServer.sqf is #include "\a3\Missions_F_Curator\MPScenarios\MP_ZGM_m11.Altis\initServer.sqf"

#

Also this repeats itself ``if (_rule > 0) then {
_grpCount = _grpCountR>
23:04:08 Error position: <_rule > 0) then {
_grpCount = _grpCountR>
23:04:08 Error Undefined variable in expression: _rule
23:04:08 Error in expression <IconVisible && (_grpCount < _minsize || _rule <= 0) && _n < _allgroupstotal && !>
23:04:08 Error position: <_rule <= 0) && _n < _allgroupstotal && !>
23:04:08 Error Undefined variable in expression: _rule
23:04:08 Error in expression < "_icon"

&&

!isnil "_iconsize"

&&

_rule > 0

&&

_n < _allgroupstotal

&&>
23:04:08 Error position: <_rule > 0

&&

_n < _allgroupstotal

&&>
23:04:08 Error Undefined variable in expression: _rule
23:04:08 Error in expression <isnil "_icon" && _rule > 0 && _n < _allgroupstotal && !i>
23:04:08 Error position: <_rule > 0 && _n < _allgroupstotal && !i>
23:04:08 Error Undefined variable in expression: _rule
23:04:08 No glasses for bis_curatorUnit``

digital hollow
#

Looks like trying to make this work is going to be a lot messier than just learning to put down a Zeus Game Master module.

tawny island
#

I think so too, my problem is, even after I remove the modules I copied and the files except for the mission file the error keeps dishing out.

#

I guess I'll start over. Do you have any good tutorials for understanding how to lay down Zeus?

#

I couldn't find anything concrete that imitates the BIS zeus missions on the web.

digital hollow
tawny island
#

Alright thanks for the help!

meager heart
tender fossil
#

Which one of these is correct?

_drawMhqOnMap = addMissionEventHandler ["EachFrame", "updateMhqPosOnMap"];

or

_drawMhqOnMap = addMissionEventHandler ["EachFrame", updateMhqPosOnMap];

where updateMhqPosOnMap is a global function?

still forum
#

Both are "correct"

#

depends on what you are trying to do

#

the first one does nothing. You'd need to add a call for it to call your function

#

the second executes the function but is hit harder by the recompilation bug

tender fossil
#

So the first should be something like

_drawMhqOnMap = addMissionEventHandler ["EachFrame", { call updateMhqPosOnMap }];

?

still forum
#

yeah

#

or just "call ..."

tender fossil
#

Ah, so the string is interpreted even without the curly brackets?

tough abyss
#

how do i make a simple teleporting thingy

still forum
#

yes.

tough abyss
#

i want to be able to teleport from a flag pole to another

tender fossil
#

I see, thanks!

still forum
#

The function actually internally only uses string

#

it converts your code to a string. and uses that

tender fossil
#

lol

still forum
#

@tough abyss player setPos <target here>

tough abyss
#

i get that

#

but im confused

#

am i supposed to put that in the object int?

still forum
#

not that directly. You'll probably wanna add a action

#

And then put the addAction into the object init

tough abyss
#

stupid question but is there just a simple mod for it?

#

because im terrible at this stuff

still forum
#

Making a mod is more complicated that just writing this script

#

so I don't think so

#

this addAction ["Teleport to target", { player setPos <target here> }];

#

in init field.

#

of course need to insert your target

tough abyss
#

okay so i just change the "target here"

still forum
#

the <target here>

tough abyss
#

oh

#

thats it?

still forum
#

Yeah

#

Needs to be a position

tough abyss
#

so what am i supposed to put as the target if i want multiple of them?

still forum
#

you put multiple addActions

#

each with a different target

tough abyss
#

got it

digital hollow
#

You can do it! Fly like an eagle! setPos [0, 0, 1000]

tough abyss
#

so the target is supposed to be a variable

#

so how do i make a target a variable lmao

#

WAIT

#

NVM

tender fossil
#

Is every function in the given file (given that there are multiple functions inside it) compiled if I call the file like this?

call compileFinal preProcessFileLineNumbers "Core\Server\Init\initServer.sqf";
tough abyss
#

ok i seem like an idiot rn that has to ask for everything but one more thing

tender fossil
#

@tough abyss Don't worry, I have the same feeling ๐Ÿ˜„

#

That's how we start our journey into Arma programming

tough abyss
#

now it says error: Type object, expected array

ruby breach
#

setPos requires an array, not an object

tender fossil
#

You probably used the object itself as variable, while you should use its position (getPos objectName)

ruby breach
#
this addAction ["Teleport to target", { player setPos (getPos _target) }];
tough abyss
#

omg thank you so much

still forum
#

@tender fossil that whole file is compiled. Including everything inside it

tender fossil
#

Nice, thanks again ๐Ÿ˜›

still forum
#

I guess you mean with "multiple functions inside it" whether the variables for these functions are set

#

compiling and setting a variable are different things

#

you are calling that code. Meaning it will execute. Meaning your assignments are executed. Meaning your variables are assigned

#

Also what the compileFinal there instead of compile?

#

That makes absolutely no sense

fair drum
#

what command can i do after a skip waypoint trigger to force units to ignore all enemies and get in the chopper. they stay in auto danger too long searching for more enemies

tender fossil
#

@still forum I thought compileFinal would be better for functions ๐Ÿ˜›

still forum
#

Then you don't understand what it's doing at all

tender fossil
#

Probably not ๐Ÿ˜„

still forum
#

you shouldn't be doing things that you know nothing about. Keep it simple

peak plover
#

KISS

still forum
#

super simple?

tender fossil
#

When is compileFinal useful?

still forum
#

if you store the function in a variable and want no one to be able to overwrite it

tender fossil
#

That's kinda what I did

still forum
#

I don't see store the function in a variable anywhere in there

#

you call it directly and then discard the code

tender fossil
#

The content of the file is (currently):

updateMhqPosOnMap = {
    deleteMarkerLocal "mhqCurrentPos";
    _mhqPos = getPos currentMhq;
    _mhqCurrentPosMarker = createMarkerLocal ["mhqCurrentPos", getPos currentMhq];
    _mhqCurrentPosMarker setMarkerShapeLocal "ICON";
    _mhqCurrentPosMarker setMarkerTypeLocal "DOT";

    if (speed currentMhq > 2) then {
        _mhqCurrentPosMarker setMarkerColorLocal "ColorBlack";
        _mhqCurrentPosMarker setMarkerTextLocal "MHQ - Moving";
    };

    _mhqCurrentPosMarker setMarkerColorLocal "ColorYellow";
    _mhqCurrentPosMarker setMarkerTextLocal "MHQ";
};
peak plover
#
Keep
It
Simple
Stupid

๐Ÿ˜ƒ

still forum
#

yeah. you are assigning code to a variable without any compile inbetween

#

so the variable will not be final

#

Read again store the function in a variable

#

THE FUNCTION

#

not some other function somewhere else in your game

tough abyss
#

is it possible to delete grass with some sort of script?

tender fossil
#
updateMhqPosOnMap = compile "
    deleteMarkerLocal "mhqCurrentPos";
    _mhqPos = getPos currentMhq;
    _mhqCurrentPosMarker = createMarkerLocal ["mhqCurrentPos", getPos currentMhq];
    _mhqCurrentPosMarker setMarkerShapeLocal "ICON";
    _mhqCurrentPosMarker setMarkerTypeLocal "DOT";

    if (speed currentMhq > 2) then {
        _mhqCurrentPosMarker setMarkerColorLocal "ColorBlack";
        _mhqCurrentPosMarker setMarkerTextLocal "MHQ - Moving";
    };

    _mhqCurrentPosMarker setMarkerColorLocal "ColorYellow";
    _mhqCurrentPosMarker setMarkerTextLocal "MHQ";
";

? ๐Ÿ˜„

still forum
#

@tender fossil compile takes string

tender fossil
#

Whoops

still forum
#

@tough abyss you could spawn a grasscutter. That's a object that hides the grass in it's area

#

don't know it's classname though

#

you should be able to spawn that in 3DEN too

tough abyss
#

okay but is it possible to change terrain from grass to rock for example

still forum
#

no

tender fossil
#

Is it better now? ๐Ÿ˜„

still forum
#

look at the syntax highlight and answer that yourself

tender fossil
#

Well, I guess it's correct since it's a string now ๐Ÿ˜›

still forum
#

look at that syntax highlight garbage and tell me again that it's correct

#

A string has one color in syntax highlight.

tender fossil
#

Ok, so it's not correct ๐Ÿ˜›

#

Ah, I just realized

still forum
#

That's why you should use CfgFunctions ^^

#

That makes everything alot easier

tender fossil
#

So maybe

updateMhqPosOnMap = {
    deleteMarkerLocal "mhqCurrentPos";
    _mhqPos = getPos currentMhq;
    _mhqCurrentPosMarker = createMarkerLocal ["mhqCurrentPos", getPos currentMhq];
    _mhqCurrentPosMarker setMarkerShapeLocal "ICON";
    _mhqCurrentPosMarker setMarkerTypeLocal "DOT";

    if (speed currentMhq > 2) then {
        _mhqCurrentPosMarker setMarkerColorLocal "ColorBlack";
        _mhqCurrentPosMarker setMarkerTextLocal "MHQ - Moving";
    };

    _mhqCurrentPosMarker setMarkerColorLocal "ColorYellow";
    _mhqCurrentPosMarker setMarkerTextLocal "MHQ";
};

compile "updateMhqPosOnMap";
still forum
#

yeah.. compile "updateMhqPosOnMap" now returns {updateMhqPosOnMap}

#

and then you throw that returned value away

tender fossil
#
updateMhqPosOnMap = compile "updateMhqPosOnMap";

Now? ๐Ÿ˜„

still forum
#

That is the same as updateMhqPosOnMap = {updateMhqPosOnMap};

tender fossil
#

I guess it's related to how the interpreter works? (By replacing that variable with the code I've stored in it)

#

And because it's inside curly brackets, it's interpreted as code

still forum
#

curly braces mark the start/end of a string. Which is supposed to be compiled as CODE

#

you have to get your function into a string

#

easiest way is to just put it into a file and load it from there

meager heart
#

Keep It Simple Simple
I never say twice... never say twice...
โœŠ @peak plover

tender fossil
#

The problem is that I don't understand yet what is simple and what is not @meager heart ๐Ÿ˜›

#

That's what I'm trying to learn here ๐Ÿ˜ƒ

meager heart
#
That's why you should use CfgFunctions ^^
-Dedmen

that ^

tender fossil
#

So I guess it would be the best option to make new file for every function and compile the files individually?

#

I'll check the wiki article for the CfgFunctions (given that there is one)

still forum
#

yes.

#

And that is exactly what CfgFunctions does for you automatically

tender fossil
#

Oh yes, this will make my life a lot easier ๐Ÿ˜„

fair drum
#

once again, im still having trouble learning certain scripts. like this

{_x setcaptive true;} foreach [units baseass]

how do i fix my syntax

digital hollow
#

replace [] with ()

fair drum
#

that would do it

tough abyss
#

so ive seen units with a shooting range with scores

#

is there some sort of script for that or do is there a mod?

digital hollow
#

Likely custom. Search workshop for shooting range missions.

tough abyss
#

ok there is one mod

#

altis advanced shooting

#

do i need to add that to tadts or

#

just subscribe to it myself and put it down on the mission file?

tender fossil
#

Can I group several functions together in one file to be compiled by CfgFunctions? Or do the functions need to be in individual files to be compatible with CfgFunctions

meager granite
#

No you can't.

#

If you ask me, CfgFunctions is just a nuisance. compileFinal security usefulness is very slim.

fair drum
#

anyone got any good video resources for arma 3 scripting?

tender fossil
#

Aight, thanks for info @meager granite ๐Ÿ˜ƒ

meager granite
#

In my opinion, unless you expect that your functions will be used by someone else (e.g. public mod that will be used in scenarios made by others), there is not much reason to use CfgFunctions, organize your codebase in a way convenient to you.

civic canyon
meager granite
#

@civic canyon Config looks fine, but I doubt anyone will help you with Altis Life issues here, ask in their discord.

fair drum
#

if i run setcaptive and action surrender on a unit while hes in combat, will the enemy still kill him or will it disengage

digital jacinth
#

captive will set the unit temporarily to civillian site, other ai will not engage that unit then

#

that does not mean they will not shoot that unit by accident

astral tendon
#
    defuser = createVehicle ["Land_MultiMeter_F", _caller, ["",""], 0, "CAN_COLLIDE"];
    defuser attachto [_caller, [-0.2, 0.01, 0.06], "LeftHand"]; 
    defuser setVectorDirAndUp [ [0,1,1], [0,0,1]];
    Rope = ropeCreate [defuser, [0, 0, 0], _this select 3, [0, 0, 0], 3];

_this select 3 is a Land_MobilePhone_smart_F, the rope is not created, even if i reverse it, tohugh if I change to a vehicle it does work.

winter rose
#

use params really ๐Ÿ˜‰

#

@astral tendon ropeAttach only works (afaik) on PhysX, simulated objects

civic canyon
#

@meager granite ฤฑ found

hollow thistle
#

If someone is interested FPS problems of the Liberation players that I was trying to debug were caused by C2 - Command & Control.

#

Every time unit respawns it adds more "killed" event handlers to player unit.

still forum
#

what is "C2"?

#

I know it as a explosive

meager heart
#

almost... like 50% ๐Ÿ˜ƒ

hollow thistle
#

"C2 - Command & Control"

#

The ai commanding mod that was even featured a few times in BI articles.

#

I guess the author thought that "killed" EH dies with the unit.

#

It does not ;>

still forum
#

but that shouldn't lower FPS

hollow thistle
#

after many rapid respawns i had 2k scripts in the scheduler.

still forum
#

it just causes big FPS drops at death

#

Oh.. It also add's scripts and never removes them?

hollow thistle
#

It adds more EH and these EH execute something on every respawn.

#

So after few respawns it spawned so many scripts that my scheduler looked "dead"

#

count of active scripts was not going down for ~10min

still forum
#

Then there's two bugs. These scheduled scripts never stopping and always spawning new on respawn.
And the killed EH's stacking up which causes even more scripts spawned every respawn

civic canyon
#

hi What can I do against hackers?

still forum
#

Run Battleye. Ban them.

civic canyon
#

the server exploded

hollow thistle
#

You say it was BOMBED? ๐Ÿ˜„

winter rose
#

FBI has joined the server

civic canyon
#

yes i've tried so hard for it ruined

meager heart
#

hi What can I do against hackers?
you can be logged as admin on the server, so when hackers will start hacking, admin will start banning ๐Ÿ‘Œ

civic canyon
#

how can I detect it?

#

he is spawning bomb

meager heart
#

๐Ÿ‘€ <with this tools

astral tendon
#

@winter rose is it possible to make a invisilbe dummy with PhysX?

still forum
#

with #arma3_model for sure... But without mods.. Dunno if hideObject disables physx

tender fossil
#


















params [
["_namespace", objNull, [true, >
 1:57:42   Error position: <params [
["_namespace", objNull, [true, >
 1:57:42   Error Params: Type Object, expected Array
 1:57:42 File A3\functions_f\Misc\fn_callScriptedEventHandler.sqf [BIS_fnc_callScriptedEventHandler], line 20
#

Ingame it complains about some error with preProcessor (empty file or sth)

#

Where could the issue be?

still forum
#

preprocessor? where

#

you are calling BIS_fnc_callScriptedEventHandler with invalid arguments

tender fossil
#
CNC_mhqEhId = addMissionEventHandler ["EachFrame", {
    _currentVehicle = vehicle player;

    if (!(vehicle player == player) && (vehicle player isKindOf "LandVehicle")) then {
        currentMhq = _currentVehicle;
    };

    [missionNamespace, "mhqMarkerUpdate", currentMhq] call BIS_fnc_callScriptedEventHandler;
}];
#
[missionNamespace, "mhqMarkerUpdate", {
    params ["_currentMhq"];
    _currentMhq call CNC_fnc_updateMhqPosOnMap;
}] call BIS_fnc_addScriptedEventHandler;
still forum
#

yeah. currentMhq

#

arguments need to be ARRAY not object

#

exactly like the error says

tender fossil
#

So,

    [missionNamespace, "mhqMarkerUpdate", [currentMhq]] call BIS_fnc_callScriptedEventHandler;

?

still forum
#

ye

#

Are you using scripted eventhandlers although you only ever have a single handler?

#

and why are you using EachFrame handler for all your stuff?

tender fossil
#

This is code written mostly by someone here ๐Ÿ˜„

still forum
#

EachFrame should only be used if you know what you are doing.

#

And if the timing needs to be exact

tender fossil
#

Yeah, I know it takes it's toll

still forum
#

I don't think it would be a big problem if the marker is updated half a second late

rotund otter
#

so, advanced armor plate mod auto doesnt auto add plates to vests, in eden nor zeus.
is there any way i can auto add plates to units i spawn in with zeus?

still forum
#

!(vehicle player == player) Wow.. That's...
(vehicle player != player) also exists.. you know?..

tender fossil
#

lol true ๐Ÿ˜„

still forum
#

@rotund otter that sounds like something extremely specific to that mod that probably very few people here know. Asking somewhere mod specific like on their BI Forum thread or if they have a discord or something would probably get you a answer sooner

rotund otter
#

i just need to know how to add an item (like a magazine) to a unit with additem, i just need to know how to sense when they spawn

still forum
#

Do you have CBA?

rotund otter
#

yes

still forum
waxen tide
#

finding empty positions is a pain in the rear.
https://community.bistudio.com/wiki/BIS_fnc_findSafePos
Return Value:
Array - in format [x,y] on success. When position cannot be found at all, default map center position is returned, which will be in format [x,y,0]

why the hell return the default map center? do i seriously now have to write around that to catch it? jesus.

#

probably easier to look up the fnc, copy it and remove the bit of code that does that

still forum
#

Why?

tender fossil
#

"Preprocessor failed with error - Invalid file name (empty filename)"

still forum
#

Just check if array has 3 elements and done.

#

Never seen that error message

tender fossil
#

I wonder if it has something to do with functions.hpp and using the default folder structure

still forum
#

just put it directly into description.ext

tender fossil
#

I've included functions.hpp to description.ext

rotund otter
#

thanks, ill take a look

still forum
#

#include "functions.hpp" like this?

tender fossil
#

Yes

waxen tide
#

is there a simple way to define custom AI loadouts and groups?

rotund otter
#

how do i add an item to a unit on zeus spawn?
["Man", "Init", {addItemToVest "SCT_plate_ceramic_sapiS_magtype" _this}] call CBA_fnc_addClassEventHandler;
or
init = "addItemToVest "SCT_plate_ceramic_sapiS_magtype" ['_Man'];";

fair drum
#

what am i doing wrong {_x setcaptive false;} foreach [crew truck2 + vehicle truck2]

peak plover
#

Basically

#
crew truck2 // [unit1,unit2,unit3]
vehicle truck2 // truck2
#

truck2 is already vehicle

#

vehicle truck2 is same as truck2

#

you cannot add an object (vehicle truck2) to an array (crew truck2)

#

forEach goes over each element of the array

#

by writing ```sqf
[crew truck2 + vehicle truck2]

You create a new array containing no elements, because you can't add (crew truck2) to (vehicle truck2)
fair drum
#

ok so what would be an example of a way to do it?

peak plover
#

to return all the crew members of the vehicle: (crew truck2)

fair drum
#

i could do... {_x setcaptive false;} foreach crew truck2

peak plover
#

yes

fair drum
#

but does that include the truck to make it targetable again?

#

or is it not needed

peak plover
#

You should not even setCaptuve for the truck

#

Yeha not needed

fair drum
#

ok got it. just do it for units

meager granite
#

Vehicle has side of commanding unit in it. Empty vehicle is civilian.

inner swallow
#

Yeah, so do (crew truck2 + truck2) @fair drum

peak plover
#

you can't

#

you can't add a object to an array

#
(crew truck2 + [truck2])
#

That would work however

inner swallow
#

Ah, yeah, good point

peak plover
#

๐Ÿ˜‰

fair drum
#

you do a good organized job at explaining

peak plover
#

Anyone use this?

#

What difference do the planning modes provide?

digital jacinth
#

I personally used this only with agents and the "LEADER PLANNED" mode

peak plover
#

Can one give the agents guns and have them shoot at people?

digital jacinth
#

I take it you can actually give them guns if they inherit from CAMAN base, but you probably need to code all the target acquiring and pulling the trigger.

#

personally I only rally made ambient civs and animals as agents. once they need to shoot i'd rely on AI

peak plover
#

ezier for me to just do normal units

still forum
#

@rotund otter for your information I just told you what do do but deleted it again. If you want any help here in the future I'd really suggest you read #rules

digital jacinth
#

is there a way to disallow nvgs without removing them from inventory completely?

alpine dew
#

Anyone ever F with Source mods? My son wants to make a HL2 mod

still forum
#

@alpine dew This is the Arma discord

alpine dew
#

I'm aware

inner swallow
#

Very good

tender fossil
#

Is it safe to learn to create GUIs with Arma Dialog Creator?`

#

Or will I spoil myself ๐Ÿ˜„

winter rose
#

@digital jacinth place them in the vest, unequip them?

tough abyss
#

I mean in general SQF coding gives you brain damage.

tender fossil
#

@tough abyss It's too late already

digital jacinth
#

@winter rose scenario is total electrical wipe out. since they are using modern nvgs they shouldn't be able to use them. placing them into their vests is as good as deleting them

#

actually, no it is better then deleting them

#

but still. i wished i could just disable them or force them off as soon as they enter into the nvg mode

winter rose
#

@digital jacinth you can script wise, visionMode or something like that

hollow thistle
winter rose
#

then remove/readd the nvg I guess

#

^ yep!

hollow thistle
#

or dont remove the nvg but add full black display/overlay to simulate dead NVG.

winter rose
#

true! it would be better (but for a player only)

meager heart
#

maybe currentVisionMode + setAperture ๐Ÿ˜ƒ

digital jacinth
#

it will be for players only. however this would require me to check each second if the vision mode is the one i dissalow

#

i doubt there is an eh for that

winter rose
#

I don't think a disableNVGequipment would work ๐Ÿ˜„

digital jacinth
#

nah it works for vehicles only

hollow thistle
#

yeah you would need a PFH but i doubts it is perf intensive.

digital jacinth
#

checking each second should be enough, but knowing the players i usually play witht ehy will just spam the nvg key to see a little bit

meager heart
#
waitUntil {currentVisionMode player == 1};
playSound "RscDisplayCurator_visionMode"; //--- cool sound
setAperture <value>; //--- > -1 auto default
#

๐Ÿค”

digital jacinth
#
[{
    if(currentvisionmode player == 1) then {setAperture 100};
    if(currentvisionmode player == 0) then {setAperture -1};
},[],1] call CBA_fnc_addPerFrameHandler

something like that

tender fossil
#

Omg, I've just only opened ADC but I love it already โค

#

So handy tool

meager heart
#
setAperture ([-1, 100, -1] select (currentVisionMode player))
```๐Ÿ‘€
digital jacinth
#

totally unsuable

#

oh no, i guess i also need to add a check if the player is looking through binocs..

meager heart
#

probably you will have to check for the vehicles... too

digital jacinth
#

๐Ÿ˜ฉ

austere hawk
#

and weapon scopes...

winter rose
#

ouch! true, totally forgot them

austere hawk
#

this is escalating quite nicely xD

tender fossil
#

LOL! I made my first dialog with ADC having pretty much no idea what I was doing, and got it working in the game within an hour

#

Got me honestly excited ๐Ÿ˜„

winter rose
#

ADC?

tender fossil
#

Arma Dialog Creator

#

Now that I look at the config I exported, I feel sad for everyone that has had to go through it manually

peak plover
#

What was trigger classname again?

primal mulch
#

just wondering, does anyone know exactly when onPlayerConnected / onPlayerDisconnected are fired? Like is it only when the player truly joins the server or can I use it safely for tracking which players are in a mission? (ie does it fire when a mission is started / ended)

meager granite
#

I enjoy writing dialog configs very much, I must be a masochist

#

@primal mulch When you go from lobby to game and from game to lobby

#

Not when you join or leave the server itself

peak plover
#

I enjoy writing dialog configs very much
๐Ÿ‘บ

primal mulch
#

ah so if a player stays on the server between a mission finishing and starting it will fire for them both times?

meager granite
#

(Leaving the server by say stopping game's process will also trigger disconnected event of course)

unborn ether
#

Configs GUI are not flexible anymore. I see more profit in procedural ones with createDisplay and ctrlCreate

meager granite
#

It should

#

I don't think you can do everything with just createDisplay and ctrlCreate

unborn ether
#

Well you can do even more

meager granite
#

I mean config\style-wise

#

Or wait, can you ctrlCreate mission-defined classes?

unborn ether
#

Since you can't basically ctrlDelete a simple config controls group is already an argument for me

meager granite
#

"NOTE: Since Arma 3 v1.69.141213 ctrlCreate will also search for control class in mission config, if search in the main config failed."

#

So yeah, you can do anything then

unborn ether
#

Yes since some 1.68 I believe

#

The thing is you can build GUI based on offsets with procedural way

meager granite
#

I did that by copying all elements 100 times back in the day LOL

unborn ether
#

Like control Y based on previous control H f speaking roughly

meager granite
#

I wonder if I might be the first one doing this back in 2013? ๐Ÿค”

#

Probably not

#

๐Ÿ˜‚

meager heart
#

lol

#

imo also animated elements ^ (sliding/collapsing/transforming) with ctrlCreate is kinda easier vs configs...

meager granite
#

pats himself on back

unborn ether
#

The basic example of why I use procedural is when you have a list of controls (lists of something but better than RscListboxes) in controls group - if you want to delete and regenerate a new one you simply can ctrlDelete the whole controls group, while config will not allow that

#

This creates some kind of pagination

meager heart
tough abyss
#

hi guys, nice GUI

#

i have a problem, I have a Unit with a variable name "tp1" (without the quotes) and when I try to use it in my scripts it says undefined variable. Could you help me please?

tame portal
#

i can imagine 80% of the development time of koth was used for the UI

#

@tough abyss well is the unit actually there?

tough abyss
#

omg im retarded

meager granite
#

There is also ctAddRow now that was added exactly for this kind of task, I didn't use it in real case yet though.

unborn ether
#

@tough abyss it means it's nil - unit wasn't created or variable wasn't defined at all

tough abyss
#

thanks @tame portal, probability of presence was 0%

unborn ether
#

@meager granite Those are still useful but lacking visuals

meager granite
#

@tame portal This is actually not far from truth. UI and progression config were most time-consuming tasks initially.

unborn ether
#

But faster

#

Like RscListbox can regenerate 1000 of elements in a blink of your eye

meager granite
#

Though honestly ct* stuff is kind of pointless since you have absolute flexibility with ctrlCreate\Delete already. And its not like you need to create or delete 100s controls each frame, usually heavy stuff happens onLoad or when you press a button, performance gain from ct* commands is likely a drop in the ocean in real cases.

earnest path
#

Hey guys i downloaded a map called Chernarus 2035 the map has a lot of wrecked vehicles spread around it. When i use the console i see all of them are <NULL-object>. Now the core of my question is i have roaming AI which are struggling to pathfind trough these objects so i would like to remove them but none of the commands i know work on them (deleteVehicle, hideObject, hideObjectGlobal) any suggestions?

peak plover
#

u can't do anything with them

meager heart
elfin sierra
#

im new to arma 3 is it a dead game?

young current
#

@elfin sierra

earnest path
#

@meager heart I am trying the same as your code and i cant get it to go away did you test this in Multiplayer or map ?

meager heart
#

in Multiplayer or map
in Multiplayer on map < there ๐Ÿ‘Œ

earnest path
#

@meager heart Cool i manage to get it working by using hideObject rather than hideObjectGlobal hmm

digital jacinth
#

today I learned you can fill every bit of ram with arma by just shooting people up beyond the stratosphere https://i.imgur.com/XfkaziU.png
someone from my group is currently trying and arma is uses 30 gb ram now

earnest path
#

@meager heart Thank you for your help i will figure it out further

meager heart
#

np

#

eden localizations is... so gud /s i just can't find anything there ๐Ÿ˜„

earnest path
#

@meager heart if you would allow me to pick your brain again.
Class => Land_Wreck_Skodovka_F


// Remove all wrecks
{
    _x hideObjectGlobal true;
}
forEach nearestTerrainObjects
[
    [worldSize/2, worldSize/2],
    ["Land_Wreck_Skodovka_F"],
    worldSize,
    false
];
#

Any idea how to get this working

meager heart
#

afaik it should be type name not the class name ^

earnest path
#

yes but the that class has no type

#

In the docs it says its of type wrecks but it does not work with nearestObjects or nearestTerrainObjects

meager heart
#

try HIDE

#

also you will have the lowest fps record

#

with worldSize ๐Ÿ˜ƒ

earnest path
#

I know but all i want is to be able to select all these objects trough one command so i can get their coordinates than i will make a script to hide them

#

And currently the nearestTerrainObjects does not have a way of giving me all the shkoda wrecks

meager heart
#
0 spawn {
    private _list = (nearestTerrainObjects [getPosWorld player, ["HIDE"], 1000, false]) apply {hideObjectGlobal _x};
    hint str (count _list);
};
```into the console ^
meager granite
#

nearestTerrainObjects doesn't use classes, use nearestObjects for that

meager heart
#

just tried that ^ 1726 objects was hidden ๐Ÿ˜ƒ

#

no wrecks there around

meager granite
#

nearestObjects [[worldSize / 2, worldSize / 2], ["Land_Wreck_Skodovka_F"], sqrt(2 * worldSize ^ 2) / 2]

meager heart
#

yep ^

#

btw what is Land_Wreck_Skodovka_F ? ๐Ÿ˜ƒ

#

ohh nvm

earnest path
#

Its a wreck of a skoda

#

ะจะบะพะดะฐ ๐Ÿ˜ƒ

#

Thanks for the help gents i am going to bed will try solve this mystery tomorrow morning over a cup of coffee ๐Ÿ˜ƒ

meager heart
#

so with HIDE was removed: all wrecks, r2_boulder2, lavicka_3, garbage_square5_f and something else.... ๐Ÿ˜ƒ

earnest path
#

@meager heart the HIDE picked up the shkodas and the garbages i guess that would work for me

#

Now i just have to extract a list of coordinates of all the skodas and use that filter with very small radius on these coordinates and it will delete just the skodas

meager heart
#

that thing >p_articum

unborn ether
#

@meager heart @earnest path tip: its better to hide objects in pre-init stage, and server only. Hiding that much of objects on client drastically decreases FPS and increases RAM usage. Server does it better and faster and doesn't really load JIP. Checked that multiple times for own purpose.

earnest path
#

@unborn ether Sure my intention was always to use server to do the job on initial load. I was just looking for a way to get an array of objects that needed to be cleared

unborn ether
#

@earnest path is allMissionObjects suitable ?

#

Oh nvm it's not

#

It doesn't touch map objects

#

Well nearest*objects then

meager heart
#

@unborn ether nearestObjects < afaik will not return those ^... preInit < unscheduled and with worldsize your mission start will be slightly deeeeelayed ... ๐Ÿ˜ƒ pre-init stage < thats before objects initialized... ๐Ÿค”

keen tusk
#

Hey there
Im locking for a way that force AI to use RPG-7 against a BlackHowk (you know what i wanna say :D)
I search many froums but cant find any thing usable
Can any one help me?

worldly locust
#

Why does calling BIS_fnc_findSafePos on the exact same location with the same parameters sometimes fail to find a position, yet 90% of the time finds one absolutely fine?

meager granite
#
_checkPos getPos [_maxDistance * sqrt (_off + random _rem), random 360] call
#

random 360

#

That's why

unborn ether
#

@meager heart In pre-init objects are created but not initialized right - but pointers are already existent. I did cleanup in a world size and by specific coordinates. Worldwide cleanup takes around 40 seconds and touches ~18k objects on Altis map

#

@meager heart why is it faster - I can only guess that those objects which hidden in pre-init doesn't init any geometry and maybe simulations, so it's easier to go by created-hidden than created-inited-hidden

meager heart
#

i see ๐Ÿค”

#

probably just "do not go crazy about radius"...the right tip ๐Ÿคท

astral tendon
#

I remember that there is a way to disable default actions like place mines

#

what is the command for that? I need to disable the place exlosive.

little oxide
#

I know the way with addon, but i don't think it's possible without any addon

unborn ether
#

This will allow to detect current action by name or string definition and disable acting with addAction to DefaultAction (see actions list) - this is basically allowing to disable any actions up to firing a weapon

meager heart
#
inGameUISetEventHandler ["Action", "_this select 3 == 'UseMagazine'"];
```something like that, maybe
astral tendon
#

were is the list of actions?

meager heart
#

there >

inGameUISetEventHandler ["Action", "hint str _this"];
astral tendon
#

nice, thanks

shadow sapphire
#

Hmmmm... How do I grab the init of an individual spawned in a group?

#
_HQ = [_Base, INDEPENDENT, ["I_officer_F","I_medic_F","I_Soldier_SL_F","I_soldier_UAV_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;```

I want to grab the medic's init to put something in there. So, I need select 1's init somehow. Is this possible? Is there a roundabout way?
mortal nacelle
still forum
#

@mortal nacelle do not post URL links w/o short description of what it is , anywhere

mortal nacelle
#

@still forum fixed.

shadow sapphire
#

Does this work? Alternatively, how might I monitor if it's working myself?

    {
        {
            _x execvm "Gear\AAF.sqf";
        } foreach units _x;
        _x deletegroupwhenempty true;
    } foreach [_HQ, _G1, _G2, _G3, _G4, _G5, _G6];
#

The deletegroupwhenempty part is what I'm trying to monitor... It's not throwing errors, but I want to know if it's actually deleting these groups when they are dead.

unborn ether
#

@shadow sapphire well it pretty sure does, that group will become grpNull, if you want to compare further

shadow sapphire
#

How might I monitor that?

unborn ether
#

I don't actually remember why that exist, since AFAIK all empty groups are still deleted within some time

#

@shadow sapphire If you need to monitor that, you can temporary put them into global vars

#

Or setvariable as array elsewhere

shadow sapphire
#

Sounds good. Will just make them global temporarily. The only reason I added that deletegroupwhenempty catch is because it was noted that it was still needed on the bis wiki.

meager granite
#

_x spawn {waitUntil{isNull _this}; systemChat "Group just got deleted";}

shadow sapphire
#

When I try to use:

[group this, getPos this, objnull, true] call BIS_fnc_wpDemine;
12:40:44 Error in expression <
};
} foreach (_units - _specialists);

sleep         1;

count _mines == 0 || count _>
12:40:44   Error position: <sleep         1;

count _mines == 0 || count _>
12:40:44   Error Generic error in expression
12:40:44 File A3\functions_f_orange\Waypoints\fn_wpDemine.sqf [BIS_fnc_wpDemine], line 140
12:40:44 Suspending not allowed in this context
12:40:44 Error in expression <alists);

sleep         1;

count _mines == 0 || count _units == 0
};


{
_x domove _p>
12:40:44   Error position: <|| count _units == 0
};


{
_x domove _p>
12:40:44   Error Generic error in expression
12:40:44 File A3\functions_f_orange\Waypoints\fn_wpDemine.sqf [BIS_fnc_wpDemine], line 142
#

That happens.

meager granite
#

Well it says what the issue is: 12:40:44 Suspending not allowed in this context

#

As for other error, probably wrong arguments

meager heart
#

yeah ^ call that function from scheduled or spawn it maybe...

shadow sapphire
#

It's a BIS function and I can't seem to find the documentation I need to understand it, since I'm ignorant about function.

#

Oh, that's a good idea!

#

Spawn. Will try that soon.

meager heart
#

location of that function File A3\functions_f_orange\Waypoints\fn_wpDemine.sqf ๐Ÿ˜ƒ

shadow sapphire
#

What can I learn from the location of the function?

#

I'm pretty ignorant about this stuff.

meager heart
#

It's a BIS function and I can't seem to find the documentation I need to understand i
so... just check it, maybe you will find the answers ๐Ÿ˜ƒ

meager granite
#

copyToClipboard str BIS_fnc_wpDemine

#

Is quickest way to see what's going on

#

Otherwise look at original file

shadow sapphire
#

That sounds pretty good!

#

@meager granite, that's friggin genius...

meager granite
#

Copying function into clipboard like this doesn't have comments and some formatting, but it should contain file path of original script and can give you a quick idea what function does.

shadow sapphire
#

Yeah, it's a very neat technique.

brave jungle
#

Hey lads, If I were make a mod that uses vanilla units and stuff to add custom units into factions, like CTRG, will it still be clientside etc. or not

shadow sapphire
#

Depends on how it's implemented and if you care about errors being thrown.

#

If you do it as a replacement, you can do it pretty slick, but if you do it in addition, then it's down to your tolerance for errors being thrown.

brave jungle
#

Sorry I missed something on clientside hehe. I mewant clientside mods, like JSRS etc.

#

In theory, it's not required for everyone correct? (if it's vanilla)

#

This is for the Zeus Menu

shadow sapphire
#

That's what I'm saying. It's not required for everyone, as long as it isn't calling a class that the clients don't have. If it's calling something that they don't have, then it could throw errors in the back ground.

brave jungle
#

Rightt

#

I see

#

Awesome

shadow sapphire
#

To answer your question in short form, yes. You can have host/server/Zeus mods without requiring them for everyone else.

#

I used to run a mod that relied on some trickery like that. Got the idea from America's Army II. Ask @past inlet about it, if you want. He's the one that constructed it. Was really slick stuff and I haven't seen it used anywhere but on AAII and on our Arma server.

brave jungle
#

Oh neat

#

I presume custom weapon textures will require all clients with the mod

#

but say, loadouts don't

#

(example)

shadow sapphire
#

Not necessarily.

brave jungle
#

Oh?

shadow sapphire
#

In fact, our mod was a weapon mod. We replaced the MX rifles with AR15s, and set it up so that errors weren't thrown, because there were no mismatches. Clients running the mod saw AR15s, clients without the mod saw MX rifles. It was a clean replacement, just had to make sure that file names remained exactly the same. So, you could do custom weapon textures that directly replace vanilla textures, then the host and any clients running the mod would see the custom textures, people not running the mod see vanilla textures, but get no errors or anything.

brave jungle
#

Oh cool

#

Nice to know it's possible

shadow sapphire
#

Just remember, REPLACE, don't ADD. Adding stuff in or misrepresenting a replacement gives you trouble or requires everyone to have the mods.

#

America's Army II used it in a very clever way. A way that I've thought about using for PVP modes in Arma or my own game. They had it where either side looked like the "good guys" to themselves, but looked like "bad guys" to their opposition. Very cool concept, instead of having a good team and a bad team, both teams were playing as the US Army against insurgents. Neat stuff. Clever execution.

#

Problems would arise with certain vehicles and hitboxes, but even then, you could get away with quite a bit with similarly classed vehicles.

civic canyon
#

Hello , Our new server has some problem about scripts.When more players join to the server , all scripts start to run slower as they play.As example : car lock unlocks with a delay , a bit late.When you log out and re login to the server it fixes for you but a bit after that , the same problem starts to happen again.Server's ping is normal and cpu , ram is pretty good too.There's no problem about them

tough abyss
#

write better scripts or get better internet?

unborn ether
#

@civic canyon Your client VM degrades, relog tells that this is not JIP - that means your scheduled environment gets pawned with some whiles or wait untils in spawns or something

dusk sage
#

To be a noticeable delay, you'd need a large amount of that

halcyon ivy
#

you guys know of a good linting tool for SQF and HPP?

dusk sage
#

One might assume he'd unlock the car on keydown though, and it wouldn't be scheduled

civic canyon
#

delay is getting too much

#

all scripts start to run slower as they play

#

When you log out and re login to the server it fixes for you but a bit after that slower

ruby breach
#

As someone said before, it sounds like you're clogging the client scheduler with too many infinite loops and/or spawned scripts

civic canyon
#

Can it be related to the command to destroy snakes and rabbits?

peak plover
#

Go over all of your scripts and optimize them

#

Sounds like slow scripts

#

If your concept works and this prototype you have is fun but laggy, rewrite the thing and make it optmizied

civic canyon
#

๐Ÿ˜ฆ

meager heart
meager granite
#

@civic canyon

onEachFrame {systemChat str activeScripts}
#

Watch number grow as you do actions in your mission, this will give you a hint what causes threads to pile up

still forum
#

@halcyon ivy Visual Studio Code with the SQF Linter extension

dim token
#

How do you consume a new CfgFormations subclass? Can't seem to find anything that directly references the formation class names, just the corresponding string values accepted by setFormation and such.

meager granite
#

Formations list is hardcoded but uses values from CfgFormations

#

You can't add a new one, only modify existing

fossil yew
#

What are benefits of using CBA events over remoteExec + call ?

#

(passing code around)

still forum
#

with CBA events you don't pass code around

#

only the arguments

#

You have the eventhandler on the target side who already has the code and waits for a message with the arguments

quasi rover
#

In artillery support module, is there a way to restrict artillery support only when the cursor is targeting at armored vehicles?

meager heart
#

(picture from wip stage there ^)

civic canyon
#

@meager granite this problem is only in the civilian

velvet merlin
#
LIB_argt_vasilev_group = group argt_vasilev;
_wp1 = LIB_argt_vasilev_group addWaypoint [getMarkerPos "argt_marker_task4",0];
_wp1 setWaypointType "move";
_wp1 setWaypointSpeed "full";
_wp1 setWaypointBehaviour "aware";
_wp1 setWaypointVisible false;
_wp1 setWaypointStatements ["true","argt_crossroad = true;"];
LIB_argt_vasilev_group setCurrentWaypoint _wp1;```

does anyone know if only the AI GL can complete the (move) WP or also you as player if you are part of the group and in the radius?
also is there way to force complete a WP?
meager heart
#

does anyone know if only the AI GL can complete the (move) WP
afaik it's just about the formation/spread or whoever will be in the completion radius first
also is there way to force complete a WP?
setCurrentWaypoint < last active wp becomes completed
also is radius really 0 b default
probably it's depends on unitReady or some engine based way of checking when unit completed "move order"... or he is at expectedDestination so it's slightly random like with doMove and move ๐Ÿค”

tough abyss
#
params ["_waypoint","_group","_position"];

[_waypoint,_group,_position] spawn {
    params ["_waypoint","_group","_wpPos"];

    _distance = (leader _group) distance _wpPos;
    _distance = ((_distance)/1000.0) max 1.0;

    sleep (_distance * 200);
    _currentWPs = waypoints _group;

    _newPos = getWPPos (_currentWPs select 0);

    if (_wpPos isEqualTo _newPos) then {
        [_group] call GAIA_fnc_removeWaypoints;
    };
};
#

So we have been finding that vehicles sometimes don't move, could be an AI mod or a game bug, regardless we have been cancelling waypoints if they hang around too long. This is a bit MCC specific as it assumes the first waypoint is the target (MCC generates two for just about everything and only the first one matters) and the way it removes all waypoints might not be appropriate but the approach of assuming some time period with a spawn script that sleeps and then checks if the waypoint has already been met or if it hasn't remove it works fairly soundly.

#

The tricky bit is determining the actual waypoint is done and you will probably want _currentWPs select currentWaypoint and not 0 and then the GAIA_fnc_removeWaypoints you will probably want to just deleteWaypoint _currentWPs select currentWaypoint

dim token
#

Thanks Sa-Matra. I was worried that was the case.

meager heart
#
0 spawn {
    private _group = createGroup playerSide;
    private _marker = "VR_3DSelector_01_default_F" createVehicle (player modelToWorld [0, 30, 0]);

    for "_i" from 1 to 5 do {
        private _unit = _group createUnit [typeOf player, player, [], 10, "NONE"];
    };

    private _wp = _group addWaypoint [_marker, 0];
    _wp setWaypointType "MOVE";
    _wp setWaypointSpeed "FULL";
    _wp setWaypointCompletionRadius 0;

    private _wpRadius = waypointCompletionRadius _wp;
    private _position = waypointPosition _wp;

    waitUntil {unitReady (leader _group)};

    {
        if ((_position distance (expecteddestination _x select 0)) > _wpRadius) then {
            _x doMove _position;
            waitUntil {unitReady _x};
            doStop _x;
        };
    } forEach units _group;
};
```this ^ https://gyazo.com/3290d023f972dc187d99ce94f4f6fc6d ๐Ÿ˜ƒ
#

completion radius is 0

#

but...

#

i mean... actual units positions will be random every time

peak plover
#

how to I add inventory opened to all future dead bodies?

tough abyss
#

Doesn't this happen already with normal arma?

peak plover
#

I add inventory opned to all units and then?

winter rose
#

@peak plover, do you mean EH?

#

that should be it

peak plover
#

hmm

meager heart
#

Killed > InventoryOpened ๐Ÿค”

#

Respawn < and after > add InventoryOpened ๐Ÿ‘€

#

๐Ÿ˜

civic canyon
#

@meager granite this problem is only in the civilian

unborn ether
#

@meager heart Just to be sure, add any EVH after Respawn ๐Ÿ˜„

#

Or even right inside of it

meager heart
#

@unborn ether thanks! will try that one!11 ๐Ÿ˜„

inner swallow
#
BraK3N - Today at 14:16
@Sa-Matra  this problem is only in the civilian

BraK3N - Today at 18:40
@Sa-Matra   this problem is only in the civilian```
๐Ÿค”
long glacier
#

Hello all, I am trying to get sound to play when a trigger is activated. I need the sound to play from a radio and to be positional. I also do not want the sound to be played and then played again because then it seems to play multiple tracks of the same sound overlapping.

I am currently using this:

condition this && (trigger1 getVariable ["delay",true])

On Activation On Activation [radio, ["music",3,1]] remoteExec ["say3D"]; null=[] spawn {sleep (61); trigger1 setVariable ["delay", true]}; trigger1 setVariable ["delay", false];

still forum
#

serverside only trigger with activation once?

long glacier
#

Seems to work well in MP preview but I will be using on a dedicated server

#

Repeatable

#

And currently server only unticked

still forum
#

it'll play once for every player

#

unless you tick server only

inner swallow
#

or remove the remoteExec

long glacier
#

Could I swap say3D out for playsound3D because it is global

#

Then all players hear it at the same time

inner swallow
#

you could but it takes an absolute path

#

but yeah no reason to change this

#

just make it server only

long glacier
#

OK rgr I will try it with the server only option ticked cheers for your help

meager heart
#

sleep (61); > sleep 61; and if that trigger is trigger1 > you can use thisTrigger

long glacier
#

Rgr cheers

tough abyss
#

@dusk sphinx

dusk sphinx
#

why?

runic surge
#

so does anyone here know if it's possible to translate an object's rotation relative to another object with scripting commands within the eden editor?

#

like for placing walls, you could simply change the widget coordinate space to be local to the object rather than the world so you could align the walls perfectly no matter what their rotation is by sliding it along the appropriate axis

#

I am trying to align a bunch of walls that already exist but aren't oriented in perfect 90 degree angles relative to the world so I can simply copy the rotation but I can't find a way to move the other walls in local coordinate space

shadow sapphire
#

I wish there was a place like the animation viewer where you could listen to every line of dialogue in the vanilla game and get the path to it to call it for stuff...

dry egret
#

Need a bit of help. I'm using ASOR vehicle selector and I need to detect when the vehicles spawned by the selector dies.

#

I was thinking, make a list and have the spawn pad add the vehicle to the list and then another trigger to check if vehicle in list is dead.

dry egret
#

thinking what i need to do is add an eventHandler to the vehicle as its spawned

#

but not sure how to add it to the vehicle inside the trigger

tough abyss
#

I'm having a hard time understanding global variables.
I have a variable I want to keep on the server, which is sent to each client when they join, then execute code with that variable. I'm struggling to understand how to do this properly

ruby breach
dry egret
#

is it possible to add an event handler to a vehicle via trigger?

#

like when the vehicle passes through the trigger

#

nvm i figured out another way lol

warm gorge
#

Is there any way to stop a group from becoming automatically deleted when there are no players in it anymore? I create groups prior to any players joining, and it doesnt delete until I add a player and then remove them with [player] joinSilent grpNull. I have set it to not automatically delete when empty as well.

#

I already use deleteGroupWhenEmpty false so very weird.

robust hollow
#

you dont have any clean up scripts deleting empty groups manually?

warm gorge
#

I do however I check isGroupDeletedWhenEmpty before deleting them to make sure they shouldn't be deleted

peak plover
#

this is not a reserved var?

high marsh
#

neither is _this iirc

digital jacinth
#

you can also overwrite _x

still forum
#

only commands and "" are reserved. this _this _x are all not commands

#

this is a local variable

peak plover
#

This is insane

tough abyss
#

this isn't insane

inner swallow
#

Lol

unborn ether
#

Same for anything similar like _forEachIndex

velvet merlin
#
calculatePlayerVisibilityByFriendly true
//friendly units will/will not calculate visility of player```
inner swallow
#

What is that actually for?

#

Performance?

velvet merlin
#

probably. its in dev branch - no more info from BI yet

#

anyone ever profiled the gain from disableRemoteSensors?

#

BI said back then they had a significant gain, most community people in BIF and reddit couldnt see any "visible" difference, while a few people saw a (big) difference

inner swallow
#

Yeah I saw the dev entry, wasn't sure

#

Would be nice if dwarden or someone else with detailed knowledge could write something up on the wiki about these two commands and the common situations to use them

#

There are details on the talk page but they're old, from 2015

#

Ah nvm, I see he has a thing on Reddit (probably should link to it on the wiki)

silk ravine
#

Hi,
If I place a trigger with the conditions BLUFOR present and repeatable and this in the on activation:
playSound3D ["A3\Sounds_F\environment\ambient\battlefield\battlefield_firefight2.wss", sound];
It should play a sound right? Any idea why it won't when I am testing in editor multiplayer?

digital hollow
#

Does the sound object exist?

silk ravine
#

its the variable name of the trigger itself

digital hollow
#

Try running it in Debug Console. Does it work there?

silk ravine
#

good point, one second

#

global execute right? @digital hollow

#

Or local because I am the server

#

hm

#

If I do this:

#

playSound3D ["A3\Sounds_F\environment\ambient\battlefield\battlefield_firefight2.wss", player]; it works

#

but it wont work with any object

#

I do not get it, ACEs ambient sound module also won't work

digital hollow
#

Should execute on Server. Try placing a test object and play it on that.

surreal sedge
#

anyone know a good way of having people survive aircraft crashes? I've tried the survivable crashes mod previously but it cause errors when used with ACE

inner swallow
#

event handler?

forest ore
#

Can onButtonClick have multiple entries? If yes how to correctly add the entries?

wispy patio
#

Does anyone know if removeMagazineTurret needs to be executed where the turret or the vehicle is local?

strong shard
#

@wispy patio where turret is local

#

@forest ore in config - only one, in scripts - ctrlAddEventHandler

#

@forest ore if need more from config then use onLoad and add other by ctrlAddEventHandler

runic surge
#

is it possible to convert local object coordinates to worldspace coordinates and vice versa?

#

like the coordinates used with the attach command and what that position would be in the actual world

still forum
runic surge
#

right

#

that's what that does

#

should have been obvious lol

#

thanks

vernal mural
#

is anyone familiar with ACE interaction framework here ?

#

I would like to add an ACE action to multiple vehicles, without knowing which ones exactly. It would like it to be the kind of interaction you have access when driving a vehicle, with your External Actions key, but without adding the action to each of the vehicles

#

Like, creating the action via script on virtually "all" vehicles and then check in the condition if the current player's vehicle must display it or not

#

I could add the action directly on the player, but if possible I want it in the actions of the vehicle, not in player's self actions

nocturne basalt
#

hi guys. Im having a strange problem that is really getting to me... hoping someone is able to help.

THE case that dont work atm:

  • when playing on a dedicated server(have only tested local) and on a Zeus map, my vehicle dont seam to trigger init scripts(or at least not all) in the eventhander. (problem seem to happen on pre-spawned tank). If I spawn in new ones as Zeus, they work better but are still missing certain elements.

cases that work fine:

  • playing on a dedicated(again local) server that is not a Zeus mission
  • playing as the host in local MP (works fine on both zeus and non zeus missions)
  • playing as the client in local MP (works fine on both zeus and non zeus missions)
  • playing in SP (ofc doh, everything works in SP)

Anybody got any clue whats going on? any known Zeus bugs I should know about?(edited)
I know this got a little long... sry ๐Ÿ˜ถ

#

@still forum you mean the eventhandler entries?

still forum
#

yes

#

and maybe the script too

nocturne basalt
#
        class Eventhandlers
        {
            class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {};
            init = "_this execVM '\Macross_Destroids\scripts\init_destroid.sqf';_this execVM '\Macross_Destroids\scripts\init_walk.sqf';_this execVM '\Macross_Destroids\scripts\init_turret_rot.sqf';";
            fired = "_this execVM '\Macross_Destroids\scripts\fired_defender.sqf';";
            getin = "_this execVM '\Macross_Destroids\scripts\getin.sqf';";
            getout = "_this execVM '\Macross_Destroids\scripts\getout.sqf';";
            engine = "_this execVM '\Macross_Destroids\scripts\startup.sqf';";
            killed = "_this execVM '\Macross_Destroids\scripts\killed.sqf';";
        };
still forum
#

so it doesn't work in anything remote?

#

is the mod running on the server?

nocturne basalt
#

oh yeah it does

#

thats the weird thing

#

it works on a dedicated server that is not running a zeus mission

still forum
#

I see you have CBA there

nocturne basalt
#

and it works if playing on non-dedicated server, both as host and client

still forum
#

why don't you just use the CBA init eventhandler?

nocturne basalt
#

๐Ÿค” I thought this was the way to make my EH work with CBA

#

I can always show you my scripts, but they are quite big...

nocturne basalt
#

you think this could be source of the problem?

tender fossil
#

I edited my multiplayer mission and now it says just "Server error: Player without identity Ezcoo" when I try to join the server. Could this be caused by code?

still forum
#

Perfect time for discord to die

nocturne basalt
#

yeah....

tender fossil
#

It's caused by Google Cloud, it has issues atm

tough abyss
#

Is there any way that I can make it so ai will pass through when a gate opens or something like that

#

like when the gate is closed

#

they stay still

#

but when it opens they pass through

meager heart
quasi sedge
#

Is there any mod which can check other user addons?

#

without signatures?

#

Serverside

#

poke my name pls

vernal mural
#

I don't think you are being clear enough, @quasi sedge . Any mod can have any other mod as a dependancy, but it's not a matter of scripting. It's all about config (and it's pretty straightforward). So, what do you want ? Checking by script if a given addon is loaded ?

quasi sedge
#

I have ACE RHS CUP

#

without signatures people can load any other mod like cheating @proving_ground

#

How i can forbid other mods, which different from server?

#

so people can load @plucky grove @RHS @CUP only

#

?

#

but with serverside signatures=0

#

@vernal mural

vernal mural
#

So you want people to join your server with exactly the same mods as the server itself, but not using the specifically designed system, right ?
I don't know how to do it. I know ACE have a "check PBO" module, but I don't really know how it works or what it does. You might wanna have a look at it. Maybe you'll find some answers

high marsh
#

why not just use verifySigantures ? Makes no sense.

quasi sedge
#

@high marsh im forking one server ^_^

vernal mural
quasi sedge
#

ty, i will check

high marsh
#

forking one server??

vernal mural
#

whatever can lead you to use this, I suggest you re-think your project in order to use the dedicated solution. It will surely be safer and more stable

quasi sedge
#

signatures is best method, but people dont want to load signatures each time they connect my server i think

high marsh
#

What....

#

Your place your mod keys in your server installation, that'll restrict the allowed mods to the ones you provided your server with keys.

quasi sedge
#

i have bad relationship with server which mods i using

high marsh
#

What?

quasi sedge
#

i mean server administration

#

they wont simply give me their keys

high marsh
#

Then it's not your server to administrate. Mods contain keys, you load the mod keys on the server.

quasi sedge
#

so i can generate keys which my clients will download?

#

and people can play both servers without any issues?

high marsh
#

No, use the keys provided with the mods.

#

place the keys from the mod folder into your keys folder in your server installation

#

make sure your verifySignatures is set to 2

#

then mods with keys placed in your keys folder will be allowed whilst others will not

quasi sedge
#

they use multiple mods like half cup half hlc and other pbo's

high marsh
#

๐Ÿคฆ

quasi sedge
#

best solution without signatures=2

high marsh
#

Not really.

quasi sedge
#

@SGTu_extra_mods

#

i dont have "Mods keys" for this one

#

i can write my own

high marsh
#

if this is something somebody slapped together then they have to create a key for it yes

quasi sedge
#

but people need to download them? right?

high marsh
#

If the client mod is signed with the same key then you're fine

quasi sedge
#

they wont bother with downloading, thats problem

high marsh
#

No, if they have your mod downloaded and you signed it with the key then the key you place on the keys folder for the server installation then your mod will be allowed to be loaded

#

otherwise, it will not.

tough abyss
#

@meager heart yeah but the thing is i dont know how to make it a variable

#

like when the bar gate is open, how would a3 recognize that?

#

like im so confused

tame portal
#

@tough abyss the bargate being open or not is a status of an animation

tough abyss
#

then what would be?

#

im completely new to scripting sorry

tame portal
#

it has a value from 0 to 1, you can get that via

#

you just need the name of the animation, i dont know that one on top of my head though

meager heart
tough abyss
#

cant i just set it as a variable?

tame portal
#

what is the benefit of that?

tough abyss
#

nvm

#

if{gate 1 [doMove]

else [doStop];

#

would that work ^

#

ive tried it

tame portal
#

what is the goal youre trying to achieve again

tough abyss
#

i want to make a simple checkpoint with ai

#

when the gate is open

#

i want them to move towards a certain checkpoint

#

if its not open, i want them to stay still

tame portal
#

i think you wont get around a loop of some kind in that case then

#

that repeatedly checks if the gate is open or not

#

or is the gate closed by default and only opens once per mission?

tough abyss
#

i think the loop would be the better choice

#

because im going to do it with multiple civs

inner swallow
#

(that code doesn't make sense at all btw)

tough abyss
#

i know

tame portal
#

so you have ai sitting around somewhere and as soon as the gate opens you want them to move to a checkpoint

#

correct?

tough abyss
#

yes

tame portal
#

can the bargate close midway through?

tough abyss
#

what do u mean?

#

i can close the bargate myself

#

if thats what u mean

tame portal
#

ai stands still, gate opens, they go towards the gate but it closes again before they get through

inner swallow
#

why not just use a tigger

tough abyss
#

how?

inner swallow
#

present condition for civilians

#

repeatable

#

on activation, open the gate

tame portal
#

i never used triggers ๐Ÿ˜„

inner swallow
#

on deactivation, close it

tame portal
#

i dont think thats what he wants

tough abyss
#

i have no idea how to make that

inner swallow
#

set trigger radius manually to the size of the gate

tame portal
#

so you have ai sitting around somewhere and as soon as the gate opens you want them to move to a checkpoint

tough abyss
#

^

tame portal
#

sounds more like the gate is supposed to give the go

inner swallow
#

ah

#

i was sorta thinking the AI goes there and the gate opens

tame portal
#

anyway, if the gate can be closed midway through the AI should respect that it gets a bit more complicated as it must be saved when exactly the AI is through the gate

#

otherwise closing the gate after they went through would make them stop aswell

inner swallow
#

could just keep it open as long as they're inArea?

tame portal
#

still need to know if they passed through ๐Ÿ˜„

tough abyss
#

cant i set a trigger to where it deactives the script as soon as they reach a certain place

#

like 5 meters away from the gate

inner swallow
#

well, if they're out of the area after being inside it then they've passed ๐Ÿ˜„

tame portal
#

you could do that yes

tough abyss
#

ok but how lmao

#

im just confused on how the original script is even going to be made

inner swallow
#

...have you made a mission before?

tough abyss
#

out of the 400 hours i have on arma its all on koth

#

so no

tame portal
#

if you havent worked with scripting at all yet this might be a bit overkill for you

tough abyss
#

lol

tame portal
#

its not complicated but you would need to learn a bunch of things first to understand how to do it

tough abyss
#

im gonna be straight forward

inner swallow
#

yeah. go through the editor tutorial and start something simple, to begin with

tough abyss
#

is the script going to be complicated? if not, can you honestly just write it out for me

tame portal
#

the script itself no

tough abyss
#

with a please and a thank you

tame portal
#

its just that you wont understand a thing afterwards and run into the next issue and land here again lol

inner swallow
#

^

#

better to actually learn the things tbh

tame portal
#

im sure this isnt everything you will need for your whole mission ๐Ÿ˜„

inner swallow
#

anyway, i'm off to sleep, good luck ๐Ÿ˜„

tough abyss
#

it actually is lol

#

im just making a checkpoint thing

#

like i wanna play with it for 30 minutes then go play something else lol

tame portal
#

i dont have the time right now to do it sorry

tough abyss
#

LOL

#

vehicles wont even move if the bargate is closed

#

omg

#

im so stupid

meager heart
#
0 spawn {
    private _barGate = "Land_BarGate_F" createVehicle (player modelToWorld [0, 20, 0]);
    private _unitDude = createGroup playerSide createUnit [typeOf player, player, [], 5, "NONE"];

    _unitDude doMove (_barGate getPos [0, 0]);
    waitUntil {unitReady _unitDude};
    _barGate animate ["door_1_rot", 1, 1];  
    
    waitUntil {_barGate animationPhase "door_1_rot" > 0.5}; 
    hint "It looks like... gate is opened!";
    _unitDude call BIS_fnc_neutralizeUnit;
};
```into debug console ^ ๐Ÿ˜ƒ
#

@tough abyss

weary pivot
#

Does anyone know how to get ai to speak. Not through radio but actual speech for a briefing that Iโ€™m trying to make.

wintry eagle
#

Anyone have a script that can toggle all lamps (including ones built into the map) off? I.E. I'm trying to emulate an EMP. The achilles mod "toggle lamps" function does not work, it would appear. That's speaking for the map Lythium. Please @ me if you know of one!

shadow sapphire
peak plover
#

Hmm

#

speed only does forward speeed

#

how do I get speed, even sideways

#

add the x and y of velocity?

#

abs of x and abs of y

peak plover
#

IS there any event that will run when ammo is created?