#arma3_scripting
1 messages ยท Page 207 of 1
you can even point at a medic and hit enter then point at another soldier and order the medic to heal that soldier
Yeah the issue is that the player stop command doesn't seem to have script equivalent or a direct way to undo it through script.
oh so that is diff hmmm
IIRC there are a few other command menu orders that aren't available through scripts. It's unfortunate, but I think the last word was that it's deep magic and we probably won't get them.
When you are the leader of the group, open the command menu (e.g. pressing F2 to select the second unit in your group) and select Stop.
oh thats the same as the normal stop command right
for Ai and players right ?
after chose stop command i just chose regroup and all regroups to me
after he stops the unit he wants to use a script move on him and it doesn't work, that's the issue,
oh ok i see now ok
thx for the explantion m8 @shut carbon
i guess you would have to make your own command structure for that
i remember there was 1 in Arma 2
ummm no it was a umm support structure i think
you thinking of High Command?
oh yeah thats it
yes, but we're talking about the user group units. It's a different use case. Thing is the user commands menu have another "layer" where they function, disabling some script commands over them.
yup ๐
i guess i'm a little thick in the head ๐ but thx for taking the time to make me understand
you're not. I'ts Arma's fault ๐
lol no no there's nothing wrong with Arma ๐
lol
its always me that mess's up its never the game ๐
lol
just like in Golf its never the club ๐
๐ i just added a cool intro to my demo mission of my chopper command
that no one seems to want lol
but thats ok i love it
Turns out if you call camSetTarget, then setVectorUp and setVectorDirAndUp no longer work on camera...
Solved by replacing camSetTarget with setVectorDirAndUp, the direction vector is the same passed into camSetTarget and the up vector is used to control banking.
i can't kill a script with "terminate" even if it returns true using "canSuspend"
Another problem, now that I don't use camSetTarget, calling camSetFov doesn't work anymore since according to wiki this function requires camera to have a target, how do I workaround this?
Hello guys I'm running into some issues with my global kill counter. I was thinking I'd ask here if you guys have any experience with addMissionEventHandlers. For some reason _killer and _instigator is ALWAYS null or in my code at least, not a player. Which isn't true, we clear through hundreds in our missions. This code is executed from XEH_PostInit of my own addon, and is run globally, on each client, but the first rows exclude client players. I have also tried using !HasInterface only to enforce server & headless are only allowed to track these kills, but without success. Could it be a locality issue? Could the internal isServer check be breaking things as perhaps the unit is not local to the server therefor the reference to it falls apart? Any ideas? Thanks for checking. If anyone wants to use this bit of code, feel free, IF I manage to fix it of course ๐
Global Killed Event Handler for all units.
Registers a missionEventHandler ["EntityKilled", ...] on all non-interface clients (server & HC).
Ensures only one global score addition per kill using a variable on the killed unit.
*/
// Only run on server and headless clients (not player clients),
// but allow if this is a local server (hasInterface && isServer) for debugging
if (hasInterface && !isServer) exitWith {};
private _Debug = missionNamespace getVariable ["GOL_Enemy_Debug", false];
if(_Debug) then {
format["[KILLS] Registering Global Killed Event Handler"] spawn OKS_fnc_LogDebug;
};
if (isNil "GOL_GlobalKilledEventHandler_Registered") then {
GOL_GlobalKilledEventHandler_Registered = true;
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator"];
private _Debug = missionNamespace getVariable ["GOL_Enemy_Debug", false];
// Only process if not already handled
if (_unit getVariable ["GOL_ScoreAdded", false]) exitWith {};
_unit setVariable ["GOL_ScoreAdded", true, true]; // sync to all
// Only update global score on server
if (isServer) then {
if(isPlayer _killer || isPlayer _instigator) then {
//// Lots of logic to figure out if captive, is enemy, is civilian, etc. Can be ignored as we never reach this point.
} else {
// Killed by environment or unknown
private _name = name _unit;
if (isNil "_name" || {_name isEqualTo ""}) then { _name = typeOf _unit; };
if (_Debug) then {
format["[KILLS] NotPlayer: %1 killed by %2 (%3) - Instigator %4 (%5)", _name, name _killer, _killer, name _instigator, _instigator] spawn OKS_fnc_LogDebug;
};
}
}]
The logs I receive are mostly the following types
18:35:56 "[D][KILLS] NotPlayer: Error: No unit killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"
18:35:56 "[D][KILLS] NotPlayer: Bilal Al-Hassan killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"
18:35:56 "[D][KILLS] NotPlayer: Sami Al-Hashim killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"
18:35:56 "[D][KILLS] NotPlayer: Mohammed Al-Nasser killed by Error: No vehicle (<NULL-object>) - Instigator Error: No vehicle (<NULL-object>)"
Edit:
I fixed this making sure that I check (local _unit), the logs were of course on the headless client. so I removed the isServer and freed that up and then used that condition to make sure I only run it on the client that the unit is local to.
It works, but perfection, probably not ๐
Didn't check the code thoroughly, but there seems to be some misplaced and missing semicolons. You can try this code snippet, but can't guarantee that it would work ๐
(I highly suggest using a syntax plugin/extension) ```sqf
if (isNil "GOL_GlobalKilledEventHandler_Registered") then {
GOL_GlobalKilledEventHandler_Registered = true;
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator"];
private _Debug = missionNamespace getVariable ["GOL_Enemy_Debug", false];
// Only process if not already handled
if (_unit getVariable ["GOL_ScoreAdded", false]) exitWith {};
_unit setVariable ["GOL_ScoreAdded", true, true]; // sync to all
// Only update global score on server
if (isServer) then {
if(isPlayer _killer || isPlayer _instigator) then {
//// Lots of logic to figure out if captive, is enemy, is civilian, etc. Can be ignored as we never reach this point.
} else {
// Killed by environment or unknown
};
};
private _name = name _unit;
if (isNil "_name" || {_name isEqualTo ""}) then { _name = typeOf _unit; };
if (_Debug) then {
format["[KILLS] NotPlayer: %1 killed by %2 (%3) - Instigator %4 (%5)", _name, name _killer, _killer, name _instigator, _instigator] spawn OKS_fnc_LogDebug;
};
}];
};
I probably messed that up mostly because of copy paste. It's not script errors as then my logs would indicate it, it's the fact that the recieved params from the MissionEventHandler is null when there should be _killer & _instigator ๐
But thanks for the advice! I do run VS Code with Syntax prettyness ๐
Little bit of a Niche thing, but any way to make Advanced Developer Tools, the syntax, ignore something?
["Randomize rotation and scale"] collect3DENHistory {
private _scaleRange = "85,115";
// Rotate: True - Random 0 - 360
// False - No Rotate
// Array -
private _doRotate = [0,90,180,270];
private _rotated = 0;
private _objs = get3DENSelected "object";
private _scaleRangeSafe = _scaleRange splitString ",";
_scaleRangeSafe resize 2;
if(isNil {_scaleRangeSafe # 0} || {(_scaleRangeSafe # 0)call BIS_fnc_parseNumber <= 0})then{
_scaleRangeSafe set [0,"100"];
};
if(isNil {_scaleRangeSafe # 1} || {(_scaleRangeSafe # 1)call BIS_fnc_parseNumber <= 0})then{
_scaleRangeSafe set [1,"100"];
};
private _hScale = parseNumber (_scaleRangeSafe # 1);
private _lScale = parseNumber (_scaleRangeSafe # 0);
private _scaleRandomRange = _hScale - _lScale;
private _scaleOffset = _lScale; // Needed?
{
private _nScale = (random (_scaleRandomRange * 1));
_nScale = (floor (_nScale + _scaleOffset))/100;
_x set3DENAttribute ["ENH_objectScaling",_nScale];
_x setObjectScale _nScale;
if(typeName _doRotate == "BOOL" && {_doRotate == true})then{
private _oRot = (_x get3DENAttribute "rotation") # 0;
_oRot set [2,random 360];
_x set3DENAttribute ["rotation",_oRot];
}else{
if(typeName _doRotate == "ARRAY")then{
private _nRot = selectRandom _doRotate;
if((_nRot % 360) > 0)then{
private _rotation = (_x get3DENAttribute "rotation") # 0;
_rotation set [2, ((_rotation # 2) + _nRot) % 360];
_x set3DENAttribute ["rotation", _rotation];
_rotated = _rotated + 1;
};
};
};
}forEach _objs;
};
That or, if you have a better idea how to accomplish this- Script is meant to make an eden undo history point, then you enter a range for random scale, then it was just a bool for rotation. True, randomize rotation between 0 and 360. False, doesn't touch the rotation. New part however is the typeName check. If bool, do what it was doing. But now, if an Array, then pick a random entry from the array, and set the rotation to that.
Advanced Developer Tools, syntax checker doesn't like _doRotate in the bool when it's an array, and vice versa. Runs fine, but the editor part complains b/c doesn't realize I'm doing a check, so it can ignore mismatched types x3
You should use params command with default value, accepted data type and array size
Also why is the range a string and not an array.
tbh, I don't remember <3
You can, it should even be scriptNull after you do
If you spawned sub-scripts however, nothing that can be done from the outside
Ah- I forgot the scale doesn't have a way to tell it to ignore it so it will always change scale ๐ซ This has already taken longer then I'd like, so I'll just live with it for now xD
is there any way to remove the external turret from CRV -6e Bobcat and turn it to pure armored transport ? I know I can remove the ammo but there is resupply point players can use to still shoot that gun ...
I'm not sure if it has animation sources to visually hide the turret. But you can use removeWeaponTurret to...remove...the weapon...and then they won't be able to rearm it
my workflow now consists of codex-cli being able to modify my arma3 scenario, pack the pbo, run an arma3 server with it, check the logs, fix stuff, all automated. fully worth the effort lol
@hallow mortar I tried this and it completely removes turret
_veh animate ["HideTurret",1];
How can I destroy/delete a backpack placed in the editor? Surprisingly hard. I've tried deleteVehicle/setDammage/enableSimulation false, doesn't work so far
deleteVehicle works, but enableSimulation wouldn't do either of things you're asking
Hmm, not for me. At first I used hideObject just to hide them, but I could still pick it up, so now I want to completely destroy it somehow
I fixed this making sure that I check (local _unit), the logs were of course on the headless client. so I removed the isServer and freed that up and then used that condition to make sure I only run it on the client that the unit is local to.
It works, but perfection, probably not ๐
I got it to work with "deleteVehicle objectParent backpack" was missing the objectParent :)
Yeah, it's because they're placed in ground weapon holders IIRC.
kinda weird because the backpack itself is an object?
never figured that out fully.
I redid the KP Lib arsenal to just the ACE3 arsenal for files init_arsenal.sqf and open_arsenal.sqf. Somehow it works but spits errors and would like to know how to clean it a bit better
[] spawn {
// Wait for the player to be alive
waitUntil { alive player };
// Declare private variables at the top
private _backpack;
private _posBase;
// Backup the player's backpack
_backpack = backpack player;
// Optional: limit arsenal to base
_posBase = getMarkerPos "base_marker";
if ((getPos player distance _posBase) > 50) then {
hint "You can only access the arsenal at base!";
exitWith {};
};
// Open a standard ACE Arsenal
[player, player, false] call ace_arsenal_fnc_openBox;
// Wait until arsenal is closed, then restore backpack
waitUntil { isNull (findDisplay 245) };
[_backpack] call KPLIB_fnc_checkGear;
};
// --- Whitelisted ACE Arsenal ---
[] spawn {
waitUntil { alive player };
private _backpack;
private _arsenalWhitelist;
// Backup player's backpack
_backpack = backpack player;
// Define whitelist of classnames
_arsenalWhitelist = [
// add whitelist string here
];
// Add whitelist to ACE Arsenal
[player, _arsenalWhitelist, false] call ace_arsenal_fnc_addVirtualItems;
// Open ACE Arsenal
[player, player, false] call ace_arsenal_fnc_openBox;
// Wait until closed, then restore backpack
waitUntil { isNull (findDisplay 245) };
[_backpack] call KPLIB_fnc_checkGear;
};
There's a setting for it I'm pretty sure, you don't need to modify the scripts directly
Pretty sure some of it is deprecated or some. Breaks 99% of the time where a custom preset, etc just does not properly load the arsenal
I mean for whether to use BI or ACE arsenal
Yeah there is
https://github.com/KillahPotatoes/KP-Liberation/blob/master/Missionframework/scripts/shared/fetch_params.sqf#L58
Both break. Most run ace and ace arsenal is nicer for search, etc to an extent. I could not be bothered to rework the BI call as well
Same, till recently. Been setting up lib annd converting maps for myself for years now. I have converted maps for myself basically to all 5star maps onn the workshop
But the question was not how to setup the arsenal presets - it was for help inn cleaning the above posted ^
get the 0.96.8 version
Onnly see a .7A version on GIT?
you should asked in the kp lib discord before wasting your time on that script lol
it's not a release version, but a branch
updated
the arsenal is handled differently
I see the functionn call has been changed
but even in 7a, i've never had any issues with the arsenal,
the only issue occurs when you have an error in the preset
and it won't load the arsenal right
Ye in the last few weeks I have noticed the preset breaks, especially on modded stuff, and you get half loaded arsenal. Hence why I just made it for a standard preset less ACE3 arsenal that can be restricted
did you check your rpt file?
What I made now works as intended - I just don;t know enough about sqf to make it 100% error free
Arma law - .rpt first and then google/discord/everything else. Been around for long enough to know that one XD
any case, the arsenal should be called in the initplayerlocal.sqf instead of init.sqf
but I'm not the dev
xD
Ye that is correct
I'm trying to get a helicopter hover next to the edge of a building, however any varian of flyInHeight will either make it drop to the ground or go way up the sky. Can I actually do this without unitCapture'ing myself flying it?
did you try flyInHeightASL?
if I place an object or helipad and use land/landAt it will choose any other spot.
yes

since some version of A3 any height below 10m makes them land, anything above will default to the baked-in lowest number
Is it possible to rotate a vehicle without resetting its velocity?
I don't think so, but you can save its velocity, rotate it, and then immediately re-apply its velocity
Yeah, thats what I was thinking, just hoping someone has some cooked up way around it xD
I mean it's not super hard to do. Any hacky workaround would likely be more complex than just re-applying velocity.
private _vel = velocity _object;
_object setVectorDirAndUp [ ... ];
_object setVelocity _vel;
// or
private _vel = velocityModelSpace _object;
_object setVectorDirAndUp [ ... ];
_object setVelocityModelSpace _vel;```
Ehh, true...
Im working on a mod to make beach assaults easier and smoother for Zeus, and thinking of different ways to manage pathing the boats to the target area when theyre being forced forward.
Really struggling to try and rotate some created objects along with a module.
It's accurate ~1/4 of the time (rotation wise), but once it crosses a certain threshold it gets a larger and larger offset from the module.
I've always struggled with vector math, and not sure what the correct way to go about this is. Also this is mostly testing code, I will clean it up more later.
// Takes a center position, length, width, height, and direction and generates a random position within the area.
params ["_centerASL", "_a", "_b", "_c", "_direction"];
TRACE_5("fnc_distribution_gaussian",_centerASL,_a,_b,_c,_direction);
private _return = [];
{
_return pushBack (random [-_x, 0, _x]);
} forEach [_a, _b, _c];
_return = _centerASL vectorAdd _return;
_return = [_return, _direction, 2] call BIS_fnc_rotateVector3D;
_return;
"large" (not sure what it was at) rotation vs 0 degrees
It seems my issue was just because I was adding the center position before the rotation, it seemingly should be after. This seems to be correctly rotating with the module
private _return = [_a, _b, _c] apply { random [-_x, 0, _x] };
_return = [_return, _direction, 2] call BIS_fnc_rotateVector3D;
_return = _centerASL vectorAdd _return;
_return;
Does anyone know/have good vehicles paradrop script? Or I have to make my own ...
depends what you want it to do. modules enhanced has a paradrop module
i also have a paraDrop script that i made, well really like 3 of them: for diff things
thay are realy nice and simple and works great
but if you realy want a Awsome paraDrop script look into (LV scripts) hes Awsome
imho
in my paraDrop script it only Drops the Amount of soldiers that can fit in the caro
in (LV scripts) he has it so you can drop as many as you want
and also in the (LV scripts) there's full Documentation on how and why to exec the script
as a matter of fact i have a "Para folder" that has
(ParaEject script)
and a regular Paradrop Script like from a flag pole
and 2 Halo Scripts 1 with EX cam
and 1 with out
all my Para scripts work over water or land
over water my para scripts ajust the stuck Aim the happends when you drop in the water sometimes as a scuba drive
hight of chut open can be ajusted in the script as you want
all with sounds of chut open PoP: and wind ripple affect: untill land
i have it set that you can not be shot while in para drop but that can be changed as you wish
I want to drop tanks
oh ummm ok lol ๐
there is sling rope for that right
or do you mean drop fuel tanks ?
base is on a carrier, paradrop vehicles is easy way to get tanks and apcs to land if there is no pilot among players
oh so you would just ajust my para drop script for the tank insted of _player
cuz my para drop script has map click location
@split ruin w8 a sec can't you use support drop for that m8
IIRC i think there is a Module for that
maybe that was Arma 2 i forget
hello all: what's the name of the cargo parachute in Arma 3 ?
ahhh ok "B_Parachute_02_F"
Woohoo ๐
paradrop module is for crates only but maybe it can be scripted to drop vehs
im making one now for tanks and stuff ๐
use the zeus one
but it may take me like 4 weeks to get it right ๐
lol just kidding ๐
ok now to see if it works ๐
This attachs a parachute if the object is high above ground
https://community.bistudio.com/wiki/BIS_fnc_curatorObjectEdited
@thin fox unfortunetely I don't plan to have Zeus in the scenario
I solved the problem partially by making land vehs to be produced as cargo container, then after sling loading them to land they can be "unpacked" to vehicle needed
depot addAction
[
"<t color='#FF80FF'>Build Container</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
_container = createVehicle ["B_Slingload_01_Cargo_F",[5845.74,2941.8,23.8007],[], 0,"NONE"];
_container setPosASL [5845.74,2941.8,23.8007];
_container setDir 300;
_container addAction
[
"<t color='#80FF80'>Build Quadbike 2P</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
private _pScore = (getPlayerScores _caller) select 5;
if (_pScore < 2) exitWith { hint "Earn more score!"};
_caller addScore -2;
_vehpos = getPosATL _target;
deleteVehicle _target;
_veh = "B_Quadbike_01_F" createVehicle _vehpos;
["build"] remoteExec ["BIS_fnc_showNotification",0];
},nil,5,true,true,"","true",3,false,"",""
];
},nil,6,true,true,"","true",3,false,"",""
];
I need to workshop how to make an XP system for various tasks in our game. It would be simple: a player does a certain task and that adds to the points total. Those points allow other skills and features to unlock.
So after the system is running it would be simple to use it. "if so many points, then, else, etc." I would like to know ways to go about collecting the points (keystrokes, time, trigger area, a combo?), and how to store them in our DB. I can set up new categories in the database to store the stats neatly. How would they be stored, and would that all fall under scripted database?
Sorry I can't be more specific, I really don't know where to start on this one. Not looking for the script, just help with an outline of the work flow.
@tough abyss maybe use score as exp points? you can simply add custom amount of score points for tasks and additionally player gets points automatically when killin enemy units and assets
thanks! heading straight to the wiki. I have learned how to use a great deal of code, but still don't know all of Arma's built in goodies. That would save a lot of headache.
for adding score points for cutom task you would need this command https://community.bistudio.com/wiki/addScore
score is personal for every players so it can work as experience
it is saved during mission
and probably can be saved to player name varspace between server sessions
Is there any way for me to split that into a several classes of scores per player? For different types of tasks. The goal is a very simple skill tree.
no problem,here is the example win trigger on a task where players have to destroy enemy weapons cache
wintrg = createTrigger ["EmptyDetector", _uberPos, true];
wintrg setTriggerArea [50, 50, 0, false, 30];
wintrg setTriggerActivation ["NONE", "NONE", false];
wintrg setTriggerStatements ["{!alive _x} forEach tsk_objects",
"
private _allPlayers = call BIS_fnc_listPlayers;
{_x addScore 20} forEach _allPlayers;
deleteVehicle failtrg;
['tsk','SUCCEEDED', true] call BIS_fnc_taskSetState;
['succ'] remoteExec ['BIS_fnc_showNotification',0];
_list = (position thisTrigger) nearObjects ['All', 30];
{deleteVehicle _x} forEach _list;
['tsk'] call BIS_fnc_deleteTask;
deleteVehicle wintrg;
", ""];
with this
private _allPlayers = call BIS_fnc_listPlayers;
{_x addScore 20} forEach _allPlayers;
you give all players 20 score points ("experience") to everyone when they destroy the enemy cache but you can make it only the player who actually destroyed the cache receives the score points
Yea that first block gives me a good idea of how to put this to use! With a little planning, we could make our tree a bit more complex and it wouldn't drain our brains too much, lol. Many thanks for the help.
About your previous question, you can make player buy improvements for his skills with experience (score points), this way he will decide how to improve his character
making his traits better and buying custom traits https://community.bistudio.com/wiki/setUnitTrait
Good luck on the battlefield! ๐
I see you didn't even read the page
That is amazing, exactly what we need put together with the score! We have some existing scripts for in game permits and license, with the above, a new UI, and some stringtable changes it will work perfect.
it doesn't require "zeus" to use that, it's a function
it needs zeus module placed in eden ...
I definitely test it with the Supply Drop module
if it works it will solve the issue completely
really? I was certain that I used that without it, but maybe you're right
i don't have a portable script for this, but here's mine for reference if you plan to write your own:
https://github.com/Warriors-Haven-Gaming/WHFramework/blob/main/WHFramework.Altis/Functions/Halo/fn_haloJump.sqf
it's not particularly complicated, just some sound effects and a teleport with automatic parachutes
@errant iron that's really cool especially if you are inside the tank ๐คฉ
is there a way to detect if a unit has a valid lock on a target? cursorTarget returns the selected target but it still returns that target even if the lock isn't valid and cursorTarget only works on a player
hey guys!
I'm trying to place a weapon on the ground in the editor. I want it to have a specific ammo inside.
Is there a way to do this? Maybe with a script?
You have to make a ground holder for the weapon, then you just add the weapon and whatever magazine you want
a ground holder? you mean like a box?
Like createVehicle ["GroundWeaponHolder" , ...]
They are boxes though technically
Though if you want to mess with it Eden you'll want create3DENEntity instead
There's playerTargetLock, which gives more accurate information about the state of the lock, but still only works on the local player. I'm not sure there's any way to do it for AI.
hi mate,s me with my basic trouble again, i kinda cant create a ListNBox 3 in arma 3, i just does not appear, any ideas what could be wrong ?
listnbox is a little pain to get working, but get the base class right first
then you need to addcolumns to it
and add something using lnbadd
does it not appear black like a listbox if nothing is in ?
u kidding me so colorBackground is what ?
from my experience it doesn't work lol
generally I add a background to it
but that's it
but to get it working, to show up, you need to add something in the list
Make sure you use ListNBox-specific commands on it. If you try to use ordinary ListBox commands, weird stuff can happen.
If you're creating it in config, you won't need to add columns by scripting as they can be defined in the config
that too
but I found that, at least for me, it's easier this way to get the right column pos
funny its not in the den editor in gui editor
Not sure where to ask; is it possible to hot-reload a mod to make testing and editing the packaged mod in different scenarios easier?
you mean like not having to restart the game as you make edits to your mod?
Scripts are pretty easy, config is doable but jank AFAIK (never tried it)
Is the system documented?
I feel like I'm missing something with BIS_fnc_randomPos; I tried passing [{player distance _this == 5}] as a code argument and it throws an error about it being code but expecting array, etc.
https://community.bistudio.com/wiki/BIS_fnc_randomPos
Syntax: [whitelist, blacklist, code] call BIS_fnc_randomPos
You're passing Code as the first parameter, but the first parameter needs to be either an Array of allowlisted areas, or nil to skip the parameter.
Parameters are interpreted strictly based on their sequential position; you can't just skip parameters and expect the game to figure out what to do with what you've given it. It's not that clever.
private _pos = [[[position player, 50]], [player distance _this == 5]] call BIS_fnc_randomPos;
Tbf, I didn't post the whole thing ๐
So in this example you have param 0: an allowlist array containing [position player, 50], and param 1: an array containing player distance _this == 5. param 1 is supposed to be the array of blocklisted areas, but instead you've got an array containing (code that evaluates to) a boolean.
If you don't want to blocklist any areas, then you need to pass an empty array [] for that parameter so you can reach param 2: code condition.
Ah, got it, didn't see the missing element there - borrowed it from the wiki as-was and threw my own code in to try and figure out how it works.
Had to rewrite from the ground up to get it t_t
I'm trying to pass it a specific set of instructions, that the positions picked must have an ASL height and AGL height of 0, trying to find the exact border between land and sea.
But it's not coming together :/
I think aiming for exactly 0 might be too ambitious. You might have better luck looking for a position that's between, say, 0.1 and -0.1
You can blocklist "water" to avoid getting positions that are actually in the water
Also, this is a function not a script command, so it is itself just made of SQF commands. You can inspect it in the Functions Viewer to see what it's doing.
Ech. Had a feeling that was the case when my marker stopped popping around to the eachFrame'd picked positions.
You can verify this yourself in the functions viewer, but I strongly suspect that this function simply generates a random position and then checks if it meets the condition. If the condition is very specific, it could take a looooooooong time for it to randomly generate a position that matches. Theoretically, forever. It has the ability to bail out and return [0,0] if a position can't be found, and that might include "this is taking too long", not just "there is literally no position there to be found".
Yeah. Damn, well, that's not cutting it. At least the function I'm dreaming of doesn't have any actual utility yet so I don't really need it ๐
can you command an Darter drone to paint a target? For simplicity I tried: sqf (gunner this) doWatch Bardelas; (gunner this) doTarget Bardelas; this fireAtTarget [Bardelas, (this weaponsTurret [0]) select 0]; in the init of the drone
which did not work. Ort would you need to create a laserTarget via createVehicle instead?
hey, I'm trying to detect when certain popup targets are down and then having it play a sound.
_target_0 = target_0;
_target_1 = target_1;
_soundPlayed = false;
while {!_soundPlayed} do {
sleep 1;
_anim1 = animationState _target_0;
_anim2 = animationState _target_1;
if (_anim1 == "terc_1" && _anim2 == "terc_1") then {
playSound "beep";
_soundPlayed = true;
};
};
I tried this but it doesn't seem to be working
what is not working
well it's not playing the sound. I tried and the sound itself is working
also, what is on your cfgSounds?
and are you testing this on SP/MP/Dedi?
the sound is there and the beep works when I just do playsound on a trigger
offline in the editor
I'll try
maybe the anim state is wrong, but try those event handler instead of a while loop
Is there a script command to prevent a vehicle turret from moving?
never seen and tested that though
Thanks, that should do it! I've used that within config, didn't realise it was available as a script command to.
It's new to me too ๐
Brilliant, works well.
this setTurretLimits [[0], 0,0,0,0]; // disable movement
this setTurretLimits [[0]]; // reset
nicee
event handles worked, tysm ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
๐
can someone help me by telling me if a script I have for dynamic loot is functional?
From what I can see it's functional ๐คทโโ๏ธ
idont know how to put it without it taking up so much space in the chat
where i got it from said it was the most basic for dynamic loot, but when i put it in my project nothing appeared
How do you excecute it?
Have you checked if there are actually items in _lootArray?
it is supposed to only place it in the mission folder and activate, i think
You need to execute it from within initPlayerLocal.sqf
i have it in the mission folder
ok
execute it from within initPlayerLocal.sqf
how do I execute it? it is not supposed to put it in the mission folder is executed when i open it in multi
say again?
?
it is not supposed to put it in the mission folder is executed when i open it in multi
I did not understand that
No you need to call it from somewhere. Only the specifically named event scripts are automatically called for missions
https://community.bistudio.com/wiki/Event_Scripts
the scripts check them by starting the mission in multi
Yes. I was wondering if there's a way to reload your mod while in-game.
Most scripts don't (can't) automatically run themselves. A file on its own will do nothing. Something needs to tell the game to run that file.
You can use execVM to run the file directly, or turn it into a function (https://community.bistudio.com/wiki/Arma_3:_Functions_Library) and use call or spawn. You'll need to use one of the scripts that is automatically run when the mission starts, like init.sqf, initServer.sqf, or initPlayerLocal.sqf.
Greetings folks! I would like to ask you for a little tip. In a multiplayer scenario, when player does some action, i want to play him some music. The music should be played in a loop until i make it to stop and only that one player should hear it, noone else. So i was wondering which script should i use, which one is the best? create sound source, or play sound or say or some other? Thank you
I was reading through the wiki and all of them seem way too similar to me, i was thinking about create sound source as it loops the sound, so i wouldn't need any while-do loop. But it has global effect so i guess others would hear that too
ok, i think i have an idea of โโwhat i should do
playSound with remoteExec
how can i make the loot vary?
because only weapons appear
no backpacks, no vests, no accessories, no food
just weapons
_cfgArray = "(
(getNumber (_x >> 'scope') >= 2) &&
{getText (_x >> 'vehicleClass') in ['WeaponsPrimary','weaponsSecondary','weaponsHandGuns'] &&
{_lootArray pushBack ( configName _x );
true}
}
)" configClasses (configFile >> "CfgVehicles");
WeaponsPrimary, weaponsSecondary....
that's what you need to adjust
thank you
thanks
https://community.bistudio.com/wiki/BIS_fnc_itemType here is a list of available types
and if they are mods objects?
They should have the same item type
ok, thanks for the aid
its not really "reloading" per say. If you run the dev branch, you can do something called a config merge. it has its limitations
@thin fox ty sir, i didnt what u tried to explain to me, but now i get it and u have been completle right
about listnbox i made it
i dont know what to touch but only dlc appears to me and in quantity
all buildings look like christmas trees
nicee
i forgot to write understand
but i get the point, yea but its har to figure it out if u dont see anything ..
yeah I took sometime to figure it out
Hello, I have questions about RscDisplayMultiplayerSetup. Is it normal for this display to remain active after a mission loads?
Trying to create script/function that has any vehicle driven by a CIV either turn around and drive away or have the occupants dismount and flee if they are hit by a specific projectile.
Couldnt find any examples on the workshop. Anyone go something similar kicking around?
Hello people ๐
I just want to confirm a learning.
Do I understand it right that the \ used as last letter defines the area of on #define PreProcessor?
source: https://community.bistudio.com/wiki/PreProcessor_Commands#Multi-line
Yes
Is there any extension of that area or a reason why the last bracket isnt inside the #define area?
(thats an image from the example files - both sides of the picture show the same document in diffrent lines)
\ does mark continue on next line.
So that is last "new" line
So the area logic goes like Ive tried to mark it. That also explain my confusion
Yes
I gues Ive done something wrong in the defining or including part because hes missing its values.
Ive compared with others and cant find a diffrence. Isnt it possible to tabstop them like Ive did?
Or is it possible that my deactivated area creates some issues because the \ isnt the very last character in line like
its called in https://community.bistudio.com/wiki/PreProcessor_Commands#Multi-line
i have another problem
now only dlc weapon appear, the backpacks that appeared cannot be grabbed, the rest of the objects that i put on the list do not appear, and the buildings look like christmas trees
I'm not sure if this is the right channel,
but I'll ask here ๐
Does anyone know how to reuse the map menu from the old man scenario?
It's not a standard map menu, but we like it and would like to use it in Altis Life.
How do i play music to specific group of players?
using remoteExec and "playMusic" ๐
Had that in mind, what if i have a group of 5 players and in that group there is only 3 players how do i remotExec group?
Do i just use group name?
you can use an array of players
what if i have a group of 5 players and in that group there is only 3 players how do i remotExec group?
just to make it clear, you have a group of 5, and you only want to send playMusic to 3 of them
I have 2 groups which contain player slots and i want to play for music only for 1 group, mb i didnt explain it that well i meant if in my group there is 5 slots and only 3 players connect to server
oh, then use units _groupVar as remoteExec targets
(do not use _groupVar directly, it would only go to the group's owner)
Like this?
["coh_calm1"] remoteExec ["playMusic", units ft_grp];
ft_grp is my groups variable name
it probably could work here, based on wiki:
https://community.bistudio.com/wiki/remoteExec
targets - (Optional, default 0):
- Group - the order will be executed on machines where the player is in the specified group (not where said group is local!)
ah fair, it's the other way around!
Cc @dire star
seems so ๐
?
so i mean this map menue
Look at mission files, you may code, which does this
Ahhhh ohhhhh...
case closed
I thank you a lot โค๏ธ
Ill simply remove the tabs between the backslash and my documantation
Can someone translate what hes saying?
From wich "caller" is he talking about?
Don't end macros with a trailing ;, add it after where you use the macro.
i.e. change:
#define SOME_MACRO class something {};
SOME_MACRO
To
#define SOME_MACRO class something {}
SOME_MACRO;
Thanks brother ๐ Trailing is translated into german with something similar to "hunt" or "chasing"
So the problem is that Ive closed the brackets in the end of my defining part?
Because Ive no ";" at the end oy my macro
You do, you literally circled it
Hm? I dont understand full
Thats what Ive tried to say haha sorry for language barrier
Now Ive received an error and I could bet that its because the missing simicolon in the area Im using my macro
Yes you are.
After material
material = -1 \
Im checking. Your right! Haha nice seen ๐ Thanks โค๏ธ
You're welcome
(but still the line 200 error)
Do you mean after the fix? The error doesn't always redirect to the correct line in the config.
Yeah after the fix
Ive learned that painfully haha. Im using the macro in line 200 so I gues its the ongoing process that resulted from line 200 cause the error.
I removed my semikolon at the end of my #define and havent placed it down so far again. Im comparing with the sample file but havent found an diffrence so far
Im also really confused of that because it makes sence after the explanation of @tulip ridge.
But its still done diffrent in the the samples files
It's not an arma limitation, it's something mikero's enforces
well you dont have ; after this ->
Yes because that's what the error was, how it is now is the "correct' way to do macros
Slightly curious whether armor = arm works as intended there.
So I have to place the semikolon after usage of the macro if Ive understand everything well.
But where is that?
I relly to the A3 sample files. If I understood it right, the armor value is given in the class HitPoints
It works similar to params. (The value index part)
I thought this was pretty clear? #arma3_scripting message
If you're asking about glass hitpoints specifically then I guess find where & how the vanilla code uses NORMAL_GLASS_HITPOINT
I thought to fully understand. And I still believe that I do. But I cant set it into practise atm
It would be respectless if I havent done that already
But I havent found more diffrences as the fact that mine ends the current CfgVehicle class and the sample continues with damage
What's the issue at the moment?
btw this should really be in #arma3_config not scripting.
Ou yeah your right. Im working on both and oversee when crossing this boarder
You need semicolons at the end of these lines
Ouuuuu OF CORSE!!!! YOU EVEN EXPLAINED THAT BI DID IT DIFFRENT... I was so blind hahahaha. Dont take a look about what Ive did with your intel hahahaha
He still is missing a semikolon. Ive removed it in the macro file and added it in the place after Ive used my macro
But in both ways Ive tried it Im receiving errors
|| Ill go buy some stuff before store closes Ill read and anwser EVERYTHING on my return. Thanks previously ||
The first one is closer but shouldn't have the class in front of the line.
You already have class in the macro so it's coming out as class class
compare with BI's version.
This code works in SP but not MP. Is there anything that stands out to you all before I start dissecting it? The helicopter is on the ground with the engine on. After that this code is executed in a holdAction.
[] spawn {
ExtractHeli landAt [ExtractHelipad, "None"]; // lets the heli take off
ExtractHeli flyInHeight 80; // goes to height then moves to base. Doesnt look smooth.
_group = ExtractHeliGroup;
_markerName = "returnToBase";
_waypointPosition = getMarkerPos _markerName;
_wp1 = _group addWaypoint [_waypointPosition, 0];
_wp1 setWaypointType "MOVE";
_group setCurrentWaypoint _wp1; // forces heli to move
sleep 60; // lets heli take off before giving another landing
ExtractHeli landAt [baseHelipad, "Land"]; // if there was no sleep the engine will turn off and heli wont take off.
};
I'll try and remoteExec the landat first even though the wiki says it's a global effect.
Is there a way to forbid player changing the loadout? I want to make dedicated pilot to remain pilot only.
@blissful current What does "MP" mean here?
If it's solo localhost then that's a big difference from DS+client.
This code, as far as I can tell, only works in SP and MP if the action is performed by the local host (correct term? I mean the player that all the other players connect to.). The code will not work on a dedicated server when executed from a client.
The way I found this out was when using two arma games open at once. The code did not work from the client so I alt+tabbed back to the main game and opened the ADT mod, put the code block in there and pressed the green play button. And it worked then.
landAt says it's local argument. So it should be executed where the heli & pilot group are local (should be the same place).
For this sort of code I would strongly recommend running the whole routine locally to the group. Waypoint commands are supposed to be global but they're also a buggy heap of shit.
"global effect" here just means that the helicopter is going to land globally. Which is pretty obvious :P
What is strange is that I have a similar hold action with landAt that does work on dedicated server. The only major difference is that the one that works is attached to player and the one that doesn't is attached to the heli.
What does this mean running the whole routine locally to the group.?
You turn it into a function and remoteExec that instead.
Oh nice, I know how to do that. Why does that make this work again? I don't grasp that.
I'm not sure what you're not grasping.
Maybe its this bit.
"local argument" means that the command should be executed where the argument (in this case the helicopter) is local.
The helicopter is owned by the server because an AI is flying it right? So that means the code must be executed on the server?
No :P
AIs can have any locality. Depends how you create them and what you do with then. Same with vehicles.
If the heli and the group are mission objects and you haven't messed with them since then they'll be server-local.
Yeah pretty much. I just plop them down and then a hold action tells it to fly to a LZ. then another holdAction tells it to land. And then another holdaction tells it to fly off (this is the one that doesnt work on dedicated server.)
But the fact that the first two actions work but the third hits a locality issue is whats throwing me now.
Why is that?
It's not necessarily a locality issue.
Then why should I remoteExec the code again?
well, or not an absolute one. Sometimes it's timing.
You should remoteExec the code because the wiki says that it's local argument :P
That does not mean that it actually is local argument.
I'm so confused, lol. It is or it isn't, why is there an in between?
if you remoteExec it and now it works, then it was a locality issue and the wiki is correct.
If you remoteExec the code and it still doesn't work, then there may be another problem.
But my money would be on the wiki being correct and it's a locality issue.
Arma itself has grey areas. For example setMass does have short term effect even with a non-local argument.
Ok I just swapped it over to a function. Time to test.
And yes, sometimes wiki is wrong :P
Oh wait there is a lot of commands in that block. So what is faster just remoteExec the whole block, though I wonder if that will break some of the commands or slowly just remoteExec one command at a time until it works?
I said make a function out of your entire paste and the remoteExec that.
Okay that's what I've done. Ill try now.
Messing around with moveInTurret, moveOut and lockTurret and I'm running into two issues with my script. Basically, I have two commander seats, because I want the commander to have a camera they can use while turned in, then a pintle MG while turned out, both independently. My script first unlocks the other seat, moves the commander to it, then locks his original seat, and vice versa. Now, I have to bugs that pop up.
-
After running the script once, the driver can no longer use their vanilla turnout feature. Does having any locked seat stop all seats from turning out or is there something else?
-
In singleplayer my script works fine, but on multiplayer with latency, I often have the problem that it kicks the player out of the vehicle, and ends up locking both seats so the commander cannot get back in. Any ideas how to solve this?
My script for reference
params ["_vehicle", "_caller"];
if (_caller == (_vehicle turretUnit [0, 0])) then { // Commander going from CITV to MG
_vehicle lockTurret [[0, 1], false];
moveOut _caller;
_caller moveInTurret [_vehicle, [0, 1]];
_vehicle lockTurret [[0, 0], true];
_vehicle animateSource ["commander_hatch", 1];
} else { // Commander going from MG to CITV
_vehicle animateSource ["commander_hatch", 0];
_vehicle lockTurret [[0, 0], false];
moveOut _caller;
_caller moveInTurret [_vehicle, [0, 0]];
_vehicle lockTurret [[0, 1], true];
};
Looks like that did the trick! So in summary if a command says LA then the code must be ran on the same machine that the object belongs to?
if I have an array say _testarray with 11 elements inside it, can I call it later down a loop as
_x params ["_elemen1", "_element2" ...]?
Yes.
What's _x?
_allGpsTrackers pushBack [_deviceId, _netId, _trackerName, _trackingTime, _updateFrequency, _customMarker, _linkedComputers, _availableToFutureLaptops, ["Untracked", 0, ""], _allowRetracking, _lastPingTimer, _powerCost, _trackerUID];
and later down the code, Ill be using a forEach _allGpsTrackers - How do I assign these values to another variable (using params) instead of _x select 0 through 12 for the above array?
_x params ["_deviceId", "_netId", ...]; is correct.
How would I set the params for the ["Untracked", 0, ""] ?
You'd need a second params line for that one.
Assing it to a variable and run another params to it?
yes
ah great thanks
Another question: What is the best way to find out a specific object (lets say has a variable assigned to it as "PEPE_tracker") in the inventories of allUnits, vehicles, and even ground?
Like I have an object that has been assigned a variable with _object setVariable ["PEPE_tracker", "TRACKER_ACTIVE", true]; - I want to essentially get the position of the object regardless of where it is (in the inventory of a player / ai unit / vehicle / in the ground)
Like I have ACE_Banana that can be picked up by players from the ground and this "banana" then produces a marker on the map wherever it is.
Usually you can just place the banna from the empty tab of 3DEN Editor / Zeus and assign variables / values to it.
I think the way that works is that it creates a ground weapon holder to put the item in.
So you'd be setting the variable on the weapon holder object, and as soon as the banana is moved it'll no longer be relevant.
So whats the best way to pursue this?
You want to follow a banana around, specifically?
Yea - not all bananas, just a select specific one
Is this a mod or a mission?
A mod, but does it make a difference?
Because the "normal" way is to create a different banana item, but that's only possible in a mod.
Hence ACE adds like 10000 different dogtag items.
TFAR adds 1000 of each radio and so on.
Well, what I'm essentially trying to do is add a 'gps tracker' to an object that can be picked up and moved to different inventories will still broadcasting its position in the map.
Even with a unique item there's no easy way, but at least you can grind through inventories and find the thing if you really need to.
If you actually wanted to track the thing then there's an awful lot of event handlers involved, and I'm not sure that covers everything.
My initial idea was to give it a variable and then go through allUnits, vehicles and ``allMissionObjects` to check if any of the objects within the inventories have the variable that was tagged earlier and broadcast its host position - Don't know if this is feasible in sense.
No, because items aren't objects.
Yea figures based on the info you gave earlier - what do you recommend I read through then
So you could try to track the movement of the item with the Take event handler.
I'm not 100% sure whether that's possible though.
unique item is a pre-requisite anyway.
So you should clone the banana class.
While I understand the logic behind unique item, can't we just use the Take EH and process the stuff there on existing class? Like, when the item is taken compare its variables with that of the tag earlier and if so broadcast the position of the _unit?
As long as you know there are absolutely no other bananas in circulation.
There is no way to distinguish between two items with the same classname in the same container.
Ah
would it be feasible for you to script it without relying on an item? i.e. an object with a "pick up" action that deletes itself and tells the client/server to track it on that player object until they use another action to drop it
i imagine that'd give you greater control over how that tracker is transferred around, but it wouldn't exist as an in-engine item anymore
I was exactly thinking on the line - hide the object texture all together when the player picks it up and attach it to the player / vehicle. Give it few more add actions to transfer it seemelessly.
I have this code:
player addEventHandler ["FiredMan" ...
It breaks under a specific circumstance. In SP when you press U to switch to another unit. In that situation the EH is not monitoring the unit you switched to. I guess player doesn't get swapped on the fly to the unit the player is controlling.
What would be a solution to this? Maybe units playerGroup addEventHandler though I'm not sure if that syntax works.
Because you're adding the event handler to whatever unit player is at the time when that code runs
Easiest way would probably be a class event handler if you're using CBA
Ah that makes sense. I suppose this issue is a very edge case scenario. I suppose I could ignore it but I'd rather not.
What is a class event handler?
Cba thing, essentially just lets you easily add an event handler to an entire class / children of that class
So you could add the event handler to all units and just exit if they're not a / the local player
https://cbateam.github.io/CBA_A3/docs/files/xeh/fnc_addClassEventHandler-sqf.html
So it adds the EH to all units in the group, even AI, so when your press U it will have it?
It would add it to all units period, but you can just filter stuff in the EH itself
I don't know what you mean by pressing U
But if it only matters for units in the player's group (and no unit leaves/joins it) you could just add the eh to all of them specifically
Oh interesting, you know how when you are testing your misssion in the editor you can press U and switch to another unit?
I assumed this works in SP too but now I'm wondering if it's just editor behavior.
Oh that, you said it like it was something with the event handler itself
Yeah just tested it. It is indeed normal function in SP as well.
I have the same issue with addActions where if you switch to an AI unit it wont have the action. Do you know of a CBA command that fixes that too?
There isn't, or at least nothing like that
There is an event you can hook into that fires whenever you control a new unit
https://cbateam.github.io/CBA_A3/docs/files/events/fnc_addPlayerEventHandler-sqf.html
Specifically the "unit" one
Oh interesting. Maybe that's what I should use for the other issue too.
You'll want to set a variable on the new unit when you add the action and/or event handler, and exit if it's already set
It fires on every unit change, not just the first time you change to that unit
The flaw here is "compare its variables"
Items have no variables. There are no variables to compare.
I have done GPS trackers as item. But I didn't have any data to store on them.
I made the tracker item a ACE-Attachable item, like a explosive or chemlight.
You can walk to vehicle and attach it on, and you can detach it again. You can attach it to your own body, and detach it again.
This makes it easy because attach/detach is just two eventhandlers, that I also know will work reliably.
But while its detached and in inventory, it doesn't do any GPS tracking. And every time its attached its essentially a new tracker created, it has no history of its past like having an own name or deviceID.
I figured as much, so there is no definitive way in the current implementation we can pull this off unless as John suggested earlier, create unique class names purpose built for this functionality and use it to broadcast network. What I initially assumed is the EH able to distinguish between different items of the same classname in the container.
i have this on a object attaching to another object but when i start the scenario it spawns it a diffrent rotation how do i rotate it so it spawns the right way when its spawned {usa_flag attachTo [usa_hunter, [1.6, -2, 0]]; usa_flag setVectorDirAndUp [vectorDir usa_hunter, vectorUp usa_hunter]; this setObjectScale 0.4;}
Let's ignore your username for now.
After an object is attached to another object, the attached object's orientation becomes relative to the parent object. So when you do vectorDir usa_hunter, you're getting the absolute (world) orientation of the parent object, and then applying it to usa_flag...which is now operating in the relative coordinate space of usa_hunter.
This applies to vectors too, but it's easier to understand with bearings: you're getting the parent object's true compass direction (e.g. heading 250) and then using it in a context where "north" is the direction the parent object is facing. So the parent is facing world 250 -> world 250 is relative 0 -> orient the attached object to relative 250 -> the attached object is facing world 140
umm did he just post that in arma3_editer
yeah i didnt know which channel fit best with my question so i posted it in both mb
ye
roger
i think Nikko and me was saying the same thing: but of course he's way better then me: and i mean way way better ๐ he showed me alot about Arma 3 scripting he's Awsome
i like it when he gives me hell: for messing up scripts and stuff: cuz he makes me understand what i'm trying to do: which is really cool of him
Oh thanks Scotty, I have my helicopter working now but send me a link and I'll add it to my "To play" list.
i would like to PM it to you m8
You may do that, thanks.
how do i do that if we are not friends
Click my name on discord, it will open a box, place the message in the field at the bottom.
oh i see cool
ok im pbo-ing it now ok m8
@blissful current thx you for giving me the opportunity to show case my INSEX Chopper Command Demo mission
there may be many things you can learn from that mission ok m8
full briefing is in there and also added some tasks to help you learn how to use the chopper
i just love it: and i have a feeling you will also
btw INS= Insertion and EX= Extration ๐
i can't w8 till you play it and tell if you liked it ๐
i played the mission like 50 times in a row lol ๐
oh btw the Chopper Command includes all water Insertion and water Extration also ๐ just make sure you have Diver gear on lol ๐ if you go to water
No worries. I'll let you know when I get around to it.
ok cool m8 thx so much: oh hay @blissful current you may want to disable all mods to play the mission at 1st cuz if you have CBA's on you may have to alter the EH's in the scripts im not sure about that
Is it okay to use the deleteVehicle command on an object that has already been removed by that method?
yeah it just wont do anything
if it gone its gone the deleteVehicle command just wont do anything after that
iirc
yep, it resets the variable to objNull, and deleteVehicle objNull does not raise an error.
you can check if isNull _veh to avoid unnecessary calculations, too
Is this more performant,
if (!isNull _veh) then {deleteVehicle _veh};
than this?
deleteVehicle _veh;
nope, but if you have more calculations before that then yes ๐
if you just "don't know and try", straight use deleteVehicle
Okay, thanks!
Hello,
Is there a way to detect when a scripted eventhandler is used?
first answer popping to my mind is: "why?"
he means Scripted Event Handlers, as opposed to (Engine) Event Handlers
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers
oh i see
then i think there must be away to detect if a scripted eventhandler is used
Just read one of those functions and find out. There will be a storage variable in there somewhere.
General rule when talking about BIS_fnc stuff. Some of them are a hard read though.
thats a roger
well, i do not know.
Maybe i just wanted to be sure is that called or not.
But seems i just fucked up code and got scripted event working.
maybe.
Trying figure out vn (SOG) events, that is called and you can define "own" setups for those, but didnt find any wiki/ examples how to use those.
And i do not know how to debug/ follow/ see, is those defined, called, used.
wiki.sogpf.com is their wiki, but IDK if they have any info there
no luck with search
Yeap, same result here
Mm,
Local ? Right, if I add
[true, "vn_photoCamera_pictureTaken", {
params ["_cursorTarget"];
private _target = cursorTarget;
if(player distance _target < 50 && _target == target1) then {
if(!(getText (configOf cursorObject >> "displayName") isEqualTo "")) then { hint format ["Photographed Object: %1", getText (configOf cursorObject >> "displayName")];};
TAG_your_task_condition = true;
publicVariable "TAG_your_task_condition";
};
}] call BIS_fnc_addScriptedEventHandler;
So I need to define where the event is called,
Like in initLocalPlayer.sqf
man i wish i could help you @stable dune
cuz you helped me so many times
oh i see what your trying to do there hmmm
well kinda anyway ๐
Well, I get my task completed when I take a picture from the correct "target",
But I don't know where I need to define eventhandler.
I have a trigger with the condition "TAG_your_task_condition",
Which is synced with the task completed,
It gets completed, but just for knowing, I want to know, do I need to publish a variable global or not.
wouldnt you define the eventhandler by missionNameSpace, or em i being nutty ?
Boolean will default to missionNamespace
oh ok
Never worked with trigger and task sync, but provided trigger is not server only then task framework should complete task inluding other players over network
i tried adding more loot variety (mod) and seeing how to reduce the spawn rate, but i managed to get only dlc weapons to spawn and what did appear couldnt be picked up. can anyone help me?
If I used the command deleteVehicle on an object that was hidden with the hide module, will it still delete it?
yes, its only hided.
Does the hide module affect performance? If the group is hidden, then the AI logic is not functioning right?
Hidemodule hides the object and disabled simulation of objects,
So yes.
lol i just made a Depth Charge Ship it drops Depth Charges to any Depth on a submerged sub ๐ 4 of them to be correct ๐ just make sure you don't back up the boat when you drop the charges lol
I have some tasks that are created at the same time. So as to not overload the player at once, the triggers that create them are separated by 3 seconds. In testing, sometimes it works flawlessly and other times the messages overlap on the UI.
I assume this happens because there are other processes running at the same time so they get queued up differently. Is there a way to make this more consistent?
you need to put a delay trigger in betwene them look at my Chopper comand mission for examples
separated how so, like you have the trigger intervals set to e.g. 3, 6, and 9?
i have a 10 sec delay trigger at each task
Exactly so.
To clarify not the random interval for the trigger. I have 3 triggers for 3 tasks separated by 3 seconds each.
In this quick tip I'm showing you how you can link or chain tasks in the Arma 3 Eden editor, to build storylines in your custom missions.
Disclaimer: I'm not an expert in Eden Editor, nor am I very proficient in scripting. I present methods and workarounds learned through trial and error, and from reading the community forums. I don't claim th...
need a bit more than 3 seconds
All scheduled scripts are subject to management by the scheduler, so yes there can be inconsistencies in the length of sleeps and other exact timings. Usually it's not noticeably very bad unless there's a lot of scheduled scripts running and eating up frametime, though.
essentially the reason that happens is because periods with different lengths will eventually overlap with each other: py Time Interval 3 6 9 12 15 18 3 | | | | | | 6 | | | 9 | | if the game time is at 18s, all triggers would (in theory) evaluate their conditions at the same time, causing them to run their bodies simultaneously if they happen to be true - ignoring slight offsets that happen over time as per nikko's explanation
in that video he shows how to have a delay trigger at each task
its very simple
@blissful current or you can open up my mission and see how i did this very thing
3 seconds does seem a little short to display and clear a notification, though. PiG13BR might be right that you just need to increase the separation a bit.
This almost makes sense to me. So I have 3 triggers set to fire 3 seconds from each other. They all resolve at the same time but then have a sleep to actually do activation code, create synced tasks, etc.
I don't get the overlap though.
yeah the tasks do pile up on eachother if you dont have a dely trigger on them
If you actually read the messages, you'll find that there is a delay between the tasks being added, and the question is simply about the consistency of the length of the delay
like it will show next task and then show task completed if you dont have a dely trigger on them
Right now it displays a finished task, the notification exits, three seconds passes, new notification, etc.
I was worried that 5 might be too long for some attention spans, haha.
i did read that sir but iv found it to work bady even tho you have delys in the task them selfs, iv found delay triggers work way better
And perhaps this is way too much attention to detail anyway. I find that most players don't care for little things like this that I do.
If you want to manage the timings a bit easier, you could put all this stuff into a single script thread with sleep between stages, instead of trying to align a bunch of different triggers
true that
I recommend that too
and you are right @blissful current most people dont care about tasks iv found
but some like tasks
@blissful current
From a scenario of mine
sleep 7;
task00_completed = true;
sleep 5;
task01_create = true;
Ok, so that is using commands to create the tasks instead of triggers synced to modules in the editor correct?
but you only have 3 tasks it should be ok
Yes.
You can still use modules for some parts if you find it convenient; it's all the same tasks in the same system. You can also use Game Logic modules, markers, etc. to reference from if you want to have something you can position in 3D in the Editor.
This and the video you posted is what I am already doing. My question is about consistency between delays if that makes sense.
or just make variables and use triggers to check it, like in my example above
@blissful current so you are using delay triggers cool just make them like 6 or 7 or 10 sec like this 10 10 10
Oh ok I see. So that is more consistent because it's all run (excuse improper wording) in the scheduler at once, whereas my method it could fluctuate more?
Hmm, let's say I tell you to clap your hands every 3 seconds, I'll clap every 6 seconds, and we start our stopwatches at the same time. When your stopwatch says 0:03, you clap hands once, and when it says 0:06, you clap your hands again. But because my stopwatch also says 0:06, I clap as well, so we both end up clapping our hands at the same time.
It's the same phenomenon here, all your triggers start counting their intervals at game start, so they naturally overlap with each other at multiples of 6 or 9.
(this explanation is just to understand the theory of why it happens with trigger intervals)
I think you do not need to overthink this, just try a longer sleep
ever since i started using delay triggers at 10 10 10 sec dely everything worked perfectly
Oh I got it. Default interval is .5 sec I think. That's what these are. Not multiples of 3. The threes I mentioned are after the trigger resolves then you wait 3 then trigger fires. It's basically a delay even though it fired.
ah i see, in that case it's not periodic like i described, but simply the order in which the triggers are satisfied
I don't want to make players wait around too long. I will first try the 5-second recommendation.
10 sec is way short m8
Thanks everyone, I now have multiple avenues to tackle this.
think about this: they are receiving information about a task, so it takes long for them to "listen/read" and get that information into their brain ๐
again if you open up my mission i gave you you will see all of this done
I already have it done. I just need to adjust the timings. I don't need to open your mission to do that.
No matter the delay, at most they only have as long as the notification displays for, which I don't think is user-controllable
copy that m8
yes, about 5-7 seconds is enough
or you can make your own notification: 3 tasks available and the short description below ๐
i like 10 sec cuz theres just a little pase like befor next task
Which is why I'd rather them bang off in orderly fashion. Afterwards, players can check the journal.
roger that
i reason i like the 10 sec delay is cuz its like the task is kinda like coming from HQ ๐
yeah hahah
lol
I'm kinda on the fence about task notifications anyways. I'm not sure how I feel about them. Half of me says just create all tasks at mission start and be done with it. That way no bothersome pop ups. But I'm afraid that might be info overload for players.
alternative: https://community.bistudio.com/wiki/Arma_3:_Notification make your own notification about the 3 tasks ahead and disable those from the tasks
yeah i get that: i realy dont use any task in any of my missions i just put them in that mission i gave you for any one to get help on how to play the mission
i really just use map links and markers
Well, it depends on the task.
If they have to be done in a certain order, then you should probably gate them appropriately. If they rely on information that isn't revealed until later, also.
If you want players to see them all and make their own choice about what to do, then showing them at the start is fine; if it's right at the start without triggers then they'll also appear in the briefing phase if you have one, which can be useful for player planning.
and in most of my missions you can attack any obj in any order you want
but like Nikko said it may depend on intel and stuff
I do already have the full diary there (signal, execution, etc). There should be no confusion as to what to do but in play testing I've noticed some don't bother to read it.
yeah thats true
that blue tag looks good on you, about time
so after a single condition, all three tasks should be accessible? in this case i'd probably do what pig said too, maybe paired with a sideChat message to help clarify it, e.g. "You've received three new tasks to complete! Check your map journal for details."
its good that it still there tho for people that want to know
Is the blue for veteran or CDLC? The colors are so close.
There's not really anything you can do to force people to read if they don't want to. Some people won't read notifications either.
Best you can do is keep things as simple as possible.
vet like military veteran or veteran discord or?
I've always wondered what that tag meant.
Cool either way! What are the requirements?
I don't actually know.
I think it's like "been here a while and appears knowledgeable" but the conditions aren't super clear to me.
Haha well it's well deserved anyways.
valan said you can become a vet in like 3 years if
I didn't do anything specific to get it, it just happened, so ๐คท
its if you go out of your way to help all the people for Arma and all that kinda stuff ๐
valan said i'm doing ok with that and i should keep up the good work
so i em
i just like helping people if i can thats all
well @hallow mortar i think your a Awsome person: and i like you: so good going m8
you helped me like 10,000 times thx so much NikkoJT
you get blue from other blues/greens/orange, the purp himself ๐
hay i play the blues on guitar does tha count ๐
What I'm hearing is that it's contagious
green is my fav collor
green is the same as the 2ed note in music or the dorian mode ๐
quick fun fact: the collors of the notes of the muical scale is the same collors of the rainbow: but not the same order
got some pretty old code in here. your loot array is what is going to contain all your classes. consider using itemtype instead of vehicleclass when searching through the config
Do you still have this code? Curious to see the difference between your implementation vs what I have so far. Thanks 
is there a code that I could use so that when I use a hold action on the table, the holo on the table disappears? Ive never done much scripting so I have almost no knowledge of the formatting or what all the codes do
depends if that table has some sort of hidable texture or something to that nature
i based it on a tutorial from a few years ago, how weapons work, and i thought i would be able to make more variety appear, but it didn't work out that way
how could i make mod weapons appear instead of dlc weapons and make them appear in smaller quantities?
if you want modded weapons only, you'll have to add an additional filter after grabbing all the weapons to filter out ones that don't have that mod's tag in the classname. Like filtering for "CUP_"
one by one?
type "CUP_AK-109","CUP_HK-471", etc...?
private _filteredForCUPClasses = _weaponClassArray select { _x regexMatch "/^CUP/i" };
or whatever string comparison you want to do.
you can also do this at the config level when you are grabbing them in the first place
where would that line go? i didnt quite understand
if (!hasInterface) exitWith {};
[{!isNull player}, {
private _action = [
"ROOT_AttachGPSTracker_Object",
"Attach GPS Tracker",
"",
{
params ["_target", "_player", "_params"];
if (isNull _target || {_target == _player}) exitWith {
["Cannot attach GPS Tracker!", 2] call ace_common_fnc_displayTextStructured;
};
[
5,
[_target, _player],
{
params ["_args"];
_args params ["_target", "_player"];
[_target, _player] call ROOT_fnc_aceAttachGPSTrackerObject;
},
{},
format ["Attaching GPS Tracker to %1 --", getText (configOf _target >> "displayName")],
{
params ["_args"];
_args params ["_target", "_player"];
!isNull _target && {alive _player}
},
["isNotInside"]
] call ace_common_fnc_progressBar;
},
{true}
] call ace_interact_menu_fnc_createAction;
["All", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;
}, []] call CBA_fnc_waitUntilAndExecute;
Why is that even with postInt = 1 this is not properly executed? I had to re-execute it in game via debug console to get the ACE Interaction Menu
Did you set it to postInt = 1 or postInit = 1?
postInit = 1;
try it with the cba preInit.sqf or postInit.sqf
Also need ace_interact_menu in your requiredAddons, otherwise the function isn't guarenteed to be defined by the time your script executes
Works when I use XEH_postInit.sqf
I'll add in the ace_interact_menu too just in case thanks ๐๐ป
Off topic to the above, is there a way to attach a sound to a moving object so it keeps broadcasting at its current location?
What's the command to despawn a whole group of units and any vehicles they're in? I have a bunch of APCs I'm using for a set piece as you fly by, and once the helicopter lands on a trigger, I want to despawn them. Using deleteGroup doesn't work at all, and using deleteunit only deleted the squad leader, not the whole group or the vehicle
{
deleteVehicle _x;
} forEach crew _vehicle;```?
You can use forEach, but deleteVehicle now accepts arrays directly
e.g. deleteVehicle (crew _vehicle pushback _vehicle);
deleteGroup doesn't work because it's for deleting a group data type. In Arma, a Group is an actual entity type, not just a list of units. deleteGroup is for deleting that entity, not the units in it.
Create a sound source and attach it to the object
Or even attach a return from say3D if you don't want / need a looping sound
I looked at playSound3D but its position is constant - Is say3D as effective/loud as ps3D?
Ah OK, so I'd write it like
deleteVehicle (crew bobcat1 pushback bobcat1);
Where bobcat 1 is the name of the group containing the vehicle? Or does that have to be the variable name for the specific vehicle?
Same thing mostly, main difference is that it's local effect and use CfgSounds class names instead of a direct file path
No, the example I gave was structured for if you have the vehicle reference. It gets the array of the vehicle's crew, and then adds the vehicle itself to the array as well. If you're working from the group reference you should do it a little differently.
If you're using CBA, you can use CBA_fnc_globalSay3D which handles the networking for you, and has the option to attach the sound already
https://github.com/CBATeam/CBA_A3/blob/master/addons/network/fnc_globalSay3D.sqf
For example, you could do (units _group pushback vehicle leader _group) (get the list of units in the group, and add the vehicle the leader is in to the list)
The important thing is that you give deleteVehicle an array of objects to delete. How you build that array depends mostly on what reference point you're starting from, and what you want to delete.
Yea but it does not return the sound source in case the audio has to be deleted. I'll probably end up using say3D.
The objects will still be different on each machine
One thing to watch out for with say3D is that any object can only be say3Ding one sound at a time. If you start a new one before the previous sound is done, it'll be queued to play once it's finished. So if you could have overlapping sounds, you might want to create a proxy object for each one.
And just for reference I replace _group, underscore included with the variable name of the group I want to delete?
Ill remoteExec a function to synchronize between all machines with the added timer to delete the sound source locally on each machine based on a pre determined parameter.
Or do you think this approach is terrible ๐
Could be the Editor-defined variable name, or any other reference to the group.
Because I'm getting a pop-up saying On Activation: deletevehicle: Type Number, expected Array,Object when I gave it deleteVehicle (units bobcat1 pushback vehicle leader bobcat1);
Not at all, I've done the same thing when doing the same effect
You've done nothing wrong, I'm stupid
Like Niko said, I also used a dummy object to play the sound from so that it didn't conflict with anything else that play a sound from the player
Invisible helipad attached to the source which is then being used as a source itself?
pushback doesn't return the resulting array, it returns the index at which the new entry was added to the array.
Try (units bobcat1 + [vehicle leader bobcat1]) - get the list of units in the group, create a new array containing the leader's vehicle, merge the arrays and return the result
Should work, I'd probably use a different generic dummy object on the off chance that a helipad would try and make AI "see" it
Can't think of a class off the top of my head though
If you did want to use pushback (handy tool to familiarise yourself with but not essential for this), it could look like this:
private _units = units bobcat1;
_units pushback vehicle leader bobcat1;
deleteVehicle _units;```
This is because `pushback` modifies the original array and does not return a reference to it, so you have to have already stored a reference to the array so you can then use it.
Yep! That worked, thank you!
You could use one of the helper objects like #particlesource and just not set any of its special properties
I want to know how to do a couple of checks in a clump of script I'm working on.
How can I check if certain inventory slot are occupied? Like, "Does this guy have a hat? Does he have a vest? Does he have a backpack?" I don't care what classname, I just need to know if he's wearing anything in that slot.
if (hat) {do thing}
if (backpack) {do thing}
etc
For context, this script will skip certain inventory randomization if that part of their outfit was already assigned to the unit before the script fires.
headgear _unit == "", backpack _unit == "", etc.
So that checks if the slot is blank?
Yeah e.g. headgear _unit == "" will be true if the unit does not have a helmet equipped
I'm trying to find a list of valid slot names on the wiki.
I think I found it. https://community.bistudio.com/wiki/getSlotItemName
Not quite where I expected to find it but, this list is accurate?
Minus the numbers.
Seems to be
๐
Okay, so it really is just as simple as going "is headgear blank? Yes." No funny getBlahBlahBlahHeadgear commands.
Well headgear is just a command that returns a unit's worn helmet
What I mean to say is somehow I was expecting something more complicated.
But I also don't know what I should have been expecting.
Thank you for the help.
unsure if this is the right spot to ask this, but is there a easier way of creating a ace arsenal? I've been trying to create my units arsenal and going through all the items and slowly picking what we would have is a pain ๐ซ (more so a pain now that we are using Grom Restricted Arsenals to make it so that only certain roles can access certain arsenals)
I do not know it off the top of my head but I know you can run a debug command to get the inventory of every unit in your group and dump it all into a big fat array that can then get exported into an ACE Arsenal.
That's how I started.
Found it!
AllPlayableUnitsItens = [];
{AllPlayableUnitsItens = AllPlayableUnitsItens + [(headgear _x)] + [(goggles _x)] + (assignedItems _x) + (backpackitems _x)+ [(backpack _x)] + (uniformItems _x) + [(uniform _x)] + (vestItems _x) + [(vest _x)] + (magazines _x) + (weapons _x) + (primaryWeaponItems _x)+ (primaryWeaponMagazine _x) + (handgunMagazine _x) + (handgunItems _x) + (secondaryWeaponItems _x) + (secondaryWeaponMagazine _x)} forEach (playableUnits + switchableUnits);
AllPlayableUnitsItens = AllPlayableUnitsItens select {count _x > 0};
AllPlayableUnitsItens = AllPlayableUnitsItens arrayIntersect AllPlayableUnitsItens;
copyToClipboard str AllPlayableUnitsItens;```
Itens
Don't worry about it
What I suggest you do:
- Create your squad of guys like you would have them at mission start, but don't make them playable except the leader.
- Make sure they have at least one of every single item you want players to be able to access in the arsenal later.
- Put them all in a group with yourself as the group leader if you haven't already.
- Run this debug command
- Export the paste output to an arsenal.
Now if you're trying to do something like I'm doing where you have a horrible disorganized gagglefuck of mercenaries with wildly varying levels of competency, the best way to give them a diverse amount of equipment is the hard way. 
is this syntac right for checking if 1 or another trigger have been activated?
triggerActivated task7a_completed || triggerActivated task7b_completed;
many thanks! and based on what you said, I somewhat have a similar thing going on- the goal is create a arsenal for our main 3/4 roles and use Groms Restricted Arsenals to make it so that Junior Operators can only grab the basic shit, while Senior Operators can grab the basic/mid/advanced gear, then Elite Operators and Team Leads can grab the fancy shit + the same shit the JOs and SOs can grab. Fun times XD
Yes.
@light musk altho i use dely triggers on my tasks: and i just use triggerActivated name of prev trigger;
oh yeah ForeWard Or -BackWard -Left Or Right Up Or -Down [ 3, -4, 1.5 ] ๐
anyone know the code to set a soilder insignia to a texture in the init feild i did it before but forgot the code
yeah i forget that as well hmmm
@winter rose hi Lou: is that the same as changing the patch on the shoulder ?
no i guess not
it looks diff tho
im pretty sure u can change it to a texture
yeah but it looks like the insignia is at a lower spot the the shoulder patch
i know but i mean that you can replace the insignia as a texture
or is it all the same thing
oh i see ok
can we change the shoulder patch or is that stuck on thier in the uniform
i think its stuck thats why i wanna use the insignia as a replacment so i can put a flag on it
roger that
im pretty sure last time i done it i used the insignia not 100% sure tho
copy that
i wish we could change the shoulder patch
without making a hole new uniform
i guess thats what mods are for
same here i use no mods
i got it
oh w8 i see some other stuff down at the bottom
this setObjectTextureGlobal [1, "\A3\Data_F\Flags\flag_NATO_CO.paa"];
i see some left shoulder and roght shoulder stuff woohoo
but please, do not use setObjectTextureGlobal in init field, only setObjectTexture
ok
yeah i want to change the shoulder patch: but its way out of my skill level
i think its pretty easy
like i would like to use the "U_I_CombatUniform_shortsleeve" and put a USA flag on the shoulder patch
i think you can make a custom texture and apply it as i did
yeah see thats on the sleve i want it on the shoulder patch
i guess i don't really need to do it i was just wanting to
i think there embeded into the uniform textures
My functions defined in CfgFunctions are detected by the game (they appear in BIS_fnc_functionMeta and BIS_fnc_exportFunctionsToWiki), but the actual function variables (CHX31TAB_fnc_*) never exist at runtime.
isNil "CHX31TAB_fnc_postInit" always returns true even though the config data looks perfectly fine.
Addon Structure
@CHX31_AC_Tablet
โโโ addons
โโโ chx31_ac_tablet.pbo
โโโ config.cpp
โโโ $PBOPREFIX$ โ chx31_ac_tablet
โโโ functions
โ โโโ fn_postInit.sqf
โ โโโ fn_hasTablet.sqf
โ โโโ fn_openOverview.sqf
โ โโโ ...
โโโ ui
โโโ RscOverview.hpp
config.cpp (relevant part)
class CfgPatches {
class chx31_ac_tablet {
name = "AC Tablet Mod";
author = "Dennis | CHX31";
requiredVersion = 2.10;
requiredAddons[] = {"A3_Data_F", "A3_Functions_F", "cba_main"};
units[] = {};
weapons[] = {"chx31_tablet_item"};
};
};
class CfgFunctions {
class CHX31TAB {
tag = "CHX31TAB";
class Core {
file = "functions"; // also tried "\chx31_ac_tablet\functions" (even with /)
class postInit { postInit = 1; };
class registerInArmory {};
class hasTablet {};
class collectThreeLists {};
class openOverview {};
};
};
};
Debug results
isClass (configFile >> "CfgFunctions" >> "CHX31TAB" >> "Core")โ truegetText (configFile >> "CfgFunctions" >> "CHX31TAB" >> "Core" >> "file")โ "functions"getNumber (configFile >> "CfgFunctions" >> "CHX31TAB" >> "Core" >> "postInit" >> "postInit")โ 1fileExists "\chx31_ac_tablet\functions\fn_postInit.sqf"โ true"CHX31TAB_fnc_postInit" call BIS_fnc_functionMetaโ
["functions\fn_postInit.sqf",".sqf",0,false,true,false,"CHX31TAB","Core","postInit"]- Still:
isNil "CHX31TAB_fnc_postInit"โ true - No related errors or warnings in the RPT log.
Has anyone any idea?
so like what happening what's go wrong as you see it ?
can you tell what the problum is or whats not working for you ?
Nothing happens, that's the problem.
postInit is not called, and when I try to call another function via [] call CHX31TAB_fnc_*, nothing happens (no function call, no error message in rpt).
But all debug attempts, as you can see above, look as if everything is where it should be and how it should look, except for the isNil query.
hmmm yeah i see
maybe you need to use spawn
if there is sleeps in the function you would need to use spawn:
Have you looked in the function viewer in the editor (should use ADT)?
Just search postInit and it will tell you if you have a name issue. I personally don't use the tag flag. Could be a naming issue.
Oh, I just noticed something while testing.
It works in the editor, but not in the mission.
It's supposed to be a tab for AirControl (Reaction Forces DLC) where you can see the supply statistics for all cities at a glance.
When I load the mission (in SP), the functions don't work, but when I load it in the editor, everything works.
That just makes it even more confusing for me.
And are these new functions, or are you trying to patch an existing mod with the same names?
completely new
Yes, I think so too,
but how can it be that the functions are compiled and the postinit is executed when I load it in the editor, but not when I load the AirControl mission?
What's in the post init file?
just keybind definition via CBA
#include "\a3\ui_f\hpp\definedikcodes.inc"
diag_log "[CHX31TAB] fn_postInit.sqf gestartet.";
// --- SERVER: Armory-Inject ---
if (isServer) then {
[] spawn CHX31TAB_fnc_registerInArmory;
};
// --- CLIENT: CBA-Keybind registrieren ---
if (hasInterface) then {
[] spawn {
waitUntil { !isNull player && { alive player } };
private _t0 = diag_tickTime;
waitUntil { !isNil "CBA_fnc_addKeybind" || { diag_tickTime - _t0 > 15 } };
if (isNil "CBA_fnc_addKeybind") exitWith {
diag_log "[CHX31TAB] ERROR: CBA_fnc_addKeybind nicht vorhanden. Ist CBA_A3 geladen?";
hintSilent "CHX31TAB: CBA nicht geladen โ Hotkey nicht registriert.";
};
// F9 = 67
["CHX31 AC Tablet", "OPEN_OVERVIEW",
"AC Lagebericht รถffnen",
{
if (isNil "CHX31TAB_fnc_hasTablet") exitWith {
diag_log "[CHX31TAB] ERROR: CHX31TAB_fnc_hasTablet fehlt.";
};
if (!([player] call CHX31TAB_fnc_hasTablet)) exitWith {
hint "Du benรถtigst das CHX31 AC-Tablet.";
};
if (isNil "CHX31TAB_fnc_openOverview") exitWith {
diag_log "[CHX31TAB] ERROR: CHX31TAB_fnc_openOverview fehlt.";
};
[] call CHX31TAB_fnc_openOverview;
},
{},
[67, [false,false,false]]
] call CBA_fnc_addKeybind;
diag_log "[CHX31TAB] Keybind registriert (F9).";
systemChat "[CHX31TAB] Keybind registriert (F9).";
};
};
diag_log "[CHX31TAB] fn_postInit.sqf beendet.";
I'm at work now so debugging on phone is a pain. Can you upload your whole mod to GitHub so we can see everything and look for an issue? I won't be able to really look at it for a while so maybe someone else can deep dive.
To fix the errors, you should remove all usage of CBA commands and replace the keybind registration with native Arma 3 event handling
The cba keybind system is well tested and works fine.
well maybe try with no cba 1st
Using vanilla keybind modding is better if you're making a mod (missions can't use it), but CBA keybinds do work and there should be a way to fix this without removing CBA.
copy that
The advantage of CBA is that it allows you to customize the key bindings with the control settings.
In addition, the largest, most stable, and best-known mods also use CBA for their keybinds (TFAR, ACRE, ACE3).
The interesting thing is:
If the CBA mod is loaded but I am NOT using it in the mod (I removed the content of postInit), then it works.
Only if I leave the postInit as I showed you, then nothing works, i.e., not only does the postInit not work, but no function works at all.
Works for me.
are you in eden editor or in the air control mission?
no wounder i dont use mods ๐
Since 2.06, mods can directly add keybinds to the main Controls settings, where they can be customised just the same as the built-in keybinds. A lot of them still use CBA because for a long time that was the only way, but the native system is better.
https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
But like I said, CBA does still work.
Okay, that makes it really confusing.
Why does it work for you but not for me?
I uploaded exactly what I loaded in ArmA, no differences, no changes.
Which program do you use packing your mod?
just the pbo manager
https://germandayz.gg/filebase/file/77-pbo-manager/
oh shit
that is the one, which once was on armaholic, but since they are down the pbomanager is aviable on other sites (or even was before reuploaded)
Well, you could test pack with some other better program.
hemtt, Mikero Tools, A3 Tools Addon Builder,
many options, every of those are better than pbomanager.
That might cause your issues.
as soon as i saw the Dayz tag i was like oh shit
no it is just one of the sites it was re-uploaded
there are many of them
https://nodezone.net/downloads/file/6-pbo-manager-v1-4-beta/
https://forums.bohemia.net/forums/topic/234846-pbo-manger/
i use it since about 3 years or 4 years
it is also not my first small mod, even not the first using cba elements
but it is the first that makse that problems
dont get me wrong i used to be a mod head but no more Woohoo ๐
and this is the 1st problum you had wow that's good
there must be a simple fix
i bet when you find out whats happening yull say oh shit ๐
I have now tried it with the Addon Builder, but it does not work with the CBA part either.
And you have correct options (include files *.sqf,*.paa etc).
And be sure that your prefix is defined correctly.
And have you tried only with your mod and CBA loaded?
Its in "TacControl" mod, is on GitHub
what are the remoteexec restrictions on public zeus servers?
I have an issue with floating objects when huts burn down in a village. My first idea is to use addMissionEventHandler ["BuildingChanged" and somehow grab the nearby object and deleteVehicle them. Maybe use a marker and delete objects with it. Or grab a center point and return all object x distance away from it. Any thoughts on this?
Most of them are locked down. You'll have to try a few.
If you can do it via event handler then do it that way. You can use the various methods to attempt to grab from within the handler.
Ok cool, I've first been trying to find a way to search for all the huts within a trigger area (so I dont grab the whole map of Cam Lao Nam which is huge), if I'm able to do that then I can forEach add the EH to them.
Currently looking into allObjects .
It could also be a part of the building lod, which you would then have to delete the building. I'm assuming this is a sog building?
I don't understand what you are saying, but yes, this is SOG. I have messed around with the EH some and can get it to correctly tell if the building param _isRuin fires.
Ok, I got this to return the huts in the village:
nearestTerrainObjects [[7809,9098], ["HOUSE"], 80];
Now to try to apply the EH to the big huts where most of the floating objects happen.
are you using MEH?
Gonna try this one: addMissionEventHandler ["BuildingChanged"
this kind of EH you just add to your scenario, you don't "apply it" to an object
or I misunderstood what you said
Where are the floating objects in the houses coming from?
Ah maybe that's why I'm having a hard time getting it to work.
Editor placed objects like lockers, desks, etc.
generally, just by putting in initServer.sqf works
Made some progress. I can get the EH to work, but for some reason, if I add this script to delete nearby objects, then it won't play the hut being destroyed animation or the ruin model. Effectively, it makes the huts look like a static/invincible object. It is deleting all the objects within, however.
addMissionEventHandler ["BuildingChanged", {
params ["_from", "_to", "_isRuin"];
if (_isRuin) then {
private _nearObjs = _from nearObjects 10;
{
deleteVehicle _x; // Delete each nearby object
} forEach _nearObjs;
};
}];
Did you test this EH without your script?
I was going to say that maybe it's getting the hut as well
and trying to deleting it, resulting an odd behaviour
I just tested a simple one by naming an object in the edior chair and doing deleteVehicle on it. Everything works like that. But I cannot do it this way. There are too many objects and some get moved around.
So that means it's getting broken by something that is getting deleted. I logged it here, it must be one of these:
[BuildingChanged] Land_vn_hut_01 destroyed. Nearby objects processed: HouseFly, FxWindLeaf1, FxWindLeaf1, FxWindGrass1, FxWindGrass1, Land_vn_hut_01, Land_vn_stallwater_f, Land_vn_woodenbed_01_f, Land_vn_chest_ep1, Land_vn_helipadempty_f, Land_vn_helipadempty_f, Land_vn_helipadempty_f, Land_vn_helipadempty_f, vn_c_men_05, vn_c_men_10, vn_o_men_vc_13, HouseFly, #mark, #particlesource, #soundonvehicle, WeaponHolderSimulated, #destructioneffects, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #explosion, #crateronvehicle, #destructioneffects, vn_m10_ammo, Land_vn_hut_01_ruin
`
Yes it work fine.
I already tried a script to exclude Land_vn_hut_01_ruin to see if that was it but no.
I systematically excluded items from the previous list and found the culprit to be "#destructioneffects".
hello was wondering how i can undo scripts in multiplayer?
there was a bit of trouble in our server i messed up a script but we're hardstuck on a save and I suspect that its the script that I ran
we use a dedicated server
We tried finding the script executions in the server files though we cant seem to find it
any help?
What script did you run? You cant "undo" a script that ran.
You can run a script to potentially fix it though
dude
what are you trying to do?
what is the problem?
did you check rpt files from the server?
guess alot
not the brightest person
wanted to change the date for a bit of immersion so I changed it to 1987 the problem is its stuck on its date and the time isnt moving forward
everytime we progress and restart the server it looses its progress because the date and time is stuck
did you wape your save?
what? why not? you beign told to do so on kp lib discord
just wipe your save, change the date on your editor first
then pbo the mission
and that's it
because of the progress
its kind of a waste imo
though if thats gonna be the case
we cant even find the save
where did the date shows up? introduction?
you have the option to just remove the intro
mission parameters
as admin
#login as admin
then, #reassign
theres actually no way to save our save huh
you messed up something
let me see the last rpt file
hold up
that your server generated
was it the ofp thing
yeah i dont know why but kp lib is trying to find the opfor thing
yeah it works fine
besides duplicate body bags
Idk what you did, but save your presets
and wipe the mission file
and put the files again
and repack into a new pbo
do i download a new kp lib?
will not hurt your save because your save is on the server profile
if you don't have a local one in your pc already...
yeah the thing is tho i cant find the mission save
we use a game server
correction to my previous message
not dedicated
its game server
wait what were you talking about?
the mission or the profile save
mission folder != save
wipe the mission folder, and get the kp lib files again (0.96.8, if you're playing in this version), just save your presets if you have custom ones
let's see if this solves your issue with saving your game
say3D sucks in terms of volume - I can barely hear it in noise
So an option question would be, whats the best way to achieve a moving sound source thats loud enough? (no need to be strictly syncing across the network as I can create one local for each client required)
playsound3D
but playsound3D does not move with the source though
Doesnt work as I tried it earlier by attaching
There is a volume parameter in CfgSounds, which is where say3D gets some of its information from. You can increase that, to an extent
Apparent volume is quite strongly affected by distance falloff too, so make sure your max distance is high enough
like >=2 times more than the distance you want to hear it at
Ah the volume property is in cfgSounds - I was looking for it in say3D ๐
You can modify it in say3D
Are you sure about that?
Nope
or like Kikko said ```cpp
class CfgSounds
{
sounds[] = {};
class LetsRock
{
name = "LetsRock";
sound[] = {sound\LetsRock.ogg, db+8, 1};//db+8 is the volume level
titles[] = {0, ""};
};
};
hey cuties
i have stink brain, it's probably a simple thing but I figured I'd ask here and see if anyone else knows already
looking to use the leaflet stuff for a horror op, and wondering how I could put linebreaks in the text (just to make a note easier to read)
[myLeaflet, "#(argb,8,8,3)color(1,0,1,1)", "Line1"] call BIS_fnc_initInspectable;
is what I stole from the wiki and barely changed, any help is much appreciated
Usually either \n or <br/> work
best way to play3D sound is to make an addMissionEventHandler```sqf
if (!isServer) exitWith {};
addMissionEventHandler ["EntityKilled", {
params ["_killed", "_killer"];
if ((isPlayer _killer or side group _killer isEqualTo west) &&
(side group _killed) isNotEqualTo west && typeOf _killed == "O_Officer_F") then
{
_randomSound = selectRandom ["LetsRock","ComeGetSome"];
_killer say3D _randomSound;
};
}];
tried that but it doesn't seem to work
I'm wondering how bohemia did it
they use <br/>
oh w8 now see what you mean
but it's in a string so it's <br/>
yeah what POLPOX said should work then
I'm an absolute fool
I wasn't putting the slash in <br/> lmao
aaaa apologies, thanks though
lol ok m8
thanks 
So I've made an interesting but ultimately disappointing discovery regarding the addMissionEventHandler ["BuildingChanged" EH. It turns out there are certain conditions where the game will not recognize that a building has changed.
For example, if I use fire to destroy the building the EH will fire. But if I use a rocket launcher to destroy it, then the EH will not fire.
So I'm not sure how I can detect the building being destroyed anymore, which I need to in order to delete floating objects that occur when the building is destroyed.
It might not fire if the building is fully destroyed, similar to Hit not firing when the unit dies
Just a guess, haven't used it personally
What's fire? :P
I tested BuildingChanged recently with a MAAWS and it worked fine.
Also worked with setDamage
You're not assuming that _isRuin is gonna be true for intermediate states or something?
I'd like to make a rather simple "teleport to marker" system. I thought of comparing the MapSingleClick's _pos value to a specific marker's position but how can I round it to make the detection less pin-pointing? Alternatively how can I check if player is hovering mouse over a marker?
this would actually be the way I guess, thanks
I mean activated when I said fire. I tested without _isRuin to be certain. I can reproduce by using a rocket launcher to shoot the underside of the huts.
There is also a pattern of when the EH does not fire and when it does. If the EH activates then there will result in a ruined model replacing it. If the EH doesn't activate then nothing will be remaining, making the ground look quite absent.
regarding the cursor, I would try to get map Ctrl and get cursor position (but I am not exactly a UI guy so I may be wrong/bruteforcing here)
I can reproduce the EH not activating if I "one shot" it with the rocket launcher from the underside. But I also can shoot it will 1000 bullets from a minigun and though it takes forever, it still won't activate this way even though it plays the "death" animation of the hut.
All this is to say since the EH is very inconsistent, I need to find a new solution since I can't use it.
I can reduce the number of objects so there won't be as many floating ones. Or I thought about using the hide module to hide the editor-placed huts, then place my own huts and make them indestructible. I lose some exciting dynamics, but that's better than ruined immersion from floating objects.
Ok, so, Ik it's your scenario... but do you really require objects inside the buildings? those things can take a lot of performance
Players search for intel in file cabinets and desks and such within the huts. I guess I could place them outside the huts but it would feel weird IMO.
Tell me more about the performance thing. I have 10 of these objects the rest are just set dressing and have simulation diabled becuase even with on they still we're floating.
if it's just a bunch of it for mission purposes, it's fine
what about making those structures invincible?
Or I thought about using the hide module to hide the editor-placed huts, then place my own huts and make them indestructible.
As mentioned above. Yeah might have to do that.
I think it's the best option
you can do that way, or you can put a trigger with a code to find nearby terrain objects and set them as indestructible
Oh wow this sounds way faster. Is it just using allowDamage command?
I think so, need someone to confirm that can actually work for terrain objects
not sure if this might still work, but all objects do have a Map ID, in Operation FLashpoint you were able to work with these ID's like as example enable/disable streetlamps and such. there is a command to localize object map ID's and probably you can make allowDamage and the ID if trigger stuff wont work
btw what's latest ver of vanilla Arma 3 ? any one ?
v2.20
https://dev.arma3.com/
Well, if the building just disappears rather than changing then I guess the EH won't fire?
I haven't seen that effect with any vanilla gear though.
Might be busted config for that particular building.
Check out the vid I PM'd you, it still plays the animation.
It turns into nothing though.
Typical CDLCs fucking everything up :P
Probably intentional.
@blissful current oh thx m8 nice so im up to date cool
just to note, destroyed buildings wont get deleted also after ruin shows up it wont get deleted it just moves down (under surface) and stays there. i did some tests some years ago
https://cdn.discordapp.com/attachments/652355777297907755/1060273619843952661/image.png?ex=68eaab41&is=68e959c1&hm=94571a40bc96b8fd5609bffde3f465c6370a3f3360c7a3d8a32ab354a60ad447&
https://cdn.discordapp.com/attachments/652355777297907755/1060274186880294912/image.png?ex=68eaabc9&is=68e95a49&hm=1861f3d60c250e4cbcf44a2dcaef174079eaff39b3e0cf09a56ef7550def40a9&
{deleteVehicle _x;} forEach (allMissionObjects "Ruins");
I believe that's by design Iirc.
This will delete the ruins not the terrain object hidden underneath
If you setDamage 0 on the building then it'll both bring the original back to the surface and delete the ruin.
Which feels like a lot of features for something that supposedly isn't intended :P
funny part is, if you got a big city and you did ruins of all your city buildings, the lag and fps drop gets duplicated

I forget whether it hides the original building after sliding it underground.
It certainly should
better would be deleted by replacing it with a ruin
map objects can't normally be deleted, only hidden. Not sure if mission object buildings have the same behaviour though.
this vanilla house is placed in 3DEN, its a destructionEffect thing
@tender sable what do you mean the terrain object ?;
do you mean like the base of the house ?
Objects that are part of the terrain, as opposed to objects that are placed in the Editor or created by scripts
For various reasons they work slightly differently
yeah on Strites it seems to delete the terrain object "ruins" with this ```sqf
{deleteVehicle _x;} forEach (allMissionObjects "Ruins");
of course after the house is destroyed 100%
or maybe i just cant see that the house; is under the Z, 0;
like if i destroy all the houses in the city by the bay: on Stratis: with a chopper and i have on a loop ```sqf
{deleteVehicle _x;} forEach (allMissionObjects "Ruins");
or are the houses just under ground like crashdome said
I hope some day someone makes a terrain: that has no houses or buildings on it: So we have to place all the terrain objects: not the veg: but just the house's and buildings: that would be cool
cuz its kind-a funny even if we hide a house or building its really still there: i can see Ai get stuck there sometimes
As stated by others I mean if the object is part of the map. It's fundamentally different to an editor placed object which is a prop. If you are talking about an editor placed object than it's behavior is different.
is there a command that gives center of the map position?
[worldSize / 2, worldSize / 2]
That's just what it's called. Everything in order
It's because it's an object with no model
I found a bug in vanilla, AAF jet pilots spawn without a helmet
Will getMissionDLCs return CDLC too, or just the "normal" DLC used? They list DLC and CDLC separately.
https://community.bistudio.com/wiki/getMissionDLCs
https://community.bistudio.com/wiki/Category:Arma_3:_DLCs_%26_Expansions
https://community.bistudio.com/wiki/Category:Arma_3:_CDLCs
did u try the command in the debug console to see what returns ? 
Totally forgot about the debug console! Also, it seems that it does; it returns 'VN' when I test it with Prairie Fire.
Does Arma have simple 'Yes/No' popup with callbacks to reuse? ๐ค
I really don't feel like creating another GUI just for that
3denMessage works too and is a bit more flexible
does it work in scenario?
Yes
Hi
Quick question : I'm setting up a countdown in my scenario with that code, with a trigger I manually activate
in the trigger :
execVM "countdown.sqf";
in the script :
0 spawn { [1080] call BIS_fnc_countdown; While {[true] call BIS_fnc_countdown} do { hintSilent format ["temps restant : %1 secondes", [0] call BIS_fnc_countdown]; Sleep 1; }; };
Once the player have done their job, I want the countdown to stop (once again, I'll manually trigger it when conditions are satisfied)
I'm using the terminate command but it doesn't work
In a trigger, on activation :
_script = [] execVM "countdown.sqf"; terminate _script;
It doesn't stop. I tried numerous options, like defining a private variable or using _handle but I can't get it to work, can anyone help me please ?
For the way you are doing it, I would ditch the BI countdown function and make your own. It's not difficult.
I don't think I've reached that stage honestly, for now I'm only good at googling sqf scripts and more or less understand what's going on so I can edit it
I'll find another way to reach my goal, maybe ditch the countdown part entirely then
Gonna have to make that jump at some point. You have most of the idea already. You'll need some while do loops and some hints.
