#arma3_scripting

1 messages ยท Page 184 of 1

formal grail
#

How odd. I tried to replicate but couldn't, must be specific conditions. Even controlNull returns 0 correctly. Is this related to the thing above with remote exec? Because I think you can't send structured text thru remote.

meager granite
#

It happens very randomly during gameplay

#

Cannot reproduce this bug in a repro mission

still forum
#

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

charred monolith
#

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.

formal grail
formal grail
# charred monolith Hi ! Is there way to put a delay on this respawn button ? I want the player to...
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.

charred monolith
#

Thanks ! I'll look into it !

tender fossil
#

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

tulip ridge
#

Just use a string if it was an issue

tender fossil
#

Hmm, good point ๐Ÿ˜„ Thanks, me dumb x)

placid root
#

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

digital axle
#

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.

granite sky
#

What, like a systemChat?

digital axle
#

It's in the text chat, yeah.

granite sky
#

Could be any mod, or mission code.

digital axle
#

Is there a way to check message history in a server?

granite sky
#

systemChat just prints there. That's all it does.

pallid palm
#

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

proven charm
#

why not make the house invulnerable?

pallid palm
#

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

proven charm
#

ic

pallid palm
#

btw how would you go about making house invulnerable maybe im not doing it right

proven charm
#

house allowdamage false;

pallid palm
#

ahh thats simple awsome

#

thx m8 let me give that a try

#

i was useing this

#

{_x allowDamage false} foreach nearestObjects [lsw,["Building"],4000];

proven charm
#

that would work too but only for "Building" s

pallid palm
#

ahhh ok nice thx m8

proven charm
#

you could make everything invulnerable

pallid palm
#

how so

proven charm
#

["Building"] -> []

#

but thats a lot of objects ๐Ÿ™‚

pallid palm
#

ahhh cool

#

could i do this ["Building", "house"]

proven charm
#

yes

pallid palm
#

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

proven charm
#

yw

bold comet
#

?

placid root
#

jup that is beeing done on clientside

bold comet
#

that's your issue i guess

placid root
#

unfortunately the server overwrites it immediately

bold comet
#

having different settings for each client in MP would be a huge exploit

rugged glade
#

anyone know the keybind to remove the map on the top left of my screen in eden editor?

placid root
#

this setting is made on clientside and as soon as he applies it gets set serverside

bold comet
#

yep

#

server settings overwrite client settings pretty quickly

placid root
#

is there a way to prevent this?

cosmic lichen
placid root
#

what was my question

bold comet
#

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

placid root
#

i think that would cause soo much lag. so this will be a sp feature only ^^

#

one just the one calling the dialog

bold comet
#

yep so that's your issue

#

you can do that with view distance but not fog afaik

placid root
#

hmm bis does thsi with his zeus module by executing the server the fog parameter on client and then on server?

bold comet
#

i suppose what you set with the zeus module applies to everyone

#

you can't set the fog for each client separately

pallid palm
#

well me in the default game i have my MiniMap keys set to the [ ] keys

#

witch toggels it on and off

faint otter
#

Hey Dudes, Quick question is there any way I can make AI respawn and take up the same waypoints and triggers?

pallid palm
#

one key put minimap on right an one key puts it on the left side

placid root
#

no i don't want to do that. just the admin can pop up the setting menu

pallid palm
#

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

bold comet
#

ha so you just need to execute that setfog remotely on the server

faint otter
#

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

pallid palm
#

actualy there is a great video on youtube for the thing your asking

faint otter
#

Really? I must see this

pallid palm
#

let me see if i can find a link ok

faint otter
#

Thank you

hushed turtle
#

What kind of AI respawning are you talking about? Are spawing them with createUnit?

placid root
#

so i think i can try to first remoteExecCall on server and the on the client editing stuff

faint otter
#

No I wasn't aware that was available

pallid palm
#

i made a mission from this video

#

but like i said i don't like way points

bold comet
#

this should work yes

pallid palm
#

i can send you the mission if you like

#

its on the VR map

faint otter
#

Yes please that would be great

placid root
#

and ater a while the fog will set on client

pallid palm
#

ok friend me and ill send it to you

bold comet
#

yes

pallid palm
#

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

blissful current
#

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
hallow mortar
#

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)

blissful current
# hallow mortar The title field cannot contain code, but you can use code to determine what stri...

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"?

hallow mortar
#

action creation is when the action is created. doesn't matter if it's initPlayerLocal.sqf or what

blissful current
#

I guess its created when a player loads in then?

#

Or do you mean it's created when the player uses the action?

hallow mortar
#

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.

blissful current
#

In this example name player is the title correct?

#

Or it contains the title?

placid root
#

ok everything set. hopefully the server won't freeze ...

blissful current
#

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"];
granite sky
#

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.

blissful current
#

Of course. Thank you John. ๐Ÿคฆ

#

Oh actually I get an error saying it expects a string.

#

This did it:

[str _chance] remoteExec ["systemChat"];
blissful current
#

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%.

placid root
#

hmm works nicly ^^

dusk gust
#

Are you trying to add the two chances together?

blissful current
#

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.

granite sky
#

Well yeah, if chance varies with more things than _attemptCount then just track the chance instead.

blissful current
#

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.

tepid trail
#

does anyone know how to make planes fly straight?

#

i want them to ignore the terrain

pallid palm
#

ai dont want to die so plane better be way high

tepid trail
warm hedge
#

Try your luck with setFlyInHeightASL

pallid palm
#

well if you flyInHight 100; the pilot will do the best he can to maintain the hight

#

oh yeah POLPOX

tepid trail
blissful current
#

Will that work for helicopters as well?

tepid trail
blissful current
#

Nice my AI helicoper just skirts the tree tops. I'd love for it to have a set altitude.

pallid palm
#

well like i said ai dont want to die just like you and me

split scarab
#

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

blissful current
#

Then why do all the CAS planes crash during guns runs in Antistasi? LOL

tepid trail
#

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

warm hedge
#

Just read the article carefully

tepid trail
#

okay

warm hedge
#

It says no XYZ mention

pallid palm
#

@split scarab ummm i think theres a way simpler way for that m8

tepid trail
bold comet
#

๐Ÿ˜‰

pallid palm
#

for 1 thing the respawn time is set in the Description.ext

tepid trail
#

so its standard, combat, and stealth

pallid palm
#

theres really no need to remoteExec all that stuff

granite sky
pallid palm
#

do you want to see my onPlayerKilled.sqf:

blissful current
split scarab
pallid palm
#

ok

granite sky
#

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.

pallid palm
#
//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;
split scarab
#

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?

pallid palm
#

well you can do that part anyway you like m8

split scarab
#

Fairs, just curious haha

#

Do you have the respawn screen though using this?

#

Where you can pick the spawn location, etc.

pallid palm
#

no no i dont use that

#

people just hit respawn anyway right away

split scarab
#

Damn I was hoping to use that as I intend to have temporary spawn points that get de-spawned as the mission goes on

pallid palm
#

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

pallid palm
#

Man i love this Arma 3 its So much fun and Cool also

placid root
#

if somebody would like my weather generator feel free to use it ๐Ÿ˜ƒ

split scarab
#

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};
    };
};
placid root
#

it does not only change the fog ๐Ÿ˜ƒ

granite sky
#

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.

split scarab
#

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

granite sky
#

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.

warm hedge
#

I would use !alive (missionNamespace getVariable ["specOps1", objNull])

split scarab
#

Oh that worked brilliantly

granite sky
#

Which might not be a case, but I wouldn't know and the wiki certainly doesn't.

static frost
#

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
granite sky
#

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.

static frost
granite sky
#

Is that ZEN?

static frost
granite sky
#

might be _this then.

tulip ridge
#

Should say if you hover over it iirc

static frost
#

Yeah it's says "_this" refers to the unit's variable

#

btw it seems to be working now thanks

analog mulch
#

Hi
Is there code I can put in a trigger condition that checks when tank "t1" has its turret damaged fully?

hushed turtle
#

getHitPointDamage

#

@analog mulch

still forum
warm kestrel
#

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?

long hatch
#

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

proper tulip
#

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?

placid root
#

loose the second private

warm hedge
#

Latest Arma 3, which latest? productVersion?

placid root
#

and use _x setVariable ["ACE_canMoveRallypoint", true, true]; instead of _rpunits = setVariable ["ACE_canMoveRallypoint", true, true];``

proper tulip
#

no other mods

proven charm
#

one thing you could check is if the player or its group is null

proper tulip
#

negative. Group Player = Alpha 1-1

#

weird

proven charm
#

k

proper tulip
#

confirmed more than once. Must be a bug

analog mulch
long hatch
placid root
#

although i never used it before. just corrected the syntax

long hatch
#

ok thanks i will try it

placid root
#

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;

long hatch
#

thanks

pallid palm
#

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

split scarab
#

How would one play a flare fired sound effect from the Trigger Activation script instead of this?

warm hedge
#

playSound etc

split scarab
#

Is there a list of vanilla sound files somewhere?

warm hedge
#

CfgSounds, yes

split scarab
#

Awesome thank you

split scarab
#

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;
proven charm
#

_newLaptop setposATL (getposATL _target); should do the trick

errant iron
#

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)

sly zealot
#

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 ?

granite sky
#

@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.

errant iron
errant iron
#

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]
errant iron
#

Ah, this combination works: sqf _unit moveTo getPosATL _unit; _unit doFollow leader _unit;

granite sky
#

Any of those commands will override a previous doMove. The command bar is weird though.

#

doStop+doFollow is probably "correct".

#

hmm, maybe not actually.

celest basalt
#

Hello gentleladies, how does setVariable work

#

If I set a public variable on a building, is it set for new players?

stable dune
celest basalt
#

Hmm

stable dune
celest basalt
#

I'm setting a variable on my server, but when I relog it ain't set anymore

granite sky
#

Is your server running with persistent=1?

celest basalt
#

Ye

granite sky
#

doStop leaves it in stopped state, doMove leaves it in ready state, doFollow just works.

errant iron
#

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; };

granite sky
#

_unit != _assigned? :P

errant iron
#

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

granite sky
#

Map objects are kinda weird because they're local-everywhere, but it seemed to work anyway when I tried it with a house.

celest basalt
#

Hi, sorry, was doing testing

#

Turns out I have a crate, lemme get the class name

#

Land_CargoBox_V1_F

granite sky
#

And it's a map object, not a mission object?

celest basalt
#

And I'm setting a variable to it

_building setVariable ["foo", true, true];
celest basalt
granite sky
#

mission should definitely work.

celest basalt
#

However, I disconnect and then reconnect and that value is no longer set

#

Checked in debug

celest basalt
granite sky
#

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.

celest basalt
#

Ye

#

_building is a parameter

granite sky
#

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?

celest basalt
#

Yup

#

Exactly that

#

It's so weird

#

Don't worry lads

#

Someone changed

#

THE FUCKING OBJECt

#

TO FUCKING LOCAL ONLY

analog mulch
granite sky
#

I think that still returns true unless the weapons are damaged.

analog mulch
#

yeah i just needed it to check for modded tanks, some require like 6-7 sabots to kill

blissful current
#

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?

dusk gust
#

It would play the sound every tick

tepid trail
#

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?

granite sky
#

disableAI doesn't apply to vehicles, so maybe.

tepid trail
#

thats probably that

#

but planes use collision lights

tulip ridge
#

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?

tepid trail
#

i cant turn them off

#

with scroll wheel

#

i tried deleteVehicle _lightSource;

#

it didn't do anything

tulip ridge
hazy turtle
#

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];

granite sky
#

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.

hazy turtle
#

ahh thanks John

indigo snow
#

STRING setVariable ARRAY?

#

Remove the quotation marks from the array ;)

ancient gull
#
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;`
proven charm
#

sortBy is valid command?

ancient gull
proven charm
split scarab
#

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;
};
hushed turtle
foggy stratus
#

How can I check if a building is destructible or not?

winter rose
buoyant hound
#

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?

little raptor
split oxide
#

Is it possible for tracers to ignite on script created projectiles?

little raptor
#

Afaik no. But try triggerAmmo. Maybe that works (I doubt it does tho)

buoyant hound
primal trench
#

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?
proven charm
#

though depends how the server is setup i guess

little raptor
foggy stratus
split scarab
#

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; 
hushed turtle
south swan
#

!quote 5

lyric schoonerBOT
south swan
#

eyyy, i remember it right ๐Ÿคฃ

digital hollow
hushed turtle
#

Which setPos command to use for PositionAGL?

south swan
#

i'd argue _obj setPosASL AGLToASL _somePosAGL; Or just _obj setPosATL _somePosAGL; if you take care to only use positions over the land ๐Ÿค”

hushed turtle
#

That's what I thought, we lack setPosAGL command

south swan
#

setPos-equivalent behavior leads to memes like

split scarab
south swan
#

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 blobdoggoshruggoogly

hushed turtle
#

Didn't notice "_args" there

#

But yeah, it would be easier to read

#

of course

south swan
#

'cept Cake's params isn't really accurate, arguments would end up in _object

hushed turtle
foggy stratus
granite sky
#

Only semi-documented of course.

formal grail
#

I recently worked on some vehicle/structure deployment system and the different position schemes are a nightmare, especially over water (there is a carrier).

tulip ridge
#

Always use ASL unless you specifically need another type

spring dust
#

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

distant belfry
earnest ether
#

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;

spring dust
distant belfry
lime rapids
#

i remember there being a online converter for the gui editor to sqf online does anyone have a link?

distant belfry
lime rapids
#

no it just took export from ingame ui creator and turned it into sqf

spring dust
distant belfry
twin moon
#

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"

warm hedge
twin moon
#

ty

cosmic lichen
earnest ether
#

i thought it is yours, if not then sry R3vo

warm hedge
#

Ping someone very specifically to pray is not how it works

cosmic lichen
#

Yay. I got my own function in the game ๐Ÿ˜…

proven charm
#

I updated the zip, seems i forgot to upload the latest

winter rose
tender fossil
#

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)

little raptor
#

CompileFinal works on more types now

#

I think hashmap and array?

tender fossil
#

Yeah seems like so

#

I'd have needed support for numbers too, but hmm

little raptor
#

Just hashmap not array

little raptor
#

You can use macros if they're literals

tender fossil
#

Was just thinking of hardening codebase when it comes to critical config variables

still forum
#

Just put all the const things into one hashmap, and make that final

tender fossil
#

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

spring dust
#
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;
tender fossil
#

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 ๐Ÿ˜‚

proven charm
lime rapids
#

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;


};

south swan
#

you provide coordinates way outside of visible screen blobdoggoshruggoogly

lime rapids
#

(using gui grid for position type btw)

south swan
lime rapids
#

thanks

meager granite
wise frigate
#

Anyone had any luck with getting the RHS manual bolting to work with the deployed bipod hand animations?

idle remnant
#

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

granite sky
#

Why do you need it fixed to the ground?

pallid palm
#

do you mean snapToSurfuse @idle remnant

next gust
#

Wich Config Property defines the texture of a uniform ground holder?

pallid palm
#

i have no idea m8

#

lol i never saw a unifrom on the ground

tulip ridge
#

Same rules as hsTextures for anything else

#

Also that's config (obviously), not scripting

idle remnant
#

I have objects inside it non-simulated and I am trying to stop it from flying away

#

Might just rewrite to use attachTo instead

pallid palm
#

does disable simulation keep it from moving, right ?

trim cairn
#

Hello iโ€™m having problems figuring out how to do unit capture for infantry

tulip ridge
#

And what things you've tried

trim cairn
#

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

trim cairn
trim cairn
split scarab
#

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?

warm hedge
split scarab
#

Odd workaround but yeah that works lol

little raptor
pallid palm
#

@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

trim cairn
pallid palm
#

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

trim cairn
#

Hopefully this advice works and hopefully I will be able to find it

pallid palm
#

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

trim cairn
#

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?

trim cairn
#

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...

โ–ถ Play video
trim cairn
#

@pallid palm

mint flame
#

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

granite sky
#

Is this your code?

mint flame
#

No its AI

#

I dont have time to learn SQF im sorry im just trying to have fun with ieds ingame

granite sky
#

Holy shit. Which AI?

mint flame
#

Claude AI

#

Sonnet

granite sky
#

This is a pretty severe weakness for the general case:
private _doorDir = _doorPos getDir (getPosWorld _building);

mint flame
#

Oh yeah, i noticed that it just couldnt get the door right, the road IED and other IED spawns fine.

granite sky
#

You'd need a better way to figure out the direction of the door. I don't know enough about models to suggest one.

mint flame
#

Hmmmm yeah that makes sense

#

So i need to loook into JBAD building models

granite sky
#

Yeah, the dumb-but-works way is to precompile a map of building types to door info.

mint flame
#

Can I also use certain markers to point out the horizontal door direction?

#

ARROW --->
(ENTRY)

little raptor
#

Map markers or 3d markers?

mint flame
#

Uhm map

#

hmm i need 3d markers

little raptor
#

What do you have problems with? The marker itself or the door direction?

mint flame
#

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

granite sky
#

maybe selectionVectorDirAndUp works on doors. Not tried it.

little raptor
# mint flame Hmm making the tripwire perpendicular to the door

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:

  1. get on point door on the door
  2. get the center
  3. 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;
little raptor
granite sky
#

In vs out? Or are there other options?

little raptor
#

the dir can be either along the door width or perpendicular to the door

granite sky
#

Arma :/

#

ROARDWAY typo btw.

mint flame
little raptor
little raptor
# granite sky Arma :/

not really Arma's fault. selectionVectorDirAndUp returns the bone rotation. it doesn't care how the part attached to the bone was originally aligned

hushed turtle
little raptor
# mint flame

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 :/) meowsweats

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;
mint flame
#

it does explode for me when i walk over it when its sticking out properly

little raptor
# mint flame yeeah, for me perpendicualr to the door for sure now but its like going under su...

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);
mint flame
#

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

lime rapids
#

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

granite sky
#

We start with animation sources and filter with isClass and then whether it has a displayName.

little raptor
#

but again looks like you've changed that in your own version. you can instead decrease the doorWidth

mint flame
#

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

tender fossil
#

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

meager granite
#

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

tender fossil
meager granite
#

mission profile namespace*, yeah

tender fossil
#

Roger

#

Thanks again ๐Ÿ™‚

civic cape
#

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?

atomic niche
meager granite
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
meager granite
#

Also what do you mean by scenario mode? Multiplayer?

#

Why hideObjectGlobal and enableSimulationGlobal?

civic cape
#

mode sigler player

#

Is it correct now?

little raptor
#

no. if it was correct your code would be syntax highlighted.
also no need to repost. just edit your message

little raptor
# wicked roost

just copy the upper part and put your code between the to sets of ```

civic cape
#
    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])"];
little raptor
#

it should be ```sqf followed by a new line

civic cape
#
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

little raptor
#

don't put any space or newline between ``` and sqf

#

just this:
```sqf
then start the code in the next line here

thin fox
little raptor
#

also this is how you edit the message:

civic cape
#

And now?

pallid palm
#

delete the old one ๐Ÿ™‚

little raptor
#

actually nvm it's only visible when the soldier's unconscious

civic cape
#

I don't have the option to reanimate the soldier

little raptor
#

but does he become unconscious?

#

or does the code not work at all?

civic cape
#

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.

little raptor
#

maybe another mod is overwriting your event handler

pallid palm
#

you can see now why, i don't put mods, in my clean, Arma 3 game woohoo๐Ÿ™‚

little raptor
# civic cape Exactly, the script works fine in the editor. The issue arises in the scenario m...

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])"];
pallid palm
#

holy Ace Batman:)

civic cape
#

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!

pallid palm
#

oh it will be Leopard20 is Awsome

#

hes 1 of the great guys in here

#

he helped me alot

terse tinsel
#

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?

proven charm
terse tinsel
tender fossil
#

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_
south swan
#

because you need "" around your format template?

tender fossil
#

Oh lol ๐Ÿ˜„

#

My brain is still messed up from that config hell. Thanks ๐Ÿ˜„

south swan
#

ja, i kinda see how config's implicit stringing can do that to human ๐Ÿคฃ

tender fossil
#

Lost 50 % of my remaining brain cells, I have one now

winter rose
#

hence why you must use string in config, don't "implicit" anything, it's the best way to get backstabbed ๐Ÿ˜›

south swan
#

using explicit strings in config would still get you backstabbed... but with explicit strings, at least ๐Ÿ™ƒ

winter rose
#

one has to choose their fights I guess ๐Ÿ˜„

lime rapids
#

is there a command to get users ui colour scheme or is it a config / var?, and if the latter is it documented?

hidden plaza
#

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.

split ruin
#

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

hidden plaza
#

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.

split ruin
#

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

hidden plaza
#

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.

split ruin
#

Prairie Fire DLC modules generally work great

hidden plaza
#

Thanks for the advice
Cheers

split ruin
#

np

#

if u want a spawning script I can send u

#

very basic

hidden plaza
#

Can you use wp once the Inf has spawned?

split ruin
#

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";

hidden plaza
#

I've give it a go ๐Ÿ‘

#

thx

tender fossil
#

Can I remoteExec a function from client if it's defined only on server (in server-side only mod)?

tender fossil
#

Yay ๐Ÿ˜„ Thanks again ๐Ÿ‘

hallow mortar
#

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

tender fossil
#

That's nice, some smart design there ๐Ÿ˜›

royal quartz
#

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

tulip ridge
royal quartz
tulip ridge
open hollow
# hallow mortar Yes

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" ?

granite sky
#

Technically yes.

tulip ridge
#

Yeah, but sending code over network is less than ideal

tulip ridge
#

There's no point in doing that

granite sky
#

well, they can't read it without debug console access or hacking tools.

open hollow
#

they can hack the server and download the files too lol

dusk gust
#

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

pallid palm
#

what people cheat in Arma ?

buoyant hound
#

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

tulip ridge
buoyant hound
tulip ridge
#

Same thing then, just spawn some dummy objects and then delete them when the actual comp is placed

tulip ridge
#

Just doing createVehicle ["someDummyObjectClass", ...] when the option is in progress, and then deleting all those temporary objects when the statement actually runs

buoyant hound
tulip ridge
# buoyant hound 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;
buoyant hound
tulip ridge
#

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

buoyant hound
#

Like what i say from array

tulip ridge
#

You'd still need to spawn something in the correct place at first, which is what you're issue is

lime rapids
#

this code would not systemchat anything if vic is nil systemchat typeName vic; however systemchat str isnull vic; would right?

warm hedge
#

No, isNull nil returns nothing, because null is not nil

dusk gust
storm linden
#

This is my first time trying to code arma and I can't figure out what is wrong

#

Labdocs=True;
Publicvariable="Labdocs";

hallow mortar
#
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";```
storm linden
#

@hallow mortar thank you so much I copied it from a YouTube video lol

vocal chasm
#

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?

proven charm
#

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;

pallid palm
#

@proven charm what is this hiding enemy do i don't understand what its for really /

proven charm
#

that was for @vocal chasm

pallid palm
#

yes i know but does this mean you can't see the enemy or

proven charm
#

you cant see the units if they are hidden

pallid palm
#

you mean you can't see them at all and they can shoot you

proven charm
#

yes cant see them

pallid palm
#

well what would this be for i dont understand

proven charm
#

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

pallid palm
#

ahhh i see

proven charm
#

assuming you still want the opfor players to see the enemy ๐Ÿ™‚

pallid palm
#

yeah i want to see the enemy when i see the enemy lol

proven charm
#

lol yeah only zeus vision should be limited

pallid palm
#

glad i dont use Zeus lol

#

so hiding the enemy would be away to scare the crap out of some players right ?

proven charm
#

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

pallid palm
#

so this hide the enemy stuff is this for hiding them on the map view or

proven charm
#

completely hiding them from player/zeus

pallid palm
#

oh i see ok

proven charm
#

you do have a point , player can still see enemy icons on map ๐Ÿค”

pallid palm
#

i see

#

ofcorse you can turn map view icons off in the game settings also

proven charm
#

or script

pallid palm
#

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

proven charm
#

the player may still take collision damage even if you used allowDamage, i think

pallid palm
#

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

proven charm
#

yep

pallid palm
#

thats awsome i love that

#

what that called in the game

#

is that a script

proven charm
#

umm vanilla arma behaviour

pallid palm
#

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

proven charm
#

its already in arma , like you can get knocked over by a vehicle

pallid palm
#

yes but how can i have a look at that script i wounder

proven charm
#

could be hard coded so you cant

pallid palm
#

oh no dam

proven charm
#

or search the files ๐Ÿ™‚

pallid palm
#

copy that

#

i wounder what addons pbo that is in

proven charm
#

yeah no idea

pallid palm
#

man thats going to be awhile till i find that 1 lol

proven charm
#

you could try the function viewer...

pallid palm
#

ahh yeah right

proven charm
#

it could be in .fsm too

pallid palm
#

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

copper plinth
#

Does smb use InterceptDB ? Is it better than extdb3?

hushed turtle
#

Is it somehow possible to do constant arrays in SQF?

digital hollow
#

compileFinal

finite bone
#

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.

hallow mortar
#

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.

finite bone
#
["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.

hallow mortar
# finite bone 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?

finite bone
#

We are standing right next to each other < 1 m away ๐Ÿ˜„

#

He can hear the audio, I couldn't.

hallow mortar
#

Also, note the requirements for the file path. If this audio file is a mission file you need to use getMissionPath.

finite bone
#

Ill fix that, but for the core functionality, its only working for the person executing it though (in a dedicated server environment)

hallow mortar
#

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.

finite bone
#

Alright, Ill check it with that then ๐Ÿ˜…

#

Still the same unfortunately

pallid palm
#

what about "any sound" remoteExec ["playSound"];

finite bone
pallid palm
#

ok i see

finite bone
#

I want the audio to be limited by distance.

#

I'm trying an alternative method of remoteExec'ing say3D

hallow mortar
#

playSound isn't positional at all, it's not really a suitable substitute

pallid palm
#

i understand

hallow mortar
#

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.

pallid palm
#

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"];
};
hallow mortar
finite bone
#
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.

hallow mortar
#

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.

pallid palm
#

very interesting

lime rapids
#

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

hallow mortar
#

Does _varray actually contain anything before you pass it into the function?

lime rapids
hallow mortar
#

Is the function actually properly registered (e.g. in CfgFunctions) and confirmed to be running without any errors before the systemChat?

lime rapids
formal grail
lime rapids
formal grail
#

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...

lime rapids
formal grail
#

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.

hallow mortar
#

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]"

formal grail
#

You said it would give an error. What error is it returning.

buoyant hound
#

How to show holdaction only for specific player role like medic?

hushed turtle
digital hollow
#

just make that code return your array

hushed turtle
#

There is only an array in that code and I'm not able to read elements from it. str returns that array including {}

dusk gust
minor agate
#

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

dusk gust
hushed turtle
dusk gust
#

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
minor agate
faint burrow
faint burrow
dusk gust
faint burrow
#

Good question about configs, but it seems like extracting data from them is slower than accessing a variable.

dusk gust
#

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.

split scarab
#

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

dusk gust
#

Should be the same, yeah

royal quartz
#

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?

split scarab
formal grail
royal quartz
#

I want to try and allow underwater use of the inventory

#

For divers

faint burrow
#

Try and let us know.

royal quartz
#

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

formal grail
#

I think there's a thing that stops you from opening inve underwater

royal quartz
formal grail
royal quartz
#

Or how did you find it haha

formal grail
#

Arma 3\Addons\ui_f\config.cpp

royal quartz
#

Huh I must have been blind af because I swear I searched that file ๐Ÿ˜…

#

Thanks I'll have a play with it

split scarab
#

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?

formal grail
#

What's the generic error in/on?

#

Maybe try "BLU" and "OPF"

split scarab
formal grail
#

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"
split scarab
#

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

formal grail
#

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

royal quartz
#

Or I guess he could remoteExec systemChat but I think it will look worse being grey than a message from "HQ"

formal grail
#

Looks like the description.ext thing doesn't work, might need an addon

royal quartz
#

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";

split scarab
#

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

spiral canyon
#

How can I find the class name for animations?

royal quartz
#

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

split scarab
#

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; 
    };
};
royal quartz
split scarab
#

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

royal quartz
#

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

split scarab
#

Didn't change anything unfortunately

hallow mortar
split scarab
#

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

royal quartz
#

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};
split scarab
#

["insert_1","insert_3","insert_6","insert_5","insert_4","insert_2"]

#

Finds them all yeah

royal quartz
#

Then add the for each that hides them to the debug console too does that work?

hallow mortar
#

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.

split scarab
#

Had to disable "Hide on Start" and remove the condition that shows them

#

Order of initialization can be a bitch sometimes lol

split scarab
#

Hello again, how can I check wait until all players are FULLY loaded in, as in able to move around?

granite sky
#

You'd probably need them to tell you that.

#

There's getClientState but I'm not sure it's sufficient.

royal quartz
#

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

split scarab
#

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

royal quartz
royal quartz
split scarab
#

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

royal quartz
#

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?

split scarab
#

Triggers before I even click continue on briefing screen

open hollow
split scarab
#

Init field of an object

open hollow
#
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

split scarab
#

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?

open hollow
#

will be better if you put all this in initPlayerLocal.sqf

split scarab
#

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?

royal quartz
#

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

hallow mortar
#

Anyone who joins in progress will have to go through the warmup time at that point

royal quartz
split scarab
#

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

hallow mortar
#

If full synchronisation is very important, you can do the timing on the server and have it broadcast a function to the clients

hallow mortar
split scarab
#

True, but from my experience I've noticed that network load during mission start heavily impacts loading times, is that right?

hallow mortar
#

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 ๐Ÿค”

split scarab
fair drum
#

ofc i know A3

#

downside to having favorites on discord. they are all in one category

eternal spruce
#

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?

little raptor
#
doStop _heli;
sleep 0.01;
_heli doFollow _heli
eternal spruce
eternal spruce
#

Nothing changed it still had the autopilot landing icon on, so maybe do stop doesnโ€™t work with that command

storm linden
#

I might just be dumb im getting the error "missing ;"

#

Lab1 = [getMarkerpos "lab1", WEST, 8] call_BIS_fnc_spawnGroup;

warm hedge
#

call_BIS_fnc_spawnGroup -> call BIS_fnc_spawnGroup

warm kestrel
#

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?

warm hedge
#

Not really sure what is unclear. You can indeed use detach command in BIS_fnc_holdActionAdd

warm kestrel
#

I'm just a moron who couldn't really find if I needed to use anything else

warm hedge
#

Do you wish to learn, or you want to have something handy to have right now?

warm kestrel
#

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.

warm hedge
#

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
warm kestrel
#

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)

warm hedge
#

Did you detach the right object?

warm kestrel
#

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.

warm hedge
#

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

warm kestrel
#

That worked. I am, in fact, occasionally very dumb. Thank you.

pallid palm
#
// Would this be the same thing
if (!isServer) exitwith {};
if !(isServer) exitwith {};
//or is this diff    
#

just woundering

warm hedge
#

Theoretically they are the same in that code

#
!(true or false) // true
(!true or false) // false```It is just as that
pallid palm
#

ok thx man

#

@warm hedge so witch way would you recamend i do it

warm hedge
#

Whichever you prefer

pallid palm
#

ahh ok thx man

warm hedge
#

Or easier to understand

pallid palm
#

copy that

quick peak
#

Hi is there any way to delete already generated particles?

winter rose
#

not an easy one iirc, why?

quick peak
#

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

warm hedge
#

Technically you can. You can deleteVehicle them

#

There is no really good way to detect particles though

faint burrow
#

Waiting for version 2.20.

quick peak
#

maybe a video with transparent background above destroyed vehicles? i mean it would be easier to delete that right?

proven charm
#

except it doesnt seem to do anything anymore hmmm

quick peak
#

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

proven charm
#

u mean BIS_fnc_VRSpawnEffect?

#

nvm got it working ๐Ÿ™‚

quick peak
#

hmm maybe time simulation time speed up during transition between past and now/?

#

nvm does not work in multiplayer

split scarab
#

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)

dusty steppe
split scarab
#

If I fetch the variable name I get "respawn_opfor_fob2" but I want to extract the name "FOB #2"

dusty steppe
#

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

hallow mortar
# split scarab How can I get the name "FOB #2" here? I tried `private _respawnName = name (nea...

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.

split scarab
#

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

hallow mortar
#

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)

split scarab
#

Would the better choice be to do this then?
deleteVehicle nearestObjects [thisTrigger, ["ModuleRespawnPosition_F"], 25];

hallow mortar
#

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

split scarab
quick peak
#

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?

split scarab
#

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

hallow mortar
#

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

pallid palm
#

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

tender fossil
#

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

tender fossil
split scarab
#

Why does my guy spawn on the roof when the module is inside..?

hallow mortar
#

AGLS positioning, if I had to guess

#

You can correct it by doing a setPosATL or setPosASL as part of your respawn handling

old owl
tender fossil
#

Just finished testing the nested macros

modern plank
#

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....

warm hedge
#

You need requiredAddons

modern plank
#

Oh yes, I forgot that part. Thx ๐Ÿ™๐Ÿป

modern plank
# warm hedge You need requiredAddons

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.

warm hedge
modern plank
#

Okay, understood. Many thanks!

lime rapids
#

is there a way to detect display's being closed? whether it is closed via script or key

split scarab
#

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"];
sharp grotto
#

Or do you mean it damages the player?

split scarab
#

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

sharp grotto
#

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]; 
sharp grotto
#

Works fine on a player unit, no damage.

split scarab
#

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

warm hedge
split scarab
#

Perfect! Added setPhysicsCollisionFlag as an extra security lol

acoustic stone
#

Any one got the script that makes shooting range targets move please?

open hollow
modern plank
#

Yeah, have seen that, for a long time. Waiting for the push to the main branch.

teal vine
#
_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.

faint burrow
#

getVariable requires global var name, not the local one.

teal vine
faint burrow
#

How? The same way, missionNamespace getVariable "_allAOLocations"?

teal vine
#

yeah

#

but somehow your solution fixed it, so i'll keep it this way, thank you!

tulip ridge
proven charm
#

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];

cyan thunder
little raptor
little raptor
tulip ridge
cyan thunder
spare matrix
#

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!

granite sky
#

No (known) limit, no.

spare matrix
#

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.

cyan thunder
spare matrix
#

I was getting SO annoyed ๐Ÿ˜‚

cyan thunder
#

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?

proven charm
cyan thunder
# proven charm some stuff that might help: https://community.bistudio.com/wiki/getCameraViewDir...

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)

old owl
#

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;