#arma3_scripting
1 messages Β· Page 707 of 1
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?
yeah helicopter
if (vehArr findIf {crew _x isEqualTo []} != -1) then {
// stuff
}
Ofc isequalto for the empty array comparison, cheers. )
is there a way to increase the inaccuracy of an AI unit/gun? setting its aiming skill to zero is still to much
setVelocity their bullets π
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
Tinker around with all the aiming related sub-skills. Setting them all to zero definitely neuters the AI.
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
Are you sure that's what's happening? You do know that it executes locally and only for your player right?
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
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"];
what did you try so far?
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
at the beginning, Black out
in the middle, delay for black out to set in
at the end, Black in
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
see the doc of whatever is at work here
Oops, I actually meant to post this over at the Exile forum.
hehe ok π
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.
Under normal circumstances, you'd use a return line in the script. I don't know if that works in ARMA though.
how do you get that value back to the client?
using a system similar to promise concept in C++
When it's said Leopard20 is typing... for the past 5 minutes. 
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 = [];
}
typing code on discord is a pain 
I know.
@grand idol see this:
https://gist.github.com/X39/709ecbf88c5fda594586c9b995c8c6a0
already ready to use
I always type it into notepad then copy paste it over.
Awesome guys. Thanks. That should get me going.
I always type it into notepad then copy paste it over.
Tbf, I'm an using NP++ so I've actually got formatting unlike regular.
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
and it will know location of that trigger
what do you mean?
Position, where trigger is on map
what part do you have need help with exactly?
executing the script?
spawning the car?
the trigger position?
This
and this
the simplest way to execute scripts is execVM
i tried but it didnt work
second, ill open arma again
oh
I lost it
while trying difrent stuff
handle = [(getPos thisTrigger)]execVM "loot.sqf";
Something similar to this

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
in trigger input
just add:
params ["_pos"];
at the start of the script
and you'll have the pos you wanted
and then write _pos when i want to use it in script?
yes
does your script have errors?
are you sure the trigger activates at all?
add this to the activation code of the trigger:
systemChat "activated";
if you don't see the message the trigger doesn't activate at all
ok, her is the problem
do you know how to use triggers?
show me a screenshot of the trigger setup
in DM
it's fine
show me the script now
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
_unit = _this select 0;
_addActionID = _this select 2;
_unit removeAction _addActionID;
hint "placing";
// _markerPos = _this;
params ["_pos"];
it was from video tutorial from YT
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
also even if it was correct, this code does nothing anyway
it's part of an addAction code
Parameters array passed to the script upon activation in
_thisvariable is:params ["_target", "_caller", "_actionId", "_arguments"];
those are rest of orginal code
i didn't know how vital they are
so i didn't deleted them
even hint?
the code fails before it reaches there
you should've seen an error
didn't you?
i didn't
no hint or error even when it is at top
did you remove the trigger hints to be sure?
yes
are you sure the file is named loot.sqf and not loot.sqf.txt?
have you enabled file extensions in windows explorer?
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
what is the format of writing classnames in modules?
wdym?
https://imgur.com/X2cwYqe how do i do this
so like that
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?
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
I dont know if what im doing is right but i think its wrong bcoz it doesnt work, ill send a screen shot
oops
class - names
i dont get what does that mean, sorry π
a classname is the name of a class
found in config
oh i understand now ok copy
so "B_Soldier_F" is a soldier's class
yep π
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
what config is soldiers under? Cfginfantry or whats the name
CfgVehicles
did you put a waitUntil with sleep? π
iirc putting sleep in some init script (not sure which) causes an infinite loop 
so I_E_Soldier_SL_F is not a class name?
so I should just remove the (SKOLX) for it to work
well⦠unless it is a classname (which it isn't), it should not be there
im so fc*n dumb im sorry hahahaha
hi sorry, I'm dad!
Very interesting. I run it through an object init with execVM, will test if thats the cause
then no
Ill test again once im home, if it still breaks ill post the code here
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.
looks like I was remembering it wrong:
https://community.bistudio.com/wiki/startLoadingScreen
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" 
scheduled "0.0052ms"
you can't measure the performance of scheduled scripts
you probably ended up measuring the performance of spawn itself
is running a code in unscheduled environment always faster than in scheduled one ?
the total running time is nearly the same. but the unscheduled one will always finish faster (even if it comes at the cost of freezing the game to do its own thing)
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
yeah ive noticed that they run smooth without spikes π
according to the wiki if the unit is an AI they will climb by themselves
use vehicle player instead of player
@cinder tree so do this:
- create a dummy unit for the new player
- add an
animStateChangedevent handler to the actual player. for the code, check!("ladder" in toLowerANSI _anim)and switch back to the old player. then delete the dummy selectPlayerthat dummy unit- play the action on the actual player
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"
not sure what you mean by a new player?
a dummy unit
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
A player would walk up to the ladder, mouse wheel to get actions and choose "climb down"
you can do everything I said inside the action
which wiki are you looking at? the Arma 3 Actions?
yes
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.
ahh.. and: the person will become stuck in the ladder mounting animation state
which is what is happening
isn't that what you wanted?
then they have to climb by themselves
the command already does that
Β―_(γ)_/Β―
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;
CONDITION
thisList
invalid
lack of high vis vests
???
...
hmm it seems it still isn't working as I switched it to this
I want to make a safezone trigger for multiple entities but I'm doing something wrong and I don't know what
triggers only activate once
if anyone else gets in it won't trigger again
you should avoid using triggers and use loops instead
or put a spawn inside the trigger
if you don't want to use loops
ty
I'm actually pretty confused. What should be the structure to detect new entities that enter the trigger
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;
};
thank you!
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
this script would work if there were 2 safezones right?
wdym?
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
I think he means, can he have 2 seperate safezones with it
yes
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!!!"
it's possible for me to rewrite it right
yes. just change the code to your own code
what i don't understand and is concerning me is if it refers to all external units or only the ones leaving
Why don't you check the side of the unit. If it's bluefor then add invincibility, if not. Pass
ye I'm going to add that to the code now
just making sure that it's not refered to every single unit outside of the safezone to disable invincibility
read the code to understand what it does...
I tried but I'm having trouble
{
_x allowDamage false;
} forEach _new;
in here you can put an if statement to check the side
Im new to arma sql
it's sqf
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 _
_old is the list of units that left
_new is the list of units that entered
use forceWeatherChange after it
ok
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?
_veh setVelocity [0,0,0];
no need
yeah I tested it moments after I said that
looks like it works instantly
Sweet thx!
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
Β―_(γ)_/Β―
is there a preference between using
private[_var1,_var1,var3]; and
params[_var1,_var1,var3]; ?
or is there any functional difference?
both of these syntaxes are wrong
I realize I didn't format the variables but its private vs params that I'm curious about.
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
Perfect. Thanks for clarifying.
See also also: https://community.bistudio.com/wiki/Variables
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
yes, hence why I said "generally" obsolete. I do it too, it has some (rare) usages π
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
don't put that in init fields.
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
@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?
damn bro, thats amazing, now if i wanted to change the uniform, what would i change? i have the class names of the sick uniforms
U_C_Man_casual_5_sick_F U_C_Man_casual_4_sick_F U_C_Poloshirt_redwhite_sick U_C_Poloshirt_burgundy_sick U_C_Poloshirt_blue_sick
_man1 addUniform "youClass"; IIRC
No, that's coming soon to arma
When execVM a script from initPlayerLocal.sqf is the player passed? and if so how?
addUniform*
player is always player
its not really "passed" it just already exists
it's MP and I'm using it to give the player multiple diary records
use player
it's initPlayerLocal.sqf
which is always executed local to the player
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
So just to make sure when I [] execVM "scripts\createDiaryRecords.sqf"; from initPlayerLocal.sqf using player in createDiaryRecords.sqf is fine for MP
yes
yes, because initPlayerLocal.sqf is run locally on a player machine therefore player will return the wanted unit
Alright thanks guys. Idk why but I get really confused with figuring out what is local vs global when I pass stuff
if (not local player) exitWith
{
systemChat "you are in deep trouble";
};
Just sacrifice a goat to the Arma 3 god and it will all become clear(er).
could a horrible one do� asking for a friend
Yeah, was thinking about that too.
π 
It could go horribly wrong though
wait
it looks wrong
ET? is that you
animal cruelty
Nah itβs just a routine check up. Making sure his bowels are clear
I have always thought that was a camera instead of a weapon in Miller's hand. Well lets say it took a while in here to find that out. 
At least there's no lack of churches and chapels on Altis for the sacrifice
The sacrifices clearly work, they're the only structures left with real chairs!
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
Yeah you can remoteExec the respawn timer to zero and then immediately set it back to what it was
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?
If you want to play a sound that will be played same for all, either play a music or use playSound, you are asking a playSound3D without 3D of it 
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.
usually you just increase the config sound volume level, but even that has a limit
Doubt it gonna work, it will have the normal effect I believe... Then you should use say3D , has local effect , so you ll set the sound position relative to player and achieve it .
ok, for those of you using sqflint on VSC, how do I disable the specific warning check for Possibly undefined variable blahblahblah
Does anybody know what kind of falloff model arma2 uses for 3d sounds? Linear?
i.e., gain = clamp((max - dist)/max,0,1) ?
you can do that?
you can
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
does distance set to 0 not make the sound not fall off?
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
@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.
"0 means no maximum distance"
my first thought is that it does not get attenuated
but I might be wrong on this Β―_(γ)_/Β―
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)
oh right, say3d
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.
only a dev would knowβ¦ π
sound energy is subject to inverse square law so write your own =p
I need to know how it's implemented in arma, given a max distance parameter
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 π
An idea that crossed my mind:
- Create an invisible local object
- In a scheduled loop, maintain its position relative to player (in wanted direction, 1 meter)
- say3D
- delete the object
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.
@cosmic lichen hit up your github with a script error involving "ENH_groupMarkers"
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?
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?
setHit is probably what you're looking for:
https://community.bistudio.com/wiki/setHit
lol now it says i need a ]
_vehicle setHit ["hitEngine2" "Hithull" "Hitengine_l1" "Hitengine_l2" "Hitengine_r1" "Hitengine_r2" "Hitengine", 1.0];
never used that command, but try doing them one by one, like _vehicle setHit ["hitEngine2", 1.0]; and so on.
you really don't see a problem with this array?
look closely
im a week new to editor lol
well, you aren't going with the syntax of the command
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;
let me see the full script. post it on sqfbin.com
Can't at the moment or for a bit but I appreciate the response
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]
};
your error is in the bottom part
count how many squiggle brackets you have
it let me hit the ok button but it didnt proform task
listen to what I'm am saying lol. how many squiggle brackets do you have?
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;
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];
make sure you are using selection names. if you use hitpoint names you have to use setHitpointDamage
it looks like you are using hitpoint names
use <font face='PuristaMedium'> blah blah </font>
Is there a way to make an object give off ambient light?
sure, create a lightpoint and attach it to the vehicle
like this>?
private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];
{
_selection apply
_vehicle setHitpointDamage [_x, 1.0]
};
only for that one?
some of them are annoying to find out which one is which. diary uses the <font></font> tag
oh
nope, bottom part is wrong again
i got 1 pair of { }
look at the syntax of apply
Sorry i'm new at this. Are the light points put in the objects Config file?
oh your looking to do a mod?
Yeah I need to make objects like up just a little to see them at night
so to be sure, you are making an addon, not just a mission
private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];
_selection apply {
_vehicle setHitpointDamage [_x, 1.0]
};
???
That is correct. Making objects for a Mod.
Thank you : )
well test it
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];
i did global space error
if you are using an init box yes you will get that
what are you placing the code in?
...... init
private _selection = [
"hitEngine2",
"Hitengine",
"Hithull",
"Hitengine_l1",
"Hitengine_l2",
"Hitengine_r1",
"Hitengine_r2"
];
_selection apply {
_vehicle setHitpointDamage [_x, 1.0]
};
the full full code
well _vehicle is undefined as well then
ripp
don't give up, keep sluggin. i'm up for a few more hours
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)
how do i set that up to a trigger then?
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
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]
};
sorry i still cant seem to make it work
when u deactivate a trigger that means u left the zone right?
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
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";
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. π€
if you need it faster, do a onEachFrame handler or use CBA's each frame handler
event handlers
CBA has a player view handler i believe. i think its under player event handler its a vision mode handler for thermans/NVG etc
Thanks guys, i will try my luck π
looks like what I said doesn't work 
yup, it works when you get out of a vehicle/gunner etc if you use that
addMissionEventHandler ["EachFrame", {
if (cameraView isEqualTo "EXTERNAL") then {
player switchCamera "INTERNAL";
};
}];
run it on your clients
Thanks, already had the BI wiki page open. I will try that and see if it's faster.
Still to slow for my taste. Just the option to block the "cameraViewChange action" on demand would be perfect.
how is an average of 40 frames per second too slow for you?
and it fires on every frame...
then block the camera view key
it's called "personView"
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 π
Works perfect. Sometimes being lazy and asking a quick question here, saves hours of testing. I appreciate it π
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
Anybody got an example of how to put addAction on a unit have it just output globalChat?
wdym?
ExileClientForceFirstPersonModule
set the variable onfindDisplay 46instead
it doesn't have the same life time as the mission namespace
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"];```
see the wiki
_this is not an object inside the addAction code
it's an array
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?
no. like I said, see the wiki
Wiki says _soldierOne globalChat "Show this text";
see addAction
ill give you a bigger hint. look at the params of the addAction on the wiki
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
so it could stop working after while ?
π€·ββοΈ sry iam stupid and never had issues the way i did
when you restart the mission, display 46 doesn't get recreated
but the mission namespace will be cleared
It's for Exile, we don't restart the mission. We do a full server restart after 3 hours runtime.
Β―_(γ)_/Β―
your choice
if (findDisplay 46 getVariable ["ExileClientForceFirstPersonModule", -1] == -1) then {
_EH = findDisplay 46 displayAddEventHandler ...;
findDisplay 46 setVariable ["ExileClientForceFirstPersonModule", _EH];
};
Thanks i will try and compare and look for issues the way i did it. π
if you haven't figured this out yet:
this addAction["Talk", {
params ["_unit"];
_unit globalChat "Hello."
},"",1,true,false,"","_this distance _target < 3"];
I actually got it working with _this select 0
essentially the same thing as params ["_unit"] just more wordy
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;
}
}]; ```
use the same thing but have a variable that changes depending on if you are currently muffled and do your results based on that condition. all in one.
I tried that and was having syntax errors and didn't know why. I'll keep trying
well post what you had then
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
missing }
oh
also:
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
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;
}
}];
&& has a very low priority
I got it
what you wrote will throw an error
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
did you restart the mission?
(you shouldn't have btw)
you have to add a "duplicate guard"
otherwise you'll end up adding multiple EHs
one undoing the other
here's an example
if you were testing in Eden, you have to close the mission completely first before trying the new code (not just restart it)
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
why do you use inputAction "help" to begin with?
didn't you say you wanted to use H?
yes, I'm not sure how else to do it honestly
I know about those but how to I put that into a script without errors
read the page
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)
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)
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
@tight cloak Are you making your own mod or are you using ZEN Custom Modules (https://zen-mod.github.io/ZEN/#/frameworks/custom_modules) ?
Either way, HCs probably don't care if you teleport them π
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
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?
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
["Custom Modules", "Cool Hint", {private _pos = _this select 0}] call zen_custom_modules_fnc_register
and i can refer to _pos in the script and it will fetch the modules local position?
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
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
this one is being used once
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
["Custom Modules", "Cool Hint", {
private _pos = _this select 0;
{_x setPos _pos} forEach allPlayers;
}] call zen_custom_modules_fnc_register;
its just going to register a module that does nothing tho if placed if its like that
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
the position is in ASL
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)
["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
//...
if you make a new script instance anywhere, you need to pass params again accordingly
and how would i do that?
the exact same way...
i am both stupid and learning sqf, could you spell it out for me?
please :3
never mind i did it
am just slow
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.
your sleep is going to delay that conditional check
so say he takes damage at second 2, he will have a long time before the check that he is dead
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
add a conditional that tells if he is in an animation through a variable or something
ait, will try
do i put the event handler inside the while loop or do i put the while loop (w/everything else) inside the event handler 
i havent used event handlers much so i dont really know how to use em
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
alright, thanks
oh my, more event handlers 
@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.
The mod has recieved its last update with v2.04. This has been month ago.
GitHub != Steam Workshop π
that was gonna be my followup question lol
how do i test if a unit is freindliy or enemy of another unit?
(without hardcoding sides)
there it is
turns out that EH's are actually pretty easy to use and now everything runs as intended 
thanks :)
i've read that kbtell didn't really work well on dedicated servers in the past... is that still the case in 2021?
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", {...}];
You could add them and check.
Indexes are per object.
so... both would be 0, yes?
not necessarily
you're not the only one adding EHs to objects
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
TAG_idOfMyEh = u1 addEventHandler ["Killed", {...}];
save the EH index in the same namespace/varspace as the one that EH belongs to
this is bad
I know but you should show a proper example 
private _ehId = u1 addEventHandler ["Killed", {...}];
u1 setVariable ["TAG_idOfMyEh", _ehId];
Leo is making sure everyone who dares studying SQF regret it. 
I'm making sure everyone who studies SQF does it properly 
if !(_leopard analyzeScript _code) exitWith {_leopard screamAt ownerOf _code}
I prefer to give simple examples and let them figure out the rest ;P
So many ways to answer this, which one should I use... I hate it when I have so many options, I end up getting lazy and use none of them.
does the screenshot ""; command work in multiplayer?
only one way to found out
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?
netID is always constant. Variables can be reassigned
you can use them to map "objects" in a hashmap
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
what does it use in SP?
oid
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
If you don't know what you could need it for, you don't need it
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
Why would you want to convert a object to string and back for remoteExec?
You can just pass the object directly
I saw it as an option for the JIP parameter
I dunno, I'm just curious about the feature
You could also just pass the object as JIP parameter
Is there a variable I can use in scripting to track FPS?
diag_fps
Thank you. I'dve google'd it but I had a feeling...it might not be the best of ideas.
1 / diag_deltaTime
Thanks. average will do fine.
I'm coding an automatic dynamic spawn radius adjuster for alive...
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...
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...
what is "144 spawned"?
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...
sounds lik... Hypoxic beat me to it, oh well, arma3 has now 288 group limit https://community.bistudio.com/wiki/createGroup
is this thing exists ? iskindof WheeledAPC
nevermind its Wheeled_APC_F
I know itβs a bit late, but:
Use soundVolume to check whether the earplugs are in or out. Also use DIK key codes and the β_keyβ param in the EH.
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
i managed to make very aggressive but not-dangerous AA fire, for pure ambience:
https://youtu.be/zQnXt0NqMEU
how do i have an ai plane and crew get deleted on trigger?
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
i have a question,how do i edit BIN files
You just unnecessarily overcomplicated, only thing you needed to do was check the inputAction outside of if (a==1) condition(separately) , plus the bottom soundVolume checks are for what? You only check it once?
Use something like this in the On Activation expression of the trigger:
{ deleteVehicle _x; } forEach crew MyPlane;
deleteVehicle MyPlane;
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.
I didnt say u didnt understand, I say that you unnecessarily complicated it, plus the code in this shape will still not do what you want, because you only initially check the soundVolume , it should be inside event handlers as well. But up to you to make assumptions about my comments.
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
thanks
it's not an assumption, I just don't understand. If I overcomplicated it that's why.
I'm trying.
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
I understand that part (now)
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;
}
}
}];
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
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.
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
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)
I'll get the correct code if I figure it out
dont use DIK_H, just use the corresponding number, DIK_H is defined in somewhere , you just need to define wherever it is defined, just dont do it , use the number instead, compare with _key coming from displayAddEventHandler
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...
which code, the new one you mean?
the old one
why couldnt you remove them?
idk, nothing was happening
when you press any button, it should be removing
should I start saving all the iterations of my scripts? I feel like it'd be helpful right now
up to you.
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
event handler returns you some parameters in a magic variable called _this.
You retrieve it from there.
or as it is written there, you just call it with as in here...
https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onKeyDown
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
so I need ( _this select 1 ) for _key then?
yes.
thank you so much.
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.
I didn't understand where to put the params [] part..lol..I'm dumb..
it is ok
or how to reference them with this..idk why
and the _key you receive in there, is basically the stuff in the list of DIK_KeyCode page
gotcha, and the _key is an integer not the DIK_ID?
no, DIK_ID is a reference to that integer but it is defined in some file that you need to import.
so if I did use the DIK_ID it would be an undefined variable
pretty much yes, cos you do not have the file that defines all DIK_ID
got it π
#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
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
it should be wherever your script is
ok gotcha
thats basically copy pasting all the text into there without actually doing it, in a clean way, nothing else.
π₯³π₯³
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" } }} ];
Well yeah but you can use only one event handler instead of 2
if soundVolume is 0.2, earplugs out, else in
how are elif statements written
you dont need elif, you got 2 conditions
there is no else if in here.
I knew that, was wondering what the way to write a similar statement would be
apart from nested if, there is switch
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
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?
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
thats... interesting. they are usually death dealers
Anyone got a preset that spawns ai in and just lets the patrol im using altis
as well as how do i start scripting
litererally flew straight at 50% thot and no flares not a single hit lol, is it cuz im using an rhs plane and dlc aa?
Start here and read everything. When you have some basic understanding, hit us up and we will help you further
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
vehicle classes like "HelicopterExploBig" or "FuelExplosion"
they're not vehicle classes
configFile >> "CfgAmmo" >> "FuelExplosion"
configFile >> "CfgAmmo" >> "HelicopterExploBig"
Vehicle objects sorry, theyre under createVehicle so my mind instantly went to that π
Thank you!
ammos can also be created using createVehicle
Gotcha, that makes sense π
Anyone mind helping me set my files up im just retarded and cant read
be more specific
Scripting files. So i script in a file then import them into my arma mission
so go to the editor and the first thing you want to do is save the mission because that will create the folder that you want to work in. its under documents > arma 3 profile > missions or mpmissions
Ok now what?
do you have a program that you want to script in? I'd suggest visual studio code
im using notepad++
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
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
the files you will use are .sqf .ext .hpp mostly
Ok
with .sqf being your main dude
K
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
Ok
im useing vma so
also, read that link i posted. i can tell you didn't read it at all
you won't make it that far, in this, or life with that attitude lol
you can hate it, but you have to do it
yea that should be good just needed some basics so start
Agreed i can do it just kinda hard
I'm doing a jet pack with scripts, there is any way to add visual fire jets to it?
https://imgur.com/yHOmoTo
this might be the greatest idea
Lol it's a gas tank
LMFAO
but yeah, you can use particle effects and create your own visuals
Blender i belive works
Alright for mods you do
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!
Blender does nothing to do with scripting
trying to look for jato but cant find any
yea, i know you can insert them and use them just on a bigger scale
@fair drum nice i will tack a loook, thanks.
This can be done without mods?
Thanks.
Can be config side, but you don't need a Mod in this context
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
Eh, I'm not interested with that project more like Arma anymore. So no, sorry
the last part of your phrase, you mean you aren't interested in arma anymore as well?
Yup. Sometimes I play and mod it but super barely
gotcha
anyone know if it's possible to remove certain LODs for buildings or plants via addon or scripting?
scripting no. addon yes
but requires modifying the model
the lod control is baked directly into the model?
So the addon would have to contain modified versions of all of the models it wants to affect?
yes
Script back pack with smoke: https://imgur.com/djn4dC0
Now going to the setVelocity part
Why does my mission.sqm look like this? 
https://imgur.com/a/Kxa4RRY
And is there any way to make it readable?
untick binarize box, uhm cant remember where it is, in attributes menu I think. you'll find it (this is on eden mission editor).
will that keep the scenario as a .bin when someone downloads it from the workshop
no idea, I dont do steam.
bin missions on the workshop are actually pbo
it's not the same as binarized config
so yes, they'll see it as a bin
cool, thanks
UBER Jet Pack: https://youtu.be/xnlcxR7aLSU
Sadlly the smoke stretch a lot when the player is moving.
i think you should disable animation and force a T pose during flight
you can't "force a T pose" 
this is... unfortunate
the mission sqm has been binarized, as @bitter magnet already pointed out. you can also debinarize the mission file afterwards with https://community.bistudio.com/wiki/CfgConvert
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?
is the CBA slider uses only integer numbers ?
i tried double and didnt work
you can set the amount of decimals in the setting thing iirc
nope
is the CBA slider uses only integer numbers ?
afaik no
Can use particle effects for that quite alright
yes but when i write the default values in the XEH_preinit they switch to integer
can you show the code?
[
"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
well you are passing nil to the decimal parameter
that's your issue
or wait nvm, ahh the formatting you use 
its not the nil, it's the 4th argument in the slider parameters, shouldn't be 0
yeah i suspected that changed it to 0.1 and the setting turned from 5 to 005 lol
its supposed to be an integer, that denotes the number of trailing decimals
[0, 100, 0.5, 2] will display 2 decimals
not really, you can make it look not utterly terrible at significant performance cost, or you can make it look like puke with little performance cost - neither option is really acceptable.
No, i managed to make a pretty devent dust/sandstorm thing. Runs quite well and looks okay
got a picture or video of it somewhere?
what does "runs well" mean exactly? i need the effect to persist for the whole duration of a mission, while i am already using other effects like volcano smoke, and ash in the air, so i don't want to add to that unless it is really good and doesn't cost more than 1 FPS.
You want an effect without 1 fps cost? Are smokes banned in your games by any chance? 
oh got it thanks !
there you go, a sandstorm/dust script
https://drive.google.com/file/d/1nQq07D5CeGHGfM17Nv2kFbvyDBmBFC9w/view?usp=sharing
The comments in it are not correct, its a function not a script anymoe
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.
thanks, will have a looksie
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 :))
you only need to change the script to make the particles worldspace dependent not attached to a player
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:
- particle emitter for the volcano smoke (visible from everywhere regardless of viewdistance)
- particle emitter for ashes in the air (follows player)
- third emitter for the fake fog surrounding the whole island (visible from everywhere).
- 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.
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 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. 
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?
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).
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.
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."
no it won't, it will change to whatever the fog is set to on the server.
Ok, I wrote everything for no reason then , since it looks like you didnt read what I said.
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 π
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 read this
if
i am still not getting it
he compares date and fog sync
he does not state "setting date will fix your fog"
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? π
spam setFog in your client who is not server, and see if it is working or not.
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.
@winter rose Dr.House, I need the strongest prescription painkiller you have in your hand.
Q: when creating a custom radio channel, i.e. radioChannelCreate, what is the '%UNIT_NAME' thing all about? seems like it may be a unit meta tag? please clarify. thank you.
https://community.bistudio.com/wiki/radioChannelCreate#Examples
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.
gtk thanks
You know what would be helpful? If instead of your sarcastic posts, you would try to explain what you mean.
Im not gonna write the same things a 3rd time. Even if the 3rd time is usually the charm.
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.
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. 
So... you did just wrote the same nonsense again. Well, thank you.
@supple matrix basically disabling server sync is impossible, so go for global fog. problem solved
Wait, so, you are telling me that this whole debate was for nothing? Or are you being sarcastic, i just cannot tell. π
it's factual - and it was miscomm
you asked for "how to replace real fog" and Talya answered "there is a way you can have local settings"
you had in mind "how to disable server sync", which is something entirely different
so
Q: can one disable daytime/fog server sync?
A: no
aha, that sort of thing happens to me a lot, sorry
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 (?)
according to the docs, seems it might be the case
https://community.bistudio.com/wiki/Channel_IDs
once we are clear of the actual creation
dunno what you mean π¬ of the when and what
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.
some commands can only edit custom channels
and to my earlier question, setCurrentChannel along the same lines, right.
right, past edit... normal operation, navigation, etc.
setCurrentChannel channelID
customChannelID radioChannelAdd units
i.e. AFAIK, channel created, but I do not see it in the set of channels I can scroll with <|> or up|down
hmm... so we need to continually add units to the channel for them to be able to engage with it?
well, yes
gtk, also, a bit awkward, but ok...
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
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'
that part is up to you!
no worries, thanks for the orientation
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?
you could use it without music and use playMusic altogether
Oh, I hadn't thought of that, thanks!
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 π¦
Is there a way in game to see what variables are attached to a player via the admin console or dump?
allVariables player
@distant oyster Thanks, but how do I display them?
the values?
yes.
allVariables player apply {[_x, player getVariable _x]};
so you get an array of arrays like
[["name", "Terra"], ["BIS_fnc_function_value", 1234]]
Ok, then I should be able to dump that to the RPT?
also possible:
allVariables player apply {diag_log format ["%1: %2", _x, player getVariable _x]};
dumping it as an array might get cut off
so... to clarify, for bits like createMarker, we need to use the normalized ID, that is, for custom ID 1, that would be 6, correct, IOW, +5?
understood, thanks
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 not really my question. IOW, passing 'code' over the wire remotely. i.e. {_this radioChannelAdd [player]}
code is code, and it will be executed on the client
Yes passing code is a thing, always has been
so player will designate the local player, as it is run on the client
the player is evaluated on the target machine not yours, you just ask some machine to execute a set of instructions on their part
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.
wasn't sending code over network bad?
you send the whole code as text, and the target has to recompile it.
Depends on your definition of bad
okay didnt know that. i thought it was getting send compiled
kinda my impression also; any time an RI (remote invocation) is involved, I cannot imagine it is going to be a strong performer.
but like said, 'depends'.
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;
Is there a way to detect if an object (or just a unit at a compromise) is currently touching a surface/in free fall?
speed, bear in mind does not tell you absolute momentum does report positive or negative
A walking unit has a speed more than 0.
yep, better believe it; you can put a watch on speed player in systemChat to prove it
also more or less than zero, negative for 'backward' momentum. I usually do abs speed _object for momentum.
note that precision should be added to the wiki as to whether it works on buildings or not (I think it does)
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;```
okay, I think I am successfully creating the custom radio channel.
still do not see it among the <|> and up|down scrolling.
Bro I will just send you my script
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.
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
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.
save the random choice in its own variable and print that
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];
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};
6 enableChannel [true, true] but I do not have it in the set of radios
Hopefully it works for the ships!
@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β;
};
};
}];
Yeah I switched it to a 50% if statement right after posting because that made more sense
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
private _jakerodgear = selectRandom faceWearList;
player addHeadgear _jakerodgear;
hint format["Hey, Jakerod is wearing: %1", _jakerodgear];
assert (headgear player isEqualTo _jakerodgear);
the private _jakerodgear = selectRandom faceWearList; player addHeadgear _jakerodgear; isn't working either. Nothing gets added