#arma3_scripting

1 messages Β· Page 707 of 1

tight cloak
#

google is fren

spark turret
#

ah sorry i meant targeted AA

#

not just random

tight cloak
#

are you using any modules such as zen etc

#

that being the zeus mod, if your doing it in zeus you can just give the turrets infinite ammo and make them "suppress" a target but that can be annoying

#

is the target a moving object?

spark turret
#

yeah helicopter

copper raven
#
if (vehArr findIf {crew _x isEqualTo []} != -1) then {
  // stuff
}
weak obsidian
#

Ofc isequalto for the empty array comparison, cheers. )

spark turret
#

is there a way to increase the inaccuracy of an AI unit/gun? setting its aiming skill to zero is still to much

winter rose
mossy lark
#

so through adding some debug messages via systemChat I think I've figured out what's going on... it looks like onPlayerRespawn.sqf is being executed when the Zeus player spawns in, and then just... stays open, because the debug message does not repeat when the players die/respawn so long as there's a Zeus player in place

is there a trigger I should be adding in here to ensure the script only executes when the player actually dies or spawns?

#

also hi bassbeard

wet shadow
little raptor
mossy lark
#

hm, i was unaware that it executed locally... i suppose that blows that theory then, and still unclear why the body is being immediately hidden on death as opposed to respawn

#

might just add a sleep and call it a day

gloomy aspen
#

Hey guys, could somebody please tell me how I might add a short fade to black and back in when changing gear using this? Cant quite get my head around adding cutText or title into it :/


this addAction ["B20A - Multicam SI","scripts\b20amc.sqf",[],1,false,true,"","_this distance _target < 2"]; 
winter rose
#

what did you try so far?

gloomy aspen
#
cutText ["", "BLACK IN", 2];

cutText ["", "BLACK OUT", 2];```

I think this is what id like to add, but my mind boggles when thinking of *where* to put it
winter rose
#

at the beginning, Black out
in the middle, delay for black out to set in
at the end, Black in

grand idol
#

Running the following locally in the admin console returns "ANY" in the 2nd hint. Any ideas why? I've confirmed read and write work when run server-side.

[] spawn {
    _BSFplayer = getPlayerUID player;
    ["InfoTitleAndText", ["DEBUG", format["Player UID is%1", _BSFplayer]]] call ExileClient_gui_toaster_addTemplateToast;

    UISleep 1;

    _resistanceDB = format["getEVR_Res:%1", _BSFplayer] call ExileServer_system_database_query_selectSingle;
    ["InfoTitleAndText", ["DEBUG", format["Resistance from DB is %1", _resistanceDB]]] call ExileClient_gui_toaster_addTemplateToast;
};

my .ini entry

[getEVR_Res]
SQL1_1 = SELECT reborn_evr_res FROM account WHERE uid = ?
SQL1_INPUTS = 1
OUTPUT = 1
winter rose
grand idol
#

Oops, I actually meant to post this over at the Exile forum.

winter rose
grand idol
#

Ok, so a more general question regarding variables and database access. As far as I can tell, all database access has to happen server-side. If a client-side script needs a DB value, I could call a server-side script to access the DB and populate a variable but how do you get that value back to the client? This is an area that I'm just dipping my toes into.

hexed crown
#

Under normal circumstances, you'd use a return line in the script. I don't know if that works in ARMA though.

little raptor
hexed crown
#

When it's said Leopard20 is typing... for the past 5 minutes. meowsweats

little raptor
#
My_RemoteExecs = []; //init on client
//fn_sendExec
params ["_code", "_params", "_returnCode"];
isNil {
  _execID = My_RemoteExecs pushBack _returnCode;
  [[_params, _code, _execID], {
    
    [_this#0 call _this#1, _this#2] remoteExec ["My_fnc_receiveExec", remoteExecutedOwner];
    
  }] remoteExec ["call", ...];
};
//fn_receiveExec
params ["_result", "_execId"];

_result call My_RemoteExecs#_execID;
My_RemoteExecs set [_execId, -1];

if (count (My_RemoteExecs - [-1]) == 0) then { //all done
  My_RemoteExecs = [];
}
little raptor
hexed crown
#

I know.

little raptor
hexed crown
#

I always type it into notepad then copy paste it over.

grand idol
#

Awesome guys. Thanks. That should get me going.

hexed crown
leaden elbow
#

Hi I'm quite new to scripting in arma and I have no idea how to do one thing.
So i have few triggers on map and i want that when any player enters any area scrip sqf will activate and it will know location of that trigger (so it can spawn there car for example)

Sory for my english

little raptor
leaden elbow
#

Position, where trigger is on map

little raptor
#

oh right nvm

#

so it can spawn there car for example

little raptor
#

executing the script?

#

spawning the car?

#

the trigger position?

leaden elbow
leaden elbow
little raptor
#

the simplest way to execute scripts is execVM

leaden elbow
#

i tried but it didnt work

little raptor
#

what did you try?

#

show me the code

leaden elbow
#

second, ill open arma again

#

oh

#

I lost it

#

while trying difrent stuff

#

handle = [(getPos thisTrigger)]execVM "loot.sqf";
Something similar to this

little raptor
#

meowsweats
well anyway, this is how you execute scripts:

execVM "myScript.sqf"

the path starts from the mission folder. so in the above example the script is inside the mission folder itself (not any subfolders)
to do what you want, you have to pass the trigger object to the script. this is how it's done:

[thisTrigger] execVM "myScript.sqf"

thisTrigger is a magic variable inside trigger activation statement that contains the current trigger object.
inside the script, this is how you receive it:

params ["_myTrigger"];

_myTrigger is a local variable. you can name it whatever you want.
to get the trigger position, you can use getPosATL for example

leaden elbow
#

in trigger input

little raptor
#

so what's the problem then?

little raptor
#

and you'll have the pos you wanted

leaden elbow
#

and then write _pos when i want to use it in script?

little raptor
#

yes

leaden elbow
#

ok

#

i don't even got hint when running script

#

so something is wrong

little raptor
#

are you sure the trigger activates at all?

little raptor
#

if you don't see the message the trigger doesn't activate at all

leaden elbow
little raptor
leaden elbow
#

i'm not sure

#

i worked with them few times and they worked

little raptor
#

in DM

leaden elbow
#

ok

#

but my game is in polish

little raptor
#

it's fine

leaden elbow
#

so trigger work

#

but rest dosn't

little raptor
#

show me the script now

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
leaden elbow
#
_unit = _this select 0;
_addActionID = _this select 2;

_unit removeAction _addActionID;
hint "placing";
// _markerPos = _this;
params ["_pos"];
#

it was from video tutorial from YT

little raptor
#

the problem is that there is no unit anymore

#

in other words, _this is the [getPos thisTrigger] array you passed to the script

#

_this is a magic variable
which is what you passed to the script

little raptor
#

it's part of an addAction code

#

Parameters array passed to the script upon activation in _this variable is:

params ["_target", "_caller", "_actionId", "_arguments"];
leaden elbow
#

those are rest of orginal code

#

i didn't know how vital they are

#

so i didn't deleted them

little raptor
#

you should've seen an error

#

didn't you?

leaden elbow
#

i didn't

little raptor
#

then maybe it doesn't execute it at all? think_turtle

#

place the hint at the top

leaden elbow
#

no hint or error even when it is at top

little raptor
#

did you remove the trigger hints to be sure?

leaden elbow
#

yes

little raptor
#

have you enabled file extensions in windows explorer?

leaden elbow
#

newer mind

#

im just dumb

#

there is both top hint and error

#

i had wrong name of script

#

sory for problems but i have to go to sleep, i'll try to fix it toomorow

desert palm
#

what is the format of writing classnames in modules?

desert palm
#

I_Spotter_F, I_medic_F, I_Soldier_AR_F

#

like that

desert palm
winter rose
#

"class1", "class2" most likely

#

wait, no

#

it says "no quotations"

winter rose
desert palm
#

oh what if i would only put a 1 thing ex. I_Soldier_AR_F would I still put a coma?

#

and if I name my player with a variable name would it work if I put the variable name that I named my player instead?

winter rose
#

try and thou shalt see

#

and I am not sure a var name for a type of uniform will work, but try anyway
for the lolz

desert palm
#

I dont know if what im doing is right but i think its wrong bcoz it doesnt work, ill send a screen shot

#

oops

desert palm
winter rose
#

class - names

desert palm
winter rose
#

a classname is the name of a class
found in config

desert palm
#

oh i understand now ok copy

winter rose
#

so "B_Soldier_F" is a soldier's class
yep πŸ™‚

desert palm
#

imma try that

#

thanks lou

spark turret
#

So i tried making a script that lets HMGs fire wildly at enemy aircraft for ambience with little threat, attached a cba target at an offset and let ai fire at it.
It worked fine for like 2h, then upon starting the mission arma just gets stuck loading and idk why lol

#

FML

desert palm
winter rose
#

CfgVehicles

little raptor
spark turret
#

Hm possibly

#

Why would that matter, its suspendable context?

little raptor
desert palm
winter rose
#

…it is

desert palm
winter rose
#

well… unless it is a classname (which it isn't), it should not be there

desert palm
#

im so fc*n dumb im sorry hahahaha

winter rose
#

hi sorry, I'm dad!

spark turret
spark turret
#

Ill test again once im home, if it still breaks ill post the code here

cinder tree
#

morning/evening all...
I'm trying to build a scenario where an action on a ladder teleports players to an "underground" bunker which is off map. Is the action "ladderdown" still valid or a legacy Arma2 thing? I can't seem to get it working, the player just seems to glitch onto the nearest ladder and can't move.

Any suggestions on the best way to achieve this effect? Teleporting them to base of the ladder in the basement is simple, but less interactive. I was hoping to get them on the ladder and finish the climb down.

versed widget
#

is running a code in unscheduled environment always faster than in scheduled one ?
i did performance test and it was like this unscheduled "0.0074ms", scheduled "0.0052ms" meowhuh

little raptor
#

you probably ended up measuring the performance of spawn itself

little raptor
#

scheduled scripts may get suspended by the scheduler and may take longer to finish

#

but unless you use slow commands in them they won't slow down the game or cause freezes

versed widget
#

yeah ive noticed that they run smooth without spikes πŸ‘

little raptor
#

use vehicle player instead of player

#

@cinder tree so do this:

  1. create a dummy unit for the new player
  2. add an animStateChanged event handler to the actual player. for the code, check !("ladder" in toLowerANSI _anim) and switch back to the old player. then delete the dummy
  3. selectPlayer that dummy unit
  4. play the action on the actual player
cinder tree
#

thanks Leopard
unit won't be AI, only players...
not sure what you mean by a new player? A player would walk up to the ladder, mouse wheel to get actions and choose "climb down"

little raptor
#

I already explained why:

according to the wiki if the unit is an AI they will climb by themselves

#

when you switch to the dummy, your player will become an AI

#

and will (hopefully) climb by itself

little raptor
cinder tree
#

which wiki are you looking at? the Arma 3 Actions?

little raptor
#

yes

little raptor
# cinder tree which wiki are you looking at? the Arma 3 Actions?

LadderDown
Description: Causes a person to play an animation as if mounting the top of a ladder, then instantly teleport onto the specified ladder in the specified position. If the person is controlled by AI, they will automatically climb up or down the ladder.

cinder tree
#

ahh.. and: the person will become stuck in the ladder mounting animation state

#

which is what is happening

little raptor
cinder tree
#

not stuck

#

i would like to them to get off the ladder πŸ™‚

little raptor
#

then they have to climb by themselves

#

the command already does that

#

Β―_(ツ)_/Β―

slow isle
#

Why is my safezone script not working?

IN TRIGGER
Anybody
Present
Repeatable

CONDITION
thisList

ON ACTIVATION
{   
    if (side _x == east) then { 
        _x allowDamage false; 
        }  
    else { 
        systemChat "!!!LEAVE THE ENEMY BASE IMMEDIATELY!!!"; 
        }; 
} forEach thisList;

ON DEACTIVATION
{   
    if (side _x == east) then { 
        _x allowDamage true; 
        }  
    else { 
        systemChat "LEFT THE ENEMY BASE"; 
        }; 
} forEach thisList;
little raptor
cinder tree
#

lack of high vis vests

little raptor
#

???

finite sundial
cinder tree
#

safezone

#

sigh

slow isle
#

I want to make a safezone trigger for multiple entities but I'm doing something wrong and I don't know what

little raptor
#

if anyone else gets in it won't trigger again

slow isle
#

oh

#

okay

#

what do I need to do

#

marker ?

little raptor
#

you should avoid using triggers and use loops instead

#

or put a spawn inside the trigger

#

if you don't want to use loops

slow isle
#

ty

#

I'm actually pretty confused. What should be the structure to detect new entities that enter the trigger

little raptor
# slow isle ty

on activation:

[thisTrigger] spawn {
    params ["_trigger"];
    _units = [];
    while {triggerActivated _trigger} do {
        _list = list _trigger;
        _new = _list - _units;
        _old = _units - _list;
        {
            _x allowDamage false; 
        } forEach _new;
        {
            _x allowDamage true; 
        } forEach _old;
        _units = _list;
        sleep 1;
    };
    
    {
      _x allowDamage true; 
    } forEach _units;
};
slow isle
#

thank you!

little raptor
#

no need for deactivation

#

yes, but as I said, it only triggers once for the first unit that enters

#

it won't trigger for new units if it's already active

#

@slow isle fixed an error

slow isle
#

this script would work if there were 2 safezones right?

tropic mirage
#

No you can not. If it's active how are you meant to make it more active. Once its on the only thing you can do is loop through everyone in the trigger via a script

finite sundial
little raptor
#

yes

slow isle
#

here's my scenario:
2 safezones - blufor and opfor

I want to make all units in the blufor base invincible and the same for opfor

when an opfor unit gets inside of the blufor base, he wouldn't be invincible and would have a hint "!!!LEAVE THE ENEMY BASE IMMEDIATELY!!!"

little raptor
#

you can put it in an external script

#

and execVM it instead of spawn

slow isle
#

it's possible for me to rewrite it right

little raptor
slow isle
#

what i don't understand and is concerning me is if it refers to all external units or only the ones leaving

tropic mirage
slow isle
#

just making sure that it's not refered to every single unit outside of the safezone to disable invincibility

little raptor
slow isle
#

I tried but I'm having trouble

finite sundial
#
        {
            _x allowDamage false; 
        } forEach _new;

in here you can put an if statement to check the side

slow isle
#

Im new to arma sql

little raptor
#

it's sqf

slow isle
#

hahahah

#

you get what I mean

#

I can write basic stuff but I don't understand the magic variables properly yet and I see that you've used them

#

the ones with the _

little raptor
slow isle
#

and that's why I'm asking

#

OOOH

#

Okay

#

that makes things clear

little raptor
#

_ is for local variables

slow isle
#

i see

#

thank you

boreal junco
#

0 setfog 0;

#

it does not remov ethe fog

little raptor
boreal junco
#

ok

brisk harness
#

What that script line that will instantly set a speed? If you set that to 0 will it instantly stop? If that is true, if an aircraft pass the trigger will it drop to the ground given engine is off?

winter rose
little raptor
#

looks like it works instantly

brisk harness
#

Sweet thx!

mossy lark
# little raptor > it looks like onPlayerRespawn.sqf is being executed when the Zeus player spaw...

I ended up figuring this out, fwiw.

Turns out onPlayerRespawn.sqf executes when the player spawns, and while one would expect, for lack of an _oldBody for the hideBody to execute on, it just wouldn't... it instead executes on the player right there. Because of the way hideBody works, that means as soon as the player dies, he is hidden, because he's already under the effect of hideBody

The fix was to add a wait until the player dies, then a second wait until the player is alive, in order to ensure hideBody doesn't fire until the player has actually died and come back.

params ["_oldUnit"];
waitUntil { not alive player };
waitUntil { alive player };
hideBody _oldUnit;
#

this actually seems to be a bug imho, since the documentation contraindicates this behavior. it specifically says that if respawnOnStart = 1; it will fire on the initial spawn, but if respawnOnStart = 0;, it will not, and yet it does so anyway.

#

wait, i'm mistaken. it said -1

#

welp, i guess it all came down to that then

#

Β―_(ツ)_/Β―

grand idol
#

is there a preference between using
private[_var1,_var1,var3]; and
params[_var1,_var1,var3]; ?

#

or is there any functional difference?

winter rose
grand idol
#

I realize I didn't format the variables but its private vs params that I'm curious about.

winter rose
#
private ["_var1"]; // scopes _var1 in this scope
private _var1 = 0; // scopes and initialises value
params ["_var1"];   // scopes _var1 and initialises value using _this
#

basically,

private "_var1";
// and
private ["_var1", "_var2"];
```are generally obsolete
grand idol
#

Perfect. Thanks for clarifying.

cosmic lichen
uncut sphinx
#

Isn't private "_var"; useful if you want to give the variable a value in some lower scope? I do that occasionally unless there's a better solution

winter rose
radiant yacht
#

so, someone sent me this script to make a civie have malaria (part of the old man expansion), but i can't figure out where or how i execute this
_pos1 = [3293.52,2931.15,0]; _man1 = createAgent ["C_man_polo_1_F_afro_sick", _pos1, [], 0, "NONE"]; _man1 setface "AsianHead_A3_04_sick"; _man1 setHit ["Head",0.5];

do you guys have any idea? it gives a variable name in global space error thing in eden so that ait in i think

winter rose
#

don't put that in init fields.

cosmic lichen
#
if (isServer) then 
{
 _pos1 = [3982.66,2883.65,0]; 
 _man1 = createAgent ["C_man_polo_1_F_afro_sick", _pos1, [], 0, "NONE"]; 
 _man1 setface "AsianHead_A3_04_sick"; 
 _man1 setHit ["Head",0.5];
};

You can use the Init attribute in Eden Editor -> General Attributes

#

@radiant yacht

fair drum
#

@cosmic lichen saw in a screen of yours the other day that you have a trigger interval option in your editor. is that just a part of a unreleased update 3den enhanced?

radiant yacht
cosmic lichen
#

_man1 addUniform "youClass"; IIRC

cosmic lichen
hushed tendon
#

When execVM a script from initPlayerLocal.sqf is the player passed? and if so how?

cosmic lichen
#

addUniform*

fair drum
#

its not really "passed" it just already exists

hushed tendon
cosmic lichen
#

use player

#

it's initPlayerLocal.sqf

#

which is always executed local to the player

fair drum
#

if you are using player in your diary records script, its going to apply it to that player's machine when it runs

#

now if you use something like _unit then yes, you would have to pass something to that

hushed tendon
#

So just to make sure when I [] execVM "scripts\createDiaryRecords.sqf"; from initPlayerLocal.sqf using player in createDiaryRecords.sqf is fine for MP

cosmic lichen
#

yes

winter rose
#

yes, because initPlayerLocal.sqf is run locally on a player machine therefore player will return the wanted unit

hushed tendon
#

Alright thanks guys. Idk why but I get really confused with figuring out what is local vs global when I pass stuff

winter rose
#
if (not local player) exitWith
{
  systemChat "you are in deep trouble";
};
cosmic lichen
#

Just sacrifice a goat to the Arma 3 god and it will all become clear(er).

winter rose
cosmic lichen
#

Yeah, was thinking about that too.

winter rose
#

🐐 MillerTarget

cosmic lichen
#

It could go horribly wrong though

winter rose
cosmic lichen
#

ET? is that you

undone flower
hushed tendon
crude vigil
tough abyss
digital rover
#

The sacrifices clearly work, they're the only structures left with real chairs!

tight cloak
#

got a question ive had nocking around for a while, would it be possible to force respawn players that are dead at say a checkpoint in a mission? (ingoring respawn timer)

#

say a player is dead, they have 5 minutes until respawn but then a buddy finishes the objective, would it be possible to immediately force respawn them on their buddies position

uncut sphinx
#

you could set their respawn time to 0?

#

I think that's the simplest way to do it

digital rover
#

Yeah you can remoteExec the respawn timer to zero and then immediately set it back to what it was

drifting sky
#

Is there a way to play a 3d sound with no distance falloff? What If I set the "distance" parameter to a huge value, like a million?

crude vigil
drifting sky
#

I want the direction compnent, just not the distance falloff

#

I'm going to try setting the "distance" argument to a million. But if that doesn't work, then I'll need to figure out another way.

fair drum
#

usually you just increase the config sound volume level, but even that has a limit

crude vigil
fair drum
#

ok, for those of you using sqflint on VSC, how do I disable the specific warning check for Possibly undefined variable blahblahblah

drifting sky
#

Does anybody know what kind of falloff model arma2 uses for 3d sounds? Linear?

#

i.e., gain = clamp((max - dist)/max,0,1) ?

winter rose
tight cloak
#

So I just fetch all dead players and set their respawn time to 0, then get the position of an alive player and teleport them there

#

Is it also possible to sort that by group also, so a specific teams dead players say

digital rover
#

Yes, make sure to use the group of the player

#

As dead units turn into civilians

robust tiger
tight cloak
#

I want to see about say. When a player dies, their squad can say throw a red flare and then they are respawns by a heli insert then if its possible

drifting sky
#

@robust tiger I don't know. I have to use say3d because it's a local sound. THe wiki doesn't define what happens if you set the max dist to zero for this function.

robust tiger
drifting sky
#

Well, I've actually had to scrap my original plan becuase there's no volume or gain parameter for say3d. So instead, what I'm doing is setting the max distance based on what volume I want. max_distance = sound_distance/(1-desired_volume)

robust tiger
#

oh right, say3d

drifting sky
#

But this max_distance = sound_distance/(1-desired_volume) presumes the volume falloff is linear: 1 at zero distance, and 0 at max distance.

#

The problem is I don't know if it IS linear.

winter rose
#

only a dev would know… πŸ‘€

fair drum
#

sound energy is subject to inverse square law so write your own =p

drifting sky
#

I need to know how it's implemented in arma, given a max distance parameter

fair drum
#

is what you are trying to do able to be perceived by your players for the work you are attempting to put in?

#

just crank up the volume and find what's comfortable πŸ˜„

robust tiger
drifting sky
#

I'm trying to set the volume to a certain level.

#

In the tests I just did, it doesn't seem to use a linear falloff model

#

in which case I presume max distance is just a totally arbitrary distance beyond which the sound just doesn't play.

#

regardless of the volume due to falloff

#

So, with say3D, it appears the only way I have to control the volume IS to move the source closer or farther away.

#

what a pain in the ass

#

So I guess distance from player needs to be: distance = sqrt(1/gain)

#

Presuming arma falloff is inv distance squared

#

Actually the "max distance" argument doesn't seem to work in say3D.

#

I'm hearing the sound at greater than the max distance.

fair drum
#

@cosmic lichen hit up your github with a script error involving "ENH_groupMarkers"

brisk harness
#

idk why i have to be special but im wanting to damaged an rhs c130 but the set damage system in the editor dosent seem to do specific damage just whole air craft seems to work. how do i damage every thing but control surfaces and make it not explode?

fossil peak
#

https://i.imgur.com/PZRue9h.jpg I'm running into this issue, problem is line 14 doesn't even exist anymore. I assume this is a cache issue. Anyone know how I can make it update the cache?

brisk harness
#

lol now it says i need a ]

#

_vehicle setHit ["hitEngine2" "Hithull" "Hitengine_l1" "Hitengine_l2" "Hitengine_r1" "Hitengine_r2" "Hitengine", 1.0];

bitter magnet
#

never used that command, but try doing them one by one, like _vehicle setHit ["hitEngine2", 1.0]; and so on.

fair drum
#

look closely

brisk harness
#

im a week new to editor lol

fair drum
#

well, you aren't going with the syntax of the command

brisk harness
#

i have big dreams

#

yeah wiki dosnt really spell out very easy

fair drum
#

so you can't set all of them with a single use of the command

#

you need to make it iterate through all the parts

#

so either you can list them all out individually, or use apply or a forEach

#

for example...

#
private _selection = [
    "selectionname1",
    "selectionname2",
    "selectionname3"
];

_selection apply {
    _vehicle setHit [_x, 1.0]
};
#

or

#
private _selection = [
    "selectionname1",
    "selectionname2",
    "selectionname3"
];

{
    _vehicle setHit [_x, 1.0]
} forEach _selection;
fair drum
fossil peak
#

Can't at the moment or for a bit but I appreciate the response

brisk harness
#

tryed both dosent seem to work

private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];

{
_selection apply {
_vehicle setHit [_x, 1.0]
};

fair drum
#

count how many squiggle brackets you have

brisk harness
#

it let me hit the ok button but it didnt proform task

fair drum
#

listen to what I'm am saying lol. how many squiggle brackets do you have?

brisk harness
#

2

#

i fixed it and it let me hit ok but befor it would allow mw to leave the trig screen without fixing it

#

i re tyed the 2nd code too

private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];

{
_vehicle setHit [_x, 1.0]
} forEach _selection;

hushed tendon
#

Is this correct? It looks fine from the documentation but it doesn't show up for me.
Path: initPlayerLocal.sqf > [] execVM "scripts\createDiaryRecords.sqf"; > createDiaryRecords.sqf

createDiaryRecords.sqf

player createDiaryRecord ["=== Important Info ===", 
    ["FOB States",
        "<t font='PuristaMedium'>During the Campaign campsites, FOBs, and COPs will show up as we progress with removing hostile forces from the region.</t><br/>
        <br/>
        <t font='PuristaBold'>Status of U.S positions</t><br/>
        <img image='images\FOBstates.jpeg' width='160' height='200'/>"
    ], taskNull, "",false];
fair drum
#

it looks like you are using hitpoint names

fair drum
proper loom
#

Is there a way to make an object give off ambient light?

fair drum
brisk harness
#

like this>?

private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];

{
_selection apply
_vehicle setHitpointDamage [_x, 1.0]
};

hushed tendon
fair drum
fair drum
brisk harness
#

i got 1 pair of { }

fair drum
#

look at the syntax of apply

proper loom
#

Sorry i'm new at this. Are the light points put in the objects Config file?

fair drum
proper loom
fair drum
brisk harness
#

private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];

_selection apply {
_vehicle setHitpointDamage [_x, 1.0]
};

???

proper loom
proper loom
#

Thank you : )

hushed tendon
# fair drum some of them are annoying to find out which one is which. diary uses the <font><...

This is correct right? Cause it still won't show up

player createDiaryRecord ["=== Important Info ===", 
    ["FOB States",
        "<font face='PuristaMedium'>During the Campaign campsites, FOBs, and COPs will show up as we progress with removing hostile forces from the region.</font><br/>
        <br/>
        <font face='PuristaBold'>Status of U.S positions</font><br/>
        <img image='images\FOBstates.jpeg' width='160' height='200'/>"
    ], taskNull, "",false];
brisk harness
#

i did global space error

fair drum
#

what are you placing the code in?

brisk harness
#

...... init

fair drum
#

then how are you grabbing _vehicle then?

#

whats the full full full code

brisk harness
#

private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];

_selection apply {
_vehicle setHitpointDamage [_x, 1.0]
};

#

the full full code

fair drum
#

well _vehicle is undefined as well then

brisk harness
#

ripp

fair drum
#

don't give up, keep sluggin. i'm up for a few more hours

brisk harness
#

so do : c130 setHitpointDamage [_x, 1.0]

#

or wahatever rfs calls it

#

rhs_c130j

fair drum
#
1. Open the attributes menu on the vehicle
2. At the top you see a variable name box, name it something
3. Open up the mission folder and create a file named initServer.sqf
4. Paste the above code replacing _vehicle for your variable name in step 2 (no underscore)
5. Profit as it run only on the server (what you want)
brisk harness
#

how do i set that up to a trigger then?

fair drum
#

i didn't know you wanted that in a trigger...

#

disregard

#

standby in a MWO game

brisk harness
#

call{_handle = [(thisList select 0)] execVM "damage.sqf";}

#

?

#

idk if this is correct i stole it from something else, im not sure what the variables do lol.... i know enough to be dangerous

fair drum
#

you know enough that nothing will work lol...

//Place in trigger
[] execVM "damage.sqf";
//Damage.sqf
if !(isServer) exitWith {};

private _hitPoint = [
    "hitEngine2",
    "Hitengine",
    "Hithull",
    "Hitengine_l1",
    "Hitengine_l2",
    "Hitengine_r1",
    "Hitengine_r2"
];

_hitPoint apply {
    c130VariableNameFromStep2 setHitpointDamage [_x, 1.0]
};
brisk harness
#

sorry i still cant seem to make it work

#

when u deactivate a trigger that means u left the zone right?

fair drum
#

its based on the activation condition no longer being true

#

so if the condition is just this then its based on the activation settings you have above in the dropdown menu

#

post a pic of the trigger menu

brisk harness
#

omg it was my activation code

#

i put the damage.sqf in the deactivation because it was giving me errors in the activation. but my effects.sqf was erroring mid script hanging the damage.sqf

#

question whats the difference in thses?

call{_handle = [(thisList select 0)] execVM "damage.sqf";}

vs

[] execVM "damage.sqf";

sharp grotto
#

Anyone knows better way to realise "first person zones" on a server where third person is enabled ?
I run a thread every 0.1 seconds that executes if you are in a trigger area.

if (cameraView isEqualTo "EXTERNAL") then
{
    player switchCamera "INTERNAL";
};

Which is still not fast enough, you can still spam it and gain a quick third person view.
I could block the button (keycode for Enter) but due to keybinding settings you could just use a different button. πŸ€”

fair drum
fair drum
#

CBA has a player view handler i believe. i think its under player event handler its a vision mode handler for thermans/NVG etc

sharp grotto
#

Thanks guys, i will try my luck πŸ™‚

little raptor
sharp grotto
fair drum
sharp grotto
#

Still to slow for my taste. Just the option to block the "cameraViewChange action" on demand would be perfect.

fair drum
#

how is an average of 40 frames per second too slow for you?

#

and it fires on every frame...

little raptor
#

it's called "personView"

sharp grotto
# fair drum and it fires on every frame...

Maybe its my old PC and the fact that i run the server on the same machine (test server) but i can still get a glimpse of the third person view.
And i like to make cheesing as hard as possible πŸ˜†

Thanks Leopard20, i will check it πŸ‘

sharp grotto
fair drum
#

what you got in final?

#

aight I dig it

little raptor
#

that's the wrong way to do it

_this select 1 in actionKeys "personView"
what if the user is using combo keys, or controller, or mouse, etc.?

#

use inputAction "personView" > 0 instead

vernal venture
#

Anybody got an example of how to put addAction on a unit have it just output globalChat?

little raptor
#

ExileClientForceFirstPersonModule
set the variable on findDisplay 46 instead
it doesn't have the same life time as the mission namespace

vernal venture
# little raptor wdym?

I mean, what I'm trying isn't working. I think I have the addAction messed up.

this addAction["Talk", {_this globalChat "Hello."},"",1,true,false,"","_this distance _target < 3"];```
little raptor
#

_this is not an object inside the addAction code

#

it's an array

vernal venture
#

Right, so the question is, what does _this need to be changed to to make that work?

#

this and _this aren't going to work in there, right?

little raptor
vernal venture
#

Wiki says _soldierOne globalChat "Show this text";

little raptor
fair drum
#

ill give you a bigger hint. look at the params of the addAction on the wiki

little raptor
#

no

#

use setVariable

#

Guess for performance reasons ?

#

no

#

like I said:

it (Display # 46) doesn't have the same life time as the mission namespace

sharp grotto
#

so it could stop working after while ?

#

πŸ€·β€β™‚οΈ sry iam stupid and never had issues the way i did

little raptor
#

when you restart the mission, display 46 doesn't get recreated
but the mission namespace will be cleared

sharp grotto
#

It's for Exile, we don't restart the mission. We do a full server restart after 3 hours runtime.

little raptor
#

your choice

#
if (findDisplay 46 getVariable ["ExileClientForceFirstPersonModule", -1] == -1) then {
  _EH = findDisplay 46 displayAddEventHandler ...;
  findDisplay 46 setVariable ["ExileClientForceFirstPersonModule", _EH];
};
sharp grotto
#

Thanks i will try and compare and look for issues the way i did it. πŸ‘

little raptor
vernal venture
#

I actually got it working with _this select 0

fair drum
#

essentially the same thing as params ["_unit"] just more wordy

atomic crystal
#

How do I add another eventhandler to change the sound back from 0.2 to 1 by pressing the H key again? Here's the code I have now:


( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
  if (inputAction "help" > 0) then {
     hintSilent "Earplugs In";
    1 fadeSound 0.2;
  } 
}]; ```
fair drum
atomic crystal
#

I tried that and was having syntax errors and didn't know why. I'll keep trying

fair drum
#

well post what you had then

atomic crystal
#

I don't understand why this doesn't work:

waitUntil { !isNull ( findDisplay 46 ) };
( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
  if (inputAction "help" > 0) && (a == 1) then {
     hintSilent "Earplugs In";
    1 fadeSound 0.2;
    a = 2;
  } else {
    hintSilent "Earplugs Out";
    1 fadesound 1;
    a = 1;
}];```
#

I realized I'm missing a semicolon but when I push H nothing happens at all with the additional code

atomic crystal
#

oh

little raptor
#

also:

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
atomic crystal
#
  a = 1;
waitUntil { !isNull ( findDisplay 46 ) };
( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
  if (inputAction "help" > 0) && (a == 1) then {
     hintSilent "Earplugs In";
    1 fadeSound 0.2;
    a = 2;
  } else {
    hintSilent "Earplugs Out";
    1 fadesound 1;
    a = 1; 
     }
}];
atomic crystal
#

I got it

little raptor
#

what you wrote will throw an error

atomic crystal
#
a = 1;
waitUntil { !isNull ( findDisplay 46 ) };
( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
  if ( inputAction "help" > 0 && a == 1 ) then {
     hintSilent "Earplugs In";
    1 fadeSound 0.2;
    a = 2;
  } else {
    hintSilent "Earplugs Out";
    1 fadesound 1;
    a = 1; 
     }
}];
#

this works ^

#

you're right I was getting an error

#

wait, there's a new issue.. no error but the earplugs are taken out by themselves now after I push h

little raptor
#

(you shouldn't have btw)

#

you have to add a "duplicate guard"

#

otherwise you'll end up adding multiple EHs

#

one undoing the other

little raptor
#

if you were testing in Eden, you have to close the mission completely first before trying the new code (not just restart it)

atomic crystal
#

so the earplugs "stay in" until I push another key like WASD and then they're "taken out"

#

if i stand still and shoot it works fine?

#

I closed the eden editor and relaunched the mission to test that, was gettin the same result before. I'm confused

little raptor
#

didn't you say you wanted to use H?

atomic crystal
#

yes, I'm not sure how else to do it honestly

atomic crystal
#

I know about those but how to I put that into a script without errors

crude vigil
# atomic crystal wait, there's a new issue.. no error but the earplugs are taken out by themselve...

Of course, your condition is (inputAction "help" > 0 && a == 1) , so every time this is false, you are putting earplugs out... So every time any other key pressed or you press help button while a==2 will put it out... You need to check inputAction "help" > 0 separately outside of the earplug in/out handle code, if it is false, it should do nothing at all. (Mouse buttons are excluded because they are not activating keyDown, they activate mouseButtonDown, so they slip your faulty code)

crude vigil
# atomic crystal yes, I'm not sure how else to do it honestly

Each activation of keyDown returns the DIK Keycode of whatever you press, you press W , it returns 17 for example. In the DIK_KeyCodes page , just search for W , and you ll see it is the corresponding Integer. For H, you need to do the same and check if the event returns that specific integer.
https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onKeyDown (Check 2nd parameter)
https://community.bistudio.com/wiki/DIK_KeyCodes (Leopard already sent)

tight cloak
#

another day, another scripting question.
so im making a custom module that teleports all players to the placed logics position (zeus module)
first question, is it possible to easily get where the logic was placed and to use it later such as getpos -
second, using allplayers it returns an array of all players including headless clients. ive tested using the examples on the wiki to no avail, id just like a simple plug and play example of how to fetch all players and assign a variable to them all for an if statement later on.
something like
"if _variable = true
setpos (Getpos _logic)"

#

ofc thats not sqf formatted but just written simply so anyone reading and may know how to do what im attempting knows exactly what i want to do

willow hound
#

Either way, HCs probably don't care if you teleport them πŸ™‚

tight cloak
#

zen

#

@willow hound

#

our group uses zen as a mod and its kinda a must. so id rather use their plug n play register than the vanilla format

willow hound
#

Well, the ZEN Custom Modules documentation that I linked above tells you exactly how to obtain the position where the module was placed, or are you having trouble understanding it?

tight cloak
#

my brain is fried from a crap ton of other scripting ive done so please if you could explain it to me :3

#

still recovering from figuring out CBA stuff

tropic gazelle
#
["Custom Modules", "Cool Hint", {private _pos = _this select 0}] call zen_custom_modules_fnc_register
tight cloak
#

and i can refer to _pos in the script and it will fetch the modules local position?

willow hound
#

That is correct.

tight cloak
# willow hound That is correct.

so just to be clear -

["Custom Modules", "Cool Hint", {execVM "myscript.sqf"{private _pos = _this select 0}}] call zen_custom_modules_fnc_register

would execute the code and record the modules local position?

#

or have i got it completely wrong

copper raven
#

you've got a syntax error

#

and what do you mean by "local" position?

#

and also don't use execVM in a script that will most likely be executed multiple times

tight cloak
#

its for a framework for MM, this one enacts our end scenario shiz

#

and no i dont mean the bis_fnc_endmission thing

#

but a script that will only be done once at the very end

tropic gazelle
#
["Custom Modules", "Cool Hint", {
  private _pos = _this select 0;
  {_x setPos _pos} forEach allPlayers;
}] call zen_custom_modules_fnc_register;
tight cloak
#

nevermind

#

missed the setpos line

#

but the idea was just to first get them all teleported for the script to then go and do more stuff. it just be compounded into one module

tight cloak
#

so the module teleports all players and then does other stuff, in this instance place them in an order and run another script

#

hence why it would be calling another script (the module that is)

tropic gazelle
#
["Custom Modules", "Cool Hint", {
  private _pos = _this select 0;
  [_pos] execVM "myscript.sqf";
}] call zen_custom_modules_fnc_register;

On myscript.sqf:

private _pos = _this select 0;
//Do what ever you want with _pos
//...
tight cloak
#

thankyou, ill give it a quick test ❀️

#

i get "undefined variable in _this"

#

:/

copper raven
#

if you make a new script instance anywhere, you need to pass params again accordingly

tight cloak
#

and how would i do that?

copper raven
#

the exact same way...

tight cloak
#

i am both stupid and learning sqf, could you spell it out for me?

#

please :3

#

never mind i did it

#

am just slow

meager epoch
#

Can someone help me fix this thing so that the animations stops whenever the bandit's health is 0?

while {alive bandit1} do {
  bandit1 switchMove "Acts_AidlPercMstpSlowWrflDnon_pissing";
  if((damage bandit1)==1) then {
    bandit1 switchMove "";
    break;
  };
  sleep 20;
};

Cause right now, the animation keeps on playing and once it's done, only then he dies.

fair drum
#

so say he takes damage at second 2, he will have a long time before the check that he is dead

meager epoch
#

Yeah, but without the sleep he doesnt re-do the animation

#

I need the animation to loop until his health is 0, i.e. hes dead

fair drum
#

add a conditional that tells if he is in an animation through a variable or something

cosmic lichen
#

use a killed event handler

#

or damaged

meager epoch
#

ait, will try

meager epoch
#

i havent used event handlers much so i dont really know how to use em

fair drum
#

put it outside the loop before it. then you don't need an exit for the loop other than alive

#

cause the EH will do what you want when the unit is dead, and the loop will exit on its own

meager epoch
#

alright, thanks

cosmic lichen
#

Don't loop

#

use the animation event handlers as well

meager epoch
#

oh my, more event handlers notlikemeowcry

fair drum
#

@cosmic lichen saw the update on the bug report. do you know if that change is live on the workshop? it says the change to groupMarker.hpp was 2 months ago, yet the last update to the mod was 7/20/21. Currently looking at the workshop files from that date, the error is still present.

cosmic lichen
#

The mod has recieved its last update with v2.04. This has been month ago.

#

GitHub != Steam Workshop πŸ™‚

fair drum
#

that was gonna be my followup question lol

spark turret
#

how do i test if a unit is freindliy or enemy of another unit?

#

(without hardcoding sides)

#

there it is

meager epoch
#

thanks :)

west grove
#

i've read that kbtell didn't really work well on dedicated servers in the past... is that still the case in 2021?

meager epoch
#

quick question, do both of these have an index of 0 (cause diff objects or whatever) or is the u1 one with an index of 0 and the u2 one with an index of 1?

u1 addEventHandler ["Killed", {...}];
u2 addEventHandler ["Killed", {...}];
hollow thistle
#

You could add them and check.

Indexes are per object.

meager epoch
#

so... both would be 0, yes?

little raptor
#

you're not the only one adding EHs to objects

meager epoch
#

now ur making me confused notlikemeow

#

how can i get the index of an event handler?

fair drum
#

you should be saving them as you make them

#

so you can recall them later easily

#

the return of an addeventhandler is a index number

hollow thistle
#

TAG_idOfMyEh = u1 addEventHandler ["Killed", {...}];

little raptor
little raptor
hollow thistle
#

it's a simple example how to store it in a variable

little raptor
#

I know but you should show a proper example meowsweats

hollow thistle
#
private _ehId = u1 addEventHandler ["Killed", {...}];
u1 setVariable ["TAG_idOfMyEh", _ehId];
crude vigil
#

Leo is making sure everyone who dares studying SQF regret it. meowsweats

little raptor
copper raven
#

if !(_leopard analyzeScript _code) exitWith {_leopard screamAt ownerOf _code}

hollow thistle
#

I prefer to give simple examples and let them figure out the rest ;P

crude vigil
void delta
#

does the screenshot ""; command work in multiplayer?

copper raven
#

only one way to found out

uncut sphinx
#

what is the purpose of NetID? I understand what it does, but what is the advantage of using this over, say, a global public variable pointing to an object?

little raptor
copper raven
little raptor
#

but since v2.08 you can use hashValue

#

or was it 2.06?

still forum
#

what is the purpose of NetID?
its the network ID of an object
but what is the advantage of using this over, say, a global public variable pointing to an object?
uh.. they are completely different things?

but since v2.08 you can use hashValue
2.06, and it uses netid

still forum
#

oid

uncut sphinx
#

is there some tutorial on netid? Seems like a very useful feature but maybe I just don't understand it well enough to use it

still forum
#

If you don't know what you could need it for, you don't need it

uncut sphinx
#

so if I'm understanding him correctly, it's a way to assign a unique string to an object without explicitly naming it with a variable

#

which is useful, for instance, as a remoteExec parameter

still forum
#

Why would you want to convert a object to string and back for remoteExec?

#

You can just pass the object directly

uncut sphinx
#

I saw it as an option for the JIP parameter

#

I dunno, I'm just curious about the feature

still forum
#

You could also just pass the object as JIP parameter

past gazelle
#

Is there a variable I can use in scripting to track FPS?

past gazelle
#

Thank you. I'dve google'd it but I had a feeling...it might not be the best of ideas.

fair pilot
past gazelle
#

Thanks. average will do fine.

#

I'm coding an automatic dynamic spawn radius adjuster for alive...

fair pilot
#

This is actually won't give you an average fps but fps of current frame

#

If you want average you probably would need to save multiple variables in array or something and then calculate average out of them

#

Or just use diag_fps

#

Not sure if it gives you average fps tho...

past gazelle
#

It says average FPS on the BIS page...

#

Will try it... Turns out I can't get anywhere NEAR ALiVE's 144 spawned profile limit, at 60 I dropped to 7fps...

bitter magnet
#

what is "144 spawned"?

past gazelle
#

Alive virtualizes units and only spawns units near the player. It has a built in limit of 144 "profiles" which could be squads/tanks as the max number that can be spawned before arma as an engine gets overloaded...

fair drum
#

Arma 3 now allows 288 groups instead of 144 btw

#

good luck getting there though lol

bitter magnet
versed widget
#

is this thing exists ? iskindof WheeledAPC
nevermind its Wheeled_APC_F

past wagon
#

You can do an if statement to check if the key pressed was β€œH”, and then you can do an if-then-else statement inside that to check if the earplugs are in or out

spark turret
brisk harness
#

how do i have an ai plane and crew get deleted on trigger?

atomic crystal
#

I genuinely have no idea how to use params in that case, I tried for 5 hours this morning and I must just be an idiot LOL inputAction has been working fine but I wasn't able to determine when the EP were in or not. I feel defeated entirely. Here's what I just wrote after reading your answer, haven't tested it yet:

waitUntil { !isNull ( findDisplay 46 )};
( findDisplay 46 ) displayAddEventHandler 
        [ "keyDown", { if ( inputAction "gunElevAuto" > 0 AND earPlug_In == false ) then {
            execVM "EP\earPlugsIn.sqf" } }];

( findDisplay 46 ) displayAddEventHandler 
        [ "keyDown", { if ( inputAction "gunElevAuto" > 0 AND earPlug_in == true ) then {
            execVM "EP\earPlugsOut.sqf" } }];

if ( soundVolume == 0.2 ) then { earPlug_in = true };
if ( soundVolume == 1 ) then { earPlug_in = false };
#

I had settled with using different keys for in/out but I haven't givenup on the toggle button

#

thank you btw

bright robin
#

i have a question,how do i edit BIN files

crude vigil
willow hound
atomic crystal
#

well I can tell you I didn't sit in front of my computer from 8 to 1pm staring at the exact same code all day. I asked here for help because I don't understand, not to be told I don't understand. But thank you anyway.

crude vigil
misty osprey
#

is it possible to get the classname of a spawned vehicle for instance I have the vehicle the player is in is there a way to get the classname of that vehicle

misty osprey
#

thanks

atomic crystal
#

it's not an assumption, I just don't understand. If I overcomplicated it that's why.

#

I'm trying.

crude vigil
# atomic crystal it's not an assumption, I just don't understand. If I overcomplicated it that's ...
a = 1;
waitUntil { !isNull ( findDisplay 46 ) };
( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
  if ( inputAction "help" > 0 && a == 1 ) then {
     hintSilent "Earplugs In";
    1 fadeSound 0.2;
    a = 2;
  } else {
    hintSilent "Earplugs Out";
    1 fadesound 1;
    a = 1; 
     }
}];

This is your previous code.
Your issue was , no matter what you press(excluding mouse buttons), it was removing earplugs right?
That is because of the else block being activated if anything else than "help" button is pressed

atomic crystal
#

I understand that part (now)

crude vigil
#
a = 1;
waitUntil { !isNull ( findDisplay 46 ) };
( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
  if ( inputAction "help" > 0) then {
     //if "help" is pressed, then do my checks, otherwise it doesnt concern me at all.
     if (a == 1 ) then {
       hintSilent "Earplugs In";
       1 fadeSound 0.2;
       a = 2;
     } else {
       hintSilent "Earplugs Out";
       1 fadesound 1;
       a = 1; 
     }
  }
}];
atomic crystal
#

gotcha, then when I added the "else" statement whenever I pressed anything other than H, the else statement ran and the EP were taken out.

#

I was unable to wrap m head around how to actually tell if H key was pressed using the params

crude vigil
#

yeah, you figured that out, you just wanted to make an if check with multiple conditions then got confused from that, happens to me as well when I wanna clear the code sometimes.

atomic crystal
#

So, I need to add the soundVolume check inside of the EH and still figure out how to use DIK_H instead of inputAction (which I'm clueless on honestly)

#

oh i changed the key, was H before. might change to T

crude vigil
#

in this case, you dont need a soundVolume check at all, cos your a==1 does the same job. (Unless anything else modifies soundVolume which I dunno if you would wanna interfere at all)

atomic crystal
#

I'll get the correct code if I figure it out

crude vigil
atomic crystal
#

when I got that working I could always put them in but not take them out. when I remove the conditions it works until I hit something other than H. I assumed it was from a = 1 being ran multiple times. This is all in initPlayerlocal... that's the right spot right...

crude vigil
#

which code, the new one you mean?

atomic crystal
#

the old one

crude vigil
#

why couldnt you remove them?

atomic crystal
#

idk, nothing was happening

crude vigil
#

when you press any button, it should be removing

atomic crystal
#

should I start saving all the iterations of my scripts? I feel like it'd be helpful right now

crude vigil
#

up to you.

atomic crystal
#

sorry if that came off in a way..this is getting to me!..I really need to figure out how to reference the key that is recorded by the event handler _key param. I'm going to try and write a line again specifically for that

crude vigil
#

You retrieve it from there.

atomic crystal
#

oh god

#

it's been there the whole time

#

...

#

lmfao

crude vigil
atomic crystal
#

so I need ( _this select 1 ) for _key then?

crude vigil
#

yes.

atomic crystal
#

thank you so much.

crude vigil
#

or you can use params as I mentioned, which is easy way to define multiple variables in one line...
(_this params blabla) == (params blabla)

#

but not needed for only 1 variable definition.

atomic crystal
#

I didn't understand where to put the params [] part..lol..I'm dumb..

crude vigil
#

it is ok

atomic crystal
#

or how to reference them with this..idk why

crude vigil
#

and the _key you receive in there, is basically the stuff in the list of DIK_KeyCode page

atomic crystal
#

gotcha, and the _key is an integer not the DIK_ID?

crude vigil
#

no, DIK_ID is a reference to that integer but it is defined in some file that you need to import.

atomic crystal
#

so if I did use the DIK_ID it would be an undefined variable

crude vigil
#

pretty much yes, cos you do not have the file that defines all DIK_ID

atomic crystal
#

got it πŸ˜„

crude vigil
#

#include "\a3\ui_f\hpp\definedikcodes.inc"

#

this is the file

#

it is written there

#

if you paste this in ur code, you can use DIK_IDs there

#

but for only 1 character, it is really not needed.... just use the integer

atomic crystal
#

If I did need to use that should that also be put into initPlayerLocal or the Description file

#

#include "\a3\ui_f\hpp\definedikcodes.inc" I mean

crude vigil
#

it should be wherever your script is

atomic crystal
#

ok gotcha

crude vigil
#

thats basically copy pasting all the text into there without actually doing it, in a clean way, nothing else.

atomic crystal
#

πŸ₯³πŸ₯³

waitUntil { !isNull ( findDisplay 46 )};
( findDisplay 46 ) displayAddEventHandler 
        [ "keyDown", { if ( _this select 1 == 35) then { if
            ( soundVolume == 1 ) then { 1 fadeSound 0.2; hint "Earplugs In" } }} ];
( findDisplay 46 ) displayAddEventHandler 
        [ "keyDown", { if ( _this select 1 == 35) then { if
            ( soundVolume == 0.2 ) then { 1 fadeSound 1; hint "Earplugs Out" } }} ];
crude vigil
#

if soundVolume is 0.2, earplugs out, else in

atomic crystal
#

how are elif statements written

crude vigil
#

you dont need elif, you got 2 conditions

atomic crystal
#

ok

#

was just curious

crude vigil
#

there is no else if in here.

atomic crystal
#

I knew that, was wondering what the way to write a similar statement would be

crude vigil
#

apart from nested if, there is switch

atomic crystal
#

other than 'nested if'

#

oh ok, I looked into that one a little bit I'll check it out more

#

ok, all together now, (lol):

waitUntil { !isNull ( findDisplay 46 )};
( findDisplay 46 ) displayAddEventHandler 
        [ "keyDown", { if ( _this select 1 == 35) then { if
            ( soundVolume == 1 ) then { 1 fadeSound 0.2; hint "Earplugs In" } 
                else { 1 fadeSound 1; hint "Earplugs Out" } }} ];
#

thank you again

crude vigil
#

np, enjoy

#

take a break, cooldown :P

brisk harness
#

is there a batter way to get sam's to work better? i have 2 rhea's and a radar and they miss all shots on a c130 [is there a way to script in a 100% accurate sam shot?

true frigate
#

is there anywhere the vehicle classes like "HelicopterExploBig" or "FuelExplosion" are readily available in a list of sorts?

#

Ive had a look in Particle Effects, CfgAmmo Config Reference, and CfgVehicles Config Reference. No results, but I could be looking in the complete wrong place

fair drum
native cloak
#

Anyone got a preset that spawns ai in and just lets the patrol im using altis

#

as well as how do i start scripting

brisk harness
fair drum
little raptor
#

configFile >> "CfgAmmo" >> "FuelExplosion"

#

configFile >> "CfgAmmo" >> "HelicopterExploBig"

true frigate
#

Vehicle objects sorry, theyre under createVehicle so my mind instantly went to that πŸ˜„
Thank you!

little raptor
true frigate
#

Gotcha, that makes sense πŸ™‚

native cloak
#

Anyone mind helping me set my files up im just retarded and cant read

native cloak
#

Scripting files. So i script in a file then import them into my arma mission

fair drum
fair drum
native cloak
#

im using notepad++

fair drum
#

okay well you are all ready to script in your mission then

#

as you create files in that folder, you can call them ingame

#

and obviously you can mess with the organization

native cloak
#

yea

#

is there a preset i can use to just spawn ai in the citis of altis

#

city's

#

and i do txt document or what

fair drum
#

the files you will use are .sqf .ext .hpp mostly

native cloak
#

Ok

fair drum
#

with .sqf being your main dude

native cloak
#

K

fair drum
#

also, if you are using the base game assets, you can just use the spawn AI module. if not, you'll have to create your own thing

fair drum
#

also, read that link i posted. i can tell you didn't read it at all

native cloak
#

nope, I hate reading

#

in every way

fair drum
#

you won't make it that far, in this, or life with that attitude lol

native cloak
#

lol i can read just ehh

#

my mind goes from that to planes so im all like

#

lmao

fair drum
#

you can hate it, but you have to do it

native cloak
#

yea that should be good just needed some basics so start

native cloak
low sierra
native cloak
#

Well thanks

#

pagoda is that a gas tank?

fair drum
low sierra
#

Lol it's a gas tank

native cloak
#

LMFAO

fair drum
#

but yeah, you can use particle effects and create your own visuals

native cloak
#

Blender i belive works

fair drum
#

everything is in game, you don't need blender

native cloak
#

Alright for mods you do

low sierra
#

I doing all with scripts, can't use mods, i was able to attach the gas tank to "spine3" and set it to roll with the memory point, perfect!

warm hedge
#

Blender does nothing to do with scripting

native cloak
#

trying to look for jato but cant find any

native cloak
low sierra
#

@fair drum nice i will tack a loook, thanks.

low sierra
#

This can be done without mods?

warm hedge
#

Yes

#

Particles are script side

low sierra
#

Thanks.

warm hedge
#

Can be config side, but you don't need a Mod in this context

native cloak
#

Yea

#

be cool to see a jet engine

#

as a jetpack

fair drum
#

while you're here polpox, can you copy the class name easily in your enhanced arsenal? if not, are there plans for its implementation?

#

@warm hedge

warm hedge
#

Eh, I'm not interested with that project more like Arma anymore. So no, sorry

fair drum
#

the last part of your phrase, you mean you aren't interested in arma anymore as well?

warm hedge
#

Yup. Sometimes I play and mod it but super barely

fair drum
#

gotcha

drifting sky
#

anyone know if it's possible to remove certain LODs for buildings or plants via addon or scripting?

little raptor
#

but requires modifying the model

drifting sky
#

the lod control is baked directly into the model?

little raptor
#

yes

#

or should I say there is no "lod control"

drifting sky
#

So the addon would have to contain modified versions of all of the models it wants to affect?

low sierra
#

Now going to the setVelocity part

west grove
#

shouldnt the object point the other way?

#

now it needs another hole in the bottom

low sierra
#

Oh yes, you is right.

meager epoch
#

And is there any way to make it readable?

bitter magnet
#

untick binarize box, uhm cant remember where it is, in attributes menu I think. you'll find it (this is on eden mission editor).

meager epoch
#

will that keep the scenario as a .bin when someone downloads it from the workshop

bitter magnet
#

no idea, I dont do steam.

meager epoch
#

oh ait

#

ty

little raptor
#

it's not the same as binarized config

#

so yes, they'll see it as a bin

meager epoch
#

cool, thanks

low sierra
#

Sadlly the smoke stretch a lot when the player is moving.

fair drum
little raptor
fair drum
low sierra
#

At high velocity the smoke sounds really bad 😦

#

I will try to fix

distant oyster
supple matrix
#

I suppose there is no way to create a localized volumetric fog? (without simulating it by abusing particle emitters).
For example, to have just one of the Tanoa islands covered by fog, which would be obstructing vision and visible on site while also being visible from far away and covering the island?

versed widget
#

is the CBA slider uses only integer numbers ?
i tried double and didnt work

copper raven
#

you can set the amount of decimals in the setting thing iirc

little raptor
spark turret
versed widget
copper raven
#

can you show the code?

versed widget
#

[
"Tracked_Camshake_Power", "SLIDER",
"Power", ["CrewHitReaction", "Tracked Category"],
[0, 100, 0.5, 0],
nil,
{}

] call CBA_fnc_addSetting;

#

but ingame the 0.5 will turn to 1

copper raven
#

well you are passing nil to the decimal parameter

#

that's your issue

#

or wait nvm, ahh the formatting you use meowsweats

#

its not the nil, it's the 4th argument in the slider parameters, shouldn't be 0

versed widget
#

yeah i suspected that changed it to 0.1 and the setting turned from 5 to 005 lol

copper raven
#

its supposed to be an integer, that denotes the number of trailing decimals

#

[0, 100, 0.5, 2] will display 2 decimals

supple matrix
spark turret
#

No, i managed to make a pretty devent dust/sandstorm thing. Runs quite well and looks okay

supple matrix
crude vigil
versed widget
spark turret
supple matrix
#

Such thing would need a scripted particle emitter, to make it visible from greater distance than the object view distance, so you are already loosing performance just because of that.
And to make it look good not just from 10km away, but also from 1km, or when you are inside of it, is imo really impossible without significant performance cost - but i will very gladly eat my words if you can show me otherwise.

supple matrix
# spark turret there you go, a sandstorm/dust script <https://drive.google.com/file/d/1nQq07D5C...

Nope, this wouldn't work for me, i need effect covering the island, when looking from afar, this is just to emit particles around player so it looks like he is in a sand storm - totally different thing.

Anyway, i just realized, i cannot do this anyway, because i am using fog, and fog is synced across all computers in MP, so i cannot have thick fog for one player who is on the foggy island while having different or no fog for another player who is somewhere far away.
And i need to use the fog, i can't use some particle emitter to fake it - that was ok back in OFP days, when everything looked like butt, but now it looks too ugly compared to what ppl expect (even from the aging Arma 3), and it would come with a performance hit that real fog simply doesn't have.

Nope. Must find a way how to explain why the fog is everywhere.
Too bad we cannot have different fog settings per client 😦

(how unexpected to want an effect to NOT to sync in MP, usually its the other way around :))

spark turret
#

you only need to change the script to make the particles worldspace dependent not attached to a player

supple matrix
# spark turret you only need to change the script to make the particles worldspace dependent no...

I know, but i need the effect to create a ring of fog around the whole main Tanoa island.
So i am worried this would come with a performance cost i am not willing to subject players to (i am already struggling to keep the FPS above 45).

But the real problem is that for this to even make sense, i would have to get rid of the real fog that i use to make the island foggy and dusty, because the real fog is synced in MP.
So, i will have to replace the real fog with yet another particle effect that follows player.
So that would be already 4 particle emitters:

  1. particle emitter for the volcano smoke (visible from everywhere regardless of viewdistance)
  2. particle emitter for ashes in the air (follows player)
  3. third emitter for the fake fog surrounding the whole island (visible from everywhere).
  4. fourth emitter to replace real fog for players who are on the foggy island (follows player)

and the big fog around the whole island won't look too good when you get close, because you start to see how the individual particles are layered over each other and how they disappear when you move too close.

That being said, i will put together a proof of concept, see how it really looks.

crude vigil
#

so you get 4 seconds to set daytime again before server synces your time

#

till then, player lives in a parallel world.

#

Only works logically if it is dedi server though otherwise hosting player is abandoned for the good cause. salute

#

So Global Effect at least in setting daytime is a lie.. and I believe setFog is too.

#

Effect is local, only that server periodically sends daytime but that is not global effect. :)

#

So yeah, I could advise you to check it if you want to use setFog and it has something similar?

supple matrix
# crude vigil I dont know if it is the same for fog (it probably is) but daytime is syncing ev...

yep, it should be something like that.
The only way would be to keep calling setFog, but i think that may cause visual glitches where the fog gets synced, and then suddenly changes to whatever that client is supposed to have.

And yes, the Global Effect is achieved by the delayed synchronization, it is not immediate - its not a "lie", its just that for all intents and purposes the effect really is global (unless your mission finishes within few seconds or whatever is the sync period).

crude vigil
#

although I checked now and setDate is marked as local effect and yeah I might ve written all these for no reason :P

#

Well, in one of my mods, Im causing desynced time for a client and it works without any issues.

#

Thinking is not enough, testing/trying is.

supple matrix
#

I didn't try it myself, but i trust the wiki when it says the following about the setFog command:
"if executed on server, the changes will propagate globally. If executed on client effect is temporary as it will soon change to the server setting."

crude vigil
#

oh so if you do what I say, it gonna work, cool.

#

Now it is up to you to do or not.

supple matrix
#

no it won't, it will change to whatever the fog is set to on the server.

crude vigil
#

Ok, I wrote everything for no reason then , since it looks like you didnt read what I said.

supple matrix
#

I am talking about the setFog command, what are you talking about? πŸ˜„
The setDate? why would you be talking about that? that has nothing to do with what we were all discussing here πŸ˜„

crude vigil
#

Yep Im assured you didnt read at all.

#

Enjoy however you gonna make it work then.

supple matrix
#

I read it the first time, and then i read it the second time just now, and i still fail to see a solution to the fact that setFog has global effect when it gets synchronized.
You are talking about spamming setDate and how that causes the TIME to get out of sync, and i just fail to see how that has anything to do with the fog getting synced across all machines.

supple matrix
#

i am still not getting it

winter rose
#

he compares date and fog sync
he does not state "setting date will fix your fog"

supple matrix
#

ok, that confuses me even more

#

i thought he is proposing some solution as to how to prevent the server from syncing the fog, but i don't see it there, so maybe somebody can explain that in simple terms, like you would to a 3 year old child? πŸ™‚

crude vigil
#

spam setFog in your client who is not server, and see if it is working or not.

supple matrix
#

aaaaaah, ok, well that will work only if you spam it as fast as you can, so when server does sync the fog (and it WILL), it would be immediately overridden by another call to setFog.
I don't want to do that, its not worth it. I will just go with fog everywhere.

crude vigil
dreamy kestrel
supple matrix
#

I don't understand, am i still not seeing something obvious?
Yes, spamming setFog is the first thing anybody would come up with, and yes, as you would be spamming it, there would be a time when once the server synchronizes the fog, it would be overridden by the spammed command, but that would happen after player already saw the fog blink between the two states - something i do not consider OK.

supple matrix
crude vigil
supple matrix
#

I don't want you to write the same thing, i read the same thing several times now, and its not helping me to understand how one can use setFog to stop the server from synchronizing the fog which results in visual glitch when you suddenly override it with vastly different fog settings.

crude vigil
# supple matrix I don't want you to write the same thing, i read the same thing several times no...

I dont know if it is the same for fog (it probably is) but daytime is syncing every 5 seconds (if difference is +/- 15 mins)

So yeah, I could advise you to check it if you want to use setFog and it has something similar?

Well, in one of my mods, Im causing desynced time for a client and it works without any issues.

Thinking is not enough, testing/trying is.

Thinking is not enough,** testing/trying** is.

Thinking is not enough,*** testing/trying*** is.

Thinking is not enough, testing/trying testing/trying testing/trying testing/trying testing/trying testing/trying testing/trying is.

#

Dont ban me for spamming, ty. notlikemeowcry

supple matrix
#

So... you did just wrote the same nonsense again. Well, thank you.

winter rose
#

@supple matrix basically disabling server sync is impossible, so go for global fog. problem solved

supple matrix
winter rose
supple matrix
#

aha, that sort of thing happens to me a lot, sorry

winter rose
dreamy kestrel
#

follow on radio channel Q: radioChannelCreate returns the range 1-10, right, but this is not the same ID that we should use once we are clear of the actual creation? i.e. setting player channels, etc.

#

IOW, do we need to add +5 in order to work with the radio once we created the custom channel (?)

winter rose
#

once we are clear of the actual creation
dunno what you mean 😬 of the when and what

dreamy kestrel
#

ah ok thanks

#

still confused, how does A3 know the difference between custom channel ID and the baked in channels, i.e. GLOBAL (also, 0), in this case.

winter rose
#

some commands can only edit custom channels

dreamy kestrel
#

and to my earlier question, setCurrentChannel along the same lines, right.

#

right, past edit... normal operation, navigation, etc.

winter rose
#

setCurrentChannel channelID

customChannelID radioChannelAdd units

dreamy kestrel
#

i.e. AFAIK, channel created, but I do not see it in the set of channels I can scroll with <|> or up|down

dreamy kestrel
#

hmm... so we need to continually add units to the channel for them to be able to engage with it?

winter rose
#

well, yes

dreamy kestrel
#

gtk, also, a bit awkward, but ok...

winter rose
#

add them once, but new units need to be added to it yes

#

just so you can have e.g side leaders talking together and not "hey everyone can use this channel", otherwise it would only be another Global channel

dreamy kestrel
#

yeah, in this case, I'm not sure it's a group, leaders, i am setting up. more like a 'roles/perms' channel.

#

i.e. 'logistics'

winter rose
#

that part is up to you!

dreamy kestrel
#

no worries, thanks for the orientation

stable musk
#

Hello, novice Arma 3 scenario maker, I was wondering if there was a way to change the music that is played by BIS_fnc_endMission, or perhaps a way to recreate it with different music?

winter rose
stable musk
#

Oh, I hadn't thought of that, thanks!

supple matrix
# spark turret you only need to change the script to make the particles worldspace dependent no...

In case you are interested in this...

There is one more thing i forgot about that prevents this from being a viable solution.
Obviously, i want the fog to be visible from very far away - ie. so while standing on some other island, you could see the central island being drowned in the "ash".
In order for that to be possible, the Particle Emitter has to be scripted, no way around that (its Arma 3 engine thing).

Problem with that is, there is also a global limit on number of particles, and i already have another scripted emitter for the volcano smoke.
I could try to limit the max number of particles both effects will produce by lowering their drop rates and spreading the particles more apart, otherwise i would hit the limit which results in jarring visual glitches of particles "blinking out of existence".
But problem with that is - it looks ugly.
Both effects need certain amount of particles, otherwise it doesn't look good, and that amount is over the limit.

So... one more reason why i have to go with global fog everywhere 😦

grand idol
#

Is there a way in game to see what variables are attached to a player via the admin console or dump?

grand idol
#

@distant oyster Thanks, but how do I display them?

distant oyster
#

the values?

grand idol
#

yes.

distant oyster
#
allVariables player apply {[_x, player getVariable _x]};
#

so you get an array of arrays like

[["name", "Terra"], ["BIS_fnc_function_value", 1234]]
grand idol
#

Ok, then I should be able to dump that to the RPT?

distant oyster
#

also possible:

allVariables player apply {diag_log format ["%1: %2", _x, player getVariable _x]};
#

dumping it as an array might get cut off

dreamy kestrel
winter rose
#

yes

#

for createMarker can take other channel IDs

dreamy kestrel
#

huh, this example is interesting, so, A3 knows how to handle the code involving, i.e. player, remotely?

[_channelID, {_this radioChannelAdd [player]}] remoteExec ["call", [0, -2] select isDedicated, _channelName];
still forum
#

eh... player is a command

#

yes Arma can execute commands

#

big news

dreamy kestrel
#

@still forum not really my question. IOW, passing 'code' over the wire remotely. i.e. {_this radioChannelAdd [player]}

winter rose
still forum
#

Yes passing code is a thing, always has been

winter rose
#

so player will designate the local player, as it is run on the client

copper raven
dreamy kestrel
#

interesting. thank you.

#

full of questions today... Q: when player disconnects via 'PlayerDisconnected' event, we have the numeric or string record of it. will the player object be in the allPlayers at that point?
goal there being to remove disconnect(ed/ing) player from the channel.

distant oyster
#

wasn't sending code over network bad?

still forum
distant oyster
#

okay didnt know that. i thought it was getting send compiled

dreamy kestrel
dreamy kestrel
# dreamy kestrel full of questions today... Q: when player disconnects via `'PlayerDisconnected'`...

So far my assumption is this, depending on whether disconnected players are among allPlayers.

private _allPlayers = allPlayers;
// Assuming an array of CBA namespace objects does the channel bookkeeping
{
  private _channel = _x;
  private _channelPlayers = _channel getVariable ["MY_radios_players", []];
  private _playersToKeep = _channelPlayers arrayIntersect _allPlayers;
  private _playersToRemove = _channelPlayers - _playersToKeep;
  // ... remove players to remove from the custom channel ...
} forEach MY_radios_customChannels;
digital rover
#

Is there a way to detect if an object (or just a unit at a compromise) is currently touching a surface/in free fall?

dreamy kestrel
digital rover
dreamy kestrel
#

also more or less than zero, negative for 'backward' momentum. I usually do abs speed _object for momentum.

winter rose
#

note that precision should be added to the wiki as to whether it works on buildings or not (I think it does)

hearty hound
#

Any thoughts on what I'm doing wrong here? I never get any type of Headgear added but I do get a hint sometimes:

    "G_balaclava_blk",
    "CUP_RUS_balaclava_blk",
    "CUP_RUS_balaclava_grn",
    "cwr3_b_facewear_balaclava_olive",
    "G_Bandanna_blk",
    "G_Bandanna_khk",
    "G_Bandanna_oli",
    "G_Bandanna_tan",
    "CUP_G_TK_RoundGlasses_blk",
    "",
    "",
    "",
    "",
    "",
    "",
    "",
    "",
    ""
];

player addHeadgear selectRandom faceWearList;
hint selectRandom faceWearList;```
dreamy kestrel
#

okay, I think I am successfully creating the custom radio channel.
still do not see it among the <|> and up|down scrolling.

past wagon
bitter magnet
#

Jakerod: player and hint lines are different random picks, so when you get a hint sometimes it has no relation to addHeadgear command. as of why headgear is not working, dunno, havent used that command much.

hearty hound
#

yeah I figured they wouldn't match but I never get anything added

#

the hint was mostly to make sure I was using selectRandom correctly because I never used it before

dreamy kestrel
#

I tried this, player customChat [0, 'this is a test'], I get nothing. // i.e. the CUSTOM channel ID, still no change, does not work
AFAIK I have correctly enableChannel both chat and/or voice, but especially chat.

spark turret
#

save the random choice in its own variable and print that

bitter magnet
#

this is just a quick edit from top of my head (not tested in-game): sqf private _jakerodgear = selectRandom faceWearList; player addHeadgear _jakerodgear; hint format["Hey, Jakerod is wearing: %1", _jakerodgear];

spark turret
#

also, theres a better way to get a 50% "no wear" than to have 50% empty entries:
if (random 100 < 50) exitWith {//no hat for you};

dreamy kestrel
digital rover
past wagon
#

@William00#8386

waitUntil { !isNull findDisplay 46 };
( findDisplay 46 ) displayAddEventHandler ["KeyDown", {
    params ["", "_key"];
    if ( _key == 207 ) then {
        if ( soundVolume == 1 ) then {
            0.2 fadeSound 0.1;
            hint "Earplugs In”;
        } else {
            0.2 fadeSound 1;
            hint "Earplugs Out”;
        };
    };
}];
hearty hound
past wagon
#

key #207 is F1, which is what I use for earplugs. Look at the DIK key codes to make it what you want

#

@atomic crystal

spark turret
#
private _jakerodgear = selectRandom faceWearList;
player addHeadgear _jakerodgear;
hint format["Hey, Jakerod is wearing: %1", _jakerodgear];
assert (headgear player isEqualTo _jakerodgear);
hearty hound
#

the private _jakerodgear = selectRandom faceWearList; player addHeadgear _jakerodgear; isn't working either. Nothing gets added