#arma3_scripting
1 messages ยท Page 184 of 1
Not related
It happens very randomly during gameplay
Cannot reproduce this bug in a repro mission
That is an engine issue, we are using fast math which sometimes does not quite the correct behavior with float numbers
We might turn off fastmath on profiling branch sometime soonish to test it
Hi ! Is there way to put a delay on this respawn button ?
I want the player to stay unconscious for a minute before having the ability to respawn.
Well, it's not a big deal for us, I just replaced that method with my own that does max 1 on the result, which fixes it.
RespawnTimer = 60;
0 spawn {
while { true } do {
private _respawnButton = (findDisplay 49) displayCtrl 1010;
if (RespawnTimer > 0) then {
_respawnButton ctrlSetText format ["Respawn (Wait %1s)", RespawnTimer];
_respawnButton ctrlEnable false;
} else {
_respawnButton ctrlSetText "Respawn";
_respawnButton ctrlEnable true;
};
sleep 0.01;
};
};
And then somewhere else you need to decrement the respawn timer after a player becomes unconscious.
Thanks ! I'll look into it !
Would HashMap with a Steam GUID as key work, since the GUID is quite a large number? Or would it break due to precision error
Just use a string if it was an issue
Hmm, good point ๐ Thanks, me dumb x)
It's better to use event handler than while { true } loop: https://community.bistudio.com/wiki/Description.ext#onPauseScript
dpes anyone know how i can prevent the server resetting client's fog settings? as soon as i move the slider the server resettes smothly to serverfog
I'm having a weird issue with my server and it only started recently. Trying to track down the source of it but it's not showing up in the server logs.
On player join, there's a message that says 'smelly', this is seperate from the motd.
I am the only one with access to the server box.
What, like a systemChat?
It's in the text chat, yeah.
Could be any mod, or mission code.
Is there a way to check message history in a server?
systemChat just prints there. That's all it does.
hello Arma 3 Awsome people:
if i spawn in a Cache Ammobox via Script, inside a house
and i destroy the Cache, witch also Destroys the House,
how do i restore the house back to its normal state, or its undamaged state, or all houses back to Normal undamaged State
why not make the house invulnerable?
well umm i did but some houses are on poles and then the poles get destroyed and the house stays intact
and if its over water there some issus getting to the cache
ic
btw how would you go about making house invulnerable maybe im not doing it right
house allowdamage false;
ahh thats simple awsome
thx m8 let me give that a try
i was useing this
{_x allowDamage false} foreach nearestObjects [lsw,["Building"],4000];
that would work too but only for "Building" s
ahhh ok nice thx m8
you could make everything invulnerable
how so
yes
ahh wow awsome m8 thx your the best m8
ok lets see how this works out woohoo Arma 3 hell yeah
@proven charm it worked awsome thx man, totaly awsome Woohoo
i love you man lol @proven charm
holy cow now that mission is so much Fun WooHoo thx @proven charm
yw
jup that is beeing done on clientside
that's your issue i guess
unfortunately the server overwrites it immediately
having different settings for each client in MP would be a huge exploit
anyone know the keybind to remove the map on the top left of my screen in eden editor?
this setting is made on clientside and as soon as he applies it gets set serverside
is there a way to prevent this?
what was my question
yep i'm just trying to tell you why it doesn't work ๐
if you want fog params to apply correctly you have to set those on the server
if you want each client to set their own fog params i'm afraid the game doesn't allow it
i think that would cause soo much lag. so this will be a sp feature only ^^
one just the one calling the dialog
hmm bis does thsi with his zeus module by executing the server the fog parameter on client and then on server?
i suppose what you set with the zeus module applies to everyone
you can't set the fog for each client separately
well me in the default game i have my MiniMap keys set to the [ ] keys
witch toggels it on and off
Hey Dudes, Quick question is there any way I can make AI respawn and take up the same waypoints and triggers?
one key put minimap on right an one key puts it on the left side
no i don't want to do that. just the admin can pop up the setting menu
though scripting any thing is posisable @faint otter
but me i would just recreate all the same stuff in a script @faint otter
but for me i like my enemy to go where thay want to go and attack where the leader tells them to attack i don't like useing waypoints
but thats just me
ha so you just need to execute that setfog remotely on the server
Awesome Thanks Scotty I just need them to do like demo where some where they will die but I would like the waypoints and triggers to pass over
actualy there is a great video on youtube for the thing your asking
Really? I must see this
let me see if i can find a link ok
Thank you
What kind of AI respawning are you talking about? Are spawing them with createUnit?
so i think i can try to first remoteExecCall on server and the on the client editing stuff
No I wasn't aware that was available
this should work yes
Yes please that would be great
and ater a while the fog will set on client
ok friend me and ill send it to you
yes
or PM me 1 of the 2
lol the name of the mission is spawnAI_copyWaypoints
mission is sent to you m8
@hushed turtle i dont remember i saw this video a while ago
and made a small mission
all i remember is the Ai keep spawning in to the same waypoints and followed the waypoints
@faint otter tell me if thats what your looking for m8, or if someone can help you make it better
store run ill bb
Can you put code into the title field of holdAction and addAction? This is what I have now.:
"<t color='#FFFF00'>Search for Intel</t>"
But I have few objects. it would look nicer if they could be named separately.
if (_objects == _file) then { "<t color='#FFFF00'>Search File Cabinet for Intel</t>" };
if (_objects == _locker) then { "<t color='#FFFF00'>Search Locker for Intel</t>" };
//etc
The title field cannot contain code, but you can use code to determine what string it should contain (at action creation, not dynamically at other times)
So I've already written a giant holdAction that accounts for other objects. I'd like to keep it if I can for time sake, but my backup is I can write multiple holdActions for each group of objects that are similar and just rename the title field for each group.
But if I can keep my original code that would be preferable. My action is in initPlayerLocal so does that satisfy the condition for "at action creation"?
action creation is when the action is created. doesn't matter if it's initPlayerLocal.sqf or what
I guess its created when a player loads in then?
Or do you mean it's created when the player uses the action?
The point I am trying to make is that if you do this:
[
_object,
name player,
// ...
] call BIS_fnc_holdActionAdd;
That name player is evaluated when that code is executed to create the action. It does not persist, it does not continuously re-evaluate and update the title. It evaluates into a string, and then that string is used to create the action.
ok everything set. hopefully the server won't freeze ...
I opted to spit the holdActions into different groups.
How would I get the following to work? I want it to print the solution to the math not _chance.
_chance = _attemptCount * 0.05 * 100; // Adjust the chance based on multiplier
["_chance"] remoteExec ["systemChat"];
Remove the quotes?
Well, the ones around _chance not systemChat.
["_chance"] -> make an array with the string "_chance" in it.
[_chance] -> make an array with the value of the variable _chance in it.
Of course. Thank you John. ๐คฆ
Oh actually I get an error saying it expects a string.
This did it:
[str _chance] remoteExec ["systemChat"];
I need some help with the math here. I have a few holdActions that do modify a variable:
//see how many times a player did the hold action
private _attemptCount = missionNamespace getVariable ["holdActionAttemptCount", 0];
_attemptCount = _attemptCount + 1;
missionNamespace setVariable ["holdActionAttemptCount", _attemptCount, true];
//calculate chance
private _chance = _attemptCount * 0.05 * 100; // Adjust the chance based on multiplier
I have 5 different hold actions. Each one can do a different multiplier. Doesn't have to be 0.05 like above. It might be a little more or less.
But the math isn't working out like I think it should. It should go like this; the more the attempts go up, the more _chance should go up.
But in testing sometimes _chance is actually lower than the previous roll. What am I missing here? Seems simple enough.
In a specific example of this. I used 1 holdAction for a chance of %7.5. Then another with the math above (5%). So it should be 12.5% but it came out at only 10%.
hmm works nicly ^^
Are you trying to add the two chances together?
The goal is have each holdAction increase the chance. _attemptCount is doing this. I don't need to track _chance since its with its own holdAction.
Each holdAction has a weighted _chance. Some are more likely to trigger than others.
Ahh I think I see. I would have to keep track of _chance if I wanted the math to look correct.
Well yeah, if chance varies with more things than _attemptCount then just track the chance instead.
Okay I can try that. Basically I'm try to test it so that it will get to 100% chance ever time for the player after doing all the holdActions.
ai dont want to die so plane better be way high
that sometimes works but i want it to be at a certain height
Try your luck with setFlyInHeightASL
well if you flyInHight 100; the pilot will do the best he can to maintain the hight
oh yeah POLPOX
ima try that
Will that work for helicopters as well?
yeah
Nice my AI helicoper just skirts the tree tops. I'd love for it to have a set altitude.
well like i said ai dont want to die just like you and me
So this script works great at forcing you into spectator mode on death but roughly 5 seconds later the respawn menu appears and prevents you from using the spectator controls anymore and just shows the map instead of the spectator camera. Is there anything I can do about that?
onPlayerKilled.sqf:
if (side group player == west) then {
"Reached force spectator" remoteExec ["systemChat", allPlayers];
setPlayerRespawnTime 999999;
"Set respawn timer to 999999" remoteExec ["systemChat", allPlayers];
["Initialize", [player, [], true]] call BIS_fnc_EGSpectator;
"Set player to respawnSpectator" remoteExec ["systemChat", allPlayers];
};
I basically want BLUFOR to have 0 respawns and go into spectator mode (instantly or slightly delayed after death) until the game ends
While OPFOR has infinite respawns
Then why do all the CAS planes crash during guns runs in Antistasi? LOL
i forgot if its in X,Y,Z order or in some other order
is it in X,Y,Z order?
sometimes its in a different order
for scripting
Just read the article carefully
okay
It says no XYZ mention
@split scarab ummm i think theres a way simpler way for that m8
oh
๐
for 1 thing the respawn time is set in the Description.ext
so its standard, combat, and stealth
theres really no need to remoteExec all that stuff
Just the SFP one as far as I heard.
do you want to see my onPlayerKilled.sqf:
This is my current Description.ext based on https://community.bistudio.com/wiki/Arma_3:_End_Game_Spectator_Mode#:~:text=In certain respawn types%2C the,3%3A Respawn - Respawn Types.
respawn = 3;
respawnDelay = 30;
respawnOnStart = -1;
Whats SFP? We have 48hrs on our save file. Only a single CAS plane has survived a gun run (Cam Lao Nam).
And yeah I'd love to if it works similar to what I'm trying for :)
ok
SOG planes were fine on Altis. CLN might be too hilly.
They fly on rails until the end of the gun run, and then we hand off to the AI to pull up. Not guaranteed success, depending on plane performance and terrain.
//onPlayerKilled.sqf
// Save inventory for loading after respawn
[player, [missionnamespace, "VirtualInventory"]] call BIS_fnc_saveInventory;
Sleep 5;
["Initialize", [player, [east, west], true, true, true, false, true, false, false, true]] call BIS_fnc_EGSpectator;
then in the onPlayerRespawn.sqf
[player, [missionNamespace, "VirtualInventory"]] call BIS_fnc_loadInventory;
sleep 1;
["Terminate"] call BIS_fnc_EGSpectator;
Isn't BIS_fnc_saveInventory here technically saving their current loadout for next respawn? Say if they've run out of ammo then they'll respawn with no ammo no?
well you can do that part anyway you like m8
Fairs, just curious haha
Do you have the respawn screen though using this?
Where you can pick the spawn location, etc.
Damn I was hoping to use that as I intend to have temporary spawn points that get de-spawned as the mission goes on
yeah see i don't use any of that stuff cuz people never use it thay are so ready to get back into the fight they just hit respawn
from what i have there you can figuer it out im sure m8
see i kinda don't like some schreen poping up its like nuts imho
but i do like the spectating stuff
btw nice Cake who don't like cake lol
Man i love this Arma 3 its So much fun and Cool also
Anyone know why this Trigger won't end the mission?
I have 4 blufor units with the variable names specOps1, specOps2, specOps3 and specOps4.
I spawn in as unit 1. Unit 2-4 aren't spawned in, then I kill myself and nothing happens?
Description.ext:
class CfgDebriefing
{
class BluforWin
{
title = "Mission Accomplished";
subtitle = "BLUFOR Victory!";
description = "BLUFOR successfully completed all objectives.";
pictureBackground = "";
picture = "b_inf";
pictureColor[] = {0.0, 0.3, 0.6, 1};
};
class OpforWin
{
title = "Mission Accomplished";
subtitle = "OPFOR Victory!";
description = "All key BLUFOR units have been eliminated.";
pictureBackground = "";
picture = "b_inf";
pictureColor[] = {0.0, 0.3, 0.6, 1};
};
};
it does not only change the fog ๐
If a playable unit is never spawned in, its variable is apparently never defined.
Which seems like terrible behaviour but hey, Arma.
So your condition will likely be silently skipped because it contains undefined references.
I'm not sure it'd work anyway, because with nil-or-null checks it might just trigger before any of the units are spawned.
Hmm, any suggestions on another way to do it? I specifically want to end the mission as failure for BLUFOR when those 4 units are dead because there's a 5th unit controlling a UAV so I can't use "end mission if all BLUFOR players are dead" for example
I don't know if you need the initial check, but this should work either way:
private _spawned = [specOps1, specOps2, specOps3, specOps4] select { !isNil "_x" };
if (count _spawned == 0) exitWith {false};
if (_spawned findIf { alive _x } != -1) exitWith {false};
true;
Actually I don't know if exitWith works in trigger conditions.
I would use !alive (missionNamespace getVariable ["specOps1", objNull])
Oh that worked brilliantly
Would still trip on the not-spawned-yet case.
Which might not be a case, but I wouldn't know and the wiki certainly doesn't.
Hi, I'm just trying to make a simple animation loop on a soldier and I'm just typing this in his execute box:
_this switchMove "Acts_Accessing_Computer_Loop";
waitUntil {animationState _this != "Acts_Accessing_Computer_Loop"};
};```
But when I execute it returns
```Error Suspending not allowed in this context```
Any help pls would be appreciated
Execute boxes run in unscheduled context (nothing else can interrupt their execution), so you can't do waitUntil or sleep within them. The workaround for something like this would be to spawn the code, like this:
this spawn {
while {alive _this} do {
_this switchMove "Acts_Accessing_Computer_Loop";
waitUntil {animationState _this != "Acts_Accessing_Computer_Loop"};
};
};
A sleepless waitUntil is pretty expensive though. If you're doing this with multiple units then consider event handlers or a sleep in the waitUntil.
I'm not sure which execute box you're referring to. Editor execute boxes use this rather than _this, hence my code.
The one where you double click on a unit to edit their properties, just below states
Is that ZEN?
Yeah
might be _this then.
Should say if you hover over it iirc
Yeah it's says "_this" refers to the unit's variable
btw it seems to be working now thanks
Hi
Is there code I can put in a trigger condition that checks when tank "t1" has its turret damaged fully?
They are already strings, not numbers
So, I'm using the default vanilla incapacitation/revive system in the game. I want to do a scenario where at least some AI utilize it as well, both friendly and enemy. For example, making it so that the AI can get incapacitated, even if they won't necessarily be helped back up. Is there a module or bit of code I could use to do this?
Hello, it would be nice if some one can give me a hint, why this not work: http://hastebin.com/fuxazebeni.md i only want that the specific Units in the Array are able to move the Rallypoint but all Players are able to move it. The Script runs on initPlayerLocal.sqf and onPlayerRespwan.sqf
it seems the EnemyDetected event handler does not work on player groups. Latest Arma 3.
(group player) addEventHandler ["EnemyDetected", {
params ["_group", "_newTarget"];
hint format ["Enemy Detected: %1 Target: %2", _group, _newTarget];
}];
does not work when you detect an enemy.
However it works for other AI groups.
checked with:
{
_x addEventHandler ["EnemyDetected", {
params ["_group", "_newTarget"];
hint format ["Enemy Detected: %1 Target: %2", _group, _newTarget];
}];
} forEach allGroups;
is this a bug?
loose the second private
Latest Arma 3, which latest? productVersion?
and use _x setVariable ["ACE_canMoveRallypoint", true, true]; instead of _rpunits = setVariable ["ACE_canMoveRallypoint", true, true];``
not beta (profiling or dev), its version 2.18.152405
no other mods
one thing you could check is if the player or its group is null
k
confirmed more than once. Must be a bug
Ty
thanks: http://pastebin.com/M0tmcuic is this correct?
although i never used it before. just corrected the syntax
ok thanks i will try it
nope thats wrong mom
private [_rpunits]; _rpunits = [ "nato_hq_zf", "nato_hq_szf", "nato_g1l_gf", "nato_g2l_gf", "nato_g3l_gf" ]; { _x setVariable ["ACE_canMoveRallypoint", true, true]; } forEach _rpunits;
thanks
bugs bug me he he
altho i can't remember the last time i saw a bug in my Arma 3 game everything works so perfect
because of all the great guys and gals in here
but mostly guys
How would one play a flare fired sound effect from the Trigger Activation script instead of this?
playSound etc
Is there a list of vanilla sound files somewhere?
CfgSounds, yes
Awesome thank you
How would I change a open laptop to a closed laptop?
Open latop: Land_Laptop_unfolded_F
Closed laptop: Land_Laptop_F
I was hoping to make it seamless and just change the object type of the original laptop but I'm not sure how to do that, so I tried the following but the closed laptop doesn't appear where I want it to be and is instead a floor below in the building lol
_newLaptop = createVehicle ["Land_Laptop_F", getPos _target, [], 0, "NONE"];
_newLaptop setDir (getDir _target);
deleteVehicle _target;
_newLaptop setposATL (getposATL _target); should do the trick
Perfect, thank you! :)
I'm trying to extend my revive system so AI can autonomously revive units in their group. Here's the action that I'm adding to the incapacitated unit: sqf private _actionID = _unit addAction [ format ["%1 %2", localize "$STR_A3_Revive", name _unit], { params ["_target", "_caller"]; [_caller, _target] call WHF_fnc_reviveAction; }, ..., // Condition: "!isPlayer _this && {[_this, _originalTarget] call WHF_fnc_checkRevive}" ]; When I'm the group leader, I can manually order AI to perform the action which pathfinds them to the target and does the revive. I also figured out that _caller action ["User", _target, _actionID] allows me to trigger the action. However, this makes the unit perform the revive regardless of distance. Is there a convenient command to make them navigate to the target before executing the action, or should I make the action doMove them to the target and wait until they've arrived?
(I just realized I don't actually need the action for autonomous reviving, but I'll still keep it there for group leaders in case they want to revive an enemy or something)
Hello, i want to create a locked Door/Gate, but ACE overrides the locked Status and i can open the door via ACE.
If i use Mousewheel only, the Door is locked.
Is it possible to lock a Door while i use ACE ?
i use this to lock the Door/Gate : tor_1 setVariable["bis_disabled_Door_1",1,true];
Edit: sry for my bad english ๐
Can i prevent ACE to show me the "unlock" Option while i use ACE on a locked-scripted Door ?
@errant iron doMove and check is the way. Bear in mind that they're quite bad at moving so they may never get there.
Especially if the target is in the upper floors of a building.
Alrighty, I'll use currentCommand to make sure the player can order them away if needed
How do I cancel a doMove command? In the case of multiple medics present, I want to interrupt a medic moving to an incapacitated unit if there's a closer medic nearby, but the following don't seem to do that, i.e. they continue running to their destination and the command menu still shows the unit has their "Move" order:
doStop _unit_unit doFollow leader _unit_unit doMove getPosATL _unit_unit setDestination [getPosATL _unit, "LEADER PLANNED", true]
Ah, this combination works: sqf _unit moveTo getPosATL _unit; _unit doFollow leader _unit;
Any of those commands will override a previous doMove. The command bar is weird though.
doStop+doFollow is probably "correct".
hmm, maybe not actually.
Hello gentleladies, how does setVariable work
If I set a public variable on a building, is it set for new players?
If you use public args true , then yes.
public - (Optional, default false) can be one of: Boolean - if set to true, the variable is broadcast globally and is persistent (JIP compatible) GEGlobal
Hmm
I'm setting a variable on my server, but when I relog it ain't set anymore
Is your server running with persistent=1?
Ye
Your testbed might be a bit odd? I tried giving a unit a doMove 100m away and all of these stopped movement except the setDestination.
doStop leaves it in stopped state, doMove leaves it in ready state, doFollow just works.

Oh hold on a moment... sqf private _assigned = _target getVariable "WHF_reviveActionAuto_assigned"; if (!isNil "_assigned" && {currentCommand _assigned isEqualTo "MOVE"}) then { _unit doMove getPosATL _unit; };
_unit != _assigned? :P
Let me test it now that my mistake is corrected
Yup, that was the issue ๐
Actual reason the last option worked was because I had refactored it just before that to handle cancelling the movement on the assigned medic's script, rather than between medic scripts
What sort of building exactly?
Map objects are kinda weird because they're local-everywhere, but it seemed to work anyway when I tried it with a house.
Hi, sorry, was doing testing
Turns out I have a crate, lemme get the class name
Land_CargoBox_V1_F
And it's a map object, not a mission object?
And I'm setting a variable to it
_building setVariable ["foo", true, true];
I've placed in eden editor so mission?
mission should definitely work.
However, I disconnect and then reconnect and that value is no longer set
Checked in debug
I dunno but it's pain
I'm assuming that you're not trying to refer to it as _building later
That's just a local variable that dies with the scope.
So you're saying that you can do cursorObject setVariable ["foo", true, true]; on the object, then reconnect, and then cursorObject getVariable ["foo", false]; on the same object returns false?
Yup
Exactly that
It's so weird
Don't worry lads
Someone changed
THE FUCKING OBJECt
TO FUCKING LOCAL ONLY
i also found about canFire which is useful
!canFire vehiclevariablename
I think that still returns true unless the weapons are damaged.
yeah i just needed it to check for modded tanks, some require like 6-7 sabots to kill
What would be an example of use case for holdAction "code ran per tick"? If you had it play a sound file. Would it only play a portion of the file or play the file every tick?
It would play the sound every tick
so i been trying to figure out how to turn off the wing lights on the planes but i tried using
_vehicle setCollisionLight false;
collisionLight = false;
and
_vehicle disableAI "LIGHTS";
am i using these wrong?
disableAI doesn't apply to vehicles, so maybe.
yeah
thats probably that
but planes use collision lights
Collision lights are (usually) on the wingtips, not forward facing
How are those lights turned on?
Are they toggled with the headlight key (default L) or some scrollwheel action?
they are turned on when i start the game
i cant turn them off
with scroll wheel
i tried deleteVehicle _lightSource;
it didn't do anything
They're probably headlights then, AI will turn them on at night
Try using:
https://community.bistudio.com/wiki/Arma_3:_Actions#LightOff
i'll try that after i eat
hey all.. I am writing players need to go in and find an injured unit, heal the unit, the unit joins the squad and then we all kill the town enemy. My struggle is trying to present the unit as an injured unit and to heal the unit with vanilla in game healing or maybe otherwaise AIS.
I've set these parameters against the injured unit as directly below, which doesn't make it visual enough.
// Configure injury state
_injuredSoldier setDamage 0.7;
_injuredSoldier allowDamage true;
_injuredSoldier forceWalk true;
I did try this and while it looked better, I couldn't heal the unit
// Injury Configuration
_injuredSoldier setDamage 0.8;
_injuredSoldier setUnconscious true;
_injuredSoldier allowDamage true;
// Animation Handling
[_injuredSoldier, "AinjPpneMstpSnonWnonDnon"] remoteExec ["switchMove", 0, true];
You'd need to add an action to the unit to remove the unconscious condition.
Similar if you use animations directly, vanilla healing won't touch that either.
ahh thanks John
A3U_loadoutCopy_Array pushBack [A3U_loadoutCopy_ID, _objetoOrigen, _AddActionTitle, _AddActionColor, _copyType, _copyOptionsArray, getUnitLoadout _objetoOrigen, _orden];
// Imprimir el valor de _x select 7 antes de ordenar
{
systemChat format ["Valor de _x select 7: %1", _x select 7];
} forEach A3U_loadoutCopy_Array;
// Ordena el array por el valor de _orden (posiciรณn 7)
A3U_loadoutCopy_Array sortBy { _x select 7 };```
Hi all, I'm trying to sort this array according to the value of _order (_x select 7) but I get an error that one is missing ; I know this error doesn't have to be that, but I've been thinking for a while and I can't figure out what I'm doing wrong.
The values are 1,2,3 and they are numbers because I convert them with this line above.
`_orden = parseNumber _orden;`
sortBy is valid command?
I just realized that the command was sort, not sortby, I'm looking because I found a BIS that is sort by, just now I'm entering the game to test it.
yep and i think you need https://community.bistudio.com/wiki/BIS_fnc_sortBy
If I were to save a player unit as a variable, like hvt = player;
Does the hvt variable get updated with player positioning as they move around? So I could do this?
while {true} do {
obj_Hvt setPos (getPos hvt);
sleep 1;
};
Yes, hvt is same object as player after line hvt = player
How can I check if a building is destructible or not?
I believe you could check its simulation, whether house or static - don't take my word though
Hello , i hAve a mission that i create , uploaded on dedicated server , mission loaded in recive file map but after it jumped to the default server mission lobby ,any guide to fix?
You're most likely missing mods on the server. Check the server rpt
Is it possible for tracers to ignite on script created projectiles?
Afaik no. But try triggerAmmo. Maybe that works (I doubt it does tho)
Where can i find server rep
Is there a way to find either:
- all units in the same building as a certain point
- if there's a path between two points
that doesn't take a lot of performance?
%localappdata%\Arma 3
though depends how the server is setup i guess
Not via scripting (except for PathCalculated but that's slow and has a delay)
Thanks, but that didn't work. Some buildings allow windows to break (maybe that's why simulationEnabled true), but are not destructible. How can I check config for building to see if there is a damaged ruins texture/object available?
How would I teleport to the marker _x in the foreach loop when using the action?
_insertMarkers = allMapMarkers select {toLower _x find "insert_" == 0};
{
_markerName = _x;
_markerNumber = _markerName select [7, count _markerName - 7];
this addAction [format ["Go to insertion point #%1", _markerNumber], {
params ["_target", "_caller", "_actionId", "_object", "_args"];
_caller setPosASLW _x;
}, _markerName, 1.5, true, true, "", "side group _this == west", 3];
} forEach _insertMarkers;
_caller setPos getMarkerPos [_this select 3, true]
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
eyyy, i remember it right ๐คฃ
This exists but not sure how reliable
class DestructionEffects
{
class Ruin1
{
simulation = "ruin";
type = "\A3\Structures_F\Households\House_Big02\House_Big_02_V1_ruins_F.p3d";
Which setPos command to use for PositionAGL?
i'd argue _obj setPosASL AGLToASL _somePosAGL; Or just _obj setPosATL _somePosAGL; if you take care to only use positions over the land ๐ค
That's what I thought, we lack setPosAGL command
setPos-equivalent behavior leads to memes like
Haha, yeah I tried what you had before the edit and I just wound up in the sea, but this makes less sense to me but it works
Why _this select 3?
because params ["_target", "_caller", "_actionId", "_arguments"]; is the proper parameter order, _arguments is 4th one, select is 0-indexed, 4 in 0-indexed is select 3, and you pass _markerName as arguments in your addAction call 
'cept Cake's params isn't really accurate, arguments would end up in _object
Seeing this I kinda want to create function setPosAGL, which would use AGLToASL method
Thanks, that seems good for ruins. But I've now found some buildings that collapse but leave no ruins behind. But DestructionEffects >> Sound returning a string value seems to consistently find those. Probably good enough.
I recently worked on some vehicle/structure deployment system and the different position schemes are a nightmare, especially over water (there is a carrier).
Always use ASL unless you specifically need another type
Using BIS_fnc_aircraftCatapultLaunch, I setPos the ai planes into catapult positions, but when they get catapulted it seems they are veer to the right or left and impact into the carrier or the sea, what can be done to fix this issue? Note these are not jets but propeller planes , but it seems it happens with jets also
Hi there, this guys' mods/scripting looks really cool, is there a way to make his script fire continuously off a vehicle in multiplayer? Use case would be a Bobcat with the plough flattening an area for a FOB for example. https://steamcommunity.com/sharedfiles/filedetails/?id=3432188295
is this a bug in BIS_fnc_holdActionAdd when you have more than one holdAction that the text of the following holdActions wont show in the middle of the screen? @cosmic lichen
[player,("time: "+str(time)),"","","true", "true",{},{},{player setDamage 0},{},[],1,nil, false, false]call BIS_fnc_holdActionAdd;
Sure, why not? Maybe your fps will be 0 but you could try it
Do you know how to do it?
i remember there being a online converter for the gui editor to sqf online does anyone have a link?
could be i remember a website for it though
no it just took export from ingame ui creator and turned it into sqf
Maybe you can force it to use its actions with the action command, so it dosen't need user input
Seems interesting, can't seem to get the terrain deformation to work with that one
This might be a stupid question but do I have to build my addon every time I want to test new changes or is there a easier way to do it "live"
#arma3_config pinned post
ty
Why ping me? Is this related to ENH?
i thought it is yours, if not then sry R3vo
Ping someone very specifically to pray is not how it works
Yay. I got my own function in the game ๐
yeah I posted a possible fix to this, now just hoping my fix works ๐ I have used it without problems so far though. link to fix: https://feedback.bistudio.com/T183273
I updated the zip, seems i forgot to upload the latest
R3vo is a wiki contributor, but he did not write this function ๐ ๐
I found this trick from A3 Alpha era, is it still valid way to define "constant" variables?
// -- Create and store the constant variable, I choose to use this format: Mission/AddonPrefix_VarName : So in this case:
EXAMPLE_CONSTVARIABLE = compilefinal "'This text is kept constant! and is returned when you call this function.'";
// -- Variables can be retrieved via:
_getVariable = call EXAMPLE_CONSTVARIABLE;
(Also ๐ at this new syntax highlighting)
Just hashmap not array
What's the point tho
You can use macros if they're literals
Was just thinking of hardening codebase when it comes to critical config variables
Just put all the const things into one hashmap, and make that final
Was actually just thinking of that ๐ Or saving all variables as strings and doing a regex check to detect number type values and then convert them to numbers, but I guess that's not the most performant way of doing it
Seems if i make them doMove modelToWorld in front of them they takeoff but only 1 from 4 plane manages to takeoff so no idea
hint format ["%1", _vehs];
_dir = getDir vehicle player;
{
_catpos = [274.561,15183.512,24.2595];
_x setPosASL _catpos;
sleep 5;
driver _x action ["engineOn", _x];
_aboveAndBehindPlayer = _x modelToWorld [0,1000,0];
_x doMove _aboveAndBehindPlayer;
[_x,177] call BIS_fnc_AircraftCatapultLaunch;
sleep 15;
} forEach _vehs;
Just a heads up: apparently the Discord theme you're using affects the syntax highlighting base colors now. If the highlighting looks weird after Discord update, switch your theme until you find good enough base colors
Like who thought that this is a good idea ๐
ugh did some version hassle there. the code in zip should now work
is there any reason this ui may not show up?, it makes the player have a freefloating cursor and can leave it with escape but no buttons are actually visible
with uiNamespace do {
NCL_display = (findDisplay 46);
display = NCL_display createDisplay "RscDisplayEmpty";
spawnvicb = display ctrlCreate ["RscButton", 1600];
spawnvicb ctrlSetText "Spawn Vehicle";
spawnvicb ctrlSetPosition [13, 19.5, 11.5, 3];
spawnvicb ctrlCommit 0;
leftB = display ctrlCreate ["RscButton", 1601];
leftB ctrlSetText "<<";
leftB ctrlSetPosition [6, 19.5, 4.5, 3];
leftB ctrlCommit 0;
rightB = display ctrlCreate ["RscButton", 1602];
rightB ctrlSetText ">>";
rightB ctrlSetPosition [26.5, 19.5, 4.5, 3];
rightB ctrlCommit 0;
};
you provide coordinates way outside of visible screen 
it showed up on ui editor export for .hpp fine? is there some calculation i need to run for the co ordinate to be better?
(using gui grid for position type btw)

see examples on wiki (https://community.bistudio.com/wiki/Arma_3:_Pixel_Grid_System or ctrlCreate's page or whatever)
here's picture from https://community.bistudio.com/wiki/safeZoneX that shows how much is 1 in UI coordinates. And it seems pretty accurate
thanks
You forgot multiplication by GRID system
Anyone had any luck with getting the RHS manual bolting to work with the deployed bipod hand animations?
Trying to do something with one of the cargo containers, is there a way for me to fix something to the ground while still being able to open/close its doors?
So far I've tried disabling simulation and attaching it to an invisible object with disabled simulation, both of which disabled the doors
Why do you need it fixed to the ground?
do you mean snapToSurfuse @idle remnant
Wich Config Property defines the texture of a uniform ground holder?
Do you mean the uniform when its dropped?
hiddenSelectionsTextures in the uniform itself (i.e. not the unit)
Same rules as hsTextures for anything else
Also that's config (obviously), not scripting
I have objects inside it non-simulated and I am trying to stop it from flying away
Might just rewrite to use attachTo instead
does disable simulation keep it from moving, right ?
Hello iโm having problems figuring out how to do unit capture for infantry
It would help to explain what issues you're running into
And what things you've tried
Well, the radio command to activate the script disappears when I try to activate the recording
And Iโm wondering if Iโm missing anything
Like do I have to create a mission file first? And where do I create it?
I havenโt tried much
How would you check if a marker with a variable name exists?
isNil "obj_Hvt" gives me true even though I have a marker with "obj_Hvt" as the variable name?
https://community.bistudio.com/wiki/markerShape
Try something like this. Or simply position being 0,0,0 consider that doesn't exist
Odd workaround but yeah that works lol
If you want to check whether the marker exists before you create it, you can just create it without checking. If it already exists the command will return "", otherwise it will return the same name as what you passed
@trim cairn if your radio trigger disappears after you use it you may want to set it to repeteable
@trim cairn and what do you mean (do I have to create a mission file first) yes you must always create a mission in the editer 1st then you can edit it as you wish
OK, but do I have to find that mission folder and put the Scripps into that mission folder?
some times i copy a mission folder then i change the name, and inside the folder eveywhere it needs to be changed, like in the sqm file and other places,
if you created a mission with the editer the folder will be in your myDocuments folder\ Arma 3\ your profile\ missions folder
yes you must find that folder
or the mission folder
Hopefully this advice works and hopefully I will be able to find it
ofcorse you must find the mission folder to put things in that folder
yes you will find it i know you will
oh wow i just got a win update cool
Iโm just making sure Iโve never done this before
like this??
Oh no, I havenโt made a mission to get. Actually, these are just all my other things. Let me make one real quick.
Are you still here?
In this arma 3 cinematic tutorial we are looking at unitcapture for vehicles and infantry (infCapture). Capturing infantry movement, animation and fire makes your cinematic look more alive. Combine it with capturing vehicles and the image becomes more dynamic. By using UnitCapture/UnitPlay for Infantry units in ArmA 3 by TedHO you can create bet...
Hello imntryijg to spawn TRIP WIRE at doors perpendicular to the entries or doors of JBAD buildings its not working for me can someone please help? Sometimes they go thru the wall or door sometimes theyre too low in the floor
I have DOT markers centered where id like them
Is this your code?
No its AI
I dont have time to learn SQF im sorry im just trying to have fun with ieds ingame
Holy shit. Which AI?
This is a pretty severe weakness for the general case:
private _doorDir = _doorPos getDir (getPosWorld _building);
Oh yeah, i noticed that it just couldnt get the door right, the road IED and other IED spawns fine.
You'd need a better way to figure out the direction of the door. I don't know enough about models to suggest one.
Yeah, the dumb-but-works way is to precompile a map of building types to door info.
Can I also use certain markers to point out the horizontal door direction?
ARROW --->
(ENTRY)
Map markers or 3d markers?
What do you have problems with? The marker itself or the door direction?
Hmm making the tripwire perpendicular to the door
making it ground level and not go thru thr ground
If i could place 3d markers via editor i think i could solve it, not many homes i gotta take care of
maybe selectionVectorDirAndUp works on doors. Not tried it.
that's a bit difficult to do. you need the door to be closed to do it properly (and even then it might be slightly misaligned)
one way to do it is:
- get on point door on the door
- get the center
- create the horizontal vector (how well this works depends on how narrow the door is)
so something like this:
private _p1 = _house selectionPosition ["door_1", "Geometry", "FirstPoint"];
private _p2 = _house selectionPosition ["door_1", "Geometry", "AveragePoint"];
private _dir = _p1 vectorFromTo _p2;
private _normal = vectorNormalized (_house vectorModelToWorld [_dir#1, _dir#0 * -1, 0]);
private _center = _house modelToWorldWorld _p2;
private _doorwayPos = lineIntersectsSurfaces [_center, _center vectorDiff [0,0,10], objNull, objNull, true, -1, "ROADWAY", "NONE"] select {_x#3 == _house} param [0,[]] param [0, _center];
private _tripWire = ...;
_tripWire setVectorDir _normal;
_tripWire setPosWorld _doorwayPos;
it does but the problem is you don't know which way the vectors point
In vs out? Or are there other options?
the dir can be either along the door width or perpendicular to the door
^ I had a typo
not really Arma's fault. selectionVectorDirAndUp returns the bone rotation. it doesn't care how the part attached to the bone was originally aligned
You can also check if it is in array returned by allMapMarkers
This seems to work in terms of placement
but the mine either doesn't explode or it explodes in the wall and does no damage... (this time indeed Arma :/) 
private _house = house;
private _door = "door_1";
private _doorAnim = _door + "_rot";
private _doorPhase = _house animationPhase _doorAnim;
_house animate [_doorAnim, 0, true];
private _p1 = _house selectionPosition [_door, "Geometry", "FirstPoint"];
private _p2 = _house selectionPosition [_door, "Geometry", "AveragePoint"];
_house animate [_doorAnim, _doorPhase, true];
private _dir = _p1 vectorFromTo _p2;
private _normal = vectorNormalized (_house vectorModelToWorld [_dir#1, _dir#0 * -1, 0]);
private _center = _house modelToWorldWorld _p2;
private _doorwayPos = lineIntersectsSurfaces [_center, _center vectorDiff [0,0,10], objNull, objNull, true, -1, "ROADWAY", "NONE"] select {_x#3 == _house} param [0,[]] param [0, _center] vectorAdd [0,0,0.05];
private _tripWire = "APERSTripMine_Wire_Ammo" createVehicle [0,0,0];
_tripWire setVectorDir _normal;
_tripWire setPosASL _doorwayPos;
yeeah, for me perpendicualr to the door for sure now but its like going under surface,
it does explode for me when i walk over it when its sticking out properly
This seems to be ok-ish now
private _house = house;
private _door = "door_1";
private _doorAnim = _door + "_rot";
private _doorPhase = _house animationPhase _doorAnim;
_house animate [_doorAnim, 0, true];
private _p1 = _house selectionPosition [_door, "Geometry", "FirstPoint"];
private _p2 = _house selectionPosition [_door, "Geometry", "AveragePoint"];
private _doorBB = _house selectionPosition [_door, "Geometry", "BoundingBox"];
_house animate [_doorAnim, _doorPhase, true];
private _dir = _house vectorModelToWorld (_p1 vectorFromTo _p2);
_dir set [2, 0];
_dir = vectorNormalized _dir;
private _normal = vectorNormalized [_dir#1, _dir#0 * -1, 0];
private _center = _house modelToWorldWorld _p2;
private _doorwayPos = lineIntersectsSurfaces [_center, _center vectorDiff [0,0,_center#2+10], objNull, objNull, true, -1, "ROADWAY", "NONE"] select {_x#3 == _house} param [0,[]] param [0, _center] vectorAdd [0,0,0.1];
private _tripWire = "APERSTripMine_Wire_Ammo" createVehicle [0,0,0];
private _wireBB = boundingBoxReal _tripWire;
private _wireExt = _wireBB#1 vectorDiff _wireBB#0;
private _wireWidth = _wireExt#0 / 2;
private _doorExt = _doorBB#1 vectorDiff _doorBB#0;
private _doorWidth = _doorExt#0 / 2;
_tripWire setVectorDir _normal;
_tripWire setPosASL (_dir vectorMultiply (_doorWidth - _wireWidth) vectorAdd _doorwayPos);
okay
the direction is good however its hard to make him put it on front or back of the door, above the ground
like make it visible
right now the direction is amazing but its just in the walls and as aplayer u just cannot defuse it
is there a config reference or command to get "components" (meaning the ones in virtual garage you can modify)? i see animation sources but am pretty sure there is more things that use animation sources
photo for reference of components
We start with animation sources and filter with isClass and then whether it has a displayName.
you can move it a little bit by "faking" the tripwire width (make it wider) so that it gets placed in the doorway:
_wireWidth = _wireWidth + 0.1;
but again looks like you've changed that in your own version. you can instead decrease the doorWidth
Thank you! i will try this
currently with your suggestions and help of claude i have
and these are results
also sometimes the doors are open and it uses the direction the open door points to
Also perhaps some1 has the answee how do you Force AI to break engagement adn move, the current force move func has a lot of issues i was told
What's the currently recommended way to create a scripted database with a HashMap? Should there be a global DB on the server or is it better to save progress to client's missionProfileNamespace? In the former case performance (when loading or saving profileNamespace) worries me, and security in the latter one
Issue with any scripted database is that entire namespace gets serialized on save for ANY slight change
So it doesn't matter if its hashmap or array or anything before, all same downsides
But yeah, use mission namespace and don't save anything important on client side
You mean missionProfileNamespace?
mission profile namespace*, yeah
Hello everyone, I've been wanting to create a single-player mission for Arma 3 for days, using scripts to revive soldiers. The goal is for the soldiers not to die and to be revivable. By placing the scripts inside the soldiers' init, I managed to make it work in the editor, but when playing in scenario mode, it doesn't work. I've tried other methods, but I can't get it to work. Does anyone know the correct method?
Don't crosspost, stick to 1 channel. #rules
Post your init code
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Also what do you mean by scenario mode? Multiplayer?
Why hideObjectGlobal and enableSimulationGlobal?
no. if it was correct your code would be syntax highlighted.
also no need to repost. just edit your message
just copy the upper part and put your code between the to sets of ```
params ["_unit", "_selection", "_damage"];
if (_damage > 0.9 && !(_unit getVariable ["isUnconscious", false])) then {
_unit allowDamage false;
_unit setDamage 0.85;
_unit setVariable ["isUnconscious", true, true];
_unit switchMove "AinjPpneMstpSnonWnonDnon_rolltofront";
_unit disableAI "MOVE";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
_unit setVariable ["ace_medical_enableRevive", false, true];
_unit setVariable ["ace_medical_pain", 1, true];
_unit setVariable ["ace_medical_bloodVolume", 0.5, true];
_unit setVariable ["medicCanHeal", true, true];
_unit enableSimulationGlobal true;
_unit hideObjectGlobal false;
};
if (_unit getVariable ["isUnconscious", false]) then {
_damage = 0.85;
};
_damage;
}];
this addAction ["Reanimate Soldier", {
params ["_target", "_medic"];
if (_target getVariable ["isUnconscious", false]) then {
_target allowDamage true;
_target setDamage 0.5;
_target setVariable ["isUnconscious", false, true];
_target switchMove "";
_target enableAI "MOVE";
_target enableAI "TARGET";
_target enableAI "AUTOTARGET";
_target enableSimulationGlobal true;
_target hideObjectGlobal false;
hint "Soldier reanimated!";
};
}, [], 6, true, true, "", "(_this distance cursorTarget < 3) && (cursorTarget getVariable ['isUnconscious', false])"];
it should be ```sqf followed by a new line
this addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage"];
if (_damage > 0.9 && !(_unit getVariable ["isUnconscious", false])) then {
_unit allowDamage false;
_unit setDamage 0.85;
_unit setVariable ["isUnconscious", true, true];
_unit switchMove "AinjPpneMstpSnonWnonDnon_rolltofront";
_unit disableAI "MOVE";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
_unit setVariable ["ace_medical_enableRevive", false, true];
_unit setVariable ["ace_medical_pain", 1, true];
_unit setVariable ["ace_medical_bloodVolume", 0.5, true];
_unit setVariable ["medicCanHeal", true, true];
_unit enableSimulationGlobal true;
_unit hideObjectGlobal false;
};
if (_unit getVariable ["isUnconscious", false]) then {
_damage = 0.85;
};
_damage;
}];
this addAction ["Reanimate Soldier", {
params ["_target", "_medic"];
if (_target getVariable ["isUnconscious", false]) then {
_target allowDamage true;
_target setDamage 0.5;
_target setVariable ["isUnconscious", false, true];
_target switchMove "";
_target enableAI "MOVE";
_target enableAI "TARGET";
_target enableAI "AUTOTARGET";
_target enableSimulationGlobal true;
_target hideObjectGlobal false;
hint "Soldier reanimated!";
};
}, [], 6, true, true, "", "(_this distance cursorTarget < 3) && (cursorTarget getVariable ['isUnconscious', false])"];
Sorry, it's my first time using Discord, thank you very much for your patience
don't put any space or newline between ``` and sqf
just this:
```sqf
then start the code in the next line here
I've sent you a message, check your spam box
also this is how you edit the message:
And now?
delete the old one ๐
do you see the action when you play it as a scenario?
actually nvm it's only visible when the soldier's unconscious
I don't have the option to reanimate the soldier
Exactly, the script works fine in the editor. The issue arises in the scenario mode, where the soldier dies immediately instead of going unconscious. This seems to be a problem related to the initial damage handling in the scenario, possibly due to the way damage is being processed in that environment. We'll need to investigate how damage is applied and make sure it properly triggers the unconscious state instead of death.
maybe another mod is overwriting your event handler
you can see now why, i don't put mods, in my clean, Arma 3 game woohoo๐
try this instead:
private _code = {
params ["_unit", "_selection", "_damage"];
if (_damage > 0.9 && !(_unit getVariable ["isUnconscious", false])) then {
_unit allowDamage false;
_unit setDamage 0.85;
_unit setVariable ["isUnconscious", true, true];
_unit switchMove "AinjPpneMstpSnonWnonDnon_rolltofront";
_unit disableAI "MOVE";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
_unit setVariable ["ace_medical_enableRevive", false, true];
_unit setVariable ["ace_medical_pain", 1, true];
_unit setVariable ["ace_medical_bloodVolume", 0.5, true];
_unit setVariable ["medicCanHeal", true, true];
_unit enableSimulationGlobal true;
_unit hideObjectGlobal false;
};
if (_unit getVariable ["isUnconscious", false]) then {
_damage = 0.85;
};
_damage;
};
private _EH = this addEventHandler ["HandleDamage", _code];
[this, _EH, _code] spawn
{
params ["_soldier", "_EH", "_code"];
sleep 1;
private _info = _soldier getEventHandlerInfo ["HandleDamage", _EH];
if (!(_info#0) || !(_info#1)) then
{
_soldier removeEventHandler ["HandleDamage", _EH];
_soldier addEventHandler ["HandleDamage", _code];
};
};
this addAction ["Reanimate Soldier", {
params ["_target", "_medic"];
if (_target getVariable ["isUnconscious", false]) then {
_target allowDamage true;
_target setDamage 0.5;
_target setVariable ["isUnconscious", false, true];
_target switchMove "";
_target enableAI "MOVE";
_target enableAI "TARGET";
_target enableAI "AUTOTARGET";
_target enableSimulationGlobal true;
_target hideObjectGlobal false;
hint "Soldier reanimated!";
};
}, [], 6, true, true, "", "(_this distance cursorTarget < 3) && (cursorTarget getVariable ['isUnconscious', false])"];
holy Ace Batman:)
Thank you so much for the help and patience! I can't test it right now, but I'll try it when I get home and let you know if everything works correctly. I really appreciate your support, and I hope this solution is what I needed!
oh it will be Leopard20 is Awsome
hes 1 of the great guys in here
he helped me alot
hey, I have a question for you: is it possible to add a texture to the entire screen (such as a hud simulator), specifically, I want to add my gas mask texture to the screen. Do you know the simplest script?
thank you very much for your help.
Why does this fail?```sqf
missionNamespace setVariable [format [PlayerMoneyOnBankAccount_%1, _guid], _playerData select 0];
```2025/03/28, 17:02:54 Error in expression <
missionNamespace setVariable [format [PlayerMoneyOnBankAccount_%1, _guid], _pl>
2025/03/28, 17:02:54 Error position: <PlayerMoneyOnBankAccount_%1, _guid], _pl>
2025/03/28, 17:02:54 Error Undefined variable in expression: playermoneyonbankaccount_
because you need "" around your format template?
ja, i kinda see how config's implicit stringing can do that to human ๐คฃ
Lost 50 % of my remaining brain cells, I have one now
hence why you must use string in config, don't "implicit" anything, it's the best way to get backstabbed ๐
using explicit strings in config would still get you backstabbed... but with explicit strings, at least ๐
one has to choose their fights I guess ๐
is there a command to get users ui colour scheme or is it a config / var?, and if the latter is it documented?
I used this in my last coop mission which I hosted.
{_x hideObject false;} forEach synchronizedObjects thisTrigger;
{_x enablesimulation true;} forEach synchronizedObjects thisTrigger;
The reverse of course to hide via the init
A few of the players did not see the objects, would checking the server only box in the trigger make a difference?
Not had a lot of luck using noshow/show module.
If objects to hide aren't many, leave the module and use the commands with variable names given in the editor. If they are a lot just spawn them.
lots of modules work only in single player (hide module is working in MP)
the bad thing with hide module is hidden object still eat your mission resources while spawn script doesn't
Ya it was strange that some players saw the objects and some didn't.
I usually 'show' with a rush script or patrol and it makes for quicker mission building.
modules are broken in MP, don't rely on them as much as possible
for exapmple hide map object module isn't working on dedicated at all
Ya I'll just reduce the hide option as much as possible for vehicles.
I've been using the SOG Respawning Garrison for Inf. and it's worked great.
Prairie Fire DLC modules generally work great
Thanks for the advice
Cheers
Can you use wp once the Inf has spawned?
yes but you have to name them in the editor and use the variable names and use the ste waypoint command
something like
//you name the wp placed in the editor wp1
//redGRP1 is the variable name you gave to the group in the editor
wp1 = redGRP1 addWaypoint [[position of the wp here],-1];
wp1 setWaypointType "SAD";
[redGRP1, 1] setWaypointSpeed "LIMITED";
[redGRP1, 1] setWaypointBehaviour "COMBAT";
wp1 setWaypointStatements ["true", "hint 'hello'; hint 'goodbye'"]
wp1 setWaypointCombatMode "RED";
Can I remoteExec a function from client if it's defined only on server (in server-side only mod)?
Yes
Yay ๐ Thanks again ๐
Not just in that client/server arrangement btw, the function only has to exist on the target machine, regardless of what kind of machines are involved
That's nice, some smart design there ๐
hey guys im trying to remove a players binoculars with either of these soltions and neither work... any help?
The first one works for nvg but using hmd instead of binocular, does the unassignItem or unlinkItem not work for binoculars?
player unlinkItem (binocular player);
player unassignItem "Binocular";
player removeItem "Binocular";
This code returns that the player has binoculars so I assume unlink or unassignItem would be correct..
assigneditems player
Binocs are a weapon, not a linked item
ah thanks yup got it working
Binocs are a weapon, not a linked item
i know is far from ideal, its more to protect the code
can i "send" the functions from the server to the client?
something like:
publicvariable "tarta_fnc_myfunc" ?
Technically yes.
Yeah, but sending code over network is less than ideal
Also that isn't going to protect your code
Because publicVariable would define the variable on the client, so they can just read the variable
There's no point in doing that
yea, but its harder
well, they can't read it without debug console access or hacking tools.
they can hack the server and download the files too lol
If you're not hoping to have 100 people on the server and broadcast the function to them all at the same time, that's one of the better ways to hide the variable. "Hacking the server" is something out of scope for 99.5% of Arma cheaters
what people cheat in Arma ?
Three question:
One, whats the best method to play sound from object. Like diesel generator sound.?
Two, there i have three holdaction code for apply loadout on player , one of codes after apply will burn about 30 fps (if you enter any vehicle it will fix) but when you come out , fps drop still . How to fix it and any good method to do loadout apply?
Three, there i want to spawn composition objects via add action , no problem on spawn for now , there i want to show an greyed out simple of my objects before place for get player information about where to spawn , like some car spawners
- Post code
- IME, mostly depends on if you're needing dynamic volume, pitch, etc. I usually default to say3D but use playSound3D if I need to vary the volume / pitch dynamically
- You're likely doing some bad / unoptimized stuff, you'd need to post your code to really see though
- You could spawn a bunch of simple objects and apply a texture to them
No acceess to codes right now , but im sure three code are same and diffrents are about loadouts changes
Greyed out object like the helpers
Its not main object
When you choose addaction it show greyedout object you can rotate it and choose where to place
Same thing then, just spawn some dummy objects and then delete them when the actual comp is placed
Can you explain about it
Just doing createVehicle ["someDummyObjectClass", ...] when the option is in progress, and then deleting all those temporary objects when the statement actually runs
Nice , i will test it and thank you
Here's a quick example, I didn't test this and haven't used a hold action in like 2 years, but it should get the idea across
// All global variables should use a unique prefix or "tag"
// You should replace it with something unique to you, the mod, mission, etc.
TAG_compositionDummies = [];
[
_object,
"Place Composition", "", "", "true", "true", {
// Action starts
// Here is where you'd create all your temporary objects, and then add them to the TAG_compositionDummies array
private _tmp = createVehicle ["Land_Pallet_MilBoxes_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_tmp setPosASL (getPosASL player); // Move it to where you'd want, this is just an example
TAG_compositionDummies pushBack _tmp;
}, { /* Action progress ticks */ }, {
// Action finishes
{ deleteVehicle _x } forEach TAG_compositionDummies;
TAG_compositionDummies = [];
// Now spawn the actual composition
}, {
// Action is interrupted
{ deleteVehicle _x } forEach TAG_compositionDummies;
TAG_compositionDummies = [];
}, [], 10, nil, true, false
] call BIS_fnc_holdActionAdd;
No problem i think , but there is a question about getpos of index of compositiondummies
How to do
_pos = getpos TAG_compositionDummies select 0;
Will work?
That'd be the complicated part
You'd need to get where the player is looking at, and try and get the relative positions of where every object in that comp would be
IMO, doing every object isn't worth all that trouble. I'd personally just use a big object to mark the general area and constantly set it to where the player is looking
Like how ACE Fortify / Liberation do it
If we use some example object ass temp then get pos of it
Will work?
Like what i say from array
You'd still need to spawn something in the correct place at first, which is what you're issue is
Ok
this code would not systemchat anything if vic is nil systemchat typeName vic; however systemchat str isnull vic; would right?
No, isNull nil returns nothing, because null is not nil
isNil is probably the command you want
This is my first time trying to code arma and I can't figure out what is wrong
Labdocs=True;
Publicvariable="Labdocs";
labdocs = true; // variable labdocs now contains value true
publicVariable = "labdocs"; // variable publicVariable now contains value "labdocs"```
`=` is used to assign a value to a variable. `publicVariable` is a command, not a variable, and you cannot assign a value to it.
```sqf
labdocs = true;
publicVariable "labdocs";```
@hallow mortar thank you so much I copied it from a YouTube video lol
Now that I cant scavange on the forums because they are down,
Does anybody have some code that allows a certain zeus to only see opfor units and nothing more? even when they might be able to updat editable obects?
you can hide unwanted units like this ```sqf
{
if(side _x != opfor) then
{
_x hideObjectGlobal true; // Or hideObject if code run only on zeus machine
};
} foreach allUnits;
@proven charm what is this hiding enemy do i don't understand what its for really /
that was for @vocal chasm
yes i know but does this mean you can't see the enemy or
you cant see the units if they are hidden
you mean you can't see them at all and they can shoot you
yes cant see them
well what would this be for i dont understand
well if zeus is not supposed to see the enemies that could be used. actually it would better to run the code in zeus machine and use hideObject instead
ahhh i see
assuming you still want the opfor players to see the enemy ๐
yeah i want to see the enemy when i see the enemy lol
lol yeah only zeus vision should be limited
glad i dont use Zeus lol
so hiding the enemy would be away to scare the crap out of some players right ?
i think this is typical RTS scenario where commander cant see the enemy
not sure exactly what is wanted but i assume something like that
so this hide the enemy stuff is this for hiding them on the map view or
completely hiding them from player/zeus
oh i see ok
you do have a point , player can still see enemy icons on map ๐ค
or script
yes sir
see i never used Zeus, so for me i cant see any reason to hide the enemy in any case
in my missions you have the option to turn markers off, or on, on the fly in game
or you can just have players markers on also
or any side markers you want, i love options
so if you are a hard core player in my missions, you would turn all markers off, and have team respawn on also, woohoo Arma 3 hell yeah
and also set max amount of enemy woohoo
but i see your point now with the Zeus
Zeus is like God right lol
also in my missions there is a setting called God Mode, where you can not die, and you can just run though the jungle, and Fire At Will, if you are a new player and you want to play the mission and just be rambo he he
i mainly use it for testing my self
but there is a condition to using GOD mode if you get in a chopper or any vehicle or para jump or teleport or halo God Mod is removed form you, in my missions
the player may still take collision damage even if you used allowDamage, i think
yes sir
like if you jump off a cliff and fall a long way your dead lol
but you can crash a chopper and not die iv found
as i did in testing lol
and i also saw many times after a hard crash in any thing the player gos into this kinds like shock mode and finaly recovers after a bit
yep
umm vanilla arma behaviour
ahhh nice i want that lol
i only use vanilla so woohoo Arma 3
would you have a link to this arma behaviour @proven charm
its already in arma , like you can get knocked over by a vehicle
yes but how can i have a look at that script i wounder
could be hard coded so you cant
oh no dam
or search the files ๐
yeah no idea
man thats going to be awhile till i find that 1 lol
you could try the function viewer...
ahh yeah right
it could be in .fsm too
oh nooo lol
fsm stands for freeking sh@t messed up lol
btw @proven charm thx for all the help you have givin me in the past your a awsome m8
np
Does smb use InterceptDB ? Is it better than extdb3?
Is it somehow possible to do constant arrays in SQF?
compileFinal
So I'm trying to play an audio via an Add Action but the playSound3D only plays for the player who activated the addAction and not for everyone else nearby. Remote Executing it (even though you shouldn't) causes multiple non-synchronous audio which is undesired.
I could use playSound but it does not have any droppler effect and sound distortion.
Make sure you have the distance set correctly, so that players nearby aren't just too far away to hear it. Also make sure you haven't turned on the "local only" optional parameter for the command.
["audio\LocalSpeech.ogg", _this, true, getPosASL tv1, 5, 1, 25, 0, false]```
The distance works for the player executing it and local only is set off.
I understand that the distance works for the player executing it, I'm asking if you're sure it's far enough to reach the other players. 25 metres isn't super far, and that's when the distance-based volume falloff reaches 0 - towards the edges of that radius, it may be so quiet it's not audible. Are you sure the other players are close enough that they should be able to hear it?
We are standing right next to each other < 1 m away ๐
He can hear the audio, I couldn't.
Also, note the requirements for the file path. If this audio file is a mission file you need to use getMissionPath.
Ill fix that, but for the core functionality, its only working for the person executing it though (in a dedicated server environment)
Using the correct file path is core functionality. It actually shouldn't work at all without it, so I wouldn't be surprised if that's why it's only partly working.
what about "any sound" remoteExec ["playSound"];
This is why I'm not using playSound per se.
ok i see
I want the audio to be limited by distance.
I'm trying an alternative method of remoteExec'ing say3D
playSound isn't positional at all, it's not really a suitable substitute
i understand
playSound3D should work, as described. I don't see anything wrong with the parameters other than what was already fixed, and it's a Global Effect command that has historically worked perfectly fine.
this is what i use to limit sound: may not be what your looking for: this would be inside a script ofcorse
if (player distance Helo2 <=300) then
{
"whatyouwaitingforGi" remoteExec ["playSound"];
};
It's not just your client volume settings, right? You can hear other sounds?
this addAction
[
"Play",
{
params ["_target", "_caller", "_actionId", "_arguments"];
tv1 setObjectTextureGlobal [0, getMissionPath "video\video.ogv"];
[getMissionPath "video\video.ogv", [2, 2]] remoteExec ["BIS_fnc_playVideo", [0, -2] select isDedicated, false];
private _sound = playSound3D [getMissionPath "audio\LocalSpeech.ogg", _this, false, getPosASL tv1, 5, 1, 25, 0, false];
waitUntil { soundParams _sound isEqualTo [] };
},
nil,
1.5,
true,
true,
"",
"true",
50,
false,
"",
""
];
This goes in the init field of the object.
What's up with using _this as the source object?
I know it's not actually used because you specify a position later, but passing something that's not an object could still screw it up
Bear in mind that in addAction activation code, _this is the array of provided parameters, not the caller object. It's not the same as the condition code.
very interesting
just want to check is this the correct way to pass an array as a variable to a function i have
params ["_player", "_vicarray", "_xarray","_infarray"]; in the function and to call it i use [_player, _varray, _xarray, _infarray] call ncl_fnc_sort;
however when using
{systemchat str _x}foreach _vicarray; and any other logic it does not return anything
Does _varray actually contain anything before you pass it into the function?
its defined as _varray = ["B_RangeMaster_F","B_Soldier_lite_F"];
Is the function actually properly registered (e.g. in CfgFunctions) and confirmed to be running without any errors before the systemChat?
as far as i can tell yes (other code in it works and i call it as a function)
Has the _varray been modified elsewhere? (Arrays are pass by reference, not value.)
Is this being called on a server?
Try systemChat str _this in the function.
systemchat str _this would return an error due to the fact i am passing multiple params
Hm... no, it should print all of the parameters of the function.
They should still be stored in the _this variable. params is just a shorthand to initialize a bunch of functions based off of _this # 0, _this # 1...
{systemchat str _x} foreach _this would i am not using syntax 2 in that thing mine is more similar to syntax #3 as it has multiple params not a param which is multiple numbers
Yes, I'm aware of what you're doing. If systemChat str _this in your function is not working and is giving an error, then it's something else.
str would work fine with multiple params. It would just stringify the whole array of params contained in _this. It would print e.g. "[1, some_object_reference, true]"
You said it would give an error. What error is it returning.
How to show holdaction only for specific player role like medic?
That accepts code, not array
just make that code return your array
There is only an array in that code and I'm not able to read elements from it. str returns that array including {}
You can use call to return the array. CompileFinal makes the code unchangeable in terms of SQF, so it will act as a constant
Hi People, Does anyone know if its possible to create markers accessible only to users in the same squad as the Person who triggered a trigger to create them? Been struggling to get anything to work
The createMarker command has a parameter for channelID. You can choose the group channel, and the marker will be created for every person in that group.
https://community.bistudio.com/wiki/createMarker
That's what I thought at first, but advanced debug console was complaining about call not accepting string, which led me to dead end. It turns out that it compiles and runs just fine, despite the error.
Ah -
_array = [1,2,3]; // Creates the array
_str1 = str _array; // turns it into a compilable string
_constant = compileFinal _str1; // creates the constant
call _constant // will return array
That still makes it for people outside the squad
Specify action's condition.
compileFinal also accepts code, so this should work too:
_getConstantArray = compileFinal { [1, 2, 3] };
Would work as well, I just gave an example. If you're going to use a predefined array with only numbers or strings like that as a constant, using a config value is probably preferential anyways.
Good question about configs, but it seems like extracting data from them is slower than accessing a variable.
Marginally, sure.
If you're evaluating a value every frame or similar, a variable will be better. But at that point, store the config value as a private variable and use that.
This and init.sqf is the same thing right? Figured I should move it to init.sqf to make things easier for myself if so
Should be the same, yeah
Hey guys I was wondering if anyone knows how to force the player to open their inventory via code?
I've tried
createDialog "RscDisplayInventory"
but it only shows the background of the inventory. Not the items etc. any ideas what display names I'm missing?
Perfect, ty
Any reason something like this won't work?
player action ["Gear", objNull];
Yes, I wish to try and force the inventory open underwater, and I'm 99% that command won't work as it does the same checks as pressing I
I want to try and allow underwater use of the inventory
For divers
Try and let us know.
Will do the second I get back home just though id shoot the question out as from trying the other day I couldn't find a way
I was hoping to find the Rsc name and use createDialog, but I only found that one unfortunately.
I know the display id is 602 but idk how I could get the class name from that
I think there's a thing that stops you from opening inve underwater
Yeah I was hoping that check is just from pressing I or the gear action. And with createDialog I could override it.
But idk the Rsc names I need or how to find them from the display idd
RscDisplayInventory. These are the idds but it sounds like a pain to get it all to show/work.
Where did you get that from?
Or how did you find it haha
Arma 3\Addons\ui_f\config.cpp
Huh I must have been blind af because I swear I searched that file ๐
Thanks I'll have a play with it
I have triggers that monitors and does stuff if an objective has been completed, I want to announce different things to each team from within the trigger.
I tried:
[east, "OPFOR"] sideChat "BLUFOR recently completed an objective! ";
[west, "BLUFOR"] sideChat "OPFOR has been alerted of your recent objective completion.";
But got some kind of "generic error in expression", so what would be the right way to do it so only one message is displayed to both teams?
Ah I think that's not a valid identity.
identity: String - class name of one of the identities in CfgHQIdentities. Possible identities in Arma 3 are:
"Base"
"HQ"
"PAPA_BEAR"
"AirBase"
"BLU"
"OPF"
"IND"
"IND_G"
Yeah, just tried with BLU and OPF and that works, but is there a way to change the name of who sent the msg? lol
You might need to define CfgHQIdentities
I don't know if you can do that if it's just a mission or if you need an addon
Just what I was about to say haha
Or I guess he could remoteExec systemChat but I think it will look worse being grey than a message from "HQ"
Looks like the description.ext thing doesn't work, might need an addon
Ah @split scarab, you could place a unit for each side, name his squad whatever you wish to the name for sideChat and then do _unit sideChat "message"
As per this image you can see alpha 1-2 which is the squad name of whatever unit is speaking
_soldierOne sideChat "Show this text";
Toyed around with the predefined ones
I'll just settle for "Base", it displays "Base" so that'll be good enough lol, I just wanted it to look like it's coming from HQ or similar
How can I find the class name for animations?
Animation viewer is the best way I know. Press escape in game and there should be a button bottom of the screen. Just scroll threw the sections till you find what you want
I hate how often I come in here for help lol, but I can't figure out how to hide specific markers for OPFOR...
I have this in initPlayerLocal.sqf
0 spawn {
if !hasInterface exitWith {};
if (side group player == east) then {
_insertMarkersToHide = allMapMarkers select {toLower _x find "insert_" == 0};
{
_x setMarkerAlphaLocal 0;
} forEach _insertMarkersToHide;
};
};
And this dosnt work? Any errors coming up?
No errors but I still see them all as OPFOR
Idk if that's cause I'm technically logged in as admin while I'm testing using local mp server
Comment out the first line and see if it works, when you locally host you are the server and client, so that first line will tell it not to run
Didn't change anything unfortunately
That line doesn't detect if you're the server. It detects if you have an interface, and P2P servers do have an interface.
Oh durr ofc
I have them set to "Hide on start", maybe that affects it?
But if I don't do that, they'll be visible during the briefing screen
Try run just this in debug console and see what you get, check it's making a list of all the markers
_insertMarkersToHide = allMapMarkers select {toLower _x find "insert_" == 0};
["insert_1","insert_3","insert_6","insert_5","insert_4","insert_2"]
Finds them all yeah
Then add the for each that hides them to the debug console too does that work?
If they're set to "hide on start" (is that a vanilla option? What does that?) then what causes them to be visible later?
Your code is being run during initialisation, which happens before the briefing. If something else is unhiding them later, then your code doesn't prevent that.
Yup that was the ticket
Had to disable "Hide on Start" and remove the condition that shows them
Order of initialization can be a bitch sometimes lol
Hello again, how can I check wait until all players are FULLY loaded in, as in able to move around?
You'd probably need them to tell you that.
There's getClientState but I'm not sure it's sufficient.
You could try this, not sure if it would work.
(PlayersNumber BLUEFOR) isEqualTo (BLUEFOR countSide all players)
PlayersNumber will count how many players are selected a role in the lobby. And the other one counts how many people are controlling units so can move
So this would only give a false info if they have not selected a slot yet but if there still loading it will work fine
I assume your only using bluefor, for all users you need something else that I could write up when I get home
Unfortunately not, works as good as waitUntil { time > 0 };
Which is met as soon as you click "continue" on the briefing screen
I'm hoping to find something that detects when people are fully loaded in to display informative messages and start a warmup period countdown
But that has to be clientside and only checks if that user is loaded in, thw code I wrote should check all users are loaded not just 1
So your wanting to know when all users are on the briefing screen and ready to start the game?
No I want to know when everyone has finished the loading screen after briefing
Cause there's a loading screen before briefing and a loading screen after briefing before you see what your character sees and you can start to move around
My best workaround so far is just to slap a sleep 20; in before it does anything but not everyone will have loaded in, in that time
Mmmh then the code I put should work because the second half checks how many users are controlling a unit (so can move) right then
How did you test it?
[] spawn {
waitUntil {
(playersNumber BLUFOR) isEqualTo (BLUFOR countSide allPLayers);
};
systemChat "Reached game loaded";
// do stuff...
};
Triggers before I even click continue on briefing screen
where are you executing it?
Init field of an object
if !( isserver ) then {
[] spawn {
waitUntil {
!(isnull finddisplay 46) &&
(playersNumber BLUFOR) isEqualTo (BLUFOR countSide allPLayers);
};
systemChat "Reached game loaded";
// do stuff...
};
};
this will be executed on every client, so don put any global commands in it
if you test this in editorMP it will be skipped btw if ( isserver ) exitwith {};
fuck it, that will work
Let me share exactly what is in the object init field, just to make sure it won't fuck anything up if I do that
[] spawn {
private _insertMarkers = allMapMarkers select {toLower _x find "insert_" == 0};
private _sortedMarkers = _insertMarkers call BIS_fnc_sortAlphabetically;
waitUntil {
!(isnull finddisplay 46) &&
(playersNumber BLUFOR) isEqualTo (BLUFOR countSide allPLayers) &&
(playersNumber OPFOR) isEqualTo (OPFOR countSide allPLayers);
};
systemChat "Reached game loaded";
sleep 5;
[west, "Base"] sideChat "...";
[east, "Base"] sideChat "...";
sleep warmupTime;
[west, "Base"] sideChat "...";
[east, "Base"] sideChat "...";
{
private _markerName = _x;
private _markerNumber = _markerName select [7, count _markerName - 7];
insertScreen addAction [format ["Go to insertion point #%1", _markerNumber],
{
params ["_target", "_caller", "_actionId", "_object", "_args"];
_caller setPos getMarkerPos [_this select 3, true];
_caller enableSimulation false;
}, _markerName, 1.5, true, true, "", "side group _this == west", 3];
} forEach _sortedMarkers;
};
Cause you say it'll execute on every client, won't the action be added a bunch of times then?
will be better if you put all this in initPlayerLocal.sqf
nope, bc addaction is local
Gotcha, not sure how I'll be able to test it but I have one concern about this. Won't it technically be out of sync between players? If one player loads in faster than another, won't their sleep warmupTime; start sooner?
It shouldn't because the sleeps are after the check to see if all players are loaded in. So that wait until should only continue when everypne is ready. It's hard to test without another person yeah. What you can do is load up arma twice and connect to your own locally hosted server for testing
It lets you which is awesome haha. To load it twice just tab out when ones loaded and click play a second time should work
Anyone who joins in progress will have to go through the warmup time at that point
Yup, but I think that's ok as he wants everyone to be there at the start, sounds like no one should be jip
Ah, good point, but I can basically bypass that entirely cause I have a gameStarted variable for when the game is finally started
So it'd only be an issue if someone joins during warmup
If full synchronisation is very important, you can do the timing on the server and have it broadcast a function to the clients
JIP includes people who disconnect or crash and have to reconnect. Even if you don't intend for it to be a major mechanic, it's good practice to account for it.
True, but from my experience I've noticed that network load during mission start heavily impacts loading times, is that right?
If there's a lot going on then it could.
A single remoteExec of one function name is a very small network packet and would have essentially no impact.
If it's not very important and the worst that could happen is they sit through a small safety delay or whatever, then there's no need for server sync and you could happily run it on clients only. If there's important stuff tied to it that must be globally synchronised, then server authority might be better.
cursorObject for the object they're aiming at.
To account for headlook and stuff then you might need to raytrace and/or do stuff with screenToWorld.
or is it the other way around ๐ค
Shouldn't be a huge deal nah, a few seconds deviation would be fine. Gonna have a test with a mate at some point and determine if it's necessary to do
crap wrong channel haha. i meant in reforger
ofc i know A3
downside to having favorites on discord. they are all in one category
planeOne action ["Land", planeOne]; I understand how this action works normally the aircraft lands and then taxi then come to a complete stop, Is it possible to stop or cancel the command after it's been given?
I think doStop should work
doStop _heli;
sleep 0.01;
_heli doFollow _heli
gonna give this a try
Nothing changed it still had the autopilot landing icon on, so maybe do stop doesnโt work with that command
I might just be dumb im getting the error "missing ;"
Lab1 = [getMarkerpos "lab1", WEST, 8] call_BIS_fnc_spawnGroup;
call_BIS_fnc_spawnGroup -> call BIS_fnc_spawnGroup
So, I've been using this particular command for years to attach things to other things like vehicles:
call{[this, variablehere] call BIS_fnc_attachToRelative}
I want to use a hold action to detach an object, to basically remove the attachTo command. I've been trying to look one up and finding nothing. Any hints?
Not really sure what is unclear. You can indeed use detach command in BIS_fnc_holdActionAdd
I'm just a moron who couldn't really find if I needed to use anything else
Do you wish to learn, or you want to have something handy to have right now?
Both A. and B. I want something that's usable, but I also want to know how and why it works. Self-admittedly, I barely understand code to begin with, but I can puzzle out how something basic works if I know how it's constructed.
The height of my ability to actually write anything on my own was making a script to open a locked gate when someone interacted with a laptop, and that was two years ago.
Okay, I just wanted to know where to begin
Let's start with B then
[
_myLaptop, // Object the action is attached to
"Hack Laptop", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"_this distance _target < 3", // Condition for the action to be shown
"_caller distance _target < 3", // Condition for the action to progress
{}, // Code executed when action starts
{}, // Code executed on every progress tick
{detach variablehere}, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
12, // Action duration in seconds
0, // Priority
true, // Remove on completion
false // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop]; // MP-compatible implementation```Long story short, copy-pasted example from the wiki article
I can't seem to make it detach. Long story short, I've made a horrible abomination of a landing craft, but I'm trying to figure out how to let the group land with a vehicle as well. I thought that if I figured out a way to do a hold action on the vehicle to 'detach' it, it could ride with them to shore attachTo'd to the horrible abomination, then be detached and ready to use. But it doesn't seem to be working.
(At least, I assume 'continuing to float in midair and not being able to move independently of the object' means that detaching it didn't work)
Did you detach the right object?
I tried setting it to the variable of the vehicle, as well as to the variable of the boat all of this is attached to. Neither seemed to work. It is also entirely possible that I'm missing something.
I do not think {detach BMP}, is a valid code to put it there. I don't know what module you use though
Try detach BMP
That worked. I am, in fact, occasionally very dumb. Thank you.
// Would this be the same thing
if (!isServer) exitwith {};
if !(isServer) exitwith {};
//or is this diff
just woundering
Theoretically they are the same in that code
!(true or false) // true
(!true or false) // false```It is just as that
Whichever you prefer
ahh ok thx man
Or easier to understand
copy that
Hi is there any way to delete already generated particles?
not an easy one iirc, why?
I have an idea for a mission with some sort of time travel so smoke in the air few years later would be a bit out of place
Technically you can. You can deleteVehicle them
There is no really good way to detect particles though
Waiting for version 2.20.
maybe a video with transparent background above destroyed vehicles? i mean it would be easier to delete that right?
It spawns an unit with effect, I mean from a brief test I made it makes a sound and unit appears with small effect except effect is always small square
Sorry not spawns just reappears as the unit have to be spawned earlier
hmm maybe time simulation time speed up during transition between past and now/?
nvm does not work in multiplayer
How can I get the name "FOB #2" here?
I tried private _respawnName = name (nearestObject [getPos thisTrigger, "ModuleRespawnPosition_F"]); but that gives back an empty string (it finds the ModuleRespawnPosition_F object)
Prefix it with the respawn prefix 'respawn_' or similar
The names for the prefixes are all shown in the tooltip in multiplayer settings
Huh? Sorry I want to fetch the name at the bottom of the picture programatically
If I fetch the variable name I get "respawn_opfor_fob2" but I want to extract the name "FOB #2"
Stringtable to convert from variable name to desired name would work, if the variable name won't allow spaces or hashtags
Also, the respawn_ prefixed name is for the lower variable name
I think the prefixes are stripped before display, but I didn't pay attention last time I set up respawns
The way this is stored internally is really horrible. You can look at BIS_fnc_addRespawnPosition in the functions viewer to see how it works, but basically it's complicated.
It would be easier to directly use BIS_fnc_addRespawnPosition yourself, rather than using the module, because then at least you get the numerical ID back, which you can then use to find the name in the internal arrays.
Yeah, I give up on it. Just gonna trim the variable name and format how I want it
I don't understand why this doesn't delete specific items inside the trigger area
{
switch (typeOf _x) do
{
case "ModuleRespawnPosition_F": { deleteVehicle _x };
case "CUP_VABox_RU": { deleteVehicle _x };
case "CamoNet_BLUFOR_open_F": { deleteVehicle _x };
case "Land_Shoot_House_Panels_F": { deleteVehicle _x };
case "Land_HBarrier_01_line_5_green_F": { deleteVehicle _x };
};
} foreach thisList;
I double checked all the object type names with typeOf cursorObject and they're all correct
thisList doesn't necessarily include everything in the trigger area. It's generated based on the trigger's conditions (e.g. set to BLUFOR Present, thisList will only contain BLUFOR units within the area)
Would the better choice be to do this then?
deleteVehicle nearestObjects [thisTrigger, ["ModuleRespawnPosition_F"], 25];
probably, but bear in mind nearestObjects uses a spherical search, and triggers are not usually spherical
You can cross-reference with inAreaArray if precisely following the trigger area is important
Good point, I'll just up the range a bit, the trigger is very close by
I got some sort of workaround for the smoke, wanted to use setWind command but it works only for a second
Is there any way to get strong wind for a longer time?
Okay that works great except the remaining spawnpoints have their names shifted around...
I have a HQ main spawnpoint which is never be deleted
and FOB #1 and FOB #2
But when I delete FOB #2 this happens??
Original spawn points
This is probably because of how respawn positions are stored internally. You've deleted the reference point, but not the information associated with it (name, marker, etc), and now the matched arrays are out of sync
If you need to remove a respawn position then you should use BIS_fnc_removeRespawnPosition to make sure everything is cleaned up properly
why not just use the "respawn_west" marker and just move the marker to the pos you want by script or trigger
like a advancing respawn marker
like you could easy move the respawn_west marker by radio trigger to at least 9 diff pos
sometimes what i myself do is i make like 4 or 5 markers called r1 r2 r3 r4 r5 with triggers around them, and in each trigger, if blufor gos in that trigger the "respawn_west" marker gets moved to the (r marker) as each trigger gets activated and each trigger is on repete
and i even move the ammo box there as well,, and yes ofcorse you place the (r markers) around where you want the respawn points to be
that way theres no pop up schreen, that i dont like to see in the middle of a mission
it may be to simple, but i like it, you may also like it
Can I add nested macros in scripts? Like ```hpp
#define GET_CASH something
#define SAVE_CASH something
#define SEND_CASH something
// ...
#define SYNC_CASH GET_CASH SAVE_CASH SEND_CASH
Yes
Thanks 
Why does my guy spawn on the roof when the module is inside..?
AGLS positioning, if I had to guess
You can correct it by doing a setPosATL or setPosASL as part of your respawn handling
Also really good documentation in-case you want it ๐
Oh, I've managed to miss that page! Thanks ๐
Just finished testing the nested macros
Hi, I try also to use spotlights to connect to my servers, but I fail....mine are added successfully, but I fail removing the ones defined by others into CfgMainMenuSpotlight, it looks like no effect in main menu since I still have "OldMan" for example...any idea/comment on my config? I have found the class definitions into various ui_f PBOs, but I am not sure about how to remove them...I suspect the order of PBO in the loading sequence, maybe my mods is processed before the ones in Arma3....
You need requiredAddons
Oh yes, I forgot that part. Thx ๐๐ป
Do you have some doc explaining what should be put into this field? I understand the concept, but have no idea about what is A3_Data_F_Enoch_Loadorder or why it works better with A3_Data_F_Decade_Loadorder in my case.
As pinned in #arma3_config , decade
Okay, understood. Many thanks!
Last question for tonight: looks like https://community.bistudio.com/wiki/connectToServer is still bugged with DN, it works with IP, but is there any recommended trick/workaround to stick with DN?
is there a way to detect display's being closed? whether it is closed via script or key
Anyone know how to properly attach a IR strobe grenade to a unit? (either using Vanilla or ACE)
I have this but it clips with the unit and damages them when they move
strobe1 attachTo [specOps1, [0, 0, 0.05], "leftshoulder"];
Just add
strobe1 allowDamage false;
Or do you mean it damages the player?
It damages the player yeah
It's hard to tell if it does any actual damage but it causes blood to appear on the screen and makes the unit grunt in pain
Hmhm maybe it's something with the object, i used chemlights and had no such problem.
_offset = [-0.07,0,0.05];
_chemLight = _chemlightMag createVehicle (position player);
_chemLight attachTo [vehicle player, _offset,"RightHand",true];
Try this
_IRStrobe = "O_IRStrobe" createVehicle (position player);
_IRStrobe attachTo [vehicle player, [0,0,0.05],"leftshoulder",true];
Works fine on a player unit, no damage.
Yeah seems to work fine
I wonder if it clipped with the unit cause I was using a IR Grenade effect?
Or maybe cause I didn't have the follow bone rotation enabled
Perfect! Added setPhysicsCollisionFlag as an extra security lol
Any one got the script that makes shooting range targets move please?
domain name is in the dev version, with ip works fine
Yeah, have seen that, for a long time. Waiting for the push to the main branch.
_ctrl ctrlAddEventHandler ["Draw", {
params ["_controlOrDisplay"];
_scale = 6.4 * worldSize / 8192 * ctrlMapScale _controlOrDisplay;
_size = 50 / _scale;
{
_location = _x select 1;
_controlOrDisplay drawIcon
[
"\A3\ui_f\data\map\markers\military\mission_CA.paa",
[1,1,1,1],
_location,
_size,
_size,
0
];
} forEach (missionNamespace getVariable "_allAOLocations");
}];
Trying to draw a icon on every known location in the RscMap, but it's not working, help is appreciated.
getVariable requires global var name, not the local one.
but doesn't missionNamespace already declare it as a global variable?
because im able to access the variable in other scripts
How? The same way, missionNamespace getVariable "_allAOLocations"?
Variables prefixed with an underscore are local. Not sure how getVariable handles that but you should rename the variable to begin with a tag (i.e. just 2-4 letter prefix that's unique to you, the mission, etc.) and not a leading underscore. E.g. YEAMI_allAOLocations
this code doesnt seem to work very well, when ropeAttachTo is called the unwinding doesnt work properly ```sqf
[_targetMan, [0,0,0], [0,0,-1]] ropeAttachTo _rope;
[_targetMan,"LadderCivilStatic"] remoteExecCall ["switchMove",owner _targetMan];
sleep 1;
ropeUnwind [_rope, 20, 0];
Yeah that's what I do, anything global that is in my mission is TL_ (TerryLib) if nothing else it makes finding my stuff later easier since my "zeus" template got really out of hand over time ๐
there is no such thing as a global or local variable with getVariable. the string can be anything (but ofc that's bad due to lack of tag)
yes, it does, but only thru setVariable/getVariable. a _blabla identifier (not string "_blabla") is always treated as local
CfgSettings isn't prefixed though
Probably should be but it predates me learning the value of doing it ๐ - my zeus framework wasn't really planned, it just accreted over time as I added stuff (see bottom left) ๐
https://streamable.com/98j2qk adding the cli was probably the best thing I did - when not gaming I live on linux so my brain just works well that way ๐
Is there a limit on the amount of functions I can define?
class fob {
class main {
file = "fob\functions";
class deployFOB {};
class buildStructure {};
class monitorFOBActions {};
class registerSupplyCrate {};
class checkSupplyContainers {};
class deliverSupplies {};
class registerFOBDeployer {};
class getMarkerName {};
class getSupplyVar {};
class addDeconstructAction {};
class deconstructStructure {};
class packupFOB {};
class initFOBPersist{};
};
};
class kbf {
class functions {
file = "kbf";
class vehDamage {};
class garageLoad {};
class garageInit {};
};
};
In game, I use isNil to check if they exist. packupFOB is defined, but initFOBPersist is not no matter how I name it or remake it!
No (known) limit, no.
omg I think I'm an idiot.
God damnit, I wasn't leaving the lobby before restarting the mission so description.ext wasn't being reloaded.
I do that at least once a week
I was getting SO annoyed ๐
Got into the habit of hitting "New" then reloading the mission, which seems to reliably rescan description.ext - if there is a better way I'd love to know ๐
has anyone played with lookAt/glanceAt - by default the AI is pretty stupid in that it never checks its six (so you can do this to them), so I'm toying with the idea of hooking into lambs and when the AI doesn't know about any player picking one member of the squad and periodically having them lookAt their six o-clock - not sure if that's a good idea or not - guess I can just try it on my players and see who gets annoyed
oh actually, I can make that smarter still, if i use CBA_headDir on the group I can find which sector isn't covered and rotate one unit to cover it - so they'll have better 360 cover, I can't find what the AI's "fov" is anywhere though, anyone happen to know?
some stuff that might help: https://community.bistudio.com/wiki/getCameraViewDirection
oooh :), I'm currently looking at nominating one unit in each group that is pure infantry as check 6, storing that unit on the group and then periodically if he's alive rotating him to look behind and if not nominate a new unit, randomise the interval and that should reduce the players ability to creep up on the AI, it's less of an issue if they are doing something like taskDefend or whatnot from lambs since it randomises their dir anyway
also on my list "find all units in a building, get them to look at either a door or a window not stare at the wall so that a player can open the door, run up and hit them with an axe (which I legit watched happen the other day)
I've no issue with lambs when the unit is on task, it behaves fine (better than fine) https://streamable.com/cg0qjr but as soon as they aren't doing anything and lambs is "idle state" they go back to been kinda dumb, if I can fix even some of that I can surprise my players ๐
Hey guys! Another network question regarding commands like here #arma3_scripting message. Just to verify something like this would not execute setObjectScale globally right?
private _localObject = createSimpleObject ["B_APC_Tracked_01_CRV_F", getPosASL player, true];
_localObject setObjectScale 2;
indeed milo!
