#arma3_scripting

1 messages Β· Page 143 of 1

molten yacht
#

wait no

#

I'm silly

#

ignore

acoustic abyss
#

I would like to:

enableEnvironment false;

On the player when they enter a trigger. But don't Eden editor placed triggers execute their onAction globally? Would I have to remoteExec it?

#

I have no easy way of testing this multiplayer, so would like to hear from someone with experience...

fair drum
#

they execute locally or on server, not the same as global like an init field.

also to test for multiplayer on your PC, turn off battle eye and hit start game a second time. 2 instances will start and you can use the second one to test

ornate whale
#

Is there any other way to set multiple fields in an array given by a reference?
```sqf
_target = (object getVariable "VARNAME") select 1;
_target set [5, false];
_target set [4, time];
_target set [3, 0];
_target set [2, 0];
_target set [1, 0];

acoustic abyss
fair drum
ornate whale
fair drum
#

your edit now makes it that way

#

now all you do is reassign _target to the object namespace var

#

after you do your sets

ornate whale
#

The set command affects the original array too. I understand it is like a pointer, not a value. But using a pure assignment treats it as a value.

fair drum
#

oh okay i see what you are asking

#

you want reduce the amount of sets? and use an array to set them?

ornate whale
#

And since it is a subarray, setVariable is probably useless.

fair drum
#

not currently.

ornate whale
#

That is probably what I need.

#

I could just take the whole array, adjust some elements and re-setVariable it, but I would need to write my function for it. πŸ˜„

#

And I am lazy.

#

I am going to stick with sets. πŸ˜„

acoustic abyss
#

I'm teleporting players between ladders using:

player action ["ladderUp", ladder_1, 0, 1];

In a trigger. But the character first needs to 'dismount' the ladder before mounting the new one. I'd like to minimize the visual bug of characters dismounting and falling to the next ladder. Is there a specific method/command of skipping or speeding up this animation? PS I'm aware of actionNow that is in the dev branch.

thin fox
#

Is there a right way to remote call a "createMarkerLocal" to a group?

granite sky
#

A group might have multiple units with different locality.

#

Depends what you're trying to achieve.

thin fox
#

Well, I want to call it inside a addAction, available only to the leader of the group. When the leader uses the action, I want to spawn a marker that's only visible to this group, for example a "Respawn" marker.

granite sky
#

Is the group membership permanent or does it change?

thin fox
#

permanent

fair drum
#

you can always create the markers globally, then hide them for everyone but the group units as well

fair drum
#

yes, local version

thin fox
warm hedge
#

setMarkerAlphaLocal

#

Nearly all marker setter command has local variant

thin fox
#

I know, I mean, the whole process

molten yacht
bleak gulch
manic flame
#

is BIS_fnc_showSubtitle local?

warm hedge
#

Yes

manic flame
#

Thanks

young yacht
#

Hey anyone know how to get the lastest all-in-one config for A3?

warm hedge
young yacht
#

Thanks

prisma kraken
#

Is their a script to add people to / fill a vehicle?

acoustic abyss
ornate whale
#

Is there any single command that will find and filter out all enemy units within a radius for me, without seeing or otherwise detecting the enemy units? There is targets command, but it only finds those units which are already known to the asking unit.

indigo snow
#

Also pit them against each other in combat

cosmic lichen
ornate whale
fair drum
ornate whale
#

Many thanks, I figured that the nearEntities returns even crew units, but you have to specify that you are looking for Cars.

#

Reason why I am looking for a native solution is that I will have to call this function often, so I want something performant.

fair drum
#

2.18 syntax should help with most of that soon

formal stirrup
#

does the eventhandler onKeyDown return multiple keys if multiple are pressed? Or does it fire the eventhandler for each key

formal stirrup
#

so joever

#

Any other way to detect inputs that can detect multiple at a time

fair drum
#

what are you trying to do? maybe we can figure out a workaround

formal stirrup
#

Got a system for movement, it uses keyDown and keyUp to move, Currently it works fine with moving in one direction but moving diagonal has proven difficult while only detecting one input

hallow mortar
#

You can use inputAction to detect the state of the movement inputs and something something maths now it's a direction

cosmic lichen
granite sky
#

I guess you'd need an eachFrame to handle the movement.

cosmic lichen
#

Then check if both flags are set.

#

Isn't there a key hold eh?

granite sky
#

Not that I've seen.

formal stirrup
granite sky
#

I've always set the flags in keyDown/keyUp and then done the calc in eachFrame.

formal stirrup
#

Alright, I'll try that

cosmic lichen
#

That was my idea.

granite sky
#

If it's proper keybindings then you could skip the keyDown/keyUp and just use inputAction in the eachFrame, I guess.

formal stirrup
#

Not proper keybinds sadly, otherwise I would prob get around this

bleak gulch
#

if keyDown / keyP detected appropriate key and assigned inputAction, then turn the PFH on (or add a task to the PFH queue). Scanning inputAction each frame even if the user doesn't push the key is not good IMO.

cyan dust
#

Good day. Is there a way to get array of all modules on map? Tried

allMissionObjects "Logic";
player nearEntities ["ModuleHideTerrainObjects_F", 30000];

No luck so far

granite sky
ornate whale
#

Which projectile or weapon class attributes can I use to determine the sound intensity or sound range of a gunshot or explosion? Thanks

fair drum
formal stirrup
#

Exactly what i've done actually

ornate whale
#

Is there any event handler that fires when player switches a weapon?

fair drum
#

bet you its the ^ on the setVectorDirAndUp line that is messing it up

#

and no _x?

#

did it copy paste right?

#

i still bet its the ^

little raptor
fair drum
#

yeah i think so

little raptor
#
onEachFrame {
{
_x setPosASL ((getPosASLVisual plane1) vectorAdd [(forEachIndex+1) * 30, (forEachIndex+1) * 30,0]) ;
Γ— setVectorDirAndUp [vectorDir plane1,vectorUp plane^];
_Γ— set Velocity velocity plane1;
} forEach [plane2,plane3,plane 4];
} ;
#

Two of the xs are weird

fair drum
#

eww, still doesn't copy right. but it looks like the space between set and velocity is a problem too

little raptor
#

Yeah that too
I'm on mobile so it doesn't do syntax highlighting for me rn meowsweats

fair drum
#

also a problem between plane and 4

#

i think this is the author's intended:

onEachFrame {
    {
        _x setPosASL ((getPosASLVisual plane1) vectorAdd [(_forEachIndex + 1) * 30, (_forEachIndex + 1) * 30, 0]);
        _x setVectorDirAndUp [vectorDir plane1, vectorUp plane1];
        _x setVelocity velocity plane1;
    } forEach [plane2, plane3, plane4];
};
#

try that

granite sky
#

needs underscores on the forEachIndex

fair drum
#

youtube apparently does not like pasting code in the description lol. I bet it removed _ as well

leaden ibex
#

The "Argument local" on wiki means what exactly?
That if I want to run it on a let's a projectile, it has to run wherever the projectile is local?
Or can anyone run it if he has a reference to this projectile?

hallow mortar
#

It means it must run on the machine where the argument is local.

leaden ibex
#

Copy that, thanks

hallow mortar
#

Note that projectiles are a bit of a special case for locality, because some types of projectiles have separate copies on every machine, with only the owner's copy actually being real. So you can't really use remoteExec with them or pass references between machines.

leaden ibex
#

copium this will be interesting haha

#

I would assume that projectile would be local to either whoever pressed the trigger, or the server

hallow mortar
#

The shooter's copy is usually the real one, yes

thin fox
#

is it okay to remote exec like this?

fair drum
leaden ibex
gleaming rivet
#

We did a massive battle scene with around 200ish present and players, 1 HC.
Server FPS took a huge dip, but it was awesome

hallow mortar
#

Yes. Each machine has their own separate copy, like I said.

indigo wolf
#

yo how do i remoteexec a function but spawn it? like i have a function named "MOS_spawnparty" and i want this function to be remote exec'd but in spawn so that the rest of the code in that block gets processed instead of waiting for the "MOS_spawnparty" to be completed

#
// some code here
=> remote exec the function "MOS_spawnparty" here
// some other code running while that function is being executed``` i dk if u understand what im tryna say
hallow mortar
#

It is already like that by default

#

remoteExec doesn't wait for the function or command to be completed on the target machine before allowing the local script to proceed. (It would actually be impossible to do that, because JIP clients don't even run the remoteExec'd script at the current time). It doesn't wait for any kind of callback at all, it just transmits the instruction and that's it, job done.

indigo wolf
#

then why remoteexec is bad and people say not use much?

granite sky
#

Well, there are plenty of bad or plain wrong ways to use remoteExec

#

That doesn't mean you shouldn't use it. It means you should understand what you use.

hallow mortar
# indigo wolf then why remoteexec is bad and people say not use much?

remoteExec isn't inherently bad. It just creates network traffic - messages being sent over the network. If there are a lot of remoteExecs being sent, that's bandwidth and network processing being used for handling that instead of other traffic that might be more important. So generally, you want to be judicious with it and not overuse it.
It's also easy for less experienced scripters to end up using remoteExec in scripts that are already being executed globally, or for commands that already have global effect and/or global argument, which is straight-up unnecessary and can cause problems due to duplicate commands.

#

Like, remoteExec'ing one function is fine. But if you get to the point where you're remoteExec'ing 5 commands in a row in a loop that runs every second, you should probably run that loop locally on the clients instead.

indigo wolf
#

i am looking at code which has lots of remoteexec within it that is run so i am trying to put it all together into 1 function to remoteexec as this function will be made available to all clients to increase performance. but these set of codes are executed in spawn so i was wondering if remoteexec has spawn similar to remoteexeccall

hallow mortar
#

remoteExec runs the specified command or function in a scheduled environment, like spawn does. That's why remoteExecCall exists - it is the unscheduled counterpart to remoteExec. In terms of scheduling, these two are both the same:

[_argument] spawn my_fnc_function;
[_argument] remoteExec ["my_fnc_function"];```
Things _within_ the spawned/remoteExec'd function will be executed in order as normal; other scripts will not wait for it to complete. If you want to make more separate threads within the function that the function itself won't wait for, you still need to use `spawn` to create new threads.
leaden ibex
gilded niche
#

Hey, do anybody know how to make ai in apcs turn out? In Arma 3

leaden ibex
#

apcs turn out what?

gilded niche
#

Like this @leaden ibex

leaden ibex
#

ah, so NPC

leaden ibex
gilded niche
#

Thanks!

leaden ibex
#

ah, that might not work

#

not sure, you might need to call it for everyone inside

#

just now noticed it has SQS around it

gilded niche
#

Yeah the error code it's saying is " vehicle: Type Nothing, expected object"

warm hedge
#

Even though the description tells you setBehaviour is a better way to do

gilded niche
#

Ah ok

#

I am very co fused

#

Confused*

gilded niche
warm hedge
#
group1 setBehaviour "SAFE"```
leaden ibex
gilded niche
#

It's still not working πŸ˜•

#

Well it is what it is I appreciate the help giys

#

Guys*

warm hedge
#

What you've done and how it doesn't work is my question then

gilded niche
#

I nameD the squad composition group 1 and I type your code and it says it missing ";" and vendors I place it it's still saying the error

warm hedge
#

group 1 is not group1

gilded niche
#

Yeah I meant "group1"

#

Lemme take a photo rq

warm hedge
#

Why photo

#

Why don't you just copy and paste the code

gilded niche
#

Nvm you right

#

The code work

#

But the units are still not turning out

hallow mortar
#

Whether the AI will want to turn out is partly controlled by the vehicle's config, and heavily controlled by their group behaviour mode. In general they'll be OK with turning out when their group behaviour is set to Careless; sometimes Safe will do it depending on the vehicle. Usually they prefer to turn in when in Aware or Combat mode.
Setting them to Careless has...some drawbacks, but it can be fine if they're not expected to fight.
Setting them to Safe is OK, if the vehicle is set up for that, because they'll automatically switch modes when entering combat, so they can still fight properly...but they'll automatically switch modes when entering combat, so they won't stay turned out.
It's hard to force them to stay turned out if they don't want to.

outer bay
#

And this way I don't need to use remoteExec, even within the event handler?

#

If I want to display some intel on a pub zeus server without using remoteExec (because it's a blocked command), I presumed a simple example would be something like this?

"showIntel" addPublicVariableEventHandler
{
    player createDiaryRecord ["Diary",[
        "Mission Intel",
        "some mission intel here"
    ]];
};
showIntel = true;
publicVariableSerer "showIntel";

Where I could load this into an invisible helipad comp and place it during an active zeus session?

#

I saw in a tutorial they showed the addPublicVariableEventHandler code going into a server init, so I hope it works running it from an object init during live gameplay

#

sort of a shot in the dark because I have really no idea what this is going to do lmao

#

I guess there is no way to show intel to all players in a pub zeus server via scripts

fair drum
#

@outer bay are you allowed to hit the server, local, and global exec buttons in the debug? if so, you don't need to remoteExec anything, just use those buttons

#

also, just choose a public zeus server that allows either remote exec or allows composition inits

#

or better yet, make your own public zeus server with the settings you want

outer bay
neat bloom
#

Hello, is it possible to make bots on vehicles move not through the roads, but just towards the point? For example, even tanks like to move through the roads, so is it possible to make them move through forests?

warm hedge
hallow mortar
#

AI are more willing to go offroad when in combat mode. Obviously that's not ideal if you need them to not be in combat mode for some other reason, though.

neat bloom
meager granite
#

What's the algorithm to find vehicle seat positions? Checking proxy names?

#

I see there is CPDriver, CPGunner, CPCargo, CPCommander proxies in CfgNonAIVehicles, but how does the game decide to use CPCommander for certain turret? Turret's commander status? I wonder what happens if you have two commanders in config πŸ€”

ivory lake
#

there's a proxyType config parameter

#

can be set in each turret and on the vehicle itself (if you want to change the driver)

#

I don't think cargo proxies can be changed other than cargoTurrets

meager granite
#

What a clunky system

meager granite
#
s1 = createSimpleObject ["I_Heli_Transport_02_F", player modelToWorldVisualWorld [-10,20,5]];
s2 = createSimpleObject ["a3\air_f_beta\heli_transport_02\heli_transport_02_f.p3d", player modelToWorldVisualWorld [10,20,5]];
[getDir s1, getDir s2]
```=> `[0,0]`
I see that `namedProperties s1` and `s2` both return `[...,["reversed","1"],...]`, why are models in different direction then? πŸ€”
#

What does "reversed" means anyway? Model rotated 180 degrees in game?

#

Oh there is also reversed in CfgVehicles

bleak gulch
#

as I understand in the model space the actual model axis can have arbitrary direction and not always matches the model space axis.

thin fox
#

Hello. It seems like this variable it's not passing the data inside this code. Anyone know why is this happening?

granite sky
#

Event handlers don't run in the same context.

#

You're just providing a piece of code to be executed later.

thin fox
#

of course, that makes sense

#

is there any other way to pass the data like this?

granite sky
#

If you use addMissionEventHandler instead then you can pass data in directly.

thin fox
granite sky
#

Yeah. There are other slight differences, like removing the "On".

thin fox
granite sky
#

uh

#

It's pretty similar, just a command instead of a function.

#

And you get the "arguments" parameter which you can use to pass in data.

#

It'll still run the code in a different context.

thin fox
#

well it seems like it's not passing the data at all. If I use an "object" like a trigger directly, it works.
from .rpt:

11:20:38   Error position: <createLocation ["Name", _centerpos, _ran>
11:20:38   Error 0 elements provided, 3 expected
11:20:38 File C:\Users\Murilo\Documents\Arma 3 - Other Profiles\PiG13BR\missions\VR\TEMPLATE_TvT_HALOJUMP.VR\scripts\PiG_halo.sqf..., line 34```
warm hedge
#

And urm how did you do that

thin fox
#

initPlayerLocal

warm hedge
#

I mean your code, that is throwing the error

warm hedge
#

Yes but updated one

thin fox
#

updated ^

warm hedge
#

It has no arguments

thin fox
#

it is possible to pass additional arguments to the EH code via optional param. The args are stored in _thisArgs variable

#

is this that am I missing?

warm hedge
#

Yes

thin fox
#

Can you give me an example? I saw the example 2 but I don't know how to do it in my code

warm hedge
#

addMissionEventHandler is doing it later, as John already said the concept, so it will not recognize any variables outside automatically

#
addMissionEventHandler ["MapSingleClick",{
  _thisArgs params ["_sideParadrop"];
},[_sideParadrop]]```
thin fox
#

updated

sullen trellis
warm hedge
#

No

thin fox
#

well this also works lol

granite sky
#

_pos doesn't exist there, except maybe by accident.

#

need params ["_units", "_pos", "_alt", "_shift"];

storm arch
#
```{
_x = _target;
if (["marker1"] findIf {_target inArea [(getMarkerpos _x), 750, 750, 0, false]} >= 0) then {_target setDamage 1};
}forEach [vehicle0,vehicle1];```Is there a way to have _x and _target work here? _target in the inArea statement comes back undefined
granite sky
#

you meant _target = _x; I think.

storm arch
#

ty

#

im blind

indigo wolf
#

can someone explain what the second line does? - sqf DUMMY_code = { hint "inside dummy code"; }; "DUMMY_code = {};";

#

does it just call the function above?

sullen sigil
#

no it does nothing

indigo wolf
#

so the "DUMMY_code = {};"; is useless?

sullen sigil
#

yes

indigo wolf
#

oh ok thanks

bleak gulch
#
DUMMY_code = compile "DUMMY_code = {}; DUMMY_code = nil;";
ornate whale
#

Can I use an empty define var in preprocessor to expand to an empty string of code? Like this:

#define SOMETHING

#ifdef SOMETHING
#define COND && _x && _z
#else
#define COND
#endif

if (alive _x COND) then {};

If COND is only defined, but empty, it will be just removed from the SQF, right?

sullen sigil
#

i mean
you can just define it as && true regardless

ornate whale
#

This is just a silly example. πŸ™‚ I meant, if I can expand macro to an empty code without any errors or something.

#

I started using it as a way to inject some additional debugging options inside conditions, because I donΒ΄t want to slow down the computation in the release version. So I wanted to know, if it is OK to do so.

warped hornet
#

Does anyone know what would be the easiest way to get an array saved to a file on the server, that I can open in a readable format in notepad or something?

fair drum
#

probably requires an extension. instead, you can copy paste into a file using copyToClipboard str _myArray

hallow mortar
#

You can also use diag_log on the server to write stuff to the server RPT log

hallow mortar
warped hornet
#

That might work, I only need to run it once at the end of OP

#

That is perfect for me thank you

devout geode
#

Anyone know where I can find a persistent crate script? Doing a survival mission for a few friends

finite bone
#

Is there a way to playsound local to a player / to a specific player wiht the same parameters used in playSound3D such as soundPitch, volume, and distance?

gilded niche
#

does the isTouchingGround function still work? Bc when I scripted a heli crash I made it a trigger to activate a task so "isTouchingGround heli_1"

#

But even though the heli is touching the ground it is not initiating the task

warm hedge
finite bone
warm hedge
#

playSound is a LE?

#

If you mean playSound3D, you can set it a local one

finite bone
#

Yea but playSound does not take in sound positions, volume and distance unlike playSound3D

warm hedge
#

Last argument

finite bone
#

Wait I'm just blind sorry πŸ˜…

meager granite
#

Lets start a list of such missing objects so it can be added in bulk

#
  • Invisible object to attach rope to. What the best simulation for it? Current list on wiki has objects with such simulations:
"motorcycle"
"car"
"carx"
"tankx"
"airplanex"
"helicopterrtd"
"shipx"
"submarinex"
"paraglide"
"parachute"
```What's the cheapest simulation to have? Wonder what ACE uses there.
- Invisible objects to attach TO rope. Some invisible `thingx` object?
#

Other things I had in mind recently:

  • UserTexture that is a ground decal
  • Object with nothing but a proxy flag so you can attach it anywhere and forceFlagTexture it
#

Anything else?

#
  • I'd really love to have even larger clutter cutter object. Sure you can make it yourself with simple object now but having it in 3DEN without mods would be very useful.
hallow mortar
#

I'd also love to have invisible copies of the chest rig and tac vest but I guess that's a slightly different thing

meager granite
bleak gulch
# warped hornet Does anyone know what would be the easiest way to get an array saved to a file o...

callExtension + .DLL / .SO with your primitive I/O functions. You can read files, memory, streams, ALCs / LPCs, sockets, pipes, make SQL queries, whatever you want.

RVExtension() is a synchronous function (the next frame won't be rendered / processed until the function returns the control), try to move your job into separate thread and then use callback to return result. It sounds a bit scary but this mechanism opens the doors into the "mature" world of countless posibilites.
https://community.bistudio.com/wiki/callExtension

little raptor
#

* not async

meager granite
#

_fpsCoef = ((time - bis_fnc_halo_para_loop_time) * 20) / acctime; //Script is optimized for 20 FPS
BIS knew how their game ran (Arma 2)

granite sky
# finite bone Isn't remoteExec'ing GE/GA bad?

Sometimes it's necessary. For example, setMass is GE but the propagation is slow, so if you want an object not to kill players within the next few seconds then you have to remoteExec it.

#

but otherwise yeah, if something's GE then you just run it in one place.

sullen badge
#

Is this correct for checking if a unit is west and not player? if ((side _this == west) and not (!isPlayer _this)) then

granite sky
#

you have a double-negative on isPlayer.

bleak gulch
bleak gulch
#

are you referring to SQF or C/C++?

sullen badge
bleak gulch
# sullen badge SQF

I was asking @meager granite πŸ™‚ but it seems he deleted his message (probably found the solution)

meager granite
#

Decided not to bother others and just redo it myself properly later

sullen badge
#

I see

#

So the ! means not?

#

in !isPlayer

meager granite
#

In case somebody will search like I did, rotate vector around axis by amount of degrees:

// Params: [Array (Vector), Array (Axis), Number (Angle)];
// Returns: Array (Vector)
both_func_rotateVectorByAxis = {
    params ["_vector", "_axis", "_angle"];

    private _cos = cos _angle;
    private _sin = sin _angle;
    private _mcos = 1 - _cos;

    _axis params ["_ax", "_ay", "_az"];
    _vector params ["_vx", "_vy", "_vz"];

    // https://wikimedia.org/api/rest_v1/media/math/render/svg/7dc67eaa6d74f6629767726f854a5ff8bf7e5477
    [
        _vx * (_cos + _mcos * _ax * _ax)    + _vy * (_mcos * _ax * _ay - _sin * _az)    + _vz * (_mcos * _ax * _az + _sin * _ay),
        _vx * (_mcos * _ay * _ax + _sin * _az)    + _vy * (_cos + _mcos * _ay * _ay)        + _vz * (_mcos * _ay * _az - _sin * _ax),
        _vx * (_mcos * _az * _ax - _sin * _ay)    + _vy * (_mcos * _az * _ay + _sin * _ax)    + _vz * (_cos + _mcos * _az * _az)
    ]
};
#

Was wondering if this could be sped up with matrix commands

bleak gulch
#

It think it can be optimized even more

meager granite
#

Nice! Share the code please.

bleak gulch
#
both_func_rotateVectorByAxis2 =
{
    params ["_vector", "_axis", "_angle"];

    private _cos = cos _angle;
    private _sin = sin _angle;

   ((_vector vectorMultiply _cos) vectorAdd ((_axis vectorCrossProduct _vector) vectorMultiply _sin)) vectorAdd ((_axis vectorMultiply (_axis vectorDotProduct _vector)) vectorMultiply (1 - _cos));
};
meager granite
#

Good stuff, thanks!

granite sky
granite sky
#

ah wait, I already did this. It's called Rodriguez's formula, right

#

Used in Antistasi's dive bomb code :P

bleak gulch
granite sky
#

It works well in SQF because it cuts down the total command count.

twin anvil
#

giving up here.
tested in debug menu, i havea totally functioning fucntion, and cba settings commands for a mod.
but making it an actual MOD for arma is the most difficult thing ive ever done for any game.

all the guides are missing 1 or 2 bits of info but every other guide says every other guide and packing program is bad.

Does anyone just have a barebones 'empty mod example' i can go off of? Ill understand that, i dont understand any of these guides.

fair drum
granite sky
#

It really is a pain to get started. Mikero and HEMTT have heavy setup requirements. Addon builder command line is just broken.

fair drum
#

hemtt i think is still the best outside of doing terrains

granite sky
#

Otherwise the actual requirements for a working mod is just a config.cpp with a CfgPatches in it.

fair drum
#

also, if you use vscode @twin anvil , there is a remote feature where I can view your code space in real time. i think you can make suggestions too

bleak gulch
twin anvil
# granite sky Otherwise the actual requirements for a working mod is just a config.cpp with a ...

I got the mod to load via the cpp.
i just cant seem to define what it wants to have a callable function in a mod.
Same for the CBA settings. Load in game i can run the contents of the settings file and it works, but every attempt after packing it (tbf ive been using addon builder) it just leaves me with a near-empty addon options list.
Ive seen 3 different commands for both which also drives me mad.

granite sky
twin anvil
#

Cant i just define them in the cpp?

fair drum
#

you can, but you need the cfgfunctions WITHIN the cpp

twin anvil
#

oh yea, sorry, brain scrambled. Yes i do

granite sky
#

Usually the issue with CfgFunctions and mods is getting the file path right.

fair drum
#

so like i said, post what ya gooooooooooot

granite sky
#

Each PBO has a "prefix" which is the virtual path it's placed at when loading Arma.

#

In the addon builder UI it's in the options tab.

granite sky
#

The file paths in CfgFunctions need to include that path.

twin anvil
fair drum
#

i can make you a hemtt template example if that is what you want

granite sky
#

Then in CfgFunctions you do something like this:

class CfgFunctions {
    class myTag {
        class whatever {
            file = "pboprefix\functions";
            class myFunction {};
        };
    };
};

Then the file functions\fn_myFunction.sqf in your PBO is mapped to myTag_fnc_myFunction.

#

HEMTT template example would be neat anyway.

twin anvil
#

im poke at this abit but yeah.
a functioning example would help.
been looking at other mods on the github but ngl, going form no idea how this file structure works to looking at someone's take on a possible way to do it when its flooded with content isnt helping loads. Normally reverse engineering is how i figure this shit out too.

granite sky
#

Usually real mods use opaque macros and black-box build tools so they're not great examples.

fair drum
twin anvil
#

i wanna use it now.
the function relies heavily on a CBA command and i want to use CBA settings.
but as far as i can tell, the settings is just some commands run in preinit (works in post but should be pre). both should (right?) just need me to add CBA as a dependency and include the script macros.

fair drum
#

you can define functions either through CfgFunctions, or by using PREP (in CBA)

#

you don't HAVE to use the CBA framework in order to use their functions btw

#

the framework is there to make managment of multiple addons within a mod easier

#

famework meaning the macro framework

granite sky
#

You can also use the macro framework without having CBA as a dependency :P

#

It took me days to figure out what was going on with the macro framework though. I would recommend setting up a mod manually first so that you understand what the framework is trying to do.

fair drum
#

i'll build him a heavily commented template that I'll put up publicly on github for others in the future

bleak gulch
#

This is very common problem how to start from scratch, define functions etc

sullen badge
#

I'm running an ALiVE mission and want to add an item to all spawned AI of side West

#

I have this in my description.ext
``class Extended_Init_EventHandlers {
class Man {

init = "_this call (compile preprocessFileLineNumbers 'BFT.sqf')";

};

};``

And in BFT.sqf is this:

``private "_this";
_this = _this select 0;

if ((side _this == west) and (!isPlayer _this)) then {

_this addItem 'ItemAndroid';

};``

But it doesn't work. What am I doing wrong?

bleak gulch
#

first off, dump the unit into diag_log instead of adding the item

#

at the very beggining of the BFT.sqf add this

diag_log (format ["[BFT.sqf] _this: %1", _this]);
#

then start the mission, and check .RPT

#

_this must not be null or any

#

after the test, move this line into your if block and repeat. The diag_log should dump only AI units.

#

if everything is ok, the last thing you have to experiment)

#

oh wait what is that???

#
private "_this";
#

that's bad idea to make _this private when it passes the argments from the outside into the fucntion

sullen badge
bleak gulch
#
params ["_unit"];
if ((side _unit == west) and (!isPlayer _unit)) then
{
    diag_log (format ["[BFT.sqf] _unit: %1", _unit]);
    _unit addItem 'ItemAndroid';
};
#

you need to know some basic aspects of SQF and what exactly _this means

#

_this is a magic word typicaly used to pass arguments to the function from it's parent scope

#

Basically it is just a variable like the other ones, but defined by the game engine implicitly like some other variables (_forEachIndex, _thisTrigger, etc).

#

So the primary goal of _this is to PASS the data through the border - between two (or even more) scopes

#

For example

#

"Hello, World!" call {hint _this;}; // _this contains text "Hello, World"
[1, 2, 3] call {hint (str _this);}] // _this contains ARRAY
[4, 5, player] spawn {hint (str _this);}; // _this contains ARRAY with 2 numbers and one object reference

// the script named myshit.sqf receives the data stored into _this variable
[player, damage player, "YEAH!"] execVM "myshit.sqf";
#

you can extract the data from _this if it is ARRAY by using select or # commands. But it's good practice to use param or params for this specific purpose

[player, damage player, "YEAH!"] call
{
    // old way
    private _unit = _this select 0; // _unit is player
    private _dmg = _this select 1;  // _dmg is damage of player
    private _message = _this select 2; // _message is "YEAH!"

    // new way, completely identical
    params ["_unit", "_dmg", "_message"];
};
#

private keyword (or command) is used when you want to isolate the locally created variable from the parent scope:

// parent scope
_x = 1;

call
{
    // same context, child scope
    private _x = 2;
    hint (str _x); // HINT: 2

    _x = _x + 1;
    hint (str _x); // HINT: 3
};

// parent scope again
hint (str _x); // HINT: 1
#

so when you made this:

private _this;

you basically created new undefined variable (because it doesn't receive any value) _this in the local scope and then trying to use it.

sullen badge
#

Jesus this is alot to take in. Thank you so much for taking the time

#

Where is the log saved?

#

Found it

#

Got nothing diag_log in the log

bleak gulch
sullen badge
fair drum
#

@twin anvil

open hollow
#

there is way to change the color of the coordinates references in map. by mod or script?
and any idea where to start lol

open hollow
#

ok i found i can change something with configFile >> "ctrlMap" but it only works in 3den

little raptor
open hollow
#

rcsmap dont have controlsBackground

bleak gulch
warm hedge
#

Did I do what?

past nebula
#

this setUnloadInCombat [false, false];

#

^ will this work to prevent my APCs from unloading before a waypoint

#

do i need to specify the vehicle instead of "this" ?

granite sky
#

Depends where you're running it from.

thin fox
#

Hello. In a dedi server, if a global variable is created inside initServer, it will not be broadcasted to the clients, right?

granite sky
#

use of the word "global" is confusing with Arma.

#

but generally a global variable is global scope but only on one machine. You need to publish it with publicVariable before it's visible anywhere else.

#

The server isn't any different to any other machine in this regard.

thin fox
fair drum
#

you also can do it in one line with setVariable (and also send it to specific machines if you want)

little raptor
#

That would be the main map

#

You can also use the config search feature in ADT, and search for a property with name idd and value 12

gilded niche
#

Can somebody tell me how to make an ai drive their vehicle to their way point when a player is inside their vehicle

#

For some reason the ai would not move to their waypoint when a player is inside their vehicle

granite sky
#

what seat is the player in?

gilded niche
#

Uhh it's whatever the player choose

#

The player will enter any seat

gilded niche
granite sky
#

setEffectiveCommander on the driver might work.

#

you'd probably need to set it again each time a player switched seats.

gilded niche
#

Thanks πŸ™

royal bramble
#

How could convert a base64 string into an image that could be displayed in game?

hallow mortar
#

I strongly doubt there's a way to do it in-game.
Doing it out of game ahead of time, just google a base64 to image converter, there are some online tools. Then plug the resulting image into the Arma image-to-PAA tool to convert it to Arma's .paa texture format.

royal bramble
azure portal
#

I'm not sure how esoteric of a situation this is, but I'm trying to fix an issue with a custom BLUFOR tracking system for my community and for some reason when a player changes units with our class selector (essentially a new unit gets spawned, they take command, and the old one is deleted) they're unable to see the marks from the BLUFOR tracker. Hasn't really been updated in 8 years so probably not the best way of doing things but it's worked until we built our class selector

Note: Apologies for the delete and repeat, I realised the previous message had the wrong code in it and the proper one is just too long for Discord to like so file is attached.

zealous ether
#

Is there a way to check the body armor values via a script? How much protection is offered?

proven charm
azure portal
proven charm
#

well the marker is deleted at the end

azure portal
#

By the way, I apologise since it seems like I did somewhat of a poor job initially explaining that

proven charm
#

its ok but i dunno whats the problem exactly , i bet it has something to do with markers being deleted

azure portal
#

Perhaps...it's definitely weird that it'd be affecting units that the script isn't running on

proven charm
#

well they are supposed to all see the same marker because markers are global

azure portal
#

Okay, hold on. Let me try explaining it a bit better.

Player A is a teamlead so has a marker for the tracker. Player B is a part of their team and so doesn't have a marker.
Player B uses the class selector, Player A doesn't.
Player B loses the ability to see the marker, but everyone else can still see it.

#

So the markers being global, if they got deleted for one person, would they not get deleted for everyone?

proven charm
#

yes deleted for everyone

azure portal
#

But in this case it isn't...it's just not showing up for the one person

proven charm
#

hmm

azure portal
#

That does seem to be the consensus, yeah πŸ˜‚

proven charm
#

which would effect the marker channel, or not

azure portal
#

Doesn't look like it, and we've pretty much got channels locked down in description.ext's so I'm not sure if that'd have an effect πŸ€”

#

Defaults to the marker channel anyways due to the behaviour of createMarker

bleak gulch
#

IMO using callExtension is the best choice for that. There is fast algorythm available on Stack Oveflow.

#

doing the same job on SQF is waay slower.

sullen badge
#

Is it possible to change a groups callsign, that which is displayed in game of a player group via setGroupId?

sullen badge
drowsy geyser
#

is it possible to add tracer rounds to handguns?

proven charm
#

how do you create your groups?

little raptor
#

It basically allows you to draw anything you want in Arma 3. Even another game πŸ˜…

little raptor
sullen badge
proven charm
sullen badge
undone flower
#

follow me for more solutions 😎

gritty parrot
#

Does anyone have a "low cost" script based idea on how to return positions on roads within cities (in a way it does not consume an absurd amount of computation power) ?
The approaches I had in mind were either making use of bis_fnc_findSafePos (which I would like to avoid) or "spraying" points in a circular pattern and check if those positions are on roads. Any good ideas around otherwise?

zealous ether
#

@gritty parrot that is a hard one. Find safe position though is one of my favorites.

stable dune
granite sky
#

probably shouldn't though :P

gritty parrot
zealous ether
granite sky
#

Example:
getNumber (configfile >> "CfgWeapons" >> _className >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Chest" >> "armor");

zealous ether
#
`getNumber (configfile >> "CfgWeapons" >> _className >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Chest" >> "armor");``` sort of like that?
gritty parrot
granite sky
#

you have a floating backtick.

stable dune
gritty parrot
granite sky
#

We just used nearRoads because we didn't have distance preferences.

gritty parrot
gilded niche
winter rose
#

would you happen to… have AI mods?

gilded niche
zealous ether
#

Hmm... Are you sure that's all it does. 🀣 You would be surprised at some of the stuff that happens behind the scenes. Why not try it in vanilla first and then come back.

gilded niche
#

It's AI Avoid Prone mod I'm pretty sure it only does that

#

But I'll try it vanilla

granite sky
#

Are the AIs in a different group to the player?

#

huh, AMV-7 Marshall won't drive with the driver set as effective commander.

#

Arma things :/

gilded niche
#

I'm doing a task where a player enters another ai vehicle which is in a convoy

granite sky
#

Ok, make the driver the group leader as well as effective commander. Seems to work.

#

Although this assumes that the vehicle crew has their own group, which may not be the case for a convoy. That case might be impossible.

wide wharf
#

Hi, I wanted to create a type of interaction on arma 3 but I don't know how to do it because I hadn't seen it before. If I remember correctly, it replaces the wheel interaction menu (not the ace one) and is installed directly on a vehicle door, for example, to open it or start the ignition by aiming at a vehicle's ignition key.

fair drum
bleak gulch
#

The UI is attached to the object directly

manic flame
#

Hello, is there a way to make it so a player unit doesnt trigger wake up for dynsim?

Use case would be aircrew working with ground forces, i dont want the pilots to trigger wake up for the enemy ground units for performance reasons.

#

could it be

player triggerDynamicSimulation false;

?

winter rose
#

nope, players always trigger dynSim

hallow mortar
#

It is possible to make your own dynamic simulation system that lets you exclude units from it

#

Keep in mind though, excluding pilots could mean they end up spotting and trying to engage AI that aren't being simulated, which would be bad

gilded niche
granite sky
#

When they switch you may have to do it again.

#

I only tested commander seat though.

gilded niche
granite sky
#

From the limited information you've given me so far, it seems most likely that the problem is the convoy. But I don't know much about the situation you're testing.

#

If you provide a minimal replication case then it's much more likely that I can find a working solution for you.

velvet knoll
#

@still forum had someone recommend I reach out to you about this - having an unexplained issue while trying to run a script that has been used successfully before - it is now causing the entire game to crash. I've included the RPT and mission files in case you have time to take a look. The gist of the code is found in the introvideo file and is also pasted below. It is currently executed in the onPlayerRespawn file.

 private _video = ["images\newsreel.ogv"] spawn BIS_fnc_playVideo;
0 spawn {
    sleep 5;
    hint "Scroll and press your use key (MMB, Enter) to skip the cutscene...";
};

player addAction [
    "Skip Video",
    {
        missionNameSpace setVariable ["BIS_fnc_playVideo_skipVideo", true];
        player removeaction _this#2;
    },
    [],
    100,
    true,
    true,
    "Action",
    "_target == _this",
    0
];

#

If anyone else has any ideas it would be greatly appreciated

granite sky
#

That's a ridiculous modlist :/

velvet knoll
granite sky
#

When does it crash though? When the video starts or when you hit the skip action?

velvet knoll
#

when you load in to the scenario after chooseing a slot

#

the modlist really isnt very intensive, its only a little over 60. And a good majority of those are very small.

granite sky
#

It runs the video code at that point?

velvet knoll
#

correct

gilded niche
granite sky
#

yeah good luck with that then. The convoy logic is just one layer of broken shit too many.

velvet knoll
#

especially if you use any AI mods

gilded niche
#

Ah, I deleted all my ai mods after someone pointed it out

granite sky
#

It's busted in vanilla.

gilded niche
#

Should I use the convoy module?

granite sky
#

I just avoid it personally and write my own monitor scripts, but that's a lot of work if you're just making a mission.

gilded niche
#

Ah ok, also is their any convoy mods I can use?

granite sky
#

I don't know. I'd expect them to trip up with a player in the gunner/commander seat anyway.

gilded niche
#

Ah alr, well I appreciate the help alot thank you guys!

#

πŸ™

granite sky
#

as a super-dumb alternative you could consider not actually putting the player in the vehicle and having a camera follow it instead.

#

but if you want the player to fire vehicle weapons then that's not going to work.

gilded niche
#

Well it is what it is, I'll just keep the player as a passenger

molten yacht
#

Between the following methods what's the best way to do a bunch of simple objects that's JIP friendly:

  1. something in each object's init
  2. big long sqf that I have to manually generate and place
  3. Something in a gamelogic's init (using its position, maybe?)
    X) something else I don't know about
#

the JIP friendliness is really important.

fair drum
#

global simple object creation on the server

past nebula
#

trying to set up mobile vehicle spawn points for multiplayer

#

i'm getting an error message from this init.sqf

#

trying to figure out what the problem is

#

when i start the server, i spawn in normally and i can hear game sounds and even move the vehicle i spawn in but i'm still stuck with the loading screen

#

this is what's inside the respawnmkr.sqf files

#

and the description.ext

molten yacht
past nebula
#

missing ; in line 3, i guess i'm not sure where that's supposed to go

warm hedge
#

execVM not exec VM

molten yacht
#

setPosASL does network traffic, so having a for-loop moving an object with a bunch of SetPosASLs is a bad idea, correct?

#

I'm trying to figure out how to get around this.

granite sky
#

Objects changing position causes network traffic.

molten yacht
#

Is there any way to smoothly move a non-physx object without that kind of spam?

#

In single player, it's easy to go "heehoo repeatedly bump the z coord 800 times"

#

that won't do at all for MP

granite sky
#

It's not necessarily any worse than any other method of moving the object.

#

Aside from having it local everywhere.

molten yacht
#

Well, as opposed to just having it move instantly.

#

jank in the name of performance

past nebula
granite sky
#

If you use a correctly calculated setVelocity as well then it's less likely to jump if the network perf is bad. Same principle as setVelocityTransformation.

molten yacht
#

Will that work for non-physx?

#

I'm having a bridge move into place.

granite sky
#

Bridges are problematic because they have low simulation rates.

#

IIRC you need to attach them to an object with higher simulation rate and move that instead.

molten yacht
#

....But does setVelocity actually do anything to non-physX?

#

Like say, a building.

#

I have never tried.

granite sky
#

It probably does with airplane sim type.

#

but in this case it's the simulation type of the object you attached the bridge to that matters anyway.

molten yacht
#

Hmm. Something that won't fall back down would be key.

devout surge
#

Hi!, im having a little confusion, i need to check that a group of ships(the names are "Bote1", "Bote2", "Bote3", "Bote4","Bote5", "Bote6", "Bote7", "Bote8") are destroyed, and that should finish the task, can anyone help?
if (!isServer) exitWith {};
[true, ["Objetivo", ""], ["Tarea De Ejemplo", "Tarea De Ejemplo", ""], objNull, "CREATED", 10, true, "rifle", false] call BIS_fnc_taskCreate;

fair drum
granite sky
#

You said the names are BoteN but you're checking for Bote_N

#

oh, different people :P

fair drum
#

Yeah you right.

#

Damn people not using underscores for numbering!!!

somber radish
#

Hey I got an issue with a very simple crate config, not showing up in zeus.
this is the config:

class CfgPatches
{
    class Pattys_Abilities
    {
        
        name             = "Pattys Special Abilities";
        author           = "Patty (Design) & Tally (Code)";
        requiredVersion  = 2;
        requiredAddons[] = {"A3_Functions_F", "CBA_settings", "A3_Supplies_F_AoW"};
        units[]          = {"PSA_resupplyCrate_F"};
        weapons[]        = {};
    };
};

class CfgVehicles
{
    class B_supplyCrate_F;
    class PSA_resupplyCrate_F:B_supplyCrate_F
    {
        scope         = 2;
        scopeCurator  = 2;
        author        = "Tally";
        displayName   = "[ABILITIES] Resupply Box";
        
        class EventHandlers
        {
           init = "_this call PSA_fnc_initNoManCrate";
        };
    };
    
};

Anyone got an idea why it is not showing up in Zeus?

stable dune
#

Make sure you have in game master module selected all add-ons (including unoffial ones).
You can unlock more using the Manage Addons module.

All addons (including unoffial ones).

somber radish
#

Hmm, I have another addon already loaded that is unoficial, and it does show

#

uh

#

Ok

#

strange

#

It worked

stable dune
#

You're welcome

cyan dust
#

Good day. Is there a way to get all the file names inside the specified folder? We do have fileExists so some sort of file management is available I believe?

warm hedge
#

Do you mean folder in a PBO or?

cosmic lichen
#

To get access to the real file system you need something like Pythia and write it in python. Or an extension.

cyan dust
#

Got it, thanks

timber shore
#

how would I disable the V (vault) key in a keyHandler?

cobalt path
#

question, is there any reason:

mfresizeeh = addMissionEventHandler ["EachFrame", {player setObjectScale 1.15}];

doesnt work on the server, but works in SP?

warm hedge
#

In DS or local MP? If former no it won't because player is nobody there

cobalt path
#

What do you mean DS or local MP?
I also tried giving me or AI a variable and replacing "player" with variable, but still nothing happens

stable dune
cobalt path
#

I am confused by what do you mean?

stable dune
#

where do you add current event

cobalt path
#

I am currently in zeus using Execute module to do it. Naming soldiers with "name" = _this; and executing the code globally

#

works with all other scripts like animation speed

warm hedge
#

Dedicated or you host your game

cobalt path
#

dedicated

#

rented and paid for

warm hedge
#

And you run that on the server?

cobalt path
#

I tried local, server and global

warm hedge
#

As I said make sure you're executing it in client computer

cobalt path
#

commands like setAnimSpeedCoef works no prob, no idea why setobjectscale does not want to play along

#

oh

#

but global should still do it

#

as global executes it well, on server and each client

#

in SP, it works fine

#

I will try local MP

#

Works fine in Local MP

warm hedge
#

Hm... πŸ€”

cobalt path
#

could there be some sort of limitations imposed by server? but if that would be true, than setAnimSpeedCoef wouldnt work

warm hedge
#

Honestly I've never heard DS doesn't support it. Probably it is an issue to have that command on live object though

cobalt path
#

I will try KJW height mod, to see if that will works, but that is really less than ideal. I am really very confused

#

If I attach an object, it starts working, but I need to do it on live. Also if its just sim disabled it still doesnt work

little raptor
#

If by "SP" you mean 3den SP it should explain why

little raptor
cobalt path
#

It works in Editor and Local Multi

#

But doesnt work on Dedi

#

okay so as I see it, its impossible

#

shit

timber bough
#

Dumb question but does anyone know how I can get into arma 2.18? do I need to pick a different branch on steam or how does that work? I'm on 2.16 right now

little raptor
timber bough
#

uh on the website it said dev branch was 2.15 πŸ€”

#

I'm doing it now tho

#

but that was what I checked first, it said 2.15

#

THANK GOD FOR FAST INTERNET 11GB IN LIKE 20 SECONDS HAHAHA

little raptor
timber bough
#

My dev build shows 2.17.15

warm hedge
#

Correct, 2.17 is candidate for 2.18

little raptor
#

Where's 2.15? thonk

warm hedge
#

...Wait

little raptor
#

2.17 dev becomes 2.18 stable

winter rose
#

technically 2.15 doesn't exactly "exist" as 2.16 was but an update for the RF CDLC, everything was moved to 2.17/2.18

timber bough
#

hmm the landAt command I was looking to see if would work doesn't actually work, you can't land a vtol aircraft on a helipad

#

I want to land an F-35b in VTOL mode in a given helipad, but as soon as I run that command, it automatically leaves VTOL mode.

timber bough
#

Alright, can anyone tell me what I'm doing wrong here please?

stable dune
#

Just snippet from wiki.
You may have an issue because it's not an airport.

timber bough
#

it's literally on the biki

#

Helicopter/VTOL aircraft

stable dune
#

Yeah 2.18, sorry.

timber bough
#

am I not on 2.18?

#

@little raptor @warm hedge

stable dune
#

If you have dev branch on use , then you r

timber bough
#

i'm on dev branch

#

vtol aircraft won't land on a helipad on VTOL mode

warm hedge
#

Apparently it's very bugging

timber bough
#

alright so it doesn't actually work

warm hedge
#

Just tried with action and somehow it ups the gear if the camera is close to the plane, will lower it when it goes away

#

landAt example 2 is workaround you might want to use, it looks working, at least, seems to

timber bough
#

which is fine, I use velocitytransformation to move stuff around cuz Arma is too brainless for it
BUT
I can't get a damn landing gear to go down on ai controlled planes

_id = addMissionEventHandler ["EachFrame", {
    f35 action ["LandGear", f35];
    systemChat str time;
}];
#

am I doing something wrong here?

warm hedge
#

As I said, it is buggy

timber bough
#

i mean even without the landAt thing that doens't actually work

#

just getting the damn landing gear down

warm hedge
#

I mean without action but landAt

timber bough
#

landAt doens't work at all for me, the f35 just goes to a near airport

warm hedge
#

See example 2 closely

timber bough
#

what about this

_id = addMissionEventHandler ["EachFrame", {
    f35 action ["LandGear", f35];
    systemChat str time;
}];
warm hedge
#

What about what

timber bough
#

What is landat example 2? you mean landat [helipad, "land"]?

timber bough
warm hedge
#

As I said it is buggy and it doesn't work, as I said, once again

warm hedge
timber bough
#

This one? Doens't work

_hpad = "Land_HelipadEmpty_F" createVehicle [0,0,0];
_hpad setPosASL _pos;
heli landAt [_hpad, "LAND"];
#

Just any landing pad, doesn't work for VTOL aircraft

warm hedge
#

It is Example 3

timber bough
#

That won't land as VTOL

warm hedge
#

I thought your goal right now is just let the gear down?

timber bough
#

Yeah but that closes the VTOL fan nozzles and unvectors the rear nozzle too

#

I need to to have nozzeles down and landing gear down

#

imma test something

warm hedge
#

W...ell

#

I thought I could but now I can't with landAt

#

It is very whacky workaround even if it works, anyways

timber bough
#

This one only works if I set the time acceleration to 2 or more haha

_id = addMissionEventHandler ["EachFrame", {
    f35 action ["LandGear", f35];
    systemChat str time;
}];
#

And there's no way to just force the animation?

warm hedge
#

No

timber bough
#

if I do landat [helipad, "land"] it the landing gear works fine but then the f35 closes it's fan doors and stuff

#

stops vectoring

timber bough
#

wait a second, if I'm far from the f35, it works perfectly fine lmfao

#

it lands perfectly

#

but if I'm super close

#

this is dumb af

velvet knoll
winter rose
open hollow
velvet knoll
# winter rose that's a ticket, not scripting

Thanks @winter rose ! Thanks @open hollow, I apreeciate the advice and heads up. The video file is in .ogv and runs fine otherwise, it's only 19mb.

I'll open a ticket, again I apreeciate the help guys!

#

@winter rose just to be clear, did you mean a ticket on the discord?

warm hedge
cobalt path
#

Is there a way to have a script to give an NPC a random (or one from a custom list) face? I am trying to do smth with compositions

warm hedge
#

setFace

ornate whale
#

Is it faster to execute code like _x in [a,b,c];, with the array being defined as a global variable or as a hardcoded array through preprocessor #define?

little raptor
#

Preprocessor doesn't save your array so it gets recreated every time you invoke the macro
A variable saves your array and you just reference it

sullen sigil
#

if its not a constant (numbers etc) then its almost always faster as a variable iirc

granite sky
#

I wonder if it'd be possible to add a const keyword that does that for you on script compiling.

fair drum
#

That would be nice

sullen sigil
#

doubt the performance gains would be huge tbh

#

dont we also have compileFinal already? expanding that to other data types would be more realistic but i suppose we'll see what dedmen says

granite sky
#

I mean it wouldn't be significantly better that declaring a global, but that's a bit of a faff.

ornate whale
#

Is there any particularly effective way how to optimize performance of various unit to unit checks, like visibility check, so that I donΒ΄t have to check all to all units every time, e.g. if they are too far away?

finite bone
#

Hello everyone. I was looking at the Spaceship composition at Steam and tried my hand at its code and make everything local as possible for the players. I have finally arrived at this solution - https://gist.github.com/A3-Root/5e468fa49c56e199206e6f619f223fcf

The problem? The create and launch works FLAWLESSLY across all clients (all effects are good and works in sync) however, the "LANDING" causes a lot of desync to players (even if it is only rendered for them locally)

Gist

ARMA 3 SpaceX Rocket SQF. GitHub Gist: instantly share code, notes, and snippets.

#

and by desync - I meant, the creation, subsequent landing of the created object, and the effects produced within as a result are all out of sync or does not work right out.

native hemlock
#

@timber shore you return true

granite sky
native hemlock
#
{
	if(_this select 1 isEqualTo 47 && myCondition) then {
		true;
	} else {
		false;
	};
}];```
open hollow
haughty sand
#

@hallow mortar

#

are you on?

hallow mortar
#

Busy right now, sorry

thin fox
#

Hello. What is this? got from .rpt file

20:01:55 Performance warning: SimpleSerialization::Read 'PIG_opfLoc' is using type of ,'LOCATION' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types```
fair drum
little raptor
#

And then you serialize it (e.g. saving game) which causes that error

#

You can try using a different type if possible (e.g. if you use the location for storing variables, use a hashmap instead, or if you use it for its position, use a marker/object/position instead)

timber bough
#

Is it normal that adding laser targets enemies slows down the game a lot?
I have a script that adds laser targets to enemies so that airplanes can target them and drop bombs on them, for effective cas purposes.
But this slows down the game A LOT
So i have two questions

  • Am I doing something wrong in the way I create laser targets and attach them?
  • I could also optimize it, so for example, only attach a laser target to one target per group, and on death, this laser target gets unattached and attached to anew unit of the same group, or better yet and more cleanly, delete this laser target and create a new one attached to a new enemy of the same group, and if the group has no alive units left then delete the lazer. Basically only have one laser target per group. So, 10 squads that total 120 men only have 10 laser targets cumulative.
meager granite
#

count allMissionObjects "LaserTarget"

little raptor
sullen trellis
#

Good day everyone, I wrote this script which spawns a searching helicopter that patrols the area to detect the player, if it happens to fly too close over the player
using "knowsAbout" command it will give hint that it detected the player. What I want is try increase detection range to spot player further away, I tried "setSkill
spotDistance/spotTime" seems like they never really work. any suggestions?

_pos = [_patrolpos, 1000, 1200, 3, 0, 20, 0] call BIS_fnc_findSafePos;
 _helisearch = createVehicle  ["CUP_I_412_Mil_Transport_AAF", _pos, [], 0, "FLY" ];
 heli_crew = createVehicleCrew _helisearch;
 [heli_crew, _pos, 2500] call BIS_fnc_taskPatrol;
 {_x setSkill ["spotDistance", 1];} foreach units heli_crew;
 {_x setSkill ["spotTime", 1];} foreach units heli_crew;
 heli_crew spawn { sleep 1; 
waitUntil {{_x knowsAbout player > 0} foreach units _this};  
hint "Caution! Enemies marked your location"; };

proven charm
#

will the hint actually trigger?

sullen trellis
#

yes, but has to be very close

proven charm
#

oh ok i dont really understand the code, foreach in condition? i think you are also missing } at the end

#

plus you are doing "units _this" when the _this should already have the heli_crew

sullen trellis
proven charm
#

np

meager granite
#

You probably wanted this: units _this findIf {_x knowsAbout player > 0} >= 0

sullen trellis
#

i guess thats another "welcome to arma 3 AI"

meager granite
#

could be the helicopter itself, its sensors and such

#

Try changing group behaviour so they search better?

#

heli_crew setBehaviour "AWARE"

#

heli_crew setCombatMode "RED"

#

Something like this

sullen trellis
thin fox
little raptor
#

afaik no

thin heron
#

looking for some help.

I am trying to use the script of CfgUnitInsignia to add a patch to everyone and have done the description.exe settings, but i am missing something.

I added the [this, "NAME"] call BIS_fnc_setUnitInsignia; to a person on the Init area, but there is no insignia.

Any help?

#

this is what i am using

{
    class 111thID
    {
        displayName = "111th Infantry Division";                                // Name displayed in Arsenal
        author = "Bohemia Interactive";                                            // Author displayed in Arsenal
        texture = "\A3\Ui_f\data\GUI\Cfg\UnitInsignia\111thID_ca.paa";            // Image path
        material = "\A3\Ui_f\data\GUI\Cfg\UnitInsignia\default_insignia.rvmat";    // .rvmat path
        textureVehicle = "";                                                    // Does nothing, reserved for future use
    };
};```

But I am not understanding the material line. I have made the patch, 128x128 saved as paa and named it. updated the script, but not sure where to go from there
warm hedge
#

111thID is the name you need to use in script

thin heron
#

so that is for the standard one right. but the class name needs to change to the new insignia?

warm hedge
#

className is always used to fetch/refer in anywhere, so yes

thin heron
#

so if i am understanding:

The image goes in the mission folder
The discription.exe has the above code with the following changes - 1) class "testpatch" 2) texture is the path of the patch
Then i need to put something in the init section on the players? or somewhere else?

warm hedge
#

It's Description.ext not discription.exe
Yes and yes if you do it correctly

thin heron
#

ok thanks. i will take a look at it again.

errant jay
#

how do i make it so dynamic sim AI are only triggered my trigger/executing a script?

not by player proxomity at all, but only by script

hallow mortar
#

Use enableSimulation / Global to manage them rather than the dynamic simulation system

timber bough
#

Alternatively, I could have an AI controlled UAV that is marking targets with its laser designator, but then all planes in the vicinity would be targeting the same laser target no? Which is fine if we have a couple fighters in the air, but in my mission I have 16 fighters at a time (carrier based mission).

Making a UAV loiter in a designated area is ezpz, but make it target a specific unit and "firing" the laser designator might be complicated given how ai doesn't like targetting and firing manually through scripting, so not sure if I wanna go down that rabbithole.

ornate whale
#

Is there any other better way to achieve this - break from a spawned loop in a single frame? I want to make sure that the exit condition does not change. I donΒ΄t like it much, because it reminds me of goto jumps in code execution.

spawn {
...
  while { _condition } do
  {
    scopeName "while";
    isNil {
      _units = units _group select { alive _x };
      if (_units isEqualTo []) then { breakOut "while"};
    };
...
fair drum
#

plus, why do you need your scheduled thing to be frame precise anyways, what is the context?

ornate whale
#

I am doing some things with the AI, detection, forgetting, etc. Sometimes I do condition checks, and perform actions based on those conds. If the execution of a schedule code pauses, the condition might not be valid anymore at the time of the action, thus breaking my state machines - freezing, looping infinitely etc.

thin heron
warm hedge
#

No, the uniform may not support it

thin heron
#

ah ok. thanks

#

can you also do this with backpacks? or is that a seperate thing?

warm hedge
#

Backpack can do a retexture, but they most unlikely have insignia selection

fair drum
ornate whale
#

I need to use sleeps in this loop, so I need do desync/spawn the code, but then I have to sync it back again somehow, and this it the critical point.

ornate whale
#

It is basically a timer with conditions.

#

Wait, check, add some time and repeat, or don't add and exit.

timber bough
fair drum
timber bough
#

yeah, don't think this will do much otherwise huh?

#

Each frame mission event handler only works if you're "far" for the plane you're forcing gear down from. If you get close I guess the simulation gets higher priority.

formal stirrup
#

There a function to lower the turn speed of a player/unit

meager granite
#

Anybody had a need for something like selectSum alongside selectMin and selectMax?

#

Maybe applySum so you can both modify values and sum at once

#

Muh syntaxic sugar thinkEyes

meager granite
#
_r = ropeSegments r select 1;
[
     _r selectionPosition "start"
    ,_r selectionPosition "end"
    ,_r selectionPosition "start" vectorDistance (_r selectionPosition "end")
    ,_r modelToWorldVisualWorld (_r selectionPosition "start") vectorDistance (_r modelToWorldVisualWorld (_r selectionPosition "end"))
]
```=>

[
[2.23517e-009,-3.26703e-009,0.0154323]
,[2.23517e-009,-3.73551e-009,0.292284]
,0.276852
,0.426513
]

#

I don't get it, shouldn't these distances be the same?

#

r is a proper rope with all segments

#

Thought its the scale, but in my case getObjectScale _r => 1.20666, but 0.276852 * 1.20666 is 0.334066, nowhere close to 0.426513

#

even if I multiply by scale twice thronking

warm hedge
#

Just nag Ded

meager granite
#

wlen is modelToWorld length, mlen is length between selection positions

#

No idea what kind of magic is going on with the ropes

#

Maybe they're scaled in XYZ and getObjectScale returns average or something?

#

My guess: Ropes are scaled by Y only and getObjectScale for them returns average of all 3 components so you end up with lower number

#

@still forum Can you please take a peek at what getObjectScale does for rope segments?

#

0.426513 / 0.276852 = 1.54058 is real scale
(1.54058 + 1 + 1) / 3 = 1.18019 is sort of close to getObjectScale of 1.20666

#

Maybe it also scales by XZ a bit too

#

GIB getObjectScaleArray

#

Probably something more complex

#

ropeLength returns 0 for segments, maybe it can be modified to return real segment length

digital rover
#

Does BoundingBoxReal change? Maybe you could do some basic trig to extract length if it does

meager granite
cyan dust
meager granite
#

There is some engine model transformation magic going on under the hood it seems

meager granite
digital rover
#

Hell yeah

stuck palm
#

Anyone know what BIS_fnc_playEndMusic actually plays?

Description:
Play mission end music (when it is nearing the end)

What, specifically is the "mission end music"?

winter rose
#

try and thou shalt see?

stuck palm
#

Wasn't sure if it would work for me. Winning side needs to hear one track. Losing hears another.

hallow mortar
#

You can open functions in the Functions Viewer from the Editor Tools menu to see what they actually do

stuck palm
#

Learn something new everyday.

hallow mortar
#

It plays one of eventtrack01_f_epa and eventtrack01a_f_epa, randomly selected. There is no side distinction.

stuck palm
#

Thanks. For both.

digital rover
quiet wind
#

Any ideas on how or if it's possible to snap and wrap a texture to sea level rather than to terrain level? Similar(ish) behaviour to the oil spill as regardless where the actual object is placed, it will snap to the terrain

little raptor
#

What you refer to is called a decal but it doesn't snap to water

#

You can probably make your own custom texture object and break it into a grid shape and move each point vertically to match the water surface but it's not a nice solution (also idk if it actually works)

quiet wind
#

Fair enough, cheers

ornate whale
#

How do I intepret the performance output:

0.135646 ms
Cycles:
7373/10000```
Does it meant that 7373 cycles took 0,13 ms to execute, or that one cycle took 0.13 ms? And why does it try specifically 10000 cycles? Thanks
sullen sigil
#

0.135646 total

stable dune
sullen sigil
#

10k is for the sake of averaging

ornate whale
#

I am trying to estimate how much it takes from my per frame or per second CPU time budget.

fair drum
#

use arma script profiler for a full frame by frame analysis. if you are running your current thing every frame, you should optimize it to be much faster than what you have above

ornate whale
fair drum
ornate whale
fair drum
#

this is sort of what the profiler looks like:

this is for instance, a very heavy frame (frame during init phase of the mission)

#

this would be a normal frame + some of my things going per frame (this is the start of a single frame, 600 micro seconds in)

#

it will tell you a bunch of info of your current frame handlers

ornate whale
#

Thanks man.

last tapir
#

Sup everyone! So i made some custom buildings that you can enter and get teleported to a custom construction way up in the sky so you would not be able to see it from normal map. the problem is, every time that i teleport the player up he changes to the halojump animation and spawns laying on the ground rubbing his belly LOL.

I tried this:

_handlerIndex = _player addEventHandler ["AnimChanged", { 
     params ["_unit", "_anim"];
     Diag_log format["ANIMATION: ", _anim];
    if (["halofree",_anim] call Bis_fnc_instring) then {_unit switchMove ""};
}];```

and also tried this:
```_player playMoveNow "AmovPercMstpSrasWrflDnon";
_player playMove "AmovPercMstpSrasWrflDnon";
_player switchMove "AmovPercMstpSrasWrflDnon";```

none seem to work, do you guys have any idea to prevent this?
#

@fair drum suggested the second one, but did not work

#

i am using exile btw

#

dont know if that matters

fair drum
#

damnnnnn i must have missed the creation of that command

last tapir
warm hedge
#

Should be

last tapir
#

testing now

fair drum
# last tapir <@177167602768936960> suggested the second one, but did not work

also, this is what I meant. the halo animation happens so fast but still takes more than 1 frame (> 1 frame but still small enough it goes in a blink of an eye, can't use CBA_fnc_execNextFrame in this instance). you get around this by adding a slight delay:

[] spawn {
    player setPosASL [0,0,100];
    sleep 0.1;
    player switchMove "AmovPercMstpSrasWrflDnon";
};
last tapir
#

oh cool

#

will try that too, first try did not work with setUnitFreeFallHeight

fair drum
fair drum
last tapir
#

i have everything, its just this animation problem and some detailing that is missing

#

wanna join voice?

#

i can show it

fair drum
#

yeah i can hop in a second

devout surge
#

Hi! im trying to make a mission for a multiplayer server. i want to check if some task are completed, and if they are call a BIS_fnc_endMission with the blufor winning and opfor loosing, how should i make it? someone can direct me to an example?

fair drum
devout surge
#

Solid 5. my mission is something like this:
[west,["trigger", ""],["missionDescription", "missionName", ""],getMarkerPos "MK1","CREATED",10,true,"destroy",false] call BIS_fnc_taskCreate;
repeat for all tasks and for each side(so the west gets a compled and east a destroyed.
my mission has triggers to check if the objetives are completed.

indigo wolf
#

i have formated text with colors and linebreaks but the function only accepts string - is it possible to send formated text as string but still produce the text colors and linebreaks i want it to?

fair drum
# devout surge Solid 5. my mission is something like this: [west,["trigger", ""],["missionDescr...

Method 1 (since you are already using triggers), Using 2 Triggers and 2 sets of win/loss debriefings for each team:

Both are server only triggers

// BluforVictory Trigger

// Condition

[
    "blufor_task_1",
    "blufor_task_2",
    "blufor_task_3"
] findIf {!(_x call BIS_fnc_taskCompleted)} == -1

// Activation

["bluforWin", true, true, true, false] remoteExec ["BIS_fnc_endMission", west];
["opforLoss", false, true, true, false] remoteExec ["BIS_fnc_endMission", east];
"serverEnd" call BIS_fnc_endMission;
[BluforVictoryTrigger, OpforVictoryTrigger] apply {deleteVehicle _x};

// OpforVictory Trigger

// Condition

[
    "opfor_task_1",
    "opfor_task_2",
    "opfor_task_3"
] findIf {!(_x call BIS_fnc_taskCompleted)} == -1

// Activation

["opforWin", true, true, true, false] remoteExec ["BIS_fnc_endMission", east];
["bluforLoss", false, true, true, false] remoteExec ["BIS_fnc_endMission", west];
"serverEnd" call BIS_fnc_endMission;
[BluforVictoryTrigger, OpforVictoryTrigger] apply {deleteVehicle _x};
fair drum
indigo wolf
#
private _smsmessage = formatText["%1%2%3%4%5","<t color='#ff0000'>Person 1:</t><t color='#ffffff'>wazzap homie watchu doin?</t>", lineBreak, "<t color='#ff0000'>Person 2:</t><t color='#ffffff'>Gfucking dying</t>", lineBreak, <t color='#ffffff'>Call disconnected</t>"];``` this is my formated text i want to display with linebreaks
meager granite
#

What function do you want to use anyways?

indigo wolf
devout surge
#

I will code it in a couple hours and post my findings

#

So many thanks

meager granite
#

title: String - title of the action shown in the action menu.It can contain Structured Text tags, such as <t color='#FFAA00'>text</t>

indigo wolf
#

oh ok i will look into that

#

but is there a function that can add my messages to the briefing / intel / anyother place for people to read?

meager granite
#

Can't advise with that, I like to re-invent the bicycle all the time myself

indigo wolf
#

the function you mentioned only allows structured text during hold not after to store so my big problem is with storing it someplace for people to read as in a conversation

meager granite
#

Oh I thought you had problem with action title not being formatted

#

[QGVAR(addIntel), [_title, _text], _targets] call CBA_fnc_targetEvent; can't get where this addIntel function is thronking

indigo wolf
#

is it not _fnc_addIntel right above that line?

meager granite
#

This line is right inside of it, and its a local variable

#

lol I didn't even notice you HAVE to be logged to search on github

#

I didn't even read the message and thought search found nothing

indigo wolf
#

yea github made it so unless you login you cant search code :/

meager granite
#

Its a wrapper for createDiaryRecord

#

It takes STRING and turns it into TEXT by itself

meager granite
meager granite
indigo wolf
#

ok formating works except for the color

#

should be managable thanks a lot ❀️ ❀️

fair drum
#

alright, looks like i might have to go down this road. whats the major order of things?

meager granite
#
  1. Add FiredMan to relevant units (players, bots if they can damage your reactors
  2. Send each relevant projectile into a function that initializes it
  3. That function should add SubmunitionCreated and HitExplosion and HitPart to the projectile
  4. SubmunitionCreated sends new projectiles into same function above so all submunitions are tracked
  5. You track damage inHitExplosion and HitPart, projectile event handlers work properly in 2.16 unlike entity HitPart
#

Unlike HitPart on targets (entities), HitPart on projectiles only triggers for direct hits

#

Depending on your damage tracking you might want either HitExplosion or HitPart or both

stuck palm
#

Trying to play music during my mission outtro. Everything except the play music works. Anyone know what I am doing wrong?

{
private _playerSide = side _x;
private _playerID = owner _x; // Get the player's ID
if (_playerSide == _winningSide) then {
titleText [_endingWinMessage, "PLAIN", -1, true, true];
// playMusic ["LeadTrack01_F_Bootcamp", 132];
["LeadTrack01_F_Bootcamp", 132] remoteExec ["playMusic"];
} else {
titleText [_endingLoseMessage, "PLAIN", -1, true, true];
//playMusic "BackgroundTrack03_Fο»Ώο»Ώ_EPC";

     ["BackgroundTrack03_F_EPC"] remoteExec ["playMusic"];
};

} forEach allPlayers;

meager granite
#

and for other RE with playMusic too

meager granite
# fair drum alright, looks like i might have to go down this road. whats the major order of ...

Fired:

_shot setVariable ["reactors_hit", []];
_shot call initShot;

SubmunitionCreated:

params ["_shot", "_subshot"];
_subshot setVariable ["reactors_hit", _shot getVariable "reactors_hit"];
_subshot call initShot;

initShot:

params ["_shot"];
_shot addEventHandler ["SubmunitionCreated", ...];
_shot addEventHandler ["HitExplosion", ...];
_shot addEventHandler ["HitPart", ...];

HitExplosion

params ["_shot", "_target"];
if(_target is your reactor) then {
    if(_shot getVariable "reactors_hit" pushBackUnique _target >= 0) then {
       //Your reactor was hit by this projectile for the first time
    };
};
#

Similar stuff in HitPart, you can also do more checks like distance from explosion to reactor, hit parts if you only care about precise penetrations, etc.

fair drum
#

gotcha, will start working on it

meager granite
#

Sadly there is no way to know exactly how much damage engine is going to make to decide if shot was good enough to be considered a damaging hit, you'll need to estimate it

#

Same "reactors_hit" array is passed from shot to submunitions so you don't get twice the damage from RPG and its penetrator for example

#

Up to you to decide how to track the damage

#

Also do some class checks inside Fired to not to track irrelevant shots like bullets and such

fair drum
#

yeah just needed a way to get that projectile first hit, was pulling my hair out the handleDamage on server way earlier

meager granite
#

FiredMan is vastly superior to Fired, use that instead

#

getOrDefaultCall is the best choice for fast cached checks

#

FiredMan:

private _class = _this select 4;
if(isShotRelevantCache getOrDefaultCall [_class, {
    //List of classnames checks, config value checks, etc., 
}, true]) then {
    // Track the shot here...
};
```and
```sqf
isShotRelevantCache = createHashMap;
```somewhere
fair drum
#

Once I grab the shot from the client, should I pass it to the init and calculations to be done on the server? or calculate it all locally and send the result to the server?

meager granite
#

You'll need to do everything on client and only send the result to server

#

Because some shots aren't global, by the time shot entity broadcasts to server it can already by dead, etc.

fair drum
#

for placed explosives that do not have a direct projectile, use HitExplosion? all the others (rockets, bullets, etc) use HitPart?

meager granite
#

Up to you, you could use both for everything

#

HitExplosion will trigger even for slightest splash damage though

#

Same with HitPart, will trigger even for non-penetrating shots

fair drum
#

Client Unit:

#include "script_component.hpp"

params ["_unit"];

if !(local _unit) exitWith {};

_unit addEventHandler ["FiredMan", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];

    if (isNil QGVAR(Carrier_Reactor_RelevantShots)) then {
        GVAR(Carrier_Reactor_RelevantShots) = createHashMap;
    };

    if (GVAR(Carrier_Reactor_RelevantShots) getOrDefaultCall [_ammo, {
            private _simulation = getText (configFile >> "CfgAmmo" >> _projectile >> "simulation");
            private _valid = _simulation in ["shotMissile", "shotRocket", "shotBullet", "shotMine", "shotGrenade"];

            !_valid
        }, true]
    ) exitWith {};

    _projectile setVariable [QGVAR(Client_Reactor_Shot_ReactorsHit), []];
    _projectile call FUNC(Client_Reactor_ShotInit);
}];
#

Client Shot:

#include "script_component.hpp"

params ["_projectile"];

_projectile addEventHandler ["HitExplosion", {
    params ["_projectile", "_hitEntity", "_projectileOwner", "_hitSelections", "_instigator"];

    if !(_hitEntity in GVAR(Carrier_AllReactors)) exitWith {};
    if !(_projectile getVariable QGVAR(Client_Reactor_Shot_ReactorsHit) pushBackUnique _hitEntity < 0) exitWith {};

    private _simulation = getText (configFile >> "CfgAmmo" >> _projectile >> "simulation");
    [QGVAR(Carrier_Reactor_HandleHit), [_hitEntity, _simulation]] call CBA_fnc_serverEvent;
}];

_projectile addEventHandler ["HitPart", {
    params ["_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_components", "_radius" ,"_surfaceType", "_instigator"];

    if !(_hitEntity in GVAR(Carrier_AllReactors)) exitWith {};
    if !(_projectile getVariable QGVAR(Client_Reactor_Shot_ReactorsHit) pushBackUnique _hitEntity < 0) exitWith {};

    private _simulation = getText (configFile >> "CfgAmmo" >> _projectile >> "simulation");
    [QGVAR(Carrier_Reactor_HandleHit), [_hitEntity, _simulation]] call CBA_fnc_serverEvent;
}];
meager granite
#

you forgot submunitions

fair drum
#

i wasn't thinking that I wanted to track those

meager granite
#

You could also send other relevant info like distance from hit to reactor, classname, etc. to server instead of just simulation

meager granite
#

I think Ghosthawk side miniguns, they turn into submunition few meters after flight

#

Also your simulation check is case sensitive

fair drum
#
private _damage = call {
    if (_simulation in ["shotMissile", "shotRocket"]) exitWith {GVAR(Carrier_ReactorHP) / 8};
    if (_simulation in ["shotBullet"]) exitWith {GVAR(Carrier_ReactorHP) / 1000};
    if (_simulation in ["shotMine"]) exitWith {GVAR(Carrier_ReactorHP) / 4};
    if (_simulation in ["shotGrenade"]) exitWith {GVAR(Carrier_ReactorHP) / 30};
    0
};

private _reactorCurHP = _reactor getVariable [QGVAR(Carrier_ReactorHP), GVAR(Carrier_ReactorHP)];
_reactorCurHP = _reactorCurHP - _damage;
_reactor setVariable [QGVAR(Carrier_ReactorHP), _reactorCurHP, true];

LOG_1(SCRIPTNAME + "Reactor Taken Damage: New Damage: %1", _reactorCurHP);

currently iternally I'm doing this... which reminds me, I need to send the server the hit reactor as well

meager granite
#

shotbullet won't register for example

fair drum
meager granite
#

Some mod could have it in different casing

fair drum
#

but i'll add a case change in there just in case

meager granite
#

There are examples of BI messing up casing too

#

Engine doesn't care about simulation string casing so you shouldn't either

#

Looks like there aren't any simulation name casing differences in vanilla

#

Still, engine allows any casing, some mods might have it

granite sky
#

yeah, I've seen it.

#

If there is any scope for casing screwups then you can guarantee that at least one major mod does it :P

fair drum
#

@meager granite how do you handle placed explosives? I can't seem to get them to register with this method. At least on the "Land_Device_disassembled_F" class. It picks up when I blow my own character up though.

little raptor
#

If it exceeds 1 second it stops running a new cycle

#

For example in this case it stopped at 7373 cycles because 7373*0.135646 becomes greater than 1 second

little raptor
#

(for example if you intend to run that code for 10 units in a loop it's ok-ish but not for 100 units)

#

Also I'm assuming you're talking about unscheduled environment

#

In scheduled environment a slow code doesn't slow down the game (unless you run a slow "chunk" of unscheduled code) but it takes longer to finish

haughty sand
#

@hallow mortar

#

u on

warm hedge
#

Don't ask to ask or wait someone to get your answer

haughty sand
#

he told me to come back to him later

#

are you able to help me with extdb3 for amra 3 server database?

#

i have it set and running but is saves data locally to .vars not to a db on my server

warm hedge
#

No but just post your Q. Nikko or I am not the only ones who can answer

haughty sand
#

is anyone able to help me with extdb3 for amra 3 server database? i have it set and running but is saves data locally to .vars not to a db on my server. Somthing has caused my server to imprint a bad local db save to the players .vars file causing the scripts on my server to not run for select players. I know it is in the .vars because when i told them to delete it, it worked. A few joins later the server re-imprints on their profile making the scripts no longer run again for select players out of random. what do i do

meager granite
ruby turtle
#

hello

#
if (!isServer) then {
    tp_1 addAction ["Teleport MenΓΌ ΓΆffnen", { 
        private _player = _this select 1;
        _player createDialog "TeleportMenuDialog";
    }];
};

```and
```sqf

Im too stupid, where is my bug? it says "missing ;" on _player createDialog "TeleportMenuDialog";
meager granite
#

save _player into global variable or get display from createDialog with alt syntax and setVariable it there.

stuck palm
# meager granite Try `"BackgroundTrack03_F_EPC" remoteExec ["playMusic"];`

tried that. Didn't seem to work.

6:58:26 Error in expression <playmusic>
6:58:26 Error position: <>
6:58:26 Error Invalid number in expression
6:58:26 Error in expression <playmusic>
6:58:26 Error position: <playmusic>
6:58:26 Error GIF pre stack size violation

and that is after I removed the "start from" time. I need the song to start at 132 seconds in or 2:12.

    private _playerSide = side _x;
     private _playerID = owner _x; // Get the player's ID
    if (_playerSide == _winningSide) then {
        titleText [_endingWinMessage, "PLAIN", -1, true, true];
       // playMusic ["LeadTrack01_F_Bootcamp", 132];
        "LeadTrack01_F_Bootcamp", remoteExec ["playMusic"];
    } else {
        titleText [_endingLoseMessage, "PLAIN", -1, true, true];

        
         "BackgroundTrack03_F_EPC" remoteExec ["playMusic"];
    };
} forEach allPlayers;```

also forgot how to format sqf on discord. apologies. 

thx prisoner
stable dune
#

```sqf
Your code here
```

meager granite
#

Also you have a comma after music name string

stuck palm
#

ok. getting coffee. will test. that was big dumb on me.

what about the start time? do I need to bracket that?

meager granite
#

Yes

#

Double brackets even, check Example 1

#

"cutRsc" one

cyan dust
#

Good day. Sometimes in SP (in the East Wind for example) we get on-screen messages looking right from Task Framework. But they are not tasks - just some hints like 'go further and patrol will start'. What is the command/function for them?

cyan dust
stuck palm
#

just tested:
"LeadTrack01_F_Bootcamp" remoteExec ["playMusic"];

[["LeadTrack01_F_Bootcamp", 132]] remoteExec ["playMusic"];

and just to be safe

[["LeadTrack01_F_Bootcamp", 5]] remoteExec ["playMusic"];

no error, no music plays in any. /shrugs

warm hedge
#
["LeadTrack01_F_Bootcamp",132] remoteExec ["playMusic"]```?
stuck palm
#

tried that yesterday. that was my 1st attempt. just tested again for posterity. No music plays, no error.

hallow mortar
#

Do you have your music volume above 0 in your settings?

stuck palm
#

yes. i have intro music. it works, however I set that up to run once on the first player respawn in onPlayerRespawn.

winter rose
#

ah, that might be that then
are you sure the code triggers?

stuck palm
#

Yes.

{
    private _playerSide = side _x;
     private _playerID = owner _x; // Get the player's ID
    if (_playerSide == _winningSide) then {
        titleText [_endingWinMessage, "PLAIN", -1, true, true];
    ["LeadTrack01_F_Bootcamp",132] remoteExec ["playMusic"];
        } else {
        titleText [_endingLoseMessage, "PLAIN", -1, true, true];
                "BackgroundTrack03_F_EPC" remoteExec ["playMusic"];
    };
} forEach allPlayers;

TitleText shows.

winter rose
#

ok (worth checking πŸ˜„)

stuck palm
#

Definitely.

Just tried playMusic ["LeadTrack01_F_Bootcamp", 132]; without any conditions, no music. I'm gonna give up on this for now.

winter rose
#

try ```sqf
playMusic "Defcon";

stuck palm
#

nada.

winter rose
#

sooo… you apparently have music issues πŸ˜„ ?

stuck palm
#

Apparently. Tried storing some of the stuff globally and then remote executing "endMusic.sqf" on each client. Same thing. Wondered if it had anything to do with the endMission camera stuff, so moved it to execute in my scoring function, same deal, no dice.

meager granite
#

@stuck palm

stuck palm
#

tried that.

#

there's something weird going on. playMusic ["LeadTrack01_F_Bootcamp", 132]; works fine in debug local exec

meager granite
#

I just tried it ant it works

winter rose
#

btw, you remoteExec forEach allPlayers πŸ‘€

stable dune
winter rose
#

(and don't use _playerID)

thin fox
#

Hello. Is there other way to remove the respawn counter after killed/forced respawn? This option seems to only remove the scoreboard.

ornate whale
meager granite
#
_seg = (ropeSegments testrope select 3);
[vectorMagnitude vectorSideVisual _seg, vectorMagnitude vectorDirVisual _seg, vectorMagnitude vectorUpVisual _seg]
``` => `[1,1,1.54066]`
#

measuring orientation vectors yields 3d scale

#

And multiplying model distance by vector up magnitude produces real rope segment length

#

God damn Arma requires days of R&D to get anything done

#

Wont post this on wiki, let people suffer hmmyes

slender turtle
#

Does anyone know if it’s possible to cause people to lose blood in ACE after someone takes morphine? Someone in my unit wants to make a β€œtainted medical supplies” op and I have no idea how to code this for them.

sullen sigil
#

_unit setVariable ["ace_blood_volume",_unit getVariable ["ace_blood_volume",6]-2];

#

its probably ace_medical_blood_volume though

ornate whale
#

Where can I find BI's FSM files in Arma 3?

slender turtle
sullen sigil
slender turtle
#

Like very very specifically morphine

meager granite
#

Otherwise unpack addons and search for *.fsm

stable dune
sullen sigil
#

im simply too kjwpilled

slender turtle
sullen sigil
#

cba event handler

slender turtle
#

I’ve never used those

#

But google!

slender turtle
sullen sigil
#

look at the cba docs

slender turtle
#

Ty!

ornate whale
#

Is there a way how to make a specific AI unit/group ignore another single enemy unit?

kindred zephyr
#

probably forgetting on frame

#

i vaguely recall some command proposed for that specifically but idk if it came to be

ornate whale
ornate whale
undone flower
fair drum
meager granite
#

Check what simulation they have

#

Maybe its some weird crap

#

I had no problem tracking satchels in my tests