#arma3_scripting
1 messages · Page 160 of 1
And you're doing this all where? preInit?
class CfgFunctions {
class PiR_ZEN_Compat {
class Functions {
file = "\PiR_ZEN_Compat\scripts";
class healUnit;
class hurtUnit;
class initActions;
};
};
};
i read some documentation said that preInit was useless
So what's the entry point?
Also those functions would be called PiR_ZEN_Compat_fnc_healUnit, not healUnit as referenced in your other code.
also how is your mod folder structured what files you have in there ?
why ?
it's automatic ?
Yes.
You should check that your functions work as expected before you start trying to hook them into Zen.
You can just check it in Function Viewer to see if your fnc is there. If you dont see it there then its not implemented properly.
3 are here
so i've problem with
params ["_unit"];
_unit setVariable ["dam_dihanie_statys", 1, true];
_unit setVariable ["dam_puls_statys", 1, true];
_unit setVariable ["dam_krov_statys", 5, true];
switch (gestureState _unit) do
{
case "pir_medic_uncondition_1": {[_unit, "PiR_medic_uncondition_1_out"] remoteExecCall ["playAction", _unit];};
case "pir_medic_uncondition_2": {[_unit, "PiR_medic_uncondition_2_out"] remoteExecCall ["playAction", _unit];};
case "pir_medic_uncondition_3": {[_unit, "PiR_medic_uncondition_3_out"] remoteExecCall ["playAction", _unit];};
case "pir_medic_uncondition_4": {[_unit, "PiR_medic_uncondition_4_out"] remoteExecCall ["playAction", _unit];};
case "pir_medic_uncondition_5": {[_unit, "PiR_medic_uncondition_5_out"] remoteExecCall ["playAction", _unit];};
case "pir_medic_uncondition_6": {[_unit, "PiR_medic_uncondition_6_out"] remoteExecCall ["playAction", _unit];};
};
_unit setVariable ["dam_player_krovstoit0", true, true];
_unit setVariable ["dam_uncondition_injured0", true, true];
[_unit, false] remoteExecCall ["setUnconscious", _unit];
_unit setVariable ["dam_conec_istorii0", true, true];
[_unit, "UnconsciousOutProne"] remoteExecCall ["switchMove", 0];
[{
params ["_unit"];
_unit setVariable ["dam_ignore_CountTimeEffect0", 0, true];
_unit setVariable ["dam_ignore_HealEffect0", (24 - round ((damage _unit) * 24)), true];
}, [_unit], 2] call CBA_fnc_waitAndExecute;
_unit setVariable ["dam_ignore_CountPlayerList0", [], true];
_unit setVariable ["dam_ignore_CountPlayerEffect0", 0, true];
_unit setVariable ["dam_ignore_Apteka0", 0, true];
[{
params ["_unit"];
_unit setVariable ["dam_player_lecit0", false, true];
}, [_unit], 2] call CBA_fnc_waitAndExecute;
2:00:20 Error in expression <ealUnit.sqf"
params ["_unit"];
_unit setVariable ["dam_krov_statys", 5, true]>
2:00:20 Error position: <setVariable ["dam_krov_statys", 5, true]>
2:00:20 Error setvariable: Type String, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
2:00:20 File PiR_ZEN_Compat\scripts\fn_healUnit.sqf..., line 5
So, it start to be complicated to understand and the dev of PiR looks no super cooperative
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
You don't need to try and use C# highlighting, it's not C#
It is saying _unit is a string
(you are passing a string into the function. You should be passing an object)
Hello, bit of a weird one here, using a custom (ua) template for antistasi ultimate, it has worked fine on a locally hosted server but when we moved to a dedi today it will not allow us to choose the faction as rebels (player faction) when we select it as the AI occupants it works fine but when we choose it as our faction the server gives me this error and it stops initialising
3:28:15 Error in expression <ction_reb get "initialRebelEquipment");
_initialEquipment append lootBasicItem;
>
3:28:15 Error position: <_initialEquipment append lootBasicItem;
>
3:28:15 Error Undefined variable in expression: _initialequipment
3:28:15 File x\A3A\addons\core\functions\Ammunition\fn_loot.sqf..., line 82
3:28:15 ["RHS_Mi8AMT_vvs","RHS_Mi8mt_vvsc","RHS_Mi24V_vvsc","RHS_Mi24V_vvs","rhsusf_CH53E_USMC_D","rhsusf_CH53E_USMC_GAU21_D","RHS_UH1Y_UNARMED_d","RHS_UH1Y_d","rhs_ka60_c","RHS_Mi8T_vvsc","RHS_Mi8T_vvs","RHS_UH1Y_UNARMED_d","RHS_Ka52_vvsc","rhs_mi28n_vvsc","RHS_Ka52_vvs","rhs_mi28n_vvs","RHS_AH1Z","RHS_AH1Z_CS","RHS_AH1Z_GS","RHS_Mi8MTV3_vvs","RHS_Mi8MTV3_vvsc","RHS_Mi24P_vvs","RHS_Mi24P_vvsc","RHS_UH1Y_d","RHS_UH1Y_d_GS"]
3:28:15 Error in expression <;
{ _groundVehicleThreat set [_x, 80] } forEach (A3A_faction_Reb get "vehiclesA>
3:28:15 Error position: <forEach (A3A_faction_Reb get "vehiclesA>
3:28:15 Error foreach: Type Number,Not a Number, expected Array,HashMap
3:28:15 File x\A3A\addons\core\functions\init\fn_initVarServer.sqf..., line 552
3:33:09 Client: Remote object 4:118 not found
3:33:09 "TCAGame/BIS_fnc_log: HandleDisconnect : commanderX"
I've looked at the respective lines in the pbo's and its just melting my brain as I'm not even close to a coder and it looks fine... hoping you guys might be able to work out if it's an easy fix or if its a lost cause... just super strange that it works in a local host but not on the dedi
I can send more in dm's if easier if it will help just ask pls
So... what did you do? An error itself will not lead to any fix, especially we don't know what or how the script even works
Is it ok if I dm you? a lot of words to put in one channel i figured
Makes sense, I just don't know what to put but here we go -
Loading into antistasi ultimate, had a mod to extend antistasi adding a new template for a ukraine force, when selecting that as a rebel faction in a local host it works perfectly fine, but trying it on the dedicated server it leads to this error.
The first error means that you don't have initialRebelEquipment defined correctly in your rebel template. The second one is Ultimate-specific, apparently they let you buy attack helis?
If it works locally then you've probably failed to load your extension mod on the server.
anyone know how to get ur milsim discord on the #communities_arma3 channel?
It doesn't sound like that has anything to do with scripting.
That was my first thought but the fact it even has any part of the script must mean it's got the mod, and it's initialised normally on server startup I've tried reinstalling once and it made no change.
Nothing you pasted indicates that the mod is loaded on the server.
thanks would’ve never guessed that 😂
Well it is near to nothing we can do other than making assumption, please state what exactly you've done terms of SQF
If you check above the script errors then there's probably an Antistasi error for the rebel faction file being missing.
It doesn't bail out of init at that point, so then you get a bunch of script errors because stuff is missing.
The faction list for the setup UI is read from local config, so you still see the extender faction there.
Ok I see what you're saying thank you, I'll take another look, at the start of server startup it says the mod has loaded but that does seem like the only logical solution that it hasnt started correctly somehow i'll do some more digging thank you
Servers don't normally tell you anything about what mods are loaded. You have to read the RPT.
oh it has a little table in the console, but checking the RPT now it only lists one PBO loaded out of the mod "upsmon" but there's about 9 more pbos in there so that'll be my problem wont it
Uh, it wouldn't be generating those errors unless core & maps were loaded at minimum.
I could send the rpt if you want but it definitely only lists " 5:08:17 @Antistasi Ukrainian Front\addons\upsmon.pbo - unknown" that from this mod, guess the mod is just scuffed beyond repair somehow
oh, of your extension mod, yes.
Not sure how you even ended up with a upsmon.pbo. I don't think we put that in the extender example.
Yeah comparing the extension script to one of the examples it's absolutely butchered so my assumption would be they broke it there but still doesnt explain it working in single player... I think the core issue is that it isnt loading in the server for some reason even though all the pbos are there to load oh well thanks for the help anyway
hey anybody knows a way to spawn a soldier inside of a vehicle via script. I managed to spawn the vehicle but not the soldier inside the vehicle
https://community.bistudio.com/wiki/addVehicle - Assign vehicle to the group
https://community.bistudio.com/wiki/moveInDriver - Move the unit into driver seat
Or the other moveIn commands, depending on your needs (moveInGunner,moveInCargo etc).
will that go after spawning the unit via trigger?
i am trying to create this plane to basically due a CAS mission with the drongo air support script and then delete the plane after the cas mission is done and the plane goes away.
If you don't need a specific unit just spawn the plane and use https://community.bistudio.com/wiki/createVehicleCrew
ill try that workaround
that worked now i can place that aircraft in to a group for the DAO script
Can someone explain to me what this has to do with the EULA and why I'd be breaking it? What, I can't give someone a monetary thanks for figuring something out that I can't figure out? Should I just yell at people and demand they work for free?
Yes

Wait, really? I'm not allowed to pay someone to write a script in ArmA for use in ArmA?
Yes
Well shit. I'm looking at the EULA right now, trying to figure out what part that is.
Well technically it is a part of Arma 3 Tools (or BI's Tools EULA) but it explicitly forbids you to use it in commercial way
It’s mainly there to promote the community not becoming purely financial focused
At least that’s my reasoning
It’s a good thing really cause those that don’t have it or it’s not enforced as heavily typically get very toxic and gatekeepey
I mean I'm not arguing but it kinda sucks ass that if I'm understanding this correctly I can't give someone a monetary thanks for doing something. The community is plenty toxic already with the "they Do thiS woRK FOr FReE so SHUt Up ANd DoN't ASK FOR MORE" attitude all over the workshop.
i swear that scripting seems impossible jajaja ive been trying a simple thing for hours now and nothing
Nobody can help you if you're here just for a rant anyways...
It’s not bad, programming can be confusing, but it’s not as hard as think
It’s just practice after all
No, sorry, I don't mean to rant. I'm getting sidetrack. Just bummed out.
Well, I still need help with that thing. If anyone wants to help me it would be nice but I can't offer you money I guess.
What makes one able to program and another cannot, one has been doing it for longer is typically the answer
I'm not saying to you
oh okay
He’s on about the other message
who me?
Yes
It’s just the typical ask to ask rather than just asking
Maybe
brother i am not ranting was just laughing at how hard is to do this ive been typing here for a while asking questions.
Anyway, found the line I was looking for.
(iv) Commercially exploit or allow a 3rd party commercially exploit game content you created using the Software, including but not limited to use by military organizations for computer aided training or commercially released game content;
💀
I mean yeah it does make sense why that rule is there. Oh well.
Am I allowed to give a gift for a job well done if I feel like it with no prior agreement or obligation to monetary gain? 
If so I'll probably only do that with friends tbh
But in any case I'll quit babbling about that for now. I'm still trying to figure out if it's possible for flamethrower particles from Webknights to cause things to happen with the Wildfire module. Maybe some means of detecting projectiles inside a trigger area.
Anyways, you are luckily speaking to the author of Reaction Forces Wildfire module right now
orly
Feel free to ask a question then
Well, with my very limited knowledge, it's hard to know where to even start asking questions! But I'll stick to something more simple for the time being and try to evolve my knowledge from there.
How can I, with scripts alone, create and perhaps intensify a fire? And, do wildfires spread to other nearby modules, or does that need more scripting?
My thinking is of a scenario where a player uses a flame-based weapon in an area of flammable stuff, and that fire then slowly spreads to other fuel sources that I marked in advance within 3den using perhaps a trigger area or something.
Another use case could be blowing up an oil storage tank and making a nice roaring fire afterwards.
https://community.bistudio.com/wiki/Reaction_Forces/Modules_and_Functions#lxRF_fnc_wildFire
What you wanted to read is this section
And urm, is it mentioning that it can spread the fire?
I think I actually forgot to update this article after the last update?
" If you synchronize Wildfire modules in Eden Editor, the fire intensity will spread to synchronised modules. This "influence" system will not spread everything randomly but only happens on predetermined/placed modules so it won't go uncontrollable. "
so right now here is where i am stuck, ive created the plane and have the pilot inside the plane how i wanted but whenever i am going to use this script [_aircraft,b2]remoteExec["DAO_fnc_AIBomb"]; it says that of course _aircraft is not a group variable. i was trying to find a way to have this spawn aircraft pertain to a group in order for me to utilize that line from DAO because it only works if its a group variable and not a unit variable. how can you guys think i can fix that issue?
https://community.bistudio.com/wiki/synchronizeObjectsAdd
This should add each other to spread
It sounds like if I have a bunch of fire modules across a section of forest, and I extinguish some, but they're synced, then the remaining fires can spread back.
I assume I should sync them in a chain to their neighbors rather than just sync all together willy nilly.
Okay, this is very good to know. Now I just have to figure out how to make it so certain projectiles (or particles? Not sure how Webknights works) or grenades going off (ACE incindeary grenades, SOG molotovs, etc) can activate a trigger.
If I can figure that out I should get the desired effect.
and something ive noticed is that if i use the show/hide module on an aircraft it technically wont work because the aircraft will still fly and will be showing the missiles but not the whole body of the plane.
And I think that is something I have zero knowledge. I seriously barely have WK works
Or, never used one
Still, this is progress. 
I'll just ask Webknight myself.
And once I got it all together
Song: Skrillex - Make It Bun Dem (feat. Damian Marley)
🔥
🔥🔥
This was helpful. Thanks. I'll play around with this later and come back if I need more help.
Is there way to check if a group is currently spawned?
thank you
is there a simple way to do something like waitUntil {left click} in a script that works on whatever display is open and doesn't create an event handler?
I think better use EH instead of loop (I actually didn't read the full message)
https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onMouseButtonDown
Add event handler to mission display? Anyway, I think it's much better to add EH to specific control rather that "global" display or control.
no, not mission. in this case eden and the eden debug menu or splendid camera
but the point is I want it to work on whatever display you happen to be clicking in and only to activate once
Works like this, ideally; A code is executed, and I move the cursor or crosshair to a point I want things to happen, and I left click and that position is used. If I click again it shouldn't happen again (unless I execute the initial code)
I have everything but the clicking figured out
Mission display is "global" display, so you can try adding EH to it.
How did you add EH to mission display?
findDisplay 313 displayAddEventHandler ...
That's not mission display.
Yes.
Yeah that one doesn't work
Somewhere at mission start:
#include "\a3\ui_f\hpp\defineResincl.inc"
_display = displayNull;
waitUntil {
_display = findDisplay IDD_MISSION;
!(isNull _display)
};
_display displayAddEventHandler ["MouseButtonDown", { ... }];
I need it to work in eden too
I believe there is no such.
EH or universal solution.
well I can manually add event handlers depending on what display is being used. but for that to work the event handler actually needs to work itself, and using 313 instead doesn't work
like it doesn't work, period. no error, just nothing happens at all
and I only need it to activate once, not repeatedly
I am just activating it manually for now. I will find a proper solution later. fencer/powerline placer is pre pre pre alpha
how could I tweak the removeCuratorEditableObjects (or curatorEditableObjects) so I can get rid only of editable units and vehicles, without modules or markers?
i think you mean something like this (curatorEditableObjects myCurator) select { _x iskindof "AllVehicles" };
i'll check this out, thanks
Arma have a tool to try the code more easily that just restart the game everytime ?
Restart the mission.
with a mod
AFAIK, no.
filepatching
this error:
16:32:57 Error in expression <R_ZEN_Compat\scripts\fn_hurtUnit.sqf"
params [player, body_part];
player setD>
16:32:57 Error position: <params [player, body_part];
player setD>
16:32:57 Error Type Object, expected Array,String
16:32:57 File PiR_ZEN_Compat\scripts\fn_hurtUnit.sqf..., line 3
with this code :
params [player, body_part];
player setDamage 0.9;
if ((!(PiR_DamageAllow_on) && (str (isDamageAllowed player) == "true")) or (PiR_DamageAllow_on)) then
{
if (isplayer player) then
{
[player, body_part, player] remoteExecCall ["PiR0", 2];
} else
{
[player, body_part, player] remoteExecCall ["PiR", 2];
};
};
That is not how params works
how it works ?
Your params syntax is wrong. See https://community.bistudio.com/wiki/params
params is used to expand an array (in this case the _this array of passed arguments) into private local variables. The names you want to give those local variables must be given as "_string" and must start with a _.
Also, you cannot use player as a variable name, because it is the name of a command.
It is also hard to tell what you need to do since we don't know context
my goal is to create a function who can be called like
[this, "head"] call mymod_fnc_heal
(str (isDamageAllowed player) == "true")
This is very... I know it should work but very weird
params [_player, _selection];
_player setDamage 0.9;
if ((!(PiR_DamageAllow_on) && (str (isDamageAllowed _player) == "true")) or (PiR_DamageAllow_on)) then
{
if (isplayer _player) then
{
[_player, _selection, _player] remoteExecCall ["PiR0", 2];
} else
{
[_player, _selection, _player] remoteExecCall ["PiR", 2];
};
};
Something like
so in your params do something like: params ["_unit", "body_part"]; start from that. And then refer _unit and _body_part (without string) in those parts of the script
so the params need " "
Expansion: isDamageAllowed returns a boolean (true/false). The == comparison returns a boolean (true/false). You are basically doing "if true then true", which is redundant. Just use the original bool (the return from isDamageAllowed).
e.g.
((!PiR_DamageAllow_on && (isDamageAllowed player)) or PiR_DamageAllow_on)```
Yes. When you do params, you're giving it the names of variables you want it to create. Those variables don't exist yet, so they must be given as "_strings" - the String data type, containing plain text, which is indicated by "".
but a _player is a object for setDamage ?
If you use variable names that aren't strings, you aren't giving it <the name of the variable>, you're giving it <the contents of the variable with that name> - you're using the variable "live", like any other variable. In theory you could make that work, e.g.:
_myVarname = "_secretSecondVarname";
params [_myVarname];
// creates a variable called _secretSecondVarname```
but that's uncommon, usually pointless, and not how you're doing it.
16:47:24 Error in expression <ams ["_player", "_selection"];
_player setDamage 0.9;
if ((!(PiR_DamageAllow_o>
16:47:24 Error position: <setDamage 0.9;
if ((!(PiR_DamageAllow_o>
16:47:24 Error setdamage: Type String, expected Object
how did you call this?
["this", "head]?
i've the error at the moment where i start my game
You are calling the function somehow. Something is causing the function to execute, whether it's call, spawn, event handlers, pre-init flags or whatever. Something initiates it.
We need to know exactly how the function is called, because it is passing a wrong argument to it.
i've a initActions function also (work with Zeus Enhanced)
private _hurtAction = [
"Hurt Unit",
"Hurt selected unit",
"\a3\ui_f\data\igui\rsctitles\mpprogress\timer_ca.paa",
{PiR_ZEN_Compat_fnc_hurtUnit, _hoveredEntity, "head"}
] call zen_context_menu_fnc_createAction;
[_hurtAction, [], 0] call zen_context_menu_fnc_addAction;
the config.cpp
class CfgFunctions {
class PiR_ZEN_Compat {
class Functions {
file = "\PiR_ZEN_Compat\scripts";
class hurtUnit {preInit = 1;};
class initActions {preInit = 1;};
};
};
};
It's the preInit flag
i need to unput ?
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
The preInit flag in CfgFunctions causes that function to automatically be executed immediately, on mission start. It does the equivalent of ["PreInit"] call your_fnc_functionName on mission start.
Given what your function is meant to do, that's probably not what you want.
* actually slightly before mission start, but the difference is not important; you don't want it to run automatically like that
so i just start InitActions
to have the menu
correct
i just tried in game :
[_this, "head"] call mymod_fnc_hurtUnit;
and it works
Ura
all my scripts worked
only, the preinit part was the problem
So, hehe, how works the _this on a player ?
It create an object who contains a list ?
I use this documentation :
https://zen-mod.github.io/ZEN/#/frameworks/context_menu
and my code looks like :
private _healAction = [
"PiR",
"Heal selected unit",
"\a3\ui_f\data\igui\rsctitles\mpprogress\timer_ca.paa",
{PiR_ZEN_Compat_fnc_healUnit, _hoveredEntity}
] call zen_context_menu_fnc_createAction;
// Create hurt unit action
private _hurtAction = [
"PiR",
"Hurt selected unit",
"\a3\ui_f\data\igui\rsctitles\mpprogress\timer_ca.paa",
{PiR_ZEN_Compat_fnc_hurtUnit, _hoveredEntity, "head"}
] call zen_context_menu_fnc_createAction;
// Add both actions to the context menu
[_healAction, [], 0] call zen_context_menu_fnc_addAction;
[_hurtAction, [], 0] call zen_context_menu_fnc_addAction;
I've a doubt on the fact if _hoveredEntity is good to use
hey guys, im trying to make a sign that can teleport me to whichever location i want to go to. Pretty much have multiple signs around the map and choose that specific one, how would i do this?
with respawn locations you could do that 🙂
or with https://community.bistudio.com/wiki/onMapSingleClick you get the click position and select nearest marker (markers placed by you)
module's enhanced has a module for this
// Create heal unit action
private _healAction = [
"PiRHeal",
"Heal selected unit",
"\a3\ui_f\data\igui\rsctitles\mpprogress\timer_ca.paa",
{_hoveredEntity call PiR_ZEN_Compat_fnc_healUnit}
] call zen_context_menu_fnc_createAction;
// Create hurt unit action
private _hurtAction = [
"PiRHurt",
"Hurt selected unit",
"\a3\ui_f\data\igui\rsctitles\mpprogress\timer_ca.paa",
{[_hoveredEntity, "head"] call PiR_ZEN_Compat_fnc_hurtUnit}
] call zen_context_menu_fnc_createAction;
// Add both actions to the context menu
[_healAction, [], 0] call zen_context_menu_fnc_addAction;
[_hurtAction, [], 0] call zen_context_menu_fnc_addAction;
So everything is fix with this code, it's really complicated to make try/error/fix, everytime, we need to reload the game
use filepatching to load
you can enable filepatching via the launcher
i saw this parameters in, but after, how it works ?
i use PBO Manager to manage the compile
then you make symbolic link to your arma3 folder from your mod source folder, which is like @YourAddon\addons\source
then your functions that have recompile = 1; should get reloaded
its bit complicated to explain XD try googling for "arma filepatching"
Where I put Preinit, I can put recompile right ?
sure
I’ll try it, thank you for the tip
https://www.youtube.com/watch?v=zRJ1Lp6cJNk good video on how to enable filepaching and pboprefix
PBO Manager is not meant to be used for packing addons, the bare minimum is Addon Builder from the Arma 3 Tools
Used it for years without problems for everything 
It is because PBO Manager cannot handle very complex files like P3Ds etc, usually plain texts are not really goofed. But nobody should use the tool to pack, anyways
It also doesn't bin anything, meaning that the game has to do it on game start instead. FIne if you don't have a lot of config, but can definitely affect load times.
maybe because you are using an old version?
https://github.com/winseros/pboman3
Maybe yes anyways
What changes can I make to make this script only spawn infantry and not a vehicle?
// Vehicle and crew transport
private _vehicle = createVehicle [Overchoice_VehicleSpawn, _position, [], 0, "NONE"];
private _crew = createVehicleCrew _vehicle;
units _crew apply { _x setUnitLoadout "SPE_US_101AB_AT_soldier" };```And```sqf
_unit moveInCargo _vehicle;```Are related lines
i finally publish, thank you for your blood 
https://steamcommunity.com/sharedfiles/filedetails/?id=3343964533
Can hiddenTextureSelections have selections added to base game classes?
I am currently testing an idea of rapidly updating SetObjectTextureGlobal and want to be able to swap out the window texture with a set of rain drops on the glass of a vehicle to simulate the rain on wieldshield effect?
Not even sure why ArmA 3 never added this an actual feature it's a pretty simple solution, to a difficult problem and doesn't require me to remodel anything?
No, these selections also must be present in the model (.p3d)
Gah.
Disappointing... Feels like anything I want to do in ArmA 3 is quickly undone by the lack of foresight in terms of simple things. We have r2t and now have rendering GUI's via textures but, seems like an oversight in not adding a simple animated loop to glass surfaces or surfaces in general to allow an overlay to act as an animated texture effect.
Or even a simple accessor to allow for access to the geometry resposible for it, with x,y,z,w translation.
of uv-mapped images
https://community.bistudio.com/wiki/Arma_3:_UVAnimations
This is a thing anyways
But I don't think your idea is anyhow feasible
Disappointing the tight coupling of model data with image it seems counter intuitive to moddability.
Wouldn't it have been better to allow these elements to be moddable as well? And not tightly couple them to the .p3d file?
I don't even consider this is a P3D thing but how Engine handles textures and materials
Does Enfusion fix this problem?
Enfusion does not inherit any problem
Well I guess I shouldn't be surprised considering the engine A3's engine Real Virutality 4 is still on the old rendering method which doesn't use Physically based shaders.
PBR is not an issue either?
Worth switching to ArmaReforger?
You're free to switch I guess
Does Reforger support surfaces like glass being able to animate rain on windows?
IIRC yes
Hmmm okay.
Is there a way to scale objects and make it walkable? Like if I want to scale the pier concrete 20 times its size and have ai / players walk on top of it?
setObjectScale
^
I did use that but objects and players just fall through
Read the note out there
How is the 70m walkable detection measured?
Not sure
What you need to know is if it loses the collision you're not supposed to make it bigger
But smaller
its funny how people say Arma 3 is lacking, iv been able to do anything i want in Arma 3 with the help of others ofcorse
Arma 3 is the best game ever
i have not had 1 thing go wrong, or iv had no problums what so ever its all awsome
Most playes who perceive that Arma 3 is lacking do so because they:
A) Don't get the performance they want/expect from their hardware
B) Play unnoptimized scenarios/missions or load bad mod combinations
C) Have issues adapting to Arma 3's particular movement/interaction system which feels quite outdated when compared to Insurgency/Squad/Reforger
D) A combination of all the previous ones
Once you have the hardware to run Arma 3 at 50+ FPS, choose the right missions/scenarios/mods and get used to the controls you start to really enjoy the game, not to mention when you get into mission making, scripting and modding
The sad thing is that those steps require some hours of gameplay and many players just quit before reaching that point
and a lot of reading lol
When using FireWeapon or BIS_fnc_fire, is it possible to specifiy the desired firemode of the weapon?
I see forceWeaponFire allows firemode to be specified, but I want to specify the sensor target in the script as well
Would anyone happen to know the class name of the ID cards you find in Old Man scenario?
The inventory items (not the world object holders) are Wallet_ID and Csat_Id_01 to Csat_Id_05. They are technically magazines.
You can find the placeable holders under Inventory Items in the Editor. (And you can inspect those items in the Config Viewer to find the class of inventory item they contain)
found them here https://community.bistudio.com/wiki/Arma_3:_createVehicle/vehicles, thanks!
how do i find the NIamrs in antistasti?
Any Ideas what this error is about? I'm using the testing methodology of using two clients to test my mission over LAN. After a few time of connecting to the LAN I am presented with this error. I can just close that client and start a new one but it is so annoying to keep lauching the game again just to test.
It's just a bug from joining yourself too many times too quickly.
would it be possible to set a unit on fire via script and if so how. i cant seem to find anything on it.
Do you mean visually?
There's not an "on fire" feature in vanilla, if that's what you're talking about.
You could create some particle effects and put them on a unit though
Or are you talking about ACE's fire system?
Then just do:
["ace_fire_burn", [_unit, _intensity, _instigator]] call CBA_fnc_globalEvent;
_unit is the unit you want to set on fire.
_intensity is a number from 1-10 (inclusive)
_instigator is optional, it's whatever unit set _unit on fire.
So like if you had a flamethrower, you'd do something like:
["ace_fire_burn", [_target, 5, _shooter]] call CBA_fnc_globalEvent;
this is great thanks. is there a way to up the damage on it?
No, all the damage is handled by ace itself
hmm
i have a script that spawns some units then makes them go to a lambs garrison marker
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
real
[_garr4, getmarkerPos "testGARR_4", 15, [], True, True, -2, False] call lambs_wp_fnc_taskGarrison;}```
and i wanted to make it a lambs hunt marker
but changing it to "taskhunt"
doesnt work
would anyone know how?
How it doesn't work
ummm
call{_garr4 = [getMarkerPos "SpawnGARR_4", east, ["O_mas_chi_Soldier_SL_F", "O_mas_chi_Soldier_F","O_mas_chi_Soldier_F", "O_mas_chi_Soldier_F","O_mas_chi_Soldier_F", "O_mas_chi_Soldier_F", "O_mas_chi_Soldier_F", "O_mas_chi_Soldier_F"],0] call BIS_fnc_spawnGroup;
this spawns the group
_garr4 is their varriable i think
[_garr4, getmarkerPos "testGARR_4", 15, [], True, True, -2, False] call lambs_wp_fnc_taskGarrison;}
this spawns the marker at "testgarr_4"
but i didnt write the script so i dont really know how it all functions
Let me rephrase my question: How it doesn't satisfy your goal
oh i misread
it makes a lambs garrison marker
i want a lambs hunt marker
waypoint*
https://github.com/nk3nny/LambsDanger/wiki/waypoints
It is documented here
hmm thank you
i realise i was googling the wrong things to find the answer
thank you :)
it worked thanks :)
Can this be a "not so good" warning? haha
Any error is not good.
Hah! Tell that to BI
waitaminute
arma with out errors, isnt arma
if i dont close 3 warnings on start, something is wrong
any smart one that can help me sort it out? could it be a script I've done myself or a mod?
_count is not defined , thats all you can tell from the screenshot
and it says "DMP" in the file name so that tells a little bit where the script is coming from
Also it says about an error using BIS_fnc_randomInt.
An error, and just an error, will not help us anyways. A help is always happening after a code, and investigate both is the reliable way to do anything
can you somehow open the garage vehicle customization thing for the vehicle you currently have?
A combination of this function (read the comments) BIS_fnc_garage + vehicle <likely have to look up its config, should work
ok thx
it seems you can open the garage for specific model but not for actual vehicle. maybe I'll do that and somehow get the attributes upon closing the garage, could this be possible/good way?
I want to try my hand at putting pylon weapons on aircraft. To be specific, I want to put the jammer pod from an EA-18G onto a two-seater F-15EX to turn it into an electronic warfare F-15GX Wild Eagle using Firewill's mods. How would I do that?
Script is a whole new world for me so I need some assistance 😅
I need a function so I can get some help when playing, like adding a medic and a sniper for example. Is it impossible to create? That would be so awesome cause I'm getting slaughtered alone 😄
does anyone know which file or folder could contain the code for watch horizon/scan the horizon option for a player squad leader? It makes the AI look around themselves 360 degrees, on foot or in gunner seat
trying to see if this can be adapted for AI squad use
It's just createUnit, but depending what mission you're playing, it might break it.
Unsure of what you mean but the mission is a own created scenario :/ ww2 with Spearhead
In that case you can just add units to your squad in the editor?
The problem is what to do when they die 😅
Do you want something to happen when they die?
I mean, if I could choose I would have the ability to press a button and then spawn 3-4 dudes around me so I can continue to fight
Ok, first you need to figure out the classnames of the units you want to spawn. One way is to place the units down in the editor, select them and use the "copy classnames to clipboard" context action.
Random AI Patrol spawn/delete script help?
It's spooky season, so I am doing a zombie mission for my unit. I'm looking for a way of having players feel like they are constantly surround by some zombies but not overload the server with extra crap.
Does anyone know of a script that I can use that automatically spawns in entities in a certain radius around players, but also deletes them if they get too far away?
Using Webknights Zombies and LAMBs if that matters
https://community.bistudio.com/wiki/BIS_fnc_spawnEnemy it doesn't say what's the radius though.
hello, i want to make a civilean point to a direction.
i know the gesture is ace_gestures_pointstandlowered but playgesture dont work, any idea on how to make it do the move?
Try playActionNow?
PlayActionNow is basicly what ace is doing https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_doGesture.sqf
https://github.com/acemod/ACE3/blob/master/addons/gestures/functions/fnc_playSignal.sqf
yep, it worked perfectly
I looked into that, I couldn't really figure it out how to get the radius to work right, and how to turn it on or off.
im getting an error GIF pre stack size violation and I cant find any documentation on it, does anyone know what this means?
Share your code
[90, [], {Hint "Ready for Flight!"}, {hint "Failure!"}, "Rearming/Refueling/Repairing", {waitUntil {_rrrComplete = true};}, [], true] call ace_common_fnc_progressBar;
Tried asking in the ACE discord, no answer as to the issue
full code here:
_x engineOn false; //Disable Aircraft Engine
_x setVelocity [0,0,0]; //Used to keep Aircraft from Rolling for certain mod assets
_x setDir 88; //Prepare aircraft for takeoff
_x setFuel 0; //Keeps Pilot from taking off until RRR complete
} forEach list rrr;
private _rrrComplete = false;
sleep 1;
{
_x enableSimulation false;
} forEach list rrr;
sleep 1;
[90, [], {Hint "Ready for Flight!"}, {hint "Failure!"}, "Rearming/Refueling/Repairing", {waitUntil {_rrrComplete = true};}, [], true] call ace_common_fnc_progressBar;
sleep 90;
{
_x enableSimulation true;
_x setDamage 0; // Repair the vehicle
_x setFuel 1; // Refuel the vehicle
_x setVehicleAmmo 1; // Rearm the vehicle
} forEach list rrr;
_rrrComplete = true;```
What is the reason? Im still learning a lot of this
waitUntil requires a boolean within a code
Your code only does a define, and returns nothing
Not even sure this usage on that function is anyhow correct though
As for the original error, what does GIF and GIAR pre stack size violation mean?
It usually does happen when some not so obvious syntax error
I don't know what GIAR etc does mean though
Yeah, it's not correct. The progress bar function runs that code every frame. It's supposed to return a boolean immediately.
You could just use _args and apply your sim, damage, fuel and ammo in codeComplete part.
Where are you calling the current event and to who?
I figured part of it out, supposedly the fnc checks that you can interact and ofc disabling sim messes that up. Ill just have to attach the aircraft to something and then detach it when the RRR is done.
What? Disabling sim or attaching something do literally nothing to do with such error
Your waitUntil returns nothing.
Because of the = sign being its last statement.
WaitUntil expects a value on the stack. But there is none. Thus stack size violation.
[_Hunt1, 1000] spawn lambs_wp_fnc_taskHunt; // gives that group a lambs hunt waypoint
}```
i need the unit to move to a movewaypoint before the hunt waypoint
does anyone know how i would do that?
_waypoint = _Hunt1 addWaypoint [_position, -1];
_waypoint setWaypointType "MOVE";
_waypoint setWaypointStatements [
"true",
"[group this, 1000] spawn lambs_wp_fnc_taskHunt;"
];
Yes, done and done
thank you :)
is there local version of animateSource?
no
ok
Could anyone check if "connectToServer" is borken?
Worked fine up until today...
I've also noticed direct connect doesnt appear to work... Server can be seen in recents but direct connect returns nothing
The advanced server browser still seems to work though
Found my answer, connectToServer must be a wrapper for direct connect, and direct connect had problems due to:
#arma3_troubleshooting message
so 2.18 is official now?
Yes
THANK YOU
Is it normal for a script to suddenly stop working...Everything was working perfectly fine yesterday in a scenario that I'm creating, then all of a sudden it just stops. No mods were changed and to my knowledge no updates as well, what I've noticed is that the script returns an error when its executed from the Init.sqf file but from the Console it works fine.
What the error the scripts returns?
maybe it's executing before the entity exists
use quotes for remoteExec
hlf_movedata_transporttruck_1_pickup is not defined at the time the script is running. Check https://community.bistudio.com/wiki/Initialisation_Order to make sure your things are happening in the right order.
disableAI "fireweapon" is pure gold
[stuff, "MY_fnc_Name"] remoteExec (...)
// not
[stuff, MY_fnc_Name] remoteExec (...)
```(if that is what is at hand)
Gengar's picture is a spawn, not a remoteExec...and that [Lou's example] would be wrong for remoteExec too since it's [arguments] remoteExec ["functionname"] :U
lemme be wrong!
it's awful and shouldn't
maybe pure anti armagic
OK thank you all, I'm gonna look up on remoteExec but that shit was weird
You should look up remoteExec in general as it's quite useful, but since you aren't using it, that's not the problem
See here #arma3_scripting message
sleep at the beginning of the script fixed it
bad practice, rather have waitUntil { not isNil "My_fnc_Stuff" };
some init order shenanigans indeed
@winter rose Thank you
all of a sudden my script has stopped working, I have the same script in 2 other scenarios and they are working fine... anyone that can see if theres a error in the code? or have any other idea what can make it not working?
The options in the scroll wheel menu isn't showing
Well shit, the script isnt working on any of my missions...
Debug it.
What do you mean? I'm really bad at this haha
You can use https://community.bistudio.com/wiki/diag_log to log anything to RPT file to determine where the script stops working.
I think the issue is (if you actually add it to init.sqf as written at the beginning) that the script tries to work with player when it's null.
isn't that weird?
I'm on my dedi server, I've executed the code locally, the action only appeared after I respawn (because of that EH)
yes
that is how you are defined that
if !isMultiplayer -> add eventhandler -> respawn -> addAction
yes
so just addAction before player addEventhandler, then that is avaible on start (i asumme initlocalplayer.sqf)
or init.sqf
for that case, isn't just better to put the code in the onPlayerRespawn?
well depens your respawn settings, if you unit doenst respawn on start, it doenst execute on mission start
player addAction Overchoise_ReinforcementAction;
player addEventHandler ["Respawn", {...
Then you have that on start and after respawn
@tough abyss this should work.
create a initPlayerLocal.sqf file in your mission folder, then inside of it put this command [player] execVm "spawnReinformcements.sqf"
Hello scriptwriters, I've been playing this game since OFP (I'm lucky and old) and I think I understand advanced scripting at a level of about 60 percent. but I have in mind to prepare to start playing with the engine that Arma Refo runs on (in the future i4), but before I do that, I would like to know the principles of sqf and sqs even better. Can you recommend me a website (not the typical bis one) where I can improve my skills? Thank you in advance for your answers
This is a good coding guideline to follow when you are working with mods such as ace and CBA if you want to make mods as well. https://ace3.acemod.org/wiki/development/coding-guidelines
ok, thank you very much for your answer. I have never been particularly interested in ace (I prefer other ai settings such as lamb etc. but I will definitely take your advice. [Regards
ACE isn't an AI mod
I know, my friend, I just shortened my answer. Let me put it differently, I have never used Ace because I don't like it. I have known it since Arma 2 and even OFP because there are programmers who tried to add something like that to OFP. I'm just trying to focus more on changing vanilla configurations. but thank you for your insight
I'm just going to buy a refo tomorrow and I'm really afraid (more than my wife) that I won't be able to cope with the new engine because they completely changed the language of the engine. and at the moment I know nothing about C++
What does the new update mean for my mission in progress? Is it going to break stuff?
Unlikely, but impossible to say for sure without knowing what's actually in your mission.
Arma updates try to be backwards-compatible, fixing and adding new things, not taking away existing capabilities.
You can always read the patch notes to see exactly what was changed: https://dev.arma3.com/post/spotrep-00115
I read through some but it's crazy long and I'm unsure of what most of it is anyways.
Obviously I'm wrong but I thought Arma 3 was no longer supported by Bohemia. I thought everyone was working on Reforger/4.
Kinda cool to see an update.
The Enforce Script is more like C# not C++
How can I do randomness?
If (random chance) do my code
I asked someone I thought knew about ArmA 3 coding but he's been struggling to explain it for the past 30 minutes and I think he's just overcomplicating the shit out of it.
I want my code to have a 1 in 3 chance of running.
private _rand = floor (random 3);
if(_rand == 1) then {
//do my code
};
a bit of edit on my end if you want exacly to be 1 in 3 chance. Also note random is 0 based index its 0,1,2 numbers.


if ((random 3) <= 1) then {```
:U
That looks like what I tried in my first attempt but I had the syntax wrong
This works for one of my uses, but just for the sake of learning, what if I wanted to do randomness based on a percentage?
Like 0 for 0% to 1 for 100%, where like 0.35 would be 35%, etc.
there is any info on what Simple VM is?
private _rand = floor (random 101);
if(_rand <= 35) then {
};
basicly get a random numb between 0 and 100 and check if its equal or below 35 that is 35 % chanse
EDIT: Its actually 36 % and not 35% becouse its including 0 but if you want true then random 100 instead of random 101. and also instead 35 you would put 34 %
Basicly:
private _rand = floor (random 100); //gives rand num 0-99
if(_rand <= 34) then { //check if rnd num = or < then 34 that is equal 35%
};
My guess would be either Virtual Machine or Virtual memory.
You still want _rand <= 35 there.
oh wait, not with the floor.
It's simpler without the floor :P
I seen that thing about DLL extensions for directx being enabled. In theory what would that allow a dev to do with directx in the context of ArmA
I assume it’s not anything as far as opening up access to the graphics API and being able to modify the rendering system like modders have done with stalker and such. But I’m curious if that would allow for some level of tweaks in that regard
does anyone know how to spawn a group into a vehicle using a trigger?
i cant figure it out
or spawn a group and have them get into a vehicle
createVehicleCrew, check wiki
make sure you only do it on server (server trigger or isServer check in statement)
nah i dont want them to be crew
i want a squad of dudes to be spawned into an already crewed vehicle that was put there in eden
i tried using "getinnearest"
but it didnt work
Use some of the moveInX (driver, cargo, etc) commands
Or https://community.bistudio.com/wiki/moveInAny if you don't care what seat
No. _mech2 out there is a group not an object
You need to use forEach and units to iterate with all units of a group
thank you it finally work :)
Hmm, sorry to bring this up again...
But it doesn't work now either 😢
Throwing in the scripts I have here
EDIT. I got these scripts from someone I dont remember haha, but the only thing i want with them are:
- No stamina for all on the servers
- Moving spawnpoint (works amazingly good)
- Ability to call for reinforcements that spawn on me (if possible ONLY infantry and not a vehicle...)
Whats the difference between Entity and Object?
nearObjects will return projectiles like grenade and bullets, anything else?
Or use a script debugger to set a breakpoint 😄
There is a handful of people still on Arma 3, none full time
If loop contents forEach/apply/select/... are simple enough (no calls, no setting variables). It gets translated into a new "virtual machine", that is simpler (has no scopes, no calls) and runs much faster
Oh sorry. I missread your message.
In the context for ArmA nothing. This is only for Arma 3
Hi,
Did anyone already had this message :
[S_API FAIL] Tried to access Steam interface SteamFriends017 before SteamAPI_Init succeeded.
Since updating my server this morning, I've had the following message in my logs, followed by a server restart a few seconds later
so people will stop doing military operations and watch videos instead XD
I'm gonna use it to watch porn
entities means nonstatic objects, like men and vehicles. when nearestObjects returns them all
thanks 👍
Your server update somehow didn't update all files. You have outdated steam api files
Got absolutely nothing to do with #arma3_scripting
I know it's not directly related to the scripts, but I still have the incident and wonder if anyone has had this problem. I've updated the files
If you want to troubleshoot an issue, use #arma3_troubleshooting
If you want to troubleshoot a server issue, use #server_admins
Use the proper channel for your thing, if you expect proper help
new playsound 3d workaround looks cool
what doesn't work? the action is not showing up?
exactly
I'm testing the script, I'm getting a weird error in the addaction, trying to find out what is
it's working for me
try again @tough abyss , I've modified it
my suggestion, test in the editor first
This won't work.
_player addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
_unit addAction _overchoice_ReinforcementAction;
}];
hmm tried it in a whole new mission and still dont work, this is so weird haha
if the action isn't showing up, it's weird
How this doesn't work?
you add a local event handler in initPlayerLocal.sqf,
Respawn event execute locally on player client when he respawns,
And add addactiion to new _unit that player controls?
New _unit != player?
all the other scripts ine the file are working
_overchoice_ReinforcementAction is undefined inside EH.
i've changed that for him
Oo, seems so.
Earlier it was global when I saw it 😁
Good catch
even in the editor?
It was _ local non defined action,
Didn't see that
I've tried both in MP and just "testing mission" and no action showing up
Is it to many stuff in the script? would it be easier to just remove it and only have that I can spawn in soldiers and no vehicle? if that so I would be really happy for help haha
a script can be much bigger than that, it's not the problem
I've also deactivated the vehicle spawn parts of it
anyone around with good knowledge of CBA? Im running into a weird issue where the garrison waypoint recognizes building positions properly, but the task defend function does not, not sur eif im just using the function wrong somehow or what
hello, how would i be making say3D work in multiplayer?
as when i interact with the object, only who activates it, hears the sound
woha, nice
so things like:
allunits select { _x inarea "marker"}
will be much faster now?
allUnits inAreaArray "marker";
yea well... it was the only loop with out variables in a select that i was able to think of lol
Well, yes arma 3. Should have been more specific. Your examples are very interesting though
this dll is included in the current build? or is just an example of what can be done?
ill appreciate to have the wiki page opened in the pause menu with the developer tools console 
@little raptor 👀
No it's an example. Source code is available on GitHub
As for ADT I don't have time rn
Well Time to learn how to do an .dll then
why dll?
what the hell, this is so weird, could it be Spearhead that breaks it?
I have now tried "Spyder addons" which I believe is kind of the same thing, and the recruit button isn't showing up there either...
well, then you should try to run this script without the dlc
Yeah it worked, thanks for all the help! 🫡 but it's useless for me since I only play Spearhead haha
weird, devs... do you know something about this? lol
thank you for your answer
Anyone know why I'm getting this error? It says that _isSpeaking is undefined.
while {true} do {
params ["_playerID", "_volume", "_isSpeaking"];
_index = playerData findIf { _x select 0 == _playerID };
_volume = playerData select 0 select 1;
_isSpeaking = playerData select 0 select 2;
// Add one tick when sprinting every 0.5s
if (speed Player > 15) then {
_soundDetect = _soundDetect+1;
};
// Add x ticks when talking on Normal volume
if ((_isSpeaking) && (_volume == 20)) then {
_soundDetect = _soundDetect+1;
};```
Perhaps it might be
What is that params for anyway?
Make sure to add some logging to that to see the actual values
If it says, then _isSpeaking is actually undefined.
What's the type of _playerID?
Sorry lads, had to disappear quickly.
Here's every part of the script that should be relevant. Bear in mind the script is probably a little overcomplicated because I'm still learning day by day, but if you have any advice I'd love to hear it.
playerData = [];
updatePlayerData = {
params ["_playerID", "_volume", "_isSpeaking"];
private _index = playerData findIf { _x select 0 == _playerID };
if (_index != -1) then {
private _data = playerData select _index;
if (!isNil "_volume") then { _data set [1, _volume] };
if (!isNil "_isSpeaking") then { _data set [2, _isSpeaking] };
} else {
playerData pushBack _this;
};
};
["MyID", "OnSpeakVolume", {
_playerID = _this select 0;
_volume = _this select 1;
[_playerID, _volume, nil] call updatePlayerData;
// debug message because this shit WILL break
systemChat format ["%1 can be heard from %2 meters", _playerID, _volume];
}, objNull] call TFAR_fnc_addEventHandler;
["MyID", "OnSpeak", {
_playerID = _this select 0;
_isSpeaking = _this select 1;
[_playerID, nil, _isSpeaking] call updatePlayerData;
systemChat format ["%1 Is currently speaking", _playerID];
}, objNull] call TFAR_fnc_addEventHandler;```
The weird part is that it actually works as intended. When the player talks using TFAR, it gets detected and increases the player's detection - but only on their first life. If the player respawns, they can't be found in the while {true} loop
There's no 100% guarantee that your while loop sees the updated player IDs. So you must check if index is -1 and skip the rest of the code
Also, instead of spawning several while loops, just use 1 while loop and iterate over all units there
while {true}
{
{
_x params ...;
...
} forEach playerData;
sleep ...;
}
I'm not sure but maybe you can just get rid of the while loop altogether (depends what you're doing, but it does look like it)
Also don't use global vars like that. Always add a tag
I assume you mean for playerData?
Yes
I'm trying to add dead units to array "deadPlayers" once they pass all the conditions listed here, but this isn't working for some reason. I'm 100% sure they pass all they checks in the if condition, as debugged using hint. Anyone have any ideas? Maybe the _unit param isn't compatible?
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
_playerCondition = isPlayer _unit;
_debugCondition = !(_unit inArea "debug");
_radioCondition = false;
{
if (_x call TFAR_fnc_isRadio) exitWith {_radioCondition = true};
}
forEach (assignedItems _unit);
_aloneCondition = ([_unit, 150] call CBA_fnc_nearPlayer);
if (_playerCondition and _debugCondition and _radioCondition and _aloneCondition)
then {
if (isNull deadPlayers) then {deadPlayers = []};
deadPlayers pushBack _unit;
publicVariable "deadPlayers";
- Use alt syntax of https://community.bistudio.com/wiki/isPlayer.
- Use https://community.bistudio.com/wiki/isNil to check for variable existence.
I will try that
dont know is that easier do with multiple if's (clearer?)
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
private _playerCondition = isPlayer [_unit];
if (_playerCondition) then {
private _debugCondition = !(_unit inArea "debug");
if (_debugCondition) then {
private _radioCondition = false;
{
if (_x call TFAR_fnc_isRadio) exitWith {
_radioCondition = true
};
} forEach (assignedItems _unit);
if (_radioCondition) then {
private _aloneCondition = [_unit, 150] call CBA_fnc_nearPlayer;
if (_aloneCondition) then {
if (isNil "deadPlayers") then {
deadPlayers = []
};
deadPlayers pushBack _unit;
publicVariable "deadPlayers";
};
};
};
};
}];
Maybe not XD
(assignedItems _unit)
does this return items from dead unit?
The assignedItems bit works just fine, as with all of the other if conditions. The problem is the bodies actually being added to the array
So, you want add "player" to deadPlayers array?
I want to add the player bodies that pass all the if conditions to the array, as in the actual objects
_unit of the event handler being the entity that died
if (!(isPlayer [_unit]) or { _unit inArea "debug" }
or { ((assignedItems _unit) findIf { _x call TFAR_fnc_isRadio }) < 0 }
or { !([_unit, 150] call CBA_fnc_nearPlayer) }) exitWith { };
if (isNil "deadPlayers") then {
deadPlayers = [];
};
deadPlayers pushBack _unit;
publicVariable "deadPlayers";
they have to pass all of the checks, not just one of them. Or doesn’t make sense here
They already pass all the checks.
You want to add the player bodies that pass all the if conditions to the array without checks?!
...the bodies are filtered by the if statement. the bodies that pass the filter are supposed to be added to the array.
And? You have 2 code snippets.
wdym
...neither of which adress the problem I'm having. We're going in circles dude
Really? Both look working.
What problem?
You want to get that corpse in your array?
Or that player who passes all those conditions?
Well you ain't telling where your problem is.
dude
What did the debugging show?
Bodies , corpse (unit that player was controlling) or unit who died
All the if conditions were passed by the body, but the body was not added to the array.
I havent even tried your original advice yet just pls give me a bit
isNil seems to have worked thank you
What's the final code?
I'm not entirely done with it yet. I need to had a perframe handler to execute some code when deadPlayers is added to
I just had the issue with the array not being added to at all
hello, im trying to make that a civilen points to a direction when i use an addaction.
on singleplayer it works, the civilean flip to the desired direction and points, but when i try on a server, the civ does a 360 and keeps looking at north
i have this on the addaction:
_c = (_this select 0);
_c = cursorObject;
_dir = getpos _C vectorFromTo getpos vip;
_c setVectorDir _dir;
[_c, "ace_gestures_pointstandlowered"] remoteExec ["playactionnow",0,_c];
_c setVectorDir _dir;
also it has
this disableAI "ALL";
this allowDamage false;
ive tryed to use setdir too, but its the same effect
anyone know how to rotate an object to face the incline of a slope ahead of it consistently?
tried a few things but im really jerry rigging this at this point
_c and _C isnt the same
_dir = getpos _C vectorFromTo getpos vip;
_c and _C are the same. Variable names are not case-sensitive in SQF.
Try using setFormDir on the unit
This was the code i used for putting pictures on slopes:
LEG_createRune = {
params ["_pos"];
private _surfaceNormal = surfaceNormal _pos;
private _surfaceNormalFlip = _surfaceNormal apply {_x * -1};
private _textureObj = createVehicle ["UserTexture1m_F",[0,0,0],[],0,"None"];
_textureObj setObjectTextureGlobal [0,"Img\Rune_01.paa"];
_textureObj setPosASL _pos;
_textureObj setVectorDirAndUp [_surfaceNormalFlip, vectorDir _textureObj];
};
Ill try it too
For now I’ve solve it creating an invisible helipad, attach the civilian to it and rotate it, detach, and delete it
For some reason the unit disappears sometimes lol
much appreciated
im trying to rotate an object in motion to follow the curve of terrain so it looks natural
getPos is slow and also using it with vector operations is almost always wrong
getposagl then ?
its a old bad habit 
It shouldn't matter much in this case since the vertical element won't really apply to a unit in the same way as it would to other kinds of object, but I would suggest using ASL for vectorFromTo. Otherwise the vertical element will be wrong unless the terrain is a completely flat plane.
The reason for this is that vectorFromTo doesn't actually look at the world or what kind of position format you're using. It just assumes you've given it two sets of coordinates in the same coordinate space - with the same zero reference - and does vector maths to figure out the direction. But ATL and AGL positions aren't actually in the same coordinate space as each other. They're relative to the terrain point directly below them, which can be very different. The command doesn't know any of that, and calculates on the basis that z=0 for one coordinate set would be the same as z=0 for the other.
For example, if you do vectorFromTo using the ATL positions of a unit standing on a beach and a unit standing on a mountain, the result will be a flat horizontal vector, because both units are at z=0 ATL. Using ASL instead means both sets of coordinates really are in the same coordinate space and you'll get the correct result.
yea, in this case there doesnt matter, juse just the fastest one ( probably getposworld or eyepos )
if (surfaceIsWater GetposASL Helo2) then {Do Something };
OK, don't know if you are interested in this haha, but tried the script WITH Spearhead and a lots of other mods but in modern warfare.. and it worked haha... this is magic!
Regarding disableAI, if i got this correctly, runnin disableAI "PATH" where unit is local (server), then taking control over it as zeus (not server), should in theory re-enable PATH, right?
It's not so much re-enabling it, more that it was never disabled on your machine, and now the AI is local to your machine instead of the server, so your local settings are in effect. If it's transferred back to the server then it should have its pathing disabled again.
Depends where the cost is.
It improves the speed of everything that is between the commands.
If the command itself is the slow thing, it won't do much. And the benefit is bigger, the bigger the script is (but there is also a maximum size limit for the script)
no dll's are included in the current build. But this is an example that is on the arma3 github
I don't know if this is the right place but anyone has any idea what extension / setting in VSCode is causing these to pop up? When I copy the code the :Boolean and :Group does not get copied so I'm assuming its something in VSCode thats overlaying this.
Thanks. So in pratice re-enables it. Thats a desired side effect for my purpose.
actually, this is Arma 😂
There are multiple extensions that have that afaik.
Ok after troubleshooting and uninstalling 64 sqf extensions, I finally found the root cause -> SQF-Analyzer extension -_-
I think its called "inline hints" ? Its definitely a feature of VSCode itself, that can surely be turned off
why some vehicles cant be created with the createVehicle command? it returns null
Can you give an example of which vehicles?
RHS rhsusf_M1078A1P2_fmtv_usarmy
"rhsusf_M1078A1P2_fmtv_usarmy" you mean?
"RHS rhsusf_M1078A1P2_fmtv_usarmy" wont create it, since its wrong
yeah i just mean its from RHS.. which would be obvious anyhow 🙂
probably the class is wrong, there is no reason why it wont create that vehicle
i tested configfile >> "CfgVehicles" >> "rhsusf_m1078a1p2_fmtv_usarmy" in debug console and it finds the config
gettext (configfile >> "CfgVehicles" >> "rhsusf_m1078a1p2_fmtv_usarmy" >> "model")
Returns you a p3d ?
That class has scope 0, private, cannot be created, used only as base class for other classes
ok i thought it might be that but RHS has so many zero scopes
Well, that's the way they've designed their config structure, I suppose
Use the D or WD variants, e.g. rhsusf_M1078A1P2_WD_fmtv_usarmy, depending on your preference for initial colour scheme
it seems like all my vehicles used in mission has zero scope
i can place rhsusf_M977A4_AMMO_usarmy_wd in the editor but it too has zero scope
ooooh the 0 scope thing, i completly forgot
oops my bad, my debug line had bug
ok I can succesfully exclude the zero scopes out now and there was just this one after all. thx for the help guys 🙂
has anyone got a a mission script example they could share which shows how to set up parent and child tasks? I'm trying to nest two sub tasks under a parent task without much luck.. Warning, my knowledge is low and co pilot and chat GPT have been assisting me with writing this mission, I hope that's no issue.. I'd add the code but can't remember how to present it correctly here
I've been right through that for 2 days now.. Thanks for the response though
thank you
@faint burrow just figured it fromth is, which I hadn't seen or noticed properly before
[west, "parentTask", ["This is the parent task.", "Parent task", "cookiemarker2"], objNull, 1, 3, true] call BIS_fnc_taskCreate;
[west, ["subTask", "parentTask"], ["This is the subTask.", "subTask", "cookiemarker2"], objNull, 1, 3, true] call BIS_fnc_taskCreate;
thanks for the prompt
By the way, you can send empty string instead of "cookiemarker2" since this variable is no longer used.
ahh makes sense, thanks
boobytraps are weird, I can most of the time just walk over them without explosion.
i guess its because the charge is obstructed it wont detonate. changing scale to 0.8 helps with this
can task description contain new lines?
tried <br>?
ill try
(<br/>)
That worked, Thanks!
Hello,
Is there a way to prevent it when you move the unit in the editor on the car, it goes in the car and when you drag something else than the unit it will error.
So is that some config value or some 3den event?
You want it to error when something that is not a unit gets dragged?
Hey there! I'm in the process of producing a cut scene for a custom mission in Arma 3 and have run into an issue. The video's audio is fine but playback seems to be extraordinarily sped up, and I was curious as if this could be a framerate issue? I exported the original mp4 at 30fps to reduce file size, but if the games' engine is rendering it at 60, that would probably be causing my issue, as it would be halving the amount of time it takes to display all the frames in the video and doubling the playback speed for the visuals. Is there a recommended framerate for videos played with the BIS_fnc_playVideo function?
answered my own question, the 60fps exported and converted file works as normally
is there a waypoint or script that makes AI go and plant the explosive in their inventory and detonate it?
Add statements to waypoints.
You can do that easy place a unit down.
Place 1st move waypoint for that unit and put this code for placeing explosives:
OnActivation in WP:
this fire ["pipebombmuzzle", "pipebombmuzzle", "SatchelCharge_Remote_Mag"];
Then place 2nd move wp and place this code in OnActivation on WP:
this action ["TOUCHOFF", this]
ty, but why pipebombmuzzle if i'll use the SatchelCharge_Remote_Mag as the explosive?
its muzzle mode magazine you can read more here https://community.bistudio.com/wiki/fire
so it will always be this for placed explosives or mines right?
this fire ["pipebombmuzzle", "pipebombmuzzle", "EXPLOSIVECLASSNAME"];
also how do i get the "muzzle" and "mode" of other explosives if needed?
no it depends on the ammo you using for example this is claymore:
ah ok
this fire [
"DirectionalMineRemoteMuzzle",
"DirectionalMineRemoteMuzzle",
"ClaymoreDirectionalMine_Remote_Mag"
];
so i enter this in the debug menu:
unit weaponsInfo [weaponOrMuzzle, onlyLoaded]
then use what it spits out in
this fire
Something like that.
Easy way would be do this.
- Get the unit lodaout with all kinds of explosives and all of that.
then run this code while waring a lodaout.
private _string = player weaponsInfo ["",true];
copyToClipboard str _string;
And then paste in notepad you get this and you can copy paste from there values that you need.
it looks something like this.
[[0,true,"arifle_MXC_Holo_pointer_F","arifle_MXC_Holo_pointer_F","Single","30Rnd_65x39_caseless_mag",30,true],[1,false,"arifle_MXC_Holo_pointer_F","arifle_MXC_Holo_pointer_F","FullAuto","30Rnd_65x39_caseless_mag",30,true],[2,false,"arifle_MXC_Holo_pointer_F","arifle_MXC_Holo_pointer_F","fullauto_medium","30Rnd_65x39_caseless_mag",30,true],[3,false,"arifle_MXC_Holo_pointer_F","arifle_MXC_Holo_pointer_F","single_medium_optics1","30Rnd_65x39_caseless_mag",30,true],[4,false,"arifle_MXC_Holo_pointer_F","arifle_MXC_Holo_pointer_F","single_far_optics2","30Rnd_65x39_caseless_mag",30,true],[5,false,"hgun_P07_F","hgun_P07_F","Single","16Rnd_9x21_Mag",16,true],[7,false,"Throw","HandGrenadeMuzzle","HandGrenadeMuzzle","HandGrenade",1,false],[9,false,"Throw","SmokeShellMuzzle","SmokeShellMuzzle","SmokeShell",1,false],[11,false,"Throw","SmokeShellGreenMuzzle","SmokeShellGreenMuzzle","SmokeShellGreen",1,false],[14,false,"Throw","SmokeShellOrangeMuzzle","SmokeShellOrangeMuzzle","SmokeShellOrange",1,false],[15,false,"Throw","SmokeShellBlueMuzzle","SmokeShellBlueMuzzle","SmokeShellBlue",1,false],[16,false,"Throw","ChemlightGreenMuzzle","ChemlightGreenMuzzle","Chemlight_green",1,false]]
ty legion
I hath come to call upon the scripting lords for assistance, ive been working on a hearts and minds for my group and was wondering if there was a way to lock pilot seats or tank crew seats to people who dont have a specification, ive seen something similar in liberation ww2 where i couldnt use a tank gun without haveing the skill for it so wanted to see if i could do something similar but have it so only admins could add the specification.
Lots of ways to do it, start with what is "specification". A slot in lobby? By UID? Something else?
Well I want to make x object behaviour like Zeus modules, like when you select and drag it over the unit and I would create a display to manage attributes and it would create x object and attach that to the vehicle.
I know I could do this via Eden attributes but I cannot use any type of object/ model of object as condition to show attributes.
There is only a condition to show my attribute to all vehicles, but my attachable object doest work with all vehicles.
Hard to explain what I want to achieve.
1st I thought I could do the Eden module that behaves like the Zeus module (is curator attachable)
Can unexploded shotShell do kinetic damage if its yet unexploded by fuseDistanceLeft/timeToExplosion at all? 🤔
i dont wont to do slots as theres no way of controlling who enters, i guess kind of like a tag, so it would be linked to their UID but something that i can do through console or ace menu rather than having to make a new version of the mission each time a specification be updated, so if somebody can prove their flight ability and has completed training, then a tag linked to their uid would allow them to enter a pilot seat, anyone without that tag would either not be let in or be forced out instantly.
Any tank guns or a specific ones?
any tank guns
so they have to be tagged as a gunner to enter
my guys arent the smartest folk around and tend to just grab vehicles and get them destroyed so im trying to idiot proof
i know overthrow ww2 had a stats system that does something similar i just want to have it so that only admins can give stats/ skills
Lazy solution:
if(isServer) then {
uidsTankGunners = ["123"];
uidsTankDrivers = ["321"];
publicVariable "uidsTankGunners";
publicVariable "uidsTankDrivers";
uidsPilots = ["321"];
publicVariable "uidsPilots";
};
addMissionEventHandler ["EachFrame", {
private _uid = getPlayerUID player;
{
_x lockDriver !(_uid in uidsTankDrivers);
_x lockTurret [[0], !(_uid in uidsTankGunners)];
} forEach (player nearObjects ["Tank_F", 30]);
{
_x lockDriver !(_uid in uidsPilots);
if(getNumber((configOf _x >> "turrets") select 0 >> "isCopilot") == 1) then {
_x lockTurret [[0], !(_uid in uidsPilots)];
};
} forEach (player nearObjects ["Air", 30]);
}];
Put into init.sqf
To add players later do in console:
uidsTankDrivers pushBackUnique "111"; publicVariable "uidsTankDrivers";
Same for gunners
To remove through console:
uidsTankDrivers deleteAt (uidsTankDrivers find "111"); publicVariable "uidsTankDrivers";
Tweaked the code a bit
so for pilots i would do the same just for planes
Yeah
Its bit more complex though as there are co-pilots
So you can get to gunner and take over controls
steam 64 bit id, yes
Added locking to driver and first turret on aircraft for you
Maybe we should check if [0] turret is really a co-pilot
Updated code bit once again
Fixed removal code
You'll need to replace 3 variable names for other arrays though 🤔
if(isServer) then {
uidsAccess = createHashMapFromArray [
["tank-drivers", ["123"]]
,["tank-gunners", ["321"]]
,["air-pilots", ["333"]]
];
publicVariable "uidsAccess";
};
addMissionEventHandler ["EachFrame", {
private _uid = getPlayerUID player;
{
_x lockDriver !(_uid in (uidsAccess get "tank-drivers"));
_x lockTurret [[0], !(_uid in (uidsAccess get "tank-gunners"))];
} forEach (player nearObjects ["Tank_F", 30]);
{
private _is_pilot = _uid in (uidsAccess get "air-pilots");
_x lockDriver !_is_pilot;
if(getNumber((configOf _x >> "turrets") select 0 >> "isCopilot") == 1) then {
_x lockTurret [[0], !_is_pilot];
};
} forEach (player nearObjects ["Air", 30]);
}];
Same but with a hashmap
Add:
uidsAccess get "tank-drivers" pushBackUnique "111"; publicVariable "uidsAccess";
Remove:
_a = uidsAccess get "tank-drivers"; _a deleteAt (_a find "111"); publicVariable "uidsAccess";
Now you only need to replace single key name in remove 
Let me know if it worked, I haven't tested it
i take it in the add and remove, uids access thats not in quotations is where i put the uid
"111" is UID of player you want to add or remove
as with "123", "321" and "333" at the start of the script
UIDs have to be in quotes, they're treated as strings in arma, not numbers
And change "tank-drivers" to another key for different access
it works for tank just not for plane
Typo
Fixed
Was
private _is_pilot = (uidsAccess get "air-pilot");
should be
private _is_pilot = (uidsAccess get "air-pilots");
same result i can access both planes and helis without spec
Turns out there is no Air_F but its usual Air
Change the classname
Yeah I think I get it.
Only think I can think of is a custom mode the user can activate and when it's activated hook into the dragged event and check what object the user is dragging.
so it still didnt work but now it gives this
Fixed once again
private _is_pilot = _uid in (uidsAccess get "air-pilots");
that worked, thank you, you're an absolute legend.
I'm using AnimationSources to show/hide some vehicle parts but it seems some parts require animateSource to work and some animate command. how do I know which one to use?
Do you mean like, having a roof rack before having something on the rack?
i mean showing/hiding vehicle extra parts or like doors etc
https://community.bistudio.com/wiki/BIS_fnc_initVehicle
I assume this is what you need
thx will try it
@warm hedge nice it seems to work well. only thing that it allows only one AnimationSources to be set. unless i make a list...
Why don't you make a list then
i will 🙂 just wasnt sure if i understood this correctly. and i hope with random value 1 it isnt actually random
now i just need to get the animation phase of the parts somehow so I know if they have been set. but i'll get back to this later
animate only works on a single animation defined in the model.cfg
animationSource will work on animation sources defined in the config (and referenced in the model cfg) so can refer to multiple singlular animations.
Ie. a door opening, the handle for it turning in one movement
Or hiding multiple selections at once
ty, for explaining that to me 🙂
Hi,
i wanted to ask if someone can help me im trying to make a switch case that adds a variable to a Player when he has a certan rank but somehow he gets set all variables.
private _rankData = player getVariable ["etr_ranks_insigniaIcon", ["default_rank"]];
switch (_rankData) do {
case ["weekend_ops_ranks","01_trooper"]: {
hint "Trooper";
player setVariable ["1", true];
true; // true zurückgeben
};
case ["weekend_ops_ranks","02_private"]: {
hint "Private";
player setVariable ["2", true];
true; // true zurückgeben
};
case ["weekend_ops_ranks","03_pfc"]: {
hint "Private";
player setVariable ["3", true];
true; // true zurückgeben
};
default {
hint "Nix von beiden";
false;
};
};```
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Looks correct. Post more code, issue might be elsewhere
Thats the whole code
He gets all variables, do you mean "1" "2" etc
Yes, should i but them as false above the switch case as a init value?
Do you read them back with the default value of true?
If you do this several times during the game, old variables remain, including after respawn
How do you verify you got all varaibles, is also a question indeed
player getVariable ["1", true];
That's why
You should set the default to false
And how do i do that?
player getVariable ["1", false]
So i should post this above the switch case?
So since im using this in a kit script like this
[
this,
"CT | PFC - SPC | DC15L",
[["212th_3AS_DC15L","","acc_flashlight","3AS_Optic_DC15L",["212th_3AS_DC15L_Mag",200],[],"3AS_Bipod_DC15L_f"],[],["212th_JLTS_DC17SA","","","",["212th_DC17_Mag",30],[],""],["212th_Clone_Trooper_Armor_CT",[["ACE_bodyBag",5],["212th_HM1_SmokeRed",5,1],["212th_DC17_Mag",5,30],["212th_3AS_DC15L_Mag",3,200],["Aux212_Class_A_Thermal_Detonator",1,1]]],["Aux212_NME_Nano_Vest_Standard",[["JLTS_repairkit_weapon",1],["ACE_salineIV_500",5],["Aux212_Phase_2_Headlamp_Batteries",5],["ACE_packingBandage",50]]],["212th_JLTS_backpack_Strapped",[["ACE_elasticBandage",50],["ACE_splint",5],["ACE_tourniquet",10],["ACE_morphine",5],["ACE_EntrenchingTool",1],["ACE_MapTools",1],["ACE_painkillers",3,10],["Aux212_Class_A_Thermal_Detonator",5,1],["212th_HM1_SmokeWhite",5,1],["212th_3AS_DC15L_Mag",20,200],["ShieldGrenadePersonal_Mag",5,1]]],"212th_Clone_Helmet_P2_CT","",["212th_RangeFinder_212th","","","",[],[],""],["ItemMap","ItemGPS","JLTS_clone_comlink","ItemCompass","ItemWatch","Aux212_JLTS_CloneNVG_Visor_Toggle"]],
["Aux212_Phase_2_Headlamp"],
"player getVariable ['PFC', false]", //Condition when true then access to kit
{}
] spawn Wbk_AddKit;
player setVariable ["1", true];
...
player getVariable ["1", true]; // true
player getVariable ["1", false]; // true
player getVariable ["2", true]; // true
player getVariable ["2", false]; // false
player getVariable ["2", "lol"]; // "lol"
help with config.cpp how to call a script on a bulletproof vest or backpack.
I saw something like Eventhandler but it didn't work
Explain more
GIB PreHandleDamage on shooter side 
I have a sqf script, can I use it inside my file config.cpp where will the bulletproof vest class be registered?
I think you dont even need a script you can just increse the armor value and put pass trough to 0 so it will be bulelet proof. example:
// Carrier Special Rig (Green)
class V_PlateCarrierSpec_rgr : Vest_NoCamo_Base
{
/* other properties */
class ItemInfo : ItemInfo
{
/* other properties */
class HitpointsProtectionInfo
{
class Neck
{
hitpointName = "HitNeck"; // reference to the hit point class defined in the man base class
armor = 100; // addition to armor of referenced hitpoint
passThrough = 0; // multiplier of base passThrough defined in referenced hitpoint
};
class Arms
{
hitpointName = "HitArms";
armor = 100;
passThrough = 0;
};
class Chest
{
hitpointName = "HitChest";
armor = 100;
passThrough = 0;
};
class Diaphragm
{
hitpointName = "HitDiaphragm";
armor = 100;
passThrough = 0;
};
class Abdomen
{
hitpointName = "HitAbdomen";
armor = 100;
passThrough = 0;
};
class Body
{
hitpointName = "HitBody";
passThrough = 0;
};
};
};
};
no, you didn't understand, I need to embed the script in a bulletproof vest or backpack, is it possible to do this in config.cpp ?
EventHendler{
init =...
}
What would it be like to call Actions when putting on this vest
That would be CBA feature not vanilla arma. You can see how is done here:
https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)#extended_init_eventhandlers
OK, thanks
init EHs are not only a CBA feature. They also exist in vanilla. The CBA feature is an alternative system designed to allow mods to add multiple EHs of the same type to an existing class.
However, I'm not sure that EHs of any kind will work in vest config, since vests aren't real objects. For a backpack they might, since those are vehicles.
Hey, was wondering if anyone knew the resources for this.
I'm trying to force a pylon onto an aircraft that can't normally accept it. Now I know how to do that part and I've done it before. The problem is I am constantly getting mixed up on which classname I'm supposed to tell it to take.
Right now I want to bolt a Reaction Forces .50 caliber gun pod onto a helicopter that can't normally allow it.
vehicle setPylonLoadout [pylon, magazine, forced, turret]
You can run this code in debug console and paste the result in notepad and just search for what you need:
private _arr = [];
{
_arr pushBack configName _x;
} forEach ("getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines"));
copyToClipboard format ["%1",_arr];
and to force pylon just use setPylonLoadout
That is very helpful. Thanks!
Hey, im trying to make a script to have an su-25 shoot two strafe runs at an target. its not shooting though and the waituntil obv goes to nil
Any advice on how i should change it
_dummyTarget = createVehicle ["Land_HelipadEmpty_F", _enemyPos, [], 0, "NONE"];
_dummyTarget hideObjectGlobal true; // Hide the dummy object so it's invisible in the game
// Conduct 2 rocket runs with 4-8 rockets each
for "_i" from 1 to 2 do {
_wp = _su25Group addWaypoint [_enemyPos, 0]; // Add waypoint to the group
_su25 doWatch _dummyTarget;
_wp setWaypointType "MOVE"; // Move to target
_wp setWaypointStatements ["true", 'waitUntil { _su25 aimedAtTarget [_dummyTarget] > 0 }; _su25 fireAtTarget _dummyTarget;'];
sleep 45; // Delay between runs
};```
I've something here that I used before.
See if it works for you:
_dummyTarget = createVehicle ["Land_HelipadEmpty_F", _enemyPos, [], 0, "NONE"];
_dummyTarget hideObjectGlobal true; // Hide the dummy object so it's invisible in the game
// MARKER
private _casMk = createMarker ["casmk", _dummyTarget];
_casMk setMarkerType "hd_destroy";
_casMk setMarkerText "Target";
_casMk setMarkerColor "colorOPFOR";
sleep (30 + random 20);
// Create ModuleCAS_F for gunrun
_moduleGroup = createGroup sideLogic;
_posModule = getPos _dummyTarget;
"ModuleCAS_F" createUnit [
_posModule,
_moduleGroup,
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]; su25gunRun = this;"
];
// Rotate the module
su25gunRun setDir (random 359);
// Modify the variables from ModuleCAS_F
su25gunRun setVariable ["vehicle","RHS_SU25SM_vvsc", true]; // Classname (must match one of that the module supports)
su25gunRun setVariable ["type", 0,true]; // 0: Gun-run
//su25gunRun setVariable ["type", 1,true]; // 1: Rockets
//su25gunRun setVariable ["type", 2,true]; // 2: Bombs << for SU-25 a vector adjustment is needed
sleep 30;
// MARKER DELETE
deleteMarker _casMk;
No idea where to ask this,
Is it possible to set the load order of "modules" of an addon whilst packing?
Each "module" has it's own config.cpp file but some of the modules are dependant on a core module which doesn't seem to be recognised when loading.
That's what requiredAddons is
I thought that, it's in there defined as:
requiredAddons[] = {
"GW_Core"
};
It goes in your CfgPatches for each addon
Also this is config, not scripting
Yeah, it's in the CfgPatches,
Also apologies, I'll move to #arma3_config
did u find away to prevent this>
You can't prevent it but you can delete the weaponholder
Anyone ever messed with BIS_fnc_credits_movieConfig and BIS_fnc_credits_movie?
Ask your question
Can CfgCredits -> CfgMovie be defined in description.ext?
And how does one define you want to use the one from description.ext
Apparently you cant
In ArmA, when using the init field of an object, if I create a variable (or several variables) is it necessary to clear out those variables when I'm done somehow, or are those variables automatically deleted when the init is finished?
let's say...
private _myVariableBravo = "more stuff";
private _myVariableCharlie = ["a","bunch","of","stuff"];
private _myVariableDelta = ["holy",["shit",["there's","a","lot","of","stuff"]]];
Do I have to go nil all these variables or do they go away on their own? I figured that if I don't make a point to clear these variables, I risk memory piling up for variables I don't need anymore.
I know one or two variables won't be a big deal but I'm using like, a hundred. Per unit.
I have spent the last week making this monstrosity of a script to plonk into Zeus-spawned compositions so I can have randomly clothed and armed mercenaries, Tarkov style.
As you can see there is a gagglefuck of variables defined.
Definitely works, anyway. 
Was there an easier way to do this? Iunno, probably.
But I was very particular on what guns I would and wouldn't want generated.
And you copy that into every single one of these dudes?
Local scope variables stop existing when the scope they're in ends.

yes
Could I have just, like, picked a random gun from the game, or series of guns if I wanted to be fancy, then randomly pick from an existing list of mags and attachments? Probably.
But I like my randomness to make some sense.
So I did it manually.
I suppose you could make a function, and just call from init field of the dudes.
Probably, but then I can't use it on other people's missions or as a 3rd party when Zeusing.
ofc you can. eg
MUH_function =
{
//That wall of text of yours, ommiting line 1 and last line
}
then in in the init field you do do [this] spawn MUH_function;
I think the reason I originally stuck it in a spawn was because in the original version since it was put in the init field, I had to run a sleep function because the predecessor of this was used on CFP mod civilians, and I had to give a second for them to spawn their equipment.
if you dont need sleep then you would [this] call MUH_function;
Oh absolutely, but where would I make a function for a Zeus-spawned unit on a mission I didn't make? For context, in my community, we have our mainline ops nights where this would be super useful, but then we have mid-week ops that are Zeus controlled, so an asset like a function might not be included in the mission depending on who is running the mission and who is helping manage it.
Without making .sqf files that would be put into the mission in advance, I don't know how I could define a function like that.
so going
private _myVariableBravo = nil;
private _myVariableCharlie = nil;
private _myVariableDelta = nil;```
is unnecessary, correct?
Correct
👍
As Marko said before, you can just define a function as a global variable containing a Code data type, and call or spawn it like any other function.
CfgFunctions definition is the most optimal way to do it, but it's not the only way.
Just make sure to execute the code defining the function on all machines, or use publicVariable to broadcast it.
You can do it in debug console
And if you intend to run it on your own spawned units, you dont even need to publicVariable it
my_fnc_testFunction = compileFinal {
params ["_text"];
systemChat _text;
};
["Hello!"] call my_fnc_testFunction;
publicVariable "my_fnc_testFunction";
["Hello!"] remoteExec ["my_fnc_testFunction",0,true];```
for zeus or any spawned units use MEH called EntityCreated
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityCreated
👀
Interesting.
Though, I don't think other Zeuses in my unit are savvy enough to figure out those extra steps.
This solution is like a hammer as opposed to a scalpel but everyone knows how to use a hammer.
Also another tip, call that wall of text of yours only where unit is local. In multiplayer those random functions will not select same gear across all clients. Which means n amount of players will create n amount of loadouts for same unit. But only last to execute will prevail
And if someone joins late, units gear could change
Well, I don't run it on units who are spawned at mission start. I put it inside an isServer if I want to do that.
Zeus-spawned units do not have this problem where the code executes for each JIP.
And gear is updated globally.
So I believe none of that is an issue.
Well depends how init field of unit is ran in zeus. It can be global
No I mean any changes to gear are global. The script runs, and even if it runs on all clients for some reason, it definitely doesn't desync the loadouts.
A simple if(!local _obj) exitWith {}; after params line solves it
Oooh
That's very useful
if(!local _obj) exitWith {}; is something I've wanted to know how to do for a while.
What happens is, that code is ran as many times as there are players + server + headless clients. And the one (with slowest computer) who runs it last assigns the gear to unit
When placing units as a Zeus custom composition, which is what I think this is, the init field is only run on the machine that placed them.
I'll add if(!local _obj) exitWith {}; to it. That's more sane.
So this will only execute on the machine that spawns it, now?
Rather, this interrupts the code.
If he uses ZEN init field it can be global, depending how its set
Only on machine that spawned it. And currently owns it
The ZEN init field isn't a real init field and isn't automatically executed when new units are created
Idk how he does it. But that line shouldnt hurt
Well it sounds like if(!local _obj) exitWith {}; is still an easy solution to let me use the same composition to spawn as a Zeus unit or spawn the same composition in 3den and run the mission from the start like this.
Instead of having to change it to check isServer
I had to do that with an earlier version of this script because I couldn't figure out how to prevent the init running over and over and over again with JIP players.
hey wait a minute
Assuming I understand, correctly.
Yes, you understand it correctly
I did try an earlier version of the script on a live server by spawning guys with Zeus compositions and it seemed to work without issue. Now I'm just expanding what the script is capable of, spawning more than just shitbox guns.
For context, we're doing a stint in Africa as mercenaries.
We're not the only mercs in town.
Anyways. But do functionalize it at least for 3den missions. Or you are adding 234kb to mission size for every init field you put it in. (A bit less due to binarization)
Yes, that is a smart idea.
For Zeus usage, you could make a composition consisting of a dummy object whose sole purpose is to use its init field to define the function as a global variable, so other compositions can then make use of it
I could, but does the Zeus-spawned script get saved anywhere? IE will I clog up memory with used up scripts every time I spawn a dude? I thought that stuff went away when it was done being used, and since equipment is always global, JIP clients will still see the guys wearing what they are supposed to wear.
The only one I'm not sure of is [_obj, "PW_PATCH_Mercenary"] call BIS_fnc_setUnitInsignia; if that's global or not since it's kind of retexturing something.
Its global.
Okay good.
The script technically goes away in zeus. Regardless function is a better way. At least you copy pasta 1 line.
Also if you are using composition you will reduce composition size
I mean I'm only spawning like ten guys. That's only... -checks file size- 2350 KB. :B
But still, helpful to know.
While it could be less than 300kb
True.
It depends on what the script does. If it's a continuous script then it...continues, and it has to persist in memory to do that. If it defines global variables, the variables will persist. If something is broadcast with a JIP flag, that stays in the JIP queue and gets sent to new joiners.
What I am trying to say is this:
- have one "initialiser" composition that defines the large function as a global variable
- place this composition only once per mission
- this means the large function is only stored once on disk, rather than once per init field, and also only once in memory when placed
- all other compositions can then simply use e.g.
[this] call your_fnc_function, rather than containing the entire function again
This is the same principle as using the debug console to define the function first, it's just easier to save and share, compared to copy-pasting the raw code
private _soundSource = player say3D ["alarm",80,1,false,0];
_soundSource will return #soundonvehicle it what I need
But how I can do same if I need RE the say3D?
Tried next but it returns empty
private _soundSource = [player, ["alarm",80,1,false,0]] remoteExec ["say3D"];
_soundSource will return ""
Because remoteExec will not return the script's return value but remoteExec's
What is the reason to get the object?
You can store the return with remoteExec'ing call and use later
Yes, that's an option too, thanks 
sounds awfully close to the point where defining a function at all clients and remoteExec'ing it would be more convenient 🤣
Hi clever people.
I had the following script working well in initplayerlocal.sqf before the latest update.
Since the latest update, it no longer works, am I able to get some assistance?
["FirstAidKit", ["CONTAINER","CLOTHES"], "Open IFAK", nil, nil, [{
params ["_unit"];
private _freeMassVest = (1 - loadVest _unit) * getContainerMaxLoad vest _unit;
private _freeMassUniform = (1 - loadUniform _unit) * getContainerMaxLoad uniform _unit;
private _freeMassBackpack = (1 - loadBackpack _unit) * getContainerMaxLoad backpack _unit;
private _addedMass = 0;
{
_x params ["_item", "_cnt"];
_addedMass = _addedMass + _cnt * getNumber (configFile >> "CfgWeapons" >> _item >> "ItemInfo" >> "mass");
} forEach [["ACE_morphine", 2], ["ACE_quikclot", 10],["ACE_tourniquet", 2],["ACE_bloodIV_500",1],["ACE_bloodIV_500",1], ["ACE_packingBandage", 10]];
(_freeMassVest >= _addedMass) || (_freeMassUniform >= _addedMass) || (_freeMassBackpack >= _addedMass)
},{params ["_unit"]; _unit isEqualTo vehicle _unit;}],
{
params ["_unit", "_container", "_item", "_slot", "_params"];
for "_i" from 1 to 2 do {_unit addItem "ACE_morphine";};
for "_i" from 1 to 10 do {_unit addItem "ACE_quikclot";};
for "_i" from 1 to 10 do {_unit addItem "ACE_packingBandage";};
for "_i" from 1 to 2 do {_unit addItem "ACE_tourniquet";};
_unit addItem "ACE_bloodIV_500";
_unit addItem "ACE_bloodIV_500";
true
}, true, [0,1,2]] call CBA_fnc_addItemContextMenuOption;
What exactly doesn't work?
It no longer prompts with the context menu to "Open" the first aid kit
@granite sky
Are you sure you still have FirstAidKit?
Yes
Unless the classname for the vanilla First Aid Kit has been changed under our nose
It's not happening. Just in case, you STILL have vanilla FAKs?
Yes, still have vanilla FAKs
This is what should happen: https://youtu.be/J2d3u5eQNiU
This is what happens now @warm hedge
Same mission, same code.
Only change is the update
Disregard, CBA broke it
V18 it doesn't work
V17 it does
I didn't realise there was a CBA update
hello,
["B_Slingload_01_Cargo_F", "Init",{
// some other code that works
(_this select 0) setMaxLoad 25000;
//more code that works
}, false, nil, false] call CBA_fnc_addClassEventHandler;```
this doenst increase the maxLoad when the object is spawned in zeus. its being called in the init.sqf
any idea if i can change it so it does?
You need call it via server,
setMaxLoad
SE
Server
So you could do CBA Event that you call CBA serverEvent
what options are there equivalent to "getDir" for pitch and roll?
specifically for this syntax: pos1 getDir pos2
nvm figured it out
i just returned after the latest update so im very rusty right now
i want to use the new command getCorpseWeaponholders
how do I set the player's weapons using this command just after death?
_newloadout = getCorpseWeaponholders player;
player setUnitLoadout _newloadout;
How do I make an object that is attached to another object via "attachTo" rotate along with it on all axis?
getCorpseWeaponholders returns containers, not loadout.
i was thinking using addweapon would be the right one?
Enable followBoneRotation in the function
Yes, but using only this command is not enough.
only works if there is a memory point, passing "nil" causes it to fail.
Anyway, I found another solution
Why arent you using a memory point?
does "forEach" iterate through each item in order or does it execute code on all items at once?
because there isn't one
Order
does nearestObjects count recently deleted objects?
wait, nvm. My problem is something else. Is there a way to check nearest objects within a certain azimuth?
Do you mean you want to sort them by azimuth?
I was hoping for an easier solution but it looks like I need to filter the results
Maybe if you could explain what you're trying to do we could point you in the right direction
I have a line of objects. I need to find the next object in the line but only going in one direction. The objects are created in a script and added to an array, which is where what they are achieved from. They are spaced at semi-even intervals.
I basically need a reliable way to retrieve the "next" object in the line.
it's all a part of my script for placing powerlines
right now I'm like 90% there
2d direction or 3d?
So do you want the object to be exactly aligned with the direction or the closest object in that direction?
I need to retrieve the closest object in a specified direction
Well technically the distance along a direction is simply the dot product of its difference vector and the direction vector.
But an object can be close along the direction but also lie at a far distance along the side of that direction. I'm assuming you don't want that?
You should be aware that I am much more stupid than your first paragraph gives me credit for.
The problem I am facing is that since the objects are spaced at even intervals, the nearest object can be the previous one in the line in certain instances. And of course, objects to the side as well
wot
I can't just remove the each object when I'm done right away either because of the way the script works. It basically places dummy objects at specific relative coordinates on already placed models, detects the "nearest" one, "aims" at it, and then a new object (the power line) is created and attached to the dummy object at a specific offset (the end point of the wire) and then detached and converted to a eden entity
the goal is to align the ends to specific locations by rotating along an "anchor" point (the dummy object) without a bunch of vector math
It works, but sometimes the wire goes in the wrong direction so there is a gap between some poles and doubled up wires between others
hmmmmm
sounds interesting
thats funny you want to put wires in i want them out lol
removing them should be much easier lmao
unless you mean in some specific way that's more complicated than I'm imagining
I want hazards for heli pilots on my terrain
You can do something like this:
_p1 = getPosWorld _obj1;
_dir set [2, 0]; // 2D dir
// create a 2d rectangular area along the direction; here 5 is arbitrary distance along the side; adjust as needed
_area = [_center, _radius, 5, _dir#0 atan2 _dir#1, true];
_objs = nearestObjects [_obj1, [], _radius, true];
_minDist = 1e30;
_nextObj = objNull;
{
if (_x inArea _area) then
{
_p2 = getPosWorld _x;
_dist = (_p2 vectorDiff _p1) vectorDotProduct _dir;
if (_dist > 0 && _dist < _minDist) then
{
_minDist = _dist;
_nextObj = _x;
};
};
} forEach _objs;
_obj1 is the object from which you want to connect to another obj
If your direction is in angles, you can make it a vector like so: [sin _angle, cos _angle, 0] if it's CW like getDir (if CCW just swap cos and sin)
I don't recommend attaching objects as it slows down the game
You have to hide them
oh no
performance isn't an issue. Just need to get the objects placed and entities created so I can export
you could execute a script on startup to remove all objects on the terrain of a certain type
or maybe you can use the module with classnames? I can't remember
nice
If you place the dummy objects via a script too, why not create the poles where you add the dummies instead of first creating dummies and then searching for them?
do you mean like this
{if ((str _x) find "wired_fence" >-1) then { hideobject _x;};
} forEach nearestObjects [GetMarkerPos "Center", [], 2000];
the poles are placed manually or using other tools. precision isn't needed there (beyond avoiding placing them inside other objects or the middle of roads) and the route is hand made. The wires need the script to be placed accurately
something like that
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
oops oh yeah
use tolower in the condition to get more matches
Ok I see
Then I don't think you can do it via a fixed direction unless the user creates them relatively accurately (within 5m accuracy in that script I posted)
ah thx mate i see
Is there a way to convert cursor positon to grid coordinates in Eden Editor via Debug Console?
Instead of using a direction you can use the objectIDs. They are always in the order the user created the objects in 3den
Awesome thanks! 👍🏻
the objects aren't necessarily created in order
also the dummy objects aren't eden entities
Source code here
https://github.com/Feuerex/fex_Scripts/tree/main/Electrical power poles cables
or download the whole repository from latest release package available here.
https://github.com/Feuerex/fex_Scripts/tree/main
Includes a testing scenario, and instructions on how to run this thing from anywhere else.
Please keep in mind that...
I put
_height = (getPosASL transport) select 2;
transport flyInHeightASL [_height, _height, _height];
In a trigger and set it to run immediately, but for some reason the aircraft continues to dive from 4700m alt to 100, which is not what I want it to do
Any way to force it to maintain 4700m alt?
transport being the var name for the C130 we are using as the transport
Still fails to maintain 4700m alt
Well it dives down to 100 meters and then uses THAT as the height so I don't think it does matter
Well that's the thing
It does matter, but the SCRIPT is what doesn't work
It should not dive below 4000 in the terrain it flies over, but it for some reason does
wright you own script
It goes to the default 100m alt
brother it's literally the flyInHeight command
That's BI's command that they made
all my aircraft maintain al if i put getposATL
something like this
Waituntil { Sleep 2; (((GetPosASLW Helo2) Select 2) <=3) or !Alive Helo2 or !CanMove Helo2 or !Alive Pilot2 };
this wouldn't work for terrains
oh shit i forgot again
boy do I ever love arma
lol me too
I deleted one of the units inside the transport that I used for comms and it just fixed itself
lol nice
What caused the issue? Lord alone knows
Maybe that one guy really needed to land or some, but it works now
anyone got any idea how to make the subtitles shown by BIS_fnc_EXP_camp_playSubtitles have color and different formatting? i tried the stuff with <t color></t> and all that but it aint working
Post your code.
i mean i got voicelines here : ```
[
["Covenant Shipmaster", "Humans… so predictable, always clawing at survival like vermin in the dark.", 0],
["Covenant Shipmaster", "You think this victory is yours? The crash of my vessel— it was a mere setback.", 9],
["Covenant Shipmaster", "You scramble across this shattered world, grasping at the illusion of hope, but we... we are eternal.", 17],
["Covenant Shipmaster", "The Covenant does not falter because a single ship falls.", 27],
["Covenant Shipmaster", "Your kind has fought bravely, I’ll grant you that, but your efforts are futile.", 34],
["Covenant Shipmaster", "Even now, my warriors regroup—stronger, more vicious than before.", 41],
["Covenant Shipmaster", "While you exhaust yourselves hunting what remains of my forces, you fail to see the trap you’re walking into.", 47],
["Covenant Shipmaster", "You may have severed our communications, but my voice still carries weight, even in silence.", 56],
["Covenant Shipmaster", "You may have won this battle, but we will win the war.", 64]
] remoteExec ["BIS_fnc_EXP_camp_playSubtitles"];
i just wanna make it so the name of the speaker is in red
tried this with it but noting was shown for the speaker name : ["<t color='#FF0000' font='PuristaBold'>Speaker1</t>", "Subtitle1", 0],
Try to remove font attribute.
i tried the color one only too and it didnt work. Im pretty sure ive seen colored text on the subtitles before so idk how they did it
https://community.bistudio.com/wiki/BIS_fnc_EXP_camp_playSubtitles doesn't mention that any form of Structured Text can be used in the speaker parameter 🤷♂️
if you want colored subtitles, rewrite the function or use something community made like R3vo's
Simple Conversation Script (APEX Edition) A simple conversation script for Arma 3. For the documentation as well as the download visit GitHub. Demo Video
aight ill try those thx!
It doesn't work because speaker's name is toUppered.
You can write own function based on BIS_fnc_EXP_camp_playSubtitles.
How to create a customchat channel?
In initServer.sqf I have:
radioChannelCreate [[1, 1, 1, 1], "Q-dance Radio", "%UNIT_NAME", Soldier1, false];
In the trigger activation field I have:
Soldier1 customChat [1, "Hi, I am a custom chat message"];
But no message shows on my screen.
You should save the return from radioChannelCreate and use that instead of just assuming it's 1
it maybe that you also need to use Channel radioChannelAdd [_player];
That should already be done via the units param
oh right
How do I go about this procedure?
Just something like:
// initServer.sqf
TAG_customChannelId = radioChannelCreate [...];
publicVariable "TAG_customChannelId";
// someOtherScript.sqf
Soldier1 customChat [TAG_customChannelId, "Hi, I am a custom chat message"];
It's possible (though unlikely) that other mods also add custom channels, which means that it might not be 1. So you should save the return to make sure you're always using the one you made
You can also check the value to make sure it's actually being created, since radioChannelCreate returns 0 on an error
Ill try that. Thanks!
just curious has anyone been able to change the map to vanilla when contact is loaded?
you mean for the title screen?
no like when you load the contact dlc under dlc tab is uses a different map and i cant find anything to disable it and still have contact objects that isnt violating ip rights
could you make a screenshot of what you are talking about because I am having a hard time parsing
for some reason when on this map i cant scroll with cursor and right click at all too
only numpad works to zoom in and out and then slowly go side to side
it's probably a mod of yours conficting with the Contact map and no you can't change it, it's hardcoded. You should load the game just with the Contact Platform which is loaded the same way as other DLCs like Malden, Apex etc
you could just not use contact dlc. many of the stuffs are available to the base game
its just missing things like blank ammunition, ui and stuff
It sounds like they want to use specifically the things that are not in the platform data (e.g. alien things)
most of the alien objects and particle effect things arent in platform sadly
welp i guess its time to play the delete ui elements game
Hello guys, is it possible to have an arma 3 script fetch data from a simple hosted website that would contain information like so:
{"rank":"First Sergeant"}
Do you mean fetch a (json) data from online website?
heyho, does "break" in sqf break out of the current loop or all loops? I have nested loops and it would be bad if I want to stop only one loop only to get the overarching loop destroyed
Current loop
thanks!
Other question: When increasing a value assigned to a hashmap, can I simple go _mymap set ("key", +1); or do I first have to assign the value to a seperate variable before increasing it?
You can test to be sure:
{
{
_x;
break;
} forEach [1,2];
_x
} forEach [3]
Should print 3 in console
I trust you haha, if not I will just use the breakto feature
