#arma3_scripting

1 messages · Page 555 of 1

grizzled spindle
#

Its because I have a few small functions and dont want to have them all in seperate files

#

But thanks for the link, I can make the file and add the postInit = 1; attribute

#

and should just call that file and initialise the internal functions

marsh storm
#

Hey guys - I've got a mission that uses the eden smoke and fire modules, which is quite happy in local MP but when I launch it on our server, I get repeated spam of examples like

14:00:44 Creation of object L Effects:2 failed, state LOGGED IN
14:00:44 Client: Nonnetwork object 787d9fa0.

or

14:00:44 Creation of object 279095: smokegrenade_green_throw.p3d failed, state LOGGED IN

any suggestions?

#

I wonder if I might be able to spawn the smoke modules after the mission starts to see if that fixes it?

#

if so, I don't know what i'd use to script spawning a module :/

still forum
#

@grizzled spindle

I can make the file and add the postInit = 1; attribute
use preInit, that way you can use them in triggers and such.

jaunty ravine
#

Anyone got a way to impose gear restrictions based on role for the ACE Arsenal?

covert inlet
#

make a custom ace arsenal for each class, then make the action to open each arsenal only show if the unit has a matching variable name

#

@jaunty ravine ^

#

not sure if you can do that with ace interaction, but you can deffinately do it with vanilla addAction

jaunty ravine
#

I figured it out eventually, I think.

#

Only tested with one person.

thorn wraith
#

so, I'm trying to kill the headlights on some vehicles.
getAllHitPointsDamage this return, eg,
..."hitturret","hitgun","#light_l","#light_l","#light_r","#light_r"],[..."commander_turret_hit","commander_gun_hit","light_l","light_l","light_r","light_r"]
setHitPointDamage ["light_r",1] does damage the light, but not destroy it, probably because there's two of them. setHitIndex [23, 1]; does kill them, if the index is right, but the index changes depending on the vehicle.

Is there a way to kill the lights without either nuking the whole vehicle or making a huge switch with individual vehicle indexes?

fervent kettle
#

There's probably some easier solution like this switch Light off or smth

winter rose
#

kill, as in "not being able to turn them on"

scarlet rain
#

Hi all, we are looking into inidb2 and try to get it to work with the ravage and vandeanson's apocalypse mods (to save player stats, position, gear, placed structures, vehicles and other things) . If anyone is familiar with setting it up for a dedicated server and might have experience or info to share that goes above what is currently accessible on the BI forum and Youtube, we would greatly appreciate a knowledge transfer:)
We have some experience with it and partially working code atm. Feel free to PM me. Thanks!

scarlet rain
#

Hi @winter rose , whats up? Wrong channel? 🤔

winter rose
#

@scarlet rain

#

(I don't know anything about inidb2, though)

scarlet rain
#

Ah ok sorry for that

winter rose
#

(nor server management 😄)

#

no problem, I get that it's a big topic - I was just afraid it would be a "hey I want it done so ping me" request; my bad if it felt a bit rude

scarlet rain
#

Oh nono, doing it (myself) is 90% of the fun😂

#

Just looking for others that might try to do or have done the same, to share experiences

exotic flax
#

I've never worked with it (or Arma and databases in general), but it doesn't look too complicated

scarlet rain
#

Yep i am working with the information on the forum and the youtube videos (these are great)

#

Further customizing the tutorial example was also doable

#

And all worked well in hosted mp

#

Getting it to work on dedicated servers was my specific issue, and figuring out if it is an issue with the code or the setup of the dedicated server

digital hollow
#

@thorn wraith You could try forEach getAllHitPointsDamage, check for "light" in each hitpoint name, and then using _forEachIndexto setHitIndex.

scarlet rain
#

And my partner in crime is looking into saving vehicles

#

Just a broad summary of the challenges we have, didnt want to go into too much detail here, again , ad it is quite a specific topic

thorn wraith
#

Yeah, that's what I'm trying atm, @digital hollow . Thanks.

grave stratus
#

https://pastebin.com/7xPnuMYd
can anyone point me where i went wrong?
its creating the box with no problem but with default item, not the item that i wanted it to fill. And the the item can't be picked up by another player.

i call this function with

if (isServer) then {
["001","bgBox","Box_NATO_Uniforms_F", [9627.385, 10021.998, 0.190], 94] call HKB_fnc_supplies;
};

is this a locality issue? if i local exec it in debug console, only i can see the box with the correct item, and other player cant pick up anything from the box.
fyi, it is for a dedicated server environment

digital hollow
#

That depends on what HKB_fnc_supplies is doing. Sounds like it's using addItemCargo instead of addItemCargoGlobal.

grave stratus
#

@digital hollow i have already give the link there. The link is HKB_fnc_supplies. And yes, it is using addItemCargo instead of addItemCargoGlobal. But the remove item part also is not working properly since it spawn the box with default loadout in it.

#

Ah so i need to use clear global command. I will try that

digital hollow
#

The point I was trying to make is that HKB_fnc_supplies is not a vanilla function and no one knows what it does except you.

thorn wraith
#

does the in command not work on strings ?

#

because I'm copying the _isInString = "foo" in "foobar"; from BIki into console , and the RPT is telling me

>
16:58:43   Error position: <in "foobar";
>
16:58:43   Error in: Type String, expected Array,Object,Location
16:58:43 Error in expression <_isInString = "foo" in "foobar";
>
16:58:43   Error position: <in "foobar";
>
16:58:43   Error Generic error in expression```
still forum
#

Read biki

#

your the dozenth guy asking that in the last week

grave stratus
#

@digital hollow that is why i left the link to view the function so anyone helping can know

#

anyway, i think you are right without even looking at the function. i have to try it first

thorn wraith
#

Ah, devbuild. figures.

grave stratus
#

If i check if isServer like this,

init.sqf :

if (isServer) then {
    [] execVM "1.sqf";
}:

and in 1.sqf:

if (isServer) then {
    [] execVM "2.sqf";
};

would the if (isServer) check in 1.sqf become redundant since it has been checked for on the init execVM?

still forum
#

yes

grave stratus
#

okay. thanks @still forum

#

how about this?

init.sqf

if (isServer) then {
    [] execVM "1.sqf";
}:

1.sqf:

    [] execVM "2.sqf";

2.sqf:

if (isServer) then {
    [] execVM "end.sqf";
}:

Does the check in 2.sqf redundant?

still forum
#

Yes

#

of course

#

if your script only ever runs on the server, why would you check isServer?

grave stratus
#

so there is no way of getting out of the scope once inside?

winter rose
#

unless you call 1.sqf from a client, no

grave stratus
#

i see

#

just to be sure, calling from client is something like addAction does?

still forum
#

"out of the scope" not really? I can't think of a way.. as execVM creates its own, new scope, without any parent scopes, completely detached from where it was launched

#

just to be sure, calling from client is something like addAction does?
usually. but addAction code can also be called by the server

grave stratus
#

well not scope exactly, but i guess the server environment.

addAction can be called by the server? i thought a player need to activate it? just like trigger?

still forum
#

An AI can also use actions

#

triggers also run on server

#

initPlayerLocal will only run on a client.. But I think headless client too

#

but i guess the server environment.
You can't switch environment without remoteExec

grave stratus
#

yeah i notice that trigger can be check isServer to make it only run once by the server. but i haven't figured out the addaction called by the server part

#

AI is considered server?

#

ahh... remoteExec yes.

still forum
#

Afaik you also have a checkbox in 3DEN in the trigger, to let it run server only?

#

AI is considered server?
no. Sometimes. Depends on where the AI is simulated

#

pre-placed AI from 3DEN is usually on the server (which might also be the client)
And Zeus AI is usually on the client using zeus

#

And AI groups with a player as leader are on the players machine

grave stratus
#

yes i can, but im trying to spawn the trigger via script since i dont want to place a lot of trigger in editor since i am making some sort of campaign-type mission

#

but wouldn't a headless client take over all of those AIs?

still forum
#

no

#

by itself a headless client is just a normal client which does nothing

#

there has to be some script that sends none/some/all AI over to it

grave stratus
#

oh i see

grizzled spindle
#

Hi @still forum I have a quick question about your intercept-database addon. I have been looking at it and it looks very interesting. We currently use EXTDB3 but as im sure you know it uses callextension and I have heard that doesnt help server load. The question I have is to use the intercept addon will the clients need intercept to join the server or does it work just serverside?

still forum
#

its only serverside

#

you can load via -serverMod

grizzled spindle
#

PERFECT

#

Thank you soo much!

tough abyss
#

Hey guys, can someone help me with finding the relative direction between two coordinates?
The problem is, BIS_fnc_relativeDirTo and getRelDir require the first parameter to be an object.
The second problem is that I'm retarded and completely forgot school geometry. :\

surreal peak
#

Forgive me if im wrong, but if you already know the two coordinates, why not spawn a small invisible object at them, calculate the relative direction and then delete the objects?

tough abyss
#

You're not wrong but the function I'm writing will be running constantly and the object will have to be spawned in the player's view so I'm wondering if there are better options.

#

I mean, there are - finding an angle between two vectors is nothing new - but I'm struggling with writing it from the ground up atm

#

Was kinda hoping that there's a library somewhere where this function is already implemented

#

Actually, maybe I should check existing arma frameworks...

winter rose
tough abyss
#

Thing is, I'm looking for a relative direction between two points.

#

Oh

#

Right

#

A point has no direction

#

That's why the first argument has to be an object

#

Told you I'm retarded

#

Okay, I'm gonna try to pull it off with invisible object then

oblique arrow
#

You could props use grasscutters for that

tough abyss
#

Made it work with air balloons with Show Model = false

#

Good enough I guess, thank you guys

winter rose
#

@tough abyss you can also subtract the direction you have from the result

#

No need for an object here.

brave jungle
#

Just a quick one from mwe

_someArray = [["some","thing"], ["In an", "Array"]];
_curFnc = lbText [1500, lbCurSel 1500];

//find _curFnc in _someArray then return the nested array, i.e _curFnc is "some"
//_return = find "some";
//_return would then be a number you can just do select 1 to get "thing"
```Obvs the commented bit is sudo code for what i'm trying to do 🙂
#

Nvm I think I got it

lucid junco
#

do someone know how to make steps in the snow (basically just steps, no matter where)? I mean, when unit walks there are steps behind it. But i need to create them via command.

lucid junco
#

sorry. wrong keyword in google. Thx!!

brave jungle
#

God I sound like an old man

lucid junco
#

😄

young current
brave jungle
#

hehe

#

np

young current
#

but you are an old man

lucid junco
#

_d=[player] spawn
{
params["_man"];
while {alive _man} do
{
{
hint format ["surfaceType=%1",surfaceType getpos _man];
if (typeOf _x == "#mark") then {_x enableSimulation false;};
} foreach (nearestObjects [_man, [], 3]);
sleep 1;
};
};

#

this is sweet

brave jungle
#

My new avatar

#

Love that

#

There we go 😄

#

Will update soon I guess

lucid junco
#

lool its not working while player is not close haha

#

love BI

brisk tusk
#

Hey guys. So I'm trying to run a script that will negate fall damage for specific units. I tried some stuff from some forums, but didn't really have any luck and just wanted to see if it was possible or not.

winter rose
#

Fall triggers "" damage type in handleDamage EH, but so can do grenades and (to some extent) bullets

You would have to check with diag_tickTime if the "" damage is close to any other bullet/grenade damage or if it is "just" a fall

still forum
#

@brave jungle findIf

_index = _someArray findIf {_x select 0 == _curFnc} //Only first element in every subarray
_index = _someArray findIf {_x find _curFnc != -1} //Any element in subarray
returns either the index, or -1 if not found.
So _curFnc param [_index, []] returns either your ["some","thing"] or [] if not found.

glad kindle
#

anybody know how to change who owns a UAV

#

I want to give opfor control of the VLS

still forum
#

UAV has a blufor AI inside it. I guess you might need to replace the AI 🤔

#

Maybe you can connect it to a opfor unit

plush leaf
#

Umm easy way is like spawn in example.(Nato Darter) and than hold Left CTRL and group it to 1 OPFOR AI. It should make Drone change faction from NATO to OPFOR

#

in a zeus case*

still forum
#

script way for that would be join.
join the AI inside the darter (via crew) into the group of a opfor unit

proud carbon
#

Hey is there a script to get all weapons of a faction?

still forum
#

Weapons are faction agnostic.

proud carbon
#

Dam

still forum
#

There are no config entries stating which faction a weapon belongs to (unlike uniforms)

#

I guess you could find all units of that faction which you can spawn using 3DEN. And then just collect all the weapons they spawn with

proud carbon
#

Oh yeah.

glad kindle
#

O awesome thanks ill try it out

hasty tundra
#

Is it possible to disable friendly fire damage only for a group members (using ACE) ?

Solved:
player addEventHandler ["HitPart", {_this select 0 execVM "checkShooter.sqf"}];

params ["_target", "_shooter"];

glad kindle
#

Anybody know where I could find reference points for aircraft locations

#

for example I attached a camera

#

spy6 attachto [jet2, [0,0,0], "front"];

#

but front is clipping inside. I could adjust the location [0,0,0] but wondering what other labels would work besides "front" or "Back" and where I could find the list of available ones.

still forum
#

the available points are vehicle specific

glad kindle
#

okay

#

is there like reference to them?

still forum
#

I don't think there is a script command to retrieve them

glad kindle
#

i checked the fandom and stuff couldnt find it

still forum
#

No. Its encoded inside the model, which is binarized and you can't really look at

glad kindle
#

so you just guess?

still forum
#

Basically. If you read somewhere that some jet has a point with a specific name, you can try if it works on your jet too

glad kindle
#

ok

#

so like any point really

#

as long as its named

still forum
#

You can unpack the pbo, and open the model file in Mikeros Eliteness which I think displays some of these points, not sure how many or if at all or whatever

glad kindle
#

i tried cockpit but no luck

astral dawn
#

Wait but there is a command which dumps all such named points

#

Or not?

still forum
#

selectionNames

#

only dumps res lod names. These here are memory lod

glad kindle
#

I just adjusted the vector and I guess it works

#

i tried to put "back" instead of front

#

and the camera is still the same. So I dont think either are actual points

glad kindle
#

okay new plan

#

what was the reference point for players eyes

still forum
#

Uh.. I assume eye ? Thats it for weapon scopes I think

#

driver, cargo, PilotCamera_pos, doplnovani, codriver

try these

#

These are listed in the vehicle config for the A10 jet

glad kindle
#

?

still forum
#

?!

glad kindle
#

said try these

#

I was expecting a follow up to that lol

#

oic above it

still forum
#

you try these

#

and see what you get out

glad kindle
#

spy4 = "camera" camCreate [0,0,0];
spy4 attachto [jet1, [0,1,-0.7], "canopy"];

#

thats what I got so far and it works pretty good

#

ill check out these

#

spy6 = "camera" camCreate [0,0,0];
spy6 attachto [jet4, [0,1,1], ""];

#

and that works fine as a body cam if jet4 is the name of the guy

#

none of those other tags seem to work

#

spy4 = "camera" camCreate [0,0,0];
spy4 attachto [jet1, [0,1,-0.7], "canopy"];

spy5 = "camera" camCreate [0,0,0];
spy5 attachto [jet2, [0,1,-0.7], "canopy"];

spy6 = "camera" camCreate [0,0,0];
spy6 attachto [jet3, [0,1,-0.7], "canopy"];

#

works pretty well for anybody in the future

exotic crater
#

Hi. Have a question for the skilled scripters.

still forum
#

walks away

exotic crater
#

See u! 😄

#

What do you think, is there a hard technical restrictions in the engine to make a huge, solid single mission with approx. 40-60 hours of the seamless gameplay? Read somewhere that there's some accumulated errors that cause a memory leaks and no matter how carefully you delete unused entities, bodies, terminate scripts, e t. c. Sooner or later yo'll get a lags.

#

Doeas anyone have an experience with such things?

The deal is a seamless RPG-style gameplay represented as a single mission, not a campaign nor a MP mode.

#

Thank you if let me know with some proofs. It's realy interesting thing for me that I never deal with before.

astral dawn
#

'memory leak', not 'memory lick'
Sorry I just couldn't get by that...

still forum
#

memory leaks*

#

wow sparker

exotic crater
#

Ahaha

still forum
#

Well I had a liberation/insurgency on my server running for about a week. But no constant players playing on it

#

I would strongly advice against it, lots of things can go wrong in 60 hours of play

#

I'd rather focus on implementing proper save/restore to be able to stop/resume the game at any point. Lots more work, but atleast always safe

astral dawn
#

Shouldn't the default save thing work good enough though?

exotic crater
#

That's the question.

astral dawn
#

Well it should, yeah 😄

#

If it's SP especially

still forum
#

not in MP

exotic crater
#

Sorry for my little rough upper intermediate 😄 The question is 'bout SP, just SP

#

Read about these errors somewhere on the BIforum, can't find where exactly

oblique arrow
#

Do you mean RPG as in something similar to full on rpg games like skyrim?

exotic crater
#

Something like

#

Dialogues, quests, procedural generated enemies that are timely terminated/deleted/collected. But I just can't find any close example in a community made SP game modes. And that's another reason why I seriously doubt

astral dawn
#

I think 60-hour-long should be ok, just collect garbage (dead enemies and their dropped weapons)

grave stratus
#

is there any issue if i use normal mission folder rather than using pbo with dedicated server?

errant jasper
#

How do you load the mission on the server then? File patching?

still forum
#

folders usually work alright

#

but pbo is still recommended cuz reasons

grave stratus
#

pbo is a bit fussy when it come to testing in server, shut down the server, fix the script, repack the pbo then restart the server. 😩

hollow thistle
#

My unit is using only unpacked missions and we never had any problems. (windows)

#

🤷

#

I'm not sure if i remember right but I recall that there migth some problems with that on linux.

astral dawn
#

@grave stratus
Create two arma profiles, run two arma instances with different profile names, test the mission by self-hosting from the editor from one profile, and joining with the other profile

grave stratus
#

@hollow thistle i've just tried it, some of the script doesnt work accordingly

#

@astral dawn i can run 2 arma instances?

astral dawn
#

Of course you can, why not

#

But only if you start them with different profiles

#

Check the launcher parameters

#

Becausei f their profiles are same, they can't access to the same .arma3profile files

grave stratus
#

i see

#

that is a better solution

#

don't need to use pbo. such a hassle

#

thanks @astral dawn

astral dawn
#

Yeah I wish someone has written it on the wiki

#

I discovered it myself

grave stratus
#

i thought it like some other game where you can only run 1 instance

hollow thistle
#

You can also easily start dedicated with correct mods via launcher -server param

grave stratus
#

@hollow thistle noted. thanks

astral dawn
#

How do I detect if a static weapon gets disassembled?

#

According to biki, the event handler doesn't get the disassembled object's handle :(

this addEventHandler ["WeaponDisassembled", {
    params ["_unit", "_backpack1", "_backpack2"];
}];
#

You mean it's not objNull?

#

Ugh... what the hell...

#

Indeed 🤔

#

Any idea how I can check if it's disassembled or not?

#

isObjectHidden returns false

#

if it's disassembled

proud carbon
#
_weaponListS = [];
_weaponAmmoListS = [];

{
     if (side _x isEqualTo Resistance) then {
     _wepClassS = primaryWeapon _x;
     _weaponListS pushBack _wepClassS;
     _WepAmmoClassS = (primaryWeaponMagazine _x) select 0;
     _weaponAmmoListS pushBack _WepAmmoClassS;
     };
} forEach allUnits;

_GunsCacheScav = nearestObjects [CentreMass,["Box_Syndicate_Wps_F"],6000,true];
_AmmoCacheScav = nearestObjects [CentreMass,["Box_Syndicate_Ammo_F"],6000,true];
_TheBoxS1 = selectRandom _GunsCacheScav;
_TheBoxS2 = selectRandom _AmmoCacheScav;
_TheGunS = selectRandom _weaponListS;
_TheAmmoS = selectRandom _weaponAmmoListS;
_TheBoxS2 addItemCargoGlobal [_TheAmmoS,(selectRandom [2,3,4,5,6,7,8,9])];
_TheBoxS1 addItemCargoGlobal [_TheGunS,2];
Sleep 2;

_weaponListN = [];
_weaponAmmoListN = [];

{
     if (side _x isEqualTo West) then {
     _wepClassN = primaryWeapon _x;
     _weaponListN pushBack _wepClassN;
     _WepAmmoClassN = (primaryWeaponMagazine _x) select 0;
     _weaponAmmoListN pushBack _WepAmmoClassN;
     };
} forEach allUnits;

_AmmoCacheNato = nearestObjects [CentreMass,["Box_NATO_Ammo_F"],6000,true];
_GunsCacheNato = nearestObjects [CentreMass,["Box_NATO_Wps_F"],6000,true];
_TheBoxN1 = selectRandom _GunsCacheNato;
_TheBoxN2 = selectRandom _AmmoCacheNato;
_TheGunN = selectRandom _weaponListN;
_TheAmmoN = selectRandom _weaponAmmoListN;
_TheBoxN2 addItemCargoGlobal [_TheAmmoN,(selectRandom [2,3,4,5,6,7,8,9])];
_TheBoxN1 addItemCargoGlobal [_TheGunN,1];
Sleep 2;
#

So this script for me works but. it comes up with an error

#

the error is undefined variable _WepAmmoClassN and _WepAmmoClassS

winter rose
#

Use private 👀

still forum
#

the assembled mortar still exists
when disassembled
its hidden/simulation disabled though
OMFG thanks @tough abyss that explains so much..
We once disassembled a machinegun while a guy was still inside. We thought we packed him into a backpack.

Any idea how I can check if it's disassembled or not?
@astral dawn maybe bounding box? Cuz the collision gets removed when disassembled, so it might return 0 for the geometry bounding box?

#

@proud carbon if the weapon has no magazines loaded, then it won't return any magazines, and you cannot select the first one in the array as the array is empty

tough abyss
#

Hi all. I'm using Laxemann's fantastic script for ambient civs. The script checks on players in the game, and then spawns/despawns civs within a set boundary. There is an option to ignore certain players to keep the script running smoother - given that my unit plays as a team in close proximity, I don't need to script to check on every player. The script has the following code, and I've input all the playable unit variable names that i have placed in the editor. However when I run the mission, the script throws an error if any of the units are not players:

// Units the script will ignore
// Example: L_ambiDrive_blackList_players = [MyUnit1,MyUnit2];
L_ambiDrive_blacklist_players = [p2,p3,p4,p5,p6,p7,p8,p9];

#

Any thoughts on how I can just feed the current players, minus me?

still forum
#

allPlayers - [me]

#

finding me might be a problem, unless you know that you are always p1 and are always there

#

also allPlayers constantly changes when a new player joins/leaves

tough abyss
#

Yes I'll be there 🙂

#

Thanks mate

#

We'll be relatively consistent

#

Can i put that straight into the square brackets?

still forum
#

L_ambiDrive_blacklist_players = allPlayers - [p1];

tough abyss
#

One further question

#

I have an intel item in game, using ] remoteExec ["BIS_fnc_holdActionAdd", 0, intel1]; // MP compatible implementation

#

this is where the player has to hold space to interact with the object

#

On the "on completion" section of the script, I have added objective1adone=true ( { ["init", [intel1,"intel.jpg", "this is your itenl"]] call BIS_fnc_initLeaflet; objective1adone=true;},

I then have a trigger waiting to pick up "objective1adone", which triggers a completed task module

#

This works in SP testing, but doesn't seem to be working in Dedi testing

#

The script is placed in the initServer.SQF

#

Is this something to do with the variable objective1adone not being global?

winter rose
#

intel*

publicVariable @tough abyss

tough abyss
#

Thanks mate so I declare it publicVariable objective1adone = true ?

still forum
#

objective1adone=true ( { ["init", [intel1,"intel.jpg", "this is your itenl"]] call BIS_fnc_initLeaflet; objective1adone=true;},
what? that looks like a syntax error

tough abyss
#

Sorry, ignore the first section of that

#

Complete code as it currently is:

[
intel1, // Object the action is attached to
"Hack Laptop", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"_this distance _target < 3", // Condition for the action to be shown
"_caller distance _target < 3", // Condition for the action to progress
{}, // Code executed when action starts
{}, // Code executed on every progress tick
{ ["init", [intel1,"intel.jpg", "Captain Hussein. We've pushed the AA patrol out to a vantage point South-East of the base. This allows us to cover the South-Eastern approach to the region; our Russian intelligence counterparts assess that this is the most likely route a potential aggressor will take to ingress the region. Regards - Sergeant Mohedeein."]] call BIS_fnc_initLeaflet; objective1adone = true;}, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
12, // Action duration [s]
0, // Priority
true, // Remove on completion
false // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, intel1]; // MP compatible implementation

still forum
#

Or you mean { ["init", [intel1,"intel.jpg", "this is your itenl"]] call BIS_fnc_initLeaflet; objective1adone=true;} is just your code?
please put code blocks into ``
or
```sqf
```

replace objective1adone = true
By

objective1adone = true;
publicVariable "objective1adone";
tough abyss
#

Thank you : - )

still forum
#

publicVariable broadcasts that variable to all other players+server

winter rose
tough abyss
#

Thanks Lou, Dedmen

#

Finding this discord has been super helpful

winter rose
#

with pleasure, the channel is here for that

tough abyss
#

Hmm. No luck 😦

#

In the trigger condition I have:

objective1adone

#

And in the initServer.SQF:

[ intel1, // Object the action is attached to "Hack Laptop", // Title of the action "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen "_this distance _target < 3", // Condition for the action to be shown "_caller distance _target < 3", // Condition for the action to progress {}, // Code executed when action starts {}, // Code executed on every progress tick { ["init", [intel1,"intel.jpg", "Captain Hussein. We've pushed the AA patrol out to a vantage point South-East of the base. This allows us to cover the South-Eastern approach to the region; our Russian intelligence counterparts assess that this is the most likely route a potential aggressor will take to ingress the region. Regards - Sergeant Mohedeein."]] call BIS_fnc_initLeaflet; objective1adone = true; publicVariable "objective1adone"; }, // Code executed on completion {}, // Code executed on interrupted [], // Arguments passed to the scripts as _this select 3 12, // Action duration [s] 0, // Priority true, // Remove on completion false // Show in unconscious state ] remoteExec ["BIS_fnc_holdActionAdd", 0, intel1]; // MP compatible implementation

#

Just checked again and it works in editor SP and editor MP. Just not on dedi

#

Hey. I got a question. I'm working on a permadeath mission with radioactive zones. Currently I have it set up like this:

Trigger:
Cond: this && (player in thisList)
OnAct: { [_x] execVM "badtimes.sqf"} foreach thisList

With the script:

// Radioactive Zone
_unit = _this select 0;
Pcolor = 1;
Pbright = 1;
Pgrain = 0.005;
Pblur = 0;
Pdamage = 0;
Pstamina = 60;
while {alive _unit} do {

_unit call ace_medical_fnc_handleDamage_advancedSetDamage;
[_unit,selectrandom [0.2],selectrandom ["head","body","hand_l","hand_r","leg_l","leg_r"],selectrandom ["bullet","grenade"]] call ace_medical_fnc_addDamageToUnit;

"colorCorrections" ppEffectAdjust [Pbright, 1, 0, [1, 1, 1, 0], [1, 1, 1, Pcolor], [0.75, 0.25, 0, 1.0]]; 
"colorCorrections" ppEffectCommit 1; 
"colorCorrections" ppEffectEnable TRUE; 
"filmGrain" ppEffectAdjust [Pgrain, 1, 1, 0, 1]; 
"filmGrain" ppEffectCommit 1; 
"filmGrain" ppEffectEnable TRUE;
"DynamicBlur" ppEffectAdjust [Pblur];
"DynamicBlur" ppEffectCommit 1;
"DynamicBlur" ppEffectEnable TRUE;

Pcolor = Pcolor - 0.04;
Pbright = Pbright - 0.03;
Pblur = Pblur + 0.1;
Pgrain = Pgrain + 0.0015;
Pdamage = Pdamage + 0.03;
Pstamina = Pstamina - 2;
sleep 5;
};

My question is; Where would I put a playSound if I wanted to have the player locally hear a geiger counter?

still forum
#

{ [_x] execVM "badtimes.sqf"} foreach thisList you are running your script N times, even though you only want to run it once, for the player

#

you run it for other units inside the trigger area too, but for these your script won't work at all as you are using local-only stuff on remote units

#

replace { [_x] execVM "badtimes.sqf"} foreach thisList with [player] execVM "badtimes.sqf"

#

you also want to make sure it doesn't fire again when the player leaves/re-enters the trigger

#

you can put your playSound anywhere

#

I assume you want the geiger counter sound to repeat, so place it anywhere inside your while loop

tough abyss
#

Mhm. I do want it to be repeated. As to simulate the damage getting worse overtime. Hence the sleep 5;

#

Every 5 seconds the player recieves the 0.2 ACE damage, until they get knocked out or die.

#

or would this cause for lag if x amount of players would be present?

still forum
#

Mhm. I do want it to be repeated. As to simulate the damage getting worse overtime. Hence the sleep 5;
the thing I talked about is a different kind of repeat

#

Get rid of the forEach

tough abyss
#

Ah, gotcha.

#

How does Arma handle the audiovolume of a sound? I have playsound just underneath "DynamicBlur" ppEffectEnable TRUE; but I don't hear it.

still forum
#

You configure the volume in your CfgSounds

tough abyss
#

Gotcha

tough abyss
#

Thanks for the help Dedmen. Works like a charm now!

spice axle
#

@tough abyss why don’t you put it in the initPlayerLocal.sqf and remove the remoteExec stuff just call the function with these arguments. Maybe I missed something you wrote before but I normally put it there and it works every time

tough abyss
#

Thanks Katalam

#

I'll try it

tough abyss
#

How can I give a randomly spawned helikopter a variable name? I tried it using this in my init.sqf, but don't think it works.

_randomSpawn = [[710.365,1173.63,0],[1445.93,1673.6,0]] call BIS_fnc_selectRandom;
_veh = createVehicle ["CUP_O_Mi8_medevac_RU",_randomSpawn, [], 0, "none"];
_veh setVehicleVarName "heli";
winter rose
#

@tough abyss like, myChopper ?

tough abyss
#

Yeah

winter rose
#

myChopper = (…)

#

no underscore, underscored variables are local

tough abyss
#

Mhm. You mean myChopper = (insert classname) ?

#

or the other way around?

winter rose
#

instead of _veh

tough abyss
#

Oh, check.

#

So this:

_randomSpawn = [[710.365,1173.63,0],[1445.93,1673.6,0]] call BIS_fnc_selectRandom;
heli = createVehicle ["CUP_O_Mi8_medevac_RU",_randomSpawn, [], 0, "none"];
still forum
#

use

#

instead of that bis func

#

also you might wanna keep the setVehicleVarName, depends on what youre trying to do but doesn't hurt if its there

winter rose
#

And PRIVATE your variables plz

tough abyss
#

Not sure what you mean by private it, but I'm a obvious newbie. So far, Got this with your help:

_randomElement = selectRandom [[710.365,1173.63,0],[1445.93,1673.6,0]];
heli = createVehicle ["CUP_O_Mi8_medevac_RU",_randomSpawn, [], 0, "none"];
heli setVehicleVarName "heli";
still forum
#

private is not that important for a newbie, but it may prevent further issues

#

Only the alternative syntax 2.
Not the string or array variants

#

maybe the page should make it more obvious that you're supposed to use "alt syntax 2" instead of the main syntax 🤔

tough abyss
#

It throws a fit over randomspawn. maybe I didn't understand how it works correctly.

still forum
#

_randomElement =
_randomSpawn

#

u see it?

tough abyss
#

Mhm

#

I suppose it should be _randomelement on the second line then?

#

And that worked.

#

In hindsight its always obvious.

#

Although, it doesn't assign a variable name for some reason.

winter rose
#

meaning? if you do heli setDamage 0.75 it does damage the heli, right?

astral dawn
#

So owner of a unit I have just created within this frame returns 0, what's the proper way to get his owner?

digital hollow
#

That command only works on the server.

astral dawn
#

Yes I am a server in a MP game, my clientOwner is 2

#

Later when I look at the unit, owner cursorobject returns 2 🤷

#

I assume it's not initialized at this frame or something like that?

digital hollow
#

Oh, I see. You could try CBA_fnc_execNextFrame

astral dawn
#

Steps to reproduce if anyone would need it:

_guy = (group player) createUnit ["I_Soldier_TL_F", getpos player, [], 3, "NONE"];
systemChat (format ["Initial owner: %1", owner _guy]);
_guy spawn {
sleep 0.0001;
systemChat (format ["Later owner: %1", owner _this]);
};

Output:

Initial owner: 0
Later owner: 2

(someone should add this .... to the wiki I think 👀 )

#

Thanks Ampersand, I will find a workaround

wispy cave
#

Is there a way to disable the sirene on the ambulance?

marble sigil
#

@winter rose You set damage to 0.75, so 75%. It's not added, but set.
0 full life, and 1 destroy.


I have a question too about flags and event handler

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
https://community.bistudio.com/wiki/BIS_fnc_addScriptedEventHandle

On my init flag, I've tested:

[this, "FlagAnimationDone", {
    systemChat "FlagAnimationDone OLD";
    systemChat (str _this);
}] call BIS_fnc_addScriptedEventHandler;

this addEventHandler ["FlagAnimationDone", {
    systemChat "FlagAnimationDone";
    systemChat (str _this);
}];

this addEventHandler ["AnimDone", { 
    systemChat "AnimDone";
    systemChat (str _this);
}];

[this, 0, false] call BIS_fnc_animateFlag;

When I test, I got FlagAnimationDone OLD
But never the 2 others.

So my question, are there 2 different systems for Event Handler ?

winter rose
#

@marble sigil … thank you? 😁

marble sigil
#

Yes it's not in the official list, but you can use specific event for specific (or custom?) objects

winter rose
#

you can't create Event Handlers

#

scripted EH, yes

marble sigil
#

So it's really 2 different systems?

winter rose
#

yes

marble sigil
#

Thx you @winter rose

jaunty ravine
#

How come this code doesn't add the second item to an arsenal? ( I perhaps should add that _commonBackpacksis used in an "if" statement )
_commonBackpacks = "rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp";

#

Probably really simple, but I can't figure it out.

still forum
#

syntax error

#

if you want an array, you need to add squad brackets around it

jaunty ravine
#

_commonBackpacks = ["rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"];?

#

Whole script:

_commonBackpacks = ["rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"];

if (typeOf player == "rhsusf_army_ocp_officer") then
{
    [_this, [_commonBackpacks]] call ace_arsenal_fnc_addVirtualItems;
    [_this, false] call ace_arsenal_fnc_initBox;
};```
#

Using the above code, neither of the backpacks show up.

digital hollow
#

Now that you've added [], what do you think [_commonBackpacks] resolves to?

jaunty ravine
#

rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"

#

But I could and probably am wrong.

digital hollow
#

[_commonBackpacks]
is now
[["rhsusf_assault_eagleaiii_ocp", "rhsusf_assault_eagleaiii_ucp"]]

jaunty ravine
#

ah...

#

Then another issue arises; If I want to add more backpacks on top of _commonBackpacks, how do I go about doing this?

#

Or is that simply not possible?

digital hollow
#

I'm pretty sure you need to do initbox before adding the items. after you init you should be able to keep adding whatever you want

jaunty ravine
#

Alright, thanks.

#

Appreciated.

oblique vale
#

Does setGroupOwner work with empty vics (or should setOwner used for that)?
Also on which client will a empty vic be local (last driver?)

winter rose
#

wiki => setGroupOwner

#

@oblique vale

oblique vale
#

It doesn't really state anything? The only issue I see that it requires a group instead of an object

winter rose
#

what do you mean by

empty vic
? empty vehicle?

#

any way,

it requires a group instead of an object
you have your answer @oblique vale

oblique talon
finite dirge
#

you are using a _variable name in a global context

oblique talon
#

Idk what that means sorry. How can I fix it?

tender viper
#

Does anybody have experience with ground vehicle/turret launched missiles? There is a function for fixing the missile firing position, but I can't seem to make the whole setup work properly.
BIS_fnc_missileLaunchPositionFix is the function. I looked at he Nyx AA (small Indie tank) for reference on how it's done, but the missiles on my vehicle are all firing from where the missile_move memory vertices are.
Here's a quick video showing exactly what it looks like:
https://www.youtube.com/watch?v=Ib4upgUjYEQ

oblique arrow
#

You forgot a ;

#

^ aalba1

oblique talon
oblique arrow
#

I dont know a lot about arma scripting, but I feel like you have too many ;'s in there

oblique talon
#

ok

plush oriole
#

how the heck does this command work

#

seems magical but it doesn't seem to work with just a group of vehicles with a waypoint

#

ok nvm i somehow managed to set the fuel on the lead vehicle to 0

surreal peak
#

@oblique talon typically, you only use ; at the end of a line

jolly jewel
hot kernel
#

how do I add my functions to the editor function library? They're all in a single .sqf. Description.ext looks like,

class CfgFunctions
{
    class MMF
    {
        class Mission_Maker
        {
            class soldiers {file = "MMF_fnc\MFF_functions.sqf";};
            class mobileGroup {file = "MMF_fnc\MFF_functions.sqf";};
        };
    };
};

Which registers the names but doesn't populate the functions.

jolly jewel
#

@hot kernel Are you sure it's the right folder?

#

Also you'll have to split the functions into different files

#

In which case I'd guess the folder is wrong

edgy dune
#

Is it possible to get a units weapon object? I remember reading in ACE's overheating script its not possible but I wanted to see if that functionality has been added but I havent found anything yet

hot kernel
#

@jolly jewel , the one I posted above has a typo. After a bit of research I decided not to do this anyway

jolly jewel
#

Alright, fair enough

#

I was half considering just recommending doing it the way I usually do, but I decided not to be lazy and actually try to fix your problem

hot kernel
#

I mean, it can be done but for my purpose it's not necessary-- we don't need the functions in the editor-- quite the opposite

#

@jolly jewel , out of curiosity what's the method you usually do?

#

@edgy dune , you mean like an object ID?

jolly jewel
#
class cfgFunctions {
  class tint {
    class furniture {
      file = "furniture\functions";
      class dressDown {};
      class dressUp {};
      class translate {};
      class updateHouse {};
      class init {postInit=1;};
    };
  };
};```
hot kernel
#

does the file functions contain multiple functions? yes?

jolly jewel
#

No, that's just that path

#

Every function in the folder will be named fn_[classname].sqf

hot kernel
#

oh, so loose files in that functions folder

jolly jewel
#

Yeah you got it

hot kernel
#

thanks for helping me to understand

jolly jewel
#

No problem!

edgy dune
#

@hot kernel like how player returns the player object and so u can thus use setvariable and stuff likd that

hot kernel
jolly jewel
#

I don't think there exists a "weapon object" in the game code (Someone correct me if I'm wrong), but even if there did, there is currently no way to get it

edgy dune
#

@hot kernel that returns the class of the weapon, like for example i want to get the current weapon and say setvariable["is_jammed",true] or something like that

#

Also rip im on phone so sorry if format is bad

plucky wave
#

Say you're creating a mod, is there anyway within that mod to listen for default event handlers.. e.g. I want the mod to listen for onPlayerKilled and the execute code

fringe yoke
#

Has any info on the spectrum device come out yet?

still forum
#

@edgy dune

Is it possible to get a units weapon object
no, it doesn't exist a weapon is not an object

#

@plucky wave just make a preInit script using CfgFunctions, and register that eventhandler

#

There is also CfgEventHandlers config class I think? not sure how useful that is

plucky wave
#

@still forum Can you elaborate when you say register that eventhandler? Got an example at all?

dawn ruin
#

@still forum Do you have any idea on how to grab the selected values from a module?

still forum
#

yes. atleast I know that I would search in old ace/tfar code for it

#

I don't know how to do it right now

blazing garden
#

Can someone esplain me what I am doing wrong?
When I paste this code:
this addEventHandler ["Fired",{mortar_fired = true; _this select 0 removeAllEventHandlers "Fired"}]
I get "Error invalid number in expression"

What does this mean?

still forum
#

did you copy his code for the BI forums?

blazing garden
#

Yes, I've fund this code to use in the init of the unit.

plucky wave
#

Shouldn’t _this select 0 be surrounded by brackets?

copper raven
#

No

#

Where did you copy it from? Looks like might contain bom chars

still forum
#

Copy the code again from dicord thing you pasted above, and put it back into your script

#

Where did you copy it from? Looks like might contain bom chars
I just asked exactly that above.

#

BI Forum probably inserted errornous characters into it that you cannot see, but break the script.

blazing garden
still forum
#

Can't see any errornous characters in there

blazing garden
#

Maybe I've resolved this, instead of "_this select 0 removeAllEventHandlers "Fired"
I've used only "this removeAllEventHandlers "Fired"

still forum
#

no, you didn't resolve it

#

you are now just using a undefined variable

#

this doesn't exist in there

plucky wave
#

Well he’s putting it in the init of a unit right? So using ‘this’ is referencing the object of the unit

#

Which would work and remove the event handler from the object, in this case, the unit

still forum
#

So using ‘this’ is referencing the object of the unit
no it isn't

#

this is a local variable, and local variables don't carry over into new scripts, which is what addEventHandler is creating once the event fires

blazing garden
#

So if the unit is affected to other scripts, those will not work?

#

However seems that rewriting the code manually, fixed even the _this select 0 problem.

I dunno why it happen, even if it's identical the one I wrote here.
Thanks for the help however

still forum
#

I already told you why it happens

#

and I already told you how to solve it

#

¯_(ツ)_/¯

blazing garden
#

You're right
The problem it's that I am slow to understand 🙈

stone coral
#

Have anyone ever stumbled upon the possibility to change/increase the range of the “rearm” function with rearm vehicles ?

winter rose
#

That would be a mod, or you can (maybe, and maybe barely) script it with a set repair cargo command and a distance radius

astral tendon
#

how to disable and delete a module? ModuleRespawnVehicle_F even afther being deleted with deletevehicle still active and spawning vehicles

rough dagger
#

Hi folks, I am still trying to get my head wrapped around MP scripting. I am including this [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory; in onPlayerKilled and onPlayerRespawn, and it seems to work fine. However If I abort the mission as a player, then come back in, I lose my loadout (in me jimmies). How can I ensure the loadout is loaded after a player aborts and then returns to the mission? Thank you in advance for any help given 🙂

#

Restarting the server solves the problem, but is probably not the best solution..

thorn saffron
#

random question: does the ACE grenade throwing trip the Fired event handler?

tender viper
#

Does anybody have experience with ground vehicle/turret launched missiles? Asking again, in case the first time it was lost during fast-scrolling convos.

still forum
#

@thorn saffron I'd assume no

#

But afaik ACE has its own grenadeThrown/throwableThrown EH

thorn saffron
#

I see, so I would need to track both EH if I want to be sure to catch the throw in the script

waxen tendon
#

command to kill spawned thread?

#

nvm found it, terminate

tough abyss
#

Hi all I just wanted to know how would I apply this script to an asset? I’ve never scripted before so I know nothing about this. I don’t know what files or anything to add this script too. Would be much appreciated if someone can help me and show me where to exactly put the script. Thanks so much!

https://community.bistudio.com/wiki/animateSource

finite dirge
#

That's not a script. That's a single function. Depends what you are trying to do and what you are animating. If you wanted to open a door for example, you could use a key event and do it from there. If it's a gate or something, an addAction could work.

still forum
#

single command*

tough abyss
#

@finite dirge Well I was told it was a script haha. It’s a building and I just want to animate the doors when opening them. There’s around 20-22 doors all together in the building. Any ideas?

finite dirge
#

Couldn't think of the word, was going to say "Engine Function" but that's not right either.

#

Doors should animate when you open them already, no?

tough abyss
#

@finite dirge For me on this building they are not opening or animating. It’s a very strange thing since it worked perfectly fine a couple days ago...

#

Something definitely went wrong somewhere somehow... still trying to figure out what I done to cause this.

finite dirge
#

If it's a modded building, you'd have to find the source from it's config to animate the door with animateSource.

You could open door #1 from a default building with this:

buildingName animateSource ["Door_1_sound_source", 1];
tough abyss
#

@finite dirge The config on the building is a .bin file. Any ideas how I can open this file and edit it correctly to add the correct scripts/commands to open and animate the doors??

finite dirge
tough abyss
#

Imthatguyhere I’m so sorry about this but I’m not sure how to use this? Is it an application I can download and I just upload the .bin file to it and it’ll convert it??? I’m so sorry about this. Thought I was annoying you so I didn’t want to @ you.

finite dirge
#

Yep.

#

CfgConvert is a command line tool for converting configs between text and binary representation.
It's a part of the A3 tools package.

runic edge
#

hello guys, I'm looking for a function to get the actual in game overcast, does this exist ? getOvercast doesn't seems to exist !
Thank you

finite dirge
runic edge
#

was searching at getO...

#

Thanks a lot mate !

finite dirge
#

No problem!

tough abyss
#

@finite dirge Hi again, if I send you the config will you be able to help me figure this out. I don’t understand what I’m reading it’s so confusing haha. Is it ok if you can help me or are you busy?

winter rose
finite dirge
#

Seems to be setup already to open in some capacity. Are you sure your issue isnt that you disabled simulation on the building?

tough abyss
#

@finite dirge No I haven’t disabled simulation. Also in the PBO file is it ok to use the .cpp file instead of the .bin file?

tough abyss
#

Anyone else know why this could be caused?

uncut depot
#

@thorn saffron you don't need both EH since the Ace EH is a wrapper for the base eh it tracks ace throw + the other base fired events

grizzled spindle
#

Has anyone ever made a tool that will parse SQF arrays into something like a PHP or Javascript array?

still forum
#

there are multiple SQF parsers in multiple languages

#

also.. isn't javascript array same syntax as sqf?

#

and php too?

grizzled spindle
#

Not really

#

They have functions to say, explode which converts a string to an array using a delimiter but I have a few multidimentional arrays in a mysql DB that im wanting to manipulate

#

lol

stone coral
#

Trying again 🙂 Have anyone ever stumbled upon the possibility to change/increase the range of the “rearm” function with rearm vehicles ?

still forum
#

i guess they are in config

#

so dont think so

rough dagger
#

Could anyone help me with the syntax I need to determine the name and UID of the pilot of a named vehicle, in an MP setting? I have a heli called "transport1". The heli can be flown by any player, but there is a mission (within an addAction) that is attached to the heli itself. Once any player triggers the mission from within "transport1", I would like to ID the player's name and UID so I can link the outcome of the mission to an entry in a database.

#

I assume 'currentPilot' is part of the equation, but I'm just way out of my depth with the MP stuff

worn forge
#

Question regarding Headless client. We've got one on our mission, I've assigned about 60% units to it, they drive around, receive waypoints, etc. But they don't engage players; they'll just drive around them. Any suggestions?

frozen knoll
#

@worn forge have you setBehaviour & setCombatMode ?

#

also setFriend

worn forge
#

I haven't specifically; double clicking on the group shows they are in red for combat mode...

#

Nothing has been set which changes their friend status, but I'll check?

#

setFriend hasn't changed either, west and east still are unfriendly 🙂

#

I mean, headless inherits the mission file like everyone else, and it's set up there

frozen knoll
#

@rough dagger getting that information is easy you can do it local and send it to the server if thats where you want to process it? there are a couple ways to do it... do you have a file to remoteExec to or a addPublicVariableEventHandler setup?

#

@worn forge i script my ai so cant be much help as placing units in editor is something i dont do but when i script them i also use the below which may be of some help

{
        {
            _x enableAI "TARGET";
            _x enableAI "AUTOTARGET";
            _x enableAI "MOVE";
            _x enableAI "ANIM";
            _x enableAI "FSM";
            _x enableAI "COVER";
            _x disableAI "SUPPRESSION";
            _x disableAI "AIMINGERROR";
            _x setCustomAimCoef 0.05;
            _x enableStamina false;

        } forEach _unit;
    };
#

especially "AUTOTARGET"

worn forge
#

Well right now, I spawn the unit on the server, then my hc unit manager process figures out which groups will get loaded to the headless client (I aim for 60%)... then when I want to transfer ownership of the group it just does
_group = selectRandom _opforGroupsServer;
_group setGroupOwner hcID;

#

I can't see how transfering group ownership would stop FSMs and such

frozen knoll
#

"AUTOTARGET" - prevent the unit from assigning a target independently and watching unknown objects / no automatic target selection

worn forge
#

Good advice, I'll check and see if somehow the AI settings are getting changed

#

Wow, that customAimCoef, they should have pretty laser like aim 🙂

frozen knoll
#

gotcha so pre ownership transfer the ai behave as intended and only on transfer they dont?

#

lol yeh but i have human like ai (as human like as you can get) with other custom things here and there

worn forge
#

Yes, pre-ownership I don't mess with any of the enableAI categories

#

They are literally driving around players like they don't exist

frozen knoll
#

have you tried setFriend post ownership transfer

#

it just sounds like they see you as friendly

#

that or ai behavior is disabled

#

another one to ponder... knowsAbout

rough dagger
#

@frozen knoll thank you for the reply, I think I can do either option (mentioned above)... I don't 'think' it needs to use addPublicVariableEventHandler , as I can simply update the DB from the mission file, I just need to be able to extract the relevant pilot/player ID and Name..

frozen knoll
#

@worn forge to add to your transfer code

 _group = selectRandom _opforGroupsServer;
  _group setGroupOwner hcID;
{_group reveal _x} forEach allUnits;
#

@rough dagger and another thing to help understand how to help you... when the player triggers the mission are they automatically entered into pilot seat or do they still have to enter pilot seat?

rough dagger
#

they are free to choose a number of heli options, each heli will hold a different type of mission

frozen knoll
#

ok so they still need to enter the pilot seat... so when it triggers you would require a waitUntil... i will quickly type something up that may help

rough dagger
#

thank you !! 🙂

frozen knoll
#
waitUntil {(driver transport1) isEqualTo player};
_vehicleClass = typeOf transport1;
_vehicleName = gettext (configfile >> "CfgVehicles" >> _vehicleClass >> "displayName");
_vehiclePilot = driver transport1;
_VehilcePilotName = name _vehiclePilot;
rough dagger
#

absolutely sound! thank you 👌 🙏

frozen knoll
#

np

pallid finch
#

Would scripting be the way to change how the player can see from driving a vehicle in the 3rd person view?

bold kiln
#

I hope this is a quick easy question.

What happens when a character or unit dies? Specifically what parameters change?

fringe yoke
#

How do you make an extension for the linux server? What is the naming?

#

I have tried web.so and libweb.so but neither work

finite dirge
#

.so and whatever the name you are going to call it.

#

While on Windows the extension name is case-insensitive, on Linux the extension name is case-sensitive and should match the name of the .so file exactly (minus ".so" part). Currently only 32-bit extensions are supported on Linux.

fringe yoke
#

Hm, confused af then

fringe yoke
#

Got it working after dependency hell, works great on Windows

#

works on Linux, but I get a segfault after it's ran

#

nice

still forum
#

yeah linux dependencies are a little more wacky

fringe yoke
#

Needed to use a more recent version of Debian, they stopped updating gblic on stretch I guess

#

Now I just need to figure out why the damn thing segfaults after

distant egret
#

Does addMusicEventHandler also have the _thisEventHandler variable in it self? Can't find it on the wiki on it's page.

#

Ow wait it seems to be passed into _this if I read it correctly.

vernal mural
#

Is there a way to retrieve the amount of subclasses contained in a given config class ? Something like :

class myClass {
    class subClassX { };
    class subClassY { };
    class subClassZ { };
};

And then calling some kind of function/command so we get such a thing :
_amount = (missionConfigFile >> myClass) call WTF_fnc_CfgCount

#

Here _amount would be 3 of course

errant patio
#

BIS_fnc_getCfgSubClasses

#

gives you an array, can count it or whatever you want to do afterwards

vernal mural
#

How ! I thought such a thing would have been included in the "See Also" section of BIS_fnc_getCfgData. Thanks !

errant patio
#

yeah sadly the see also sections are a bit hit or miss when it comes to including all relevant pages

winter rose
#

Categories are usually more reliable for "big population" ones - you cannot have everything in the See Also

wheat geyser
#

Can anyone confirm that magazinesTurret still is bugged in A3?

#

In A2 it, smartly, returns Magazines which are empty. Which, of course, makes it utterly useless.

#

Really awesome: Apparently "Jirka" has fixed counting of 'virtual' in 2007, but forgot to add his line to the turret (i.e. the important) part of the command (l. 2154 cont.) Just wow.

#

*'virtual' magazines

runic edge
#

Hello guys I'm trying to get this script to work https://cdn.discordapp.com/attachments/274298407445725186/637701000760918036/HcFwd.sqf
It's aim is to transfer unit from zeus to the HC but the RPT keep trowing errors at me :

"onEachFrame", 
{
if (isPlayer) exitWith {};
if (_x in units group _HC>
19:13:33   Error position: <) exitWith {};
if (_x in units group _HC>
19:13:33   Error unexpected )
19:13:33 File mpmissions\__cur_mp.Altis\HcFwd.sqf, line 11
19:13:33 Error in expression <"HcFwd", 
"onEachFrame", 
{
if (isPlayer) exitWith {};
if (_x in units group _HC>
19:13:33   Error position: <) exitWith {};
if (_x in units group _HC>
19:13:33   Error unexpected )
19:13:33 File mpmissions\__cur_mp.Altis\HcFwd.sqf, line 11
if (!isServer) exitWith {};
_HC = owner "HC1";
waitUntil {!isNil "_HC"};
[>
19:13:33   Error position: <owner "HC1";
waitUntil {!isNil "_HC"};
[>
19:13:33   Error owner: Type String, expected Object
19:13:33 File mpmissions\__cur_mp.Altis\HcFwd.sqf, line 5```
#

any ideas ? 😗

still forum
#

command neeeds an argument

#

also don't add a EachFrame eventhandler, when it will never fire

#

actually. Show the script I don't really see what youre doing there? CBA eventhandler?

#

probably scripted eventhandler 🤔

#

Okey.
if (isPlayer) exitWith {}; what are you trying to do with that?

#

_HC variable will be undefined

#

local variables don't carry over to other scripts

#

also owner returns a number, and takes a unit not a string

#

you cant call group on a number

#

in general that whole script is argument type nonsense

#

please read the wiki pages for all the commands you use there

#

also there is no reason to call setGroupOwner if it was already set, I'd recommend you check first

#

waitUntil {!isNil "_HC"}; that will never work as the variable never gets changed

#

if (_x in units group _HC) exitWith {}; that should never possibly happen

#

setGroupOwner doesn't put them into HC's group

#

if (isNull _HC) exitWith{}; this is terrible, you should remove the eachFrame eventhandler if you don't want it to run

#

rather than skip every iteration

#

I recommend you just spawn a while true loop, with a sleep inside, instead of using onEachFrame

runic edge
#

ok, will try it ! Thanks a lot sir ^^

astral dawn
#

Is it really bad to add lots of intenvoty items into cargo boxes/vehicles with script? Does it cause a lot of traffic or anything like that, or I can use that safely?

#

I'd guess... not much probably 🤷

finite dirge
#

Constantly wouldn't be great, but if you have to fill it you gotta fill it somehow.

mint kraken
#

How do I get a vehicle's readable name?

winter rose
#

through config

still forum
#

cfgvehicles >> class >> displayName

winter rose
#

@mint kraken sqf gettext (configfile >> "CfgVehicles" >> typeOf mySuperVehicle >> "displayName");

mint kraken
#

Thanks!

pallid finch
#

Would scripting be the correct place to ask the question of why the 3rd person view in a car would change

surreal peak
#

I assume it is the same person in each car?

winter rose
#

@pallid finch vehicle config, so not scripting but more #arma3_config

jaunty ravine
#

I'm attempting to limit an arsenal based on a player's role description, my current code looks like this:

if (roleDescription player == "Player 1") then {...}```
#

However this code doesn't work.

#

Also tried with:

_playerRole = roleDescription player;
if (_playerRole == "Player 1") then {...}``` But to no avail, still does not work.
#

Anyone have any ideas on what I'm doing wrong?

winter rose
#

first ensure you have the proper valuesqf hint roleDescription player

jaunty ravine
#

Yep, it's the right value.

#

Tried with just roleDescription player as well and it returned "Player 1".

tough abyss
#

Those anyone know how to make this work?

jaunty ravine
#

Are you using ACE, @tough abyss?

tough abyss
#

Its for a friends server

#

I have no clue

jaunty ravine
#

Is that server running ACE3?

#

Ask.

tough abyss
#

Okay sec

#

No

#

Its not

jaunty ravine
#

Then I can't help unfortunately.

tough abyss
#

Wat is ace3

jaunty ravine
#

Realism mod for Arma.

tough abyss
#

Ohh

#

My friend he new to coding n he doesnt know much but

#

He is pretty good

#

For not knowing much

#

I want him to put a full screen NV screen

#

:/

#

🙁

#

@jaunty ravine hes working on a vanilla server

#

Can someone help out

jaunty ravine
#

Sorry but I'm not that good at scripting so I can't help.

modest temple
#

is there a way to execute a .sqf with add action globaly on a dedicated server?

spice axle
#

@tough abyss
isClass (configFile >> "CfgPatches" >> "ModName")

You have to manually look it up. Often the mod has a main or common pbo and you can use that.

rough dagger
#

@modest temple have you looked at ‘remoteExec’?

worn flame
#

Is there a way to detect if a map/area near a location is desert/woodland etc?

forest ore
#

Would want to:

  • getPos of multiple objects
  • then drawIcon3D on the locations of those objects

Currently got this but can't seem to figure out and get it to work on my own (also getting an error with the version below)

    _positions = [BLUFOR_1,BLUFOR_2];
    {_helipadPos = getPos _x;} forEach _positions;
    drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_positions select 0),(_positions select 1), 1], 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
}];```
BLUFOR_1 and BLUFOR_2 are objects (**HeliHEmpty**)
proud carbon
#

Hey so I am having problems with getting an object.

        _Obj1 = nearestObjects [_point,["rhsgref_ins_g_Igla_AA_pod","rhsgref_ins_g_ZU23"],10,true];
        _Obj = (_Obj1 select 0);
        _AAname = getText (configFile >> "cfgVehicles" >> typeOf _Obj >> "displayName");
        _description = format ["There is AA at grid %1. Be careful, We really need it to be taken out. it should be a %2", _gridPos, _AAname];

can someone tell me what i am doing wrong?
if gives out no error

winter rose
#

put systemChat/hint to get variable contents @proud carbon

#

when bringing up an error, it is good to know which. what is happening with your code @forest ore ?

forest ore
#

thanks Lou. Such error:

drawIcon3D ["\A3\ui_f\data\map\markers\n>
14:49:20   Error position: <drawIcon3D ["\A3\ui_f\data\map\markers\n>
14:49:20   Error Type Any, expected Number```
worn flame
#

Thanks Lou!

proud carbon
#

so it doesn't come up with the variable contents with hint

winter rose
#

Syntax: drawIcon3D [texture, color, position, width, height, angle, text, shadow, textSize, font, textAlign, drawSideArrows]

_positions = [BLUFOR_1,BLUFOR_2];
    {_helipadPos = getPos _x;} forEach _positions; // helipad is never used -and- is unusable```

```sqf
_positions = [getPos BLUFOR_1, getPosBLUFOR_2]; // correct``` @forest ore
#

then you don't get a proper result with your command @proud carbon

proud carbon
#

I get <Null> some of the time.

#

Do you have a fix?

winter rose
#

make sure that the array result is at least 1 item long

#
if (count _obj1 > 0) then { (...) };```
proud carbon
#

ok, it isn't 1 item long

winter rose
#
_array = [1,2,3];
_array select 0 // returns 1

_array = [];
_array select 0 // returns nil```
proud carbon
#

does that mean one of my class types isn't there when i spawn it?

winter rose
#

it means it doesn't detect with the class you gave it, either it is not present, too far away or the class name is wrong

proud carbon
#

how do i get better detection with RHS AA?

winter rose
#

…script better?

proud carbon
#

well the error is occurring class "rhsgref_ins_g_Igla_AA_pod".

winter rose
#

in the most stripped down version of this script (e.g in a VR environment) does it work?

proud carbon
#

same error.

winter rose
#

maybe the class is wrong then.

#

use typeOf to get the object's class

#

oh wait
you are using nearestObjects

proud carbon
#

it must be the class after switching out a different class. the script works

winter rose
#

is it empty by all means?

proud carbon
#

not with a different class

#

so I could use

_Obj = nearestObject [_point,["rhsgref_ins_g_Igla_AA_pod","rhsgref_ins_g_ZU23"]];

instead of

_Obj1 = nearestObjects [_point,["rhsgref_ins_g_Igla_AA_pod","rhsgref_ins_g_ZU23"],10,true];
winter rose
#

if there is only one, yes

#

mind the radius, too

forest ore
#

Lou, switched to this as per your suggestion

    _positions = [getPos BLUFOR_1, getPos BLUFOR_2];
    drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_positions select 0),(_positions select 1), 1], 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
}];```
and now the error is
```15:04:48 Error in expression <s = [getPos BLUFOR_1, getPos BLUFOR_2];
drawIcon3D ["\A3\ui_f\data\map\markers\n>
15:04:48   Error position: <drawIcon3D ["\A3\ui_f\data\map\markers\n>
15:04:48   Error Type Array, expected Number```
#

Not much changed with the error except Error Type Any changed to Error Type Array

winter rose
#

becausesqf [(_positions select 0),(_positions select 1), 1] would result in sqf [[0,2,3], [5,3,2], 1] and that is not a proper position array

#

you should dosqf _positions = [pos1, pos2, pos3, etc]; { drawIcon3D [/* blabla*/, [1,2,3], _x, /*blablabla*/]; } forEach _positions;

forest ore
#

I don't understand this [1,2,3] _x
Is that supposed to be the position information or what?

winter rose
#

you should keep your drawIcon3D format, but use the forEach's "_x" variable as the position - because you are coding for multiple positions

forest ore
#

Sadly not following in this case so had to hammer up something

    _positions = [BLUFOR_1, BLUFOR_2];
    {drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_positions select 0),(_positions select 1), 1] _x, 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
    } forEach _positions;
    }];```
and with that getting an *Generic error in expression* .. error
winter rose
#

of course 😄

#
addMissionEventHandler ["Draw3D", {
    private _positions = [getPos BLUFOR_1, getPos BLUFOR_2];
    {
        drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_installation.paa", [0,0.3,0.6,1], [(_x select 0),(_x select 1), 1], 0.8, 0.8, 0, "", 1, 0.0315, "PuristaSemibold"];
    } forEach _positions;
}];```
#

does it look clearer to you, as the how and why?

forest ore
#

All I can say that at one point I tried with [(_x select 0),(_x select 1), 1] but at the time only had _positions = [BLUFOR_1, BLUFOR_2]; and at in no point I did not come across to test with _positions = [getPos BLUFOR_1, getPos BLUFOR_2]; also.
A lot is much clearer now but would not have been able to arrive there on my own. Thank you so much Lou 🙏🏼

winter rose
#

the thing is for _x to exist, you need a forEach! A simple example:

private _texts = ["a", "b", "c"];
{
    private _text = _x;
    hint _text;
    sleep 1;
} forEach _texts;```
dreamy kestrel
#

Question, I am defining some class event handlers, i.e. onLoad, right. they are defined in the public (client) scope, and they are being invoked when the event spawn calls them. That much is fine.

#

My question is to do with the module in which we actually declare the event handlers themselves. Am I right in thinking that any module private variables we might have declared are basically lost once that scope has vanished? Sans the public scope event handlers, of course.

#

If we introduced a sort of "keep alive", do nothing, "manager", basically a forever sleep, would that keep the private variables alive?

dreamy kestrel
#

my goal there is, I am defining some cross-cutting variables such as tuple indices, IDD and IDC variables, along these lines. I do not want to incur a public variable pollution, necessarily, yet the variables have cross-cutting application for this particular set of event handlers.

#

I suppose another strategy might be to add variables on the dialog itself and manage them that way. Of course, the tradeoff then is that we are constantly getting them from the dialog namespace when we want to use them. Better than a public variable pollution, but still with the downside of having to query for them, when we could simply define them once.

#

thoughts? suggestions?

astral dawn
#

any module private variables we might have declared are basically lost once that scope has vanished
What do you mean 'module private variables'? Variables declared as private in some script?

dreamy kestrel
#

yes, in the module scope. i.e. private _a = "..."; Public_Event_Handler = { /* do something with _a */ };

astral dawn
#

Anyway it's ok to store variables in missionNamespace of in any other namespace, just give it a not-too-generic name like mic_house instead of house

#

if you do

private _a = "123";
public_eh = { player setdamage 1; };

then it's same as if you did
missionNamespace setVariable ["public_eh", {...}];

#

hmm sorry I was reading your msg wrong

dreamy kestrel
#

that's the same as saying public_eh = "..."; ?

astral dawn
#

yes you are right, _a won't be accessible from the EH

#

so you won't be able to /* do something with _a */

#

unless you store _a somewhere else

#

like on object to which you attach the EH

#

or in mission namespace

#

or anywhere else

dreamy kestrel
#

thoughts as to the efficacy of introducing a do nothing "manager" to keep the private variables alive?

astral dawn
#

your idea with spawning a script which will never terminate and thus keep _a value alive will not work too, because when EH is called it won't have access to _a anyway

#

EH is called totally without any context (in other words, without any local variables), except for the variables passed to it by arma

dreamy kestrel
#

even though the module would still be alive, the scope is still basically "visible" ?

astral dawn
#

what is a module really? what do you call a module?

dreamy kestrel
#

i.e. tacking a waitUntil { sleep 10; false; }; at the end, or something like that.

#

self contained .sqf script

astral dawn
#

a spawned script?

dreamy kestrel
#

yes

#

spawned or exec'ed, etc

astral dawn
#

well what I have said still is true, there is no way to pass any variable to event handler, only way is if you setVariable somewhere

dreamy kestrel
#

okay, appreciate the insights. forming a strategy how to approach this.

astral dawn
#

typically... you add EH to a control, you can setVariable on that control

#

...you add it to an object, well you can setVariable on an object too

dreamy kestrel
#

I am leaning that direction I think. perhaps with a modest API to set, get variable set tuples from the object.

#

thanks

astral dawn
#

can create a macro to replace the long setVariable with setv :p

#

#define SETV setVariable if you are lazy to type
another my favourite definition is
#define pr private

why does Lou dislike me 😮

#

(like me)

#

CBA use a lot of GVAR and similar macros which convert
myParams
into
sparker_moduleName_myParams

#

it's like moduleName_submoduleName_varName... don't remember but you get the idea

dreamy kestrel
#

yeah, I've studied the ACE framework. it is an interesting approach, but goodness the decoder ring you have to wear. thank goodness it is well organized.

#

unfortunately the code base I am working from is not nearly so well thought through, but I get the idea.

rough dagger
#

Hi all, I return with another MP scripting question 🙂 ... I have various locations in my map, that should spawn activity when players are near, and despawn said assets when all players have left the area. Could someone advise on the best if () then {} syntax for this?

#

Thanks in advance

oblique arrow
#

Doesn't the base game dynamic loading system do that?

flint iris
#

Hello, I have a question about removing benches from MH-9 Hummingbird with this script: this animate ["addBenches",0]; Is there any way how to remove options to still jump on the bench even if it's removed?

winter rose
#

the base game (should?) remove the action

rough dagger
#

@oblique arrow sorry, was that in response to my question?

winter rose
#

yes it was; the quantity of items is not an issue before long, but the quantity of simulated items might be
did you look up the in-game dynamic system @rough dagger ?

jagged wing
#

Been reading the wiki page on scripting, does anyone know any more in depth tutorials on how to begin?

winter rose
#

which one did you read?

jagged wing
#

The beginers one

winter rose
#

link?

winter rose
jagged wing
#

I have opened vsc before but didnt know enough to go any thing

#

Just finished reading that one 2

#

Just found the useful links section of the first article

#

Going to read the first couple of those

winter rose
#

Have fun!

trail wedge
#

@grizzled spindle

#

(he has a q, but i'll let him ask)

jagged wing
#

Thanks @winter rose

#

Any good apps to write on my phone while im away from pc

#

Android phone or apple ipad

#

Found one

errant patio
#

Is it possible to change any of the properties of a particle after it's been droped?

winter rose
#

drop, no

#

setParticleParams, yes

you set the particle param before dropping it, once dropped, it lives its life!

cloud thunder
#

@flint iris lockTurret

flint iris
#

thank you @cloud thunder

jagged wing
#

My file should be names fileExample.[what do i put here]

grizzled spindle
#

So the question I had was about remoteExecs to a server. If I remoteExecCall to a server will the game be frozen until that function is complete?

#

As in server side

#

I know this is true for clients

#

As per the remoteExec Wiki

still forum
#

My file should be names fileExample.[what do i put here]
doesn't matter. Just matters that you use the same ingame

#

If I remoteExecCall to a server will the game be frozen until that function is complete?
yes

rough dagger
#

@winter rose @oblique arrow thank you both and sorry for the delay in responding .. I should probably not try to resolve scripting problems while at work 😉 I will research the simulation link as suggested .. thank you

errant patio
#

Thanks Lou, not surprising but disappointing still.. I was daydreaming of fading out particles smoothly as the player approached lol

grizzled spindle
#

Thanks @still forum

plucky wave
#

Anyway to remove object textures set using setObjectTexture?

wary vine
#

is there a clean way of converting "#(argb,8,8,3)color(0.365,0.541,0.659,1,co)" to [0.365,0.541,0.659,1]

#

i got a hacky way,

((("#(argb,8,8,3)color(0.365,0.541,0.659,1,co)" splitString "(") select 2) splitString ")") select 0 splitString ","; 
``` but then still have to parseNumber on it.
grizzled spindle
#

Is there any ways to stress test a mission/server that anyone knows about?

ruby breach
#

@wary vine You can use find and select to make something dynamic to always pull the color arguments from a string

#

Ugly example: (i.e, pre-coffee code)```sqf
private _string = "#(argb,8,8,3)color(0.365,0.541,0.659,1,co)";
private _start = (_string find "color(") + (count "color(");
private _end = _string find ",co)";
parseSimpleArray format["[%1]",_string select[_start,(_end-_start)]];

round scroll
#

trying to get an AI controlled AWACS roam the sky. The Sabre E-2 works when I set the group of driver to careless and follows waypoints. The Unsung E-2 doesn't, it flies straight to the closest bogey or AA to get shot down. Both code are the same and include ```sqf
awacs setVehicleRadar 1;
(group driver awacs) setBehaviour "CARELESS";

#

with the E-2 being named awacs

#

any ideas what could be the culprit with the Unsung E-2?

wary vine
#

@ruby breach oh shit, ty

wary vine
dreamy kestrel
#

is there a way to report the call stack from a function?

ivory lake
still forum
frozen knoll
#

@ivory lake you just use addMagazine

ivory lake
#

load, as in, load it into the weapon

#

no delay, instantly. that'd just add it to the pool

frozen knoll
ivory lake
#

that doesnt help either.

frozen knoll
#

why not

ivory lake
#

because that just changes how many magazines from the vehicles config are available

#

I want to have a weapon that is loaded, or unloaded, immediatley change to another magazine

frozen knoll
#

from my past use it reloads it

#

go into editor jump in a pawnee or any vheicle... deplete its ammo and put in debug

and its instantly good to go

ivory lake
#

thats not what I want

frozen knoll
#

"instantly load a magazine into a vehicles weapon "

ivory lake
#

a specific magazine

#

not just reload the entire vehicle

frozen knoll
#

oh ok so what magazine

ivory lake
#

ugh why would that matter

frozen knoll
#

a specific magazine

#

since u said "specific "

ivory lake
#

Look, to explain what I mean. Say a tank is switching from AP to HE

#

I can find out the tank is doing this with a reloaded eventhandler, and I want to make the switch

#

instant

#

for infantry weapons you can do that by using what I said, addweaponItem etc

frozen knoll
#

have you tried it by use of the SWITCHMAGAZINE action ?

#

or does it still play out animation ?

ivory lake
#

its the same as selecting the option in the menu yourself, so yeah

plucky wave
#

Best way to check side of a vehicle in game? Have tried using side _vehicle however this returns CIV for everything. Is there a way I can check CfgVehicles for isKindOf BLUFOR/WEST?

velvet merlin
#

whats the most efficient implementation (mod or script) of 2d map unit markers/icons?

winter rose
#

@plucky wave you should check for a vehicle's faction (maybe through faction, maybe through config)

plucky wave
#

All good, found a way to do it. If anyone is curious:

_type = typeOf _vehicle
if (getNumber(configfile >> "CfgVehicles" >> _type >> "side") == 1) then {

winter rose
#

@plucky wave question, does sqf faction _myVehicle work?

plucky wave
#
_vehicles = vehicles; 
{
 diag_log faction _x;
} forEach _vehicles;

would return:

19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "OPF_F"
19:54:26 "UK3CB_ANP_B"
19:54:26 "BLU_F"
winter rose
#

thanks! 👍

jagged wing
#

Is there an arma 3 extension for vsc

errant patio
#

there are a few, search the marketplace for sqf and arma

still forum
#

@jagged wing yes, just search for SQF

#

ah im too slow

jagged wing
#

Thanks @errant patio. And @still forum , its the thought that counts!😀

#

Can I position entities in the editor then add other things in the init file

still forum
#

sure

crisp turtle
#

Lads i'm back in here again.
I'm trying to figure out how to use playSound3D to have sound cues based on activated triggers in multiplayer.
I've followed KK's guide and added

    private "_arr";
    _arr = toArray __FILE__;
    _arr resize (count _arr - 8);
    toString _arr
};```

to my init.sqf
Now, i have an item with an Addaction that sets a variable true to activate a trigger that should play a sound with

```playsound3D [MISSION_ROOT + "sound\EMERGENCY.ogg", spooker];```

in the OnActivation field. Spooker is the soundSource.

And ofcourse it ain't working. Anyone know where i'm screwing up?
still forum
#

did you try logging the final path, to make sure its correct?

crisp turtle
#

logging the final path?

#

Sorry, unsure what you mean

still forum
#

hint (MISSION_ROOT + "sound\EMERGENCY.ogg")
systemChat (MISSION_ROOT + "sound\EMERGENCY.ogg")
diag_log (MISSION_ROOT + "sound\EMERGENCY.ogg")

#

whatever, just to check that the path is correct

crisp turtle
#

it should be yes

#

yes it is

#

doublechecked, the path is correct

crisp turtle
#

ALRIGHT GENTS I'LL SEE MYSELF OUT. the soundSource was Spooker1

winter rose
#

spooky

crisp turtle
#

31st is behind the corner

still forum
errant jasper
#

Maybe things have changed, but isn't the description misleading, because now you just shift the problem? How would playSound3D work with an absolute path in multiplayer now? Or does the calling machine stream audio to everybody else?

#

Similar with createSimpleObject suggested in the description. It makes sense such a thing requires an addon path?

#

I mean, its use makes sense to pass proper paths to commands with local effect, like drawIcon3D as suggested.

still forum
#

you mean for things that are global? I assume the game knows that a file is in mission directory and can correctly resolve it interally

errant jasper
#

Well, if true, then that would make setObjectTextureGlobal work for textures placed in missions folders now. One can only hope.

#

Though, IMO would make more sense for BI to just designate a particular pboprefix for the mission...

#

rather than parsing "clientA\path\to\mission\blah\blah" to "clientB\path\to\mission\blah\blah"

still forum
#

to just designate a particular pboprefix for the mission...
we have that.. its called cur_mp something

#

dunno how they broke that

marble thistle
#

It seems like the truck boxer is disappering from a distance of ~ 50m. If you zoom it it appears again. Also the 3d vehicleshop preview from altis life seems to be broken Is there any fix?

subtle flint
#

Hi guys

#

Is it possible to modify a value in the server.cfg by a script at the server start?

winter rose
#

no

brazen aurora
#

And to configure a value outside of the file?

mild pumice
#
_str = "[""hint """"hello world"""";""]";
_a = parseSimpleArray _str;
diag_log _a; // ["hint """"hello world"""";"]

Shouldn't this be equal to ["hint ""hello world"";"] ?

#

Ok i guess the behaviour changed... "Since Arma 3 v.1.95.145925 the command will tolerate extra spaces and supports single quotes"
the right syntax now seems to be

_str = "[""hint 'hello world';""]";
_a = parseSimpleArray _str;
diag_log _a; // ["hint 'hello world';"]
tough abyss
#

Okay so the params command https://community.bistudio.com/wiki/params was not introduced until Arma 3. Anyone know what people used for this functionality in Arma 2?

winter rose
#

BIS_fnc_param I think @tough abyss

#

ah wait, it was introduced in Arma 3 0.50, so no

tough abyss
#

_this select 0,1,2...?

twin steppe
#

Hey guys just wanted to ask if it was possible to attach a camera to where Zeus is looking?

#

Would use it as a on the go cutscene module, showing a live feed of wherever the Zeus is looking for all players.

short vine
#

With the new change of createVehicleLocal being disabled for multiplayer is there a way to spawn a with createSimpleObject?

Im using

_light = createSimpleObject ["#lightpoint", getPosASL _proj]; or pos = player getRelPos [10, 0]; light = createSimpleObject ["#lightpoint", pos]; and nothing will spawn

tough abyss
#

Is it possible to make a helipad a place to change pylon loadout on planes ingame ?

velvet merlin
#

is doing drawIcon each frame more efficient than using markers and reposition them?

astral dawn
#

It's stated everywhere on wiki that drawicon is not more efficient than markers, but less

#

Also note that drawicon either doesn'r work with GPS or needs special handling at least

still forum
#

@short vine

With the new change of createVehicleLocal being disabled for multiplayer
its not. For one thats a bug and shouldn't have happened, second you can just set "unsafeCVL = 1" in description.ext to enable it.

#

Anyone have Arma open right now?
Does
this = 123 work to set the global variable named "this" ?

frozen knoll
#

this = 123;
systemChat format["%1",this];
//123

winter rose
#

OHMAGAD 😄

#

I hope this still doesn't work though… are commands protected? sqf player = 123;

frozen knoll
#

^nope that doesnt work

#

lol

#

Reserved variable in expression

winter rose
#

VERY good news 😄

#

I hope that this as a global var doesn't override the "this" in init fields for example

still forum
#

no

#

local variables are checked first

#

this is a local variable

winter rose
#

it's a… local global variable? 😄

#

the lack of underscore is triggering me

still forum
#

no

#

local local variable

#

yeah the missing underscore is a little unfortunate

#

Thanks @frozen knoll

errant patio
#

Does anyone know if it's possible to get the unit of a player with the PlayerConnected missionEventHandler?

winter rose
#

if it is in the EH vars, yes? if not, no 😄

errant patio
#

Yeah... there are a lot of vars provided in the EH but nothing so simple as a '_unit' since... i'm fairly sure it fires before there is one. Unsurprising given its name :p

if there is a mission event handler that can give me the player unit after they've spawned in general that'd be better but that doesn't seem to exist? :/

winter rose
#

ah wait yes, because a player connects but is still in the lobby

errant patio
#

I guess if you put that in a waitUntil or something it might work

#

but then it would never return true if the player doesn't actually join the game and just leaves again.. i imagine that's bad

winter rose
#

yep
waitUntil time > 60, huhu

#

you can waitUntil player units are one more, because it would replace an AI

exotic flax
#

PlayerConnected is triggered when someone joins the server (into the lobby), so there is no unit available till he/she selected a slot, went through the briefing phase and fully loaded into the game...

#

Init and/or Respawn are most likely what you should be looking at

hollow thistle
#

If you're using CBA then use XEH init on CAManBase and check via isPlayer

errant patio
#

👀

#

that looks promising

#

it doesn't seem to catch players that are there at the start of the game but that's easy to work around, thanks a bunch :D

hollow thistle
#

You sure? XEH fires immediatly after unit is created.

#

Maybe it's not player controlled at server init for a moment... 🤔

errant patio
#

well i only tested very briefly but i didn't see the systemchats i expected until after i disconnected my client and then reconnected them

plucky wave
#

Quick one, when trying to play a sound file from within a pbo (sound file lives within same .pbo as the function that is executing it) what is the correct file path you should use?

queen cargo
#

the one that works @plucky wave

plucky wave
#

Well.. I guess thats the question, which one works??

still forum
#

just use the full path

#

if you are in a mod pbo anyway

plucky wave
#

Ta

sturdy cape
#

is it just me or has something changed in the engine regarding client object creation or effects (ie particlesource) ?? i have a whole anomaly system that doesnt do any effects since 1.96

still forum
#

createVehicleLocal was accidentally broken

#

is being worked on

#

temporary workaround is to add unsafeCVL=1 in description.ext

exotic flax
sturdy cape
#

Ah OK they did it.thanks

ivory lake
#

its not really a bug and more somethign that wasn't meant to be pushed to stable yet

#

or atleast, not enabled like this

gray drift
#

as far i know: "feature". you have two options... 1st - change your code to createSimpleObject or - if you can't do it - 2nd use unsafeCVL=1 in description.ext or server.cfg.

still forum
#

@exotic flax bug

#

its broken and was thus removed.

#

But it somehow got enabled in the build again. BI must've missed some commits

winter rose
#

git blame 👀

still forum
#

@mild pumice thats a bug, it worked correctly in 1.94. I already forwarded it

errant patio
#

Is it possible to disable the "All Players Died" mission fail with scripting?

exotic flax
#

add respawn to your mission

errant patio
#

so... no

#

oh well.

exotic flax
#

Well... a mission ends when there are no more units... no way to script that out...
Although you can disable the scoreboard, but no idea if that also disabled the "WASTED" screen

astral dawn
#

You mean in sp?

velvet merlin
#

use HD to script death

errant patio
#

HD?

velvet merlin
#

total damage > 0.9 => black out + setPos

#

handleDamage EH

exotic flax
errant patio
#

right now i'm bypassing the entire respawn system using selectPlayer and it works fine, but it has to be done immediately or the mission fail sequence starts (even though the player is alive again)

mild pumice
#

@still forum hmm ok , so i'm not crazy lol thanks

austere granite
#

playerKilledScript.sqs sort of things allow you to get rid of that behavior

still forum
astral dawn
#

Can you make a command to tweak scheduler's time frame (3ms to something different)?

#

I neeed those milliseconds :3

still forum
#

Already exists

astral dawn
#

:O

#

You mean it's in your list to be pushed into the person who approves this at BI? (like the list above)

still forum
#

no

#

already in the game

astral dawn
#

what's the command then?

still forum
astral dawn
#

😆 It's clearly not configurable and can't be used on a client

still forum
#

good nuff for me ¯_(ツ)_/¯

vernal mural
#

Isn't there a "download data" function from End Game, which is available for use in other missions ?

sturdy cape
#

´nother one for the pros: ```
23:45:11 Performance warning: SimpleSerialization::Read '' is using type of ,'TEXT' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types

#

or to say it in different words, what can i do to find the cause?

queen cargo
#

Long Story short: use strings, not Text

fleet bear
#

Hello! Need to do the following: Server asks the specific client (id is known) to send to server the value of a certain variable. That variable (from acemod) is local to the client, so simple getVariable doesn't work. Sorry if it is complicated) i suppose I have to do several remoteExec or something like thah

astral dawn
#

Yes that's how you do it for the problem you described

velvet merlin
#

recommended practice to add a sleep to any waitUntil condition that has non basic condition and needs no quick activation to the event?

still forum
#

wtf does this want to tell me ???
nothing. A note for devs.

#

@fleet bear remoteExec a script to the client, the script itself remoteExec's the variable back to the server.

#

@velvet merlin you mean if thats a good idea? yes it is

velvet merlin
#
_conversation = [source,target,textSet,sentence,delay] spawn LIB_fnc_conversationHandler;
waitUntil {scriptDone _conversation};```
#

having a bit of a brain freeze here.. how to solve this with the new 1.96 check: Error Undefined behavior: waitUntil returned nil. True or false expected.

winter rose
#

well, scriptDone should return a boolean whatever happens 😐

#

maybe use isNull instead @velvet merlin

velvet merlin
#

ty

#

@still forum do you have advice please?

still forum
#

I cannot see how that could return nil

#

if scriptDone returns nil, thats a bug

#

it should only return nil if _conversation is also nil, which in your example is only possible if LIB_fnc_conversationHandler is nil

velvet merlin
#

hm will double check, but it worked pre 1.96

quaint ivy
#

Does anyone know if SQF supports recursive functions?

hollow thistle
#

What's why touching so old api just for sake of changing it is retarded. But what do I know 🤷

#

Does anyone know if SQF supports recursive functions?
yes it does.

quaint ivy
#

thanks

hollow thistle
#

||_a = { call _a }; call _a;||

still forum
#

Does anyone know if SQF supports recursive functions?
yes but stack overflow is a thing

fleet bear
#

is this script correct? it executes on the server on Eh EntityKilled


if (_killer == _victim) then {
        _killer = _victim getVariable ["myRealKiller", _killer];} else {_killer};  ```
still forum
#

looks correct

#

do you think theres anything wrong with it?

winter rose
#

private _victim = (...)

queen cargo
quaint ivy
#

Thanks for the info, I just needed to know if it's possible to do it, not how to do it.

fleet bear
#

@still forum Seems it doen't work right.. trying to overcome ACE+ EntityKilled bug

still forum
#

can you show full code?

fleet bear
#

now testing this one

#

hope will work)

still forum
#

looks good

fleet bear
#

it works!))

dire hearth
#

Hey, i'm trying to create a script to search cars, i'm using the ace progressbar but the problem I have is that while the progressbar works the items are not added to the car, using this code:

#
if (_random > 90) then {

[3, [_target], {_target addItemCargoGlobal ["ARP_Objects_Weed_M", 1]; hint "You have found some illegal drugs on the backseat";}, {hint "Failure!"}, "Searching car"] call ace_common_fnc_progressBar;
 
};
#

Anyone has any clue?

#

the _target comes from code inserted into our spawning scripts

#
    _action = ["sr_search", "Search car", "",{_target call fw_fnc_search;}, {true}] call ace_interact_menu_fnc_createAction;
    [_veh, 0, ["ACE_MainActions"], _action] spawn ace_interact_menu_fnc_addActionToObject;
random loom
#
if (_random > 90) then {
    
    [
        3, 
        [_target],
         {
            _target addItemCargoGlobal ["ARP_Objects_Weed_M", 1]; 
            hint "You have found some illegal drugs on the backseat";
        }, 
        {
            hint "Failure!"
        }, 
        "Searching car"
    ] call ace_common_fnc_progressBar;
 
};
#
{
    _target addItemCargoGlobal ["ARP_Objects_Weed_M", 1]; 
    hint "You have found some illegal drugs on the backseat";
}
#

_target is not defined here

#

[_target] from the line above is passed to that script in _this

#

Correct usage would be

{
    params ["_target"];
     _target addItemCargoGlobal ["ARP_Objects_Weed_M", 1]; 
    hint "You have found some illegal drugs on the backseat";
}
#

or (_this # 0)

#

In fact you're running into the same issue twice here

dire hearth
#

Yeah I was thinking that as well..

#

I'm already going wrong with calling the function right?

random loom
#

Yeah the parameters passed is also stored in _this

dire hearth
#

I call it with _target call ... should be (_this select 1) call ... right?

random loom
#

Arrays start at 0

dire hearth
#

right 0

still forum
#

I call it with _target call ... should be (_this select 1) call ... right? no.

#

_target is a parameter coming from the ace action

dire hearth
#

ok so I just need to define the parameter again in the code executing when the progressbar completes?

still forum
#

Yes, as Freddo posted. Just that

dire hearth
#

Hmm, I just seem to be getting generic errors

#
if (_random > 0) then {

[3, [_target], {

params ["_target"];
_target addItemCargoGlobal ["ARP_Objects_Weed_M", 1];
 hint "You have found some illegal drugs on the backseat";
 
}, {hint "Failure!"}, "Searching car"] call ace_common_fnc_progressBar;
 
};