#arma3_scripting
1 messages · Page 681 of 1
why complicate things?
triggers working out great connecting with ieds.
Q: it is safe to GC the trigger inside the condition callback, i.e. detects the ied 'went away' for whatever reason, was blown up, disarmed, etc
Is it possible through scripts to tell the third person camera to ignore a specific objects geometry?
nice effect, true to form, when I depress the IED a little in the ground, -0.0125 something like that, when it blows, it includes debris.
how do I make a enemy shoot at the player when the player walks through a trigger?
do you want it 100% hit and dead player?
not 100% but basically I am making a Vietnam mission with the new dlc and I have a sniper in a tree waiting for the player to get into a trigger where he will begin shooting at him.
I want the player to have a chance to fight back if they are lucky and spot the sneaky sniper
single player or multiplayer
Use setUnitCombatMode
multiplayer, but I am testing in single player with one character
you mean hide it but only from the camera?
via scripting, no
I just wanted it so that the camera didn't get pushed around by an objects geometry but still rendered normally. Like when you are close to a wall the camera will come in closer, I wanted to disable that for a specific object
Afaik no
Yea I tried setUnitCombatMode and it doesn't work
Because the ai doesn't know who the target is I guess
did you reveal the player to the AI?
idk how to do that?
SniperAmbush1 setUnitCombatMode "RED"; I have this
what do I need to add though so the ai targets man1?
man1 being the player
Oh I figured it out @fair drum
sorry about that
SniperAmbush1 setUnitCombatMode "RED"; SniperAmbush1 reveal man1; This is what I did and it is all good
doesn't help you for multiplayer
this is what I had so far.
// Put the following in the sniper's init box
if !(isServer) exitWith {};
this setUnitCombatMode "GREEN";
this disableAI "RADIOPROTOCOL";
// Everything below goes in a trigger
// Trigger Activation: AnyPlayer
// Trigger Server Only: ON
//Condition Box
this;
//OnActivation Box
thisList apply {
if (_x isKindOf "CAManBase") then {
SniperAmbush1 reveal _x;
};
};
SniperAmbush1 setUnitCombatMode "RED";
Hey thanks so much! Why is it different for multiplayer though and does this script need to run in a separate file in the map folder?
it tells you where to put things...
Okay cool
do I have to add if !(isServer) exitWith {}; to all my init boxes now?
And thanks so much for the help
understand that those init boxes are run on every machine, everytime someone loads the mission. lets say you had a additem command in there and you had 60 players. you just created 60 items. so the server check makes it so that it just runs once, on the server
What is a simple script I can write where you go to a body and text appears saying *search body for intel* and then it will say *no intel found* and the player will be sent to another location?
Is there a way to make a simple dialogue script so a character can talk to me and then I get an order to go to a certain point?
strange issue, I'm making a medical task for a mission with some AI set in one of the prone animations but they keep auto-healing so you can't heal them.
this disableAI "ANIM"; this disableAI "MOVE"; if (isServer) then { [[this,"PRONE_INJURED_U2"],BIS_fnc_ambientAnim ] remoteExec ["call"] }; this setDammage 0.5;
Remove their FAKs or MED kit?
The following information is obsolete as of Arma 2 v1.00. Reason: For later titles (Arma 2, Arma 3), see Particles Tutorial - Full examples.
Hey Y’all!
I have a custom static object that I wish to omit a specific type of light, similar to the continuous fire light omitted by the BI campfire, but I am unsure how to proceed.
As of right now, I have the object inheriting from the CampingLamp so it gives off a continuous Light but it’s a white/LCD light color.
Is it possible to use config Event handler to change the light’s color, I’m not familiar with Scripts but i believe it would be Setlightcolor & setlightambient. Is this doable?
OR Would it be more convenient to Script a Light point to the model’s location and find a good color match to what I seek?
This is my first project with lights and don’t know what the best practices are so I’m unsure how to approach this situation.
Thank You!
emit* ^^
Seek Lightpoint tutorial on the BI wiki @Lantern#2301 :slight_smile:
Ping
5 AM messaging is bad for my grammar, Thank you for pointing it out though 😂
I had the BI wiki pulled up while I was asking, I’ll start on my light point and learn about event handlers as I go. I appreciate it!
is it possible to use intro cams/intro scripts on dedicated servers or do they only work on sp/mp missions?
They work if executed for every player
i was planning for it to execute for each individual player whenever they join the server
that works
for text, look at sideChat then you would want to use the arma 3 framework with some triggers.
https://community.bistudio.com/wiki/Arma_3:_Task_Framework
crazy idea, has anyone ever tried procedural map gen?
something like. you have a specific heightmap painted a certain way and then you use random generation to create cities, roads between them, place trees, etc. is there an inherent limit to the count of mission objects?
Hi, I have problem with my remoteexecs if I do sqf [getPlayerUID player, (name player)] remoteExecCall ["JS_fnc_teste", 2]; the function of server sqf diag_log "Reception coté serveur"; but in the log i dont see that, my config.cpp of the server ```sqf
class CfgPatches
{
class John_serveur
{
units[]={"C_man_1"};
weapons[]={};
requiredAddons[]={};
fileName="John_serveur.pbo";
author ="John";
};
};
class CfgFunctions {
class john_fonction {
tag = "JS";
class base {
file = "\John_server\core\extdb";
class server_init {};
class request {};
class teste {};
};
};
};and the cfgremoteexecsqf
class CfgRemoteExec {
class Functions {
mode = 1;
jip = 0;
class JS_fnc_teste {allowedTargets = 2;}; // example envois serveur
class john_fnc_envois {allowedTargets = 1;}; // example reception coté client
};
class Commands {
mode = 1;
jip = 0;
};
};``` The logs do not say that the function cannot be found or that it is not allowed to be executed. Do you have an idea to solve the problem?
yeah your FPS 
every object is always "simulated" to some level
or do you mean that maps have special optimizations that you can't do at a mission level
right. and the maps can run higher object counts because they do even less simulation?
the game creates some objects only when they are needed
or maybe simulates them when needed? 
all I know is that not all objects are fully loaded in a map
but if you create mission objects, they will always be fully loaded?
hmmm
so you could script this then? making 40k trees as simple objects?
I guess no way to know without trying
short question about attachTo. I have attached two weapons to a helicopter, however the weapons can't shoot and can't rotate around. Is there something better to work with? I guess it is a limitation of attachTo? https://i.imgur.com/f0zoltH.jpeg
Code used is:
US_SupHelo01_Gun01 attachTo [US_SupHelo01,[-0.145699,5.89916,-5.23]];
US_SupHelo01_Gun01 setVectorDirAndUp [[0.00106458,0.999999,-6.36484e-005],[0.0003609,-6.40327e-005,-1]];
US_SupHelo01_Gun02 attachTo [US_SupHelo01,[0.0606022,-0.203697,-5.23]];
US_SupHelo01_Gun02 setVectorDirAndUp [[-0.000406593,-1,9.80905e-005],[0.000448534,-9.82729e-005,-1]];```
they should be able to rotate
they're just turrets
if you're using AI to control them it won't work tho
because they're upside down
tried a UAV terminal. Turret is stuck. They are B_Uav_AI at best
because well, turrets
probably just because they're upside down then
did you try an upright one?
it should work
I did not, the point of my attachTo was to have them upside down. But I will remove the setVectorDirAndUp of one turret and see if it makes a difference
yeah that works then @little raptor
but it is not exactly what I'm looking for. Is this a engine limitation that upside down turrets can't shoot?
¯_(ツ)_/¯
alright, did a FT item for that https://feedback.bistudio.com/T158456
Thanks for your help
Hi, I saw in the 2.04 update there is a Added Support for precompiled SQF bytecode
What is that?
@brazen lagoon why would we want procedural gen arma maps? proc gen looks terrible
more important would be removing paywall from terrains so they can hold a full server
maybe a gofundme, ask BIS what $$$ they want to remove the terrain paywalls
allows faster compilation and in some cases better performance
how do you delete a vehicle a few seconds after it goes through a waypoint?
so when you open a waypoint and you scroll down. you see a completed box? or on completion or something like that? a box to put code?
Waypoint Expression?
the tooltip should say something like, executes code when waypoint is completed
im not in game atm
There is On Activation
yeah that box.
@pulsar bluff proc gen does not inherently look terrible
and besides the idea wasn't even necessarily totally 100% random. maybe something like some scripts that take in some user input and then simplify the map creation pipeline
{deleteVehicle _x} forEach units group this; I know this deletes smthn, but I do now want it to delete right away as my cutscene camera needs to see it for a bit
So I want it to delete after 10 seconds or so
sleep 10; first
the script you posted will delete all units in the group of whatever unit this refers to
you gave him a partial answer
this spawn {
sleep 10;
{deleteVehicle _x} forEach units group _this;
};
awesome!
Thanks
I have a few questions though.
So instead of this can I put many units down? Like unit1 unit2 and so on...
unit1, unit2 spawn { sleep 10; {deleteVehicle _x} forEach units group _this; };
[] spawn {
sleep 10;
[unit1, unit2, unit3] apply {
deleteVehicle _x;
};
};
simple answer with what you have
Does anyone know how to make something an ace medical building via scripting?
Hey does anyone know how to get an AI to shoot an RPG at a helicopter with 100% accuracy, but no damage when the helicopter passes through a trigger?
okay thanks I will check this out
[[10005.3,16813,0], "ammo_Missile_Cruise_01", h1, 180, false, [0,0,0.25]] spawn BIS_fnc_exp_camp_guidedProjectile; Here is what I got so far...
[[10005.3,16813,0] This is the start location for the missile, but I am unsure why it is not working. I put this code into a trigger On Activation.
use a AA missile
what is the code for that, and where do I find the list of available weaponry?
Thanks man for all the help!
i think you can even use that function to launch cars
My code is still shit. lmao
I am so new to this it is not even funny so sorry about all the questions bro
because you are not reading. time to start
#arma3_scripting message
also, notice your missile start position
its in the ground
lol kk
@still forum hi sorry for tagging you but i cant find much documentation on the EH "GroupCreated"
Im trying to get the leader of the group once it is created and this is my script
_id5 = addMissionEventHandler ["GroupCreated", {
_group = _this;
_groupldr = leader _group;
_groupveh = Vehicle _groupldr;
diag_log _group;
diag_log _groupldr;
diag_log _groupveh;
}];
when running this i get this in my RPT
19:01:42 B Alpha 2-1
19:01:42 <NULL-object>
19:01:42 <NULL-object>
just after spawning in a group with zeus
I then thought it could be todo with delays but im not sure how to add a delay to let the group spawn
How do I get the object that called a script from an action? I have this addAction ["<t color='#0000FF'>Garage</t>", "openGarage.sqf"]; in my object init, and inside of openGarage.sqf I'm trying to access what I thought should be _target however that is giving me undefined
For clarification, I'm trying to get the object the action is on, not the player that did the action
where are you getting that event handler? I don't see it on the wiki
you aren't creating _target
you need params
Is that not a default?
so params ["_target", "_caller", "_actionID", "_arguments"]
GroupCreated / GroupDeleted are added very recently, 2.04?
That goes in openGarage.sqf?
ahhh I think I figured out the problem
I was trying to use _target inside an inline function
then you have to give all the params to the sqf file
_this execVM "openGarage.sqf"
now params in your script will be filled
newly released this patch and im in same boat
v useful EH but im just discovering stuff about it
its best to call it and send the group to a script and then edit the group there
got a linky to the addition page?
The params are being filled, I can access _target on line 13. But within my function I can't. I'm assuming it's because line 49 where I call fnc_spawn_vehicle does _spawnbtn buttonSetAction "call fnc_spawn_vehicle";
I'm guessing the way it handles calling a string doesn't keep access to the same scope
that's probably it
Came kinda close to a solution. _spawnbtn buttonSetAction format [ "['%1'] call fnc_spawn_vehicle", _target ];
Except I'm guessing I can't pass objects this way, it jsut turns it into a string unfortunately
that's the only instance where that EH was mentioned?
thats what I need to see. the spotrep
hmm yeah i see that. what have you tried so far? creating a new group with a single unit in zeus?
Is there anyway to remove the turrets from the military speedboats?
i don't think so. the only animation sources I have is:
[hitGun, hitTurret, muzzle2_source, muzzle2_source_rot, muzzle_source, muzzle_source_rot, ReloadAnim, ReloadMagazine, Revolving]
nothing about hiding turrets
ok cool. you looked for a hiding animation eh? good to know
yes. some vehicles (such as the wheeled apcs) have a hideTurret animation
they look pretty cool
sweet, ima go play with that then 🙂 thanks as always.
@lean anchor figured it out
you can't call leader/units/etc from within that event handler
store the group in a namespace, then use it from there
//Test Handler
addMissionEventHandler [
"GroupCreated",
{
missionNamespace setvariable ["EHThis", _this];
}
];
//Test in Debug
private _testGroup = missionNamespace getVariable "EHThis";
private _testLeader = leader (missionNamespace getVariable "EHThis");
private _testUnits = units (missionNamespace getVariable "EHThis");
private _return = format ["Group - '%1' | Leader - '%2' | Units - '%3'", _testGroup, _testLeader, _testUnits];
_return;
@lean anchor
gives me everything
@lean anchor yes there needs to be a delay, tested it with this and it worked as well
addMissionEventHandler [
"GroupCreated",
{
_this spawn {
sleep 1;
private _group = _this;
private _leader = leader _this;
private _units = units _this;
private _return = [_group, _leader, _units];
systemChat str _return;
};
}
];
without a delay, the handler fires without grabbing the units before they init
would that be faster than if i was exec to another sqf file?
im wanting this specific thing to be as fast as possible
and yeah, i found that passing it out works
Exec makes it slower
may have to delay it by a frame.
It fires as soon as the group is created, not after the group was created and all possible members were added some time later.
how would you personally delay it a frame without heading into scheduled?
you need scheduled inorder to use sleep
Good Morning from England,
Would anybody here be able to assist? I want to be able to end a mission upon the condition that a given task is completed.
I have set up a trigger with the condition of
taskCompleted inteltask1;
with an on activation
"inteltask1" call BIS_fnc_Endmission.
Though this doesn't seem to work. I imagine that that taskCompleted condition doesn't function how I understood or maybe I have named a variable incorrectly. Maybe there is also a way to do this by usind the End Scenario Module in the editor?
Any advice is greatly appreciated.
Thanks
Use BIS_fnc_taskCompleted instead of taskCompleted
You can also sync the trigger to the end scenario module, but that has less options than BIS_fnc_endMission
also SP or MP?
SP Thanks
Let me give that a go, I am quite new to the editor and scripting so learning out of necessity as I go along,
Sure.
do I need to call this function in the condition of the trigger or is it sufficient just to state it?
in the condition
okay, just checked the syntax on the wiki, I will test it now,
ahh excellent it works as intended! thanks you so much!
yw 🙂
I would use CBA's execNextFrame
Anyone have solution ?
try without an addon first - also without MP exec restriction, just to see if it works
Does CBA_fnc_addClassEventHandler not work on buildings such as "Land_Cargo_HQ_V1_F2 or flags? And if not, does anyone know an equivalent way?
hello all again, i think this is the right channel. But for structured text is it possible to position the text more precisely than what i have below 🤔
cutText ["<t valign='bottom'align='left' color='#813b07' size='2'>testtext</t><br/>***********", "BLACK IN", 10, true, true];```
I don't have any mistakes except this one but I don't think it concerns my concern : sqf Setting invalid pitch 0.0000 for L Alpha 1-2:1 REMOTE
Does it work without the addon thing - that's the question
the diag_log is not work on my log server, but for the sqf [] call compile preprocessFileLineNumbers "\John_serveur\core\extdb\fn_server_init.sqf"; it work
@grizzled lagoon What about [] call JS_fnc_server_init?
it is for load extdb 3
But does [] call JS_fnc_server_init work too?
Yes it work no problem
I don't know if a client can ask for a function to run if it is not defined client-side too
as in [] remoteExec ["ServerSide_Only_Function"];
Local functions work, see last Note on remoteExec.
cool! thanks 👍
Yes on init un spawn local functions for remoteexec
any ideas from my thingy above how i would do whats in the gyazo? https://gyazo.com/058b76106a3c0e2bb540efd899c3d09b
Im not even sure such alignment is possible at least from what i have tried🥲
So diag_log in JS_fnc_server_init works but diag_log in JS_fnc_teste does not work?
Yes
Can you post the source code of JS_fnc_teste?
Use the dynamic text function
First sentence from wiki about cutText: "Displays a text message in the center of the screen". That means it does not help you to display text on the bottom left corner.
Link to Hypoxics suggestion: https://community.bistudio.com/wiki/BIS_fnc_dynamicText
Is there any API for extracting real-time info from the server (player positions, heading, speed etc)? Looking for possibilities to make a real time browser map for a server to use in ATC-operations.
AAA very nice thank you @fair drum @rancid mulch
and i presume id use this same thing if i wanted different messages to appear in different areas of the screen consecutively?
sorry for my late, ```sqf
params ["_uid", "_nom"];
diag_log "Reception coté serveur";
private _query = format ["INSERT INTO personnage (uid, nom, nombre) VALUES('%1', '%2', '0')",_uid, _nom];
dialog format ["Format sur envois fnc %1", _query];
[_query,1] call JS_fnc_request;
private _query = format ["SELECT nom, nombre FROM personnage WHERE pid='%1'", _uid];
private _result = [_query,2] call JS_fnc_request;
diag_log format ["resultat %1", _result];
private _query = format ["UPDATE personnage SET nombre='%2' WHERE uid='%1'",_uid, ((_result select 1) + 1)];
[_query,1] call JS_fnc_request;```
dialog format
There is an old and dead project. Code is available on github.
https://forums.bohemia.net/forums/topic/168411-real-time-browser-map/
Another project, which does the data extraction on the client:
https://forums.bohemia.net/forums/topic/171846-athena-an-arma-2nd-screen-application/
And a 3rd one here. Basically only the map in a browser but scroll to the bottom and see ctab project:
https://jetelain.github.io/Arma3Map/
Oh yes
Thanks McDodelijk! I have looked through these before except for Athena. I will take a look.
Athena is not open source unfortunately.
Does everything work now?
The last argument is which rsc layer it's going to use. Make sure that number is different for both of them to show at the same time on screen.
yeye so for example if i wanted to have the text on the bottom right fades out just as another message in the top left fades in, it would be possible?
You just have to do some timings with them. Add some sleeps in the script etc
exactly what i was thinking, thats perfect thank you
Yes thanks you ansin11 and Lou
You can write your own with SQF scripts and extensions
Unfortunately I'm more on the web side of things, hence why I'm asking this question in the first place. Any pointers in the right direction are much appreciated! 🙂
Is there a way to stop Portable Helipad Lights from blinking instead having them either switched on or off?
You might be able to use animateSource ["MarkerLight", 0 or 1]
That doesn't work unfortunately.
Hi! I need some guidence once again, can someone please tell me why I get an error message on this script?
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
I'm trying to make several units guard a building
if !(isServer) exitWith {};
_unit1 = newGroup1 createUnit ["rhsusf_army_ucp_squadleader", [14589,16754.2,0], [], 0, "FORM"];
_unit1 setDir 135;
_unit1 setFormDir 135;
_unit1 setPos getPos _unit1;
[_unit1, "GUARD", "FULL"] call BIS_fnc_ambientAnim
_unit2 = newGroup2 createUnit ["rhsusf_army_ucp_squadleader", [14585.2,16750.5,0], [], 0, "FORM"];
_unit2 setDir 135;
_unit2 setFormDir 135;
_unit2 setPos getPos _unit2;
[_unit2, "GUARD", "FULL"] call BIS_fnc_ambientAnim
Thank you, didn't know that
So what isn't working?
I get an error message
That says what?
hold on, I will start the game
[_unit1, "GUARD", "FULL"] call BIS_fnc_ambientAnim
One error is in this line
Open your rpt
no need to start the game
!rpt
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/arma.RPT
To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
save it and copy the link
What is the error?
[player, "STAND1", "ASIS"] call BIS_fnc_ambientAnim;
this is the example from bi wiki
I don't get it where there is something missing
Exactly
What now?
Error setdir: undefined varable in expression newgroup1
What is newGroup1 ?
I guess the group for my _unit1
Did you create that prior the creation of the unit?
if !(isServer) exitWith {};
_unit1 = newGroup1 createUnit ["rhsusf_army_ucp_squadleader", [14589,16754.2,0], [], 0, "FORM"];
_unit1 setDir 135;
_unit1 setFormDir 135;
_unit1 setPos getPos _unit1;
[_unit1, "GUARD", "FULL"] call BIS_fnc_ambientAnim;
_unit2 = newGroup2 createUnit ["rhsusf_army_ucp_squadleader", [14585.2,16750.5,0], [], 0, "FORM"];
_unit2 setDir 135;
_unit2 setFormDir 135;
_unit2 setPos getPos _unit2;
[_unit2, "GUARD", "FULL"] call BIS_fnc_ambientAnim;
That means newGroup1 is undefined
No, whats that?
newGroup1 = createGroup east;
prior to the createUnit command
same for the second group
Ok, I'll try
Thank you once again! It works now
Awesome
_unit2 setPos getPos _unit2;
Also, this doesn't make much sense. You can probably just remove it
Ok, I used that one before when I spawned a vehicle and wanted in a specific direction, thought that I had to use it when spawning units to
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
[_unit, "STAND", "FULL", { (player distance _this) < 5 }] call BIS_fnc_ambientAnimCombat;
if I want the unit to exit the animation and it's on the same side as me, what do I put in the text where it says "player distance _this"?
So for me to understand that, does that mean that the Ai only recognizes Ai on the same side in a 5 meter radius?
when I put down an enemy Ai near the Ai with the animation it doesn't exit the animation
if !(isServer) exitWith {};
newGroup1 = createGroup [west, true];
_unit1 = newGroup1 createUnit ["rhsusf_army_ucp_squadleader", [14589,16754.2,0], [], 0, "FORM"];
_unit1 setDir 135;
_unit1 setFormDir 135;
//_unit1 setPos getPos _unit1;
//[_unit1, "GUARD", "FULL"] call BIS_fnc_ambientAnim;
[_unit1, "KNEEL", "FULL", { (side _this == side player) < 5 }] call BIS_fnc_ambientAnimCombat;
hey guys I am trying to make the task complete when destroying AA and Artillery pieces , this is my code
!alive Mortar1 && AA1;
I tried it in game and gave me error
yeah you have to add eventhandlers that auto end the animation on danger or similar.
yup
even for being killed iirc
you can only have one paramter for the function "alive", youre trying to pass 2.
!alive Mortar1 // boolean, true or false
AA1 // object
true && object // error
// proper way:
not alive Mortar1 && not alive AA1
!alive Mortar1 && !alive AA1
//or
[mortar1, AA1] findIf {alive _x} == -1;
Oh thanks guys , it had me stumped for a bit lol
I was about to write the "or", so mutual -ninja actually
😄
if you place down (obsolete) brackets in your code, it gets a bit clearer as to why your way doesnt work:
(!(alive Mortar1)) && AA1;
but bigbrain could oc set AA1 to value = true, since SQF isnt statically typ(ised(?))
(dont do that)
Am I right to assume that there is no command to check whether simulation is disabled by dynamic simulation system? 😦
by it, no iirc
that is a 🦆ing bummer
hm maybe there are eventhandlers for that that would let you log it?
very wild guess
well a simple dynamicSimulationSystemEnabled && simulationEnabled should do, provided that you do not disable simulation manually
check its leader then 😬
that's not the same
unfortunately.
we'll get 'em next time! 🐍
time for a ticket!
all these things should automagically go into the arma 4 git feature request tracker
damn i was to slow 🐌
How do I go about retrieving linked objects?
linked as in modules?
Doing Sync To, then using synchronizedObjects returns an empty array
like attaching an object in the editor
attach != sync
inside the Editor use the 3den* commands
I want to link an object to the garage to use as spawn points
Sorry. Just an object I've placed down, with an action on it. When the player uses the action I'm trying to get an array of linked objects to spawn a vehicle at
why don't you record the posATL and dir of each of the linked objects and just use those in the addaction script?
Ideally I want to be able to just link positions to the garage object that I can move around without having to use specific object variable names. That way I can have multiple garages where I can add/remove/move spawn points easily
And potentially another script in the future to set spawn points during runtime
So my idea was that any object with the garage script as an action would look through some list of spawn points when you do the action, where the list could be modified and not hardcoded
I found this, but it's still an empty array when I either Link or Sync To https://community.bistudio.com/wiki/get3DENConnections
what type of object do you use?
One is a repair depot, which has the garage script on it. Then the other is an invisible helipad
synchronizedObjects don't work on those afaik
you are over complicating this. just select all the positions of the objects you want, right click select log -> positions to clipboard and just paste it in a variable for init and just call a select random of that variable for a position
no need for that either.
Yes I'm fully aware I can do something like that. But I'm trying to not have the spawn positions hard coded
what do you mean by hard-coded?
If I just paste the positions into the script I can't move spawn points around while playing
And any time I want to make adjustments I have to go back in and copy paste new positions
It's very poor coding practice
not how sync'd objects would work anyways
just use them as arguments for addAction then
its a combination of conditions with setCaptive
Then I am limited to a specific amount of spawn points
then use setVariable
My end goal is a base building scenario. Where there could be any amount of garages in the game, with any amount of spawn points in use by each one at undetermined positions
how do you "determine" them then?
why not use the alternative syntax of getPos or use BIS_fnc_findSafePos? with the garage object as the center
Some method of spawning a garage initially, then there will be an action to add a new spawn point. You move to the position, and use some action like "Set Spawn Point Here". It then adds your position to the garage somehow so when you use it as a spawn, it has its own list of positions
setVariable it is then
The reason I was trying to use links in the editor is because I want to have premade garages as well
Okay I think I'm on the right path now then
Thanks for your help
// your code here
if (hasInterface) then {
private _zeus = (allMissionObjects "ModuleCurator_F") select 0;
_zeus addEventHandler ["CuratorObjectPlaced", {
params ["_curator", "_entity"];
if (_entity isKindOf "Land_GarbageBags_F"}) then {
deleteVehicle this;
};
}];
};
how to fix this so it works?
deleteVehicle _entity;?
Remove the excess } in the if-statement.
this didnt work
if (hasInterface) then {
private _zeus = (allMissionObjects "ModuleCurator_F") select 0;
_zeus addEventHandler ["CuratorObjectPlaced", {
params ["_curator", "_entity"];
if (_entity isKindOf "Man" && {(side (group _entity)) isEqualTo EAST}) then {
null = _entity spawn INF_fnc_infecthim;
};
}];
};
but this works so probably isnt the } the problem
Not sure if this is the correct channel to ask. But I got a question about best-practices for signing of mods. So for mods that has server-side code creating a new key-pair for each update is, as I understood it, best-practice as it ensures that any client only joins with the mod version that match the server-side "mod code".
However for purely client-side mods would you still create a new key-pair for each mod update? Or would you just use the same key as there is no server-side "mod code" to match?
I can see the benefit of using the same key would save the server-admins from having to update the key upon update. While the negative part is that the server-admins won't see and test the changes a update brings, before there could be clients on the server using that update.
There is no need to update the key
just sign the mod with the current key. the signature will be updated to match the changes
Cheers. Will do that. 🙂
I need a piece of code that will delete all vehicles within a marker area, but I can't figure out how to go about doing this. It seems simple, I just don't know what to do
inAreaArray, vehicles and deleteVehicle
thanks. i'll figure it out
this isnt related to my last question, but how does this code look?
_spawners = allPlayers inAreaArray "VehicleSpawningArea";
[_spawners, ["Please wait before spawning another vehicle!"]] remoteExec hint;
units inArea?!?
yeah i have no idea
hint in forEach?
I don#t even know what you are trying there
read docs of units, inArea, hint and forEach, maybe also format
heres what im trying to do
I have an action that spawns a vehicle. i want to limit how quickly players can spawn vehicles, which i have already done. When it stops them from spawning a vehicle, I want it to hint them that message. So, what I did was I made a small area around the action, and I want it to hint all players in that area
inAreaArray
okie
but hint forEach makes no sense
is that because hint is local?
do i need to remoteExec?
wat? no.
because you only see one hint
what's the point of forEach?
Yeah, that is true too
ok ok ok
i get it
i can use a single hint command to hint multiple units
so, an array of units
just remoteExec the hint to all players that are in the spawn area
ok
also when I do remoteExec on hint will it look like this? I am guessing I am completely wrong. just trying to remember what it looked like last time I used remoteExec
[_spawners, ["Please wait before spawning another vehicle!"]] remoteExec hint;
Dont try to remember what you did, try to open wiki of the command if you do not remember the available syntax
Memorizing does not really help when you need to alter things.
There is literally an example on the remoteExec page. Please read it
i know but im always confused about remoteExec syntax
Invest these 5minutes
even when I read the wiki
There are 11 different examples on the page.
There is a direct example of hint usage.
["Please wait before spawning another vehicle!"] remoteExec ["hint", _spawners, false];
You can omit "false" since that's the default
Just make sure you _spawners is correct now.
read allPlayers
ok
That's what you want to use
alright so heres what i have now:
_spawners = allPlayers inAreaArray "VehicleSpawningArea";
["Please wait before spawning another vehicle!"] remoteExec ["hint", _spawners, false];
there is also a pinned message
Looks good if "VehicleSpawningArea" is a area marker
_cars = vehicles inAreaArray "CarSpawn1";
{ deleteVehicle _x } forEach _cars;
so my goal is to delete all vehicles inside a marker ("CarSpawn1"). Will this do the trick?
did you try it 😊
yeah lemme try it
also can I do something like this where I have 3 different variables and I just want it to wait until at least one of them is equal to zero?
waitUntil { s1 == 0 or s2 == 0 or s3 == 0 };
waitUntil { 0 in [s1, s2, s3]}; would work as well
or s1 * s2 * s3 == 0
Q: working on a mission/mod, I noticed that my side flips from playerSide or WEST to ENEMY after engaging several EAST faction units. why is this? and is there a way to prevent it?
I'll elaborate a bit, it matters because I am also counting units by side, so counting on the alignments to be dependable.
math haha
because of friendly fire which adds negative rating
use a HandleRating event handler to prevent negative rating
player addEventHandler ["HandleRating", {
params ["", "_rating"];
0 max _rating;
}];
friendly fire? hmm... so I am setting friendliness as well, could that be it?
mainly wanting to account for civilian disposition toward players, that sort of thing; but I was wondering if that also deals with opfor aggression towards blufor?
probably yeah.
even destroying your own vehicle counts as friendly fire
right I would expect that, at least, i.e. own vic destruction
okay, that's a clue where to begin looking
what does it prevent? friendliness from being evaluated?
you won't get negative rating for friendly fire
so I could set that, but really the root cause is to use the friendliness better. east+west should always be aggressive to each other, no half measures. civilians is another question.
thanks
follow on question, I guess there is no way to identify the "other" unit in the rating evaluation short of bookkeeping hits and kills?
not really. you need another event handler on the other unit
not exactly what I was asking, case in point, blufor engages opfor, blufor gets a rating evaluation. but we do not know whether blufor was engaging opfor by that event handler.
yeah you don't
so in other words, we might "allow" true friendly fire, but might filter true enemy fire
that's what I said
you need an even handler on the other unit to detect he is being hit
like hit, handleDamage, etc.
right, okay dokay, thanks
thanks @little raptor @fair drum got my garage working 😄 https://www.youtube.com/watch?v=l2rwhFahceo
still needs some more work, I want to add camouflage selection, and display the top speed and seat count as well
You ended up doing what I pm'd?
I properly engaged my first couple of sector captures today, including OPFOR units spawning in. And with a little help from a damage reflection god mode, jammed through them and play tested out some kinks. For the most part working well, but I need to fine tune the unit garrison strategies a bit. Should not be difficult, but I do want to keep the groupings at least somewhat geographically centered if possible. Then round it all out with light and heavy vehicles.
this code here seems broken after a recent arma update. Earlier it stopped AI infantry to be fixated on air units when they appear, now it does not do much. Is forgetTarget broken or is another command needed now? https://sqfbin.com/rumoliyiqelusamewigo
OK i got a weird situation, I'm using a deleted eventhandler on an object and when it runs I want to delete an array of objects along with it. I feel like I should know the answer for this but what I've tried so far doesn't work or sucks.
However getvariable doesn't work on the object as it's deleted
What's the best way to pass an array to the eventhandler and allow for multiple instances of the script (so has to be a unique global variable if going that route)
NVM I'm a moron who used the wrong variable name, getVariable worked fine.
I have a question ref CBA_fnc_addClassEventHandler which has confused me a bit. I'm currently using it for a variety of classnames however a few recent additions don't seem to be working as intended.
private _fobBuildingClassname = getText(missionConfigFile >> "Blufor_Setup" >> "AW_fobBuilding"); //returns "Land_Cargo_HQ_V1_F"
[_fobBuildingClassname,"initpost",{
params ["_object"];
if ([getPosATL _object] call AW_fnc_isNearFOB) then {
_object addEventHandler ["HandleDamage",{0}];
};
},false] call CBA_fnc_addClassEventHandler;
["Land_TentHangar_V1_F","initpost",{
params ["_hangar"];
AW_maxPlaneCount = AW_maxPlaneCount + 1;
publicVariable "AW_maxPlaneCount";
},false] call CBA_fnc_addClassEventHandler;
The above are 2 examples where it doesn't seem to be working. When looking at it further, if I do ["All","init",{systemChat str _this}] call CBA_fnc_addClassEventHandler nothing comes up for when either of the above are spawned however when I look at the XEH configs it should be enabled
class All {
XEH_ENABLED;
};
Have I missed something, or is this intended? And if it is, is there a nice way to do what I am trying with something within CBA or ACE?
Is there a way to command subordinate AI like UAVs (waypoints marked, changeable waypoint types etc.)?
only with the command menu, no "create waypoints" for them in vanilla @vague geode
Ok, thank you guys.
Is there a way to take a look at the code that makes it possible for UAVs to be commanded that way?
That's a pity...
i have a problem, i want to attach my player to an object and still be able to move my had and look around is this even possible at all ?
Well, have you tried moving anything after attaching your player to something?
i dont get this question can you repeat ?
i have tested it and my player is attacht but my 1/3personview is locked
attachTo is not really cool with native actions. Forget the idea is the best way to achieve, or do setPos setDir or such command every frame
okay
attachTo is the only way to attach objects, but, as you already found out, you can not look around when attached to something.
I imagine the only way around this would be making a mod with a fake vehicle seat for the player to sit / stand in (and then attaching that seat), because you can look around and shoot in vehicles.
i have done that but its a bit wired, i dont get the eye pos of cargoslots to work, its always offset to the center of the "vehicle"
Maybe the mages in #arma3_config can help with that.
that's funny, already ask there a few days ago. they sad use attachTo ;D
Yep. Each garage has an array of points/directions representing each spawn point
I’ll need to make some changes for multiplayer but as is it works great
{
_x enableSimulationGlobal false;
_x hideObjectGlobal true;
} forEach units independent;
this doesn't seem to work?
its not hiding or disabling simulation on independent units
where are you running this
I think I need to do spawn right?
debug console
dedicated?
I'm running the server from my pc
editor -> play multiplayer
and you're the one running the code, not some other client?
🤔
and tried global exec
it just hides them
simulation is still on
they still shoot me
but they are not visible
it does
I'm trying to hide all enemy units to save performance, so it does hide them and disable their simulation, but if they are in a turret, they would get hidden but their simulation is not disabled, kinda weird
fixed it
{
_x enableSimulationGlobal false;
_x hideObjectGlobal true;
vehicle _x enableSimulationGlobal false;
vehicle _x hideObjectGlobal true;
_x disableAI "all";
} forEach units independent;
now that's quite different from
this doesn't seem to work?
its not hiding or disabling simulation on independent units
😬
so, yeah, vehicled units are managed differently. kudos on finding out
Yeah if the units are in a vehicle, just disable and hide the vehicle. It will disable and hide the units as well making it easy.
What's the best way to check if player(s) was/were detected by given side? knowsAbout seems to be a bit too unreliable.
you mean <side> knowsAbout player?
Yeah
hmm, well you could check knows about of every units <side>
but that's more expensive.
Probably bit more reliable.
or big ass trigger with detected by condition 
targetsQuery perhaps
[] spawn
{
while {true} do
{
sleep 30;
_detected = units east findIf {((_x targetKnowledge player) # 0 == true || (_x targetKnowledge player) # 1 == true) && alive _x};
hint str (_detected > -1);
};
};
```This seems to actually work very nicely. This way the player has 30 seconds to kill the unit which detected him before the alarm goes off.
its not always 30 secs, depends when you call the code
true
could already be sleeping there 🙂
Good catch
Is there a way to spawn fireflies?
createvehicle [_type,_pos,[],_maxHeight * 0.1,"none"];
``` Works but no FSM =/
[_agent] call BIS_fnc_animalBehaviour;
❤️
not sure if it works on them.
Gonna find out
"P:\a3\animals_f\Data\Scripts\main.fsm"
it just calls this func on the agent and quits
Doesn't work
private _agent = createAgent ["FireFly", getPosATL player, [], 0, "NONE"];
[_agent] call BIS_fnc_animalBehaviour;
No luck

re: garrison for a sector, I spawn a group in, that much is fine, but they "always" form up in whatever formation, and I'd like that not to be the case, i.e. just be where I placed them. I might give them an instruction, i.e. defend a point, patrol waypoints, etc, but that's a next step. thanks...
bruh
doStop, thanks...
Create one group for each unit
very bad practice
Doesn't matter for 2 or 5 units
I am here to show options, not tell what's the best for his situation
naw, man, we're talking could be upwards of 30+ 40+ units here... plus vehicles and crews themselves.
Be more precise next time then
There are two problems with that.
- Group limit (256 per side I think)
- Each unit will have their own path finding thread, which will severely slow down the game
when they're grouped only the leader generates a path (the others simply follow the leader)
I wasn't asking that though, read the OP. only that the group would form up. anyway, doStop is the solution. appreciate the feedback.
very good to know
guys, is this:
(((getPosWorld _x) select 2) < 20)
as good as
(((getPosATL _x) select 2) < 20)
I need to find out if the unit is not too high in the air
getPosWorld is faster so that is why I am trying it use it
it is also ASL
a completely different thing
if the unit is not too high in the air
neither of them fit your need
Hey guys! I've got this recruitment script that I use, but I'd like the dismiss action range to be reduced, otherwise I see the "dismiss" action on screen all the time, I'd like to reduce it so I have to be facing 1 meter of the unit I want to dismiss for the action to pop up, if anyone could help that would greatly appreciated
said script :
MMF_fnc_recruit=
{ params ["_caller"];
if (_caller== player) then {
MMF_recruitAction=[ player, "Join Group",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"player distance cursorTarget<5 && (cursorTarget getvariable ""MMF_isRecruit"") <1", "playerSide isEqualTo side cursorTarget", {}, {}, {
[cursorTarget] call MMF_fnc_recruit;
}, {}, [], 2, 0, false, true] call BIS_fnc_holdActionAdd;
} else {
[_caller] join (group player);
systemChat "Joined group";
_caller setVariable ["MMF_isRecruit", 1];
dismissAction=_caller addAction ["Dismiss", "[_this select 0] join grpNull; (_this select 0) setVariable [""MMF_isRecruit"", 0]; (_this select 0) removeAction dismissAction;"];
_caller addEventHandler ["Killed", {
(_this select 0) removeAction dismissAction;
}];
};
};
https://community.bistudio.com/wiki/addAction
Use the radius parameter.
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
You might run into problems using that dismissAction variable because it's a global variable. Imagine this scenario:
You have two units A and B. Unit B already has had an action added to it previously, unit A has not. You add the dismiss action to both units.
Because it already had an action added to it, addAction with unit B will return 1. But addAction with unit A will return 0, so one value will overwrite the other because both are saved to the same dismissAction variable.
Now you can't delete the dismiss action from one of the units because what's stored in dismissAction is not the same as the Action ID of the dismiss action on that unit.
Just save it in the namespace of the unit
This is my need: ```SQF
waitUntil {
sleep (2 + random 2);
if (diag_fps > 15) then {
private _playerIsNearEnough = ((allPlayers - entities "HeadlessClient_F") findIf { (alive _x) && !(vehicle _x iskindof "Air") && (_x distance2D _zombieSpawnPos < _zombieSpawnDistance) && (((getPosWorld _x) select 2) < 20) }) isNotEqualTo -1;
(_playerIsNearEnough)
};
};
with words please? what do you want to achieve?
😄
as I said, getPosWorld is ASL
I don't want players too high up to trigger the continuation of the waituntil
height is measured from the sea when you use ASL
a person on a mountain will be considered "too high" in your code. so _playerIsNearEnough = false
also no need for _playerIsNearEnough
use lazy eval and omit the if
alright so I should use getPosATL because getPosWorld uses getPosASL which would not trigger if the players are on a mountain etc
no you should either use AGL or AGLS
ASL is just wrong
ASL and AGL are the best world coordinates
I just want the fastest what will do the job, so it is AGL?
You are evaluating that every 2 to 4 seconds
saving 0.002ms on a position won't save you
yes but I have like 30 locations running that spawn4
if you need to watch our for surfaces eg rocks use AGLS
No I just need to know if a player is near enough so I can spawn the zombies
How many players?
then what you should care about is using one loop. you don't need 30 spawns
Well yeah, I will expand the script with one loop in the future, but right now I want to optimize this waitUntil
I will just go with getPosATL
Like this: SQF waitUntil { sleep (2 + random 2); ((((allPlayers - entities "HeadlessClient_F") findIf { (alive _x) && !(vehicle _x iskindof "Air") && (_x distance2D _zombieSpawnPos < _zombieSpawnDistance) && (((getPosATL _x) select 2) < 20) }) isNotEqualTo -1) && (diag_fps > 15)) };
?
waitUntil
{
sleep (2 + random 2);
((((allPlayers - entities "HeadlessClient_F") findIf
{
alive _x &&
!(vehicle _x iskindof "Air") &&
(_x distance2D _zombieSpawnPos < _zombieSpawnDistance) &&
(((getPosATL _x) select 2) < 20) }) isNotEqualTo -1) &&
diag_fps > 15)
};
}; ```
a bit easier to read
might wanna exit if diag_fps is < 15
so perhaps put that in front and use lazy eval
That's what I meant
waitUntil {
sleep (2 + random 2);
diag_fps > 15 && {
(allPlayers - entities "HeadlessClient_F") findIf { (alive _x) && !(vehicle _x iskindof "Air") && {(_x distance2D _zombieSpawnPos < _zombieSpawnDistance) && (((getPosATL _x) select 2) < 20)} }) != -1
}
};
this
Thanks guys! You rock!
can't wait util @cosmic lichen and @little raptor release their own cDLC!
isn't it an infinite loop?
I just remove it for now
I don't know what it is anyway
I dunno.
that random 2 is also weird given that he is looking for max performance but can't decide on how often he needs to run it 😄
the random part is so that it doesn't check at the same time as the other 20 loops
but perhaps my logic is flawed
Have you already considered using distance to omit the height check?
You're already checking for aircraft and I don't see many other options to gain altitude, so what's up with that anyways?
Arma 3!
Good day. Is there a command to play "glitch" visual effect just like when mission ends?
0 cutrsc ["RscInterlacing","plain"];
0 cutrsc["RscNoise","black"];
0 cutrsc ["RscStatic","plain"];
parachutes are air vehicles tho 
Thanks a lot 👍
Hello is this working?
(desc.ext)
disableChannels[] = {
{0, true, true}, //--- Global Chat
{1, false, true}, //--- Side Chat
{2, true, true}, //--- Command Chat
{3, false, false}, //--- Group Chat
{4, false, false}, //--- Vehicle Chat
{5, false, false}, //--- Direct Chat
{6, true, true} //--- System Chat
};
iirc disableChannels is broken
If you guys keep going to give wiki links every one for helping wtf is this channel anyways?????
well do you want me to copy paste the syntax or what?
bruh
tbh arma community dying every single day because of this kinda stuff (infistar, weirdly moderated servers, people are so arrogant)
Not up-to-date tools old engine, really bad coding language. And this game is still making money at least update the editor.
Yet you keep coming, so there must be something.
You ask for info, it is provided. What more do you want, spoonfeeding?
PS: this channel is #arma3_scripting.
Scripting in Arma relies on SQF.
SQF is explained on the wiki.
Okay maybe i want, spoonfeeding. I think this is the right place to ask.
- SQF language is only works for Arma.
- Hard to learn.
- Look like cpp but not cpp maybe java?
- Not really great videos for visual learners.(They are great but old)
- So complicated and no proper debugger.
And yes new comers wont understand from wiki. Sorry.
Hey could i get some quick help to get a statement to work, so if there is an intersect it removes _X from array
_ins = [_heli, "GEOM"] Intersect [_heli modelToWorldWorld [0,2.1,2.2], aimPos _x];
if !(_ins isEqualTo []) then {
_dataLinkArray = _dataLinkArray - [_x];
};
You absolutely have the right to not understand the wiki and can even ask for explanations; what you cannot do however, is lashing out on helping peeps.
Is that understood? We understand the potential frustration, but we are not your punching ball to evacuate it.
no
you can't remove array from array like that
how is sqf complicated, and how does it look like cpp/java?
it is inside a foreach statement that checks everything in an array
it doesn't matter
{
_ins = [_heli, "GEOM"] Intersect [_heli modelToWorldWorld [0,2.1,2.2], aimPos _x];
if !(_ins isEqualTo []) then {
_dataLinkArray = _dataLinkArray - [_x];
};
sleep 0.20;
} foreach _dataLinkArray;
so this wont work
if _x is an array , _array - [_x] won't work
also the intersect command doesn't return objects
what you wrote is incorrect
By any meaning i don't want to be disrespectful to any one. I love ArmA. Its not like a game it more like framework for milsim. But arma is lacking on game engine. 10 years old engine and still working on single thread. Please update wiki(Classnames are missing some pictures from beta.) and editor.
is if !(_ins isEqualTo []) then {
incorrect?
is _dataLinkArray an array of objects or intersects?
object
then it should work
it dosent want to
We do what we can with what we have, but we will look into the wiki.
As for your issue, did you save your file as description.ext (and do you have file extensions showing in Windows?)
thats what i need help with
are you trying to check if it intersects with heli?
so im tryna make a radar script i came on here before to get help using check vis but that dosent work for what i need
if (isVehicleRadarOn _heli && (_heli animationPhase "fcr_enable" == 1) && _heli getHit "radar" < 0.8) then {
_datalinkarray = (listRemoteTargets playerSide) apply {_x # 0};
{
_distOffAxis = abs ([[_heli, (getposatl _heli select 0), (getposatl _heli select 1), (getposatl _x select 0), (getposatl _x select 1)] call fza_fnc_relativeDirection] call CBA_fnc_simplifyAngle180);
if (_x == _heli || _x isKindOf "man" || _x isKindOf "StaticCannon" || laserTarget _heli == _x) then {
_dataLinkArray = _dataLinkArray - [_x];
};
if !(alive _x) then {
_dataLinkArray = _dataLinkArray - [_x];
};
if ((_heli getVariable "fza_ah64_agmode" == AGMODE_GND) && (_distOffAxis > 45)) then {
_dataLinkArray = _dataLinkArray - [_x];
};
if (_heli getVariable "fza_ah64_agmode" == AGMODE_AIR && !(_x isKindOf "air")) then {
_dataLinkArray = _dataLinkArray - [_x];
};
_ins = [_heli, "GEOM"] Intersect [_heli modelToWorldWorld [0,2.1,2.2], aimPos _x];
if !(_ins isEqualTo []) then {
_dataLinkArray = _dataLinkArray - [_x];
};
sleep 0.20;
} foreach _dataLinkArray;
{
if !(_x in fza_ah64_targetlist) then{
fza_ah64_targetlist = fza_ah64_targetlist + [_x];
};
} foreach _dataLinkArray;
};
fza_ah64_fcrlist = _dataLinkArray;
I saved in side the mission file / desc.ext
But i guess enable channel or Disable channel thing is not working anymore. (they told me its broken).
so im tryna check if there is something between the target and heli
then you're using the wrong command
Finds named selections in object which are in specified LOD, intersected by given section of a line.
lineIntersects then?
what you wrote checks if it intersects with heli
lineIntersectsSurfaces
that has hardcode dis of 5k
i need 8k
split the distance
thats beyond me
a for loop
would lineintersect not work
Thanks for the chat. Thats all wanna to say. I would like to end this conversation for now. I am sorry if i was disrespectful by any mean.
it's even more limited that lineintersectsSurfaces
crap
right so how would i got about splitting the distance?
a for loop 
_ins = lineIntersectsSurfaces [_heli modelToWorldWorld [0,2.1,2.2], aimPos _x, _heli, _x];
if !(_ins isEqualTo []) then {
_dataLinkArray = _dataLinkArray - [_x];
};
so i would need to check twice somehow by splitting it
_lastPos = _p1;
_dir = _p1 vectorFromTo _p2;
for "_i" from 3000 to _totalDist step 3000 do {
_NextPos = (_dir vectorMultiply _i) vectorAdd _p1;
//check from _lastPos to _NextPos;
_lastPos = _NextPos;
};
//now do it from _lastPos to _p2 one last time outside the loop
splits by 3000m
that looks like black magic give me a min to try understand
as far as I know it was broken but it was fixed.
The file name should be description.ext (not desc.ext, descr.ext or as it happens sometimes description.ext.txt)
Thank you. So much!
Does it work?
so P1 is helI
p2 is end point
lastpos is the middle?
yeah
My description file is description.ext
p1 is the start
p2 end
But i write the disable channel thing like this;
disableChannels[] = {
{0, true, true}, //--- Global Chat
{1, false, true}, //--- Side Chat
{2, true, true}, //--- Command Chat
{3, false, false}, //--- Group Chat
{4, false, false}, //--- Vehicle Chat
{5, false, false}, //--- Direct Chat
{6, true, true} //--- System Chat
};
Its not working i can still use side chat.
is the mission file "mission" or "mission.sqm"?
what is _i then
Mission file >> description.ext
split range
I mean the "mission" file, next to description.ext
you can just draw it on a piece of paper.
Its binarized btw.
Ok, just checking if you had the file extensions showing
1, false, true
means
side channel / disable text / allow voice
@brave lance ^
if you want to entirely disable it set it to false, false
black magic of another level im barely understanding
so would this work
_lastPos = _heli modelToWorldWorld [0,2.1,2.2];
_dir = _heli modelToWorldWorld [0,2.1,2.2] vectorFromTo aimPos _x;
for "_i" from 4000 to 8000 step 4000 do {
_lastPos = (_dir vectorMultiply _i) vectorAdd _heli modelToWorldWorld [0,2.1,2.2];
};
_ins = lineIntersectsSurfaces [_heli modelToWorldWorld [0,2.1,2.2], _lastPos, _heli, _x];
_ins1 = lineIntersectsSurfaces [_lastPos, aimPos _x, _heli, _x];
if !(_ins isEqualTo [] || _ins1 isEqualTo [] ) then {
_dataLinkArray = _dataLinkArray - [_x];
};
wait, or true true
The doc has an error :grimacing:
let me check 1 sec.
- where'd you get 8000 from?
- why aren't you checking intersect inside the loop?
see the code again
I added some stuff
8000 is the distnace i need
for "_i" from 4000 to 8000 step 4000 do {
_lastPos = (_dir vectorMultiply _i) vectorAdd _heli modelToWorldWorld [0,2.1,2.2];
};
is this a loop?
it's not what you need 
it should be what it IS
right
distance from heli to aimPos _x
All of the channels are working ahaha.
so there may be an issue with the description.ext. Is it the only thing that is in the file?
_lastPos = _heli modelToWorldWorld [0,2.1,2.2];
_dir = _heli modelToWorldWorld [0,2.1,2.2] vectorFromTo aimPos _x;
_totalDist = _heli distance _x;
for "_i" from 3000 to _totalDist step 3000 do {
_lastPos = (_dir vectorMultiply _i) vectorAdd _heli modelToWorldWorld [0,2.1,2.2];
};
_ins = lineIntersectsSurfaces [_heli modelToWorldWorld [0,2.1,2.2], aimPos _x, _heli, _x];
if !(_ins isEqualTo []) then {
_dataLinkArray = _dataLinkArray - [_x];
};
how do i put that in a loop?
you copy paste it 
author="Yanoee";
onLoadName = "Hybrid Combat Royale";
OnLoadMission = "<t color='#4af0a8'>Hybird Combat Royale | Yeni bir deneyim için.<br /><t color='#7289da'>Discord: xxxxx<br /><t color='#CAE4F1'>Web: xxxxx<br /><t color='#FF0000'>V:3.6.0";
overviewPicture = "Core\Resources\Images\logo.paa";
respawn = 3;
respawnOnStart = 1;
respawnDelay = 6;
disableChannels[] = {
{0, true, true}, //--- Global Chat
{1, false, true}, //--- Side Chat
{2, true, true}, //--- Command Chat
{3, false, false}, //--- Group Chat
{4, false, false}, //--- Vehicle Chat
{5, false, false}, //--- Direct Chat
{6, true, true} //--- System Chat
};
showHUD[] = {
1, // Scripted HUD (same as showHUD command)
1, // Vehicle and unit info
1, // Vehicle radar [HIDDEN]
1, // Vehicle compass [HIDDEN]
1, // Tank direction indicator
1, // Commanding menu
1, // Group info bar
1, // HUD weapon cursors
1, // Vehicle display panels
0, // "x killed by y" systemChat messages
1 // force show drawIcon3D icons
};
corpseManagerMode = 2;
corpseLimit = 10;
corpseRemovalMinTime = 200;
corpseRemovalMaxTime = 300;
wreckManagerMode = 2;
wreckLimit = 5;
wreckRemovalMinTime = 200;
wreckRemovalMaxTime = 300;
class Params
{
class MapPick
{
title = "Choose Area";
values[] = {0,1};
texts[] = {"Larche","Fields"};
default = 0;
isGlobal = 1;
};
};
#include "Core\Scripts\Market\Gunstore\DEF_Gunstore.hpp" //Gunstore
#include "Core\Scripts\Market\Gunstore\UI_Gunstore.hpp" //Gunstore
class RscTitles
{
#include "Core\Scripts\Client\Player\StatusBar\statusbar.hpp"
};
Whole description.ext
im to far beyond my understanding to finish this but this is a help so far thanks
I don't see any issues as it is… weird
_p1 = _heli modelToWorldWorld [0,2.1,2.2];
_lastPos = _p1;
_p2 = aimPos _x;
_dir = _lastPos vectorFromTo _p2;
_totalDist = _lastPos distance _p2;
_clear = true;
for "_i" from 3000 to _totalDist step 3000 do {
_NextPos = (_dir vectorMultiply _i) vectorAdd _p1;
//check from _lastPos to _NextPos;
_ins = lineIntersectsSurfaces [_lastPos, _nextPos, _heli, _x];
if !(_ins isEqualTo []) then {
_clear = false;
_dataLinkArray = _dataLinkArray - [_x]; break;
};
_lastPos = _NextPos;
};
//now do it from _lastPos to _p2 one last time outside the loop
if (_clear) then {
_ins = lineIntersectsSurfaces [_lastPos , _p2, _heli, _x];
if !(_ins isEqualTo []) then {
_dataLinkArray = _dataLinkArray - [_x];
};
}
Yeah and i don't have any other stuff that intrupts with system chat.
sorry, my Arma is updating tonight. I can check tomorrow
by the time it gets to clear
wouldnt lastpos & p2 be ontop of eachother?
no
maybe (if the distance is round)
you can check that too
its checking all the way _totalDist
so the last pos would overlap i think
no
ah so it checks in 3000?
yes
right so it would have to be 3,6,9
ye
got you
im in a situation where there is definetly intersection but
if !(_ins isEqualTo []) then {
apparantly isint right
il give that a go
so isNotEqualTo is a thing?
the wiki stopped working for me noooooooooo
https://community.bistudio.com/wiki/isNotEqualTo since v2.04 iirc (and yes wiki down too)
great thanks
if (_ins isEqualnotTo []) then {
the statement to remove stuff just isint working
Wiki down
#community_wiki message latest COMREF (a bit old)
How do pass in parameters to this? In Zeus with Zeus Enhanced, one option is "Execute Code". Mousing over the box where you can enter code shows this:
This code will be passed the following arguments:
0: Module Position ASL
1: Attached Object (objNull if none)
I'm guessing that the attached object that I'm passing in is the vehicle that I'm clicking on before the execute code dialog box pops up. I tried this land "LAND" to land the heli but it won't work. I'm unsure of how to pass in the second argument instead of this.
params ["_pos", "_obj"];
put that at the beginning of your code and use those parameters (if you need them)
so those are arguments, you have to assign parameters to those arguments.
The wiki is currently down (at least for me). Anyone knows the arguments for getClientState?
Gotcha. Can you show me how to use the param? I'm a bit new to SQF, I've not done a ton. (programming is my day job, this is just a new lang)
_pos and _obj are what the module told you
This code will be passed the following arguments:
0: Module Position ASL
1: Attached Object (objNull if none)
how you want to use them is up to you
e.g.:
_obj land "LAND"
Is there a way to limit a player driven vehicles speed that isn't just applying a force every tick? limitSpeed and forceSpeed don't seem to have an affect.
Ah, nailed it. I'm unused to declaring variables as strings, haha
params is used when you want to "map" array elements to private variables
[1,2] params ["_num1", "_num2"]; //_num1 is 1, _num2 is 2
Super neat! I'll keep that in mind, thanks a bunch 
Cheers!
no.
Darn
limitSpeed and forceSpeed
AI limits
Yeah that’s what I figured
All I'm trying to do is put a speed restricted area inside a base, so I'm thinking a single loop that iterates over each vehicle in the area and caps it's velocity shouldn't be too bad
only one way to find out I guess
preferably use a loop on each client for their own vehicle
What I ended up doing is just locally checking if the player is in a vehicle, and if the vehicle is within a trigger area I clamp the velocity. Seems to work fine
Evening,
How would I use https://community.bistudio.com/wiki/diag_exportConfig
To make a All in one? Like it seems it wants PBO paths rather then the config.bin already compiled
Is there a temp file that gets made some were I pull from? I actually have no idea were the config.bin gets made when you run the game after it compiles Mods, CDLC, ect
Utils 2 just shows bin\config.bin/
It wants a config
every addon has config.bin, they all get loaded into the game
not a file
you just need to pass a config to the command
oooo
diag_exportConfig ["C:/mycfgvehicles.txt", configFile >> "cfgVehicles"]
Hey guys can anyone help me with the new SOGPF module for cinematic? I have the camera shots working fine however there are more than one and they seem to play in a different order every time i start the mission. I would like them to play in a specific order every time. Can anyone help? thanks
Hey does anyone know how to get an AI to shoot an RPG at a helicopter with 100% accuracy, but no damage when the helicopter passes through a trigger?
lmfao I still can't figure this shit out @fair drum
still didn't get the guided projectile to work?
yea unfortunately no
post what you got
How would I get the gas masks to work with the current chemical weapons?
kk give me a sec. I will write it out
Guided missile Sqf:
`_target = _this select 0;
_startPos = _this select 1;
_missileType = _this select 2;
_missileHeight = _this select 3;
_perSecondsChecks = 100;
_missileSpeed = 6174;
_pos = [0,0,0];
if (isNull _target) exitWith {hintSilent "No Target Found!"};
_pos = [_startPos select 0, _startPos select 1, _missileHeight];
_missile = _missileType createVehicle _pos;
while {alive _missile} do {
if (_missile distance _target > (_missileSpeed / 10)) then {
_dirHor = [_missile, _target] call BIS_fnc_DirTo;
_missile setDir _dirHor;
_dirVer = asin ((((getPosASL _missile) select 2) - ((getPosASL _target) select 2)) / (_target distance _missile));
_dirVer = (_dirVer * -1);
[_missile, _dirVer, 0] call BIS_fnc_setPitchBank;
_flyingTime = (_target distance _missile) / _missileSpeed;
_velocityX = (((getPosASL _target) select 0) - ((getPosASL _missile) select 0)) / _flyingTime;
_velocityY = (((getPosASL _target) select 1) - ((getPosASL _missile) select 1)) / _flyingTime;
_velocityZ = (((getPosASL _target) select 2) - ((getPosASL _missile) select 2)) / _flyingTime;
_missile setVelocity [_velocityX, _velocityY, _velocityZ];
sleep (1/ _perSecondsChecks);
};
};`
Script used in trigger: nul=[target, startLocation, missileType, missileLaunchingHeight] execVM "guidedmissile.sqf"
Script used in object that you want to fire: nul=[laserTarget player, getPos startLocation, "M_Scalpel_AT", 500] execVM "guidedmissile.sqf"
you took that from somewhere else didn't you
Thanks chief
give me the starting position you want
?
10005.3,16813,1
I am also using Fockers Arma3 Scripting Guide and it is helping me understand more
why are you insisting on spawning these projectiles righ tnext to the ground...
they are just gonna hit something
I found the script after looking
okay
h1 is the target
[ASLToATL [10005.3,16813,1000], "M_Air_AA", h1, 1020, false, [0,0,0], 30, "", false] spawn BIS_fnc_EXP_camp_guidedProjectile;
works fine for me
make sure you use it in a scheduled environment
Sweet I will try this. And does this sit in a trigger?
you can do anything you want with it
For some reason it doesn't work...
dude i literally just sat in the virtual editor, changed h1 to player and shot myself
took about 10 seconds for the missile to get to me
okay let me do some more testing lmao
thanks tho, brother!
Oh maybe because the target is not a player but a helicopter
That could be it
No I am not spawning it.
oh nvm! I switched the two false lines to true
cool you just made your heli die no matter what and you also just made it spawn a projectile for every client that joined the game
stop messing with the arguments of things thinking they will change something. i just showed you that it works.
with a heli named h1 to prove it
https://streamable.com/jw1t5c
oh lol okay
how long does it take to hit?
because it is not hitting
My Trigger:
Everything Below [ASLToATL [10005.3,16813,1000], "M_Air_AA", h1, 1020, false, [0,0,0], 30, "", false] spawn BIS_fnc_EXP_camp_guidedProjectile; Works...
[ASLToATL [10005.3,16813,1000], "M_Air_AA", h1, 1020, false, [0,0,0], 30, "", false] spawn BIS_fnc_EXP_camp_guidedProjectile; h1 setHitPointDamage["HitVRotor", 50]; h1 setHitPointDamage["HitEngine", 50]; h1 setHitPointDamage["HitHull", 50]; h1 setHitPointDamage["Glass1", 50]; h1 setHitPointDamage["Glass2", 50]; h1 setHitPointDamage["Glass3", 50]; h1 setHitPointDamage["Glass4", 50]; h1 setHitPointDamage["Glass5", 50]; h1 allowDamage false; _source01 = "#particlesource" createVehicle getPosWorld h1; _source01 setParticleClass "UAVWreckSmoke"; _source01 attachto [h1,[0,1,-1]]; [] spawn { sleep 30; [h1, hccs1, hccs2, hccs3, hccs4, hccs5, hccs6, hccs7, hccs8] apply { deleteVehicle _x; }; };
Oh nvm @fair drum
Thanks for the help!
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
@wanton forge
So complicated and no proper debugger.
There is a proper debugger as visual studio code extension
- Look like cpp but not cpp maybe java?
neither, completely new.
- Hard to learn.
I think SQF is the easiest language I know, so I'd disagree on that
There is sqf-vm allowing you to code with sqf outside of the armaverse theoretically (practically, nobody does (yet))
It also features a full debug interface, available through code or cli (also being used by arma.studio, so here you get the debug features from sqf-vm too)
Sqf is of the c style Syntax family more or less, yes
Programming of any kind is never good for "visual learners"
Btw, did I already mention the plethora of language servers for visual code, aiding in development?
sqf is easy, but its inconsistent and arma is buggy and you have to dig deep until you get a proper debugger.
Imagine complaining about the Arma community dying when you threaten to DDoS servers
arma is a very open and friendly community. i have never had a community that was more willing to help with problems.
I think SQF is the easiest language I know, so I'd disagree on that
True, only thing which makes it sometimes a bit hard to understand are little inconsistencies.
Good day. Is there a way to check if GPS is active or not? I'm trying this, but it's returning true even if GPS is turned off
private _gpsdisplay = uiNamespace getVariable "RscCustomInfoMiniMap";
if (!isNil "_gpsdisplay") then
{
private _gpscontrol = _gpsdisplay displayCtrl 101;
if (!isNull _gpscontrol) then
{
_gpsActive = ctrlShown _gpscontrol;
};
};
Also tried ctrlVisible and ctrlFade > 0 both giving false negative result (false even when GPS is on)
Damn I feel stupid хД
https://community.bistudio.com/wiki/visibleGPS
Thanks for pointing 👍
Does parseText have 8192 bytes limit?
hey! im trying to make this script work but i cant seem to do it help https://community.bistudio.com/wiki/setSlingLoad
What have you got so far?
in what way? (im very new to scripting)
what did you try / what is the error you meet?
What are you trying to use setSlingLoad for and how have you tried getting that to work so far?
uh im not meeting any error, im trying to make mraps slingloadable by putting it in the init box
Ah, but setSlingLoad is meant to actually attach some cargo to some helicopter.
There is enableRopeAttach which can be used to disable (and re-enable) sling loading for sling-loadable cargo.
But I don't know how much these commands can be used to override limitations such as the Ghost Hawk not being able to carry a Slammer MBT.
yeah no for heavy lifting id use the CH-47, then to make it work should i use the example provided?
it should work out of the box. what is the precise case you are trying?
e.g if you are trying to lift a tank with the MH6 (or a house), it won't work
im trying to lift the m1220 with a ch-47
M1220… is not a vanilla asset
nor is the CH47
I assume it's too heavy for this helicopter
you can change its weight with setMass
those are mod assets yes i could try changing the mass of said vehicle
either im being very incompetant or it doesnt seem to work
i tried lowering the mass of the vehicle it had no effect on it being able to slingload
how did you do it?
(also, maybe its config does not allow it, and therefore you cannot fix it by scripting)
Hi everyone! I have one issue, I want to load one box on one truck, I want to drive it into a trigger that activates a hint, the box has the variable name cargo. My issue is that it wont work.
Trigger
Activation: Blufor
Condition: this && cargo in thisList
On Activation: hint "The cargo has arrived";
Any suggestions?
thisList will only list Blufor objects since thisList only contains objects that satisfy the trigger's condition
How can I solve it?
Change the trigger to "empty"
like Activation: None?
yup
Thank you
It wont work
Activation: None
Condition: cargo in thisList
On Activation: hint "The cargo has arrived";
try anybody
Thank you! That solved it
hey fellas, to host a dedi with prairie fire, do i need to have -mod=??? filled
think i got it thx
"-mod=vn"
does BIS_fnc_EXP_camp_SITREP have the ability to adjust its location on the screen? For instance is there a way I can spawn it in the center of the GUI?
it probably uses one of the layout coordinates
you can either "hack" and change them, then restore, or edit the function
Hey guys, I just want to know if there is a comprehensive list of basic scripts to download for mission making. If yes, How and where to download? Thanks.
if you want to download something, there is the COMREF: a (1yo outdated) reference of commands here
#community_wiki message
now if you want everything up-to-date, see https://community.bistudio.com/wiki/Category:Scripting_Topics 😉
Thanks sir
I dont know anything about programming so i thought it would be better if i just use scripts which is meant to perform a certain task.
You'll mostly be writing things yourself.
In some cases you can find community made scripts on the forum.
There are also some vanilla and CBA functions that can help with some stuff.
Will the init.sqf run once when the player first joins the hosted session or will it run again if they rejoin?
every time they join the server
Ok
How do you remove any type of NVG from a unit? I've tried this unassignItem "NVGoggles"; this removeItem "NVGoggles";, but it only works with that classname.
unlinkItem hmd unit is the key!
That's perfect, thank you!
Thanks bro @cosmic lichen
guys is there any easy way to make mission for example i want on my mission to put 1 red cyrcle marker but when all enemy die inside on my marker radius the marker delete is any way to do that so my frients on my mission know when the mission is clear
with trigger ? and what setup i need to do on my triger or i need script for that?
Mission making is easy with the 3DEN editor alone. There are a lot of good tutorials in the BiKi, so you could start there:
https://community.bistudio.com/wiki/Category:Eden_Editor
Anyway, if I understood you correctly, do the following:
- Place a marker of your desired shape/color/size in the zone where the enemies are, and name it
myRedMarkeror to whatever name you want in the marker’s Variable name field. - Then place a trigger, preferably the same shape/size as the marker above, in the zone where the enemies are.
- In the trigger’s Activation drop-down menu, choose the side the enemies belong to.
- In the trigger’s Activation Type drop-down menu, change it to Not Present.
- In the trigger's On Activation text field put the following code:
deleteMarker "myRedMarker";(or to whatever you chose to name your marker) - Make also sure to check the Server only, just to make sure the marker gets deleted for everyone if it’s a multiplayer mission.
The result? Once all enemies that are not present in the trigger/marker area (either dead/killed or moving away), the marker will then get deleted.
is there a way to add spyder addons via script and without sync?
did something changed with ifdef & functions? I cannot recompile function if it contains ifdef - it just fails silently and produces empty code { }
yeah. it now uses the compileScript command
what's funny is that it has fixed another bug! 😄
#arma3_feedback_tracker message
wait, do you mean compile works and only recompile fails?
@still forum ☝️ you might want to take a look at this too?
ok, I'm dumb. One of the ifdefs had double hash in front of it. I hate when stuff fails silenty
Hey guys, i'm trying to find any function to check if unit has chemical detector, any help? Thanks!
<detector> in items player. Just need the class name
Find the item classname using arsenal
Then check if it exists in items or backpackItems
Thanks!
You can also do
"ChemicalDetector_01_watch_F" in assignedItems player
to check if it's properly slottet
Here is more info
Hey, I would like to get some help with this script
if (groupId (group player) == "B 1") then {playmusic "EventTrack02_F_Orange";};
I would like to playMusic for the members of "B 1" group.
I currently know my groupID is "B 1", which has to able to hear music.
using debug console, and looks like it doesn't work out.
any help please?
@daring parrotwhy have it locally and not trigger it from the server? (are you using triggers maybe?)
yes it is
you should better name the group with a variable (e.g bravo1group, etc) and do sqf if (group player == bravo1group) then { /* ... */ };
Oh, I will try that one thank you.
Is there a way to tell if an object is a vehicle? i.e. I can tell whether an object is itself, i.e. not "in" a vehicle, but that's not quite the same thing. like perhaps whether the object supports driver+commander+gunner+cargo assignments?
how do i find the user actions inside a config, won't let me search
either a config lookup, or fullCrew usage
fullCrew got it, thanks
Right so, I'm trying to find where the specific UserAction for opening some gate. Currently looking for it inside the config, however I can not find it. I have the config open for the object but useractions isn't listed anywhere.
see #arma3_config then 🙂
ok thanks
hmm probably better to verify _x isKindOf "Man" or even _x isKindOf "CAManBase", i.e. when vehicle has no crew, both return [], which is a false positive.