#arma3_scripting

1 messages Ā· Page 115 of 1

granite sky
#

getModelInfo I guess.

dreamy kestrel
granite sky
#

(we don't know whether your nearestTerrainObjects call or your config viewer screenshot is the "correct" object type. They mismatch)

dreamy kestrel
#

well, I don't know about "we", but I do think source types are mis-aligned.

granite sky
#

The earlier nearestTerrainObjects example didn't even have the same model as the later one.

dreamy kestrel
#

ah I see could be could be...

nearestTerrainObjects [player, ["BUILDING"], 10, false]
fleet sand
#

So when i run this it just gives me this:

private _HideObJ = nearestTerrainObjects [[worldSize / 2, worldSize / 2], ["HIDE"], worldSize, false]; 
private _testArray = _HideObJ select {_x isKindOf "CUP_A2_powlines_wood1"}; 
copyToClipboard str _testArray;
//result:
[]
granite sky
#

You know even if that classname uses the same model, the one on the map doesn't necessarily have a classname?

fleet sand
granite sky
#

cursorObject, not cursorTarget.

#

cursorTarget only shows... entities? Not sure.

fleet sand
#

["powlines_wood1.p3d","ca\structures\misc_powerlines\powlines_wood1.p3d",false,[0,0,-3.50319]] This is the result how would i take this and remove all models from map ?

granite sky
#

filter by one of the first two elements, I guess

#

_array select { (getModelInfo _x # 0) == "powlines_wood1.p3d" }

#

Not sure if the first element is ambiguous in Arma but it probably doesn't matter for your use case.

dreamy kestrel
fleet sand
fleet sand
granite sky
#

It is an object but not all objects have classnames.

#

(terrain objects are special though)

muted crystal
#

call BLU_F_fnc_findPlayer does this code work correctly?

dreamy kestrel
fleet sand
dreamy kestrel
#

ah okay I see what you mean

hallow mortar
# muted crystal call BLU_F_fnc_findPlayer does this code work correctly?

If you have a function called BLU_F_fnc_findPlayer, which requires no arguments, then probably yes. However, there's no such function in the normal game.
All the code does is run a function with that name. If there is one, it'll work (assuming the function isn't broken). If there isn't, nothing will happen.
I am dubious that you have such a function. The name is odd and most functions require some arguments.

dreamy kestrel
#

so we're talking models, LODs, etc

fleet sand
muted crystal
#

I've been trying for 2 hours but I couldn't find a solution

hallow mortar
#

It looks like rhsusf_fnc_findPlayer is a function included in the RHSUSF mod. The rhsusf_ in the function name doesn't refer to a faction, and you can't simply replace it with another faction name like BLU_F. It's just to indicate which mod it's from.
I don't know exactly what rhsusf_fnc_findPlayer does. I suggest replacing _p = (call rhsusf_fnc_findPlayer); with _p = player;, but I don't know for sure that that will work, because rhsusf_fnc_findPlayer could do something weird but essential.

muted crystal
#

Player didn't work unfortunately :d

hallow mortar
#

It looks a lot like this script is meant for internal use inside RHS's special attachment stuff. It's also quite complex. If you don't understand it, it may be better to leave it alone.

opal zephyr
#

Is there a way to make an ai raise their weapon as if they were gonna shoot?

hybrid spire
#

hey could someone help me with this?: how could i get color corrections to automatically apply to every player that joins? this is what i have:

// test theme 1  
"colorCorrections" ppEffectEnable true;  
"colorCorrections" ppEffectAdjust [0.9, 1.1, 0.0, [0.0, 0.0, 0.0, 0.0], [1.0, 0.7, 0.6, 0.7], [0.200, 0.700, 0.100, 0.0]];  
"colorCorrections" ppEffectCommit 0;
fair drum
proud yacht
#

Hey! Quick Question, I want to check if my script will run for all players, meaning , I known that the sound will play for all players , but will the object hidden, object shown will be seen by all the players, or just by the players who clicked the action?

this is the script:

 [SelfD1Mic, ["sD1Sound", 250, 1]] remoteExec ["say3d", 0, true];
sleep 12; 
D1hidden hideObject false;
D1 hideObject true;
hallow mortar
#

You can look at a command's page on the wiki to see its network locality information. hideObject is Local Effect, which means it only takes effect on the machine where it's executed. addAction code is only executed on the machine that did the action, so you'll need to remoteExec it.

#

I notice you have the JIP parameter set to true for your say3D remoteExec. This means that clients which join-in-progress will receive and execute the command when they join - even much later than when the command was sent. This is desirable for hideObject because you want them to receive the current hide state, but you might not want it for say3D, because if they join well after the event that caused the sound, they'll hear the sound out of context as soon as they join, which could be irritating or confusing.

proud yacht
#

Ok, thank you very much , didn't even knew I had my JIP for the say3D on , thx !!!!meowheart

reef grove
#

so I'm under the impression file patching allows you to recompile scripts without having to restart the game; I have the unpacked files in Arma 3/x/mod/addons/mod_name and when I go into the functions view and recompile, it's not updating the file. I also have $PBOPREFIX$ with just x/mod/addons/mod_name inside

#

i probably have a fundamental misunderstanding of how file patching works, so could anyone help me out with understanding it?

granite sky
#

First confirm that it does use the updated version of the function when you restart Arma.

#

(without repacking the mod)

reef grove
#

it doesn't

#

but it also says the folder is in use if i try to move it

granite sky
#

What are you using to pack your mod?

reef grove
#

just pbomanager

granite sky
#

Have you checked the prefix in PBO manager?

reef grove
#

yep it's in there

#

oh wait a sec

#

i might be dumb and using the wrong PBO

granite sky
#

I mean in file properties

#

I'm not sure PBO manager takes any notice of $PBOPREFIX$

reef grove
#

what do you mean file properties

#

like right click > properties?

granite sky
#

In PBO manager there's a cog wheel at the top.

reef grove
#

ahh yeah it's there

#

Property Value
pboprefix x\server\addons\framework

granite sky
#

Should work then, assuming you didn't screw up subfolders.

reef grove
#

does it have anything to do with me using CfgFunctions?

granite sky
#

Like if you have files in functions inside your PBO, the same files should be in x\server\addons\framework\functions in your Arma 3 program folder.

reef grove
#

correct

granite sky
#

Then filepatching will work.

reef grove
#

hmm

granite sky
#

oh wait

#

property should be prefix, not pboprefix

#

Like this:

reef grove
#

well, that did something. now it says i'm missing the files haha

#

does the path in cfgfunctions need to include x/server/addons/framework ?

granite sky
#

Yes.

reef grove
#

perfect, it's working now. Thank you!

fleet sand
#

Question why is this always returning same value ?

 private _text = "10"; 
 private _num = parseNumber (_text); 
 private _rand = floor (random _num); 
systemChat format ["%1",_rand];
hallow mortar
#

It bothers me that you're bothering with format instead of just str but otherwise nothing looks wrong with it. No reason it wouldn't randomise properly.
How many times did you try it? It is possible, albeit somewhat unlikely, that several tries in a row could generate values leading to the same floor result.

drifting sky
#

Is there a way to get access to ai pathing nodes either on terrain or in buildings?

meager granite
#

I wonder if there is a way to simulate physics hit effects somehow? Main thing I want is to have collision sound, but creating particles would be nice too. Is my only way to manually play the sound and create the particles?

meager granite
#

Looks like I'll need to do everything myself

drifting sky
#

Can anybody tell me what this means?

Error Type Number,Not a Number, expected Number```

_surface = (lineIntersectsSurfaces [_from, _to, objNull, objNull, true, 1, "VIEW", "FIRE"]);
south swan
#

and what are _from and _to?

drifting sky
#

positions in ASL.

#

shit... one of those positions had NaN as the altitude.

drifting sky
#

Has anyone sorted out logic to calculate elevation firing angle for things like grenade launchers and rocket launchers? I've got a method, but it requires a lot of manual experimentation for each magazine type.

reef grove
#

is there a good way to directly return data from server in a function call via remoteExec, or is the only way to set variable on player

#

ie. client does remoteExec and server actually returns data

meager granite
#

Client:

"dataineed" remoteExecCall ["server_requestData", 2];

Server:

server_requestData = {
    switch(_this) do {
        case "dataineed": {
            someServerData remoteExecCall ["client_returnSomeServerData", remoteExecutedOwner];
        };
    };
};

Client:

client_returnSomeServerData = {
    systemChat format ["Got the data from server: %1", _this];
};
cunning sequoia
#

Hey all. Currently running a KP Liberation campaign. In KP Liberation, players have access to mobile respawns in the form of vehicles.
I'd like for the enemy AI to target these vehicles when spotted, even if the vehicles have no passengers or a driver inside. That way, the mobile respawns would always at risk if left carelessly parked in the open.

I know that B_TargetSoldier exists but how would one attach it to a vehicle? Also, if this is in the wrong channel, let me know.

unreal scroll
#

@cunning sequoia Attach invisible objects, based on it, from the both side of the vehicle (using attachTo), and save it to a vehicle variable, to remove objects once vehicle destroyed/on GetIn event.

cunning sequoia
#

I assume the enemy AI would see these invisible objects, right?

unreal scroll
#

Yes, so you need to adjust it to to be visible from the both sides and not collide into the vehicle's body.

cunning sequoia
#

Sounds good. Thank you so much!

digital hollow
south swan
#

air friction and rocket engine would make maths way way worse, though meowsweats

digital hollow
#

Pretend it's negligible, and wait to run after motor burnout šŸ’€

granite sky
#

I have a routine that does it, but it uses an assumption that the air friction direction is constant and then throws in a fudge factor.

#

It's not really analytically solvable.

south swan
#

and then Dedmen gets into funny mood and programs air density into in-game ballistics šŸ’€

granite sky
#

Well, you would also need to take account of ACE ballistics if you're using those.

south swan
#

dumb bruteforce way would be to place agent in VR world, make him shoot at different angles and measure how far the projectile actually went derpWolf

granite sky
#

Well, we do know exactly how Arma's engine works there.

#

So you can just run the simulation, adjust, re-run.

#

bit slow in SQF but maybe workable. Depends what it's for.

#

Ok, "exactly" is a stretch.

south swan
#

i suppose programming the agent to do funny stuff would be faster than re-creating ballistics in sqf or any other language

granite sky
#

If you know what weapons you're dealing with you can just make tables for them :P

#

hell, you could probably steal some ACE code to do that.

south swan
#

well, one example that popped up today was making an adjustable iron sight for RPG-like launcher. With rockets apparently not being auto-zeroed by engine

granite sky
#

I guess ACE firing table generation won't deal with rockets.

digital hollow
#

Does it already do grenade launchers?

south swan
#

on the other hand don't planes have CCIP for rocket pods? tanking

digital hollow
#

Any weapon can, see ws gun drone

dim terrace
#

is there workaround for string size limitation in a1.54? trying to dump config somehow...

queen cargo
#

foobar = foobar + "foo"

#

there is your workaround

#

if you need larger strings then you have to write your own extensions as ~4GB are the max. a 32bit application can allocate

cyan snow
#

Hey, not sure if this is the right channel, but I will give it a try:
So I have recently been trying to make my own online multiplayer server (CQC), but I have ran into a problem. When people do join they can see everyone's Hex, even though we have removed gps from everyone's inventory.
I have tried to add this:
["Initialize"] call BIS_fnc_dynamicGroups;
Into init.sqf, however without any luck. Any tips?

granite sky
#

I think the hexes are the groupIndicators difficulty param

#

The dynamicGroups init is correct as long as you run it on the server.

cyan snow
#

Sorry bare with me here, I am not quite sure what you mean?

granite sky
#

shrugs

#

I'm not sure what you're trying to do.

cyan snow
#

you see the hex on the other person (in top left)

#

I am trying to remove it, by putting a code into the mission file

granite sky
#

You can't. It's a difficulty setting and has to be changed on the server.

granite sky
#

The dynamicGroups line enables an interface that allows players to switch between and create groups. It's kinda related because groupIndicators only applies if you're in the same group, but not really.

hallow mortar
dim terrace
#

I wonder then, why they introduced that '999999 (sometimes 1000000) characters ' limit

hollow saddle
#

Hey there folks, is anyone here familiar with scripting relating to pop-up UIs and could perhaps help me work out an idea I'm trying to do? (The explanation for the idea is a bit long so so if anyone would like to help and DM me about it I would appreciate the help!)

hollow plaza
#

Haven't messed around with these things before, but I was wondering how do I use a script in order to change the progress bar value on an object (in this case a rugged communications hub).
I assume https://community.bistudio.com/wiki/progressSetPosition would be used to change the value, but I don't know how or where to get the control id, as I haven't messed around with UI stuff at all really.

hallow mortar
#

It's not. progressSetPosition is for actual game UI stuff. The progress bar on the rugged terminal props isn't a real UI element, it's just an animated part of the object, just like the open/closed state.

hollow plaza
#

Ah, fair enough. As I said, I have no knowledge in Arma UI stuff.

hallow mortar
#

There is a function that's used by the object when you configure it with the Editor attributes, BIS_fnc_linkTerminal_Animations. It's not documented on the wiki (yet?) but there's some discussion about it here #arma3_scripting message, and you can find it in the in-game Function Viewer to see how it works.

hollow plaza
# hallow mortar There is a function that's used by the object when you configure it with the Edi...

Thanks, I also just now figured out really how the config viewer works, something I really could've used a day ago when I went to check a VTOL jet's cargo door names in the addon files.

Since this may help other people as well in the future, here's the script to change the progress bar value for a rugged communications hub:

commHub animateSource ["Progress_source", _value, false];

Just change commHub to be whatever the name of the object is (or to _this in the init) and _value to be whatever value you want it to show (0-100).

granite sky
#

lol

#

It's step-iterated. Gravity is obvious. Air friction is acc = airfric * v^2 with the air friction constant coming from this:

private _airFric = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
if (_airFric > 0) then { _airFric = _airFric * 0.002 } else { _airFric = _airFric * -1 };
#

What I'm not sure about is what step size it uses and whether that's frame-rate dependent.

#

but it's not difficult to get very close anyway.

dreamy kestrel
#

Q: how do I know the number of rounds magazines have in an object inventory? getMagazineCargo does not seem to do it...

dreamy kestrel
drifting sky
#

Is there a way to define custom colors for markers?

warm hedge
#

Define CfgMarkerColors

drifting sky
#

so no way to do a random color then

warm hedge
#

Indeed

#

If you mean you want to set marker color in RGBA, no

granite sky
drifting sky
#

Does anybody know what kind of performance impact minefields have on a multiplayer server?

#

that is, how much does total number of mines in the whole world matter much for performance? and how much does the total number of mines in a small region matter?

hallow mortar
#

Large numbers of anything will reduce performance eventually. Mines aren't super high-drag, though. They don't have physics, AI, or movement, so the impact isn't that huge. You can have many hundreds of mines without any trouble, at least assuming you haven't already spent a lot of performance on something else.

#

You might run into some problems if a lot of them go off at once, though.

queen cargo
#

ehrm ... @dim terrace ... 1000000 characters equal ~1GB dude

#

its most likely no limit but more a limitation

candid sun
pastel notch
#

Hello!
I’m very new to arma 3 scripting and was hoping somebody could make a simple init for me for a mission focusing on sustained combat

I need to add a script to my Init.sqf in the mission file which will activate on a specific class of vehicle (as defined in the init) with the functions to ā€œsetdamage 1ā€ (which means destroy) the vehicle when it has been empty of a pilot for 50 seconds or more.

I’ve been working with arma 3 event handlers via CBA to no avail, can anybody with advanced scripting knowledge make this up for me to use?

#

And maybe share with recognition of them

meager granite
pastel notch
hollow saddle
pastel notch
#

The problem I have is I am using a mod which virtualises units and vehicles and they I also have a resupply mod which respawns them, unfortunately on both occasions adding an init to the vehicle init box alone doesn’t stick, it removes itself, so I need a way to add it into the init.sqf instead so It automatically applies to any of a class type, in my case, an attack helicopter class

meager granite
pulsar bluff
hollow saddle
pulsar bluff
#

in the early days (2013-2014) we used to disable artillery cluster mines, since even one salvo would desync a server catastrophically

hollow saddle
winter rose
#

that's how we roll ^^

hollow saddle
meager granite
#

Added GetIn, GetOut and SeatSwitched to a remote vehicle for a test

#

Remote unit does: Passenger->Driver switch: SeatSwitched triggers
Remote unit does: Driver->Passenger switch: GetOut and GetIn trigger one after another

#

SeatSwitched for both actions for local units

meager granite
south swan
meager granite
south swan
#

fun stuff

meager granite
#

Pretty sure you've seen how remote players fall out of the vehicle for few frames when switching seats, probably consequence of that

#

In other words, EHs report properly, net code is fucked

#

Been like this as long as I play MP so probably won't be fixed

pulsar bluff
#

probably some scar tissue from the days when players would "bounce" outside the vehicle

meager granite
#

Good guess but since I know why that bounce happened exactly its not

pulsar bluff
#

do i want to know why the units bounce?

meager granite
#

Probably the logic is:

  1. Move unit out
  2. Wait until locality change happened
  3. Move unit in
meager granite
#

Affected both OA and A3 at the same time, got fixed in both (units didn't bounce in OA but just floated in place)

pulsar bluff
#

yea i think 5 years ago i would have been interested to know why

#

now ... meh

#

lol

#

it was annoying tho. endless complaints of "wtf i was in a full health tank and got killed by a katiba... ADMIN?!?!?"

#

or with heli, bouncing player bouncing into the rotors and damaging the heli

meager granite
#

It still happens for other reasons though, on vanilla mortars for instance

pulsar bluff
#

vanilla mortar still have animation issue

meager granite
#

yeah

#

seat keeps occupied though, so you can't stack 10 players into same gunner seat

pulsar bluff
#

havent bothered to spam an animation once the player is in the mortar

meager granite
#

I did tests with it, nothing helped

pulsar bluff
#

darn

meager granite
#

animationState returns proper animation, none of playAction/switchMove fuckery did anything to fix it

south swan
#

sad noises

pastel notch
meager granite
pastel notch
#

I had this

this addEventHandler ["GetIn", {

_this = _this select 0;

_vehicle = _this select 0;

sleep 30;

if (count crew _vehicle == 0) then {

_vehicle setDamage 1;

}

}];

I applied this to all init boxes of a vehicle class, Unfortunately It doesn’t work when they eventually crash and respawn

meager granite
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
south swan
#

deja vu

meager granite
#

Also you can't sleep right inside the event handler

south swan
#

"do what i say, not what i code" blobcloseenjoy

pastel notch
#

As you can see I’m not great I just started, I know basic python for my job and that’s it

#

So if no pilot is in the pilot seat a countdown begins of 50 to destroy the vehicle

#

The countdown doesn’t have to reset if the pilot gets back in, just once a pilot is out and the vehicle is empty a countdown begins

#

regardless of if they get back in or not

pulsar bluff
#

you cant just use a getout event, as im sure you also want this to occur when a unit has been killed in the heli but their body remains in the heli

#

in which case the heli isnt empty

pastel notch
meager granite
pastel notch
#

If a pilot dies in the heli doesn’t it count as the heli being empty anyway?

#

In Zeus if a pilot dies at the controls the vehicle goes into the yellow empty state

pulsar bluff
#

i would just use a monitor script, iterate thru an array of entities and check for alive crew

south swan
#

inb4 an external loop that checks if target vehicles have a driver once every 30 seconds and then destroys whatever failed twice in a row

meager granite
#

Unless you want do to all vehicles each frame

pastel notch
#

That doesn’t matter because these are just AI so they’ll disembark from a disabled vehicle and it will explode

tough geode
#

You could flag the vehicle for cleanup in the getout event handler ^^

pulsar bluff
#

once empty add a tick variable or setvariable with servertime, once not empty, reset

tough geode
#

So the loop just checks for dead units ^^

pastel notch
#

It’s basically made for disabled vehicles so they don’t stick around, ai always disembark disabled vehicles so a countdown to destruction is all I really need for it

south swan
#

with no players there the EH setup can probably be shrunk down to like "GetOutMan"+"Killed" on driver šŸ¤”

pulsar bluff
#

i would just add a decay variable to empty assets, and if the asset isnt empty, reset the decay...

south swan
#

and run it FSM-style, checking one vehicle per frame? šŸ™ƒ

pulsar bluff
#

just a while with a sleep

pastel notch
#

The problem I have is this is all basically Latin to me, it took me 3 frustrating hours to make that first script and there are things you guys are saying that I couldn’t even comprehend inputting to an sqf file

pulsar bluff
#

yea you are trying to do an intermediate task with beginner experience, thats all

pastel notch
#

This game is pretty hardcore when it comes to the learning gap lol

pulsar bluff
#

someone will post something fancy for you to look at soon im sure

pastel notch
#

I love it but it’s like a toxic relationship

meager granite
pastel notch
#

I’m happy to learn and this all sounds promising but I just need a bit of guidance on how to set it up in the init.sqf

meager granite
#

Also Killed is local to the unit, so unless its added everywhere, won't work as easy with server-side only script.

pulsar bluff
#
// init.sqf
0 spawn {
    if (!isServer) exitWith {};
    scary_while_loop = TRUE;
    private _v = objNull;
    while {scary_while_loop} do {
        {
            _v = _x;
            if (((crew _v) findIf {(alive _x)}) isEqualTo -1) then {
                // vehicle is empty
                
                
            };
            sleep 0.1;
        } forEach vehicles;
    };
};```
pulsar bluff
#

?

meager granite
#

Yeah. Doubt it affects performance but I still try not to add\remove EHs too much

pulsar bluff
#

what value is persistent, a global or entity level?

meager granite
#

EH indexes?

south swan
#

500 added EHs that don't fire are likely to have less performance impact than 1 extra spawned thread :3

pulsar bluff
#

i think hes saying that when you add + remove an EH, the index remains and always increments higher, for the life of the entity

#

like addAction

#

im not afraid of these incrementing numbers šŸ˜„

south swan
#

per-entity per-handler numbering isn't likely to run out when engine is good up to what? 1e6-ish or something?

pastel notch
#

How do I put sqf inside a little neat box on here

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
pastel notch
#

I have something that might be better to work from

south swan
#

deja vu

pastel notch
#

Running in the 90s

hallow mortar
meager granite
#

Muh CPU tacts

south swan
#

muh 8 bytes of memory per

pastel notch
#

Fudge didn’t work

meager granite
#

Speaking of Killed, how come there is no remote Killed or at least one for server similar to EntityKilled but added to specific entities?

pastel notch
#

I really am useles

south swan
#

``` backticks. The ones to the left of the 1 key

tough geode
#

[_vehicleClass, "init", {
    _this spawn {
        params ["_vehicle"];

        // Wait for player to enter
        waitUntil {
            sleep 1;
            (crew _vehicle select {isPlayer _x}) isNotEqualTo [] ||
            !alive _vehicle
        };

        private _time = time;
        while {sleep 1; alive _vehicle} do {
            // If player in vehicle, reset timer
            if (crew _vehicle select {isPlayer _x} isNotEqualTo []) then {
                _time = time;
            } else {
                // All players not in vehicle and timeout
                if (time >= _time + 30) then { _vehicle setDamage 1 };
            };
        };
    }
}, true, [], true] call CBA_fnc_addClassEventHandler
meager granite
#

Pretty sure remote entities also die and there is a way to run EH from there

tough geode
pastel notch
#

Oh

meager granite
#

Repurpose MPKilled to also work with addEventHandler but without code broadcasting crap

hallow mortar
#

that first attempt looked a lot like autoformatted start/end quotes
I sure hope you're not writing SQF in Word

winter rose
south swan
tough geode
south swan
#

F

gray bramble
#

More like 1M - missing 3 zeroes for the G.

tough geode
#

But looking at it you should add a check if at least one of the crew is still alive. Or else your vehicle with a dead crew still won't get deleted

pastel notch
#

So I need to add one check for every seat for the vehicle I am using

hallow mortar
#

It doesn't need to be one check per seat.

if (({alive _x} count (crew _vehicle)) < 1) then { ... };```
pastel notch
south swan
#

too sad Shakespeare didn't write valid SQF derpWolf

pastel notch
#

Lol

hallow mortar
#
_whereFore findIf {name _x == "ROMEO"};```
pastel notch
#

I’m getting on arma now so I’ll do some extensive testing of the info here, thanks for the help with this you’ve all provided it means really means a lot

#

For sure I’m going to use it to not be as dogsh*t at basic sqf

gray bramble
#

Likely it's just an arbitrary value to keep usage - and memory fragmentation - reasonable.

meager granite
#
    0 spawn { // Separate thread
        if(!isServer) exitwith {}; // Run only on server side

        while {sleep 1; true} do { // Forever loop with a small delay between iterations
            {
                // This vehicle wasn't assigned a cleanup thread yet
                if(isNil{_x getVariable "my_cleanup_thread"}) then {
                    // Assign it and save into variable
                    _x setVariable ["my_cleanup_thread", _x spawn {
                        // Forever loop while vehicle is alive
                        while{alive _this} do {
                            // Waiting until vehicle no longer has alive pilot
                            waitUntil {sleep 1; !alive currentPilot _this};

                            // Start a timer and wait until either timer runs out or there is an alive pilot
                            private _timer = diag_tickTime + 50;
                            waitUntil {sleep 1; diag_tickTime > _timer || alive currentPilot _this};

                            // If condition ended and timer ran out, break the while loop with vehicle destruction
                            if(diag_tickTime > _timer) exitwith {
                                _this setDamage 1;
                            };
                        };
                    }];
                }
            } forEach (entities "Car" + entities "Tank"); // Keep checking all vehicles until new one is found
        };
    };
```Here is what I wrote
meager granite
#

Change alive currentPilot _this to crew _this findIf {alive _x} >= 0 to check for anyone in the crew being alive instead of just pilot

pulsar bluff
pastel notch
#

crikey

pastel notch
meager granite
pulsar bluff
#

samatra and i have been doing it awhile lol

pastel notch
#

it's incredible

warped hornet
#

Does remoteControlled work with zeus controlled units?

pulsar bluff
#

yes

warped hornet
#

Thanks

pulsar bluff
south swan
#

you heretic

#

where's my pitchfork?

pulsar bluff
#

custom version, trained the GPT on all @meager granite scripts

hallow mortar
#

I hope you asked them before doing that

pulsar bluff
#

that only matters for commercial use

hallow mortar
#

I'm thinking about the ethics more than the legality

warped hornet
# warped hornet Does remoteControlled work with zeus controlled units?

Following on, the page on remote controlling states that its all handled locally. Does this mean that if player A is controlling an AI then player B would not get a result from calling remoteControlled on it?

If that is the case how would I go about getting that information when executing from player B

pastel notch
pastel notch
pulsar bluff
#

yea i was kinda joking, gpt is trash for sqf scripts now..

pastel notch
#

i hear 4.0 might be better

#

its not good for anything it seems, i used it for an assignment and it really does just pull things out of the blue and relay them in an academic writing style

pulsar bluff
#

it was good from december 2022 to march 2023, since then imo its trash

pastel notch
#

then when you tell it its wrong it'll say "oh right my bad, heres another made up thing i pulled from the crevises of my starfish

pastel notch
tough abyss
#

pretty new to this stuff but i saw someone run up to a box and ace interact and hit randomize shoothouse, how do you even go about setting a script up for something like that

pastel notch
meager granite
#

entities returns all vehicles of provided class and its child classes

pastel notch
#

aah thanks

warped hornet
still forum
#

_target is local to you?

#

remoteControlled has local arg

warped hornet
#

In this instance _target was a unit spawned by me taken over by player B

#

And that code was run on my client

still forum
#

local _target
must return true, for remoteControlled to work

warped hornet
#

So its not possible for me to use remoteControlled to see if any zeuses are controlling a unit unless that unit is local to me?

still forum
#

it needs to be ran where unit is local.
you could remoteExec it to there

pastel notch
#

i'll be sure to read over these scripts and learn a bit more about how i should properly set out sqf so i can be of a bit more help on this discussion board

#

thanks again to you all and have a wonderful day ā¤ļø

warped hornet
still forum
#

you can remoteExec back to remoteExecutedOwner

warped hornet
#

Like this?

Main script:

_target remoteExecCall ["DSS_fnc_checkIsControlled", _target];

Defined function:

params ["_unitToCheck"];

private _isRemoteControlled = !(isNull (remoteControlled _unitToCheck));

_isRemoteControlled remoteExecCall ["DSS_fnc_returnIsControlled", remoteExecutedOwner];

Defined function:

params ["_isControlled"];

DSS_Unit_Is_Controlled = _isControlled;

systemChat "Returned from local";
dreamy kestrel
#

Q: about container (i.e. uniform, vest, or backpack) mass versus capacity.
mass, in relation to the container container. i.e. how does the container thingy stack in its host vehicle.
versus capacity, what the container can actually sustain in terms of load.

is there a difference? do we sum the mass of the container cargo? or is there a cost/benefit translation that can be realized?
let's see it in some numbers to be clearer...

// backpack, let's say, holds 10 things averaging 100 mass each
_thing_mass = count _things * 100; // 1000 mass, overall mass of the things
// could transliterate to things like backpack weight, let's say
// ...the backpack is actually 1000 mass units worth of weighty (whatever that may convert to in kg)

// backpack stored in vehicle, indicates 600 mass units
_backpack_mass = 600; // i.e. it 'just is' 600 mass units, whatever that is
// perhaps also a function of its load, fully loaded 600 mass units, forgiving for partially loaded container
_backpack_mass_actual = _backpack_mass * (load _backpack);

along these lines.
or am I giving ARMA too much credit here?

tough abyss
#

how do you even go about setting a script up for something along the lines of randomize a killhouse after ace interacting on a object

#

saw it on youtube video, i will send a video if you need it to understand what im talking about

meager granite
#

No idea about vehicles, give it a test

meager granite
tough abyss
#

How do i make it to where when I ace interact a object it randomizes it? Im new to this stuff so im just trying to learn everything I can

warped hornet
#

Probably an addaction and then just 50/50 if it renders or not in a foreach

dreamy kestrel
# meager granite Are you asking if item weight counts weight of stuff inside it?

yes and no. I am asking if there is a cost/benefit, i.e. does a container (backpack, etc) mask the full mass from its host container?
i.e. there's a reason why we like backpacks (or vests, or uniforms), because it makes things easier to carry...
ARMA mechanics-wise, mass

to clarify, I know I can sum the cargo mass of a backpack, that's not really the question.
but whether the vehicle may see the backpack fully loaded as 600 mass? whereas the contents are 1000 mass worth of items.
my question is whether that is a thing, or too much credit given ARMA on my part.

tough abyss
kindred zephyr
meager granite
dreamy kestrel
dreamy kestrel
kindred zephyr
dreamy kestrel
#

or rather mass of the container (backpack) times loading, 50% of 600 let's say...
would contribute ~300 mass to its container...
that would make sense.

#

but that mass is the same budget for backpack contents as for gauging backpack host container loading.

kindred zephyr
#

what makes it troublesome is that there is 2 different properties called mass within arma, the actual mass in grams, which is assigned to the model, and the mass unit which is assigned in config to occupy container space. Imo it would be cleared it it was called volume instead, for example

south swan
#

well, those masses aren't frequently met in the same context. Model/physx mass is barely present outside of, well, physx, config/inventory mass is barely present outside of inventories blobdoggoshruggoogly

ruby bronze
#

I’m not entirely sure where to ask this. Is there a way through a script or a mod, etc to add a suffix after a player’s name in the lobby, such as ā€œCypher [Pvt]ā€ ? I don’t want players to have to go edit their profile names. I want to just be able to do it behind the scenes with code.

dreamy kestrel
dreamy kestrel
winter rose
#

weight a minute

dreamy kestrel
#

🤣

winter rose
#

bonus joke: how do you weigh influencers? in insta grams :p

dreamy kestrel
#

Lou has jokes...

my goal is to manage a container inventory apart from having to visit adding cargo or cargo global every time, or refresh from the same.
manage it in one view, then apply once.

#

so I need comprehension of container, masses, capacities, apparently also counts, etc.

sullen sigil
#

mass ingame seems to be best compared to density

#

would prefer if mass and bulk were seperate things but it is what it is

winter rose
#

afaik, in Arma 3 "mass" counts as mass and space; some kind of density ^ yes

south swan
#

sounds awfully close to "let me rewrite the engine cargo system in SQF"

sullen sigil
#

until we can add fake mass to the inventory we cannot do better 🤷

#

i would if gui stuff was easier to do šŸ™‚

winter rose
#

only one measurement for Arma 3, volume + mass in Reforger

dreamy kestrel
#

understood, understood, it's not a criticism. working with what we got here.

winter rose
#

(no criticism ever taken, aware of limitations ^^)

kindred zephyr
dreamy kestrel
#

so back to the container maximum count. that is reflected in config at all?
or is that a function of content masses?

kindred zephyr
kindred zephyr
# dreamy kestrel so back to the container maximum count. that is reflected in config at all? or i...

maximumLoad considers the mass units of the items.
The other ones are called transportMaxSomething

class CfgVehicles
{
    class ReammoBox;
    class Bag_Base : ReammoBox
    {
        scope = 1;
        class TransportMagazines {};
        class TransportWeapons{};
        isbackpack = 1;
        reversed = 1;
        mapSize = 2;
        vehicleClass = Backpacks;
        allowedSlots[] = {901};
        model = "\A3\weapons_f\Ammoboxes\bags\Backpack_Small";
        displayName = "Bag";
        picture = "\A3\Weapons_F\Ammoboxes\Bags\data\ui\backpack_CA.paa";
        icon = "iconBackpack";
        transportMaxWeapons = 1;
        transportMaxMagazines = 20;
        class DestructionEffects {};
        hiddenSelections[] = { "Camo" };
        hiddenSelectionsTextures[] = { "\A3\weapons_f\ammoboxes\bags\data\backpack_small_co.paa" };
        maximumLoad = 0;
        side = 3;
    };
};
dreamy kestrel
dreamy kestrel
vocal mantle
#

It makes more sense to append a file via extension than to use the clipboard for huge file sizes.

kindred zephyr
#

yup, + knowing if the item itself can be stored in an specific type of container and so on.
You can even config bags that take bags inside for example. There is very few of those

dreamy kestrel
#

does ARMA even watch transportMaxWeapons and so on?
testing in game, I have a backpack, claims 1, but I just put two pistols in there...

#

allowedSlots seems like a harder constraint, though.

#

so allowedSlots is declarative in nature, these are the containers that can hold me

#

allowedSlots is less a concern today in the first beta draft, but I had considered possibly a tree like view in which players could also manage sub-containers, the backpacks and such. then it would be more of a concern.

tough abyss
#

would anyone recommend a place to learn the basics of scripting?

#

looking to make a project further down the line of making scripts to randomize a killhouse after ace interacting a prop.

tough abyss
twin oar
#

Any idea on why I'm getting a missing ";" on this. It's on a trigger set to make a task successful

!alive TK1 and !alive TK2 and !alive TK3 !alive TK4 and !alive TK5 and !alive TK6 !alive TK7 and !alive TK8 and !alive TK9 !alive TK10 and !alive TK11 and !alive TK12 !alive TK13 and !alive TK14 !alive TK15 and !alive TK16 !alive TK17 and !alive TK18 !alive TK19 and !alive TK20 !alive TK21
queen cargo
#

ye youre right @gray bramble ... i was still drunk when i wrote that :)

twin oar
#

nvm

#

I was missing a few ```sqf
and

queen cargo
#

@vocal mantle thats correct! however, it is also a kinda large overhead to create an extension and most people are not capable of doing so

winter rose
twin oar
#

oh i can shorten it

#

thanks lou

exotic flame
#

I would like to make an Megaphone mod and given that i want it to be compatible with TFAR and i'm not an expert at Teamspeak API, i decided to code it in c# with DirectX. In order to do this i made a voice recorder and a voice modifier. But, in order for other players to receive the voice data, i made a kind of daemon in charge of receiving and playing the voice on the receiving computer. I know Arma 3 throws a warning when a dll takes too much time to execute but would it be better for that daemon to be in the dll or in a separated executable file ?

#

I would also like to know if it's ok for a dll to call a another system dll (which has propably not been whitelisted by Battleye) ?

winter rose
winter rose
exotic flame
thin pond
#

Is there any "solo tank" script that works good on MP ? I used the module from MGI but it causes issues with vehicles that have multiple gunner positions

tulip ridge
tough abyss
#

will anyone be so kind to guiding me to make a script to making ai passive until shot at

#

trying to walk around like right next to them and not get shot at

#

I have no experience scripting either so please bear with this stupid quesiton

dreamy kestrel
#

I have a function that recursively finds the CONFIG property by _targetName starting from a _cfgRoot. recursively drills through nested classes to find the property(ies) aligned with the name.

I am after the maximumLoad, or the mass, depending on what a container class may be, uniform, vest, backpack ... actually, my results sort of address the question I had earlier, capacity (what a container may carry) versus bulk (may the container be carried by another container) ... at least for backpacks it may. not so much uniforms or vests, as demonstrated here:

_ucfg, _uclass, etc, are the CONFIG and class name (STRING) for the thing in question, _u..., _v..., _b..., uniform, vest, etc, you get the idea.

// [_cfgRoot, _targetName, _first]
[_ucfg, ['mass', 'maximumload'], false] call MY_fnc_findConfig apply {[_uclass, configname _x, getnumber _x]};
[_vcfg, ['mass', 'maximumload'], false] call MY_fnc_findConfig apply {[_vclass, configname _x, getnumber _x]};
[_bcfg, ['mass', 'maximumload'], false] call MY_fnc_findConfig apply {[_bclass, configname _x, getnumber _x]};

// // results:
// [["rhs_uniform_FROG01_d","mass",40]]
// [["rhsusf_spc_marksman","mass",80]]
// [["B_Carryall_cbr","maximumLoad",320],["B_Carryall_cbr","mass",60]]

for total mass purposes, do we count the mass of the container in addition to its contents?

but moreover, maxLoad _uobj and maxLoad _vobj are both reporting 40 and 60, respectively.
so are we to take it, these containers' mass is also capacity?
obviously, the numbers suggest, yes, question is, is there any other choice?

question also on backpacks, does mass mask the maximumLoad capacity when storing in another container?

fair drum
queen cargo
#

Did anybody find the magic Formular for setDriveOnPath to make a unit drive to the exact spot?
Like, I need it to be exact to half a meter to make units park during a checkpoint mission and they are always stopping like 5-10 meters in front of the actual spot

#

Or how to reliably detect when the path has finished being driven?

dusk gust
meager granite
#

I guess allUnits inAreaArray [position, radius, radius] is the best way to search for units nowadays?

#

position nearEntities ["Man", radius] is faster but doesn't include units in vehicles

spice ravine
#

Hey, does anybody know how can I obfuscate a .SQF file?

pulsar bluff
spice ravine
cobalt path
#

how do I select an individual in eventhandler fired? I mean, I want a code to be executed on to any specific player that fires his weapons within the proximity of an object. I just dont know how to define if shot is fired, effect only the guy who fired it

meager granite
polar belfry
#

hello is there a way to dump the names of the animations of a plane

#

I want to fix pook's incoming.sqf file

meager granite
meager granite
polar belfry
#

and it copies it to clipboard

#

?

meager granite
#

If you want this code for init field and copy to clipboard, do:

copyToClipboard str ("true" configClasses (configFile >> "CfgVehicles" >> typeOf this >> "AnimationSources") apply {configName _x});
polar belfry
#

roger that

#

he has such nice code but half of it isn't declared

#

found the error that has been plaguing people that use pook soviet airforce pack with a lua error

#

a missing }

polar belfry
#
if (_pP select 2 > _pM select 2) then {
    _highlow = "Low";
} else {
    _highlow = "High";
};```
Is this block of code correct
#

typesqf editor says expecting semicolon

#

on the first line

hallow mortar
#

Check the line(s) before that as well. Missing semicolons (or other things that can cause that error, like wrong command names) aren't always detected at the place where it's actually missing

polar belfry
#

found it

#

it was 10 lines prior

cobalt path
#
player addEventHandler ["fired", {

if ( (_this select 0) distance2D safespawnmfv1 < 20 )
then
{
_safespawnentity = getPosATL (_this select 0);
_safespawnentity set [2, 1000];
(_this select 0) setPosATL _safespawnentity;
hint parseText "<t size='2.0'>Working</t>";
}
else
{
hint parseText "<t size='2.0'>Failed</t>";
};
}];

Any idea where I made a mistake? It suppose to teleport a player who fired a weapon into the sky, I aint getting any errors, it just does nothing

hallow mortar
#

Is safespawnmfv1 a) a variable that actually exists and b) a variable that contains an Object or Position (not a Marker or anything else)?

cobalt path
#

When I was writing the script I executed it and it would only give me errors when I was within 20m from that sphere, so game does recognise it

hallow mortar
#

Have you respawned between adding the EH and testing it? I'm not sure whether fired persists between respawns or if it would stay with the old player unit

cobalt path
#

I did the removeeventhandler command, I will try to respawn or restart the mission all together

hallow mortar
#

And when you say it does nothing, does that include not showing the hints? Both for inside and outside the radius

meager granite
#

If its on mission start, player might not be yet available

cobalt path
meager granite
#

Do something like hint "test"; or something

#

Also player is local player, you're not expecting this to work on another player, correct?

#

If its global code execution, it should be fine

hallow mortar
#

Execute Code module is a Zeus module that gives you something like the debug console when you place it, you put in your code and you can choose to server exec, global, local, global+JIP

#

I'd be very surprised if the Zeus Enhanced one simply didn't work at all. It's a popular and maintained mod and I'm pretty sure someone would've noticed.

cobalt path
#

I will test it in a bit

dim terrace
#

@candid sun - thanks, guess I will have to use it

polar belfry
#

I got this error

#
private["_highlow","_pP","_pM"];
/** missile HEIGHT check - is it "high" or "low" ***************************************************************/
if (_pP select 2 > _pM select 2) then {
    _highlow = "Low";
} else {
    _highlow = "High";
};```
stable dune
polar belfry
#

it's from pook's incoming.sqf
When Ai is shot with a missile it does a calculation

#

I'll post the whole sqf in sqfbin

#

I try to fix the sqf so it works properly cause it has lots of potential

#

with jamming and such

hallow mortar
#

At line 145/146, try moving the private definition before the while line

#

I think the relevant variables are being made private to the scope of the while loop and therefore don't exist outside it

polar belfry
#

I see

#

I'll inform you

#

I did the thing with putting all the private variables from within while out of it

polar belfry
#

I may have put the }; at a wrong spot I'll do a check

polar belfry
#

no lua errors anymore

#

I also reported it to pook since he is online in his modpage

meager granite
#

*sqf

polar belfry
#

yea that

bitter bough
#

Working on some custom vehicle compositions in editor with attachTo
Does anyone have a script that outlines module hitboxes for vehicles?

drifting sky
#

With selectBestPlaces , the "hills" parameter doesn't seem to work. Is that normal?

granite sky
#

What were you expecting it to do?

#

hills 0..1 how much is the place "hilly" (160 ASL -> 0, 400 ASL -> 1)

drifting sky
#

score for a place is always 0 with "hills" parameter.

granite sky
#

Which map?

drifting sky
#

altis

#

oh wait... 160 is zero???

#

so it doesn't catch any hills at all until you get into extreme hill territory?

nocturne bluff
#

KK makefile is nice

coarse dragon
#

hey would theses 3 work in a single trigger?

be setDamage 1;
boo setDamage 1;
bill setDamage 1;
pop setDamage 1;

winter rose
#

yes

#

that or forEach

coarse dragon
#

?

#

oh oh i get ya lol

#

i assume all charge ect cant be set off by this method?

sullen sigil
#

yes they can

#
{
  triggerAmmo _x;
} forEach _charges;```
warm swallow
#

Is there a command for colorSelectBackground[]? I looked through all ctrl commands and lb commands for it and haven't found it.

I'm trying to change the color dynamically in a mission

faint oasis
#

Hi, i have a question ? When you use the command "remoteControl" is it possible to be able to command the troops too like in the zeus ? Because when i switch to a unit, i'm able to control it but i'm not able to see who is in his group.

warm hedge
#

Yes

faint oasis
# warm hedge Yes

oh ok how ? I'm realizing that in the zeus i have a mod and it's maybe that mod that does that in particular, maybe not

faint oasis
warm hedge
#

The example 1 pretty tell you how it works and I don't know how else to explain

faint oasis
warm hedge
#

Wait so you want to remotecontrol a group leader and control your squaddies as well?

faint oasis
#

wait no

#

"his squaddies"

#

because atm i can control mine but i don't want, i want to control his squaddies exactly like if i was him šŸ˜„

warm hedge
#

I do not think there is. Even Zeus doesn't let you to do so

faint oasis
faint oasis
#

btw thank you for your answer šŸ˜„

half sapphire
#

hi guys, quick question that might turn into a whole lotta questions. when a unit joins the player's group... who is the actual owner? as i read it, it would be the group leader?

#

to clarify, the unit is local to the group leader?

warm hedge
#

AFAIK the leader of the group owns all units under him

#

MP wise question, am I right?

half sapphire
#

im just driving myself nutz with a hostage with a joinsilent addaction, a handleDamage EV that adds a holdaction... and EV fires many times... and there is more.

half sapphire
#

all works "well" if i joinsilent and join grpNull in sequence after the unit is created. but "well" is not tested with other players.

granite sky
#

Players stay local to their own client regardless of group leader, if you were asking that.

half sapphire
#

no, that i know. but local argument commands get tricky now. like allowDamage i.e.

#

also the EV is firing multiple time. and so much more.

granite sky
#

AIs & group switch to the group leader locality, although I'm not sure if there's a different rule if there are non-leader players in the group.

#

If you create a new group and join an AI unit to it, the group switches to the unit's locality rather than vice versa.

warm hedge
#

I think it should be local to the server itself unless you pass the locality of the group to some client, like HC

half sapphire
#

i do owner _unit, returns server. i joinsilent the _unit, owner _unit returns 4 (which i was sure it should be 3 but anyway.

#

by server i meant 2

#

its quite a lot of lines to post here. but maybe the EV alone will give you an idea.

{HostageUnit addEventHandler ["HandleDamage",
            {    
             HostageUnit = _this select 0; 
             private _damage = _this select 2;

             if (_damage >= 0.7) then {
             H_RexecTarget = owner HostageUnit;
             publicVariable "H_RexecTarget";
             {HostageUnit allowDamage false; HostageUnit setUnconscious true;} remoteExec ["call", H_RexecTarget];
             {HostageUnit removeAction 1; HostageUnit removeAction 1;} remoteExec ["call", 0, true];
             [west, "Hsave", ["The Hostage has been Shot! Hurry!!", "REVIVE HOSTAGE"], [HostageUnit, true], "ASSIGNED", -1, true, "heal"] call BIS_fnc_taskCreate;
             [] spawn RPR_HostageCountDown; //this is countdown with stuff.. does work regardless of EV.
             [HostageUnit, 
             "Revive hostage", 
             "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa", 
             "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa", 
             "_target distance _this < 2", 
             "_caller distance _target < 2", 
             {_caller playMove "AinvPknlMstpSnonWrflDr_medic1";}, 
             {}, 
             { 
             {HostageUnit allowDamage true; HostageUnit setUnconscious false; HostageUnit setdamage 0;  
             HostageUnit PlayMove "UnconsciousOutProne"; HostageUnit enableAI 'anim';} remoteExec ["call", 0];
             HostageUnit spawn GF_Missions_addaction_Join_Disband_Hostage;
             }, 
             {_caller switchMove "Acts_Accessing_Computer_out_short"}, 
             [], 
             5, 
             100, 
             true, 
             false 
             ] remoteExec ["BIS_fnc_holdActionAdd", 0, HostageUnit];
                              };    
           } 
                    ];

} remoteExec ["call", 0];

granite sky
#

well, that's horrible :P

half sapphire
#

oh yeah... it was worse.

hallow mortar
#
  • probably make a function and remoteExec that rather than transmitting a whole lot of code inside call
  • remoteExec accepts objects as the locality target, so if you need to remoteExec to where the unit is, just provide the unit. You don't need to find the owner, the game will do it
#

Also, handleDamage EH can indeed fire many times. Every time any part of the unit is damaged, which can be several times per hit as different body parts take damage. If you want it to only do something once, you'll need to add a safety, like setting a variable true the first time it happens and having an if to skip the code if that variable is true

half sapphire
#

i was running the EV like this "[HostageUnit, ["HandleDamage", {_this call RRP_HuEH}]] remoteExec ["addEventHandler", 0, true];" then had to scrap to better look at the code. im going nutz already lol

#

those are good pointers @hallow mortar thanks

#

so, for the remoteExecs it'd be something like "[_unit, true] remoteExec ["allowDamage", _unit];" ??

granite sky
#

Yes.

#

If you have a bunch of commands to process on a unit, some of which are local, you should group them into a function rather than spamming remoteExecs though.

half sapphire
#

you mean like full function with class in description.ext?

granite sky
#

Ideally.

#

If you're writing dirty stuff then you can broadcast functions with publicVariable :P

half sapphire
#

ok, im using a lot of {} remoteExe ["call"]. is this a bad thing?

granite sky
#

Yes.

#

Make a function, remoteExec that instead.

#

Also I'm not absolutely sure that your HandleDamage is returning nil. Always check that. Breaks things badly otherwise.

hallow mortar
#

A non-CfgFunctions function (defined by variable in a script run everywhere or by publicVariable) will have the same benefit in this case - reducing the number and size of remoteExecs, saving network traffic - but CfgFunctions functions have other benefits too, such as performance and security.

granite sky
#

Sometimes I do use remoteExec ["call"] when the function's very short, but generally it's something to avoid.

half sapphire
#

yeah.. testing all that in dedi would take me ages. so many restarts every time i mess up.. wich is a lot. tried filepatch.. still wont let me edit and save.

granite sky
#

Yeah, filepatching isn't great on a server atm.

half sapphire
#

im just writing it and pasting in the console until it works.

hallow mortar
#

When you remoteExec code using call or spawn, all that code is transmitted over the network as text. When you use functions, only the function name is transmitted and the clients refer to their local copy of the code, making the network message much smaller and faster.

half sapphire
#

another great pointer.

#

i was hoping not having to learn how to make functions and declare them on ext until later on when i was sure shit was working right.

granite sky
#

You could do the publicVariable global functions thing for now. At least you can write your functions and event handlers in different ADT windows then :P

wise frigate
#

Any way to Attach two objects together using Memory Points, I want to attach 2 walls via a scrip using a memory point on each of the models.

warm hedge
#

attachTo is the command

half sapphire
#

for objects that you dont need to animate, you could try larrows compostion spawner. you just make it all in the editor, save compostion, and well, read larrows instructions.

#

for some reason, at least i can not animate composition objects spawned with his script.

#

also, you need to give buildings with doors a variable name and make it publicVariable. or clients wont be able to open them. that's my workaround anyway.

wise frigate
warm hedge
#

There is no way to do. I've no clue what exactly is your expection though

wise frigate
#

Say I have a custom wall model, on the edge of each wall is a memory point I want to have a script which attaches one of the walls to the other but have them connect at the memory points so to speak

half sapphire
#

didn't kllzone_kid make a function for something like that?

warm hedge
#

No idea what does "connect" mean

half sapphire
#

he basically wants "snap" points on the wall edges, i guess?

wise frigate
#

Essentially

half sapphire
#

[_obk1, _memory 1] attatchTo [obj2, _memory 1] just made that up to express the idea. is this the intention?

wise frigate
#

Pretty much

#

Something along those lines

hallow mortar
#

(selectionPosition)

half sapphire
#

@wise frigate you should really check larrow's compo spawner.

#

just google that.

#

although, learning how to do the attatch thing is way better.

wise frigate
#

Gotch I’ll look into it

half sapphire
#

ok, the EV triggers many times IF the unit is local to the server. once it joins my group once it all works.

#

even if it leaves the group

queen cargo
#

anybody ever experienced a crash with setDriveOnVehicle? thinkdrops

#

ahh
just was a 2 minute freeze

granite sky
#

How long was the path? :P

queen cargo
#

40 nodes

#

yeah .-.
setDriveOnPath does not play nicely with damage at all

#

thats bad ... need a convoy that refuses to follow a path ... and have it stop once any of em takes damage

#

bloody AI ... why is creating convoys this embarresingly bad 😦

tough abyss
#

may i have some help? Would anyone be willing to point me to the correct sources to build a script that randomizes preset shoothouses i made (only happen when player run to a object and ace interacts)

#

very new to scripting, this will be my first project, would love to learn anything anyone has that will help in my journey of scripting 😃

granite sky
#

I would have thought the easy way to do that is teleport the player(s) to a different place on the map.

warm hedge
#

Making a randomized killhouse is very hard from my perspective. You need to take almost everything into count, like the size of the house, target pos, anything into the script and make it into one thing and randomize everything is very hard

#

I'd suggest what John said

#

Or, probably randomize show/hide the predetermined/placed target and call it a day

tough abyss
warm hedge
#

That exactly is the suggestion

tough abyss
#

hm interesting

#

im just thinking of how i could use that, obv this is for a milsim im in the midst of making so just seeing what i can do

granite sky
#

You certainly can spawn a predefined collection of objects in a particular formation as an alternative, but that's a few extra steps.

#

Also likely to look weird unless you have a very flat surface to place it on.

tough abyss
tough abyss
tough abyss
#

again im very new and just trying to learn

granite sky
#

The tricky part there is turning the objects into data in the first place.

#

Once you have them it's just setPosWorld + setVectorDirAndUp.

warm hedge
#

I do not think turn things into data is a big concern, you can just show/hide a layer that is defined in Eden

tough abyss
#

yea i was experimenting, i am working on the box they run up to in order to randomize it

granite sky
#

ah yeah that's probably easy. I can't remember the command for it.

tough abyss
#

i only plan to go as far as the interaction that says randomize shoothouse (only as far as ik)

#

so just looking to learn from someone or be pointed in the correct direction

warm hedge
#

One thing you definitely should to determine is how and what should be randomized

granite sky
#

The interaction part is just addAction. In this case you'd probably add it in the script box for an object.

tough abyss
warm hedge
#

Definitely and why not

tough abyss
#

sorry just dont wanna be a hassle to yall!

warm hedge
#

Just upload it here. Not my DM

tough abyss
#

it just gets deleted instantly sadly

warm hedge
#

Oh wait you're very new Discord user to post one

#

We've made this restriction to prevent spam

tough abyss
#

ah yea i had made a new discord recently

tough abyss
#

yea it is a youtube video, i can drop link rn if need

warm hedge
#

I am asking because posting a recorded video is very unreasonable and I really cannot tell what is the need you want from this clip

tough abyss
#

i should clearify only the first 10 seconds of the video is actually what im wanting

warm hedge
#

Okay if you mean you want to layout the room, walls, targets, maybe doors randomly, it is not a script that can be done within hours

tough abyss
#

yea im fully aware that it wont be an easy task

warm hedge
#

Always start from a very small step, especially if you're very new to the entire script syntax

#

This is pretty much what John and me told

tough abyss
#

alright, how do you recommend i take baby steps on this? the teleport player to a shoothouse?

warm hedge
#

And the easiest is (script wise), make multiple killhouses, teleport the player into one of them

tough abyss
#

alright, thank you i will do that

#

may you guide me to the correct sources possibly?

tough abyss
#

thank you!

tough abyss
#

what is the difference of using VS (script writing thingy) compared to using a init box of a object?

warm hedge
#

I don't know what is VS

tough abyss
#

visual studios code

warm hedge
#

VSCode and Init box are not comparable. Different software

tough abyss
#

gotcha

#

still confused on when I should use one over the other though

warm hedge
#

If you mean SQF script file vs Init box, my very wild guess, essentially nothing is different. But SQF file is better to reuse, maintain and anything

tough abyss
#

so basically i can copy sqf's from one mission to another with the code saved instead of copying and pasting the code into an init box again if used in a different mission?

granite sky
#

Init boxes are normally something you want to avoid unless you're just adding a small amount of mission-specific script to a mission.

tough abyss
#

alright thank you, i was just curious. Not sure how all this works yet

empty pilot
#

Hi

#

I need help with this code here. why i am getting player position near [0,0,0]

NOTE: player position was near molos.

player selectionPosition "head";

[0.0888845,0.110778,1.50533]
it nearly to [0,0,0]

I am trying to get blue2 head position to try to make nametag above their head. but i always keep getting somewhere near [0,0,0] which it lead to getting the Draw3D in wrong position.

warm hedge
#

selectionPosition's base is object, not world

tough abyss
#

Pole addAction ["Teleport To Shoothouse",

_pos = getPosATL pad;

player setPosATL [_pos select 0, _pos select 1 , _pos select 2];

teleporting me to random coords and not the pad coordinates [pad is object i wanna teleport to]

warm hedge
#

The syntax as far as I can see is wrong after all

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
warm hedge
#

Post the entire code precisely

tough abyss
#
    _pos = getPosATL pad;

    player setPosATL [_pos select 0, _pos select 1 , _pos select 2];```
warm hedge
#
Pole addAction ["Teleport To Shoothouse",
    _pos = getPosATL pad;

    player setPosATL [_pos select 0, _pos select 1 , _pos select 2];```Is this the entire script?
tough abyss
#

yea it is

warm hedge
#

Are you sure? Because it is not even going to process, but fail and throw an error in the first place

tough abyss
#
    _pos = getPosATL pad;

    player setPosATL [_pos select 0, _pos select 1 , _pos select 2];



}, [], 6, false, true, "", "_target distance _this < 2"];```
empty pilot
tough abyss
#

i mean thats all i have in the script

#

the bottom part from my understanding is how far the interaction pops up from the player

warm hedge
#

Your code is still broken, not going to run

#

If, that is the actual code you use

tough abyss
#

im not getting an error, the interaction is running just putting me in a random spot?

#

so im not sure

warm hedge
#
  1. You need to wrap the brackets. addAction takes a code to run and a code needs {} bracket. You have no {
  2. Make sure pad is there, where you want to refer
  3. (Suggestion) setPosATL getPosATL ... is enough
tough abyss
#

{ is in the bottom part, first character in bottom

#

}, [], 6, false, true, "", "_target distance _this < 2"];

warm hedge
#

It is }

#

Not {

tough abyss
#

yea i typed the wrong bracket

#

in the code above it is there

#

}, [], 6, false, true, "", "_target distance _this < 2"];

#

the first character is the wrap bracket

warm hedge
#

Pardon?

#

Are you sure the code you've just posted, is is the actual code?

#

I'm asking because it is impossible to run, or at least having no error log

tough abyss
#

yea im sure lol, it the only thing i have opened/made

#

is the } from the bottom part of the code not the wrapped bracket you are reffering to?

warm hedge
#

You MUST have both start and end bracket

#

This should happen if you try to run your code. The code is not going to be recognized properly by the game

#
Pole addAction ["Teleport To Shoothouse",{
    player setPosATL getPosATL pad;
}];```It can be altered and simplified into this
tough abyss
#

im sorry man, i dont mean to make you mad or annoyed, im just trying to learn. What i sent was the full thing so im not sure what was going on

#

i appreciate you simplifing it for me also

warm hedge
#

I'm not really angry or mad. I'm simply confused because you cannot run it despite you say you've ran it

tough abyss
#

yea again as i said im not sure

granite sky
#

If you don't tick "show script errors" in the launcher then everything fails silently.

tough abyss
#

however im still running into the same issue with this simplified version, it is putting me in a random spot of the map

warm hedge
#

You cannot avoid to see the error in Eden Editor and its preview

tough abyss
#

it is weird though because it is putting me in the same spot as the last code

warm hedge
#

Possibilities:

  1. You're not running it but something else
  2. You have a faulty Mod or script in your mission
  3. You're modifying an old mission or file
tough abyss
#

hm

#

its sending me to the coords 0,0,0 so maybe its a faulty mod

granite sky
#

what is pad exactly?

#

getPosATL pad will return [0,0,0] if it doesn't exist or isn't an object.

warm hedge
#

If pad is not an object it will return an error and not going to run

granite sky
#

pretty sure it gives [0,0,0] for objNull at least.

tough abyss
warm hedge
#

Are you sure pad does exist when you execute the code?

granite sky
#

test in smaller pieces anyway. Run getPosATL pad in the debug console.

warm hedge
#

Or simply pad

tough abyss
#

copy will do that right now and come back

tough abyss
#

i appreciate the help greatly, means tons to me

meager granite
#
private _logic = createAgent ["Logic", getPos player, [], 0, ""];
[teamMember _logic, isNull teamMember _logic, teamMember player, isNull teamMember player];
```=>`[Agent 0x1b854080,true,<NULL - team member>,true]`
winter rose
#

a ! may be missing somewhere in the engine šŸ˜„

meager granite
#

Guess nobody ever used isNull TEAM_MEMBER since 2009 or something?

#

Unless it means something else in context of team members

winter rose
#

team_member is not exactly used afaik? introduced in A2 but left aside

meager granite
#

Looking at CfgTasks its used for animals? Or was used.

meager granite
unreal scroll
meager granite
deft lotus
#

Howdy ho, Quick question for yall maybe you could help.

Basically what im trying to do is a log system similar to Liberation where it saves kills, rounds fired, ect over multiple missions using ALiVE. So once a certain kill count is met over those multiple missions it does the BIS_fnc_endMission function. I dunno if thats possible lol so just asking cheers

wispy venture
#

Hi,

So i run a Arma unit and i’m trying to figure out how this works. https://community.bistudio.com/wiki/radioChannelCreate

Is there maybe a way to create a squad in the editor and give the squad the variable AlphaSquad for example, then i call the variable and everybody that is in that variable will have access to ā€˜Alpha Channel’ and same with Bravo and Charlie.

If anybody could help me out with how this would work in scripting and where i put this code, it would be so much appreciated.

meager granite
wispy venture
fair drum
fair drum
fallow pawn
#

Hello there!
You know how in Spectator Mode, when you're spectating a player (not on free camera), the camera mode automatically toggles between 1st and 3rd person as the player remotely do so?
Does someone know how it does that?
Does it use the UserAction event handler as in "addUserActionEventHandler ['personView', 'Activate', {}]" to broadcast the player's view mode changes? Or is there another way like monitoring a variable?

wispy venture
meager granite
fleet sand
fair drum
fair drum
fleet sand
#

Quick Question is there a better way of doing this code then this:

params ["_unit"];

if(isNil {_unit getVariable "LEG_Is_BlackAndWhiteEffect_Active";}) then {
_unit setVariable ["LEG_Is_BlackAndWhiteEffect_Active",true,false];
};


if(_unit getVariable "LEG_Is_BlackAndWhiteEffect_Active") then {
    systemChat format ["Effect is Active"];
    _unit setVariable ["LEG_Is_BlackAndWhiteEffect_Active",false,false];

    //effect Active
    effectHandle = ppEffectCreate ["ColorCorrections", 1500];
    effectHandle ppEffectEnable true;
    effectHandle ppEffectAdjust [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]];
    effectHandle ppEffectCommit 0;

}else {
    systemChat format ["Effect is Not Active"];
    _unit setVariable ["LEG_Is_BlackAndWhiteEffect_Active",true,false];
    //Effect Deactivated
    effectHandle ppEffectEnable false;
    ppEffectDestroy effectHandle;
};
wind sapphire
#

Legion - just note that you can set a default value when you use getVariable so you do not need the first three lines.

#

The second if() could be written as

#

if (_unit getVariable["LEG_Is_BlackAndWhiteEffectActive",false]) then { ...

split oxide
#

It's also a local (network) effect, so saving the status to _unit doesn't really do anything for you since your only probably going to want one effect per client. Also you can check if the effect is enabled using ppEffectEnabled. Since you're already using a (network local) global variable, so you could get away with doing something like this:

if (isNil "LEG_Is_BlackAndWhiteEffect_effectHandle") then { 
   LEG_Is_BlackAndWhiteEffect_effectHandle = ppEffectCreate ["ColorCorrections", 1500];  
   LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectAdjust [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]]; 
   LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectEnable false; 
   LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectCommit 0; 
}; 
private _isEnabled = ppEffectEnabled LEG_Is_BlackAndWhiteEffect_effectHandle;
LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectEnable !_isEnabled;```
This approach gets rid of your `systemChat` calls, but I'm unsure if you want those in the final version. In addition, the above code doesn't address the fact if you create an effect with the same priority (in your case 1500) as another effect, it will fail to create an effect and `ppEffectCreate` will return -1. You can see a few examples on the Post Process Effect wiki page about how to handle that though (https://community.bistudio.com/wiki/Post_Process_Effects)
#

But a better question is what are you trying to do? There may be a better way to approach it or other considerations

edgy dune
#

Is there anyway to detect when a players stance has changed?

tough abyss
#

Hello !

I'm doing a mission where a BLUFOR talks to you when you get close with a trigger.

It works very well, the problem is that I'd like it to have several sentences available, and that each time you move away from it then move back towards it, it would choose the next sentence available, and so on, to add realism and not repeat himself constantly.

Can anyone help me on this ?

winter rose
tough abyss
#

Yes of course !:D

#

That was my main idea but I thought it would be too difficult to do

winter rose
#
[theGuy, selectRandom ["sentence1", "sentence2", "sentence3"]] remoteExec ["say"];
warm swallow
#

having issues with htmlLoad when the html file is within a folder, not in the root directory of the mission

#

forward slash / doesn't do anything.
backward slash \ crashes the game

winter rose
#

try double backslashes?

#

(escaping the backslash)

warm swallow
#

so \ ?

#

\ \

#

\

winter rose
#

yep

warm swallow
#

ok

winter rose
#

\\ ^^

warm swallow
#

ty lol

#

@winter rose not working still unfortunately

#

VScode relative path: client\spawnmenu\infoTitle.html

winter rose
#

your code?

warm swallow
#

_ctrlHTML htmlLoad "client\spawnmenu\infoTitle.html";

#

didnt copy correctly my b

#
_ctrlHTML htmlLoad "client\\spawnmenu\\infoTitle.html"; 
winter rose
#

hmm, ok
can you try

_ctrlHTML htmlLoad getMissionPath "client\spawnMenu\infoTitle.html";
```?
warm swallow
#

nope

#

didnt work either

tough abyss
winter rose
winter rose
warm swallow
#

mood

tough abyss
winter rose
tough abyss
#

Well, my system is ready, I mean my computer is on

#

Sorry sometimes I struggle with english

winter rose
#

(I wrote "read" at first, I edited the message)
I wondered how you made your soldier speak?

#

Comment fais-tu parler ton soldat, kbTell?

warm swallow
#

and it worked this time!

#

no crashes today meowheart

tough abyss
#

@winter rose I basically used the exact same template as this guy in this video : https://youtu.be/-uqyg1FA8As?si=OTXYFjVD82tLtA97&t=130

Had a lot of requests for this, NPC voice chat with spoken text on screen. It's a real pain to set up, I hope you're not confused by this information.

Download the mission file here:
https://drive.google.com/file/d/16u0-sA4TYDBzWdL451od-ENRBZM8o8Vh/view?usp=sharing

It's in zip format, so extract it, move it into your missions folder in Arma 3...

ā–¶ Play video
winter rose
#

(glad to hear it works! ^^)

tough abyss
#

@winter rose Am I stuck with this ? 😢

#

I mean the system don't allow me to do that ?

winter rose
#

ah you cannot write "bad words" so the "mf" in it is blocked yes
but I saw it

tough abyss
#

Oh ok forget about the MF ahah

#

I still don't understand how to do the random sentence thing šŸ˜…

winter rose
#

using BIS_fnc_kbTell is tricky, I would have to think

better to only use kbTell alone for this

#

(also, you are missing a ; after your text = "")

tough abyss
#

Damn I really do try to understand coding but it's such an alien language for me 🄺

#

I don't understand, but it's normal

winter rose
#

sorry, I can't help rn
but I wrote the Conversations page and it should provide everything you need

tough abyss
#

I will try to understand the conversation page

winter rose
#

I like to help, but BIS_fnc_kbTell is really for conversations and not one-time chats, or you would have to duplicate things etc and I don't exactly remember how it works
so kbTell or say are safer, simpler bets

tough abyss
#

But with kbtell only I can't show the text on the bottom of the screen, no ? @winter rose

winter rose
#

you can have the radio subtitle yes

tough abyss
# winter rose you can have the radio subtitle yes

Hmmm, and let say I do like 3 triggers at the same location with 3 different .bkib et description.txt code (so 3 different sentences) , can I manage to activate one of the triggers randomly ? Trying to think outside the box (lel)

winter rose
#

nah that would be ugly

#

and most likely not working šŸ˜›

tough abyss
#

😦

#

😢

winter rose
#

but if you duplicate bikb, you can selectRandom a topic

tough abyss
#

Let's stay with 1 sentence then. Very last question @winter rose (sorry), but the sound of my ogg file is very low in game when I activate the trigger... But when I listen it on my windows media player it sounds totalluy normal / loud, is tehre something wrong ?

winter rose
tough abyss
#

Is it horse sh*t ?

winter rose
#

yep!

#

that's script in config, two different worlds ^^

tough abyss
#

Godamn 😢

still forum
fallow pawn
# meager granite I think its done automatically, view mode is sent over the network and applied w...

Maybe I phrase it poorly. I meant to say I know it's automatic and it's sent over the network while I'm on BIS's Spectator Mode.
The thing is, I'm making a functionality that basically makes a custom camera follow a remote player, quite like the spectator mode but for a different purpose.
I'd like to know how could I go about to monitor this remote player's camera view mode, as in the LA command "cameraView", so I can get closer to my intended final result.
All I know is that it can be done, since BIS's Spectator Mode does it.

meager granite
fallow pawn
#

Wait so if I simply _remotePlayer swithCamera "INTERNAL" into a remote player it will automatically keep up with it's remote's camera view changes?
Hold on I have to test it!

meager granite
fallow pawn
#

Yes! It just works!
You just spared me from a world of pain broadcasting changes through Event Handlers and some timesome variables monitoring...
Thanks very much for the tip!

meager granite
#

Looks like changing locality of a unit when they're in ragdoll state makes them never leave the ragdoll state anymore

#

Forever stuck like this lol

#

Armanormal activity

hasty gate
#

Hi, my situation: in a combat vehicle a player is a commander or gunner, and the driver is AI. Goal: how to nerf somehow the ability of the crew to react to player given navigation commands like FORWARD, RIGHT, LEFT? Now it's not worth to have a player instead of AI I want to balance that using scripts

meager granite
#

This locality change and stuck ragdoll mess everything up, seems to be no way to script fix it either

#

(isAwake for units returns false when in ragdoll state btw)

#

testz awake false; testz setUnconscious false; does nothing

#

Well, the lesson is: Never switch unit locality if

!isAwake _unit || {animationState _unit == "unconscious"}
```is true or it will get stuck in being a ragdoll forever
#

!isAwake _unit check wasn't enough, thankfully there is an animation that sets during ragdoll

errant iron
# tough abyss But with kbtell only I can't show the text on the bottom of the screen, no ? <@1...

if you're interested, i did my own testing with the conversation system a few days ago which you can find here
https://github.com/thegamecracks/Soup-Conversation
it basically just used BIS_fnc_kbTell, except that i slightly tweaked their functions to support textPlain in description.ext CfgSentences to give the subtitle effects sqf private _config = [_mission, _topic] call BIS_fnc_kbTopicConfig; if (isNil "_config") exitWith {}; // private _text = getText (configFile >> "CfgSentences" >> _mission >> _topic >> "Sentences" >> _sentence >> "textPlain"); private _text = getText (_config >> "Sentences" >> _sentence >> "textPlain"); if (_text != "") then {[_from getvariable ["bis_fnc_kbTellLocal_name",name _from], _text] call BIS_fnc_showSubtitle;};

winter rose
#

yes, I mean why does this function not check description.ext 😩

errant iron
#

but like lou said, say should work pretty well for one-off sentences, for example your trigger activation might look like: sqf // Pick a random voice line from CfgSounds + subtitle _sentences = [["Sentence01", "Hello there!"], ...]; selectRandom _sentences params ["_sound", "_subtitle"]; [name mySpeaker, _subtitle] spawn BIS_fnc_showSubtitle; mySpeaker say _sound; though it gets a bit more complicated if you want it to be synced in multiplayer

fair drum
#

You could probably use the animChanged event handler and compare the current animation of the player though.

errant iron
tough abyss
pulsar pewter
#

Is there any command to play a sound for one player only? Ie ensuring others dont hear it?

errant iron
#

i'd prefer the function still be compatible with kbWasSaid, but if there's no fix for that i guess i'd have to use my own function to check

hallow mortar
warm swallow
fallow pawn
#

Does the T-100X Futura have a workaround to be usable in dedicated MP? I can't fire it's main gun more than once no matter what I do...

warm swallow
#

Is there a way to locally disable the sun? i know you cant change the time of day locally

hallow mortar
sullen sigil
#

all terrains must have the sun

granite haven
#

Are macro's recommended to use as much as possible?
or is it more a luxury addition for if you need to repeat the same thing multiple times?

sullen sigil
#

depends

#

if you are working on a mod which has a lot of components/modules, yes. saves you having to remember everything

#

if youre just working on a single mod at a time which only has one prefix and wont benefit from more then it is unlikely

hallow mortar
#

Macros are a convenience for you when you write the code or config. They have no impact on performance or how the code works. It's up to you whether you want to use them.

granite haven
#

ok, thank you

sullen sigil
#

yeah theyre purely a self aid and do nothing for the game itself

warm swallow
sullen sigil
#

not as far as i know

#

has to be done with config if at all

fallow pawn
hallow mortar
#

The fix shouldn't require any mission updates. It would all be in the vehicle config and BIS functions, which aren't saved in the mission.

dapper cairn
#

Does anyone know of or how to make a script for low laying yellow fog/smoke in a 1km radius?

pulsar bluff
#

whats wrong with white fog?

dapper cairn
hallow mortar
#

Unfortunately it's not possible to control the colour of standard fog (maybe(?) in the map's config, but that's no good for missions). Using particle effects is...possible, but not ideal for large areas. You could use particles for smaller drifts of dense fog/spores.
You might try using standard fog in combination with a post-process effect: https://community.bistudio.com/wiki/Post_Process_Effects#ColorCorrections
Everything in the scene will be affected, not just the fog, but it may be the best you can get.

fallow pawn
meager granite
#

Remembered this and realised why Arma shooting feels so sluggish in multiplayer on a 100 player server, with all other messages clogging queue, no wonder people die like after 2-3 seconds after hit even though latency is less than 100ms.

dreamy kestrel
#

Q: do compatibleMagazines and compatibleItems also support binoculars?

warm hedge
#

A: Try it!

edgy dune
peak pond
#

What's the best way to prevent use of the Commanding Menu in a PVP mission? I noticed showHUD can hide the UI which covers most of the bases, but I think players can still activate the command menu items if they memorized the keybinds (e.g. ``-5-5` to request status and find out who is dead).

tough abyss
#

is there a way to reduce the range an object with an addAction can be activated from? I'm able to scroll wheel activate them from about 50 feet away

warm hedge
tough abyss
drowsy umbra
#

Is there a way to make AI run towards explosions/shots not in their immediate vicinity? Trying to make a scenario where a patrol is walking around, an explosion happens in a populated area, and the patrol runs to check it out

hallow mortar
#

If you know where the explosion is going to be, you can just give them a waypoint to that position at the same time as you cause it

kindred zephyr
#

That last one is a great tip for more natural responses

vapid spoke
#

why does my area marker keeps getting deleted mid game?

granite sky
#

Because some code is running that deletes it?

vast zodiac
#

Does anyone know if there would be a way to make a code which checks for ai with skill under a certain level, and if it finds it, locks them in an animation for the duration of the animation then resets their skill level? I'm looking to make a scripting solution that's compatible with ACE3 to produce a similar flashbang effect to the RHSUSAF mod without having to have the entire RHSUSAF mod loaded

glossy pine
warm hedge
#

There is a command to set VON volume

celest oxide
#

Would it be deleted content causing the issue?

#

but its not to do with the header from what I know bc according to the discord its the mod issue or conflicting

warm hedge
#

You have a missing addon/Mod to play

celest oxide
#

yeah figured trying to figure it out but was wondering primarily

#

no shot it cant be something within the mission file?

dusk gust
# celest oxide no shot it cant be something within the mission file?

The mission file uses an addon that includes "jbad_opxbuildings2". You don't currently have it installed and loaded, which is giving you the error and not letting you join. The only way to fix it is to install and load the mod if you are the only one having the issue. If anyone else is, then you should tell the mission creator.

celest oxide
#

@dusk gust
We already fixed that though now I got a new issue lemme send it, it's becuase a mod is broken i think rn

#

just frustrating

drowsy umbra
hallow mortar
#

Probably more of an #arma3_config question, but it looks like it's controlled by the positions of the ends of the taxiways

half sapphire
#

hey guys. im still trying to figure out handleDamage EV. how do you make it NOT fire for each hit part?

granite sky
#

You don't.

half sapphire
#

aka "only fire once".

granite sky
#

You just suffer it, like most things in Arma.

half sapphire
#

did you just grab my ass? šŸ˜›

#

really? thats it?

granite sky
#

No, it's worse than that.

half sapphire
#

come on dude, im drving myself nutz here.

granite sky
#

Some of the handleDamage EH calls aren't even for real damage on the hitpoints. They just threw some other garbage in there.

#

oh, that reminds me

half sapphire
#

so there is no way to make this only show 1 message on systemchat?

        HostageUnit = _this select 0; 
        private _damage = _this select 2; 
        private _hitSelect = _this select 1; 
        if (_damage >= 1) then {[format ["fired"]] remoteExec ["systemChat", -2]; 0.7};}]] remoteExec ["addEventHandler", HostageUnit];
granite sky
#

That's bad code anyway. You need to explicitly return nil if you're not adjusting the damage.

half sapphire
#

damage gets set to 0.7 in this example. as bad as it may be.

granite sky
#

wait

#

Are you intending it to show a maximum of 1 message per hit, or one message forever?

half sapphire
#

what i want is the EV to run code in it only once. the example is a test to try and figure out htf to.

granite sky
#

In that case just remove the event handler when the case is triggered.

#

You can remove the event handler from inside the event handler.

half sapphire
#

yeah i've tried that. then the unit is vulnerable while on the ground incapacitated.

granite sky
#

You want to ignore the whole triggering hit but only fire the message once?

half sapphire
#

i guess i could live with that. but man this is full of it. there is too many welcome to arma moments here lol

granite sky
#

This reminds me

#

@meager granite You managed to generate cases where the target-local handledamage calls were spread over multiple client frames, right?

half sapphire
granite sky
#

Ah right, you'll be wanting the answer to the question above too then :P

half sapphire
#

i did manage to do this.. but the unit also has an addaction to join group... then it gets so much interesting.

granite sky
#

If you want the unit to be invulnerable then allowDamage false probably works.

half sapphire
#

IF i make the unit join then leave, "everyhing" is golden, swtiching locality messes it all up.

granite sky
#

Although I can't guarantee that this works mid-frame.

half sapphire
#

its the code i show you the other day, im just trying to make it less bad.

#

if i can get the EV to not fire for every hitpart i'd be half way done. or maybe not. i don't even know anymore.

granite sky
#

you can't do that.

half sapphire
#

from what i remember testing, if you remove the EV before the rest of the code, then the rest of the code doesn't run. if i do it after, the code is run for every hit part.

granite sky
#

Nah.

#

It'll complete the current EH code block.

#

Second part I'm not sure about.

#

Worst case you can do an explicit timed lockout.

#

Check at the top of the EH whether the target is under lockout.

meager granite
granite sky
#

hmm

#

I guess the question is equivalent to whether Arma determines the selection hits on the shooter side or the target side.

#

Although I guess it could forward the list of selection/damage results in one lump.

half sapphire
#

in the example i've made, it fires for basically every hit point, or at least i get about that amount of systemchats. i just can't belive there isn't a way to make it fire for "overal damage". i did try _selection "" in some checks but i don't know if im using it wrong or wtf is going on.

#

feeling like getting a punching bag right now.

granite sky
#

_selection == "" will fire twice for each hit. One target-local and one shooter-local. They are not easy to distinguish.

meager granite
#

Wish we had that shooter-side HandleDamage or at least an event handler without modifications

half sapphire
#

is it the only EV that can keep a unit from dying? i.e allowdamage false. ?

granite sky
#

I have a non-replicable issue with players going from live -> dead with a single bullet (despite a two-frame lockout) and I had the dumb idea that this might be because the handleDamage calls are getting separated by the networking under pressure.

half sapphire
#

or can hit and dammage do the job? if so, idk how.

granite sky
#

I think Hit occurs after HandleDamage? Not sure though.

#

It specifies that it won't trigger on a kill, which would suggest that.

#

actually god knows how that spaghetti works...

meager granite
meager granite
#

It won't have any data about which hit parts got the damage though, you need some kind of accumulator for that

#

But even _hitIndex < 0 is not ideal because there two shooter local events for bleeding and something else

round scroll
#

is there a way to convert a unit to an agent? A friend has a mission with 36 ambience AI standing around that don't need to fight. I believe that making them agents will save some resources, but without a way to convert the Eden defined unit to an agent it's a bit moot

granite sky
#

It's possible, but tricky, and I'm not sure it gains you anything beyond disableAI "ALL".

crude sky
#

New to scripting, trying to parse it out from a search here. My goal is to (1) disable thermals on goggles/helmets and (2) disable them on vehicles in Antistasi - meaning I can't just do the ini code in a vehicle in editor as they spawn as the game progresses.

The former I achieved with #arma3_scripting message this code here. However, it does not work on a Ifrit GL. I have to use vehicle player disableTIEquipment true; which does work - but only for the vehicle I am in. If I spawn another ifrit, get in it, then thermals come back.

I'm flying blind given ignorance of scripting, but I've tried replacing _person action with _turret or _vehicle and no luck.

half sapphire
# meager granite If you only care to know IF something was damaged, then run your code if `_hitIn...

im probably not being clear.

        HostageUnit = _this select 0;  
        private _damage = _this select 2;  
        private _Selection = _this select 1;  
        if (_damage >= 1) then {[format ["%1", _Selection]] remoteExec ["systemChat", -2]; 0.7}}]] remoteExec ["addEventHandler", HostageUnit];

detecting that unit was hit is not the issue. the problem is that i get 1 system chat for each body part hit. this is for testing. but if i call a function or whatever in there, it gets called for each body part.

meager granite
meager granite
half sapphire
#

keep a hostage setUnconscious, give holdAction to revive. basically.

crude sky
#

I'll give that a look into, thanks Sa-Matra. It won't be stressful scripting, I'd hope? Ideally this will only impact players, I don't care about the AI having thermals

meager granite
meager granite
#

run this on server side

crude sky
#

Looks like that did the trick. Spawned one and it's not possible to activate

#

thanks!

meager granite
half sapphire
meager granite
#

I still don't get it. Make unit unconscious if they are about to die?

half sapphire
#

i was thinking about using the EV _damage param to keep it alive but idk, it stops firing if you add pretty much anything when using that method. the syntax inside the EV is a mystery to me... yet the stupid amount of bad code i've put in it does work.

meager granite
#

HandleDamage is simple, it fires for every engine-driven damage on every hit part for every damage event.

half sapphire
#

that i know

#

if i put code in it, it runs it for every hit part for every damage. that i dont want.

meager granite
#

Arguments are info about the damage, result of the function is what damage will be set to the entity. If result is invalid (nil, wrong type, etc.) engine sets its original intended damage instead of result of your code.

meager granite
half sapphire
#

ok, let me show.. get ready to cringe... and please dont yell at me.

RRP_HuEH =  
            {  
             HostageUnit = _this select 0;
             private _damage = _this select 2;   
    
             if (_damage >= 1) then {
                  
                  {HostageUnit allowDamage false; HostageUnit setUnconscious true; HostageUnit removeAction 1;} remoteExec ["call", HostageUnit];  
                  [west, "Hsave", ["The Hostage has been Shot! Hurry!!", "SAVE HOSTAGE"],   
                  HostageUnit, "ASSIGNED", -1, true, "heal"] call BIS_fnc_taskCreate;  
                  [] spawn RPR_HostageCountDown; //this is a countdown with stuff.. does work regardless of EV. 
                  [HostageUnit,  
                  "Revive hostage",  
                  "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",  
                  "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",  
                  "_target distance _this < 2",  
                  "_caller distance _target < 2",  
                  {_caller playMove "AinvPknlMstpSnonWrflDr_medic1";},  
                  {},  
                  {  
                  {HostageUnit allowDamage true; HostageUnit setUnconscious false; HostageUnit setdamage 0;   
                  HostageUnit PlayMove "UnconsciousOutProne"; HostageUnit enableAI 'anim';} remoteExec ["call", HostageUnit];  
                  },  
                  {_caller switchMove "Acts_Accessing_Computer_out_short"},  
                  [],  
                  5,  
                  100,  
                  true,  
                  false  
                  ] remoteExec ["BIS_fnc_holdActionAdd", -2, HostageUnit];  
                  };  
            };
publicVariable "RRP_HuEH";

[HostageUnit, ["HandleDamage", {_this call RRP_HuEH}]] remoteExec ["addEventHandler", 0, true];

i know, i've already been told thats bad code..

#

now how do i get my bad code to NOT fire for every hitbox that gets damage.

meager granite
#

Where are you executing this from?

half sapphire
#

server run.

#

script-

#

oh wait. for testing right now the console.

meager granite
#

Script file? Some debug menu that makes server run the code during gameplay?

half sapphire
#

its a task. with a hostage. if enemy spots you hostage gets shot and you have 5 minuts to get to it and revive it. whole task script is run on server. that bunch of crapy code works. i still have to figure out some locality issues (the units joins player group and everything gets weirder). but none of that matters if i can't make the code only fire once.

meager granite
#

Script context matters a lot and figuring out why and where to use remoteExecs will help you solve the locality issues

#

Where do you intend to run this script in the end?

half sapphire
#

server

#

get this fricky part. if i make the unit join group... the thing just works.

#

but probably cos i get ownership. but im willing to bet other players get the issue then. at least ones that are not in my squad.

half sapphire
#

the last thing i've tried.. and it only makes the whole thing more noob code like, is to _pickone = selectRandom _selection then {all that code} forEach _pickone. it did not like it.

meager granite
# half sapphire i get that. but i can't even get the systemchat message to only display once. so...

Have this in init.sqf:

HostageUnit addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];

    // If new damage is about to be big enough AND unit is not unconscious yet, means its time to make them unconscious
    if(_damage >= 0.7 && {lifeState _unit != "INCAPACITATED"}) then {
        _unit setUnconscious true;
        ["Hostage is down!"] remoteExec ["systemChat", 0];
    };

    _damage min 0.7; // Never exceed 0.7 damage for any hit parts
}];
#

init.sqf will add this code on all clients including new ones that join later

#

HandleDamage calls where unit is local so this will make sure your code will run regardless of hostage locality

#

EH return of _damage min 0.7 means unit will never really die, damage will never go above 0.7 no matter what

#

lifeState _unit != "INCAPACITATED" prevents your setUnconscious from running several times

#

Also changed remoteExec's -2 to 0 because server might be a player too

#

This setUnconscious code bit will run where HostageUnit is local at that time thus you need remoteExec there to do your chat message on all clients

granite sky
#

missing a semicolon.