#arma3_scripting
1 messages ยท Page 166 of 1
Sorry to clarify i meant that
instead of placing
"hint/message goes here" remoteExec ["Hint", 0] in the script,
hint ["message"] would do
but i think the hint ["message"] would just appear locally afik
hint is local, meaning the hint would only be displayed on the machine where it was run
remoteExec'ing stuff in Init? Are you totally sure it's needed there? Init field does get executed on each and every client by default already
honestly don't know
You don't
That would add the action n^2 times
Because the first player would join and run the init, the action would be added to all machines.
The second player would join and run the init, the action would be added to all machines.
Etc. etc.
Try this: ```sqf
[
this,
"ACTION GOES HERE",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 2",
"_caller distance _target < 2",
{},
{},
{ "hint goes here" remoteExec ["Hint", 0, true];},
{},
[],
12,
0,
True,
False
] call BIS_fnc_holdActionAdd;
thank you!
There's a trailing comma there
Whoops, fix'd
You need to put the code e.g. in init.sqf
True... I think I need to take a nap before I continue giving useless advice ๐
hi, i'd like to increase some turret gun's rate of fire
i've found these 2 codes but i'm not sure how to use them
_success = _vehicle setWeaponReloadingTime [gunner vehicle player, currentMuzzle gunner vehicle player, 0.5];
unit addEventHandler ["Fired", {
_this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
}];
i've asked chatGPT but did not worked
i've asked chatGPT but did not worked
A shocker
Don't use ChatGPT, it's never going to give anything that works well, or works at all.
yeah, i can tell ๐ฅฒ
You'd be better off just changing the firerate via config, rather than trying to script it
config? i am listening ๐
Config is where you define classes to be used in-game
Config changes would require you to make a mod, rather than being able to do it in a mission though
when Dart text's i'm on the edge of my seat ready to learn
imo hes the Best
others are good , But Dart, woowee hes awsome
It's a newer command so it almost certainly has global effects.
And it should not require the turret or vehicle to be local.
Hey, i have a bunch of mods installed and i would really like to list out all the vehicle names and in what base category they belong to (tank, armour, car etc.). Is there an easy way to do this?
and by vehicle names i mean actual vehicles in the game and their classname
I found a way to get all vehicles from the cfgVehicles, but categorizing them in a meaningfull way was very dificult
There aren't really any guaranteed properties you can look for to determine what a thing actually is - the game doesn't specifically distinguish between a civilian car, a Humvee, and an APC for example. You can try to hope the Editor subcategory is set to something reasonable, but that's up to the mod maker and not guaranteed. You can go broad and just sort by base class, e.g. TankX, PlaneX etc, but that is broad.
Oh, don't forget to filter out classes with scope = 0, these are private classes used only for config inheritance purposes and can't be spawned
now hurry and finish your CBA PR
๐
August
where is it located? I dig a lot, I didn't find it
github
Is there a way to call BIS_fnc_guiMessage; inside of a mission EH? It seems that when I try, it says that suspending isn't allowed in this context.
It's being called with execVM, but I have a feeling that this won't work with MP anyway.
Full code for anyone interested.
_markerbb = createMarker ["BlueBase", position player];
_markerbb setMarkerType "mil_flag";
_markerbb setMarkerColor "ColorBlue";
addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];
bbPos = _this select 1;
"BlueBase" setMarkerPos bbPos;
if (_this select 3) then {
private _result = ["Place your flag here?", "Training", "Yes", "No"] call BIS_fnc_guiMessage;
if (_result) then {
_markerbb setMarkerAlpha 0.0;
};
};
}];```
Try spawn BIS_fnc_guiMessage instead of call it
I tried doing 0 spawn {private _result = ["Place your flag here?", "Training", "Yes", "No"] call BIS_fnc_guiMessage;}; and it really didn't like that, but for some reason just spawning the function instead seems to work. Thanks ๐
Bro apparently I got it wrong every single way 
https://imgur.com/a/rgc128c
Not sure how your last pic or sentence is relared to your issue
Oh sorry, I just thought the error message was funny.
That function returns a script handle, not a bool
Well I read your code carefully. You need to wrap it with spawn entirely, including your last if statement etc too
Also doing if (_someBoolean == true) is unnecessary, you can just do if (_someBoolean)
Man I'm stupid. I was wondering why this _markerbb setMarkerAlpha 0.0; kept breaking. I tried to pass it as a parameter and then realised it takes a marker name.
I'm using BIS_fnc_guiMessage which uses suspension, so it has to be executed in a scheduled environment. The script is called from an SQF file, but I believe - and please someone correct me if I'm wrong - that Event Handlers are unscheduled.
https://community.bistudio.com/wiki/BIS_fnc_guiMessage
Most code is run unscheduled, meaning commands like sleep will fail since they require a scheduled environment
Would it be possible to add the zeus lightning strike to a guns init field? i.e. on bullet impact there is a lightning strike?
not the way you describe it. instead you would use the fired event handler to grab the projectile, then use a hitPart projectile event handler to detect when it hits something, then spawn the lightning bolt
either create it a custom way, or use the module lightning bolt function
this addeventhandler ["Fired",
{
_this spawn
{
_bullet = _this select 6;
_pos = getPosATL _bullet;
while {alive _bullet} do {_pos = getPosATL _bullet; sleep 0.01;};
private _tempTarget = createSimpleObject ["Land_HelipadEmpty_F", _pos];
[_tempTarget, nil, true] spawn BIS_fnc_moduleLightning;
};
}];```
It's certainly not the best solution but it's working on my end. Put this in the Unit's init field or execute it through the debug menu
hi everyone, i have a question how to change a music to sound? i mean in ZEUS you have a object sound where you can play some sound with 3d function. Im using a Zeus Music Mod Generator and how can i change in config from music to sound?
That would create a ton of objects and then never remove them. Just use an event handler on the projectile itself
That's a #arma3_config question, not scripting
๐
That works perfect thankyou so much!
Just use a HitPart event handler on the object, that way you're not spawning potentially hundreds of objects
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HitPart_2
https://community.bistudio.com/wiki/BIS_fnc_moduleLightning
target: Object - where the lightning bolt hits - will be deleted by the function!
๐
That's a really odd design choice
I guess maybe just to delete the module itself?
In any case, there's not much reason to run that scheduled. Just add a HitPart event handler and use the bullet itself as the target for the module
I honestly could not tell you myself, just found it online and thought it'd be really useful. Although, like you say - it's probably to avoid spawning hundreds of objects.
Workin like a dream. I have it setup to activate upon walking into a trigger.
I tried restricting it to just the gun itself but it didn't seem to wokr
ideally once the ammo is used up no more lightning powers.
You can remove the event handler after it's fired
there is a reason both dart and I recommended hitPart projectile event handler lol
If you want it used with a certain gun, you can add an if statement to check the weapon, but I'd be lying if I said that wouldn't be horrendously unoptimized. Dart's idea is better here.
A single if statement is not horribly unoptimized
I assume people are gonna be full autoing it, to be fair 
Can I ask, doesn't the HitPart EH need to be used on an object that you're shooting at?
Nah i wanna restrict it to just a mosin nagant or something.
Im using cursortarget setdamage 1
No, you'd add it to the projectile
there is another one for the projectile. look lower on the page
Ah I completely missed that
So you take the projectile data from fired, and use it here?
Yeah
Works for grenades too lol
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "", "", "", "", "_projectile"];
if (_weapon != "TheSpecialWeaponClass") exitWith {};
_projectile addEventHandler ["HitPart", {
params ["_projectile"];
[_projectile, nil, true] spawn BIS_fnc_moduleLightning;
}];
_unit removeEventHandler [_thisEvent, _thisEventHandler];
}];
Something like that should do the same thing
You'd just change "TheSpecialWeaponClass" to the class name that you want to limit it to
you can also use this on created submunitions as well for things like cluster munitions, explosives (each fragment) etc
chaos
Can you create submunitions from submuntions? 
I forgot that _projectile was an object lmao. Just realised that you can just use that instead of getting the last hit position.
Yeah you can
Yeah Punisher use Dart's, it's much better 
Realized I called the module instead of spawn, fixed that
Hmm Dart's isn't workign on my end. Im probably doing something wrong
You'll want to change this to whatever unit you want to add it to
And the weapon classname
Yeah you mentioned wanting to limit to a certain weapon.
If you no longer want that, just remove that whole line
Weapon_ indicates that it's a ground holder for that weapon, not the weapon itself
Trying to set up an object to have multiple hold actions on it, but keep getting a syntax error and can't lock down where it's coming from. See below script:
What am I doing wrong here?
Allegedly (according to TypeSQF) I'm missing a ] but I cannot for the life of me see where.
Missing comma on line 122
I.e. after [player,"Barklem","male07eng"] call BIS_fnc_setIdentity; }
You're a gun hey, thanks
You can remove the Weapon_ part from the class name
If it doesn't work after that, start the mission and do:
copyToClipboard (currentWeapon player)
That'll copy the class name of the weapon you're holding to your clipboard
Im trying to predict rocket projectile trace, the prediction accuracy drops when distance rise, and the accuracy on RPG-42 drops more than MAAWS, what could be wrong?
(red line is [player, 2] call BIS_fnc_traceBullets;, green line is prediction)
the code: ~~https://pastebin.com/W3AYX6nC~~ (too long to post here because i dont have Nitro)
EDIT: the code with Syntax Highlighting: https://pastebin.com/7n4HC2WU
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Hmm, maybe air friction is ignored during thrust or other way around?
Probably gonna need some engine insight
There is also sideAirFriction, no idea how it works though
MAAWS:
["thrust", "thrustTime", "sideAirFriction"] apply {getNumber(configFile >> "CfgAmmo" >> getText(configFile >> "CfgMagazines" >> "MRAWS_HEAT_F" >> "ammo") >> _x)}
``` => `[0.1,0.1,0]`
RPG42:
```sqf
["thrust", "thrustTime", "sideAirFriction"] apply {getNumber(configFile >> "CfgAmmo" >> getText(configFile >> "CfgMagazines" >> "RPG32_F" >> "ammo") >> _x)}
``` => `[500,0.1,0.075]`
There are probably some hardcoded intricacies to the way thrust works that aren't accounted in your script
0.1s of 0.1 thrust on MAAWS produces tiny deviation, while 0.1s of 500 thrust on RPG42 end up with large deviation
Best bet would be nagging the devs to have an insight into the engine to do 1:1
Maybe RHS or ACE has it figured out already, try checking there
Related in case you didn't see it already: https://forums.bohemia.net/forums/topic/189677-solved-predict-target-position-need-some-help-with-code-optimization/
Hey guys,with ur help in this Topic I managed to write a script which can predict a targets Position in the moment when ur current magazines ammo is reaching it.I ll post an example Mission within the next days.And here it is: /* Author: Sarogahtyp File: pre_tar_pos.sqf Description: Calculates th...
Haven't checked how much it differs from your script
Also you can figure out exact ammo starting point by spawning the weapon with createSimpleObject and getting muzzle positions from there
Do that with some caching and local objects
I tried RHS_calcBalistic.sqf on rhs_optics.pbo and fnc_calculateRangeCard.sqf in ACE, but seems they're calculating bullets and not considering thrust
Maybe there is some old CCIP for the jets/helis there?
๐ Nice idea, I'll try it later
@still forum Could you please share the sacred knowledge of how the engine does missile/rocket thrust and what is sideAirFriction and how its different from airFriction?
Also are you sure thrust is applied by velocity vector and not model direction vector?
I remember I tried model direction until I found that model direction doesnt change at all after firing.
So I assume its not model direction
Try making a test addon and play around with thrust, thrustTime and airFriction to see what really happens
IIRC air friction is ignored for shotBullet maybe its also ignored here during some engine stages?
bullets do lose the speed while they travel, though
Maybe its ignored for something else then
shells?
I don't remember, I just know its ignored for something and could be ignored here as well
Anyone got any tools or software or etc that they use to create stringtable.xmls?
I would really like to get in contact with you
@young current
I have seen some that when you click on them, they open up in microsoft edge.
How do you reconcile that with making it in notepad?
You can open pretty much any file in notepad++
what windows is set to open things by default does not mean the files are made there
thats true yes
so my understanding of it would be that basically you call a file "stringtable.xml" and fill it with whatever you want inside and thats it?
I have the acompanying files, I am only concerned about removing text from a stringtable
ok thank you, I will see what I can do
its an older version and needs an update
#arma3_config is the channel for these btw ๐
It's ignored for shells not bullets
Mixed it up then
Side friction applies to x and z components of model velocity
Friction applies to y
Also for some reason the drag is cubic, not quadratic 
Yes
No exceptions for drag during missile stages?
Not for drag
Allright so...
I want to spawn AI in groups with custom cloths.
Thats what I achieved so far:
call{_tgp1 = [getPos ens1, east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup; _tgp1 deleteGroupWhenEmpty true;
{
_x setUnitLoadout [[],[],[],["U_B_GEN_Soldier_F",[["ACE_EarPlugs",1]]],[],[],"H_Beret_gen_F","",[],["","","","","",""]]
}
forEach units _tgp1;
_wp1 = _tgp1 addWaypoint [position twp1 , 0];
_wp2 = _tgp1 addWaypoint [position twp2 , 0];
_wp2 setWayPointType "SAD";
hint "Gegner marschieren auf";}
But they all have the same clothings...
Thrust is a bit weird
It only gets faded in the last 25% of thrust time (i.e. ((_time * 4 / _thrustTime) min 1) * _thrust)
The rest is applied at full
Oh, that must be is then
Linear?
@magic dust Here's your answer
Yes
Also you need to take into account the mass
Thrust is acceleration. The game applies it by mass to make it a force
Then it adds it to drag and gravity. Then it divides by mass to get final acceleration
Your code sets same identical clothes it seems, why did you expect them to have different clothes?
I know that this dont work like this. Thats my problem haha
Ive texted with a person and he sent me this:
call{_tgp1 = [getPos ens1, east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup; _tgp1 deleteGroupWhenEmpty true;
(units _tgp1 select 0) setUnitLoadout .... // First Unit
(units _tgp1 select 1) setUnitLoadout .... //Second Unit
_wp1 = _tgp1 addWaypoint [position twp1 , 0];
_wp2 = _tgp1 addWaypoint [position twp2 , 0];
_wp2 setWayPointType "SAD";
hint "Gegner marschieren auf";}
But this wont work. I dont know if Im not able to fill in the blanks or if the code dont work
Yes and No
To controle difficutly i would need a few lists than.
So one with easy weapons like pistols and weak armor
and another with Spec Ops or some
But if this is possible: Lets fucking do it
read how this works, if you want to only change something, you need to get loadout first and then set it back after modifications
exact
Like this:
{
_x setUnitLoadout [[],[],[],["U_B_GEN_Soldier_F",[["ACE_EarPlugs",1]]],[],[],"H_Beret_gen_F","",[],["","","","","",""]]
}
forEach units _tgp1
Just that I dont know how to select a single unit
You already do, forEach goes through each unit and has them as _x
... im not that good
call {
_tgp1 = [getPos ens1, east, (configfile >> "CfgGroups" >> "East" >> "OPF_G_F" >> "Infantry" >> "O_G_InfSquad_Assault")] call BIS_fnc_spawnGroup; _tgp1 deleteGroupWhenEmpty true;
{
private _loadout = getUnitLoadout _x;
_loadout select 3 set [0, selectRandom ["U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F"]];
_x setUnitLoadout _loadout;
} forEach units _tgp1;
_wp1 = _tgp1 addWaypoint [position twp1 , 0];
_wp2 = _tgp1 addWaypoint [position twp2 , 0];
_wp2 setWayPointType "SAD";
hint "Gegner marschieren auf";
};
Change classnames to whatever you want
Am I allowed to ask like a child?
I dont know what call does
Is "private" just for local clients or what is the private thing on it?
why is there a underline infront of _loadout
I DIIIIIID
The fuck
I dont understand
Im asking because I need another explanation
You can see in the screenshot ive sent to you that this is opened in my browser
In your case it just wraps the code in separate scope, basically nothing
I understood Scope haha so it give it his name, right? And everything insight the Brackits is the scope than, right?
Thats why the trigger condition is call{this}, right? I feel so lost
(please)
You will need to figure out the basics yourself, there are official docs as well as lots of tutorial videos explaining it
I try since 6 years
https://community.bistudio.com/wiki/Category:Arma_Scripting_Tutorials
All official articles, even reading through them all without fully understanding will give you a general idea how it all works
thanks for your help men...
"Call" executes a "code". A code is something wrapped in {} (also known as scopes). Without call it won't do anything.
_ behind a var name makes it local to the scope it was first created in. When the scope exits (after }), the variable won't be seen in outer scopes
private forces a variable name to be local to the current scope (it prevents overwriting variable with same name in outer scopes)
THAAANKS
oh my god Such a good explanation
I think Ive read something like this. Now the puzzle is puzzled
Copy Pasted this into my ArmA Brain folder...
And now I understood that the Brackits define the scopes (i gues a good step)
Am I right that the underline infront and "private" does quite the same?
Same what?
They both define a variable in a local scope {}
they're both local because of the _ behind them
private makes it local to the current scope
Thanks for you help <3, and Sa-Matra โค๏ธ
So say you have something like this:
_myVar = 1;
call {
_myVar = 2;
};
// Here myVar is 2
It changes myVar to value 2
But:
_myVar = 1;
call {
private _myVar = 2;
};
// Here myVar is still 1
In other words you can think of private as if it defines a completely new variable in a scope, even if the name is duplicate in an outer scope
That was unexpected
Thanks for saving my learing haha
// [Credits: Sa-Matra]
private _loadout = getUnitLoadout _x;
_loadout select 3 set [0, selectRandom ["U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F"]];
_x setUnitLoadout _loadout;
this isnt clear to me at all
What is unit _x?
Well _x is the current element in a forEach loop
the 4th element in the loadout array (_loadout select 3) is another array, and the 1st element (hence the set [0) of that array is the uniform
It just sets that element to a random element
So SaMatra wrote forEach units _grp. Units _grp returns an array of units (soldiers) belonging to said group
So _x is each one of those soldiers
connecting back to life https://youtu.be/qTX1lI8COuQ
private _loadout = getUnitLoadout _x;
Here he does a local variable with "private" that only is defined in the current scope {}
Than he gives it the Value _x
Am I right so far?
He gives it the loadout of _x (so the var _loadout contains the loadout)
getUnitLoadout _x means get loadout of _x
But who is _x?
Current item in loop
In a collection.
Ouuuuuuu ahhhhhh. Some are defined by engine
sideAirFriction applies to sideways movement. airFriction only to forwards movement
For example
{
} forEach [1, 2, 3]
Means execute the code {} one by one for each elements 1, 2 and 3
So each time it executes, it sets _x equal to those elements
(So first _x is 1, then 2, then 3)
Got it. Cigarrete break and than lets head on to the next part. Ive diffrent questions like how can it be random if all cfgUnits are the same...
_loadout select 3 set [0, selectRandom ["U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F", "U_B_GEN_Soldier_F"]];
Unit is first created as predefined one in CfgGroups, then you modify it through script
through what script? I feel like the zero and your the one haha please excuse my not knowledge
when you go to the gym you feel weak, but you end stronger.
When you start learning something, you feel stupid... but in the end you will be smarter ๐
welcome to my ted talk
hey i have the following code ran in initServer.sqf but i keep getting the issue of _sectorOwner not defined. any help?
{
_sectorOwner = nearestObject [getMarkerPos _x, "PortableFlagPole_01_F"] getVariable "OwnedBy";
_x setMarkerColor format ["color%1", _sectorOwner];
} forEach _sectorPoints;
That means either nearestObject returns null or getVariable returns nil.
oh interesting, strange.
so i did a little extra screwing around and debugging. and found that both "nearestObject" gives me the correct object and that "getVariable" on that object gives me the correct value when done seperately. but when i put them both together, it no longer works.
this is all the code in the document:
/*
init locations
*/
_allMarkers = allMapMarkers;
_sectorPoints = _allMarkers select {markerShape _x == "ELLIPSE"};
_Flagpoles = nearestObjects [[worldSize / 2, worldSize / 2], ["PortableFlagPole_01_F"], worldSize, false];
{
_x setVariable ["OwnedBy", resistance];
} forEach _Flagpoles;
{
_sectorOwner = nearestObject [getMarkerPos _x, "PortableFlagPole_01_F"];
hint str(_sectorOwner);
_x setMarkerColor format ["color%1", _sectorOwner];
} forEach _sectorPoints;
If "OwnedBy" is your variable, you need to prefix it
Oh i was unaware they needed a prefix
It isn't a strict requirement, it will work without it, but prefixes reduce the chances of variables getting overwritten by other mods and scripts using the same name
That's just a recommendation.
Ah that makes sense, does it matter if this variable being saved into an objects varspace and not profile varspace?
Variables saved to an object's namespace are still global variables
Well, it's less likely that another mod will be doing that with an object specific to your script, but it can still happen.
Fair enough, ill add a tag to it ๐
yea im gonna need more help with this. im completely lost on why it wont get the values from the variables despite the variables being 100% absolutely having the correct values
/*
init locations
*/
_allMarkers = allMapMarkers;
_sectorPoints = _allMarkers select {markerShape _x == "ELLIPSE"};
_Flagpoles = nearestObjects [[worldSize / 2, worldSize / 2], ["PortableFlagPole_01_F"], worldSize, false];
{
_x setVariable ["SPD_OwnedBy", resistance];
} forEach _Flagpoles;
{
_sectorOwner = (nearestObject [getMarkerPos _x, "PortableFlagPole_01_F"]) getVariable "SPD_OwnedBy";
_x setMarkerColor format ["color%1", _sectorOwner];
} forEach _sectorPoints;
heres all the code as of right now.
im lost. no clue why it wont work in the slightest
been trying to figure it out for hours now :(
heres proof that the variable exists and has a value
its just strange to me how the camp rogain marker is being coloured fine but the rest arent??
NearestObject -> Hardcoded radius is 50 meters.
it is??
fffffffffffuck i missed that on the wiki
welp, ima use nearestObjects and sort by distance then
Couldn't you place the marker more accurately? :P
I guess the markers are dual-purpose.
Store marker names in flagpoles, then:
{
_marker = _x getVariable "SPD_Marker";
_sectorOwner = _x getVariable "SPD_OwnedBy";
_marker setMarkerColor (format ["color%1", _sectorOwner]);
} forEach _Flagpoles;
well the markers location and the flag location are in two different places, i could just move the flag to be at the same location as the marker but i just personally prefer it like this
forgive me if this is a silly question, but why does this execVM work in debug console but not a trigger? systemChat goes through and running that same execVM line in debug also works, but the script does not run from the trigger
This code won't run from Debug Console either. You miss a ;
By default objectspace variables are set locally. You need to set the third parameter to true to make them global.
No, they're global. The 3rd param can be used to make them public.
Global =/= public
Public = network broadcast
Global = readable from anywhere on the client during the session (basically)
Hey folks, I need help understanding Namespaces better. I know, I read the Wiki but I still have a question:
If I set a Variable in a namespace for example
houseObjekt setNameSpace ["_adress","Funny Street 23"];
Can I call this variable from any other namespace and machine in MP by:
_houseAdress = houseObjekt getVariable "_adress";
Is this how it works, or would I have to make the variable public when I set it?
with objects you dont use setNameSpace but setVariable / getvariable instead
_myTruck setVariable ["TAG_myPublicVariable", 123, true];
that true at the end makes it public (for server and other clients).
https://community.bistudio.com/wiki/setVariable
Okay, great.
Next question, what does the "public" parameter in setVariable do?
Does it mean I can call the Variable just via TAG_myPublicVariable (like you do with Variables you publish with "publicVariable") or does this mean I still have to use the Namespace for it, like:
_myTruck getVariable "TAG_myPublicVariable";
Correct, it's just the name of the variable
"Public" also implies that the variable is synced across the network, so that all machines get the variable updated
Okay, but if I would not use the public parameter could I still get the Variable with getVariable when I know the namespace?
//On Server
houseObject setVariable ["Adress","Funny Street 1"];
//On Client
_houseAdress = houseObjekt getVariable "Adress";
No, because the value would be undefined on the client
Okay, got it. Sorry for when I seem fussy, but I really want to know for sure.
Another example:
//On Server
houseObject_1 setVariable ["Adress","Funny Street 1",true];
houseObject_2 setVariable ["Adress","Funny Street 2",true];
//On Client
_houseAdress = houseObjekt_1 getVariable "Adress";
This would give me "Funny Street 1" and it wouldn't overwrite even if the variable is the same name?
No, it would be Funny Street 2, because you updated the variable and synced it across the network
Damn
Okay, that is great. So I can use Namespaces to attach Variables to objects and they can use the same variableNames.
setVariable and getVariable are my new friends
Definetly. Mine too ๐
Okay, last question (hopefully). What happens when I delete the object?
You can also only update a variable on a certain machine, but that's not as useful for most people
For example:
missionNamespace setVariable ["TAG_someVar", 1, 2];
Would only update the variable on the server
Then there would be no object, any use of getVariable would return nil unless you gave a default value
Okay, great. So all variables are literally attached to the object. That is great. Thank you so much.
I really struggled getting this out of the Wiki. ๐
_obj getVariable "TAG_someVar"; // returns value if defined
deleteVehicle _obj;
_obj getVariable "TAG_someVar"; // returns nil
_obj getVariable ["TAG_someVar", false]; // returns false, since variable is undefined
Not always, you can also use other namespaces to store stuff.
Those are not tied to a object then.
https://community.bistudio.com/wiki/Namespace
He's referring to specifically objects
Yeah, I see, when I use one of the arma inherrent Namespaces, I can store stuff more or less persistantly, depending on what Namespace I use.
hey so, i see in some missions like Liberation and Antistasi that they use the task framework to use as kind of like a notification at the top middle of the screen. do they do this by creating a single task and just changing the title, description icon etc or is a new task created every time a notification pops up?
@tulip ridge @sharp grotto Thank you guys, that was really helpful and clarified a lot for me.
Yeah no problem
Looks like a new one is created each time
It's then later updated and deleted on https://github.com/official-antistasi-community/A3-Antistasi/blob/unstable/A3A/addons/core/functions/CREATE/fn_attackHQ.sqf#L87-L102
I dont get this anymore
{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
} forEach _GRUPPE;
Why doesent this work...
He says something is missing between "forEach" and "_GRUPPE"
If anyone wanna look at it I would be happy...
try forEach units _GRUPPE
Im into
forEach doesn't work with groups
That would cause a "type group expected array", not a "missing x" error, though
I've got a feeling there's something missing from the previous line (a ;, for example) and this is just where it's getting picked up
Thats the whole code:
call{
_GRUPPE = createGroup independend;
_SPAWNPUNKT = [5555.778, 440.678, 0];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
(units _GRUPPE select 0)
setUnitLoadout [["arifle_AKS_F","","","",["30Rnd_545x39_Mag_F",30],[],""],[],[],["U_OrestesBody",[["ACE_EarPlugs",1],["30Rnd_545x39_Mag_F",2,30]]],[],[],"","G_Sport_Red",[],["","","","","",""]];
(units _GRUPPE select 1)
setUnitLoadout [[],[],["hgun_Pistol_heavy_02_F","muzzle_snds_L","acc_flashlight_pistol","optic_Yorris",["6Rnd_45ACP_Cylinder",6],[],""],["U_BG_Guerilla3_1",[["ACE_EarPlugs",1],["6Rnd_45ACP_Cylinder",3,6]]],[],[],"","G_Respirator_white_F",[],["","","","","",""]];
(units _GRUPPE select 2)
setUnitLoadout [["srifle_DMR_06_hunter_F","","","optic_MRCO",["10Rnd_Mk14_762x51_Mag",10],[],""],[],[],["U_O_R_Gorka_01_brown_F",[["ACE_EarPlugs",1],["10Rnd_Mk14_762x51_Mag",3,10]]],[],[],"","G_Tactical_Clear",[],["","","","","",""]];
(units _GRUPPE select 3)
setUnitLoadout [[],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",17],[],""],["U_I_E_Uniform_01_tanktop_F",[["ACE_EarPlugs",1],["16Rnd_9x21_Mag",3,17]]],[],[],"","G_Bandanna_oli",[],["","","","","",""]];
{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
} forEach unit _GRUPPE;
_WEGPUNKT = [5501.956, 544.822, 0];
forEach unit _GRUPPE;
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];
_WEGPUNKT setWayPointType "SAD";}
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
units _GRUPPE, not unit _GRUPPE
independend
what
Exact spelling is important, the computer is not a human and will not figure out what you actually meant
He decided not to forgive me... nothing changed
What decided not to forgive what and what was not changed
independent not independend
does it actually creates a group?
check your rpt files to find the first error that you got
what is rpt?
The RPT is flooded with an error that is unrelated with the code you posted
I saw
Its the intro cam fucking my ear
So why ive sent this to you?
Ouuuu I think I shall switch language to english for you ...
It doesn't matter
So we could see the Error that is happening in the code you sent us.
Sadly, the logfile is flodded with other errors unrelated to the code you posted.
This means you have a lot of errors happening long before the code you posted is executed.
I would suggest looking into the log file and trying to figure out the Errors happening before and then continue with the unit spawn.
Im into fixing
Its an Intro Cam Template with 3 Cam Shots. I wanted more and got fucked
I want to place the script in a trigger. This .rpt is from a whole other run
Thank you really
This is a big mistake a do from time to time
removed it
creates error in a not existing file
hey guys im making a wasteland server for me and my buddies to enjoy, ive chosen tanoa as my map and using GTX servers as they offer a wasteland server already setup ready to change to my liking. my problem is i have very heavy fog in the server and cant find a way to change it. usually there would be a "setviewdistance" but on these servers theres no such thing as far as i can see
you're paying GTX for their servers so you should ask them tbh
Please explain my failure:
{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
}
forEach units _GRUPPE;
Im close to bang my head into the wall
Well what error are you getting
I don't remember if having a forEach (or similar command) on a new line causes an error, I assume it would
Please explain. I didnt understand a single word
That was to my question
I am not referencing to your point, Dart's
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Your error is not coming from this part of your script, that segment is fine
Your issue is skipping the basic things and trying to fix your entire project in the same time
Here it is:
{
_GRUPPE = createGroup independent;
_SPAWNPUNKT = [5555.778, 440.678, 0];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
"B_Soldier_F" createUnit [_SPAWNPUNKT, _GRUPPE];
(units _GRUPPE select 0)
setUnitLoadout [["arifle_AKS_F","","","",["30Rnd_545x39_Mag_F",30],[],""],[],[],["U_OrestesBody",[["ACE_EarPlugs",1],["30Rnd_545x39_Mag_F",2,30]]],[],[],"","G_Sport_Red",[],["","","","","",""]];
(units _GRUPPE select 1)
setUnitLoadout [[],[],["hgun_Pistol_heavy_02_F","muzzle_snds_L","acc_flashlight_pistol","optic_Yorris",["6Rnd_45ACP_Cylinder",6],[],""],["U_BG_Guerilla3_1",[["ACE_EarPlugs",1],["6Rnd_45ACP_Cylinder",3,6]]],[],[],"","G_Respirator_white_F",[],["","","","","",""]];
(units _GRUPPE select 2)
setUnitLoadout [["srifle_DMR_06_hunter_F","","","optic_MRCO",["10Rnd_Mk14_762x51_Mag",10],[],""],[],[],["U_O_R_Gorka_01_brown_F",[["ACE_EarPlugs",1],["10Rnd_Mk14_762x51_Mag",3,10]]],[],[],"","G_Tactical_Clear",[],["","","","","",""]];
(units _GRUPPE select 3)
setUnitLoadout [[],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",17],[],""],["U_I_E_Uniform_01_tanktop_F",[["ACE_EarPlugs",1],["16Rnd_9x21_Mag",3,17]]],[],[],"","G_Bandanna_oli",[],["","","","","",""]];
{
_x setSkill ["aimingAccuracy", 0.4];
_x setSkill ["aimingShake", 0.4];
_x setSkill ["aimingSpeed", 0.35];
_x setSkill ["targetingAccuracy", 0.6];
_x setSkill ["spotDistance", 0.5];
_x setSkill ["commanding", 0.8];
}
forEach units _GRUPPE;
_WEGPUNKT = [5501.956, 544.822, 0];
forEach units _GRUPPE;
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];
_WEGPUNKT setWayPointType "SAD";}
wot
Your error is from the second forEach units _GRUPPE;
forEach expects code on the left, but you gave it nothing
It's likely a copy/paste mistake if I had to guess
wot = what
^this is what i wanted to say
Bro Im a beginner HELP MEEEE
Dont lough at me. HELP ME
Explain me. Educate me. PLEASE
Then take a rest
wot
I told you what was wrong
Your error is from the second
forEach units _GRUPPE;
forEachexpects code on the left, but you gave it nothing
It's likely a copy/paste mistake if I had to guess
You can just delete the second forEach units _GRUPPE;
Cause their allready selected by the first (?)
I don't really know how you've done your code, but it doesn't make sense to start from that amount of code without having much clue. Take a rest, forget the idea and start from the small step first
And gift 400โฌ Ill get for the Mission
Of course I do
No thanks
Bro Ive 9 Days left. Theres a Deadline
But thats not the point
Im here for solutions
So please stay on topic track
My point is already told
I dont wanna anger you but if you dont wanna help me. Please stop sending new msg in who pushs the topic away. You dont need to.
And gift 400โฌ Ill get for the Mission
It's not a gift if you're giving something in return, and that's also (legally) a transaction
So you have legal issues there
loosing faith in humanity
I have told you what is wrong twice now
If you're not going to read it twice, a third time isn't going to help
Ive even answered this...
And now anwser my question to this @warm hedge I gues you wanna help if you text again
Why?
?
Why can I remove it. What was my mistake. What is the learning I can take from it
Because that chunk of code does not fit into the syntax that compiler can understand
What is a chunk of code?
_WEGPUNKT = [5501.956, 544.822, 0];
forEach units _GRUPPE;// this line
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];```
So a part of .sqf is a chunk. Are there more characteristics to define and recognize a chunk or is everything a chunk? Wait I think Ive got it
Blablablabla; <- This is an chunk
didididiidi; <- This too
am I right?
I think chunk is a colloquialism for a part of your code, not an official term.
Thats why Im asking. Thank you very much. I really wanna learn this.
So lets go on with your message: @warm hedge
Because that chunk of code [since here all clear]
does not fit into the syntax [Syntax is the form of sequence my command is formed](not 100% sure)
that compiler can understand [I have no clue]
You mean me?
yes, you
Yeah
if that is your code - what is the line highlighted here supposed to do?
Its a the german word for WAYPOINT and defines the kords of the local waypoint "_WAYPOINT"
Than I wanted to add the Waypoint to the units
_WEGPUNKT = [5501.956, 544.822, 0]; this line puts array of 3 numbers into a variable _WEGPUNKT
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0]; this line creates a waypoint and puts it into variable of the same name
forEach units _GRUPPE;// this line what does this line do?
@warm hedge
Your called <@&105621371547045888> and I wonder if you know for what a "help" Channel is for. Im a newbie I even told. I have questions to everything. I gues you had a well better start. Maybe because there were people not like you who really wanted to help you. If you want pros: Please set conditions on this channel. Otherwhise react never again to my messages if you dont really want to help.
Fine? Yeah? Thanks
Ohhh my gooood your right. I mean what are they doing haha
Their chunk is solved by ";"
I wanted to connect it with the next line
_WEGPUNKT = _GRUPPE addWaypoint [_WEGPUNKT, 0];
so that a Waypoint will be created forEach units of _GROUP
You feel my point? How can I do this?
individual units don't have waypoints. https://community.bistudio.com/wiki/addWaypoint specifically calls for Group
5.5k hours and I never noticed that if I do a waypoint from a group member it appears from the group leader
ouchhhh
So I add the Waypoint to my group and have my solution, right?
Like you said haha
With the diffrent: Ive learned why
Thank you!!!
Thats why Im here. give me your paypal so i can gift you a dollar as sign for my thankfulness haha
I have a question. When scripting chatter that shows up in "side channel" how do i make the text show up with slight delays in between,
So person 1 says some things, and due to the length of the chatter, maybe i need 6 seconds of delay before the next line fires -
And then person 2 replies.
Like typical chatter in any bohemia made mission
Im not an expert but Ive used "sleep" for this cases ๐
Here is the definition and averything:
Yeah Sleep is probably the way to do it, so in a very rudimentary and non-scripting way, would it look something like this?
scriptcall voiceline:
Voice 1: "Bla bla bla bla bla"
sleep 6
Voice 2: "bla?"
Yeah your right ๐
I really have to say Im no profi. But if I think about I would do it somehow with a If Cause
Hmm so how would that work script wise i wonder. maybe like this? lol
class CfgRadio
{
sounds[] = {};
class RadioMsg1
{
name = "";
sound[] = {"\sounds\hillbilly.ogg", db-10, 1.0};
title = "You are a hillbilly";
sleep 2.5
class RadioMsg2
{
name = "";
sound[] = {"\sounds\huh??.ogg", db-10, 1.0};
title = "Excuse me..?";
};
};
};
Yes but I dont know if Sleeps delay is accepted in decimal
only one way to find out i guess.
In germany we call it ZUGRIFF (engage)
It is.
Is there anything i would need to change in the script to make it... work?
Finally ๐ Thank you again for the explanation @south swan
I cant detect anything. But I gues that sleep isnt finished with a ";" -> first try than change haha
oh yeah true.
Almost everything :D
You're mixing Config (the stuff with classes, which is used to pre-define things) with Script (SQF syntax, where code is written to be actively executed)
That makes sense yeah,
All that config stuff, CfgSounds etc., is meant to go in your mission's description.ext. It creates classes which you then reference with script commands like say3D.
That's fair, All i know right now, is how to make the text work along with a soundfile(see example below). It's the "sleep" to then follow up with the next line of text that i'm trying to understand, i'm not quite sure where in the script it will go ๐ค
class CfgRadio
{
sounds[] = {};
class RadioMsg1
{
name = "";
sound[] = {"\sounds\hillbilly.ogg", db-10, 1.0};
title = "You are a hillbilly";
};
};
two seconds, i just spotted that 2nd radio msg in your link
didnt see it at first
CfgRadio is a config thing. Your sleep doesn't go anywhere near it.
Config is like a structured database the game can look at to find information. It's parsed during mission loading, and can't be changed. It's not active code.
You will need this CfgRadio to create your radio message classes, but it is not, in itself, the code to play those messages.
Your CfgRadio goes in description.ext, and then your script, which is separate, will refer to those classes by their names.
* it's https://community.bistudio.com/wiki/sideRadio for using CfgRadio classes, as opposed to say3D for CfgSounds
** or groupRadio, vehicleRadio etc, whichever channel you're after
Does the game then just automatically know when it needs to play the next file?
No, you need to do that in your script.
Okay, i was wondering if i could have a say 4 minute file with voice, and then have the text follow appropriately, or is it more covenient to chop it up, and have each Line be said individually
so it keeps going radiomsg2-3-4-5 etc?
because thats where i originally thought if i could use sleep, to then let the game know, hey, i want you to not show the next line of text until the voice file actually is there.
I like to have a large conversation switch file that you use recursively when needed. BI does this as well for the campaigns.
It doesn't look like CfgRadio supports multi-part subtitles like CfgSounds does, so breaking it up into smaller lines is probably necessary, unless you want to manually script the subtitles.
I see, so if we do the script like this, as shown on the wiki link you sent me.
class CfgRadio
{
sounds[] = {};
class RadioMsg1
{
name = "";
sound[] = { "\sound\filename1.ogg", db - 100, 1.0 };
title = "I am ready for your orders.";
};
class RadioMsg2
{
name = "";
sound[] = { "\sound\filename2", db - 100, 1.0 }; // .wss implied
title = "$STR_RADIO_2";
};
};
Would the radio messages overlap or would radiomsg2 naturally wait for Radiomsg1 to be completed, before firing?
Again, that's not script. It's config. It looks correct, for config, but it does not cause the messages to be played. This is just setting up the classes - resources - which you will then call on with your script, using commands like sideRadio. It's your script that decides how the messages are played. The config classes are separate from each other and don't have any inherent connection.
Well yeah i know its just one half, i dont have the game booted yet.
So you put all that in your description.ext, and then in your script you would do something like this:
_unit1 sideRadio "RadioMsg1";
sleep 5;
_unit2 sideRadio "RadioMsg2";```
Generally things happen at the moment the script command is executed.
The only case where the game overrules your script, in terms of timing, is in cases where a source can only do one thing at a time. Like, with `say3D`, if you use the same unit as a source for multiple sounds, it will wait until that unit finishes playing the first one before doing the next. But that's about _that unit_ only having one mouth, it's not decided by the config stuff. Radio commands _might_ work like this too, you'll have to test, but obviously if you're using different units for each message then it won't matter.
Makes sense yeah, standby 1.
* Don't forget to make sure the unit you use for testing actually has a radio item on it. Not all BI default loadouts have one, and they are required for radio commands to work.
Good call, for the beginning it wont matter as i'm making a sort of briefing for the players, so i'll be doing that in direct-comm. All i need to know now is how to make sound localized from an object, and not playing over the entire server, and then i'm actually good to go.
Sound is played like the object is making the noise, like a speaker or a person talking normally: say3D, playSound3D, CfgSounds
Sound is played like the person is talking on the specified radio channel: sideRadio, groupRadio etc., CfgRadio
Sound is played by magic in your head: playSound, CfgSounds, playSoundUI
Are you talking about some or can I post a question to execVM in?
Hmm, How would you make the object make the noise work along with "BIS_fnc_playVideo"?
I don't know much about how BIS_fnc_playVideo handles audio.
It's possible (but I don't know) that when you use the video-on-object-texture method described in example 3 (https://community.bistudio.com/wiki/BIS_fnc_playVideo), then the audio is also associated with the object.
If that isn't the case, then you would have to split the video and audio into separate files, and just play the sound with say3D or playSound3D at the same time as starting the video.
Yeah i was worried i would have to do that aswell by splitting it up into video, background sounds, and then the individual voicelines. I'll try that video on object method, and if not i'll just have to do it the hard way.
Does anyone remember the command to export a functions content to the clipboard?
I'd assume copyToClipboard str my_fnc_functionName would do it
You can also open functions in the Functions Viewer and see their contents, provided they're CfgFunctions registered
That works, I thought there was a dedicated command for it though. Either way, thanks
anyone know how i can make an ai unit do a bombing run, trying to make a ww2 scenario where the bomber plane comes in and bombs a German base and flies away.
hey! anyone know why this doesnt work? ๐
_captureText = parseText "<t size='2.0'>A zone has been captured!</t>";
[west, ["captureNotification",""], ["",_captureText,""], [0,0,0], "CREATED"] call BIS_fnc_taskCreate;
What it says, nothing or wrong format?
Try:
_captureText = str parseText "<t size='2.0'>A zone has been captured!</t>";
[west, ["captureNotification",""], ["",_captureText,""], [0,0,0], "CREATED"] call BIS_fnc_taskCreate;
NOTE: str before parseText
I think the easiest and most reliable way is just spawning the bombs yourself under the planes and give them a velocity:
private _bomb = createVehicle [_bombClass, [0,0,1000]];
_bomb setPosWorld (_plane modelToWorldWorld [0,0, boundingBox _plane#0#2]);
_bomb setVelocity (velocity _plane vectorAdd [0,0,-1]);
it just looks like normal text.
I'm pretty sure doing str on structured text is the same as not having made it structured text in the first place, which is pointless
what could be a reason for a vehicle not showing up in zeus, but in the editor. It has scopeCurator= 2 ;
You can try it without str or parseText - the taskCreate function might automatically parse to structured text
Not being added under units[] array in cfgPatches I think
Or the addon not being added to curator addons
the 5 others do show, but i will double check the units[] array
ye it had a slightly differnt name in the units[], thanks!
follow up question: the units[] only need new Items/Vehicles what ever, right?
oh yea it does ๐
thanks o7
can you send a link?
I have a fired event handler that calls my script. As fps drops fire rate decreases which affects what my script does. Is there anyway to calculate maximum fire rate based on fps?
You're best posting the function called from the Fired EH.
Calling code for every shot fired is HEAVY! There is probably a better solution to what you want to do.
params ["_unit"];
private _phase = (_unit animationSourcePhase "muzzle_flash");
if (_phase == 0 || _phase == 3 ) then
{
if (_phase == 3) then
{
_unit animateSource ["muzzle_flash", 0, true];
};
_unit animateSource ["muzzle_flash", 1];
};
if (_phase == 1) then
{
_unit animateSource ["muzzle_flash", 2];
};
if (_phase == 2) then
{
_unit animateSource ["muzzle_flash", 3];
};
Essentially, a three barreled turret where muzzle flashes are individually animated
No, it's really not.
The performance cost of calling a function alone is neglible.
The code in that function could have a decent performance cost, that's why failing hard and failing fast is important.
If your code is only supposed to run on X type of ammo, then that should be the first bit of code in your function
Maths is cheap, loops/heavy repetition is expensive
You can use diag_fps to find the current frame rate. Then it's reasonably simple maths to work out the theoretical maximum rate of fire based on that. (FPS x 60 = maximum RPM). You can also compare that to the weapon's mechanical rate of fire by looking it up in the firemode config. (To save performance, try to look this up once per weapon, not every event, and store it somewhere for quick retrieval - or if you know you're only dealing with one firemode for one weapon, manually look it up and then hardcode the number)
I'd say RPM that depends on the FPS is not a normal behavior so I'll tackle it
Not by making EHs
Bad wording on my part.
This sounds like a better spot for a model cfg solution
im starting a wasteland server for me and my buddies to enjoy and have just got it running but i have a problem with visibility, the fog on the server is so extreme and i cant work out how to change it. usually you would just go to arma3.config and set the script but it seems wasteland overrides that file. does anyone have an idea of how to do it? the server does have CHVD but im not sure how to go about changing that
Does this weapon have a variable ammo count, or a set one?
Is it Tanoa?
(ie, does it have more than one count of belts)
yeah sure is
Are you trying to solve something on your model.cfg/P3D?
This person is trying to solve it with scripting
My function to calculate infinite is super expensive
// fnc_calcInfinity
params ["_value"];
_value + 1 call FOO_fnc_calcInfinity;
I think model cfg would be better
Okay, it seemed the context was jumped enough
Nobody is sane here, so don't worry
there we go now they know I'm talking to them
Anyways. Having that kind of EH won't restore the RPM. It still is unknown why FPS can affect that much
It is in Arma, it's just that most guns' rate of fire is lower than typical frame rates. You have to have a pretty high mechanical rate of fire to see the effects.
Miniguns are one type of weapon that could exceed average frame rates, which is why they fake a higher RoF by using bullets that cost multiple ammo and have splash damage.
That kinda makes sense
Arghahahaha! I knew it.
I've played many different missions across servers on Tanoa and had encounters with the fog every time.
It's not a mission or server setting. It is the terrain.
I'm afraid I don't have a solution. setFog on the server seemed to reset after a few minutes, back to the mysterious fog.
damn thats a shame, its such a good map. thanks anyway!
Maybe forceWeatherChange will work?
I don't think I've been on Tanoa since 1.16?
https://community.bistudio.com/wiki/forceWeatherChange
okay i will give it a go! where would you reccomend i put that in?
Server Execution: server exec means that the command or function has to be executed on the server machine, either mission host or dedicated server.
oh gotcha, okay thank you so much i will have a little play around and see if i can break something lol
ideally you could have selectionFireAnim[] if memoryPointGun[] is used but I guess its too limited of a use case
fair I missed recursion, but that's technically heavy repetition
All code is just loops
All code is a set of instructions typically followed in a structured way, unless you go for the joke languages that break that idea and do things in random order
Yeah it's just a loop that only runs once
Also if it wasn't obvious, it was just sarcasm
Is there any easier way of deferring whether an item is clothing, a weapon, an item, etc then by utilizing it's config? By the looks isKindOf supports "Weapon" but couldn't find if there way anything for anything else like clothing or anything like that.
I returned all the parents of cfgVehicles but there was a crap load of stuff and honestly couldn't find much to hint to clothing.
type or iteminfo config
Cheers thanks ๐
Could look at https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_getItemType.sqf for a reference
Hi!
I have pasted my SQF code and a rough depiction of the config I am working with but right now I am struggling with indexing a config for a value while also keeping what I am doing optimized. Given how many nested forEach I have, certainly there is a better way to do what I am doing. I did define a scopeName and used a breakTo to prevent it from continuing to iterate when a value is found. That obviously significantly increased performance with the screenshots I've got below.
Essentially I am just looking to find a a class name that is equal to what I am looking for while also being able to do a getNumber to get it's value. Apologies if I am butchering my terminology there as I do not typically deal with configs.
Would anyone have any suggestions of how I could speed this up and remove the nested forEach garbage I am currently doing :)?
scopeName "main";
private _return = 0;
{
{
{
if (_this isEqualTo configName _x) then {
_ret = getNumber (_x >> "value");
breakTo "main";
};
} forEach configProperties [_x];
} forEach configProperties [_x];
} forEach configProperties [missionConfigFile >> "CfgStuff"];
(_return)
class CfgStuff {
class BLUFOR {
class Backpack {
class B_Kitbag_tan {
value = 100;
};
class B_Kitbag_mcamo {
value = 50;
};
};
};
class OPFOR {
class Helmet {
...
Okay got BIS_fnc_codePerformance to 0.07 now by replacing the inner most forEach with a findIf but still feels gross haha
private _return = 0;
{
private _cfg = _x >> _this;
if (isClass _cfg) exitWith { _return = getNumber (_cfg >> "value")}
} forEach configProperties [missionConfigFile >> "CfgStuff", "isClass _x", true];
_return
Actually you need another loop. I forgot
Haha was just trying to see if I could fix that myself- didn't wanna bother you before I tried first :D
I can tell difference is gonna be huge already though. Did not know about isClass that is great ๐
Anyway, if you want the best performance just cache the config into a hashmap (you have to read everything in your cfgStuff once tho)
I think I am gonna give a shot at adding an extra loop just because I am curious the performance increase but you are probably right about the hashmap. I would really only be using it with one thing but it is gonna be running semi-frequently on server so probably just makes sense I just create it on init or something.
I'll modify the current example you sent though and send the performance resulst though in-case you are interested :)
Well if you do it right hashmap will be miles faster, but sure, feel free to ping me with your results ๐
Hey people. Im into adding modules by script and I need help.
Ive found this on Wiki:
_moduleGroup = createGroup sideLogic;
"ModuleSmokeWhite_F" createUnit [
getPosATL player,
_moduleGroup,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];
I do fully understand whats happening. Until _disableAutoActivation, false, true];"
I mean I can read that its task is to activate the module. But I dont know how I could create something like this by my own. Like to configurate the smokes density. All I can find to a topic like this, was this: https://community.bistudio.com/wiki/BIS_fnc_initModules
Can maybe someone help me with that?
is there a way to remove weapon sway in the PBO files?
Do you mean via a Mod?
so im setting up a wasteland server and currently the weapon sway is just ridiculous. i pulled the mission file from the server and im currently looking for the place to turn sway off but havnt found it yet
I am not sure you're saying yes or no
i would prefer not to have to use a mod to remove it, i know there is a mod called remove sway or fatigue but i was hoping maybe there was a way to do it in the files
I recall there is a script command
do you know where the command would go into? im sure i can probably find the command online but i dunno where to put it
parameter aimPrecisionSpeedCoef).
i might give this a go, where would i put this script?
That's not what I suggested
oh this one then? player setCustomAimCoef 3;
It makes the sway bigger 3 times, but that's the command
okay so if i set 1 or 0 it should be less then?
do you know where i run that command to?
This needs to be run where argument is local.
On the client/player
oh okay, im running the server through GTX so im still trying to work out where everything is
Hey guys, I gues Ive a problem with a variable. Everything works but he says that _dichterRauch is an undefined variable.
Here is the code. I cant get the failure:
// Erstellung der entsprechenden Gruppe
_modulGruppe = createGroup sideLogic;
// Definierung der entsprechenden Art
_dichterRauch = "ModuleEffectsSmoke_F" createUnit [getPosATL player, _modulGruppe, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]"];
// Konfiguration
_dichterRauch setVariable ["effectRadius", 50, true];
_dichterRauch setVariable ["effectIntensity", 5, true];
hint "rauchscript lรคuft";
That createUnit syntax does not return the object. Use another syntax (first one) instead
https://community.bistudio.com/wiki/createUnit
this time Ill try to make you proud. Not like the last one.
I'm not here to be proud
Ive chosen this Syntax now:
group createUnit [type, position, markers, placement, special]
So I filled in the blanks
_modulGruppe = createGroup sideLogic;
_dichterRauch = sideLogic createUnit ["ModuleEffectsSmoke_F", getPosATL player]
He says I did something wrong with the Syntax. I dont see it.
[type, position, markers, placement, special] is 5 things. ["ModuleEffectsSmoke_F", getPosATL player] is two things 
none of the 5 are marked as optional, all 5 should be provided
So like this:
_dichterRauch = sideLogic createUnit ["ModuleEffectsSmoke_F", getPosATL player, [], 0, "NONE"]
Should do
Still something is creating issues. Im into reading wiki first.
Ok ive read about the Factions and found now out that sideLogic is an own faction for modules and game logics.
The error says something about the group went wrong.
Do I also have to name it? I dont get it...
.
//Creating group sideLogic
_modulGruppe = createGroup sideLogic;
// executing createUnit
_dichterRauch = sideLogic createUnit ["ModuleEffectsSmoke_F", getPosATL player, [], 0, "NONE"]
sideLogic isn't a group, though
.
Your right. Its a side. Such as BLUFOR.
So im adding the Modul to the side "sideLogic"
But where is the failure
_modulGruppe = createGroup sideLogic;
_dichterRauch = sideLogic /*you are not using _modulGruppe here*/ createUnit ["ModuleEffectsSmoke_F", getPosATL player]```
So its the wrong parameter in the syntax... got it
you have Sides (west/blufor, east/opfor etc)
these Sides have Groups (Alpha 1:1, etc)
you create Units in Groups (David Armstrong, etc)
You did
Issue is here
Ouuu. So if I got you right. I have to use my var "_modulGruppe" because of it contains the command and the factions side.
sideLogic is a side. createGroup sideLogic makes a group. sideLogic still is a side, not a group
So yes
Confusing. But it makes fun. Thank you a lot since now ๐
Wooooooooooo it worked !!!!!!!
Next step will be the configuration.
But first eating meanwhile I watch Cinematic ...
https://youtu.be/y_SfeLDR3fg
It has to look something like this:
// Konfiguration
_dichterRauch setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_dichterRauch setVariable ["effectRadius", 50, true];
_dichterRauch setVariable ["effectIntensity", 5, true];
any command or trick to check if mission is in intro phase or scenario phase?
I really dont know. But Ive two questions to the experienced.
//First Question
Ive got the tip in the past to start building missions backwards and finish with the intro. Would the expierenced say that this is sencefull?
//Second Question
I was able to enter a configuration to my smoke (yayy) But I want more than just the effectSize.
So my question will be if there is a list of these: _dichterRauch setVariable ["effectSize", 50, true];
Some like effectIntensity you know?
you could eventually use initIntro.sqf which fires in intro and outro ๐
...Actually, do we miss that command for these two decades straight?
This game is Ded, for sure
@still forum : getScenarioStage/getScenarioPhase or something alike, would it be possible? if yes, I tikit it
Looks BI is not really good at brainstorm
There is a gamemode "intro", but don't know how thats related to initIntro
intro, outroWin, outroLo(o)se
Is there any List guys? Or parameters for this ["effectParticleMultiplier", 2, true];
Mh eden is creating seperate displays?
Mission runs in DisplayMission, Intro in Intro, Outro in Outro
When they are different displays, with different IDD's you can probably find them that way
RscDisplayMission
RscDisplayIntro
RscDisplayOutro
- your call
- see https://community.bistudio.com/wiki/Particles_Tutorial ๐
_colorRed = _logic getVariable ["ColorRed",0.5];
_colorGreen = _logic getVariable ["ColorGreen",0.5];
_colorBlue = _logic getVariable ["ColorBlue",0.5];
_colorAlpha = _logic getVariable ["ColorAlpha",0.5];
_timeout = _logic getVariable ["Timeout",0];
_particleLifeTime = _logic getVariable ["ParticleLifeTime",50];
_particleDensity = _logic getVariable ["ParticleDensity",10];
_particleSize = _logic getVariable ["ParticleSize",1];
_particleSpeed = _logic getVariable ["ParticleSpeed",1];
_particleLifting = _logic getVariable ["ParticleLifting",1];
_windEffect = _logic getVariable ["WindEffect",1];
_effectSize = _logic getVariable ["EffectSize",1];
_expansion = _logic getVariable ["Expansion",1];```According to BIS_fnc_moduleEffectsSmoke
so "just" findDisplay "RscDisplayOutro" would do?
(also don't forget the difference between outroWin & Lo(o)se)
Don't know, might need the idd
Thank you both alot. These are many things to learn. In germany we call it ZUGRIFF (engage)
btw. @still forum I love your work. Thank you for your service to the ArmA Community. Im a fan ๐
by checking endType if Outro is there https://community.bistudio.com/wiki/missionEnd
im working on a very simple little thing but i dont know much about scripting,
i just have a VR Area circle grey that turns VR Area circle yellow when standing on it and it gets ordinance fired (repeatable)
i got the trigger all sorted with
the grey circle called targetsafe and the other targetunsafe and a hideobject true and false on activation and deactivation but the targetunsafe is still able to be seen before activating the trigger but when it is activated it works proper
the init of the VR Area circle yellow
this hideObject true;
this setObjectScale 2;
and another thing i couldn't get working is repeatable ordinance, i was using a module synced up to trigger
yep, unfortunately this only works if you're the one making the mission ๐ฆ
yes - are you doing that in a mod?
yep, but, regardless, it was something I was curious about, as yesterday I didn't find anything
is it possible to just spawn a normal rocket that isnt fired?
private _rpg7 = createSimpleObject ["A3\Weapons_F_Exp\Launchers\RPG7\rocket_rpg7.p3d", position _drone];
_rpg7 attachTo [_drone, [0, 0, 1]];
_rpg7 enableSimulation false;
if i spawn it like that its fired already
yes, you "just" need to animate it
is that possible just in the innit box of the drone?
you have to use the _rpg7 variable you have here
whats the command for it called? _rpg7 animate [""]?
There is magazine model "\A3\Weapons_F_Exp\Launchers\RPG7\rocket_rpg7_item.p3d" maybe its a better fit
oh that worked, thx mate. where do i find these names? i havent found it in config viewer yet. Just put _item behind it?
in "CfgMagazines" >> "RPG7_F" >> "model" (or "modelSpecial"), probably ๐คทโโ๏ธ
thx
is there a way I could use this in a trigger?
Sure why not?
The script is not complete tho. First of all you need to define the bomb class
Also you need to make it loop to make it a bombing run. This just drops one bomb by one plane
I want to use addForce to apply a southwards force to the player. From what I understand the input for the force origin is in PositionRelative and to do that I need to either attach an invisible object to the player or somehow get a north facing output to apply the force from.
My question is, should I try and write a script that attaches an invisible helipad to always face north from the player, to get the start position for addForce - which is then deleted
Or is there a way to get a specific bearing around the player in PositionRelative?
addForce is world position, see the doc
ah, no
it is that
- force is world value
- pos is relative value
if you apply to [0,0,0] it will be fine anyway ^-^
Alright, thank you mate 
The position for addForce isn't the force origin, it's the point on the object to which the force will be directly applied.
Setting the position to the top of the object doesn't mean the force will come from above, it means the force will move in the vector direction and "hit" the specified position. Like, if you apply sideways force to the back of a car, it will spin.
If you do need to convert between relative and world positions or vectors, you don't need to faff around with attaching helipads and stuff. Use commands like worldToModel, modelToWorld, and their vector counterparts
Thanks for the explanation, I've realised my mistake as I was actually looking at the wrong bloody wiki page aha
I'm now using (getPosASL forceStart) vectorFromTo (getPosASL player)
Also, if you want to always use a given compass direction, you don't necessarily need to do any sort of conversion or directionfinding at all. In world space, X is west-to-east and Y is south-to-north, so if you want to always apply southwards force, you know you just need a negative Y value.
So one of the zeuses in this clan that im in, has this error that repeats itself 5 million times in the log files (not an exaggeration). It says "Warning Message: mpmissions__cur_mp.lsb_terrain_mimban\mission.sqm/Mission/Entities/Item1/Entities/Item5/Entities/Item10/Entities/Item85.type: Vehicle class 3AS_Prop_Baseplate_20_GAR no longer exists"
trying to host this on a dedicated server is whats giving this issue. Any clues?
missing mods
@warm hedge Can you say me where youve got this?
So I can replicate the same for fire Modules? Or are they all the same?
Problem is its pretty hard to find out what mods are missing, because he doesnt have anything that pops up when loading in the mission, saying: "this mod had not been loaded, either enable or force load the mission"
yep
It's either a missing mod, or the mod was updated to remove the object class (horrible practice but people still do it)
Judging by the classname it's a 3AS mod
So if hes putting down a composition, that has missing assets, it would potentially give that error? The thing that makes it confusing, is when you're able to put down the composition, without errors
I don't know, maybe. It looks like it's part of the mission.sqm, though, so Editor-placed, not something Zeus placed during the course of the mission.
This isn't a scripting problem though, so you might need #arma3_troubleshooting instead
Thats true, i was struggling to find the correct channel
Guys Ive several questions to the picture Ive posted:
Why does the script create the car including the smoke but not the fire?
Ive tested both codes (smoke/fire) separate and both worked. But if I combine them it stops working.
This is my code:
// Erstellung der entsprechenden Gruppe-
_modulGruppe = createGroup sideLogic;
//Autowrack spawnen
_HMMW_Wrack = "Land_Wreck_HMMWV_F" createVehicle [3015.43, 2350.629, 0];
// Definierung der entsprechenden Module
_FeuerAutoBrand = _modulGruppe createUnit ["ModuleEffectsFire_F", [3015.43, 2350.629, 0], [], 0, "NONE"];
_RauchAutoBrand = _modulGruppe createUnit ["ModuleEffectsSmoke_F", [3015.43, 2350.629, 0], [], 0, "NONE"];
// Konfiguration Feuer
_FeuerAutoBrand setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_FeuerAutoBrand setVariable ["effectSize", 5, true];
_FeuerAutoBrand setVariable ["ParticleDensity",50];
_FeuerAutoBrand setVariable ["ParticleLifting",1.5];
_FeuerAutoBrand setVariable ["ParticleLifeTime",100];
_FeuerAutoBrand setVariable ["Expansion",1];
// Konfiguration Rauch
_RauchAutoBrand setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_RauchAutoBrand setVariable ["effectSize", 5, true];
_RauchAutoBrand setVariable ["ParticleDensity",50];
_RauchAutoBrand setVariable ["ParticleLifting",1.5];
_RauchAutoBrand setVariable ["ParticleLifeTime",100];
_RauchAutoBrand setVariable ["Expansion",1];
And how can I fix the problem that smoke and wreck arent in the really same position? Something like noclip that the game agrees to place 2 object in the same position.
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Use "CAN_COLLIDE" instead of "NONE" for createUnit
I know that mod, those classes were deleted a very long time ago
Why they deleted them and not just deprecate them, no clue
Ive two more questions:
- How can I add the rotation kord to the createVehicle position? solved (setDir)
- How can I randomize the rotation then? solved (random 360)
shit mod dev ๐คทโโ๏ธ
They got plenty of hate for it
we are trying a one last thing (saving the placed composition ourselves) but i doubt it would make much of a diff
it really sucks cause i wanted to make some cool CW missions
Why does this not work:
_bumm = "HandGranade" createVehicle getPos player;
_bumm setDamage 100;
I want the granade to explode
grenade
I think this is not the way to spawn it
I spawned a SatchelCharge meanwhile. It worked. I gues the faiure is somewhere in the variable
So that "getDamage" couldnt reach the explosive
you need to spawn the ammo type
less time at the mirror more time at the dictionary
Hi pigu
Now it works ๐ oh my god
it cost me 1 minute google it
you should try it
I asked chatgpt after grenade classname ...
oh ma gad
Chatgpt just makes shit up
Like, in general
Not even just for Arma
Unfortunately, you can't actually just make a computer chat bot think for you
well, you got the classname lol but not for the purpose that you want, that's why is good just to google what you want to do, arma 3 is been out since 2013
He said classname: "HandGranade"
That's definitely a thing chat gpt made up to tell you
Use an LLM that cites its sources and then go to the source ๐ they are good for cutting down the middle man but LLM hallucinations are a thing
Or just, don't use gpt
even with wrong spelling omg ๐
It's a much less useful tool than just, your brain
If I do counter +1 +2
Will he do +3 or will he do +1 or +2
Gpt isn't even a good search engine
Why waste time googling though if 9/10 times it can do that job for you. LLMs are an extremely useful tool
Because it gives you total bullshit and misses shit all the time
oh ma ga
which is why you use an LLM that cites sources and then go to the source
Second part
thatd be your 1/10
source: BIKI
Just don't use it, it's shitty tech propped up by companies trying desperately to eventually be profitable
๐
Is there a way to get a list of all Module Specifications? Like to configurate them?
I wanna edit the content of the screenshot
Where can I find the parameters?
try function viewer in the editor
For what am I looking there then?
I went threw all registers. Am I doing something wrong?
function viewer, not config
ops
Ive never entered this one. flashbanged
Theres alot of input inside but I cant find ModuleTracers_F
Is there a way to navigate in a more efficent way than searching by alphabet?
Typical... everythings there but not what Im looking for haha. Where is ModuleTracer gone?
ModuleTracers_F is a module not a function
You can find it in config viewer
The function name is listed in its config
In this case it's "BIS_fnc_moduleTracers"
Allright lets goo
You already mentioned the function name tho
What are you trying to do again? Do you want to modify the function?
Yeah I want a Intro scene and spawn the modules in and out
So I need to modify them into running mission
Same with GenericRadio. But there I dont know where to find the Sentence names
Guys do you have experience with say3D?
Sure why?
I have encountered an anomaly ๐ ๐ For unknown reasons its not working how its supposed to work. When played from trigger. It fast forward part of audio, like old tape and continues the rest of audio in normal speed.
It's wss right? What did you use to encode the wss?
Or is it ogg?
It happens in multiple occasions ( we have more characters talking like briefing, AI chit chat in hallways etc)
Give me second I will ask friend. But it some times lag, some times it doesnt. Like in 2 cases from 5 test runs it runs smoothly.
He says "I used audacity to encode it from mp3 to 48000hz mono ogg"
ogg
You should convert it to wss/wav
I had that happen to me when using sideRadio with a logic without setIdentity (but the whole sound was fast or slow, not just a part)
Ogg?
It acts like:
approaching captain
Captain: "Hey caasdplaomj foijna gnjaiogaergaergfaegaerg, then get your gear and fuck some penguins
ogg it was yes
sideRadio or kbTell though, I don't remember now
most likely kbTell now that I think of it
So anyway try a mono wav to see if that solves the issue
If it does but you don't like its size, compress it to wss using WavToWss from A3 Tools
We will try it, thank you ๐
stupid question, if i assign a player unit a variable name and that player respawns, do they keep that variable name tagged?
"wav" doing the same shit ๐ข @little raptor
Try asking in #arma3_audio
Those guys can help better with this issue
Hi if anyone has a mission file or script for some custom radios theyve added on a server I could see as a reference I would greatly appreciate it
Having a hard time understanding it on the wiki 
{
if ((side _x == west) and (_x isKindOf "Car" || _x isKindOf "Tank" || _x isKindOf "Helicopter" || _x isKindOf "Plane")) then
{
_x addEventHandler ["Killed",
{
params ["_unit","_killer"];
systemChat format ["%1 has been killed by %2.", _unit, _killer];
}];
};
}forEach allUnits;
Could anyone explain why this doesn't work? I can't seem to get a killed eventhandler applying to any vehicle on the western side.
allUnits is for units - things with brains - not vehicles.
While units and vehicles are sort of the same in some contexts, they aren't completely the same.
Try vehicles instead.
Haha. I guess configs tripped me up on this since they're all under CfgVehicles.
I'll test this out
What effect are you seeking? Just the kill messages?
I'm creating a point system where it's like var_destroyed + 1 on all vehicles. Your side loses if too many vehicles are destroyed. The system chat was just for testing
Thank you. This worked
I'm having an issue with ACE CSW. I'm using the RHS m252 as a base, so same rounds and magazines, but loading rounds into the tube isn't working
class hab_fuze_rhsusf_m252_d: RHS_M252_D {
displayname = "M252 VT Fuze";
scopeCurator = 2;
class ACE_CSW {
enabled=1;
proxyWeapon = "habfuze_mortar_81mm_proxy";
ammoLoadTime = 3;
ammoUnloadTime = 3;
desiredAmmo = 1;
disassembleTurret = "habfuze_M252_Bipod_Bag";
disassembleWeapon = "habfuze_M252_Gun_Bag";
};
class assembleInfo {
primary = 0;
base = "";
assembleTo = "";
dissasembleTo[] = {"habfuze_M252_Bipod_Bag", "habfuze_M252_Gun_Bag"};
displayName = "";
};
class EventHandlers {
init = "_this call HAB_FUZE_fnc_init_m252_fuzes"
};
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"habfuze_mortar_81mm"};
magazines[] = {"rhs_12Rnd_m821_HE", "habfuze_81mm_12Rnd_WP"};
};
};
};
I actually don't know the difference between Mission EHs and EHs. Don't they just monitor and execute stuff?
Standard EHs are attached to specific objects and only fire for events related to those objects.
Mission EHs are attached to the mission as a whole and can fire for events regardless of which objects are involved, as well as for events that don't necessarily involve a specific object.
Standard EH: fire when this object is killed
Mission EH: fire when any object is killed.
The idea is that instead of finding all objects of a certain class and adding a Killed EH to them, you add a single mission EntityKilled EH, and filter by class when it fires.
The advantage is that you don't have to make a way to catch newly-created objects and add an EH to them.
That's config, not scripting, but you're missing magazineLocation to note where the load ammo action should be
Thank you, and my bad!
If RHS follows convention, you can use:
magazineLocation = "_target selectionPosition 'usti hlavne'";
That would put it at the end of the barrel
addMissionEventHandler ["EntityKilled",
{
params ["_killed", "_killer", "_instigator"];
if ( (side _killed == west) and (_killed isKindOf "Car" || _killed isKindOf "Tank" || _killed isKindOf "Helicopter" || _killed isKindOf "Plane") ) then
{
var_usdestroy = var_usdestroy + 1;
hint "friendly destroyed";
};
}];
So, I've tried switching to addMissionEventHandler, but I can't seem to get it to trigger now. I've tried using the iskindof checks by themselves, and they seem to work. But, it seems like the side check doesn't work. What am I missing?
The side probably changes to civilian once it's dead
You could look up the object's config side rather than checking its current side, or try using its faction instead.
gotcha thanks
I can't verify it, but you could simplify those last two checks to check isKindOf "Air"
Btw, you can use the lazy evaluation syntax for and and or, or sequential exitWiths, to reduce the number of checks that have to be made per firing.
Your current version checks all those conditions, even if a broad one is already satisfied, which is inefficient. You could instead check something that eliminates most possibilities first, and then only do the remaining checks on things that pass the first check.
Examples:
// other checks are only run when the object is side west
if ((side _killed == west) && { _killed isKindOf "Car" ... }) then { ... };
// same result, different method
if (side _killed != west) exitWith {};
if !(_killed isKindOf "Car") exitWith {};
...```
\* not saying go back to using `side` check, just using what's already there to illustrate the concept
So I've looked everywhere, is there a script I can use on a crate to spawn randomized guns in it for a pvp night with the boys?
You could make one yourself pretty easily
Writing this on my phone so it may not be 100% correct
if (!local this) exitWith {};
private _weapons = ["arifle_MX_F"];
private _weaponCount = 5;
for "_" from 1 to _weaponCount do {
this addWeaponCargoGlobal [selectRandom _weapons, 1];
};
You could just put that in an object's init and it'll add some weapons to it
Just put the weapon class names in _weapons and change the count to your liking
I definitely wanna learn to do that but I'm VERY new to mission making and scripts as a whole, I appreciate it!
SQF (arma's scripting language) isn't too bad to learn I would say
There are definitely some things that will trip people up, but the overall language isn't super difficult to read
Hey guys, I am having a hard time getting my head around creating a module to turn a script system into an addon.
Currently we have a specialised respawn system set up via script in a mission. The current layout in the mission folder is like below:
MyMission.Altis
โโโ functions
โ โโโ function1.sqf
โ โโโ function2.sqf
โ โโโ function3.sqf
โโโ description.ext
โโโ mission.sqm
โโโ initPlayerLocal.sqf```
The issue I'm having is figuring out how to convert this into the module format, as we want to be able to share the respawn system as a mod without the hassle of implementing scripts in the mission folder.
Hoping someone may be able to shed some light, or at least tell me I'm a fool and it's actually there in the wiki. (I am brand new to SQF scripting in arma but have my head around config)
Thanks!
There is a full page on how to make modules on the wiki. If you need to see examples or more in depth tricks and processes, I can help you tomorrow.
You can also look at my code in modules enhanced GitHub if you want to look at examples in the meantime. Though I am refactoring for 1.0 soon.
Good day. Did anyone face the problem where getUnitLoadout returns empty array [] ? Why?
You provided wrong arg I guess.
I provided bunch of AI units, check that arg IsKindOf "Man", check that it is not Null and alive.
Still, for some units, usually for several of the same group, getUnitLoadout returns []
Post code
Everyone always does everything right, but you get the wrong result, right?
By the way, use https://community.bistudio.com/wiki/getEntityInfo.
F*ck me ๐ After adding more logs I found the problem - it happens with AI animals, Dogs, for example. Have no idea why doggies passed the IsKindOf "Man" check though 
Because Man includes animals.
Arma'd
Anyway, thanks for your response, guys
Wish there was a quick way to check entity type similar to getEntityInfo, its so useful
_object getEntityInfo 0?
Other simulation kinds too
tankx, helicopterrtd, etc.
Yes I know its a matter of getText(configOf _x >> "simulation") == "tankx" check and you can even cache it in hashmap by class name but checking such essential entity info could've been a dedicated command
And SimpleVM won't work with this many commands
_array select {isTank _x} vs _array select {getText(configOf _x >> "simulation") == "tankx"}
Guess I'm like 15 years late
Yeah would be nice. And while we are at it a easy command to check for armed/unarmed for example ^^
hello, i will that the ai shoot at an marker with the artillery a simple script to put in the init line
an example but it dont work when i put it in the init line
opform5 doArtilleryFire [getmarkerpos "opform5_target", "8Rnd_82mm_Mo_shells", 32];
this is an script from arma 2 with the game logic arty [M1, getmarkerpos "M1FM1", ["IMMEDIATE", "HE", 0, 30]] call BIS_ARTY_F_ExecuteTemplateMission;
is there an example for arma 3
i don't always want to add an sqf file but simply pack it into the unit and leave
if you put in the init line of the artillery unit, try:
this doArtilleryFire [getmarkerpos "opform5_target", (
(getArtilleryAmmo [this]) select 0), 8];
make sure that the marker name exists and if doesn't work, maybe the artillery unit has no ammo for some reason or is out of range
okay and how is it with an area to shoot is that also possible?
maybe a line of more markers
for that you will need to do a script
but starts with getting the basic working first
okay
Hi!
I'm working on an AWACS systems mod, and i'm having to quite often reload the game, since i do updates to the code frequently. But since i've been ArmaScripting for only 3 days now, it's unknown to me about what kind of methods there are to reduce the testing times of script mods.
Any help would be appreciated!
I believe you need to add -filePatching in startup parameters
Or test in your SQF in a mission
i tried that, but loading my unpacked mod resulted in it simply not working. I could see it being loaded in, but none of the functionality was executed. Perhaps it was my file structure in the unpacked folder? i'm unsure.
try to do what polpox said, I'm not a modder so I don't know how to help you with that
could you please elaborate on that? i'm not very savvy with sqf testing in general.
Cannot really tell anything other than the idea because I don't know specifics of your script
it uses ACE and CBA
well, to put it simply, it's adding ACE menu options to the player, when they're in a specific aircraft. There is a scanning option, which progressively scans for units in a range, and marks them both on the map, and 3D.
shares the info to other players as well
server-side features
Okay, So whatโs wrong?
nothing's wrong. i'm just looking for a way of testing the mod quicker.
cuz currently i'm having to restart the game every time
Well, still don't know how it is working so can't say but make your debug environment in a mission and try it within, is my goto
i'll look into it, thanks.
Does anyone have some strong experience with Zeus scripting? I'm making a script for FOB/defense fortification building and im using zeus for it. The players get an object with an action. The first player to use the action is granted temporary access to a limited zeus with limited assets, resources, editing and camera area around the initial object.
I got it working perfectly on client/local server but I'm really struggling with making everything work on dedicated.
Almost all scripting commands in regards to Zeus have to be executed on the server but for some reason i'm not getting consistent results, idk if it's due to scheduling or variable localization
This is my function fn_fortMaker which spawns the box with the action
params ["_spawnPos","_radius"];
_box = createVehicle ["Land_Cargo20_red_F",_spawnpos,[],20,"NONE"];
_box allowDamage false;
_box setVariable ["fortRadius",_radius,true];
[_box,
["Fortify Area",
{
params ["_target","_caller"];
[_target, _caller, _target getVariable ["fortRadius",100]] remoteExec ["CO_fnc_startFortification",2];
_target setVariable ["zeusAvailable",false,true];
},
nil,
6,
true,
true,
"",
"_target getVariable ['zeusAvailable',true]"
]] remoteExec ["addAction",0,true];
_box;
CO_fnc_startFortification is my function that Creates a Zeus module object, here's how it looks
Here's where I'm at currently at on dedicated: The Zeus is created properly with the correct addons, editing area, camera area and ceiling. However the zeus doesn't have the event handler nor the correct action coefficients.
Ooooooooooh I think i figured out the cause of the problem. The zeus got it's locality changed from Server to Client
Does anyone know how I could avoid this change of locality, or work around it
can you script armbads?
Hi, since I need to record a cinematic scene , is there a script I could use to make AI die with less ammo instead of me unloading a full magazine on 'em before they die? ๐ฅฒ Thanks!
_badguy setdamage 0.5; simple way
but might get bloody
Indeed I already tried that it gets bloody :/
you can add a "Hit" event handler to increase the damage or straight up kill the ai
u can also do that by decreasing the health bar on attributes its the same
interesting
Hmm, curious what the limitation of simpleVM is there.
Hello everyone !!!
I took a year break off of arma 3 ๐ and it feels Great to come back to this community with all the wise advices and great personalities!!
Im trying to get back up to speed with the community and the game all over again .
Can anyone tell what this error code it pops up ever time I deceased a bad guy
i wanna post i picture but i forgot how to post with this message
You should be able to post pictures to #arma3_troubleshooting
Works with single command only iirc?
Good evening people ^^
Ive a simple question.
I want to use a Variable from another .sqf file.
I read that I can use them after loading the .sqf file via "execVM".
I did this but somehow it doesent work...
Or am I doing something wrong? Like "_Intro_GRUPPE_I_1" isnt my group variable
Variables that start with underscore _ are local variables, in your case you might want to use global variable. You can make your variable global by deleting the underscore: _Intro_GRUPPE_I_1 ---> Intro_GRUPPE_I_1
It's not the only possible way to handle the variable, but you can try that approach at first
Ohhhhhh your right
I remember. But arent variables in Scope {} local too?
So do I have to delete call{} too?
I removed the unterdline. Nothing changed
How are you using the variable in the other scripts? You seem to delete the group in the end of the code above ```sqf
deleteGroup Intro_GRUPPE_I_1;
Same error
"non defined var"
So you're trying to create the group in one function and delete it in another?
The group is only used in Intro. So Ive did a template of creating units.
Than I execVM in the intro file to the tmplate. And in the end I want to delete everything from the intro with the last line in the intro script
I will show
Intro script
.
Group template. So this is "Intro_Gruppe_I_T1_4_1.sqf"
I changed _Intro_Gruppe_I_1 to local again after nothing changed.
I also dont think that this is the problem because the local vars
of Group Template are getting loaded by execVM, or not?
No, the global variable is correct. Local variables only exist within the current scope (and children).
But you'd need to change every instance of the variable to global. There's no automatic conversion.
But I allready did. So there has to be more. Ill change now.
Either that or do Intro_GRUPPE_I_1 = _Intro_GRUPPE_I_1 at the end of it.
Well, if Arma says that the variable is undefined then it's undefined.
How many times I wanted to speak to ArmA in person and show him _Intro_GRUPPE_I_1 = createGroup independent; THERE IT IS
Now we have
You're using execVM, so the deleteGroup runs before the creation happens.
Im ready to learn.
execVM is like spawn. It means "run this code at some point in the near future".
And then execution of the current function continues immediately.
The script does not execute immediately upon running execVM command but with some delay depending on the VM's scripts queue and engine load.
(wiki to "execVM")
Maybe newbie question but what is VMs scripts?
Arma maintains a queue of scheduled scripts that it needs to run.
Every time you use spawn or execVM you're adding an entry to that.
If I learned right, it is allways the first non active script in the scheduler if I use execVM?
It's the script that's been asleep for longest.
If that's not distinguishing, the behaviour is undefined.
I may be misinterpreting your question.
I need a cigarrete. So much input... btw, im in Voice if you wanna talk
.
Ive got the issue I think. Its the opposit. Were to slow.
So intro.sqf is running to the point where execVM is reached. Than scheduler gets Intro_Gruppe_I_T1_4_1 in que. (But doesent exec)
So that intro.sqf script goes on and does deleteGroup "...".
After finishing intro.sqf scheduler goes on and launches Intro_Gruppe_I_T1_4_1 .sqf
(thats the theory)
Yes, that's what I said.
Oh wow I understod that were to fast... so if I use exec instead execVM, it should work
[Anything] exec "Scripts\Gruppen\Intro\Intro_Gruppe_I_T1_4_1.sqf";
I think I do it not in the correct way
exec is an old thing from before SQF.
You should use the function library. See the other link I pasted.
And then you can just call the function.
I was thinking about fsm and say that all faults lead into deleting. Im so in desparation haha.
Now I grab my laptop. Open Your link. Turn a cig and take a break. See you in 5 Minutes
or call compile?
Dude, that thing takes more than 5 minutes to read.
Oh yeah, I forgot that call compile exists
that's the easier way if you don't want to learn how to do things properly.
But my cig burns not longer
You can also be lazy and still do it "properly".
Inside initplayerlocal.sqf / init.sqf / initsever.sqf / mod pre-init etc.
// Define functions
{
missionNamespace setVariable [(_x #0), compileScript [_x #1]];
} forEach
[
["XYZ_fnc_ABC","Code\XYZ_fnc_ABC.sqf"],
["XYZ_fnc_DEF","Code\XYZ_fnc_DEF.sqf"]
];
I remember this.
I did my difficulty like this. Am I right that Ive to rename the file himself then into fn_Intro_Gruppe_I_T1_4_1.sqf so it becomes readable to the function.
And on the way I define the path with class Category (Category can be replaced by the folder name, right?)
And there are diffrents to build the functions pending where I define it. (description.ext | config.cpp -> dont even know this...)
So if Im defining Functions in desciption.ext I need to create a new Folder in main, named "Functions", right?
(I will ask now many question if I understand something right/wrong)
My understanding:
I need to give it 2 Names. One first Name (the classname)
And a Second name (the subclass)
Its just like an ID of a person.
Theres the Classname=Forename
And the Subclass=Surname
Thats all about the TAG, right?
Are you still there @granite sky ?
So, the outer while loop is always running, correct? Since I just need this for a small portion of my mission, would it negatively impact performance for the rest of the mission?
Not substantially. While the toggle variable is false, all the outer loop does is check that variable every 5 seconds. The performance impact of this is miniscule.
However, if you really do only need this for a very small time, then it might be better to use the other method I mentioned - making the loop a function and just spawning it again when you need to start the loop again. The always-running monitor loop is better for when the loop is likely to be turned off and on quite frequently and you just want to be able to set-and-forget the system.
Can someone help me understanding the Functions right?
sure
Oh my god thanks
I really starting to aks myself what Im doing wrong. I slowly thought Im a bad human and thats the reason theres no help for me like alltime.
the two are unrelated, you may very well still be a bad human, who knows ๐
so what's the matter ^^
In the beginning
What is the task of funcions?
Ive got it like their are transforming paths and orders together in this 2 splitted function name that I can use as result to do the order with the selected path.
a function is just a named bunch of code to be executed.
they are preloaded, so there is no disk reading when calling the script (even multiple times)
Copy this. I understood it to 99% right. Theres no way to misunderstand this.
They are like vars just with more code. In easy words
Ok, so far so good.
Next step is to know and fully understand how theyre created.
We need an example... wait...
Lets start with Tag value
The first word called "TAG" is the functions name, with that I can control it later, together with the subclass name.
as shown in https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Function_Declaration :
- in a scenario, create a
Functions\MyCategory\fn_myFunction.sqffile - in it, write
hint format ["It works! Passed arguments: %1", _this];
- in
description.ext, declare this function with
class CfgFunctions
{
// a tag is used to avoid possible community conflicts
// e.g BIS_fnc_setDamage, ACE_fnc_setDamage, etc
class EBER // the BIS_fnc prefix, here it will be EBER_fnc
{
class MyCategory // named like the directory
{
class myFunction {}; // named like the file, minus the fn_ part
// will end up as EBER_fnc_myFunction
};
};
};
- save the scenario
- use your function, e.g here
[player, 42] call EBER_fnc_myFunction;
So in my mission, it would need to start being turned off. So if I'm understanding correctly I need to make a function to turn it on. Which I can do with the waitUntil command. But since my function's purpose is to remoteExec something, should I also have a way to turn it off when it isn't needed anymore (for networking performance)?
But the way you worded this > "just spawning it again when you need to start the loop again"
doesn't work that way with waitUntil right?
So let me explain by my own and say "You dumb fggt" or "Good student" hahaha
ยดยดยด
class CfgFunctions | General command to start everything
{
class TAG | Name of everthing (the Name ive to run later in script? Like TAG_fnc_Intro_Gruppe_I_T1_4_1.sqf)
{
class Category | Home folder (what to do if more folders to cross like Templates\Groups...?)
{
class myFunction {}; | Here ive to insert the script. But in these brackits or do Ive to replace "myFunction" with Intro_Gruppe_I_T1_4_1.sqf?
};
ยดยดยด
class CfgFunctions = general class to define functions yes
class TAG = function prefix (TAG_fnc_something)
what to do if more folders = use file = to eventually determine deeper directories, but in 99.99% cases you won't need that
"here I have to insert the script" = no, not at all! just the class myFunction {}; alone, the script will be written in the sqf file as detailed before ๐
sorry I don't have time to explain more at the moment. I'll try to remember to get back to you later if someone else doesn't help you.
I read this the 20. time now...
"here I have to insert the script" = no, not at all! just the class myFunction {}; alone, the script will be written in the sqf file as detailed before
I gues you misunderstood my hard broken englishgerman because I think that your saying what I wanted to say haha
Ive found the issue. Im to dumb to conversation. I ment the scripts file name. Not the Script itself
example:
class CfgFunctions | General command to start everything
{
class TAG | Name of everthing (the Name ive to run later in script? Like TAG_fnc_Intro_Gruppe_I_T1_4_1.sqf)
{
class Category | Home folder (what to do if more folders to cross like Templates\Groups...?)
{
class Intro_Gruppe_I_T1_4_1.sqf {};
};
// named like the file, minus the fn_ part
``` ๐
My head is thinking about what is sencefull now to learn.
First step will be to smoke a cig.
Second step will be to ask if this was all because im still confused by the wikis examples haha. There is so much more text...
Third step is to bring alltogether (WOOOOOOO)
Second: Yes this was all... lol
I thought this will take hours more.
For third step Ill try to reach the goal. If something goes wrong Ill ask the Fourth question haha
Since here Im so thankfull to you. Youre such a good person and helped me with problems you would say cute to haha
Just a lot of thanks โค๏ธ
Im so exited rn that Ive told my Ma everything haha. Even the ArmA Lore and the case of spy on Limnos with greek law.
Next holliday target set ahahahaha.
So now practice the knowledge
Good evening everyone. I am wondering, why do I end up getting actionObj undefined when hinting it? I appreciate your time.
toggleAction = {
params ["_actionObj"];
hint ( _actionObj);
};
addEnableAction = {
params ["_actionObj"];
if (!isNil "_actionID") then { player removeAction _actionID; };
_actionID = player addAction ["TogglAction", { [_actionObj] call toggleAction; }];
};
private _actionObj = 1;
[_actionObj] call addEnableAction;
the code in an addAction is an entirely new scope and is not aware of surrounding code
pass it as a parameter or add it as an object variable, etc
_object addAction [
"title",
{
params ["_target", "_caller", "_actionID", "_args"];
_args params ["_input0", "_input1"];
// my code using _input0 and _input1
},
[_input0, _input1] // put what you want to pass here
];
I see now thanks a lot I couldnโt see why it was working in the first function & not there. Cheers ๐
As I understand it leader can change to a different unit if leader dies. However, when I kill the group leader to test this no sound is played (because the unit is dead). Do I need to have a sleep or something to let the leader pass to another unit first? It doesn't seem instantaneous.
[(leader _group), ["flarelaunch", 400]] remoteExec ["say3D"];
Im back ๐
I gues its simple but I cant get behind it. Im really trying.
My script and everything is pined to the message.
Ive placed CfgFunctions down to description.ext
He says that theres an undefined variable on line 50 "call Intro_Gruppe_I_1_fnc_Pfad;"
Am I running the function the wrong way?
you can try to force the leader changing by commands
Im kinda in determination right now. Im hanging on this since 3 hours...
I don't know much about functions but this what mine looks like and it works fine:
class CfgFunctions
{
class FoxClub
{
class fnc
{
file = "functions";
class Conversation {}; // this will make the function FoxClub_fnc_conversation
};
};
};
And I call it like this [playersspotted1, [player]] call FoxClub_fnc_Conversation;
And the file is called fn_conversation.sqf
I had it in a way like this. Felt right. But than I remembered about something called sublass that Ive to give. Im kinda clear kinda confused about the topic.
But your message helps
You could try to copy/paste your names onto mine and see if it works.
.
FoxClub is TAG (so the name)
fnc is the Category (so the location if "file =" isnt used)
Conversation is the function you wanna run (Is it right that the file format like .sqf is missing?)
I was asked 5 mins ago if I ever leave my Voice channel. My anwser was: "Im learning"
I really really want to understand all of these. Like a knowledge sponge.
In germany we say "Ganz oder garnicht" (all or nothing)
I double checked. This is what it looks like.
Allright thank you alto since here. Im gonna try this out.
So Ive to delete the file ending ".sqf"
Bring in "file =" in the right position
And form the right execute command to combine it with call
ZUGRIFF (engage)
Here is what someone told me:
2.) add your function file with the prefix fn ie: fn_conversation.sqf into functions folder
3.) add CfgFunctions to description.ext:
So looks like you need a functions folder too.
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
IT WORKS. WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thanks to @granite sky even if you left me in confusion.
A really really big thanks and hug to @winter rose
And @blissful current youve helped me finishing all together. Feel huged too please
Oh ma gad finally!
you need to slow down a bit ๐ and try your stuff first and see what is wrong by just reading a lot of what biki and ppl from Bohemia forum says, other important thing is to check people's work to see how they do.
yeah you need to leave time to learn. learning to debug and troubleshoot is probably the most important part of learning this stuff.
don't rely on others to test your code
I'm not sure if this is standard practice but I basically test after each little thing I do. That way it's way easier to narrow down what I actually did to cause an error.
me too
question: how is it possible, that certain feature works when I test it locally (play -> multiplayer) in editor, but when it's on live server, it doesnt' work? On our server we have a tool called bulldozer, which just removes/hides trees, bushes, buildings from area you select. It worked for like 7 years iirc, but it suddenly stopped working. What's interesting is, that locally it works perfectly fine, but when I join a hosted multiplayer server, the bulldozer menu is just not in it's sub menu, and also other scripts which rely on that feature stopped working too.
When was the last time you used it? A lot has changed in 7 years.
well I know, but it worked like a week ago
looking at script commits, we didn't touch a thing related to it
also the server is running on profiling Arma build
it's just a general question, like what could potentially go wrong
Mostly locality and JIP issues. Something not firing where it should.
Did you run your server on release branch the last time it worked?
JIP?
Join in Progress. Joining into the game during a game
ah
Post the GitHub if you have it
yeah Ill ask the main devs to maybe revert some commits, test it on server, and if it's not working, to switch to release build
thanks!
_unitsInArea = (switchableUnits + playableUnits) select {
(_x inArea generatorArea) && (alive _x)
};
private ["_selectedUnit"];
if (count _unitsInArea > 0) then {
_selectedUnit = selectRandom _unitsInArea;
};
["idea", [_selectedUnit]] remoteExec ["FoxClub_fnc_Conversation", allPlayers select {_x distance generator <= 50}];
Is it not possible to use _selectedUnit in the array for a function?
