#arma3_scripting
1 messages · Page 172 of 1
hm is there a way to detect if a soldier is speaking?
I have a scripting performance question. Does assigning variable names to objects in editor have an impact on performance (aside from taking up some memory) ?
Not one you can measure
I thought it was possible (within the Conversations system), but it seems not
yeh, there seems to be no return value or anything when a character speaks
kinda wish we'd have an EH for that 😄
https://community.bistudio.com/wiki/BIS_fnc_kbIsSpeaking HAH! Cc @west grove
ah nice.
only problem is -- this is just for the conversation system. it doesn't cover regular commands 😄
So i have this 3den attribute for objects. When enabled, data is loaded on the object which includes a saved position. The function attempts to move the object to that saved position.
It seems that using setPos on an object during 3den attribute init doesnt work.
Does anyone know if it is possible? Im already moving on from this with a different solution, but im am still curious about this.
Sample code below has some test functions, but the first one that is commented is the actual cide.
Depends on what you want to classify as "speaking"
"man, 100m, front" etc
is there a way to insert stringtable instead of WEAPONS ? _description + "<t size='1.2' color='#D9D98C'>WEAPONS</t><br />";
format ["...", localize "STR_someStringtable"];
I am trying to replicate via script how the game sets the damaged material on damaged vehicles (not destroyed) but I haven't been successful so far:
_vehicle addMPEventHandler ["MPHit", {
params ["_unit", "_causedBy", "_damage", "_instigator"];
private _engineDam = 0;
private _bodyDam = 0;
private _finalVehDam = 0;
_engineDam = _unit getHitPointDamage "hitEngine";
_bodyDam = _unit getHitPointDamage "hitbody";
_finalVehDam = _engineDam + _bodyDam;
if (_finalVehDam > 0.49) then {
_unit setObjectMaterial [0,"A3\soft_F\Offroad_01\Data\Offroad_01_ext_damage.rvmat"];
} else {
_unit setObjectMaterial [0, "#reset"];
};
}]; ```
It is for a modded vehicle (offroad) which doesn't have a damage material configured and I don't want to mess with the PBO
Dose the material gets apply if you force apply material on object ?
you need to apply the texture as well
like ```this setObjectTexture [-1,"A3\Data_f\Destruct\destruct_rust_mca.paa"];
{this setObjectMaterial [_foreachindex,_x];} foreach [
"A3\armor_f_beta\APC_Tracked_02\Data\APC_Tracked_02_ext_01_destruct.rvmat",
"A3\armor_f_beta\APC_Tracked_02\Data\APC_Tracked_02_ext_02_destruct.rvmat",
"A3\armor_f_beta\apc_tracked_01\data\apc_tracked_01_aa_tower_destruct.rvmat"
];
Thanks, now I need to figure it out when to apply those
funny, i was never driving with a destroyed marshall before
That is working great for a destroyed vehicle like so: sqf _vehicle addEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _unit setObjectTextureGlobal [-1,"A3\Data_f\Destruct\destruct_rust_mca.paa"]; {_unit setObjectMaterialGlobal [_foreachindex,_x];} foreach [ "A3\armor_f_beta\APC_Tracked_02\Data\APC_Tracked_02_ext_01_destruct.rvmat", "A3\armor_f_beta\APC_Tracked_02\Data\APC_Tracked_02_ext_02_destruct.rvmat", "A3\armor_f_beta\apc_tracked_01\data\apc_tracked_01_aa_tower_destruct.rvmat" ]; }];
you need to change the texture and material to whatever else you want
for example damage_metalsheet_mca.paa instead of destruct
and it needs the correct rvmat
It would be cool if we could do shaders and effects something like this:
https://www.youtube.com/watch?v=8kTtNaMojaE
since damage rvmat also has the base vehicle nohq and such in it referenced
Yeah, I can apply the rvmats (materials) just fine... What I haven't been able to replicate is how the game determines when to apply the "damaged" rvmats (materials)
at 0.5 damage or something like that
depends on vehicle config. oftentimes it is the hull hitpoint that matters
I'm clearly missing something _description = _description + format ["<t size='1.2' color='#D9D98C'></t><br />", localize "STR_antistasi_dialogs_crew"] + ((_crew apply { _x#0 }) joinString "<br />") + "<br />";
Yes, a %1 in the first string in the format command
You didn't put the %1 where the text should be
Tried that... damage never goes up when firing bullets or grenades at the vehicle and while the game does apply the damaged material the script doesn't, that is why I've been trying with https://community.bistudio.com/wiki/getHitPointDamage
is hitbody correct?
getAllHitPointsDamage vehicle cursorTarget [["hitlfwheel","hitlf2wheel","hitrfwheel","hitrf2wheel","hitfuel","hitengine","hitbody","hitglass1","hitglass2","hitglass3","hitglass4","hitrglass","hitlglass","hitglass5","hitglass6","hitlbwheel","hitlmwheel","hitrbwheel","hitrmwheel","hithull","#light_l","#light_r","#lightsirenm","#lightsirenlfront","#lightsirenm","#lightsirenl","#lightsirenl2","#lightsirenl3","#lightsirenlfront","#lightsirenlfront","#lightsirenrfront","#lightsirenr","#lightsirenr2","#lightsirenr3","#lightsirenlfront"],["wheel_1_1_steering","wheel_1_2_steering","wheel_2_1_steering","wheel_2_2_steering","","engine","","glass1","glass2","glass3","glass4","","","","","","","","","palivo","light_l","light_r","","","","","","","","","","","","",""],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]] ```
Probably hitHull would be better
Aslo myb instead MPhit use HitPart EH https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HitPart
format ["<t size='1.2' color='#D9D98C'>%1</t><br />", localize "STR_antistasi_dialogs_crew"]?
im digging this gif
before writing a message, I've tried it. Didn't work)
Works fine for me with a vanilla stringtable:
format ["<t size='1.2' color='#D9D98C'>%1</t><br />", localize "STR_b_crew_f0"];
"<t size='1.2' color='#D9D98C'>Crewman</t><br />"
"Didn't work" doesn't tell anyone anything about your issue. What didn't work? Did it not localize properly? did it not appear in the string?
_description = _description + format ["<t size='1.2' color='#D9D98C'>%1</t><br />", localize "STR_antistasi_dialogs_crew"] + ((_crew apply { _x#0 }) joinString "<br />") + "<br />"; yep, it works now, wrote something wrong the first time
Thank you
I have a bunch of scripts for spawning a whiteboard and drawing various things on it. Drawing stuff is done via addAction, remoteExec'd globally. The constituent scripts call each other via call compile preprocessFileLineNumbers. When I used remoteExec instead of preprocessFileLineNumbers, the scripts just didn't work (didn't execute) when I tested on the local multiplayer in 3den. But now the script doesn't work on multiplayer on a dedicated server. Anyone has any ideas what the problem might be? I could dump a zip file of all the scripts here if it is any help. This is the code I'm running on the test character's (z1) init field:
"<t color='#FF0000'>(Trolla fram whiteboard)</t>",
{params ["_target", "_caller", "_actionId", "_arguments_"];
call compile preprocessFileLineNumbers "scripts\whiteboard\spawnWB.sqf";},
z1,
1.5,
false,
true,
"",
"_this isEqualTo z1",
3,
false,
"",
""
];
spawnWB looks like this:
params [
["_target", objNull],
["_caller", objNull],
["_actionId", objNull],
["_arguments", objNull]
];
_pos = getPosAtl _caller;
_wb = "Land_MapBoard_F" createVehicle _pos;
missionNamespace setVariable ["VLRS_" + str _caller + "_wb", _wb];
[_wb,"img\wb\blank.paa",false] call compile preprocessFileLineNumbers "scripts\whiteboard\drawTexture.sqf";
[_wb,_caller] call compile preprocessFileLineNumbers "scripts\whiteboard\initWB.sqf";
[_caller, _actionId] remoteExec ["removeAction", 0];
[
_caller,
[
"<t color='#FF0000'>(Trolla bort whiteboard)</t>",
{params ["_target", "_caller", "_actionId", "_arguments"];
call compile preprocessFileLineNumbers "scripts\whiteboard\despawnWB.sqf";},
nil,
1.5,
false,
true,
"",
"true",
3,
false,
"",
""
]
] remoteExec ["addAction", 0];```
both implimentations work in local mp but not on a dedicated server. On a dedicated server, the action "(trolla fram whiteboard)" just plain does nothing, no error messages, no nothing.
That's because spawnWB.sqf can only be executed on server.
Oh!
Hey peeps what was the right way to execute custom functions/script files for everyone on a server again? iirc remote Exec only takes scripts allowed by its config, or?
Huh I thought remoteExec only took stuff allowed by the config, I shall try it tho
If you exec from server nothing else needed, if you remoteExec from client you need to whitelist via description.ext/mod and cfgRemoteExec
https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec
Hm ok
What I want to do at the moment is
Player clicks a button in a UI
UI starts script on server
server sends remoteExec with custom .sqf files/precompiled functions to players to execute
so I gotta find the right way to go from player to server since then remote Exec should be fine
I'd ver ymuch appreciate help with that sinc I dont have much multiplayer experience 😅
Yup, then you just need to create the two functions, allow the exec from client to server via cfgRemoteExec (server to client doesn't need to be whitelisted).
👍
so remote exec the fnc in the UI and then do the normal isServer check in the fnc so only the server executes it I assume?
On client as example
[_Parameter1,_Parameter2] remoteExecCall ["XYZ_Server_Function", 2]; // 2 will execute only on the server.
On server
[_Parameter1,_Parameter2] remoteExecCall ["XYZ_Client_Function", -2]; // -2 will execute on all clients.
oooh right that exists, ye
Also looking at the wiki article, could I also just make an empty cfgremoteexec setting the whitelist to mode 2 to just ignore the whitelist?
So pretty much like this
class CfgRemoteExec
{
class Functions
{
mode = 2;
jip = 1;
};
};
Would save myself actually defining the functions 😅
although the wiki article does say that mode 2 is default? so wouldnt remoteExec allow everything already anyways?
2 - remote execution is fully allowed, ignoring the whitelist (default, because of backward compatibility)
I think so yea, i only ever did Exile servers, that had the cfgremoteExec inside the mod config.
Ah yeah fair
hm I'll try without it for now and see if it works and report back
if so that'd save me some extra complxity which I'd appreciate since my scripts folder already looks like this 😅
Did try to implement the script i had been given yesterday, thought i did it right, but apparently not.
Its not showing up in chat, the markers do work though.
null=[]spawn {
{ _x setMarkerAlpha 1 } forEach ["SyndicatFlag", "SyndicatArea", "WarlordOne", "WarlordTwo"];
{
if (not alive NATO) exitWith {};
_x params ["_text", "_delay"];
[NATO, _text] remoteExec ["sideChat"];
sleep _delay;
}
forEach
[
["ATLAS, this is NATO Command. Over", 4],
["We got reports telling a revolt has started near a town called Kruger.", 5],
["Support the resistance and help them gain ground in the region. ", 5],
["Your priority is to eliminate a warlord that has been oppressing the local civilians. ", 5],
["We have updated your map with the warlords possible locations and the location of the resistance. Out. ", 5]
];
};
*inside a trigger activated by radio alpha
Does the unit with the variable name NATO have a radio item in their radio slot? It's required for sideChat to work
hmmm, that is a good one
you were completely right, such stupid little mistakes, why i have a love-hate relation with coding
Yeah chat messages only show if you have a radio
I kept getting bug reports on stuff like that with a chat wheel I made
thats when you make a recursive annoying pop up reminding them that they need a radio
I've gpot the vast majority working now 
But any chance anyone here knows why an emitter spawning timeline wouldnt work correctly when being remoteExec'd?
when I call it locally using debug it works just fine, but trying to remote Exec on the server doesnt do anything at all

I've spent 2+ hours trying to fix this and I think the mission hasnt been exporting correctly the entire time, which is why all my changes didnt apply
for some reason the export got borked, file didnt change and timestamp was old too
Yeah I've been repeatedly reuploading and retesting the same mission file for the last 2 hours 
yeah I actually re-exported it now and who'da thunk, stuff actually works
I love arma 3 so much, such a great piece of software
anyone know what this menu on the map is called and how to interact with it?
appreciated o7
hello all,
I'm stuck with a very basic function, I don't found any help in the Discord history or on the Internet.
I'm not able to use the second example in setMarkerColor
https://community.bistudio.com/wiki/setMarkerColor
"MarkerOne" setMarkerColor "#(1,0,0,1)"; // red color - since Arma 3 v2.20
no matter what I try, I've got console error msg, like
Warning Message: No entry 'bin\config.bin/CfgMarkerColors.#(1,0,0,1)'
someone can show me how to use custom color on marker please ?
- it is a command not a function
- it is a upcoming feature in Dev-Branch
haaaaa, thanks a lot, I was pulling my hair !
when I read "since Arma 3 v2.20" I was sure it's already available, thanks again for the info!
Hey folks,
a question to getMissionConfigValues.
How can I define Bools in an Arma config?
Right now I only get a string ("true") back from
getMissionConfigValue "testbool";
At the moment I decline the bool variable like this in the config.cpp:
testBool = true;
Is there a way to get a Bool back from getMissionConfigValue or is it always string and I have to "switch" the type myself?
A config itself does not have a boolean/true etc but you can just value == 1 so it converts it to bool
Or what he said
Okay, got it. Thanks for clarifying
getNumber on "true" also returns 1, but you still shouldn't use a string for boolean flags
hey everyone is there a way to change the drone (Darter) size by scale ?
Did you try setObjectScale?
[] spawn {
while {alive myDrone} do {
myDrone setObjectScale 0.3;
};
};
It's just one of the issues with setObjectScale, it's only really meant for attached / simple objects
You could have a dummy drone that's invisible, and attach a simple object copy of it to the actual drone
(invisible by default not by hideObject)
Ive tried this and still it does not move -
[] spawn {
while {alive myDrone} do {
myDrone setObjectScale 0.3;
};
};
myDrone attachTo [myDrone2, [0,0,0]];
myDrone2-
this hideObject true;
Thank you @still forum Will test tonight.
So there is something interesting going on here.
Line 32: I forgot to add a default value to a getVariable, throwing a syntax error
Code resumes execution??? what? shouldnt it stop execution?
Line 40: Unassigned variable because the line of code that assigns it throws an error an fails
Did code always resume execution after encountering an error?
Yes
- You're attaching the wrong object
- You should just use a simple object for the dummy drone
You could use something like this in the drone's init. This creates a dummy drone model on each player's machine and attaches it to the actual drone. Then hides the original by disabling its textures.
if (!hasInterface) exitWith {};
private _dummy = createSimpleObject [getText (configOf this >> "model"), [0, 0, 0], true];
_dummy attachTo [this];
_dummy setObjectScale 0.3;
{
this setObjectTexture [_forEachIndex, ""];
} forEach (getObjectTextures this);
it didnt changed the size
thank you for trying
if you have another idea
Something Like this might work:
Not tested btw
private _drivableDrone = createVehicle["B_UAV_02_F", player modelToWorld [0,5,0],[],0,"NONE"];
createVehicleCrew _drivableDrone;
private _visualDrone = createVehicle["B_UAV_02_F", player modelToWorld [0,5,1],[],0,"NONE"];
_visualDrone enableSimulationGlobal false;
_visualDrone attachTo [_drivableDrone,[0,0,1]];
_visualDrone setObjectScale 10;
setObjectScale, not setSize
Hello,
Is it possible to enable Dynamic Simulation on triggers? As in, triggers won't be checking until a player comes near the trigger(not into the trigger)
well, the thing is, it says it affects objects, and triggers are considered objects, although on Eden Editor, there's no option to enable Dynamic Simulation on the triggers
Then this is not applicable to triggers.
Or you can try adding triggers to DynSim using script commands.
I believe the object needs to have the can wake flag which triggers don't have. Have you tried it yet?
No.
that's what I'm basically doing, adding the dynamic sim to triggers via script, although I'm just asking here to be clear if it'll work or not, as there's no mention of exceptions, nor suggestions of doing so.
the real issue I have is, I'm using EOS (very outdated, I know, I've been modifying it to fit my needs) and it creates too many triggers it just lags the server eventually, so I'm basically trying to disable far away triggers, and to do that, I really hope it works, otherwise I'll have to rework the trigger system of EOS to be on players instead of the markers
I get an error from it
I wonder if there is a way to quickly remove dead unit from the group instead of waiting for leader to realize that they are dead
killed eventhandler, remove from group.
Define "remove from group"
Do you realize that joining grpNull creates new group?
There seems to be no way to simply remove dead unit from group
Yes, but it will remove the dead unit from the original group. You didn't specify.
Now that you specified, I have no idea.
I did that, the problem is that it creates lots of empty groups, if I move all dead units into single group, it grows and dead units never get removed from it because apparently there is no leader to shout that unit is dead and have them removed
I guess there is no easy way
You could add them into a group that contains a single living unit that isn't on-map to do that for you. Seems messy and a crappy work-around for it.
Well that garbage collecting group had Logic unit as leader
is there a 3den command for syncing two objects?
nvrmnd. I was looking for something3denSync... Answer is add3denConnection
how do I stop arma tools from making a project drive every day
I unmounted and un-did everything in workdrive.exe
but it still remounts and tries to reextract every day I open the computer
I'm trying to make an eden module that will turn anything it's synced to into an intel object, but in the eden module all the boxes and stuff are overlapped, I don't understand where though, I followed the BIS tutorial and some other ones and I still don't understand what's going on. If yall don't want to read the code and inspect it then can I at least get some pointers on what might be causing an issue like this typically?
class CfgPatches {
class NES_Intel {
units[] = {"NES_Module_AceIntel"};
requiredVersion = 1.0;
requiredAddons[] = {
"ace_main",
"ace_interaction",
"ace_intelitems",
"A3_Modules_F"
};
author = "Nes";
version = "1.0.0";
};
};
class CfgFunctions {
class NES_Intel {
tag = "NES_Intel";
class Functions {
file = "\nes_intel\functions";
class moduleAceIntel {};
class addIntelAction {};
};
};
};
class NO_CATEGORY;
class CfgFactionClasses {
class NES_Intel_Category: NO_CATEGORY {
displayName = "NES Intel";
};
};
class CfgVehicles {
class Logic;
class Module_F: Logic {
class AttributesBase {
class Default;
class Edit;
class EditMulti;
class Combo;
class Checkbox;
class ModuleDescription;
};
class ModuleDescription;
};
class NES_Module_AceIntel: Module_F {
scope = 2;
displayName = "Add ACE Intel";
icon = "\A3\modules_f\data\iconTaskCreate_ca.paa";
category = "NES_Intel_Category";
function = "NES_Intel_fnc_moduleAceIntel";
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
isDisposable = 1;
class Attributes: AttributesBase {
class IntelTitle: Edit {
property = "NES_Intel_Title";
displayName = "Intel Title";
tooltip = "Title of the intel item";
defaultValue = """Intel""";
};
class IntelContent: EditMulti {
property = "NES_Intel_Content";
displayName = "Intel Content";
tooltip = "Content of the intel item";
defaultValue = """Intel content here""";
rows = 8;
columns = 50;
};
class IntelImage: Edit {
property = "NES_Intel_Image";
displayName = "Image Path";
tooltip = "Path to image file (optional)";
defaultValue = """""";
};
class ActionText: Edit {
property = "NES_Intel_ActionText";
displayName = "Action Text";
tooltip = "Text shown in ACE interaction menu";
defaultValue = """Collect Intel""";
};
class DeleteAfterCollection: Checkbox {
property = "NES_Intel_DeleteObject";
displayName = "Delete After Collection";
tooltip = "Delete the object after intel is collected";
defaultValue = 1;
};
class ModuleDescription: ModuleDescription {};
};
class ModuleDescription: ModuleDescription {
description = "Sync to an object to make it an intel object that players can collect using ACE.";
};
};
};
@vapid scarab @junior hearth
I see you both have been working on modules. Feel free to look at modules enhanced code for ideas and reference.
tnx a lot... just to put it in the script bar?
it doesnt work as well
Im going to take a guess and say that the issue might be theIntelContent: EditMulti class. Comment that out, rebuild and see what that looks like.
iirc, all of the editMulti controls dont work by class inheritance, and you need you to set via the control attribute
Also, may I introduce you to Bax Intel:
https://steamcommunity.com/sharedfiles/filedetails/?id=3053334491
Code is open sourc https://github.com/BAXENdev/BAXA3-Intel
Here is a specific example of EditMulti control: https://github.com/BAXENdev/BAXA3-Intel/blob/main/bax_intel/config.cpp#L69
Bax intel was one of the mods I found when researching for enhanced intel stuff and it's a pretty good mod
the issue is that I wanted to make it persistant for an upcoming campaign and make bodies searchable with intel and things like that
I was able to do this with the init of objects but that got wayy too messy
I'll try that and see if it fixes it
thats a cool idea.
Yeah bax intel is a pretty good mod for intel and its very customizable
Criminally underused
My intel mod should be rather complient given that it offers the onPickup code. What was the short coming that made you want to make your own mod?
To learn sqf and modding in general as well as me wanting to make extra intel modules
mostly intel sent from triggers and a body search for intel thingy
so you could sync a module to a trigger and onactivation it would give the players the intel
and body search for intel is pretty self explanatory
It's a very good mod though and considering how little stuff there is about working with intel functions and shit i'm very happy it exists
Yeah gotcha. You are doing something different from me then
A different "source" of obtaining the intel.
Oh also I forgot
I wanted to add a module for zeuses to give intel to players under the guise of like "SIGINT" or something
you can already do this but its a little odd and I just wanted to make it more straightforward
at least for the mod pack im using
okay i built the mod im testing it
For my mod? Ill go ahead and add it if that is what you mean
Feel free to but I wanted to add it to mine so I could learn zeus modules and that sort of thing
I know some people that could really use your mod though since I plan on keeping this stuff to myself for the most part
I know dudes that just place all the intel using zeus modules and have us wait for 10 minutes so he can place everything just because he doesnt wanna do stuff with scripts
Alright so commenting out that fixed it and now it works normally
Except for not having the edit intel box obviously
I'll try what you said about the control attribute
class IntelContent {
property = "NES_Intel_Content";
displayName = "Intel Content";
tooltip = "Content of the intel item";
defaultValue = """Intel content here""";
control = "EditMulti";
rows = 8;
columns = 50;
};
its overlapping still
guh
why does arma have to do this to me 
. . . 
@vapid scarab I'm gonna use your mod since I need something I know will work for this and I'll experiment later, but it would be super cool if you could add the other modules I mentioned, if not that's fine though as the mod is still very good
Also is the mod only client side or does it have to be on the server too?
I have used EditMulti5 and EditCodeMulti5
Im going to assume that the issue lies particularly with the control type EditMulti or your rows/columns attributes.
Testing now. its throwing me an error that says control type EditMulti does not exist... Would that be your issue? (it is)
Use config viewer and take a look at the available Attribute controls in configFile >> "CfgVehicles" >> "Module_F" >> "AttributesBase"
Where did you find the thing for EditMulti?
I got a script but it doesnt like to work on multiplayer, it works on singleplayer, and when i host it works - but when you're not the host it doesnt work
theres a create vehicle inside the script
now the method i used to do it does work because everybody is able to use it and no issues - but there seems to be an issue when waypoints are involved
_heli = (leader group1);
sleep 5;
cargo1 = "B_Slingload_01_Cargo_F" createVehicle getMarkerPos "CRATE_CREATION_MARK";
private _wp = group1 addWaypoint [getPosASL GENERALS_WAYPOINT2, 1];
_wp setWaypointType "move";
_wp setWaypointStatements ["true", "Chinook1 setSlingLoad cargo1;"];
sleep 5;
private _wp = group1 addWaypoint [getPosASL GENERALS_WAYPOINT1, 2];
_wp setWaypointType "UNHOOK";
if (triggerActivated AC_TRG1) then
{
{deleteVehicle _x} forEach nearestObjects [AC_TRG1, ["B_Slingload_01_Cargo_F"], 25];
deletevehicle cargo1;
hint "Logistics Payment: Shipment recieved!";
sleep 2;
_wage = 1000;
hint format ["Logistics: Payment for $%1 for airborne cargo", _wage];
sleep 10;
[[4, player], "scripts\Automatic_Cargo.sqf"] remoteExec ["execVM"];
_killpotcash = KILL_POT1 getvariable ["Cash",0];
_logwage = _killpotcash + _wage;
KILL_POT1 setVariable ["Cash", _logwage, true];
sleep 2;
hint "Logistics Payment: Payment added to Contracts fund!";
};```
is it just fucked?
Hello, I have a problem when I try to subtract a small value from a large amount, it doesn’t work or it always subtracts 8 by default. Do you have a solution to fix this problem ?
Here’s the test I used :
private _first_mount = 118949952;
private _second_mount = 1;
private _new_mount = _first_mount - _second_mount;
diag_log format ["Test | First mount : %1 | second mount : %2 | new mount : %3", ([_first_mount] call BIS_fnc_numberText), _second_mount, ([_new_mount] call BIS_fnc_numberText)];```
Here’s the output I got in the logs : ```17:40:07 "Test | First mount : 118 949 952 | second mount : 1 | new mount : 118 949 952"```
This is because Arma uses floating point numbers and scientific notation to count numbers over '999,999'. Any numbers over this are basically rounded to the nearest multiple of... i think 16 or 32, but I can't remember right now.
The only way I am aware of accurately storing numbers this way is to store up to 999,999, and having a separate variable storing how many times the original number has rolled over that number.
ok thank you for this information
You're saying the helicopters spawn just fine but it doesn't work when you add waypoints
Its just technical curiousity and maybe im wrong, but wouldnt those gaps start at 2, then 4, 8, 16... As bit precision descresed?
If its subtracting 8, he would be in the value range that has lost 3 precision(or value?) bits?
More than likely. Been a while since I've had to worry about precision with numbers that high
Same.
I created a script that does that, when enemy killed, random chacne to have intel spawn on it or next to the body (to imitate the AI dropping it when killed).
see https://github.com/gerard-sog/arma3-macvsog-columbia-scripts --> 13. Intel on body (at the bottom of the readme).
If you need help custamizing it feel free to reach me, I also made most of the setting configurable in the Addons setting 👍
Arma3 MACV-SOG Columbia - Scripts & Settings. Contribute to gerard-sog/arma3-macvsog-columbia-scripts development by creating an account on GitHub.
Short video showcasing my new script adding intel document on killed units. Works on dedicated server !
For installation and how to use, see documentation & implementation on Git: https://github.com/gerard-sog/arma3-macvsog-columbia-scripts
Arma 3 Vietnam unit: https://discord.gg/dyeUNXHFqS
sorry i had to leave earlier, basically the helicopter spawns fine - but the cargo container either doesnt spawn or the waypoint doesnt attach
is there some magic sling code i'm not knowing about?
i'm thinking its my setup of the cargo loading tbh
i seen someone else had it and said it literally had to be within a distance of the helicopter too work
I'm blanking hard right now, can anyone tell me how to get the vectorUp between two 3d vectors? I have done this before relatively easily but I cannot find the solution
Thanks!
how do I stop arma tools from attempting to remount and reextract every day I open the computer. I un-did everything in WorkDrive.exe but it still tries to do that
could I maybe delete the workdrive related executables and folders etc?/
Don't delete the workdrive stuff, you need it for some of the modding tools and to mount the drive when you want it
Disable "Mount P Drive on startup"
that should fix your issue
Can I exit a scope trough one of its sub scopes by nesting exitWith in an exitWith? Or is there perhaps a command to exit the entire current script?
thanks raven
You could use https://community.bistudio.com/wiki/scopeName and the breakOut/breakTo commands
Anyone know if theres a way to get default mass of a vehicle without having to spawn the vehicle in?
It's a property in the model itself, so you have to spawn it
getMass
how long a player stays dead before he respawns
in seconds
respawnDelay = 10; // 10 second timer before respawning
Is the addPublicVariableEventHandler still broken with object variables? If not, what is the correct syntax?
addPublicVariableEventHandler is not supposed to work with (public) object variables
PVEH only triggers when any other machine uses publicVariable
Or on the server if any machine (incl. the server) uses publicVariableServer
Or on that client if any machine (incl. that client) uses _id publicVariableClient
1.48 changelog: "Added: addPublicVariableEventHandler support for object, group and teammember targets. setVariable accepts a 3rd ‘public’ parameter for its namespace version."
on Wiki it says it's not working as intended, so it supposed to be working, but it doesn't?
That means that the value of the public variable can now be a group, object or string
Not that it's a object namespace variable
e.g.
theman = player;
publicVariable "theman";
I see... not sure how the setvariables comes in here though
sure, you can do missionnamespace setvariable, but...
Where did you get that from. Object type support was not as recent as 1.48 ?
namespace setVariable does not accept the public parameter
I know
this is why I'm kind of confused about how is the setvariable mentioned there
Anyways, intended or not. It's not working 😄 😄
The spotrep is trolling you. No idea what they are talking about
"setVariable accepts a 3rd ‘public’ parameter for its namespace version."
LOL
they lied to you, haha
I hope they never touch PVEH. It's one of the few things in this game that does work.
This gives the PhysX mass btw (object must be a physx type)
For model mass use getModelInfo
ah nice i see thx m8
true. Would be awesome though on objects 😄
I'm currently on 1.55 dev and namesace setvariable acutally accepts the 3rd parameter
For missionNamespace only, errors on uiNamespace etc.
but that's like doing a simple publicvariable, isn't it?
For a newly spawned vehicle it'd just be the one set in the model, unless some other script modified it on spawn (which would be odd)
yes.
Since you can't use on-the-fly names anyway with PVEH
Or it would be stupid to do...
Yes but it has to be a physx type.
E.g. getMass on simple objects returns 0
Interesting, guess I haven't ever tried to get the mass of a simple object
Good to know, thanks
I'll play around with it a bit. Maybe it's one of these dev branch only things
// client 1
"a" addPublicVariableEventHandler {systemChat str _this}
// client 2
missionNamespace setVariable ["a", 3, true]
confirmed working, 1.55dev
aaaaand this works too:
player setVariable ["a", 5, true]
No idea about stable
The object is passed as thrid parameter too
["a",6,C Alpha 1-1:1 (Gefr. commy2 (2)) REMOTE]
works on groups
["a",6,C Alpha 1-1]
not sure if this is a very widely spread thing or whatever but i just found this on google and its pretty useful
ill like something like this for cba scripting
it really well made, love it
Is that the Armaholic foxhound?! 😅
hi,
i would like to know how to add custom tactical numbers on the side of tanks and ifvs
i have the pic of the numbers in .paa file but not sure how to add it to the side of vics
The correst way iirc is to add a face and texture to the side of the model, and then have the texture be a hidden texture.
The typical scripted work around is to attach a texture object to the tank.
which object in props is best for that?
tried it with one of the grafitti it didn't work
I forgot the name, but there are 2 objects that are literally "texture object". Its a 1x1 and 10x10. Look up "texture" in objects and i think itll come up
so get that prop texture object, use setobjecttexture on it using the custom numbers, but then how to make it stick on a vic and stay on it while it moves?
also if the vehicle respawns, it will lose that right?
any way to make it respawn with the vic?
The respawn vehicle module has a on respawn code block.
Otherwise, you will have to script your own solution
If. This is in a multiplayer context, you should make the texture object be local only objects that get attached on every client.
Otherwise, clients will see the texture object jumping around as sync catches up with it.
wouldn't setobjecttextureglobal be better in that case?
It you had a ovject hat wasnt being moved around, it would be fine to have it as a global object, and as such the setObjectTextureGloabl would be fine, but it wont work for everyone if the object is local only.
Essentially do this:
On Vehicle Respawn -> [tankObj, "tagfile.paa"] RE fnc_initTag -> create local texture object, attach to tank, and set texture
Hello, I was using this script https://gist.github.com/AgentRev/abcdf75aceba54510e499a3972d720d1 by AgentRev, and I made a few bridges. But I was wondering if the bridges created from the script could be imported into Terrain Builder.
Bridge-building script for Arma 3; https://imgur.com/a/eGhhF - buildBridge.sqf
Good morning guys, Im looking for a way to bind a command to a default classname
I want it to add a Ace Arsenal to a placed down box
Something like this
_Arsenal = [this, true] call ace_arsenal_fnc_initBox ;
_Box = "I_supplyCrate_F";
_Box addAtribute(?) _Arsenal;
What is bind a command to a default classname
haha I gues language barrier
Maybe you would say "attatch to a classname"
That every object of this type becomes automaticly
an ace arsenal only from existing
addMissionEventHandler, EntityCreated is what I would do
Im reading. I will edit this this post in a minute so you can check if you want
So this will be one core element https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
But I cant find something for EntityCreated, I mean its self explaining
Im digging into the rabbithole
But whats this https://community.bistudio.com/wiki/missionNamespace
Is it just a spacer or a just a topic word?
missionNamespace is unrelated at all
Copy
This is what I got so far
_Arsenal = [_Box, true] call ace_arsenal_fnc_initBox ;
_Box = "I_supplyCrate_F";
addMissionEventHandler ["EntityCreated", {params ["_Box"]},"_Arsenal"];
Dont work until now if I put it into the init.sqf
Did Ive used something the wrong way?
Im digging haha
https://arma.fandom.com/zh/wiki/AddMissionEventHandler
_box is a string, not an object. It's also defined AFTER where you are trying to use it
Look into createVehicle
Also not sure what "_arsenal" is with the event handler, as addMissionEventHandler only takes 2 parameters. Event name as a string, and the code it executes as a code block
Edit: I'm stupid, I was unaware that you could pass it additional parameters...
Edit:
_Arsenal = [_Box, true] call ace_arsenal_fnc_initBox ;
_Box = "I_supplyCrate_F";
addMissionEventHandler ["EntityCreated", [_thisArgs _Box], [_Arsenal]];
I thought thats how the arguements work
You are correct, I actually didn't know that you could add additional parameters
Regardless, I've detailed it a little here for you.
_boxSpawnPosition = [0,0,0]; // Position you want the box to spawn at
_boxObject = "I_supplyCrate_F" createVehicle _boxSpawnPosition; // Creates the actual box object
[_boxObject, true] call ace_arsenal_fnc_initBox; // Initilizes ACE Arsenal options on the box
// Not entirely sure what you'll use this for
addMissionEventHandler ["EntityCreated", {
params ["_box"];
}];
Thats not I want it to use for at all
I want that if somebody placedown _boxObject = "I_supplyCrate_F", its allways an [_boxObject, true] call ace_arsenal_fnc_initBox;
I think its my fault cause of language barrier
Btw, I keep refresh it. You think we can bring it to work?
Hopefully this'll work for your case.
addMissionEventHandler ["EntityCreated", {
params ["_object"];
if (typeOf _object isEqualTo "I_supplyCrate_F") then {
[_object, true] call ace_arsenal_fnc_initBox;
};
}];
typeOf is a command that takes an object, and returns itsclassName as a string. We can use that to check exactly what type of object was spawned.
https://community.bistudio.com/wiki/typeOf
Edit:
//Allways Arsenal
addMissionEventHandler ["EntityCreated", {
params ["_object"];
if (typeOf _object isEqualTo "I_supplyCrate_F") then {
[_object, true] call ace_arsenal_fnc_initBox;
};
}];
The first part before the addMissionEventHandler doesn't actually run, as _box is a string. I don't think you need it in your case either.
Where are you adding that event handler, are you sure the place you put that event handler is getting run, and how are you creating the I_supplyCrate_F?
Im adding I_supplyCrate_F with Liberation Building or Zeus. Ive also edited the message over me
Removing the string from I_supplyCrate_F creates errors
Just remove
//Allways Arsenal
_box = I_supplyCrate_F;
_Arsenal = [_box, true] call ace_arsenal_fnc_initBox ;
It doesn't do anything for you.
_box is wanting it to be an object, not anything else ex. _box = 'I_supplyCrate_F' createVehicle [0,0,0]
You also stated that you want it to be for every box, not one that you spawn in that script, so there is no reason to have it there
Where is _object defined or is it a Magic Variable? (Edit refreshed)
Made it. Now I need to understand the ongoing full
_object is the object that is spawned. It can be changed to any name you want if you don't like _object
It's the parameter of the"EntityCreated" event handler.
Ahhh so thats the var that will automaticly given by to the spawned object so the code can be executed additional
Yes
Does this anything together with the Namespace or am I mixing the wrong things?
Technically it exists in the missionNamespace however, that is not relevant to what you wat
want*
Copy bro. You helped me a lot to understand whats going on and how things work together 😄
I want to thank you really alot ❤️
- Greetings from germany 😄
Hi, could anyone help me understand what this issue could be from?
I copied the liberation files over from altis into another map
All but the mission sqm.
in the editor, everything runs fine, and the game mode starts
This alert appears in the editor but the game mode runs fine
however, when I play it from a server hosting website, i get stuck in the lobby.
Any suggestions?
As far as I know, you can't just copy it over to another map, I havent dealt with it personally though.
Do you happen to have the.rpt file it generates? That should tell you where the issue stems from
Also, could be wrong, but I think that error might be from a mod
One moment
its a pretty big list actually, but I will trouble shoot a bit
Not sure if should paste the whole log
Just upload it as a file, should be fine?
Btw Fraali, do you know a way how to reduce the ace arsenal to the Items that are used in the default loadouts.
I know you can reduce the ace arsenal by this:
[_box, ["MyItem1", "MyItem2", "MyItemN"]] call ace_arsenal_fnc_initBox
There are usefull informations writen down, but I cant find a nice way to make it done. Maybe you have some experience or idea
What do you mean by default loadouts?
I mean this
I don't have any idea for that. It depends on what items you want exactly. I don't know what you mean by default loadouts
I dont see any specific errors that would stop loading from this Maybe try unloading all mods except the hellanmaa map? (any requirements of course)
its in my commandline already. in my server hosting website
and in my modlist
I mean to unload the mods that aren't 100% required for now, to see if you're able to join with just the mission itself
Btw this[Attached Picture] dont work *(Im just joking around, I dont want this seriously to work) *
addMissionEventHandler ["EntityCreated", {
params ["_m4a1"];
if (typeOf _object isEqualTo "rhs_weap_m4a1_blockII_bk") then {
[_m4a1, true] call ace_arsenal_fnc_initBox;
};
}];
=======
What I mean with the Default Loadouts is that you can enter default Loadouts with ace arsenal so they are preseted to the server.
What I want to achieve is to limit the placed down arsenal only to the items that Ive used in that default loadouts.
Btw. I think its language barrier again. Because ger.:"Standard Ausrüstungen" in the marked message means eng.:"Default Loadouts"
It’s not working
Would you know if there is a liberation for hellanmaa? It’s a map
As far as I am aware "rhs_weap_m4a1_blockII_bk" wont work as it is a weapon, not an object.
Little difficult to go into detail, however it exists in CfgWeapons but not in CfgVehicles
So EntityCreated works with createVehicle in somehow?
heres the new log by the way
yesss, thank you I will try that
can probably use groundWeaponHolder instead and check if it contains the m4a1?
Whats more important about the message is the second part where I describe Default Loadout thing
Cant find anything to "groundWeaponHolder " (no informations)
EntityCreated will run any time you create an entity - createVehicle, createSimpleObject, createVehicleLocal.
When you drop a weapon, the weapon class name "rhs_weap_m4a1_blockII_bk" isn't created, but a GroundWeaponHolderis created
https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_Equipment#GroundWeaponHolder
GroundWeaponHolder is the "box" that holds your stuff when you throw it on the ground
whats iirc?
If I recall correctly
you can treat it like any other weapon box (only difference it is gets deleted when empty)
So if you want to check if it contains x weapon you can do it the same as a regular weapon box with weaponCargo or whatever script command you prefer
Okay logic in theory
dont know why it is but I can never get past the black and white loading screen for this mod. I have the accompanying depency and im stuck
quit the game 3 times
post your .rpt file
this is in the editor now, im checking out the new mod I was suggested
I get a black and white screen of Liberation RX and doesnt get past it. says the logistics (forgot full name but seen it before) has initialised
yes, post the rpt of when you get stuck on the black and white screen...
can you do that for the eden editor though?
not sure how to do that. I server host from another website. I dont know where the logs are kept for the eden editor
Why are you trying to run it in EDEN?
Just go to multiplayer > server browser > host server > select map > select liberation mission > select
if you read the chat history you would know
im exploring the new mission file I was suggested and of course im in the eden editor.
i was working on the same map from a different avenue but now I found there is a prebuilt for it so im checking it out but its get stuck loading in
3den editor doesn't run the exact same code/conditions an actual server does, might not work properly in editor as seen from your example
loaded in host server and works just fine...
load the mods and mission on your dedicated server and post the RPT from that server, every server provider has some way of getting those logs
well, in case it wasnt stated, I do plan on moving things around from the original file. Im sure everyone knows what thats like; making changes to the starting point, adding custom assets, spawn points, etc
thats why im in the editor but the problem is persistant to say the least so I cant even edit
how about you try hosting it normally first? if that works you can try and edit it > SAVE IT> run it normally either on the server host or using host server in the server browser
I went back to editing the previous file, the one before the liberation mod was announced to me. here is the log if you could help me decypher what is wrong with it
How are you running it?
Can someone help me out? I am trying to have artillery fire on a perpetual fire mission. After they fire for a bit, they stop aiming toward the target area, the guns slide back to facing front, but they continue firing. Is there a way to keep their guns pointing toward their fire mission target without going back to idle?
_wp = group this addWaypoint [_targetPos, 0];
_wp setWaypointType "ARTY";
_wp setWaypointCompletionRadius 10;
_wp setWaypointStatements ["true", "{ _x doArtilleryFire [_targetPos, '8Rnd_82mm_Mo_shells', 5]; } forEach units (group this);"];
_cycleWp = group this addWaypoint [getPos this, 0];
_cycleWp setWaypointType "CYCLE";```
I tried this, and a fire mission and cycle wayppint, but they never go back to firing on their target.
Additionally, this code is used to add back the round afterr every shot. this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]
https://community.bistudio.com/wiki/Waypoints#Cycle
Cycle
This waypoint type will change the group's active waypoint to the nearest waypoint other than the group's previous waypoint.
maybe try adding one more waypoint to the mix
also, is "ARTY" even a valid WaypointType? 🤔
It's not, just an example. I have a fire mission waypoint.
Tried changing the cycle waypoint, but they still just fire at the target, then look forward and keep firing.
Why the waypoint instead of using doArtilleryFire on its own?
Yeah no need for waypoints at all
That was from the eden editor
how can i pickup on when an apers mine dispenser releases its payload?
i have tried eventhandlers for submunition created and fired, and neither seem to respond.
i want to make the dispenser create mines owned by the player that deployed them in MP, so another players handledamage event handler will be able to pull the mine owner to compare and determine if the player should take friendly fire damage
howmany times do we have to tell you to not run it from the editor? -_- bro
Buddy,
How else am I suppose to edit the file?
1 - I’m not going to be uploading a vanilla file to the server without re-organising where the assets are because that’s not fun, hence I want to edit. I also want to add mods and those are not in the original file, weapons etc
2 - even if I did upload it, and it worked, what’s the point if I can’t edit stuff in the editor? It would be stuck like that forever
3 - this is a previous mission file, not the mod I was suggested last night
Hope that’s clear
So thank you, but that’s my perspective
I only want help interpreting the log file so I can see what’s breaking down
It says I am missing a model
b u d d y, nobody will help you if you can't listen to instructions
try the vanilla file first, does that work?
then try editing the mission > SAVING IT > running it using "host server" in the server browser NOT WITH THE EDITOR, does that work?
Running a mission in the editor is not the same as using host server and is likely why its not working
Hope that's clear
if you cant get the first step to work there is no point in trying to edit it
nobody is telling you to play the vanilla version, just to test it to see if your mission is the problem or your server is the problem
Keep in mind, running a mission as multiplayer in the editor is the same as a listen server. You just actually have to say play in multiplayer.
I just tried this and it didnt work.
I will be in the arma voice chat sharing my screen
In 3den, I have the vectorDir and vectorUp of an object, and I want to set the rotation 3den attribute of the object using them.
How would I convert those to rotation?
Do you just mean setVectorDirAndUp?
Does that command not work on 3den entities / update those values?
You could also probably just set3DENAttribute with rotationX/Y/Z (that seems to be the naming scheme)
https://community.bistudio.com/wiki/Eden_Editor:_Setting_Attributes#Attributes
Oh you mean vector to degrees
Thats.... not how that works.
setVectorDirAndUp doesnt set the attribute. And the rotation vector value is very different from vectorDir and vectorUp
I misunderstood what you needing help on, I thought you had the values and just needed to set them
I wish it was as simple as that
You could try searching for general vector to degrees formulas, shouldn't be too different in sqf
getDir and bis_fnc_getPitchBank should™ be what you need. And set3denAttribute / s
I believe this is covered in calc 3, but this could help. Its what was give to me when I asked my engineer friends
but they also said that stuff needs to start moving to Quaternions as they are easier to work with
this would be useful, except I only have the vectorDir and vectorUp stored. Not an actual object.
dig into the functions and build your own. i just can't tell you the math behind the why
In this video, we will discover how to rotate any vector through any axis by breaking up a vector into a parallel part and a perpendicular part. Then, we will use vector analysis (cross products and dot products) to derive the Rodrigues rotation formula and finish with a quaternion point of view. Using quaternions allows us to write a very compa...
@vapid scarab
Thanks!
Is there a way tyo make the collor of a callsign in sidechat a different color than blue?
I want to do something like modernwarfare where friendly armed forces turn to opfor, and let it be obvious by the sidechat and the callsign changing color
https://community.bistudio.com/wiki/radioChannelCreate
And other related commands
will have a look at it, thx
You'd have to do some matrix math. Those values are stored as a euler angle iirc. Pretty sure Nikko gave you close enough commands though.
I have a problem
Im using this to get an array of all muzzles, what ammo is loaded, and how much ammo it has
However, when i use it with a disposable (eg, the RHS m136) it breaks the disposable and prevents it from being reloaded
Does anyone see a different way i could be doing this?
(before people ask if things are defined, they are, it works, it just doesnt like disposables)
https://github.com/acemod/ACE3/pull/10541/files#diff-efc2950c84a6c2322fd5df1edaa9543606cbd8d7b1a0b16631ba631f7932a54e
Could it be trying to add in a bad _launcherAmmo or _launcherAmmoCount? I would suggest trying to run the launcher code independently in debug and figuring out exactly what it's trying to add. Might start you in the right direction
Anyone have any idea where the saved3DENInventory variable comes from?
I see it accessed in BIS_fnc_unitHeadgear, however I don't see any place that it is created.
It's set globally on all units, and over a 2 hour restart has been set over 100k times, so trying to track it down.
inb4 "proper path separator is \"
so it worked when you put the .paa file in the main mission folder
ill have to try that lol @knotty moth
Did you try using \ as the separator?
That's now how that should be, you should do images\info1.paa
how to force AI heli pilot to hover on one place ? 🤷
I have found only this command isAutoHoverOn but I need something to force auto hover ...
unfortunately it doesn't work if AI is the heli pilot
If you disableAI "PATH" on them they'll probably stop and hover
@hallow mortar Its working thanks! 👍
is there a way to slow down flares when they fall i tried messing with setVelocity setting the z-axis to -0.0001 and such didnt make much a difference and 0 would stop it from falling completely.
I believe there is a config value. At work so I can't look it up. Look at the ammo's config for something relevant.
Nice, gonna check it out
any idea why this doesnt work? Essentially I want all vehicles of those types to get an addaction
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
vehiclelist = ["B_ION_Pickup_mmg_rf","B_ION_Pickup_rf"];
if (_entity in vehiclelist)
then
{
_entity addAction
[
"<t color='#FFCC00'>Interaction",
{
params ["_target", "_caller", "_actionId", "_arguments"];
Script here;
},
nil,
1.4,
true,
false,
"",
"true",
10,
false,
"",
""
];
};
}];
_entity is not a string 
check for typeOf _entity in vehiclelist or something. And probably use a private array instead of global one if you don't need to change that on the fly. And if you do need to change that on the fly - use a tag in your global variable name 
and whats "Script here;"?
What ever I want to put in there
I will look into that
Not sure where to post but I'm trying to make a mod that brings up my tablet i have made and the picture for it. I have the dialog file made but im having a problem with the game running/bring up the mod. Not sure what im doing wrong.
whats your code so far?
dialog code is pretty long not sure if i should post it here or just dm you it but this part is in my init sqf
Tablet_available = false;
Tablet_addAction = {
waitUntil {(!isNull player) && (alive player)}; // Wait until player is alive and not null
// Add action to the player with the custom icon and name
player addAction [
"<img image='addons\image\IconN.png' /> <t color='#FF0000'>Tablet</t>", // Action text and icon
{ _dialog = createDialog "Tablet"; }, // Script to run when action is selected
nil, // Argument for the script (none here)
-1, // Priority (default priority)
false, // Show window
true, // Hide on use
"User19", // Shortcut key for the action
"true", // Condition to always show the action
-1, // Radius (not specified)
false // Don't allow when unconscious
];
Tablet_available = true; // Mark that the action is available
};
// Wait for the player to be alive and not null
waitUntil {(!isNull player) && (alive player)};
// If the action isn't already available, call the function to add it
if (!Tablet_available) then {
[] call Tablet_addAction;
};
// Add event handler for respawn, so the action is added again after respawn
_EHRespawn = player addEventHandler ["Respawn", {[] call Tablet_addAction;}];
init.sqf is a mission script, not a mod script. If you're making a mod you need to make a function (https://community.bistudio.com/wiki/Arma_3:_Functions_Library) in config.cpp with the function flagged for preinit or postinit execution.
if (_entity in vehiclelist)
then
{
this indentation hurts lol
if ((typeof _entity) in vehiclelist)
to have a cleaner code you can use reversed ifs
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
private _vehiclelist = ["B_ION_Pickup_mmg_rf","B_ION_Pickup_rf"]; //no reason to have this global
if !(typeof _entity in _vehiclelist) exitwith {}; // if it not in the list, just go out
_entity addAction
[
"<t color='#FFCC00'>Interaction",
{
params ["_target", "_caller", "_actionId", "_arguments"];
//Script here;
},
nil,
1.4,
true,
false,
"",
"true",
10,
false,
"",
""
];
}];
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Sneakyamr syntax highlight there ^
have you check that your code reaches createDialog and that Tablet is valid class?
add the addaction might fail sometimes, instaed of use an bool in the code, you can check if the return of the addaction isnt nil
if !(isnil "AddActionAddedSucessfull" ) exitwith {}; //
AddActionAddedSucessfull = player addaction ["blabla", {}];
haven't checked and the class should good.
and oki FlyingTarta
isnil takes string
wopsie
Quick question i knew this in past but i forgot now how would i update the text on procedural text texture ?
Basicly i want my count down to be shown on screen and with the text to show the timer ?
Using Text - #(rgb,width,height,3)text(vAlign,hAlign,"FontName",fontSize,backgroundColor,textColor,"text")
Just setObjectTexture again with updated text.
With UIOnTexture - #(rgb,width,height,mipCount)ui("displayClassName","uniqueName","texType")
https://community.bistudio.com/wiki/displayUpdate
https://community.bistudio.com/wiki/Procedural_Textures#UI_On_Texture
ah ok thanks
its adding the rockets correctly, however adding them to a disposable breaks the scripting on the disposable making them useless
vehicle and objectparent aren't working for me, anyone else notice this?
Share your code
theres nothing to share the command doesn't seem to work, its probably on my end idk
What? You can share the code that doesn't work
it was on my end, disregard
Asking for coding help 101: tell what is and how it is not working. Otherwise nobody can provide anything
Entity: Me
Game: Arma 3
Looking for: Someone who can update this customized hetman mission to also include jets and planes even in custom factions and make them fly around ingame?
Send DM if interested
Paid: Yes
Contact: DM me
Additional info: I want you to edit the mission pbo and the scripts so that it detects jets and planes form custom factions and spawn them and have them fly around and fight and be ordered around by the hetman ai commander. No need to make custom scripts to force the AI jets to attack just have them spawn since currently it only detects helicopters
Was this supposed to be in #creators_recruiting ?
Don’t get you pls
can you get the IP of the server in the server itself?
Not with default arma. Could probably set up a system to send it through rcon, or mod though
hmm what about extension?
What is your intention as it might help find a good solution
was planning on making custom server browser/list where you can grab IP of server and join it
Well this can help with the “friends” section
But for the more typical, an extension and checking the status of a server using a post request might be best, I’ve not really looked into this much though, so success might vary.
it says that command doesnt work
Not in MP, no
maybe i could use serverName instead
its not like i can launch arma from website with the IP anyways
though some one might want to put the IP in launcher and auto join
Yes you could
steam://rungameid/107410//-connect=<server_ip> -port=<server_port>
https://developer.valvesoftware.com/wiki/Steam_browser_protocol
ooh nice 🙂
but once again if you are creating a website you can either just scrape all the arma 3 servers using the steam master server and filter by whatever ur mission is, or just have people manually register their server on your website
all this extension sending server ip to an api to then list it is overly complicated for no reason
and if you are using an extension to send the ip to an api, you might as well still just use the arma 3 https://community.bistudio.com/wiki/htmlLoad function and grab the ip on the api side (server will request webpage from your api, your api records the IP and uses it for your server list), saves you having to write a useless extension
the problem... at least with arma server browser is that it cannot find lets say missions made by me. it can only filter by server name which doesnt quarantee all my missions are listed
once every x minutes go over all 4000 arma servers (querying 4000 servers really isn't that much) and request what mission file they are running like was already mentioned #arma3_tools message
or use the htmlLoad
or have people list their server on your server list if they actually want to be listed there
or use the overly complicated extension that grabs the servers ip and send it to your website/api
the solutions are there
The chances of someone manually registering their server on your server list are higher than somebody running some unknown extension with questionable functionality
i was thinking of using POST to the website to register the server
or use GET and provide server information as parameters...
You are trying to come up with a solution to a problem that doesn't exist
- htmlLoad sqf to ask the server to register on the server list
- web server validates the the IP given by the htmlLoad is actually running and arma 3 server with your mission (use the steam api)
- web server adds the server to your server list
htmlLoad would work too, already wrote C# code to do the same 🙂
You expect servers that run your mission to run your extension too tho?
Why should I as a server running your mission add a separate mod that will run an extension just to register to my server on your serverlist
my mission already requires mod and extension so it wouldnt be big deal
why does this only open the launcher?
<a href="steam://rungameid/107410/ -connect=127.0.0.1 -port=2302 ">test</a>
Running that appid runs it from steam. Steam is directed to the launcher executable.
ya makes sense
--nolauncher is a thing
The more you know...
<a href="steam://run/107410// -window -nosplash -nolauncher">test</a> shows a steam confirmation prompt and when i agree runs the game @proven charm 
Is there a way to select the highest ranking alive unit from group ?
I am doing right now the
private _HQCand = {rating _x} forEach (alive _unitG);
private _NewHQ = _HQCand call BIS_fnc_greatestNum;
but I know it will not work, since _NewHQ would be a unit rating, not the unit...
thx!
And script further down requires position, that is inherited from squad leader and if he is gone, it gets object nulled...
more like sqf private _newHQ = objNull; private _highestRating = -9999; { if !(alive _x) then {continue}; if (rating _x > _highestRating) then { _newHQ = _x; _highestRating = rating _x; }; } forEach (units _muhGroup);
I was thinking about using "select" command for selecting out of array, but this will work perfectly. Thanks.
Is there a fisheye lens effect in Arma 3 or is it possible to simulate this effect somehow?
No
case "STRONG": {
private _tankPos = [_spawnPos, 0, 25, 5] call BIS_fnc_findSafePos;
private _tankArray = [_tankPos, 0, _tankClassname, _side] call BIS_fnc_spawnVehicle;
private _tank = _tankArray select 0;
private _tankCrew = _tankArray select 1;
private _tankGroup = _tankArray select 2;
private _ifvPos = [_spawnPos, 0, 25, 5] call BIS_fnc_findSafePos;
private _ifvArray = [_ifvPos, 0, _ifvClassname, _side] call BIS_fnc_spawnVehicle;
private _ifv = _ifvArray select 0;
private _ifvCrew = _ifvArray select 1;
private _ifvGroup = _ifvArray select 2;
[_tankGroup, _toPosition, 0, "SAD", "AWARE", "YELLOW"] call CBA_fnc_addWaypoint;
[_ifvGroup, _toPosition, 0, "SAD", "AWARE", "YELLOW"] call CBA_fnc_addWaypoint;
{
_attackArray append [_x];
} forEach [units _tankGroup, units _ifvGroup];
};
``` is this an efficient way to do this? or is there a better way?
Efficient way to do what?
I mean, you could save some lines with params?
You could also optimize that forEach at the end, the way you have it right now is really odd
I don't see why you need a loop at there at all, and I think you're getting nested arrays when you don't need them
yea i see that i guess ill have a look at it
Your _tankPos and _ifvPos return an identical result. You should just do the BIS_fnc_findSafePos once then. You also create variables _tank, _ifv and both crew then never use them. I'd suggest axing the group variables and just selecting them from the array within the addWaypoint function: (_tankGroup #1).
Hey lads, maybe a silly or simple question but I'm at the end of my rope
Got a classic 2 part vehicle spawner set up;
- Invisible helipad
- Terminal with a spawn script
Work great but I wanted to put that spawn locations on a larger moving vehicle (aircraft carrier style) but the deployment area for my vic is NARROW and the randomness of normal getATL spawn is getting it blown up.
Here's what I'm trying to work out/implement;
- Aircraft carrier has a bird attachTo'd with a "Clamp Release/engage" script (done)
- Either when bird is destroyed or when terminal is used (I'd settle for either), bird spawns and is attachTo'd at the exact model co-ordinates that won't get it blown up on an aircraft carrier that could have very well moved since the bird left
My issue is finding those model co-ordinates, how the hell do I go about finding them?
Is there a way I can take the initial position of the bird relative to the carrier, store that, then use that for the bird spawn/respawn? I thought I was getting somewhere with getrelpos but it doesn't seem to be what I need.
Picture should clarify a bit
Thanks in advance!
Get coordinates of the Ship relative to the platform (Offset): https://community.bistudio.com/wiki/worldToModel
Translate Ship world coordinates relative to the platform: https://community.bistudio.com/wiki/modelToWorld
Set position with the result: https://community.bistudio.com/wiki/setPosWorld
i dont think they should? i have the two seperate variables because im picking a point on the map and spawning 2 vehicles there. when i was using just one find safe pos function, both vehicles spawned in the exact same position, resulting in them exploding.
Is anyone aware of a script that can override Hide and/or Stop commands given by the player to his group?
You're right, I didnt notice you spawned the vehicle inbetween checks
all good no worries o7
I'm really sorry mate, I understand these are what I need to get to the result I need but can't for the life of me work out how to implement it. What I want to do seems to be quite a bit beyond me
Get your offset, will look like that [10.8945,10.4722,-2.28235]
// Get offset
private _relpos = _Platform worldToModel ASLToAGL getPosASL _Ship; // This will be your offset value and will be used to set the position relative to the platform.
// Set position
_Ship setPosWorld (AGLToASL(_Platform modelToWorld [10.8945,10.4722,-2.28235]));
joinSilent
Oh I see, just running the offset fetch then inputting that, wow I wouldn't have got that with the ASLtoAGL's as well! Thanks so much mate with a little tweaking she's working a treat ❤️
That does it for Stop, but not all units on Hide. For some reason the last or second units in group (“formation leaders”) stay stuck in Hide after JoinSilent and again a doMove. It’s like it’s stuck in the FSM somewhere…
Do you do joinSilent on the current group, or do you create a temp group, joinSilent into temp group, then move them back into the current group?
In any case, try both
Will try again with a temp group, but think I already did. Hide is a persistent command 😉
Is there need for a sleep between the joinSilents?
@little raptor Nope, even after joinSilent to another group, the unit goes back into Hide after returning and being told to doMove somewhere... feels like a bug
Only player commanded Regroup will fix it, it seems.
Does anyone here know a place I can find a scripter for my unit? ours left due to life getting hectic and im not sure where to find a replacement. You scripters are like gold lol
Thank you!
for some reason, this disableAI "MOVE"; put into a units init box seems to make it so that the unit cant turn either, anybody know why?
Because that's exactly what it's supposed to do: https://community.bistudio.com/wiki/disableAI
Trying to create some small AOs with tasks in my mission. At the mission init it will select a random AO (all AOs are pre made hidden layers). Randomly selected AO will then show and enable simulation. The issue is getting tasks/task modules to show in that layer. As it stands all tasks start on mission start. Regardless of what layers enabled.
I was thinking maybe use a trigger to check if the layer is enabled that would then fire up the createtask module to create a tasks in that layer only?
Some advice would appreciated .
I need to add an object
not a vehicle
it create a object just put the class name of a object
So instead of
_heli = "AH1Z" createVehicle getMarkerPos "hspawn";
I can change it to
_object = "Randomobject" createVehicle getMarkerPos "hspawn";
Yea just make sure class name is correct.
What is the class name
Depends on the object each object has its own class name.
Oh yeah
Can i keep the "createVehicle" or do i need to change that
createVehicle is a command witch is createing a type of object on a positon.
ok
Any object that is not a) a baked-in terrain object or b) intelligent is technically "a vehicle" in Arma. The game doesn't make a hard distinction between "vehicle" and "non-vehicle object", they are all the same basic thing, just with varying properties. deleteVehicle and createVehicle apply to everything except full AI (createUnit) or limited AI (createAgent).
Okay thank you
Is there a way to reference the last word in a string?
Word? Not a character?
How do i make it spawn with a variable name
Same way you'd save anything else to a variable.
my_variable_name = createVehicle [ ... ];```
ty
Yes, though I could achieve the same affect by pulling the last few letters
If you think of English (or any other Latin) words,
_str = "I have a little lamb" splitString " ";
_str#-1```should return "lamb"
Ok thanks I'll try it
You're a mad lad, that worked perfectly
Evidently _str select -1 works as well
Well they are semantically the same
# is just select with higher priority
Could use some help finishing up the following code, as it's frying my brain still.
Everything works except for the setPitchBank, if the platform is on an angle I want the spawned vehicle to attach at that angle, at the moment it's the right position but wrong angle, clipping through the carrier vessel. I realise setPitchBank is looking for the specific numbers, not a variable name, but am unsure of how to get the correct numbers into each place after storing in a variable, as this pitch and bank can change frequently.
_pos = [(getPosATL h1) # 0, (getPosATL h1) # 1, (getPosATL h1) #2 + 5];
_relangle = h1 BIS_fnc_getPitchBank;
_vehicle = createVehicle ["17th_Valkyrie_Transport", _pos,[],0,"NONE"];
{ _x addCuratorEditableObjects [[_vehicle], true] } forEach allCurators;
[_vehicle, _relange, _relange] call BIS_fnc_setPitchBank;
_vehicle setDir (getDir h1);
_vehicle setPosWorld (AGLToASL(h1 modelToWorld [-0.135254,8.3811,-2.253628]));
[_vehicle, Hdropship] call BIS_fnc_attachToRelative;
}]};```
Thanks for any help offered!
setPitchBank uses an object, a number and a number. You have two arrays
Yeah I get that sorry, I just don't know how to take the getPitchBank or otherwise find those numbers when the action is used, then apply those numbers
I'm very much newer to arma coding and this is what I'm trying to work out 😂
BIS_fnc_getPitchBank returns an array of [pitch, bank]
So you can just use params to get those values easily:
(h1 call BIS_fnc_getPitchBank) params ["_pitch", "_bank"];
Or use select or #
Params is easier for newer people to understand IMO
Well preference, I guess. I don't just really use it for very one-time non-complex declaration
That code could just use some clean up in general too, I don't know why you have the whole thing wrapped in a call
So looking at that it would pass each of the values off to variables that are only readable within that call loop (what _variable does right?). But then don't I hit the same issue with setbankpitch?
It's part of a larger spawner
Whole code
call{this addAction ["Spawn Valkyrie",{
_pos = [(getPosATL h1) # 0, (getPosATL h1) # 1, (getPosATL h1) #2 + 5];
private _relangle = h1 BIS_fnc_getPitchBank;
_vehicle = createVehicle ["17th_Valkyrie_Transport", _pos,[],0,"NONE"];
{ _x addCuratorEditableObjects [[_vehicle], true] } forEach allCurators;
[_vehicle, _relange, _relange] call BIS_fnc_setPitchBank;
_vehicle setDir (getDir h1);
_vehicle setPosWorld (AGLToASL(h1 modelToWorld [-0.135254,8.3811,-2.253628]));
[_vehicle, Hdropship] call BIS_fnc_attachToRelative;
}]};
call{this addAction ["Spawn Vulture",{
_pos = [(getPosATL h1) # 0, (getPosATL h1) # 1, (getPosATL h1) #2 + 5];
_vehicle = createVehicle ["DMNS_40k_Vulture", _pos,[],0,"NONE"];
{ _x addCuratorEditableObjects [[_vehicle], true] } forEach allCurators;
_vehicle setDir (getDir h1);
_vehicle setPosWorld (AGLToASL(h1 modelToWorld [-0.0712891,-10.7347,-3]));
[_vehicle, Hdropship] call BIS_fnc_attachToRelative;
}]};
call{this addAction["<t color='#ff4000'>Repair/Rearm",
{_veh = nearestObjects [h1, ["Helicopter","Plane","Car","Tank"], 10] select 0;
_veh EnableSimulation false;
_veh setvehicleLock "LOCKED";
_veh setDamage 0;
_veh setFuel 1;
_veh setVehicleAmmo 1;
_veh EnableSimulation true;
_veh setvehicleLock "UNLOCKED";
}]};
call{this addAction["<t color='#37A9E7'>Unclamp Vehicle", {_veh = nearestObjects [h1, ["Helicopter","Plane","Car","Tank"], 10] select 0; detach _veh;}];}
call{this addAction["<t color='#37A9E7'>Clamp Vehicle", {_veh = nearestObjects [h1, ["Helicopter","Plane","Car","Tank"], 10] select 0; [_veh, Hdropship] call BIS_fnc_attachToRelative;}];}
call{this addAction["<t color='#37A9E7'>Store Vehicle", {_veh = nearestObjects [h1, ["Helicopter","Plane","Car","Tank"], 10] select 0; deleteVehicle _veh;}];} ```
The point is:
- getPitchBank returns an array with two numbers
- setPitchBank uses two numbers
- You need to unwrap the array to use these numbers because what you have right now is not a number but an array
Yeah okay awesome, so the fnc WILL read variables as I put in, I've just got to seperate it out first
Much much MUCH appreciated
Basicly code vise this is what he is telling you:
(h1 call BIS_fnc_getPitchBank) params ["_pitch","_bank"];
[_vehicle, _pitch, _bank] call BIS_fnc_setPitchBank;
I was just about to say, that initial variable shouldn't be needed right? I don't need to store the array once it's passed out
Theoretically. Preference you take matters
Also i dont know were are you calling this code from but its unessery to have call {}
Not working I'm afraid, I'm going to keep tweaking on my end just in case I've stuffed something up
My guess why your pitch and bank dosent work its becouse of this code:
_vehicle setDir (getDir h1);
_vehicle setPosWorld (AGLToASL(h1 modelToWorld [-0.135254,8.3811,-2.253628]));
[_vehicle, Hdropship] call BIS_fnc_attachToRelative;
So you run this after you set the pich and bank witch i think overrides your pitch and bank.
Basicly try setting the pitch and bank after this code runs.
Not working either sadly, I've played around with a few positions for the code
Placed after setposworld but before attachtorelative results in the same picture as above
Placing it after attachtorelative breaks it completely
I've gotten it working by swapping to select as Polpox suggested, thanks again everyone!
Hey Folks, its me, lost in Configs again.
I am trying to read out how many passengers a helicopter can have to dipslay that in an info screen.
I would like to view it without spawning the helicopter, so I thought I try to find something in the config.
I found "transportSoldier" but I already saw that this is often not the real passenger count. For the Ghost Hawk it is, for the MH-6 Little Bird its not (it shows 2 but infact 6 passengers can take place). This is most likely due to the fact, that the four seats on the benches are also turrets.
Then I thought about counting the entries in cargoActions. This is mostly precise (Ghost hawk has 8, Little Bird has 6, Chinook has 16) but in case of the unarmed Chinook, it has only 16 but he can fit 18 peaplo in it. This is, again, because of the two "additional" seats are Turret seats.
I admit, now I am out of ideas. Is there any way to get a precise count of how many people can fit in a helicopter (without the crew) or do I really have to spawn the heli, count the free seats and then despawn it?
You'll need to count turrets
Figuring which turret is passenger can be a bit tricky
No weapons? Person turret? Some mods have 2 turrets for one passenger (RHS vehicles where you can swap between passenger and firing turret for one soldier)
Uh, okay, thats ruining the fun when the Mods handle this all differently.
Well these are exceptions, maybe you can account for them too somehow
private _cfg = configFile >> "CfgVehicles" >> "someclass";
private _seats = getNumber(_cfg >> 'transportSoldier');
private _turret_seats = [];
{
if(getNumber(_x >> "isPersonTurret") > 0 && count(getArray(_x >> "magazines")) == 0) then {_turret_seats pushBack [_forEachIndex]};
private _index = _forEachIndex;
{
if(getNumber(_x >> "isPersonTurret") > 0 && count(getArray(_x >> "magazines")) == 0) then {_turret_seats pushBack [_index, _forEachIndex]};
} forEach ("true" configClasses (_x >> "turrets"));
} forEach ("true" configClasses (_cfg >> "turrets"));
Didn't test it, it should fill _turret_seats with paths of person turrets with no weapons (I think there are seats where you can shoot the turret AND turn out to shoot handheld guns)
_seats + count(_turret_seats)
otherwise you can just increase the counter instead of pushBacking paths
also make it recursive function
or more complex conditions
Thanks man, what a service. I'll try to set it up.
nevermind was using old buggy code it seems
Im trying to make a mod that adds realistic fighting, does anybody know how I could make animations for stances and throwing different types of punched (like hooks, crosses etc.)
#arma3_animation better ask here
when i go running i aways bring a knife you run faster with a knife lol he he
just kidding m8s lol
Ummm... finally tested this, and well.... the vehicle on the left is where I am getting the input dir and up from, and the vehicle on the right is the one being applied the rotation vector after.
Looks like i might need to relearn that math🙃
Edit: ignore this.... I tried a few weird things including reversing the vectors, and I thought fixed it back before testing other things, but I guess not which screwed the other tests. Fixed this and figured out it should be X,Y,Z. I think the editor swaps the values after they are passed.
You also dont need to use vectorCrossProduct you can get side vector with vector side.
https://community.bistudio.com/wiki/vectorSide
also in your code here in picture you have
_vectorup = vectordir obj. witch gives you dir vector just stored in _vectorUp variable.
I'm trying to add Get In Pilot and Get In Gunner actions to the Sentinel. Needs to work for multiplayer. Here's what I have currently:
private _GetInPilot = this addAction ["Get in Sentinel as Pilot", {player action ["getInPilot",_this];}];
this setUserActionText [_GetInPilot, "Get in Sentinel as Pilot", "<img size='2' image='\a3\ui_f\data\IGUI\Cfg\Actions\getinpilot_ca'/>"];
Getting an error. The action option and icon appear but the action doesn't work.
private _car = this;
_car addAction ["Get in vehicle"{
params ["_caller","_target","_args"];
_caller moveInAny _target;
}];
``` try this
Yeah. ignore that
I was messing around with reversing the values and other stuff.
I guess i thought I fixed the vectorUp before moving on to trying other things.
Fixed that, and then flipped it to X,Y,Z instead X,Z,Y and that worked for me
Here is how you would limit range and also disable addaction if player is in vehicle:
private _car = this;
_car addAction
[
"Get in vehicle",
{
params ["_caller","_target","_args"];
_caller moveInAny _target;
},
nil,
1.5,
true,
true,
"",
"!(_this in _target)",
10,
false,
"",
""
];
I was wonder if there's any way to make a glitch screen effect that could be trigger from the zeus executor module?
Partially works. Action appears but does nothing. Also you missed a comma 😛.
You can make it with postProcess effects like film grain you can see example code here and see if that is the glitch effect you want.
https://community.bistudio.com/wiki/Post_Process_Effects
Or with the ppEffectEnable, ppEffectAdjust,ppEffectCommit
example:
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [50];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust [0.0];
"dynamicBlur" ppEffectCommit 2;
Thank you!!
I'm testing locally in the editor. Could that be the issue?
no where are you calling this code from ? I am assuming you are putting this in init of a vehicle ?
Correct
@rapid vortex try this code and myb put like systemChat "test" see if it executes or diag_log.
systemChat did appear, unit not entering vic though
private _car = this;
_car addAction
[
"Get in vehicle",
{
params ["_caller","_target","_args"];
_caller moveInAny _target;
systemchat "It runs";
},
nil,
1.5,
true,
true,
"",
"!(_this in _target)",
10,
false,
"",
""
];
no space in _car?
try this myb:
this addAction
[
"Get in vehicle",
{
params ["_target","_caller"];
_caller moveInAny _target;
systemchat "It runs";
},
nil,
1.5,
true,
true,
"",
"!(_this in _target)",
10,
false,
"",
""
];
it should be ```_target moveInAny _caller;
actually the params is on wrong order
should be params ["_target", "_caller", "_actionId", "_arguments"];
good catch i didnt see it
the moveInAny was fine
fix params instead for it to make sense 🙂
still missing "_actionId" if you want it to be perfect
if you are not gonna use it its unessery.
i would say _args is also unessry
yes but you have _args there at its place
The syntax for moveInAny is unit moveInAny vehicle.
yep
Then why _target moveInAny _caller?
that was my bad, i didnt realize the params were in wrong order.
so just ignore that :/
Legion's code should work
@fleet sand @proven charm Thank you both, working as intended now. 🙂
3den attributes are xyz
xzy is how they're stored in sqm (and in radians)
(which is what SaMatra wanted when I replied to him)
I wrote that code before vectorSide was introduced
Quick Question how would i stop VLS from shooting this is what i have currnly i want it to shoot 1 time but it keeps on shooting.
private _realPos = _userInput call CBA_fnc_mapGridToPos;
private _offset = _realPos vectorAdd [50,50,0];
private _target = createVehicle ["LaserTargetW",_offset,[],0,"None"];
private _dummy = createVehicle ["Land_HelipadEmpty_F",_offset];
_target attachTo [_dummy];
[west,[_target,120]] remoteExec ["reportRemoteTarget",_gun];
[_target,[west,true]] remoteExec ["confirmSensorTarget ",_gun];
[gunner _gun,_target] remoteExec ["doTarget",_gun];
[_gun,[_target]] remoteExec ["fireAtTarget ",_gun];
[gunner _gun,objNull] remoteExec ["doWatch",_gun];
nvm i got it another way.
Could you share because that is something i have always been curious about.
I figured i have zeus enhanced and i just used their fnc
https://github.com/zen-mod/ZEN/blob/master/addons/common/functions/fnc_fireVLS.sqf
How do I make a unit exit a looping animation smoothly with the designated end animation?
I have a script for
unit playMoveNow "ACTION_START";
unit playMove "ACTION_LOOP";
``` and a seperate script later for ```
unit playMoveNow "ACTION_END";```
When the second script is ran after the first one finishes (and the animation is still looping) nothing happens and the animation continues. Same thing happens if (which a friend suggested) I use empty quotes `""` instead of the `"ACTION_END"`. The animation still ends and the loop terminates, giving way to the end animation to play, if the unit is shot / dies. Any ideas?
I can put the specific lines here if needed but this seems to be more of a structural issue im facing I havent seen documented on the biki
Did you try:
unit switchMove "";
unit playMoveNow "ACTION_END";
Havent tried that but I'm worried about it clipping directly to the anim end instead of being contiguous like the anims are supposed to
I need some insight into why this is not working:
_m = createMine ["SatchelCharge_F", player, [], 0];
player addOwnedMine _m;
player action ["SetTimer", player, _m];
Not working as in the timer not being set. What object do I need to provide to the SetTimer action for this to work?
Yes, that's the doc I followed. It doesn't work though. The animation is played but the timer is not set.
How do i script so if i leave the area of the trigger a task will be completed currently i have a create task that is synced to a state task (to succeed) and a trigger with no code in it because i dont know how to
In the init function of a module, how would I determine if the module was created from the mission file or by a curator/zeus?
The prupose being, if a module was preplaced in 3den, I dont attempt to open a dialog, but if it was placed by a curator, then I need to open a menu.
When using Stringtable.xml, what happens when an entry does not have the used language?
Will it fallback on Original or to English?
There's no way to make a turret of a tank turn to a desired angle/position just by setting it's animation source value, right? 
IIRC that does work.
yeah, kinda bummed about it
But I could use alt of lockCameraTo
i have a question about HandleChatMessage missioneventahandler.
if i exxecute this eh in player1 ( side blufor) and player2 (side opfor) writes something in the side chat.
player1 eh is triggered with that message?
Furthermore, is there a way to make a turret fire even when no one is sitting inside of it? 
All the fire commands I've seen look like they are targeted towards whoever controlls the turret
If I recall correctly handleChatMessage executes on all machines when someone messages
even a system message will trigger
aka any messages a client sees will trigger that EH
There is "Not present" activation type.
yea... but "targeted" messages, likes vehicle/group/side doubt that is broadcasted to the network
it should trigger
Yeah so if you see a message on your machine, it will trigger that EH
I tried it doesnt work
I put to any player not present
synced it to state of task
Doesnt work
@faint burrow this is what is going on rn
Seems this is a broken scripting function/action, worked around with my own bomb timer script.
Works for me. Try making the trigger server only.
Ok
What does server only do
Checkbox tooltip describes this.
Doesnt work
Have the task been created?
Let me check
maybe it has and im just dumb
The task was on succeed thats why
it wasnt assigned
You can assign it.
There's a page on the wiki for "synchronizing waypoints" where you can link a trigger to a waypoint or a waypoint to another waypoint https://community.bistudio.com/wiki/synchronizeWaypoint
question still is though, what does this even do here? there's a behavior in the editor where you set a trigger as a waypoint activation, is this just the script version of that? there's also the ability to sync two waypoints, which makes less sense. can you set a waypoint to complete once a different waypoint completes?
There are some things you can do with syncing waypoints together, like connecting the waypoints of transport crews and the groups riding in the transports to make them do drop-offs properly. It's a bit opaque though and I never use it so can't offer much insight
Afaik, dont use set trigger as waypoint activation. I havent found a behavior that it works for.
It does work. It makes the trigger activation a condition for the waypoint to complete. So for example, if you have a Move waypoint connected to a trigger, the AI will move to the waypoint position, but can't complete it and move on to the next until the trigger is activated. Or, if used with a Skip Waypoint trigger, it allows the trigger to force skip that waypoint, which is useful for e.g. Hold waypoints.
Source: I've used it
Hello i hope this is the right channel to ask. I wanted recently to tweak some weapon optics to make them a little bit more "realistic" in terms of the usually engagment ranges which occur in Arma 3. For example i would like to change the default zoom of the RHSUSAF ACOG optics, to be less powerful and change the zoom to x2 from x4. Where should i begin?
You're gonna need ✨ a mod ✨
Those kinds of properties of an item can't be modified by scripting. Instead, you'll need a mod that can change the item's config. For that, you'll need #arma3_config .
Btw, I believe the RHS ACOGs have an effective zoom (accounting for the slightly wacky way zoom is calculated in Arma) of 2.9x. Unless we're thinking of different variants of the ACOG. The ACE Arsenal shows the sight's true effective zoom when you select it so it's easy to check (....if you have the game open)
Thank you very much for the response sir! 🫡
Hey i wanna script a helicopter crash and i have the crash but how do i make it so after the plane hits the ground and the player exits damage will be enabled and he will take some damage from the crash
Player damage is disabled so he doesnt die
but how do i make a trigger so its enabled and make him take some damage when it hits
player setDamage 0.5; or whatever you want
0.5 is 50%
or p1 setDamage 0.5;
player allowDamage true; player setDamage 0.5;
Change the condition to check if the heli is on ground and player is not in vehicle, then enable damage and set any.
How do i do that
waitUntil { isTouchingGround Helo2 };
You can't use waitUntil in trigger's statements.
oh ok i did not know that
i would make a script then execVM it from the trigger
player allowDamage true;
i guess i never tryed to use waitUntil in a trigger i guess thats why i didnt know that
but thx anyways m8 @faint burrow
your 1 of the good guys in here also
i hope some day i can be half as good as some of the guys in here
WooHoo Arma 3 yeah
if you use execVM then you can use sleep in your script
Okay
execVM isn't needed.
You wrote that a trigger is used.
I also tried it on trigger
and without sleep
D1 is the player ?
No
What you tried? What the code, any screenshot?
i would name the player like p1 or something like that
i dont need to add a variable for player
i can just use "player"
well that would mean all player right
Its a singleplayer mission
oh ok
Where this code is placed?
Trigger
It has at least 3 fields. Which one?
Wdym
Shouldnt i just put this in an initserver
Let's count: "Condition", "On activation", "On deactivation"... + extra fields. But you provided just the code. How are we supposed to figure out which field this code is in?
Oh
its in on activvation
Í might have fixed it sec
IIt needs to be in condition
Bro when i alt tab sometimes my screen goes black and i lose all of my progress
its so annoying
Your trigger should be repeatable, have condition, where will be checked if if the heli (not player) is on ground and player is not in vehicle, and on activation code, where player damage will be enabled and set some damage. I don't see that.
The heli will get stuck in the trees and never touch the ground the map is tanoa
Check its altitude.
It can be diffrent since its on a hill and allowing damage the wrong spot will just kill the player wont it?
Then determine when to consider that the heli has crashed.
Player touching ground works well though
and im gonna switch maps since the player gets stuck in the trees
OK, then set trigger's statements.
Now when i cant heal because the condition repeats itself
brain fart-
private _magnetPositionCheck = {
params ["_positions","_newPosition",["_errorMargin",0.001,[0]]];
{
if((_x distance _newPosition) < _errorMargin)exitWith{
true;
}
} foreach _positions;
};
exitWith just breaks out of the for loop here, right? xD
also inb4 there's an obvious, and easier way to do this
inb4 ||findIf||
ah
also, exitWith seems to exit from the scope containing the loop (the entire function call in this case, i suppose?)
I thought that, but then it was returning false when I put a false after the foreach
hmm- Should I call it twice or implement a way to give it 1 positon, or an array of positions? xP
you're correct, i'm not*, exitWith stops the loop, execution goes to the next line when i fail less at testing*
Might be useful to do array of positions for the long run- You know "Oh I remember making something that did this, lemme steal that real quick" xD
inb4 inAreaArray then 🙃
Hmm- I don't think that'd work?
basically, I have 2 points. I need to know if point A is in the already handled positions. If no, handle it. Then, if point B, handle that the same way, but with a slight change.
private _roadPositions = [];
{
private _info = getRoadInfo _x;
Points1 pushBack [(_info select 6),(_info select 7)];
if(_roadPositions find (_info # 6)< -0.5)then{
_allObjs pushBack (create3DENEntity ["object","Sign_Sphere10cm_F",_info # 6]);
_roadPositions pushBackUnique (_info # 6);
};
if(_roadPositions find (_info # 7)< -0.5)then{
_allObjs pushBack (create3DENEntity ["object","Sign_Sphere10cm_F",_info # 7]);
_roadPositions pushBackUnique (_info # 7);
};
}forEach _connectedRoads;```
This is, currently, so I can see the roads made in terrain builder, but in game. So if I want to modify them, I can get the start to line up properly.
But also- Oirignally, for another reason I forgot- xD
Heh- my checks for -0.5 b/c- SOME REASON
I think I'll do just 1 test position per call, b/c then I get into having to worry about array index when I look at the results x3
Also wanna get rid of the points thing and maybe swap it out for just syncing in 3den-
wait- what position does create3DENEntity take? o.o
https://community.bistudio.com/wiki/create3DENEntity
meme position iirc
what's wrong sorry? The goal?
That after the helicopter crashes you will take damage and you can heal but you cant heal the damage just repeats itself
Yes
Is there a way to reset the player's torso to being fully upright when creating a camera and having them play an animation?
Reference Image:
When I crouch and interact with the object to open the locker it's a lot better looking:
Might be able to object switchMove ""
Cant remember if it changes torso movement
It does reset the aim but the unit aims again automatically
Maybe try disabling AI aim before switchMove, tho not sure if it works on the player.
If it doesn't, create a temp unit and make him the player until the dialog is closed
Is it set to repeatable?
No
Post a screenshot with trigger's settings.
Quick question how would i apply ppEffect on a specific player ?
What happens with array if we substract all elements. Can empty array exist ? I mean _arr = [];
did you try and see ?
obviously I didn't 🤔
yes
by remoteExec, or better, just doing things locally in the first place
So question would this work on Dedicated Server.
I want a player that enters trough portal to teleport and get applied the effect But only to that player that enterd trough portal.
params ["_trigger"];
private _posToTP = getposASL customPos;
private _trigger = _trigger;
private _playersToTP = allPlayers inAreaArray _trigger;
{
["",["","BLACK FADED"]] remoteExec ["cutText",_x];
//[0] remoteExec ["BIS_fnc_fadeEffect",_x];
} forEach _playersToTP;
uisleep 2;
{
_x setposASL _posToTP;
} forEach _playersToTP;
0 spawn {
private _handle = ppEffectCreate ["ColorCorrections", 1500];
_handle ppEffectEnable true;
_handle ppEffectAdjust
[
1,
0.4,
0,
[0, 0, 0, 0],
[0.8, 0, 0, 0],
[1, 0.587, 0.114, 0]
];
_handle ppEffectCommit 5;
private _min = 30*60;
uiSleep _min;
_handle ppEffectAdjust [0,0,true];
_handle ppEffectCommit 5;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
uiSleep 6;
{
[1] remoteExec ["BIS_fnc_fadeEffect",_x];
} forEach _playersToTP;
no. the ppEffectXX stuff you're doing are all local. other players won't see them (and since you're doing it on Dedi, no one does)
So i would need to remoteExec the spawn for the effect as well for the player that enterd ?
well just make your triggers local
you won't need any remoteExec
plus, triggers are activated by the first unit that enters
so if player 1 enters, the trigger gets activated
and if you remoteExec that, all players will get the effect, even those who are not in the trigger
also, while the trigger is active, if other players enter too, the trigger won't get "reactivated"
so to sum up, make triggers local. their activation condition should be true && {player in thisList} so that they only trigger when the local player enters the trigger
so like this:
/*
Type: None
Activation: AnyPlayer
ActivationType: Present
Repetable: False;
Server Only: False;
Codition: true && {player in thisList}
statment:
[] execVM "trigger.sqf";
*/
private _posToTP = getposASL customPos;
cutText ["","BLACK FADED"];
uisleep 2;
player setposASL _posToTP;
private _handle = ppEffectCreate ["ColorCorrections", 1500];
_handle ppEffectEnable true;
_handle ppEffectAdjust
[
1,
0.4,
0,
[0, 0, 0, 0],
[0.8, 0, 0, 0],
[1, 0.587, 0.114, 0]
];
_handle ppEffectCommit 5;
uiSleep 6;
[1] call BIS_fnc_fadeEffect;
yeah I guess. give it a try 
When using addMissionEventHandler with the additional _thisArgs param, if I were to pass it an array, will _thisArgs be a reference to the provided array, or is it copied into a new array?
Edit: Its a reference
But missionNamespace setVariable public does trigger PVEH apparently.
Also PVEH >>> remoteExec
remoteExec is sheduled and therefore dead to me
hey, I have a question for you, I've been looking on the internet and I can't find the answer. how to make the selected object (in this case the column of smoke I made) visible, rendered from a greater distance from the rest of the surroundings, such as trees and houses. I know there's a way to do it because there was something like that in the "panda nuke" addon. my smoke column composition for example is called smoke 1. thank you in advance for your help.
Thx guys, i will check
I have a few scripts to call for reinforcements and supplies, but somehow they are doubled in the mouse wheel menu, anyone know why? this is one the scripts
"i addAction 3 times, why does it show up more than once" 
What are we supposed to understand from this code and piece of pic
because you add it multiple times with the same name ?
sleep 0
y tho
each team i read this channel there's a whole new bunch of refactor tasks that pop in the backlog somehow
(had no idea about pveh)
if you write a book about best practices in arma scripting i'd buy it
and if it already exists as a blog or something i'd be interested to know instead of finding out along the way
Do you know who Killzone Kid is?
Is it possible to use the setSkill script to make the AI’s skill above 100%? If not, is there some other means of doing that?
Yeah, that's about it as far as blogs go.
Teleport bullets into player?
it's more like a bunch of arma scripting shower thoughts than a comprehensive and organised source for everything about best practices
imo
maybe you could use doTarget . create a script that gives the AI new targets
if you've followed it every day since the beginning then maybe you've got to read everything
but i didn't
There are huge disagreements between members of the Arma scripting community as to what the best practices are.
same as in every other community about anything technical, yet there's a bunch of great books about Java for example
(talking about what i know)
my favorite is clean code
and especially code comments
if you want to see endless arguments full of nerd rage you can read about that
There are some guides about the basics of SQF, but they are outdated. (no params, private keyword)
yet there's one great book about the matter
I'm not looking to give them new targets, I'm looking to see if I can further amp up their skills when it comes to say, accuracy.
indeed
Although from what I'ved picked up its an odd request.
wait private is outdated ?
They talk about private local variables, but never mention the new private keyword
Which is a must and (almost) completely replaces private STRING and private ARRAY imo
furiously looks for private on the bis wiki
private _var = 123;
vs.
private "_var";
_var = 123;
But then again, there are people that believe the private keyword is bad and private ARRAY should be used.
well i can add some more refactor to the backlog
So a "common guide to SQF" would be nothing more than an explanation of everything
What's bad about the private keyword?
Nothing
you don't need to put everything
As in, what do they think is bad about it?
It's the best.
tbh with 50 pages you can cover all the most important
while vs handlers and all that stuff
hello all Merry X-Mass: Soo when my script is called from a radio trigger ,and in my script i put openMap True; How do i have the Map to only open for the player that called the script from the radio trigger Arma 3 ofcorse ?
in the radio trigger i have this && (Local Player) oh and its on a DED server
the map opnes for everyone ATM
X39 for example, said that it's better to use private ARRAY on the top of each script, so you have a better overview of all variables used.
you don't need to side with one solution for each issue, just explain objectively what it's all about, the good sides of each solution, etc
@shell kiln set your game Options to Expert
that's really all i need
or use this in a script
if (!isServer) exitwith {};
{
_x setSkill ["aimingAccuracy",0.000];
_x setSkill ["aimingShake", 0.000];
_x setSkill ["aimingSpeed", 1.000];
_x setSkill ["commanding", 1.000];
_x setSkill ["courage", 1.000];
_x setSkill ["general", 1.000];
_x setSkill ["reloadSpeed", 1.000];
_x setSkill ["spotDistance", 0.000];
_x setSkill ["spotTime", 0.500];
_x allowFleeing 0;
} forEach allUnits;
change the upper 2 settings to what ever you want
and the bottom 2 settings also
can just call the script from the initServer.sqf
name the script Ai_skill and call it from the initServer.sqf 0 = [] execVM "Ai_skill.sqf";
While I think that it should be completely avoided
It's not even worth learning the syntax , imo
Did that already.
This can be applied to specific units via Eden right?
yes it will work on all Ai
But I'm biased I guess , I don't know the syntax myself - never bothered.
Just set the skills for the specific unit(s) rather than looping over all units
I wanna make them higher than 100% though.
You're seemingly having your trigger run on all machines, so it opens the map for all players
I'm curious if scripts can do that.
yeah how do i change that
They're clamped to 0..1
well the trigger is on a DED server
So there's a hard cap at 100% then?
Yes
i did quite a lot
Can you show your trigger settings?
until arma 2 i guess
ummm yah i have in the condotion this && (local player)
then in the onAtvation i call the script
I mean just like a picture of the menu
You'd want the trigger to be set to local only Nevermind that setting is "Server Only"
oh i dont know how to do that
started with ofp so there wasn't really a choice back then
They're quite dependent on the weapon used, so you can give them broken weapons to make them stronger. That's either config or exploiting poorly written mods though, not script.
yeah i want only the player that called the script to have the map open
Yea.
inside the script i have openMap true;
Non-server trigger's statements are local to player.
Been a long time since I touched triggers, but apparently thisList is empty when triggered via radio. Which seems odd
I would've imagined it'd be an array with just the player that used the radio
oh so mayb thistrigger
thisTrigger is just the trigger object itself
hmmmm i see hmmm
But why explain the past?
Ah right, thisList is for units in the trigger's area, so a trigger with no range would have nothing
right right i get that hmmm
nostalgia :p
maby i should make the player open the map and not make the script open the map
that probly would fix it
Yeah I'm not sure if you can detect what unit used a radio activated trigger
ahh i see ok
let me see what i can come up with as always DART love you m8
your my Fav guy in the hole world
he he
^ this is probably a big reason why there are disputes about best practices
ill have the script close the map but ill make the player open the map and the script will detect when the map is opened
thx again and again for your help @tulip ridge
"I always done it that way"
again, same as everywhere else
WoooWa that worked Awsome WooHoo Arma 3
hell yeah
now when my friends are flying a chopper the map wont open on them lol
i've had some great time forcing people to use the new stuff in java 8 for example
and the cancel script call, also worked, if the player close the map after opening the map
nice nice nice
because i didn't tell them "it's better" but explained why it was better
in turn forcing me to learn more about it
You are a wise man, haha.
OH i may need to give a (time limit) to how long the script will w8, for the player to open the map
say the player never opens the map lol
after the radio trigger call
i dont want the script to wait very long for the player to open the map
ill bb soon my friends, if i may use the term (friends) WooHoo Arma 3