#arma3_scripting
1 messages ยท Page 218 of 1
Yeah, its still spooled up amd ready to go, infact if it takes any fire at all itll take off and fly a littl ways away before coming to a hover.
Im away from my computer now, but that posted segment of code was an extract before the next two waypoints for exfil get added for the helicopters, gunship and non- alike, to follow, which work fine. If the errant 'Waypoint' is deleted the Mi-24 takes off and leaves.
Otherwise, everything works as well as I could hope for (okay, some oddity with units being added to the curator interface but im working on it); the only hiccup is the Loiter waypoint not operating correctly.
Ill give an interceding MOVE command a try first, since my alternative is a sleep 180 - and while I dont intend to use this more than once at a time, that still feels rough xD
Woohoo: What you waiting for Gi, Get Your Ass in here: ๐ thx Nikko ๐
sorry im having so much fun i can't help it
Quick question does anybody have a working garage system in arma 3 that they can share.
I need a option where i can save and load vehicles to it.
https://github.com/HakonRydland/A3-HR-Garage/tree/main
Something like this system would be perfect just the problem here the loading of saved vehicles is broken.
When you load from save it gets error at this location:
A3-HR-Garage/HR_Garage/addons/Garage/Core/fn_reloadCategory.sqf
//Line 34
_y params ["_displayName", "_class", "_lockedUID", "_checkedOut", "", ["_lockName", ""]];
private _index = _ctrl lbAdd _displayName;
_ctrl lbSetData [_index, str _x];
_ctrl lbSetValue [_index, _x];
expected number got array and i dont know how to fix this.
might be the loiter radius, try to increase it
@fleet sand You could try the version from Antistasi. Has a lot of bugfixes.
Hmm, load from save like vanilla save though?
No there is a save fnc that gives me hashmap of allvehicles and their status in garages. And if i want to load that in next mission i just load that hashmap.
ah ok, fine
hello all again: Can we add a Killed EVH like this to a enemy group
_grp addEventHandler ["Killed",{
[_this select 1, _this select 0] spawn EnemyDead;
}];
Nope, only units.
ahhh darn ok
Parameters are different so you'll need to tweak.
yes sir thx you m8
Can just add it in forEach
I was thinking of that just its gonna be pain to go trough each file and try to get rid of antistasi fncs that are intergraded.
Example like this:
```sqf
private _systemTime = systemTimeUTC;
if(_lockTime isEqualTo []) then {_lockTime = _systemTime;};
private _timeSpan = [_systemTime, _locktime] call A3A_fnc_systemTimeDurationToTimeSpan;
_tooltipText = format [localize "STR_HR_GRG_Feedback_LockedToolTip_Ago", _tooltipText,
[_timeSpan, 0,0,false,2] call A3A_fnc_timeSpan_format
In here: https://github.com/Antistasi-Ultimate-Community/A3-Antistasi-Ultimate/blob/unstable/A3A/addons/garage/Core/fn_reloadCategory.sqf
Antistasi Ultimate - Discord https://discord.gg/antistasiultimate - Antistasi-Ultimate-Community/A3-Antistasi-Ultimate
whoops
what was that again @hushed turtle was that to me ?
Who put that in there :/
lol
Unless you need the lock time functionality you can just delete that section.
In general there shouldn't be Antistasi calls in the APL-ND bits.
That one was clearly missed in review :P
Yeah, but I dunno what are you trying to do
I know but this is another example where i would need to go trough each file:
there is a few files that are litterd with A3A fnc.
private _nodes = [HR_GRG_dispVehicle, _static] call A3A_Logistics_fnc_canLoad;
if (_nodes isEqualType 0) exitWith {};
(_nodes + [true]) call A3A_Logistics_fnc_load; //we know we can load it, just need the nodes from can load
hintSilent ""; //clear load hint
Antistasi Ultimate - Discord https://discord.gg/antistasiultimate - Antistasi-Ultimate-Community/A3-Antistasi-Ultimate
@hushed turtle yeah i'm trying to add a Group Killed EVH to a group
Groups don't get killed
Only deleted
But that happens later when group no longer has any members
If at all
_group addEventHandler ["UnitKilled", {
params ["_group", "_unit", "_killer", "_instigator", "_useEffects"];
// not sure what to put here
}];
What are you trying to do?
well umm i have this function i made and for the enemydown part i need to add EVH to the group to be dead
so it can spawn the next part
Do the spawn part when there are no alive group member remaning
Not sure what your intended purpose is but there is an Altis Life framework built off the original one made by tonic that I'm pretty sure has one. Gonna be years more out of date then Antistasi but if it helps as a reference.
ok i'll get it i may have to split the Function into 2 parts
or 2 functions
well thats the easy way anyway ๐
thx so much m8
i know im over thinking it but well you know ๐
im not sure what you ment when you said do the foreEach thing
if (({ alive _x } count units _group) == 0) then
{
// Do stuff when everyone in _group died
};
ahhh ok i see ๐ ok cool thx m8
Also FWIW tho depending on what you're doing might also just be better off making your own. Our vehicle garage is actually the most sickening spaghetti code there is due to it just being old. Only thing you really need for a garage system is a hashmap like you mentioned and whatever you wanna have along with it and a UI that references the vehicle class config for it's icon and details.
If you do that tho my advice would be is to store the vehicle attributes as a hashmap or an array which can be made as such. Just so you don't have to deal with array hell whenever you wanna add a new feature or something later.
@hushed turtle how does this look is this ok m8
_grp addEventHandler ["UnitKilled", {
params ["_group", "_unit", "_killer", "_instigator", "_useEffects"];
if (({ alive _x } count units _group) == 0) then
{
0 spawn EnemyDead;
};
}];
Is EnemyDead global function? Then yeah
And it's _group, not _grp
It's _group in EH code
oh i see
ok Awsome
i fixed it
see up there
ok now to test it woohoo ๐
oh hell yeah Woohoo thx so much Guys works great @hushed turtle @granite sky
i have an issue where when i createDisplay "RscDisplayEmpty" and add a button to that display then whenever i press anywhere, my button dosent get highlighted when i hover above it with the mouse cursor, is this known issue and how can i fix this?
you cant click the button?
yes, and it doesn't get highlighted like blinking when you hover above it
well make sure the button class is ok
this only happens when i click somewhere on the screen
maybe your display looses focus dunno
is there something like a priority order?
no
setFocus
this solved my issue thanks
How does one get all available 3DEN layers via SQF?
Hey
Is anyone here by chance good at scripting in SQF? I'm very bad at scripting in general, and trying to fix one issue for around a week already. It's mission editing related. Would be great if someone could offer some help 
I'm trying to make A2/A2OA Warfare work with custom Map/Addons.
Fortuntaely there wasnt a single issue with making it work with custom map, even without predefined positions.
However, when im trying to make warfare use a custom faction, trying to fix it became a nightmare for me lol.
I'm Referring to "Warfare 1" Wiki on Bohemia but it seems to be outdated. If I'm correct, it just says to change classnames for each side and for each soldier but by doing it nothing changes.
In my mission folder I have
InitMission.sqf file which then goes to Init_Common.sqf
InitMission.sqf
BIS_WF_Common SetVariable ["customInitCommonScript","Common\Init\Init_Common.sqf"]; // Using a custom common script.
BIS_WF_Common SetVariable ["customInitServerScript",""]; // Using core server script (Must always be included even when no custom server script is used.)```
And in **Init_Common.sqf**
BIS_WF_Common SetVariable ["eastFactions",[Localize "85_SOV_Army_TuSG"]]; ||85_SOV_Army_TuSG is custom faction cfg im using||
BIS_WF_Common SetVariable ["EastHQIdentity","WFHQ_RU"];
ESOLDIER etc. I have addon classnames and it seems that they spawn normally, same as EREPAIRTRUCK etc.
I also have set eastDefaultWeapons and resistanceDefaultWeapons which work fine as well.
And at the end of Init_Common.sqf I have this script
[] Call Compile PreprocessFile "Common\Config\Config_Structures.sqf";
This file seem to work fine as well. Without any "Config_Barracks.sqf" it just defines standard Takistani soldiers and vehicles, but as soon as I add a Config_Barracks.sqf file ( even from vanilla missions ) it completely breaks and there is nothing in the buy tab.
My guess is that it lacks some definite script which would tell Arma to use the classes defined in Configs such as Config_Barracks/Config_LightFactory etc, but with my retardness and lack of general knowledge in scripting is nearly impossible ๐
I also tried looking about any info possible on BI forum and official Wiki and using Warfare missions given by BI itself for Arma, but it didn't work.
going to a server just to download a mission, then trying to edit it and realize its rockets science
just join the server and have fun
I may have not have made myself clear.
Me and my buddies play A2 Warfare and I'm trying to make my own mission. I didn't go to any server. I've downloaded Example missions provided by Bohemia Interactive and official BI Warfare missions such as "Civil War" on Chernarus.
in general when you just start with sqf open a complex mission and trying to understand/edit is the worst way to learn
better start small and gradually learn by doing simple missions first, sorry if this doesn't help you
guys here will help you but only if you understand what are they writing in sqf otherwise is pointless
Hey,
Maybe one of you has an idea.
I have a function ([] spawn max_phone_fnc_initPhone;) that is not being executed.
It doesn't matter whether I execute it on the server side or client side (in the initFiles).
But when I put it in the debug console, it executes immediately without any errors or problems.
There are no error logs for this file, only โconsequential errorsโ that occur because this file was not executed.
It's the AltisLife Framework.
If it's working in debug console and it's not working in your mission then you need to likely change where it's being executed.
If you're using remoteExec make sure you have it whitelisted for CfgRemoteExec.
Are you able to give more details on where you're attempting to spawn it, how the function is declared and confirm you have script errors enabled?
Hey ,
i just spawn it like in my message above.
I spawn it in a file that is execVM in the initPlayerLocal.sqf
so initPlayerLocal.sqf
#include "script_macros.hpp"
/*
File: initPlayerLocal.sqf
Description:
Starts the initialization of the player.
*/
if (!hasInterface && !isServer) exitWith {
[] call compile preprocessFileLineNumbers "\life_hc\initHC.sqf";
};
CONST(BIS_fnc_endMission,BIS_fnc_endMission);
[] execVM "core\init.sqf";
[] execVM "briefing.sqf";
and then
core\init.sqf
[...]
{
_x params [["_chan",-1,[0]], ["_noText","false",[""]], ["_noVoice","false",[""]]];
_noText = [false,true] select ((["false","true"] find toLower _noText) max 0);
_noVoice = [false,true] select ((["false","true"] find toLower _noVoice) max 0);
_chan enableChannel [!_noText, !_noVoice];
} forEach getArray (missionConfigFile >> "disableChannels");
if (life_HC_isActive) then {
[player getVariable "userID", player getVariable ["realname", name player]] remoteExec ["HC_fnc_wantedProfUpdate", HC_Life];
} else {
[player getVariable "userID", player getVariable ["realname", name player]] remoteExec ["life_fnc_wantedProfUpdate", RSERV];
};
[] call life_fnc_hudSetup;
[] call life_fnc_globeLoop;
[] spawn theprogrammer_core_fnc_clientInit;
[] spawn The_programmer_Duty_fnc_init_Service;
[] spawn max_phone_fnc_initPhone;
if !(profileNamespace getVariable ["license_civ_driver_removed",false]) then {
license_civ_driver = false;
profileNamespace setVariable ["license_civ_driver_removed",true];
[2] call SOCK_fnc_updatePartial; saveProfileNamespace;
};
diag_log "----------------------------------------------------------------------------------------------------";
diag_log format [" End of Altis Life Client Init :: Total Execution Time %1 seconds ",(diag_tickTime - _timeStamp)];
diag_log "----------------------------------------------------------------------------------------------------";
What does max_phone_fnc_initPhone contain? Are you able to jump in https://discord.com/channels/105462288051380224/107506974056280064 and screen share?
Without having more details really tough to say what the issue is. What my head goes to though is some variable is not set at the time you spawn the script. Could add this at the start of max_phone_fnc_initPhone to rule it out:
waitUntil {time > 60};
hey sorry for the late answer
if you are still there, i am in sub_alpha
Machine network ID
A server always has an ID of 2, every new client has the next number (the first client will be number 3, second client number 4, etc.)
Is this correct on the wiki? I always get ID 4 when I connect first, there are no headless clients
My recollection is that the first client gets 4. I wouldn't count on it though.
That's true, server is 2, first client is 4
Is there EH like this but for units? This works, but no way to tell which unit in group changed command
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CommandChanged
It fires when I order(through command menu) one of my unit to move example
But it seems like it's the leader yeah
_this in the EH is for example: [B Alpha 1-1,"MOVE"]
Looks like I don't need it anymore, but would like get position where unit is heading when executing order, like when ordered to move by his leader. I don't see any command, which would return that though
have you taken look at https://community.bistudio.com/wiki/expectedDestination ?
In multiplayer, is there a distinction between the eventhandlers used for dying, and manually respawning?
you want to know if player manually respawned?
there's no support for this that I know of. I made ticket if we could get the functionality: https://feedback.bistudio.com/T183660
Bugger, okay
but with the help of people from here i made function to do this
Ooo!
playerManualRespawnCheck =
{
while { true } do
{
private _display = findDisplay 49;
private _respawnButton = _display displayCtrl 1010;
// Create the button event when display is created again
if(!(_display getVariable ["respawnButtonSet",false])) then
{
uinamespace setVariable ["escMenuDisplay",_display]; // Message box uses this display (the menu)
_display setVariable ["respawnButtonSet",true];
_respawnButton ctrlAddEventHandler ["ButtonClick",
{
private _ctrlButtonOK = (uinamespace getVariable "escMenuDisplay") displayctrl 235106;
[_ctrlButtonOK] spawn
{
params ["_ctrlButtonOK"];
sleep 0.01;
// If player clicked ok to make respawn
_ctrlButtonOK ctrlAddEventHandler ["ButtonClick",
{
player setvariable ["manualRespawn", true];
}];
};
}];
};
sleep 0.1;
};
};
``` something like that not fully tested so i hope it works
iirc, when you respawn, the unit and the killer is the same in the killed EH
I see... I'll look into it, and see if this script works. Thank you both for the help!
hello all: So if i create a ammobox Box1: by scripting: and i add a killed EVH to the Box1 does the Killed EVH go away after the box is killed
i think it does but im not sure now
The Killed EH is attached to the box. The box can only be killed once. What do you imagine the Killed EH would do after the box has been killed, even if it isn't deleted?
i see thats what i was thinking
so i also repete spawning the box and also adding the EVH to the new box1
after the old 1 is killed of course
but now im sure ๐
i'll tell you what: it sure is fun learning from you Nikko ๐ thx so much you make me Smile ๐
You have to create new killed HE for new box
Only exception to this rule are some persistent EHs on players, which stay on player even after respawn
Yeah, I've assumed engine is clever enough to clean up this stuff
A lot of object EHs do actually persist on the corpse/wreck after death; for example, the Hit EH can still fire if a dead object is hit again. AddActions also persist. But the Killed EH in particular just...can't fire even if it does remain, so unless you're doing some real weird stuff with that death-reversing setDamage syntax that isn't on stable branch yet, it doesn't matter.
For buildings you can resurrect them and the only thing that breaks is the Killed EH :P
In some cases the EH still fires, just with objNull as the unit.
I think that was probably EntityKilled rather than Killed though. I forget.
Buildings swap model for destroyed ones, so I guess that's what breaks it
Ah no, it was Killed.
So in fact the EH is not removed on death.
Not really, the original model is still there and when you run setDamage 1 it pops it back up to the surface and deletes the ruin object.
Everything else works fine as far as I can tell. AI pathing, doors, whatever.
BuildingChanged EH still works too.
Look at code found on setDamage page:
0 spawn
{
private _house = cursorObject;
_house setDamage 1;
sleep 5;
_house setDamage 0;
};
It makes it look like destroying buildings creates new objects(the destroyed ones)
Maybe the problem isn't the ruin but the intermediate damage stages that buildings have.
There is a lot of object-swapping going on.
it does create a new destroyed building
@hushed turtle yes i created a new killed EVH for the new box yes
but for the enemy groups killed EVH i remove the EVH
or you what i mean right
Interesting shooting dead corpse lol ๐
Is there a way to have the AI set their collision lights on while in flight and have their combat behavior set to "aware or combat" ?
C17_1 setCollisionLight true;, C17_1 action ["CollisionLightOn", C17_1]; , _vehicle setCollisionLight true;
and nothing worked, also I tried the enable lights in the Editor as well.
you need disableAI "LIGHTS"
Thank you it's working perfectly now
Hey guys, I have a question: Right now I have put my server to the Veteran difficulty. Therefore we don't see waypoints on the screen (the grey thingy showing you where a waypoint is). That is okay, actually that is what I wanted. I only have one problem...I would like to have that enabled for pilots. Be it for everybody who is in an air vehicle or only for specific role....both would be okay. Is there any way to achieve that?
Maybe an addition: I'm speaking of self created waypoints...those you can put on your map yourself!
@Moony you mean the map shift + click marker, right?
Thats the wpperm or something. I disabled it on my server. Still works for players in sophisticated vehicles.
@spring stone If you use something like Ctab (BluForceTracker - https://forums.bistudio.com/topic/156970-ctab-commanders-tablet-fbcb2-bluforce-tracker-uav-and-helmetcam-interface/), I'm pretty sure it will show up on the radar of the vehicle. Could work even without Ctab but I haven't tested it.
for my mod I have a read/write extension, this is the code I have some pretty basic security functions I am wondering if they are good enough or not. I feel like I have overlooked something major
Security against what? What exactly is your threat definitions? Are you running it on the server or client? Doesn't matter much much the extension is secure if there is possibility to inject arbitratry strings the extension
It is a client side mod, right now I have made sure that the user themselves can't make too many or too big files. I plan on using this for more mods which people will have loaded on multiplayer so there is a possability for other players to interact with it. To counter that I have limited the file path and types to hopefully not access system files using std::filesystem::canonical
Okay, but I still don't understand the threat. You do all kind weird stuff to erase PE headers, prevent debug attachments, ensuring zeroing memory after use, indirect comparison via hashing etc.. So one might think you want to prevent Clients from reading the data, that is servers might possible store client-related data on the client you don't want client to read. So you protect the memory.
But then waht the extension is doing is being a key-value based storage based on files. But the files are completely unprotected and accessible.
(Successfully) restricting calls from going outside the "root" might protect read of user's file, but that still enable other attacks like just spam-creating entries. Or a bad mod overwriting a good mod's keys.
yeah thats a fair point, tbh I just put in promt in antigravity tell this code to be more secure. I don't really know much about coding. This is what I made at first
I suspected something like that. But that second paste looks much more reasonable; I wouldn't let the first one run on my system, for sure!
While protecting the extension from the client is running can have its uses the main threat is that you are indirectly doing stuff on the user's machine via user input. The most secure way is to run extensions server-side only, with server-side code. That prevents a lot of possible attacks.
If that is not possible, and you do not have 100.000% (yes that many zeroes) over what SQF code executes, then you are in a very hostile environment. Someone could run your extension with arbitrary input, so anything you extension does to the system is a possible vulnerability. In your case you are interacting with the file system and based on input to your extension opening and reading files. Trying to prevent .. and symlinks is admirable (and the only "legit" thing in your first version IMO; though I am not sure that will be enough!). Would you be confident it is 100.000% not somehow able to "escape" any file root access "sandboxing attempt" and access C:\Users\username\AppData\BitCoinWallet\Wallet.bin ? And since they managed to trigger via SQF it is not impossible they could extract the READ data either. This is the threat environment you have positioned yourself in with a client side extension with system access varying by user input.
Honestly, I would recommend not composing paths and maybe use SQlite (it only uses few files for many entries) or something with fixed path (or at most a single basename with only alpha-numerical symbols).
This is also getting offtopic, non-SQF based extension development belongs better in #arma3_tools probably.
that's really helpful advise, it does seem like SQlite is the better option in this case as I'm only storing object data. If I have any more questions I will be sure to ask in #arma3_tools
hey guys! Time ago in order to sync 2 animations using a game logic with "this attachTo [logic1, [0,0,0]];" would make the 2 AI soldiers start the animation on same time and play till the end sync, now I tried again but does not work anymore? I mean, they start to play the animations but they are not sync at all
it was probably only random. there's no such thing as syncing animations with attachTo
I'm pretty sure it would work like a charm, but I just came back after 1 year and I forgot few things
this was a message from @warm hedge : Prepare 4 units, name they, attachTo to a GameLogic (className: "Logic"), play animations same time.
it used to work, now it does not
to "sync" them you just need to play them at exactly the same time:
isNil
{
sol1 switchMove [_move];
sol2 switchMove [_move];
};
sorry, prob I explained badly...I meant to sync animations that ARE SUPPOSED to be sync.. like the "abuser" one...
oh that's what you mean. it could be related to order of object creation maybe? what's your setup?
so, I placed a game logic named "logic1" then on first soldier I put this in his init : this attachTo [logic1, [0,0,0]];this switchMove "Acts_Abuse_abusing";
and this on second soldier : this attachTo [logic1, [0,0,0]];this switchMove "Acts_Abuse_abuser";
years ago game logic would sync them up perfectly, now I'm not able to get it done lol
in debug console run attachedObjects logic1 and see if they're attached (after running the scenario)
why the array version ๐
What am I supposed to get after this? a log?
it also does playMoveNow. some animations don't play unless you do _x switchMove _y; _x playMoveNow _y but the array version does playMoveNow internally
you see? they mix up lol
I literally just tested it and it works fine
you tried the 2 abuse animations?
yes
can you please paste here the codes you used?
your exact code
also, out of curiosity, the 0,0,0 on game logic is "standard" right?
for these animations typically yes
it runs smoothyl without them overlapping with each other?
and this is the logic
yes
you probably didn't name the logic correctly. check it again
could be if they change the animation timing or something
it's correct indeed
try without mods 
is it normal when I start the mission the 2 soldiers get teleported some meters away? shouldn't they stay on game logic same position?
depends on the animation
oh yeah cause the animation needs some "space" to happen right
yeah that's why you do attachTo to make sure their origin is synced, but the position of the body in model space can be far from origin
it could be because some mod you're using does setDir maybe? here's another thing you can try:
this spawn
{
sleep 3;
_this attachTo [logic1, [0,0,0]]; _this switchMove ["Acts_Abuse_abuser"];
}
and same thing for the abusing anim.
mmm no I aways get the abusing one too much forward from the other
Anyway, thanks a lot man, I'll try without mods and see otherwise...its ok anyway, I won't record those scenes lol
@warm hedge I summon you from the scripting abyss ๐
did you try this? it just shows you an array in debug console
@spiral trench Yes I mean those @frail dune Actually we use cTAB. I also have to say, that this request comes from my pilot. I was not able to test if it is working or not (since I never use these marker). I'll do it now ^^
yeah man I tried but I dont get any feedback
works without mods
also, says "true" while playin the game
sorry
false
I meant
so maybe its a mod problem?
idk. maybe a mod is deleting your logic
๐ฎ
you mean with mods it returns false? or without? (without mods it's correct so it should return false)
well actually no that's not it. it would still return false in that case (but isNull would return true)
with mods says false, I still have mods loaded in game
hold on, I tried again with those WW2 mods and now it works lol
let me see if it's fixed now
the magical game restart always works...
works good now
lol
@little raptor reaction now :
xD
yeah 
thanks a lot again man
How about this @spring stone ```
onMapSingleClick {toLower typeOf player find "pilot" == -1}
trying to do a custom sector control similar to HLL. my plan was once a sector is captured the next becomes available to attack while the one just captured has to be defended. once the second point is captured the first one becomes unavailable while the third turns on to attack and so one, same in reverse, if a sector is lost the one that could be attacked becomes unavailable while the 1st has to be defended again. also having vehicles and objects spawn in on the first sector once captured and respawn once destroyed and stop spawning if that sector is lost.
Okay, I should add that I'm shit at scripting but I'm learning it atm...therefore it would be very nice, if you could quickly explain what this does (as I said, learning scripting and it would help me ... learn xD)
AAS style?
if that includes a back and fourth instead of normal aas where once its captured thats it than yes
@frail dune Now I know what you see and yes it does but my pilot is actually not interested in the directional aspect of this marker that much but in the distance this marker shows him ^^ That something cTAB does not accomplish
@spring stone It will just prevent shift + click markers from being placed if the unit placing them does not have "pilot" in its class name.
Mhhh, that could actually be a workaround. I'll look into it. Thank you for the help! ^^
Two questions:
How can you show the map UI in a texture like in the Expeditionary forces Combat Boat...
and... Would it be possible to show the radar UI in a texture, like the map?
I mean AAS like from Project Reality, that's the model that I have
In theory you can put any UI on a texture.
You could alter it for pilots in the sense they are in the pilots seat of some air vehicle, like so onMapSingleClick {vehicle player isKindOf "Air" && driver vehicle player == player}
Anybody remebers the way to check, if a player is inside a building?
@spring stone Give your pilots an Android tablet or something similar? If you have the map tools activated on the tablet you will see information like bearing, distance and altitude on whatever you point at within the interface map.
@frail dune While thats true, its very unhandy going onto the big screen while flying each time you want to know the distance to the AO. Also the biggest problem is, while on the big screen the game forgets every input and you will slowly go to the ground ^^
Yep. It doesn't cancel the input or anything for me, so I think that might be a joystick issue? Either way, I see what you mean. This is why we need working and interactable MFDs with terrain following radar and GPS markers ๐
It does it for me (Keyboard and Joystick) and yes...you are right T^T
RHS has a very basic terrain radar in their jets, but it's very rough. Not interactable or anything, but still very cool.
I wanna make my own radio system on the game, using radioChannelCreate etc. I will need to override push to talk keybind, and possibly enable / disable push to talk as well. All via scripting or modding.
Any way of doing that?
The idea is to have the player talking in a different channel for each keybind
How about this @jade abyss lineIntersects[visiblePositionASL player,AGLToASL(player modelToWorldVisual [0,0,10]),player];
nah, there was something different, since this one doesn't react, when the player is watching out of the window ๐ฆ
just cant remember..
I'm pretty sure there is no command, you can only check via some scripted solution usually involving some lineIntersect* command.
ha, boundingbox
Yeah, my problem with bounding box is it's not particularly accurate, but I guess it can be sufficient in some cases.
and youd want to use boundingBoxReal
How does the say3d work, I have this
class CfgEnvSounds {
sounds[]={};
class battle2
{
name="battle2";
sound[]={"battle2.ogg",db+10,1.0,160};
soundNight[]={"battle2.ogg",db+10,1.0,160};
};
};
class CfgSounds
{
sounds[] = {};
class sound1
{
name = "sound_1";
sound[] = {Missaaukko.ogg, db+10,1.0,160};
titles[] = {};
};
};
EnvSound work great
On AI charecter I have this
this say3D "sound1"
Indeed, specifying group for once ain't clear enough
_grp setCurrentWaypoint [_grp, 1];
what is the issue you encounter?
None, I'm just making fun of it 
I guess there is no way to tell, if waypoint got completed, because leader got stuck and just decided to skip the waypoint
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#WaypointComplete
Maybe you can just ask the people to disable push to talk manually, and make your own push to talk system via enableChannel / disableChannel ๐ธ
Does anyone know what triggers Land_FirePlace_F to actually light the fire? Had a look at the config in the config viewer and didn't find any UserActions sub-class. Trying to execute some code when the player lights the fire or puts it out.
I don't see stackable version of this EH. It should allow to catch when player puts on fire
https://community.bistudio.com/wiki/inGameUISetEventHandler
Thank you, I'll try that.
Hi, I'm new with scripting. I like to unlock a gate with a trigger but something is not working correctly. It must be something simple but I don't get it. ๐
When I step on the trigger I hear the activating sound but gate is still locked.
lock is for vehicles. To open gate you need to play animation
For that you need to look in config for gate's animations and play it using command
ok, I can't change the value in Doors States with script?
You can do that with script
You can open any door or gate in buildings using script
Can someone tell me what a 'background control' is? aka the difference between class ControlsBackground and class Controls in Arma UI scripting
gate1 animateSource ["Door_1_sound_source", 1];
Perfect ๐ซก , thx
Gates are considered buildings and the gate is a door. Locking doors on buildings is done with variables: https://forums.bohemia.net/forums/topic/152949-lockunlock-doors-on-a-builing/
This was my first idea, but I don't know how to find the correct name.
It's in config
can camCreate be used reliably for an admin menu? (100 - 200 cameras)
EDIT: I guess not because of the inmense amount of rendering needed
why you need 100 cameras at the same time? just move the camera
The idea is to have some sort of control room
But considering the limits of the
human eye, might wanna make it 10 or 20
20 pip rendered cameras?
fake it with some video, you will destroy performance just for a background
Can anyone confirm the rope length is actually capped to 100m, or it is defined in a config?
i remember John Jordan says yes capped at 100m
I'm still trying to figure out how to modify a backpack on the ground. Using TFAR, I want to set the backpack to speaker and frequency 70.0. Putting the relevant code into the init does not work, I assume due to it being in a groundweaponHolder. According to nkey, who made TFAR, I would have to use the everyBackpack function to reference the backpack, but I'm unsure how to do it exactly (I'm a bit of a scripting noob). I need these two functions to be executed on the backpack:
[_x, "radio_settings", "70.00"] call TFAR_fnc_setLrFrequency;
[_x, "radio_settings"] call TFAR_fnc_setLrSpeakers;
Here's the post I made on the forums as well, for reference: https://forums.bistudio.com/topic/159393-task-force-arrowhead-radio/?p=2975208
That was just what I saw from testing. I wouldn't know about secret config vars.
there's some config properties for how long the rope can stretch etc and ones for slingloading
but thats about it
ie.
class CfgSlingLoading
{
ropeLength = 10.0;
hookMinRange = 4.0;
abortHeight = 20.0;
abortRange = 15.0;
unwindSpeed = 2.0;
slmMaxAltitude = 40.0;
};
class cfgVehicles
{
class Rope: All
{
access = 0;
scope = 2;
displayName = "";
simulation = "rope";
model = "";
side = 8;
maxRelLenght = 1.1;
maxExtraLenght = 20.0;
alwaysTarget = 0;
irTarget = 0;
irScanRangeMin = 0;
irScanRangeMax = 0;
irScanToEyeFactor = 1;
laserTarget = 0;
laserScanner = 0;
nvTarget = 0;
nvScanner = 0;
artilleryTarget = 0;
artilleryScanner = 0;
};
};
Thanks, much obliged
Did anyone get issues with setVariable global being not reliable since last patches?
Like some clients not getting some\all variables assigned to entity
I can't confirm it but looking at what's going on in the mission this is what I think happens
Considering how fucking broken MP since last few patches with people floating on top of vehicle, no uniforms and such this looks like possibility
Floating on top of vehicles? oO Never heard of that one.
It happens all the time on our servers since last one or two stable patches
People get into vehicle, their body floats around and other can get into same seat. Happens with any seat, not just gunner as it was since A2
Sometimes people get out of vehicles, they walk around and shoot others while everyone (maybe only some?) see them inside vehicle
Both in King of the Hill and Wasteland.
is a there an ingame function or script that spawns flies/insects? i remember there was one but im not sure if it was vanilla
There is but I don't think it works as it was originally written for arma2
i found it but it dosent have the sound effects will have to add it myself
Sent a DM
oh wow oO
I remember... wasn't there a bug several versions before? When you ran-over someone (but didn't killed him) -> Nobody could see him
yes its been there since alpha and still not fixed
For a short period it was fixed, then came back iirc
playSound3D [ "a3\missions_f_oldman\data\sound\flies\flies_02.wss", _obj,false,getpos _obj,.3,1];
I donโt understand at all how to adequately set up Color Corrections so that it turns out natural, and not as if someone put a colored film on the screen. I want to create a slightly grayish and slightly white effect for the snowy weather. But the color correction always seems unnatural.
Bruh....
Not sure what is unclear in the instructions in BIKI, what is your intention and code
I'm pretty sure you can tweak it to your liking, just experiment with it
Whatโs the technical explanation of the bug that makes you be stuck to walls and die while floating? The animation while it happens is afalpercmstpsnonwnondnon
And the player seems to behave like on a freefall (Z vector rapidly decreases). I suppose the death happens when the player gets unstuck and the negative Z vector makes it act as if it had fallen to the ground (handleDamage EH also behaves the same way when you intentionally jump out of a building). But why the hell would it get stuck in the first place?
The engine thinks you are falling and increases your velocity and then at some point you get killed.
I wrote a small script to counter it years ago. Example video and code here: https://github.com/ELRabito/Exile-Anti-Floating-bug-script-aka-stair-bug
Weird as hell right? Why would the player get stuck!
#arma
I died hundreds of times to this bug and wasted a lot of time as player when i played Exile.
I was so angry and swore to fix it, without knowing anything about scripting xD
Thatโs great
Well, itโs really well done imo
I was about to start doing lineIntersect ๐
does anyone know a good way to prevent parachute opening when player respawns? when respawning at carrier this sometimes happens and its not just visual thing but I think the chute sometimes kills the player
no just normal respawn at marker/position
they don't open parachute
ya they shouldnt....
remove mods and try again?
very little mods but i can try that too
well cant repro it on new mission so it could be just my mission and lag that causes it or my mission does something weird
hmyep, otherwise I don't see what is happening
i know for a fact that lag can cause weird things in respawn, i even made ticket about it
so who knows ๐
Arma'd
wow i just spawned in water with the parachute too ๐ฎ
yep got a repro now ๐
same thing without mods
zomg, more Dedmen werkz for 2026
late christmas present to the devs ๐
its because if the respawn point is not at the carrier deck height but above it, then player respawns in water.. and very deep
i will definitely make ticket about this once i get the time
ah yeah, something like "15m above waterโฆ no carrier surface? OK, make it 15m above terrain"
yeah weird
It happend to me yesterday. Decided to go dowm from rock(2m above ground), hit some wooden boxes while falling down and just died seemingly for no reason
@proven charm this can be rectified by getting PosASL of the object when its on deck and then setting it right after spawn
ya this could be fixed in some ways but my initial thought was that its bug that needs to be fixed
Is there way to get the position of a road in a radius? I'm trying to spawn a vehicle somewhere within 2500m but it HAS to be on the road
Hi
I've written a whole bunch of scripts for Arma 3 (including one I posted on the forum back then, which has since been updated). And since the forum closed, I don't know where to share them. What's the universal source for scripting now?
I have a whole github accompanied by a mission file that groups everything together (the mission file that serves as a test bench and experimentation tool)
Most of the scripts aren't revolutionary; I mainly focus on reading configfiles and randomization, AI spawning, and automatically generating "sector" modules from the cities in the configfile (CfgWorld).
It's more of a starting point for those who want to begin scripting
Steam Workshop or Guide could be a good guidance source, IMO
Do people actually read guides on Steam?
But it's true that writing a guide could be relevant
need to see if it's possible to format it correctly, including the code
lol i make the best missions imho ๐ its so much fun woohoo i love it ๐ well that's what my clients say anyway ๐
thx so much guys for helping me with all the sqf scripting stuff
Your clients??!!
Players is like clients i guess
By the way, I still haven't tried scripting on Reforger. I learned it's more complicated and requires using an additional tool called "Workbench"
I imagine the SQF file is no longer used
Give servername
yeah i understood
This one ?
I can host my sort of catch-all/sandbox mission
With all the scripts I've made
For me, it's just a sandbox scenario.
I don't know how to create a "scripted" mission or come up with ideas.
I just script random ideas and add everything I script to my mission, which includes all the Blufor vehicles, respawns, and AI that spawns on the map (and is marked on the map as soon as it's detected by an ally)
I'm going to look into automating artillery fire soon, specifically if an enemy is spotted by an ally and within firing range
Good idea
https://github.com/Nixx57/Arma3-random-script-libs?tab=readme-ov-file#key-scripts
In this list there might be some things that interest you, at least as a starting point for modification
I think this is a config question. Any of yall know how to get other attributes to show up in a custom module?? I have the combo & edit boxes working but Iโm trying to get marker color/brush drop down to appear in the module and itโs not working. Any insight much appreciated. Images to follow:
Thatโs the module config.cpp the edit/combo/checkbox works but most the others donโt.
Are you talking about the attributes displayed in 3den?
Yeah I wanted to get some of them into a custom module
I just started exploring making my own modules, my test module works it creates a marker with info parsed from the module. But I was trying to get a sense of how many total attributes a module can have for future
Yeah, and if there was a way to get a multi-line text box that would be cool
@simple sorrel Maybe something like this ?
class MarkerColor {
displayName = "Marker color";
tooltip = "Select a color";
property = "XXModule_MarkerColor";
control = "Combo"; // Type
defaultValue = "'ColorRed'";
class Values {
class Red { name = "Red"; value = "ColorRed"; };
class Blue { name = "Blue"; value = "ColorBlue"; };
class Green { name = "Green"; value = "ColorGreen"; };
class Black { name = "Black"; value = "ColorBlack"; };
};
@Nixx, thatโs certainly a good way to get a drop down with some choices, but I suppose a more refined question would be: since I started exploring other attribute types I was wondering how to get the other types to work at all in a module. Like for example when you select the independent allegiance to BLUFOR/OPFOR in the scenario. Could that be in a module and if so how?
Ohh
Iโve seen it in other mods but they use hella macros and extremely hard to decipher file pathing when tearing their PBOs apart
Do you mean by synchronization, for example?
At this stage for my test/learning module. It just creates a marker but I learned how to actually create in game modules that function - the next step is to see how many attributes are technically possible to put in one. For future Dec
@Nixx maybe? Depends on what you mean by synchronization.
Is that some magic SQF I can throw in a config and boom modules are inheriting what I want?
For example, by synchronizing a module with one or more entities (side, unit, etc.)
This can be done simply by setting the variable as an alternative
It is possible to browse parent objects
and potentially retrieve related items
But what exactly is the project? Just exploring the engine's limits?
I do the same, but with extreme randomization ๐
https://github.com/Nixx57/Arma3-random-script-libs/blob/main/scripts/fn_respawnVeh.sqf
Haha sick Iโll check that out. Ok so The create task module is a perfect example, I prob should have lead with that. Anyway, in there you see the state attribute is a graphically pleasing clickable boxโฆ thing. Iโm trying to get my test module to have all the possible attributes to visualize and then it helps with developing modules later knowing what types of interfaceโs we can have
But I donโt know how and where BI gets that into their module
Like, if I can find a way to make modules with this that would completely change the way someone might tackle a faction function that flips sides after the player does XYZ or something
We would need to decompile and search through the scripts
this ๐
Alright Iโll start there
Another example ๐ ('_this' is a Group)
It's likely I'll also have to delve into the Bohemia decompilation functions
I don't want to code an artillery function from scratch when there's a module that does it perfectly well (a module whose script is hidden)
Eden's attribute/GUI is completely unrelated with this function
Yeah, I misunderstood his question when I answered him
@warm hedge. Yeah I know but I was hoping there was a way
class ModuleTaskCreate_F: Module_F
{
class Arguments
{
class State
{
displayName = "$STR_A3_CfgVehicles_ModuleTaskSetState_F_Arguments_State_0"; // State
description = "";
class Values
{
class Created
{
name = "$STR_A3_CfgVehicles_ModuleTaskSetState_F_Arguments_State_Values_Created_0"; // Created
value = "CREATED";
default = 1;
};
class Assigned
{
name = "$STR_A3_CfgVehicles_ModuleTaskSetState_F_Arguments_State_Values_Assigned_0"; // Assigned
value = "ASSIGNED";
};
class Succeeded
{
name = "$STR_A3_CfgVehicles_ModuleTaskSetState_F_Arguments_State_Values_Succeeded_0"; // Succeeded
value = "SUCCEEDED";
};
class Failed
{
name = "$STR_A3_CfgVehicles_ModuleTaskSetState_F_Arguments_State_Values_Failed_0"; // Failed
value = "FAILED";
};
class Canceled
{
name = "$STR_A3_CfgVehicles_ModuleTaskSetState_F_Arguments_State_Values_Canceled_0"; // Canceled
value = "CANCELED";
};
};
};
};
};```
And this will be stored into getVariable "State"
I haven't dealt with classes much, but I imagine in this case it returns an array?
(TaskCreate is slightly special case IMO tho)
Basically every Attributes goes into class Attributes
Yeah this is a great start but how do I get this in my module that has its attributes defined with all the ones provided from the wiki?
Also, POLPOX, long time fan of your mods
๐ป
What is the context
how do I get this in my module that has its attributes defined with all the ones provided from the wiki?
class ModuleEditTerrainObject_F: Module_F
{
class Attributes: AttributesBase
{
/*
some other attributes
*/
class ObjectState
{
property = "#state";
expression = "_this setVariable [""#state"",_value]";
control = "ObjectState"; // this defines the GUI elements
displayName = "$STR_a3_to_editTerrainObject10"; // Object States
tooltip = "$STR_a3_to_editTerrainObject11"; // Select damage or visibility state of selected terrain object.
value = 0;
defaultValue = 0;
};
/*
some other attributes
*/
};
};```Another vanilla example
In Cfg3DEN >> Attributes
class ObjectState: Title
{
attributeLoad = "['objectState_attributeLoad',[get3DENSelected 'logic' select 0,_this,_value]] call bis_fnc_moduleEditTerrainObject";
attributeSave = "['objectState_attributeSave',[get3DENSelected 'logic' select 0,_this]] call bis_fnc_moduleEditTerrainObject";
h = "2 * 5 * (pixelH * pixelGrid * 0.50)";
class Controls: Controls
{
class Title: Title
{
h = "2 * 5 * (pixelH * pixelGrid * 0.50)";
colorBackground[] = {0,0,0,0};
};
class Value: ctrlControlsGroupNoScrollbars
{
idc = 100;
x = "48 * (pixelW * pixelGrid * 0.50)";
w = "80 * (pixelW * pixelGrid * 0.50)";
h = "2 * 5 * (pixelH * pixelGrid * 0.50)";
class Controls
{
class Checkbox1: ctrlCheckboxBaseline
{
/*
And more lines
*/
So if I just add a:
Class ObjectState: Title
To my module config it will show up as the same thing from BIโs edit terrain object?
No
class ObjectState* (the c must be lowercase) in this context only defines the GUI elements in Eden Editor's attribute
What directly matters to modules' attribute is this
Whoop wrong reply
This is what I meant
Ok. A lot of trial and error in the future. The executive summary of my mission is simply, get a test module in game that displays all possible attribute types, that a module_F can do. That will help inform future design of functions knowing what modules can provide to the player as UI
In game rather than Eden Editor you mean?
Yessir
So I started chipping away at modules. Made one test module. It works it creates a marker and you can set the size and text and all that jazz. But now I want to see what modules can look like entirely
Sure it's possible, just because Eden Editor's attributes are just in-game GUI elements
And defined in config in readable state
Thatโs what I was hoping. Cuz boring check boxes and list boxes are limiting creative module dev lol
But now, so, I need to dig into the Cfg of those elements and put them as a โclassโ of their own name and they will look like that in the module?
You can use scripts like configClasses to dynamically read config attributes
Thatโs nice
Anyone know of any reason why CT_WEBBROWSER wouldn't work on stable but would work on profiling? Haven't done a whole lot of troubleshooting outside of just verifying it no worky but just wanna know if I am doing something dumb, this is a known issue; or something I should investigate more so I can put in a https://discord.com/channels/105462288051380224/108187245529268224 
rofl
Yes, a Taru can load a huron (without mass modification)
Isnt it scheduled for 2.22 for stable?
CT_WEBBROWSER was added to stable in 2.20
I believe it was still a bit WIP, and there may be differences between stable and prof depending on what specifically you're doing with it.
currentCommand _leader; // Returns "ATTACK"
How do I get rid of that "ATTACK" command? I need them to follow waypoints. "ATTACK" command makes them run away sometimes, when they lost their target. I guess they think their target ran away, so they are following him and leave mission area
doMove does nothing for whatever reason
does joinSilent work?
He is alone it the group
you can make him join a new group, then delete the old group
Which means I have to re-add all waypoints
yeah that's the only way I think. you can try ignoreTarget but it's probably not a good idea
Spam forgetTarget + reset combat mode might work.
But what you have is a buggy pile of shitcode in an unknown state. And joinSilent is your best shot at a reset.
Maybe I could spawn some civ in the corner of the map and join him to the group to make sure group is never empty. Delete the civ after that
Your trouble is that some state is attached to the group. Enemy knowledge, behaviour etc.
I thought commands like ones from command menu are attached to the unit. Only reason why leader has "ATTACK" is because command was given to him by previous leader before he died.
Is that what happened?
Yes
I figured they'd give themselves ATTACK anyway. But that's info from an undocumented AI layer.
Usually leader has "MOVE" command when he is following waypoints
I guess you do see that as a player too. If you get downed in Antistasi it switches the leader to an AI, and then when you wake up again it switches back, but the attack orders can be sticky so you see the red cursor.
joinSilent worked and it didn't remove waypoints
You rejoined it to the current group?
Yes
[_unit] joinSilent group _unit; // return to formation
Leopard's comment says it removes waypoints, when only one unit is in the group, but that didn't happen
https://community.bistudio.com/wiki/joinSilent
IME waypoints update asynchronously, like there's another layer of code running intermittently that checks whether the waypoint is complete.
So an immediate joinSilent would be ok unless it specifically does the clear. Not sure why it would.
But what was said is that if you joined the unit to a different group it'd reset the waypoints.
Question was whether rejoining the same group would do anything useful.
But I guess that still resets the unit state.
I guess unit will no longer be leader after re-joining. When group had more than one unit
it used to clear the waypoints 
yeah it first removes the unit from its current group then rejoins it iirc
hmm, it's really quite difficult to intentionally get someone to currentCommand == "ATTACK" state :P
I guess it's the enableAI "TARGET" thing where they send units from the group to distant positions?
@hushed turtle ```sqf
//what about command Move
units _grp commandMove [(getPosATL ? select 0)+(random 5), (getPosATL ? select 1)+(random 5), 0];
or edit as needed
i found making enemy move to a marker is way better then waypoints
in any case
the only problem is you don't know how long it will take for them to get to the next marker, so you need to check this constantly ...
waypoints exist for a reason ๐
I thought giving order to attack from command menu would do it, but I haven't tested
To be fair, leader running away and chasing lost target is rare. It's just becomes a problem when you need to kill them all to complete objective
I'd disableAI "TARGET" and allowFleeing 0 generally if you care about such things. But I'm not 100% sure that it's related to your case.
I have allowFleeing 0. I think I will use leader changed EH and re-join him to the group when his command is ATTACK
Quick question, is there a namespace in 3den editor that is preserved when exiting and re-opening the editor? I want to save custom data but missionnamespace doesnt work
I could save it to profile namespace with a reference to the mission and get it back that way but that isn't very ideal
uiNamespace is generally persistent IIRC? Not specific to 3den.
you can also create custom 3denmissionattributes that you can save and load from
class Mission {
class Scenario {
class AttributeCategories {
class MEH_VersionControl {
displayName = "Modules Enhanced Version Control";
class Attributes {
class MEH_MissionVersion {
control = "MEH_MissionVersionReadOnly";
defaultValue = """""";
displayName = "Modules Enhanced - Mission Version";
expression = "true";
property = QGVAR(MissionVersion);
};
class MEH_CurrentVersion {
control = "MEH_MissionVersionReadOnly";
defaultValue = QUOTE(QUOTE(CURRENT_VERSION));
displayName = "Modules Enhanced - Current Version";
expression = "true";
property = QGVAR(CurrentVersion);
};
};
};
};
};
};
private _missionVersion = "Scenario" get3DENMissionAttribute QGVAR(MissionVersion);
"Scenario" set3DENMissionAttribute [QGVAR(MissionVersion), CURRENT_VERSION];
stuff like this
I've just found out that selectLeader removes commnand from from leader. So, I can just select leader a leader
group _leader selectLeader _leader;
No need for group joins
..huh
Command clears it, internal leader selection doesn't? :P
I shouldn't really be surprised.
Exactly ๐คฃ
It's just SQF things you know. ๐
SQF is really the tip of the iceberg for AI.
The things you can't see are even worse than the things you can see.
selectLeader removes it, but if I kill myself while I'm leader then other unit(new leader) keeps the command ๐
I think in a lot of cases it can be good thing that leader keeps the command. For example medic ordered to heal someone or if unit was order to refill ammo, then they complete the command even after becoming a leader.
By the way, do leaders refill ammo for themselves? I know leader orders unit to refill ammo when needed, but do leaders themselves ever refill ammo?
IME that stuff is busted anyway.
Thanks for the suggestion John and Hypoxic, I like the attribute approach, it will make loading the data easier for me too
Im dumb and didnt read the wiki closely enough, realized I can't access these values when playing the mission :(. I can't find a function that would do it but does anyone know if theres a way to export data to a file in the mission folder that can then be read during the mission?
^ I don't think this is possible, havent come across a function like that before. I think the only way to save data in 3den and then pull it from the mission is to have an object in the scene that has the data saved within it. If anyone else has any suggestions though I'm all ears
what exactly is your use case here?
(reading a file is possible, writing a file is not without an extension.)
As far as default Arma goes I believe uiNamespace and profileNamespace are the only namespaces with persistence outside of mission. The profileNamespace will exist on the selected profile past game close where as the uiNamespace will exist regardless of profile but will clear on game close.
I am creating map drawing for the 3den editor (same as map drawing during gameplay pretty much). And I need to save that line data somewhere that will remain with the mission even when its exported, hosted on a server, played locally, etc.
Writing to the mission folder would check these boxes, right now im doing a quick test with creating a module when needed and saving the data to an attribute within it
If you're willing to install mods, A3Log extension should allow you to save files with any file extension iirc.
There are addons like extDB3 which also allow for SQL database connection for storage there. It's pretty old and not very performant though.
Thats sort of out of scope for this project, but I apreciate the suggestion!
This might be kind of obnoxious but might be able to setup a Github repo with a symlink of your profile folder. Then you could create some sort of automation to commit, push and then pull the profile for whatever other server or whatever you wanna use it for perhaps
Without extensions, you can't write files when hosting. With the exception of profilenamespace & missionprofilenamespace
My test of using a module that stores it works decently, I think I'll try and go this route
you could always copy the result to clipboard?
If the writing is only while editing then whatever.
I could, but how would I get that data back in a mission?
While running, a mission can read any file within the mission PBO/folder.
The writing would only be while editing in the 3den editor, the mission just needs to read it
It's just the auto creation of the file to read thats the problem
If you format it as SQF then you can use preprocessFileLineNumbers, execVM or the functions library. If it's any other text (eg JSON) you can use loadFile.
But there's no way to create the file to begin with :(
We covered that part? Output text to clipboard, copy to file in mission folder.
I want it to be automated, that would require you to create the file in the mission folder yourself. Or use an extension which I don't want to do for the size of this project
Completely automated isn't an option without extensions. Arma won't write data to arbitrary files.
Not sure if you're intending for it to be used purely in a server environment but you could also just exclusively save the data to the servers profileNamespace if that helps
Yup got that, so that method is a no-go
I suppose you can write an init expression to an arbitrary object using set3denAttribute
Unfortunately the 3den editor isnt usable in a server so that wouldnt work
Oh apologies you said 3den earlier, that's my bad
I tried that, but you cant access the data in those attributes during runtime
You can't use get3denAttribute when running a mission but the init will run.
this setVariable ["my_arbitrary_data", whatever];
You can technically store arbitrary mission-accessible data in the SQM like that. Ugly but it works.
I don't even understand that fully, so I think Ill stick with the module approach, its automated and only introduces minor user error possibilities
I appreciate your very creative thinking though
Does minimalHit apply to Infantry? And if so, can I disable it on an individual unit?
I'm trying to set up a Juggernaut unit for players to fight on a mission, I've got him taking reduced damage, but I think it's hitting some kind of threshold, since a full two LIM-85 boxes dumped into his chest armour didn't kill him
We were talking about this not too long ago. Someone wanted increased heath for unit
You need to use HandleDamage EH and handle damage from there
I don't know what minimalHit is. There is no command like that
Can anyone point me to where I can find the structure of a ParticleArray
This contradcits its self at every turn
well i guess it don't matter how long it takes for enemy to get where they are going in my missions, cuz i Allow the enemy to do as they wish: and i must plan or change plans according to that: maybe that's why i don't use any waypoints ever ๐
Probably, but I think only through config?
On CAManBase they're all set to 0.01
Not sure whether it's applied before or after HandleDamage.
This looks like modding question rather than scripting one
Yeah I was hoping I could script this and not be forced to make a custom unit
heli addEventHandler ["HandleDamage",{
params ["_unit", "_selection", "_damage"];
_curDam = call {
if (_selection == "") exitWith {
damage _unit;
};
(_unit getHit _selection)
};
((_damage-_curDam)/2+_curDam) //Adjust "/2" here
}] ;```Something I've wrote years ago in this server. Not tested today
Seems to be working alrighty
It can be scripted using HandleDamage EH
does anyone know which artillery shell ammo type causes that kind of explosion?
that arma 3 screenshot?
yes
well if no one knowns you could put some artillery in the editor and start shooting with them
i mean make AI fire
It kind of looks like a 155mm HE, but...there are so many different mods, and some of them use the same effects as each other, and then there are mods that change the explosion effects on top of that... it's a bit of an impossible question
it would be easier to tell if there was a video
If those are black smoke trails off to the right then maybe Blastcore is involved
Honestly, are you even sure it's artillery? It could be an aerial bomb. They don't inherently look different.
@pallid palm well if the enemy have to go to only one place in your mission, then waypoints are not needed
@brave mountain seems like some kind of Blascore mod is used like this one -> https://steamcommunity.com/workshop/filedetails/?id=2257686620
Hi, does anyone know if and how its possible to execute a script on and player who is close to a position or in a trigger. I want to make a shooting drill where i start it via ace interaction and the "shooter" stand in an square
Are you just wanting the action to only appear while in the trigger?
Yes kinda. So the shooter stands in the trigger/area and i want to execute this "removeGoggles _player;" after my original script went through so the one in my mod
So just check if the player is in the trigger in the action's condition
player inArea triggerVariableName
And then i can execute my script which is in a mod in the player in the trigger?
Yeah you can just make it a function and call it from the trigger's statement
I was trying to get an artillery barrage goin' using this script : [] spawn {
_delay = 0.5;
{
private _impactPos = getPosATL _x;
private _explosion = "R_80mm_HE" createVehicle _impactPos;
_explosion setPosATL _impactPos;
_explosion setDamage 1;
sleep _delay;
} forEach [
barrel1, barrel2, barrel3, barrel4, barrel5,
barrel6, barrel7, barrel8, barrel9, barrel10,
barrel11, barrel12, barrel13, barrel14, barrel15,
barrel16, barrel17, barrel18, barrel19, barrel20
];
};
and it works
but only with that ammo type
I tried other class names but won't do anything
works only with R_80mm_HE
I don't know why...
ARMA3 Machinima Cinematic Movie by Flawless War Gamer
(The battle of Kursk โถ World War 2 Machinima)
A soviet defensive position has been heavily overruned during the first days of the battle of Kursk
Subscribe Link:
(https://www.youtube.com/channel/UCO3rUMBjMZ0Iuo5MfRWIROw?sub_confirmation=1)
Movie chapters:
0:00 The quiet before the storm
1...
for anyone wondering : that scripts lets you simulate artillery strikes in an area, create games logic named barrel1 to barrel 20 in my case but do as wished...can name barrel or any other name...it spawns explosions around based on the ammo type in the script
pretty cool
but again, It works only with R_80mm_HE and I'm tryin to understand why.. EDIT : Seems like it's working only with plane's ammos. Not with artillery shells. Mmm interesting.
Assuming this does reduce incoming damage properly, how do I adjust how much it's by?
It literally says "Adjust "/2" here" :P
Well shit, I need to adjust my screen contrast
Okay, this doesn't work
3 LIM-85 shots to the chest, whether I set it to 0.1 or 100
How are you adding it
If you have other systems running that use handleDamage, like ACE/KAT and BI Revive, you will probably need to do some kind of handling to prevent them conflicting with each other or stacking in weird ways.
HandleDamage EHs are processed in sequence, in the order they were added, each receiving and acting on the results of the previous one in the sequence.
Wait okay hang on
Can I use "this" instead of requiring a variable name?
Yes I can
Okay, I think that's about perfect
if I have varspace set to player, does it get deleted when player respawns or carries over after spawn? ๐ค
wdym varspace?
Respawning does transfer variables from the player if that's what you're asking
Hello, I am working on a script and want to use htmlLoad , but I cannot make it work. Is there a way to figure out why it gets blocked?
private _url = "http://www.domain.de/tools/arma-news.htm";
hint ("Loading " + _url);
_html htmlLoad _url;
in Description.ext
class CfgCommands
{
// a list of URIs supported by HTMLLoad
// note that in case of clients connected to dedicated server, restrictions defined in its config have priority.
allowedHTMLLoadURIs[] += { "http?://*.domain.de/*" };
allowedHTMLLoadExtensions[] += { "html", "htm", "php" };
};
I did also try with the arma3_news.php in the doc, and that works. So it must be related to the filter, but I don't get what I need to change, this looks correct to me. And I get very little (no) Debug Errors.
Also, starting the mission from EDEN (both SP and MP) and I dont know where the server.cfg of my machine would be :/
no no m8, the Enemy can go as far as i set the radius: for them to patrol in: i mostly set it to 200m: and if they see us: they can do as they wish: they mostly Attack us and try to kill us: of course
i have them set to not flee of course
of course: i have many diff kinds of missions: some times the enemy are in houses and some are patrolling: and other missions the enemy patrol random house's in a set radius
and sometimes i set some enemy to come out of the houses: if they hear you: ๐
i made many diff kinds of patrol scripts: for all my needs
i don't think a mission would be that good: if the enemy only went to one place: ๐ my missions are way more dynamic then that m8
you just change the position patrol will go before they get there, ok
btw did you check out my diver patrol script m8 ๐
its the same with patrol waypoint if you set central position the position of the leader of the group
[_ptrlgrp, position (leader _ptrlgrp), 100] call BIS_fnc_taskPatrol;
yes but i like way more control of the enemy then that task patrol script gives
what u mean by more control ?
like changing depth of the patrol
what u mean by depth of the patrol? ๐ตโ๐ซ
like in the water depth
i am using this with land patrols they are present in most missions, not divers ๐
roger that
well in my patrol scripts you can use land or water patrols
and you can set the depth if you like for watar
for land there already a function that do this ... so no needed, maybe if you want group to have different group behavior
aka "stealth patrol" or something like this
yes thats all in my patrol scrips as well
you have many things to choose from in my patrol scripts
like you said there
its all for whatever need you have: like if you know what i mean: ๐
I know what u mean, ready script templates for coop missions, which is really useful
yesSir in some of my patrol scripts i make the enemy randomly select one of the team members to Attack its funny cool lol
defend the hvt kind of mission ๐
well knida: when we are in the field fighting my clients say why are they trying to Attack me lol
i say i don't know: i say to them they don't like you: lol hahahaha: and we will protect you lol
but then the enemy select a diff random team member and they try to kill only him lol
its fun
my one friend said why its all the enemy Attacking only me lol i said im not sure ๐
like maybe if you want the enemy to kill the medic cuz in my missions the medic is the most important guy of all
cuz if you get hit in my missions you go into shock and you can hardly do anything and you need medic real bad
its so Awsome i love it
the medic is the only one who can fully heal you in my missions: well the med tent can also but you must call the extraction chopper to go back to base to go in the med tent if we have no medic
or if no one choose's to be medic as it were
there's 2 player slots that are medic's
so 10 player missions so you can have 2 teams both teams have 5 guys: and one guy can be medic in each team
or one team of 10 of course
sounds like fun yes ?
i cant get the example to work on this page, somehow nothing shows up does anyone know why?
https://community.bistudio.com/wiki/BIS_fnc_showSubtitle
How reliable are triggers in feature rich missions with a lot of other stuff going on?
Like.. if I make a safezone trigger and have it run a protection script when they enter/leave - is there ever a chance of it getting stuck and leaving them invincible when they leave?
I mean, it's a program thing, nothing is perfect, is there a chance? I think so yes, but from my experience they are reliable and never had issues
Thanks
I think I will also add some variable check when they leave the area too just in case
I'd assume that if they had any reliability issues, they would've been detected and fixed by now
just do a lot of tests if you're not sure
You gonna have too. Otherwise how you gonna remove invincibility from units outside of area? You could remove it from all units who are outside of area, but you've mention a lot of stuff going on
I mean another check on top of the trigger exit check as a confirmation
work with onActivation and onDeactivation and it will be just fine
lol what you mean nothings perfect: my Arma 3 works prefect: in all things m8 ๐ and after you helped me: it really works perfect ๐ ๐ ๐
everything works so good: i'm so happy about Arma 3: Woohoo
i Actually have 1 mod now i can't believe it tho: Huey Choppers ๐
I have an object that keeps getting destroyed even after using allowDamage false and even in the attributes tab i uncheck the box that enables damage, what can i do to fix this?
we need to know more about it like where does the object start at and when does it get destroyed
you need to use this allowDamage false; by the way
and what object is it what is the object ?
Itโs an airplane and itโs starts on the ground then executes a unitPlay where it takes off. As it moves to the end of the runway it takes too much damage then itโs destroyed
is this a moded airplane
They check at intervals rather than event based, so it shouldn't be possible for it not to run the exit code. Might be an issue with your enter/exit code though.
Yes itโs moded
Yes I did
hmmmm ok im thinking
domb ? but was the grar down when you took off ๐
and is the run way long enough for that plane
Yes it was down, I think the issue is that I used a different airplane in the UnitCapture (kc-135) and unitPlay on (c-17), not sure why itโs getting destroyed because itโs works on another
i see
I also noticed when using some aircrafts at max throttle going down the runway if you donโt take off you take damage to the gear then eventually if you keep going you get destroyed
hmm interesting
yes that make sense
just like real life
is a c-17 a cargo plane ?
Ok I thought it was a conflicting mod and yes C-17 is a cargo plane
ok nice i was in the US Air Force so what you are saying makes sense
yes landing gear is some what the weakest part of a plane ๐
Iโll remake the UnitCapture but move slower than I did
and in Arma 3 that's really true
roger m8
try to get off the ground as soon as you can
full flaps when you get speed
i worked on the C-5A in my day it is now it like C-20G or something like that ๐
no it must be the C-5G
Ok I was trying to make it a bit cinematic by prolonging the takeoff but thank you Iโll remake it
rgr m8
Damn those C-5 looks sexy
yeah bad ass C-plane yes
them wings look so small lol ๐
how the hell does that thing fly lol
you can put 9 gryhound Bus's in the cargo
3 across and 3 back
lol I didnโt know itโs that small
lol
its like a football field in there ๐
and don't forget to use this allowDamage false;
does anyone have an idea how I could have smth like
setPlayerRespawnTime 300;
But only for people who respawn.
Essentially the issue is that I want players to have like a 5min respawn timer, so they couldnt get back into combat immediatly. BUT I dont want that to apply to guys who just joined the server
well you could use the onPlayerRespawn.sqf but set the player to what you need here
in the description.ext```cpp
// -1 - Dont respawnOnStart Don't Run Respawn Script on Start
// 0 - Dont respawnOnStart Run Respawn Script on start
// 1 - respawnOnStart Run Respawn Script on start
respawnOnStart = 0;
respawnDialog = 0;// 0= disabled 1= enabled
respawnButton = 0;// 0= disabled 1= enabled**
you may want to use respawnOnStart = -1;
Thx I will look into it didnt know this one existed
Wouldnt respawn button just send them to 5min timer tho?
no it will respawn them right away
let me know if you need any more help ok m8
I got another idea. Have initplayerlocal. So when player joins the server his respawn is 5 seconds but on respawn it gets increases by 30s every time
can do yes
Until he relogs so that would solve that isdue
Okay thanks
I use it all the time. My initplayer is like 2000 lines long
yup thats the way Arma 3 works ๐
2000 lines omg ๐
well i always try to find the best way and it takes me a long time to do that : but the guys in here help me lots
i hope i helped you some im not the best: im still learning
no not the initplayerlocal i was thinking the wrond thing
i was thinking the initPlayerServer or something like that
All good. I will test it tomorrow. I thinking like having a variable like _myplayerrespawntimer = 5;
Playersetrespawntimer _myplayerrespawntimer;
And on respawn would be smth like
_myplayerrespawntimer = _myplayerrespawntimer +30;
I dunno smth like that
no no what you had befor was ok
respawnTime = 300;
setPlayerRespawnTime respawnTime;
i use that stuff in my team respawn script
do you put it in initplayerlocal?
well it should work any where you put it i think
I am testing now
@cobalt path if you have it in the initplayerlocal then JIP players will have to w8
i would put it in the onPlayerRespawn.sqf
and set the player not to respawn on start
Uhhh, okay I am trying, setrespawntime doesnt seem to work for me when onplayerrespawn sqf
did you define the respawn time like i showed up there
respawnTime = 300;
setPlayerRespawnTime respawnTime;
No, for testing purposes I just did
setPlayerRespawnTime 20;
well
see the setPlayerRespawnTime is kinda diff from the main respawn time in the respawnDelay = 20; in the description.ext
Question: is it possible to have a series of Hold-actions set their respective variables as "True" so that when the Nth action down the line is completed the script triggers?
Example: the mission is to destroy a fuel depot but conventional means are unavailable/impractical. So the players have to change the machine state on a couple pumps and trigger some back-pressure. Then, trigger another interaction to have the pumps detonate. But this would only work if all the pumps are set, and the players won't be told in advance how many there are.
well i only use 1 hold action: so i think it possiable to do: but i dont know how
Yeah, I normally don't get this involved but I've decided to start integrating small puzzles into my missions
so what i would do is use 1 hold action like in 4 diff flags or something like that
to get the thing to expload
Couldn't you just have n triggers each just unlocking the next?
Technically, you can use the condition field for all kinds of stuff, but I am not sure that will make it obvious to your players what is needed...
yup could do
theres so many ways
could put hints in there as well
or even tasks can work also
is there a way to forbid players from loading any loadouts with items that are not present in the arsenal ?
only manual blackilisting possible ?
Scripting solution? I guess you could override the buttons and check yourself against the arsenal contents.
this is over my knowledge unfortunately, is there a way to export current arsenal classnames ?
one more thing is there way to remove rain sound from vehicles? I prefer not to disable all ambient sounds but the vehicle ones only ...
weird bug in 3den, things set with set3DENAttribute dont save when saving the scenario just once, you need to save atleast twice before the value is actually retained
scenario editor, vanilla mission editor
If you believe some vanilla thing is broken, make a ticket in #arma3_feedback_tracker (its description) and be sure to include repro steps
anyone got any idea how to fix soldier[O_Soldier_SL_F]:Some of magazines weren't stored in soldier Vest or Uniform?
You'd have to modify the unit(s)' loadouts in config so not have extra items/mags
gg
Also it's specifically for items/magazines (and their respawn versions), since items in backpack are handled through different backpack classes
theres a bunch of vanilla units that get that error and it doesn't actually matter
its because the magazine gets loaded into their weapons so they're not 'missing'
basically the error pops up for them because the game checks if they have room for the magazines - and they don't - but then their magazines get loaded into their weapons and they end up having room
Sounds like the engine check for that should get a fix
would be nice to fix
:3
how to disable rain ambient sound with vehicles, this doesn't help
enableEnvironment [false, false, 1];
don't think you can, they're part of the vehicle sound config and not the environmental sounds
can someone explain this https://community.bistudio.com/wiki/Arma_3:_Sound:_SoundControllers
can I manipulate "rain" sound controller and turn it to "snow"
@ivory lake this terrible immersion breaking thing ๐
the snow thing is set in the terrain config
@ivory lake everything is fine with terrain and terrain objects like buildings, the problem are vehicles, they have rain sounds, not snow/no sound ...
and these are vanilla vehicles ...
you don't have to ping me
I didn't say anything about the terrain objects or whatever - i said the 'snow' stuff is set in the terrain config
so you can't do anything to it with scripting
oh actually... setRain got extended
see the 3rd example
thank you a lot, this fixed rain sounds ๐
I am playing with the params and I want to simulate heavy snowfall, for now this is the most dense snow I can spawn, I don't know how to change the params
[
"a3\data_f\snowflake4_ca.paa", // rainDropTexture - 4 means it has 4 flakes in it. Other available textures: snowflake8_ca.paa, snowflake16_ca.paa
4, // texDropCount - 4 because we are using texture with 4 flakes. Change to 8 or 16 in accordance with other textures used
0.01, // minRainDensity
25, // effectRadius
0.3, // windCoef
2.5, // dropSpeed
0.1, // rndSpeed
0.5, // rndDir
0.07, // dropWidth
0.07, // dropHeight
[1, 1, 1, 0.5], // dropColor
0.0, // lumSunFront
0.2, // lumSunBack
0.5, // refractCoef
0.5, // refractSaturation
true, // snow
false // dropColorStrong
] call BIS_fnc_setRain;
๐คทโโ๏ธ
I tried
0.9 //minRainDensity
but this stops snowfall completely ...
You'll want to test this, but I think the rainparams array sets the properties of the rain but not its actual strength. The minRainDensity param is the minimum rain strength needed for the rain effect to appear.
The preceding 0 setRain 1 in the example is important; that's what controls the actual strength
If you already have rain strength set to 1 then that's it, that's the best you get
0 setOvercast 1;
0 setRain 1;
is exactly what I was looking for, let it snow ๐งโ๐
Im on dev branch but dont know if thats the cause for this issue, but executing the example on this page does not show any subtitles, any clue why?
does it need radio channel ("CROSSROAD") or something?
The Wiki doesn't say anything about the name parameter
No, it's just subtitles. It creates a UI text control and that's it. It has nothing to do with the radio system, and the name of the speaker is not used as an actual reference to anything, it's just for display.
The function does check whether subtitles are actually turned on in the game settings, and will not run if subtitles are turned off. So that could be it.
Oh so if i create a mission and the people have their subtitles off they wont see it?
You might be able to use showSubtitles to force it on, but I'm not sure exactly what that influences
Thank you i will try this
How can I set the progress bar of the Rugged Comunications Hub via script command?
Use animateSource with "Progress_source"
It looks like the value should be between 0 and 100
I tried:
cursorObject animateSource ["Progress_source", 80, 1];
This fills the Progress bar up to 80%.
How did you find out that theanimateSource is called Progress_source ?
rightclick on the object in the Editor, select "Open in Config Viewer", and look in the Attributes or AnimationSources subclass in the left panel
(suggest using Advanced Developer Tools to make the Config Viewer more bearable to use)
That is what you wanted right?
the command showSubtitles does not affect the BIS_fnc_showSubtitle unfortunately if subtitles are disabled in options.
I am sorry if its the Wrong Sector it seems to fit either editor or scripting...
I try to understand 2 Issues:
1.
17:36:26 โฅ Context: E:\Windows Benutzer\User\Dokumente\Arma 3 - Other Profiles\Serga\missions\V3noms Server Mission Files\mission.Altis\stringtable.xml <- [] L1 ()
[] L1 ()
17:36:26 mission: string @STR_MISSION_DESC cannot be localized client-side - move to global stringtable```
2.
```17:36:26 Warning: Cannot evaluate ''
17:36:26 โฅ Context: [] L1 ()
[] L1 ()```
These both to relate to issues in the Stringtable.xml.
Funnily enough even though 1. says it can't find the Language it translates it perfectly. This kinda seems like an Arma 3 Issue. Removing the one Localization pointer fixes it though.
For the later it seems like it wants to evaluate something but it can't show me the line or block for that issue. I overtook an old project i just need direction what i have to search for for the second issue .
Okay i was able to point the Second issue. Turns out Mission Parameters were setup in a way where it can't evaluate a string "" in values[]: and default:
Hi, I'm trying to use dynamic simulation with mines, so they are only triggered by players at and not bots. When I do: "helipad1 enableDynamicSimulation true", "dynamicSimulationEnabled helipad1" returns true. The same does not seem to work with an APERS bounding mine. Any suggestions?
enableSimulation works on it though, but you would have to handle yourself when it gets enabled/disabled
cant you set the mines side or something? sorry dont know much about mines
Yes, it works manually, guess i'll have to write a script
Easiest would be to disable simulation when any of the players enters a trigger area
idk, a trigger for each mine is a bit overkill
maybe the other way around - a trigger attached to player, but how to disable simulation for mines that exit trigger?
I meant trigger per minefield
i'd like to do it for individual mines
I guess you could use nearObjects to find mines around player
or loop mines (allMines) like mad in eachFrame EH and activate/deactive them
i'll figure it out, i'm sure, it's a shame it doesnt work with the dynamic simulation, it would have been perfect
each frame is also a bit overkill, but i'll do like a 0.5 sec loop
the only prob with scheduled is that it may actually run slower, than 0.5
If you have mines grouped together in minefields, you could save performance by not checking mines from minefields too far
it's true, but for my purpose i want to trigger individual mines, because bots could be in the same minefield and they are not supposed to trigger mines
I meant checking per mine, but only on minefield where player is
i thought to check on client 5-10m around player or something and use enableSimulationGlobal
It gets more complicated with multiple players, since each player can be close to different mines
and it doesnt really, if it's done on client
I see
each client checks area around the local player
i'll figure it out, thanks for the help
Which also means it won't enable simulation for any AI not local to the player
Is there any way to disable the "clan name" display after the player name? I think i accidently disabled it on my server and now I cant find how to re-enable
sounds more like server config than scripting
Aren't these just part of the player's name?
he said they were disabled
could it be a script that "disables" them after all ๐ค
If those squad tags were provided by the Arma 3 Units service, rather than by an independently hosted squad.xml, then they won't appear if Arma 3 Units is down. In an interesting coincidence, Arma 3 Units was down last night and may still be down
is there a way to detect if mine was deactivated and not blow up ? using mineActive, but can't differentiate if mine was exploded or deactivated
using condition like this
private _result = allMines findIf { mineActive _x } isEqualTo -1 };
needed to use isNull as if you blow up mine, it become null and original reference object is gone
Yeah, alive is correct. Also doesn't make assumptions about whether the object gets deleted on death or not.
I imagine mines are always deleted on death so isNull will work, but alive seems safer for a general solution.
is there a way to reassign functions to variables? I have a variable which is given a function as a value on init, but I want to overwrite it later. For security reasons I understand it cant be simply done with global variables because publicVariable could easily override it and run malicious code, but it seems to also be blocked in localNamespace, any idea why and how to work around it?
For your functions- using the functions library will automatically prevent your functions from being overwritten on initialization. If you don't wish to use the functions library, I would use compileFinal as that will make them read-only and unable to be changed by commands such as publicVariable.
If you didn't use compileFinal and the functions library didn't, then the variable can be overridden.
I don't think the namespace matters. At last count you can compileFinal into profileNamespace and brick your profile if you want to.
let me give some context
Ive got a custom config for weapon attachments, and in their config I added onActivate and onDeactivate string properties which are functions
now in my scripts, I've got global variables for both activate and deactivate functions, and I want to swap these values as the weapon attachment changes
but somehow arma won't let me do it, I am unable to override a value
I think I just figured out the answer to my problem
hmm. I've never heard of onActivate and onDeactivate event handlers.
they are custom for my mod, Im trying to load them from the config in my scripts to do stuff
also they're irrelevant, the most important bit is that Im trying to dynamically swap out functions assigned to variables
So how are you assigning them in the first place? That's the relevant part.
If you use function libary or compilescript / compileFinal they are protected from being overwritten
// init.sqf
MYMOD_VARIABLE = BettIR_fnc_defaultOnActivate;
then in a different script I try to load it from the config as a string and assign
MYMOD_VARIABLE = (call compile _onActivateFromConfig);
tried the same with localNamespace but it refuses to override it
however, Ive got another variable for deactivate which initially is just an empty code block {} and Im able to override that
example 2 on compileFinal:
// duplicate code will be final as well
_myDuplicateCode = _myCode;
not sure if I can reassign after assigning it
So if BettIR_fnc_defaultOnActivate is final then MYMOD_VARIABLE will be as well.
need to make a new function
so realistically I should just store the name of the variable
and compile every time I call it
if I want to have a dynamic code like that
You could not use compileFinal. Or store other data that tells some code which function to call.
Thanks. Ill think about the path forward tomorrow
WIP ๐
Originally I wanted to reuse the code from BIS's virtual garage, but I ran into a problem with it
And most importantly, I want this script to work in vanilla (and without CBA dependencies).
For now, i use a simple pylon display with a generic UI
Is it possible to easily get this one?
"easily" might be a stretch. But it should be in there somewhere.
You can easily recreate similar GUI with some several ctrlCreates, the picture and combo boxes are defined in config and can fetch the data easily
does execVM makes the function/script run on server-side? how can i execute a script on server-side?
Either you execute it from the server itself https://community.bistudio.com/wiki/Event_Scripts or you use https://community.bistudio.com/wiki/remoteExec to initiate a execution from the client side.
ty
is there a way to check if we're in main menu and not an actual mission? pre-init and post-init seem to run if you dont have the "show static background in menu" and "no land" ticked in the launcher, and i dont want them to
i already got the mission name for the background "mission" but in the very edge case that ever changes (esp. due to a mod) i'd want something more robust
try maybe with worldName too?
which is stratis, but someone could change it ๐
from what i can tell the background map is just a mission like any other that gets loaded
maybe isNull (findDisplay 46)?
Idk if it exists in the main menu
Hm.. ill try that
allDisplays isEqualTo [findDisplay 0]
it doesn't exist in many places, including 3den.
in main menu you just have display 0
oh, sweet!
yeah @little raptor that worked like a charm, thanks!
I'm back with more questions
any idea what "GIAR pre stack size violation" means? It occurs in my postInit script
Usually a wrong syntax (not too obvious one)
at least when Im trying to run it with execVM with a file path. It's also a function in CfgFunctions with postInit=1 flag, but it doesnt seem to run and I assume it's similar
Such like arrays with extra comma
pls post code
My UI is ugly, poorly positioned, but everything work (a few minor changes to make it perfect or almost perfect)
I'm really struggling with the UI design
I have just 200 lines of code (all-in-one file, 100% vanilla, no dependencies), and in theory it should work in multiplayer
I'll try to keep this under 300 lines
I'll stop here for today
If a kind soul could give me the correct values โโto put in the UI to get something decent, I'd be grateful (lines 49 to 106)
https://github.com/Nixx57/Arma3-random-script-libs/blob/main/scripts/fn_enhancedGarage.sqf#L49
I'll still need to create the checkbox (if that's actually what 3DEN calls a checkbox) to define which seat will use the weapons. But I think I can manage to do that.
Figured it out but ngl i don't even know what fixed it. Removed all the code that I commented out earlier, made sure that even all one-liner code statements have semicolons and it worked
private _pos = getArray (_x >> "UIposition"); // Position relative on the UI [x, y]
// Creation of the ComboBox
private _combo = _display ctrlCreate ["RscCombo", -1, _ctrlGroup];
_activeControls pushBack _combo;
_combo ctrlSetPosition [
_pos select 0,
_pos select 1,
0.3,
0.035
];
why are you using _pos as comboBox pos in your controls group? it's not related
is it possible to detect if man has armor on his shoulders/hands etc ? i need to give him armband of proper size
I'm assuming you mean visual armor. In that case, no. You'll have to compile a list of matching sizes for your arm band.
what im trying to avoid ๐
i was thinking that maybe the vests for example have some value that shows which body part they protect?
Maybe they just add same armor value for entire torso
that would be lame
not yet
Yes, HitPointsProtectionInfo in vest's ItemInfo
ty 
Hi everyone,
I'm working with KillzoneKid's old server transfer script prototype that uses stacked onEachFrame eventhandlers to exit the player from the current multiplayer mission and then connect to a new server by scripting a serie of interactions with the multiplayer tab GUI. However, it looks like the code now stops after the mission ends. KillzoneKid notes this:
[the server transfer] is possible because of using onEachFrame from within onEachFrame so that you run certain portion of code per 1 frame. onEachFrame also survives exiting procedure from the game but gets reset as soon as new mission is received. This is enough to handle server switching.
My question: did this behavior of onEachFrame get patched out at some point? I saw that there was a mod called "Server Transfer System" that used KillzoneKid's code as a base and was functional from 2017-2023 (ish), but it's been removed from the workshop and of course the armaholic download is gone. Is there a new method thats prefered, cause I remember that cytech was experimenting with it at some point?
I'm using KillzoneKid's original code with some extra debug build in. Here's the relevant snippet with variable references replaced with their actual items for clarity.
diag_log "Closing all open displays";
private _allDisplays = allDisplays select
[
allDisplays find findDisplay IDD_MISSION,
count allDisplays
];
reverse _allDisplays;
{_x closeDisplay IDC_CANCEL} forEach _allDisplays;
onEachFrame
{
diag_log "Leaving mission"; //this is present in the rpt log
findDisplay IDD_DEBRIEFING closeDisplay IDC_CANCEL;
findDisplay IDD_MP_SETUP closeDisplay IDC_CANCEL;
//client is returned to main MP screen
onEachFrame
{
diag_log "Opening Direct Connect tab"; //this is not present in the rpt log
ctrlActivate (findDisplay IDD_MULTIPLAYER displayCtrl IDC_MULTI_TAB_DIRECT_CONNECT);
... code continues ...
The way I did it works, but it's off-center
I tried it on the uiPicture but it places the comboBoxes in the center of the screen
Hi, Iโm here asking for help. Iโve been trying to figure out how to fix this, but with no luck so far.
This is the only shop system that is publicly available for Arma, but it has a bug where it cannot display the facewear category. All other categories works except the faceware. If anybody could take a look in their spare time and help me figure out how to fix this problem, I would really appreciate it.
https://github.com/7erra/VASS-Virtual-Arsenal-Shop-System
The shop system is in the Mission.VR folder
QUERY - HOW DO I ADD AMBIENT SOUNDS TO AN AREA?
- Hello, I am making a mission heavily centered around a city and I am wanting to add ambience of cars and sirens in the area of the city.
- I have tried to use the "playsound3d" function but the sound's audibly distance is too small to encompass the entire city.
- I have no idea how to increase the audible distance of the sound so that it is audible throughout the entire city but is inaudible outside a certain range (e.g: in the countryside)
- If you have any advice, please send ๐
NO NEED TO SHOUT
people read the channel, you know ๐
Sorry ๐คฃ It's just there's a lotta messages here and I want to make sure mine gets seen lol, I take it it worked ๐
let's have everyone do that then ๐
but to answer your question I would look in the direction of https://community.bistudio.com/wiki/CfgSFX
Thanks man, appreciate it ๐ have just tried this for a bit but Im struggling to get it working. Would you maybe be free to hop in a call and help me by any chance my friend?
negative, sorry ๐ฌ working rn
all good mate no worries
you free sometime later?
Someone will help eventually
Way I'd do it is a bunch of sirens with playsound3d loops (pfh's) running on them on the server with an alive check for each one to remove the pfh if the siren gets destroyed
Wouldn't that put a bit of stress on the server if there's lots of sirens running?
All of those things are pretty cheap. Do you plan on a hundred sirens?
Like it'll add up but you could cover an Arma city with maybe five of em if you set the range to like 2000
It's quite a large city so it will probably be quite a lot if the sound's audible distance is low
How do you set the range?
It'd a playsound3d params
Check the wiki
if you're in a city that big, a few pfh's is gonna be a drop in the bucket in terms of performance
I'm a little confused on how to set the params, I'm quite new to proper eden editor coding and scripting and stuff so I'm a bit slow with this stuff. I've followed the wiki's instructions but it isn't working in game for whatever reason.
Playsound3d is a different thing
For this you kinda have to know the basics of scripting
People do teach the basics here but that's people other than me
You know anyone who can help?
Someone in this channel may decide to
The wiki is a good resource
Plus cba docs for how to add cba per frame handlers
Thank you for the help ๐
I wouldn't bother with a per frame handler at his level. The sounds don't need to be frame time specific. Just do a scheduled loop.
it's never too early to learn best practices :3
Do you know how to use the ambient sounds module in ace at all?
Haven't used it before, but I bet it's documented on the Ace docs
Id argue using frame time is not best practice for his case. He wants a bunch of cars and ambient noises (chaos). None of that needs to be frame time specific.
Loading the scheduler up for no reason is a slippery slope people tend to fall down
I think what Lou said is the best way to do this. Just use createSoundSource
Hello,
I'm running on a framework derived from Altis Life.
When a player opens a door in a house (modded or not), it is only open for them (on the client side only). Other players see it as closed.
Do you have any idea where this might be coming from?
yes
But I don't know how to do that off the top of my head lmao
Local only object
What does that mean?
Object is set to local only in the mission most likely
The houses are placed directly on the map. Is it related to the mission?
Where can I change that?
Uhhh someone is being weird then
do you know if the doors are supposed to be locked?
because that might cause desync...
No, they are open because the house has not been purchased.
ok
But they are closed, and as soon as you open them, they only open for one player.
Each player must open it to see it open...
I tried disabling BattlEye, Infistar, changing the difficulty, etc.
I can't find it... If you have any ideas, I'm all ears.
battleye and those things probably wont affect, but maybe some mod does
Hmm, yes, but which one? It worked for a while, but I admit it's been a long time since we tried it with several people, so I wouldn't know which mod does that.
Many mods interact with doors to animate them.
Like (_this select 0) animate [(_this select 1), 1];
that would definitely be a problem. you just have to disable those mods to see which mods break the door system
Although kind of at a loss, you wouldn't happen to be using animate and animateSource together would you? The wiki says it results in undefined behavior, although no idea what that behavior would look like
They use it in mods, but not together, as far as I know.
Hmmm. I used animate with a terrain object (local) and a global object (non-local) and didn't experience any issues. I'd definitely look into the mods, but without more details hard to say
I guess have you verified your objects are indeed global or a terrain object? Have you tried to do a setVariable on the house as public to verify other clients are able to see that data and that it is indeed the same house?
Everything about buildings (animations, damage, etc) should all be public and be relayed through JIP. I feel like the house has gotta be local or something.
These are terrain objects. I haven't tried anything yet. But it works on some modded buildings, others don't, and vanilla ones don't seem to.
Okay so I read this:
It is recommended that animateSource command is used instead of animate whenever is possible, as it is more efficient and optimized for MP
And figured I'd regex change all our usage of animate to animateSource just to give it a whirl and see what happens. I immediately had issues with both terrain and global objects. In further reading of the wiki:
If animate uses class name from CfgModels Animations, animateSource uses name defined by the source property. AnimationSources can animate multiple animate Animations. AnimationSource is defined in CfgVehicles' AnimationSources (see Arma 3: createVehicle/vehicles).
My guess would be that perhaps your command usage of animate or animateSource doesn't match with your models source property. I didn't investigate any more myself since I gotta head out but figured I'd document my findings.
Ultimately though, if you're noticing this after newly added mods; ruling them out one by one would probably be your best bet if you're not wanting to dig through each of them.
I used that back then for some stuff with doors and never had any problems nor complaints (used on multiple MP servers for terrain objects and additionally placed).
If it doesn't work the model/config is badly made.
...
private _AnimationSources = ((configfile >> "cfgVehicles" >> (typeOf _Building) >> "AnimationSources") call BIS_fnc_getCfgSubClasses);
{_Building animateSource [_x, 1]} foreach _AnimationSources;
I have some logs :
20:38:02 Object id 8ba27142 (322) not found in slot 78,93
20:38:02 Link cannot be resolved
20:38:11 Object id 8ba27142 (322) not found in slot 78,93
20:38:11 In last 3000 miliseconds was lost another 1 these messages.
20:38:11 Link cannot be resolved
20:38:11 In last 3000 miliseconds was lost another 1 these messages.
20:39:08 Object id 8ba27142 (322) not found in slot 78,93
20:39:08 In last 3000 miliseconds was lost another 1 these messages.
20:39:08 Link cannot be resolved
20:39:08 In last 3000 miliseconds was lost another 1 these messages.
But I don't know if it helps you
Unfortunately it does not 
Hmm. Are you sure server & client aren't running different versions of the same map, or something like that...
^ easy to check if you compare the netID of the building. Should be the same on server and all clients. https://community.bistudio.com/wiki/netId
Also check simulation, maybe some weird script disabling simulation?
.... it is ๐คฃ
My friend doesn't have updated his version....
I'm sorry for the disagreement
what's the correct way to get the [a, b] area of a module with an editable area while in 3den? BIS_fnc_getArea doesn't work and manually getting the objectArea variable only works while in mission
if i remember correclty
(yourModule get3DENAttribute "Size3") select 0 params ["_a", "_b"];
Not sure if there's a way to get module attribute names from the UI. If you don't know one you might need to grind through the config.