#arma3_scripting

1 messages ยท Page 57 of 1

grizzled cliff
#

nevermind, ima go cry in my sleep because BI has broken shit.

#

:(

ivory locust
#

@still forum The wrappers for Triggers don't seem to work properly in Intercept

#

This trigger will be created but the activation will not be registered

#

It seems to correctly evaluate the condition every .5 seconds, but this will never evaluate true, at least as much as I was able to test it. Overall the behavior is just unusual

proven charm
#

what does setCombatBehaviour do for group and how its different from being used for units?

modern meteor
#

How can I get the coordinates of the location where the player's crosshair is currently pointing at?

thorn saffron
#

Can I have macros in mission based functions? ie. functions that are in the mission folder.

warm hedge
#

Yes

#

Not sure what Macro you mean, but still yes

thorn saffron
#

I basically want to define a custom macro for a bit of code that I keep reusing, but I dont want to turn it into a full function.

warm hedge
#

There is actually almost no downside to make it into a function, but you can always use #define and #include and others

thorn saffron
#

Its just about verbosity.

modern meteor
proven charm
modern meteor
#

This gives the coordinates of the laser designator:

_primaryTarget = lasertarget _player;

But I am now looking for a way to assign the coordinates without a laser designator.

modern meteor
proven charm
modern meteor
#

lasertarget and screetoworld return different things

#

does not work to guide a missile

proven charm
#

oh you need to create the laser target via script then

modern meteor
#

but how?

proven charm
#

copy from my code: _pos = screenToWorld [0.5, 0.5]; _laser = "LaserTargetE" createvehicle _pos; _laser setPosATL _pos;

#

use different LaserTargetX for each side

modern meteor
#

sorry, i am confused

#

this returns the coordinates of the player's crosshair to guide a missile?

proven charm
#

yes

#

i updated the code

modern meteor
#

Thanks, this works perfect!

lusty hollow
#

Is there a way to get info about target selected on sensors screen?

jagged mica
#

I don't know if it's the right channel, but I've recently made a quick video on multiplayer scripting and even though it's barely scratching the surface, maybe it'll shed some light
https://youtu.be/-hz0SoS95VY

Join the discord!
https://discord.gg/wCUqFxs

Consider supporting me as a modder/creator
Paypal: thevestarr@gmail.com

This video is just an introduction to multiplayer scripting in ARMA 3.
It's a huge topic and it's barely scratching the surface.

Resources:
https://community.bistudio.com/wiki/Multiplayer_Scripting
https://community.bistudio.co...

โ–ถ Play video
winter rose
meager granite
#

Should've also mentioned turret locality and that it behaves differently to vehicle locality

#

Weapon/magazine changes on vehicles are one of the most popular changes people do with scripting and its pretty frustrating if you don't understand locality.

shut reef
meager granite
#

Try <br/>?

shut reef
#

same

#

Even literally putting <br><br/> did not calm it

hallow mortar
#

I regularly use <br/> on its own in diary records without any trouble

shut reef
#

Even if you run the game with the script error flag?

hallow mortar
#

Yes. Trust me, we're talking hundreds of missions over several years, no problems

shut reef
#

๐Ÿคทโ€โ™€๏ธ

winter rose
winter rose
#

Is that just an overeager log message?
then most likely, unless you find cases where it doesn't trigger

jagged mica
shut reef
winter rose
#

heh, weird message but "accurate" warning

proven charm
#

are you using composeText for the diary record?

shut reef
#

yeah, also kinda weird that it only seems to care when it comes from a loca string and not when it is directly in sqf

proven charm
#

i thought it was a must

shut reef
#

No, it has its own parser (the very one that is complaining)

shut reef
shut reef
#

Is that worth a comment in the wiki, does anyone care to fix this or will it just be left for the next person to marvel in that rare case?

winter rose
#

maybe a note in the RPT thing

proven charm
#

whats the diffrence between setCombatBehaviour group and unit? I just want the tanks to drive on road with "CARELESS" but im unsure if I need the group version of the command

#

also wondering setBehaviourStrong, why so many commands ๐Ÿค”

warm hedge
#

Twenty years worth of SQF commands ๐Ÿ‘€

kindred zephyr
proven charm
kindred zephyr
#

yes

proven charm
#

if group setCombatBehaviour is not set?

kindred zephyr
#

is the driver the leader?

proven charm
#

dunno

kindred zephyr
#

if so, group will be set to careless if you set the tank to careless, if not, leader is set to careless

#

It gets even more complicated if you have AI mods

proven charm
#

hmmm well if combatBehaviour returns the "correct" value then it would be easy to test whats happening

kindred zephyr
#

Command Applies To
setBehaviour Every unit in the group, but not the group itself
setBehaviourStrong Every unit in the group, and the group itself
setCombatBehaviour If argument is Object, only that unit, and if argument is Group, the group itself (not its units)

proven charm
#

yea saw that wiki page, still kinda wondering ๐Ÿ™‚

kindred zephyr
#

using behaviour strong is the best from what I've seen, its the most consistent one

proven charm
#

ok but in mech group i want only tanks to careless

kindred zephyr
#
{
group _x setBehaviourStrong "CARELESS";
}forEach _tankArray
```?
proven charm
#

that would apply to infantry as well

kindred zephyr
#

yes, the behaviours are managed using groups

proven charm
#

i'm gona try using setCombatBehaviour see if they stay careless

kindred zephyr
#

gl

proven charm
#

ty for the help ๐Ÿ™‚

still forum
#

Pretty sure it won't interpret these initializer lists correctly?
You can pass your thing to diag_log and see what falls out in RPT and if it looks correct.
I would build the arrays manually, not using initializer list to try get the compiler to do it

#

no, you are inside a SQF command, you don't need locks in main thread

#

no, not if you are in main thread

#

If you crash, attach a debugger and look

#

If you have to, that means i should update my intercept on workshop?

#

remoteExec is like taping a message to a rock and throwing it over a wall.
You don't get a result, unless someone on the other side of the wall throws you another stone back.
( you need to control the function on the receiving side, and remoteExec the result back to remoteExecutedOwner)

#

Thats nonsense, a variable being used in some place doesn't mean you're forbidden from using it.
The real issue here is missing private infront of the local vars.
There is no issue with using _y

#

no

#

intercept is "unscheduled", cannot sleep in unscheduled.
sqf::sleep shouldn't even be available to you to call ๐Ÿค” Except for quite advanced intercept usage it doesn't make sense to use

#

If you look at the code, the variable is not defined where its used, and it is destroyed before its used.
The variable only exists in the while scope, not outside of it

#

That is your only option. sqf::spawn

#

The water you mean? afaik thats detected on the heightmap

hallow mortar
meager granite
#

Did a test, somehow having 1000 controls groups with 2 structured texts in each yields more FPS than having 2000 structured texts controls in the display root ๐Ÿค”

still forum
#

We have it, #arma3_tools
atleast that's where we've always done it in the past

hallow mortar
still forum
#

you can also compile and define your functions from C++ side
sqf::set_variable("fnc_xxx", sqf::compile("sqf code"));
don't even need setVariable, you can store on C++ side no need to put into SQF side namespace

#

Make FT ticket please and ping me the link

#

If you want to talk to me, the best approach is to talk to me. Instead of asking if you can talk to me

#

Having one big batch in one command call is more efficient than having many smaller batches.
And when JIP happens, you cannot put sleep between the command executions, so while you can make sleep's inbetween for live play to lag less, the JIP's will be frozen/killed by it

#

You missunderstood that.
if you make repeat updates, you want to repeatedly update the WHOLE section, even if its hundreds of positions and you only actually changed a single one.
You don't want thousands of command calls for different sections

#

If you want to flood the terrain, its probably easier to adjust the water level (I think there was some way to do that)

meager granite
#

@still forum Couldn't stop thinking about that flag that lets model faces to render with transparency. There is no easy way to make the engine force this flag on certain model draw instance, right?

hallow mortar
still forum
#

Make a FT ticket and attach crashdump

sullen sigil
still forum
still forum
still forum
kindred zephyr
#

is it possible to be able to move your character while a dialog is active or is that just possible with rscTitles?

meager granite
#

You can sort of move with createDisplay dialog, but only the keyboard

#

findDisplay 46 createDisplay "YourDialog"

kindred zephyr
meager granite
#

Pretty much

kindred zephyr
#

still better than nothing, thanks Sa-Matra

little raptor
little raptor
still forum
#

So?

#

We shouldn't fix game crashes just because we already know what's causing them

#

nah

little raptor
#

so using forgetTarget in knowsAboutChanged EH

#

You can sorta expect it would cause infinite recursion

still forum
#

Or we could also just fix it

granite sky
#

By contrast, unit behaviour seems dominant when on foot.

little raptor
#

Which breaks other stuff ๐Ÿคท

still forum
#

We already fixed infinite recursion for a couple other EH's

#

I don't care what you see, I asked him to make a ticket so i can fix it

little raptor
lusty hollow
#

Am i understanding correctly, that there is now way that i can get sensor targets list from handheld weapon?

winter rose
proven charm
lusty hollow
winter rose
#

I am afraid I have no idea what you are talking about

proven charm
#

tracer?

median nimbus
winter rose
median nimbus
#

I'm not sure either

south swan
#
{
    class MissileCore;
    class MissileBase: MissileCore
    {
        class Components;
    };
``` example on that very page
lusty hollow
#

i just have a question in my head for a feature request ticket about command that will provide currently selected sensor target and while thinking what it should output found out that getSensorTargets only applicable to vehicles

#

But sensors could also be added to ammo

south swan
#

except i don't think the entity of CfgAmmo is ever created before the actual shot ๐Ÿค”

lusty hollow
south swan
#

weapon locks, then fires, then sets the target for freshly created munition iirc.

lusty hollow
#

so the weapon checks for sensor config of it's ammo?

south swan
#

even iirc-er: missiles don't have a target set in the frame they're created, but do on the next frame.

wind hedge
#

Guys, any idea how to detect if the player was hit in the VEST but the vest alone... I tried sqf if (_part == "body") exitWith { if (_unitVest isNotEqualTo "") then {_dam = _dam * 1.5;}; // Ai Vest Nerf }; in addEventHandler "handledamage" but it also the condition also fires when the unit is hit on the hand, arm, legs and even head...

south swan
winter rose
wind hedge
# winter rose FYI `"HandleDamage"` only provides the new damage value, **not** the *added* dam...

Yeah I know, thanks, it is still possible to get the added damage but I am not trying to modify the added damage just the total damage, but my EH not only has the problem of not detecting vest impacts accurately but also it detects body impacts as hands and head impacts and therefore fires my "weapon drop" and "headgear drop" funcs, which should only happen if the impact was on those body part exclusively

#

here is the whole thing:

winter rose
#

ok - just wanted to be sure because I see tons of people getting it wrong, better safe than sorry :)

#

wrapping something in call {} is useless (line 7)?

wind hedge
winter rose
#

ah, fair

#

but, well, how to break it to youโ€ฆ _unitVest is just undefined

wind hedge
grizzled cliff
#

CRYING CEASED. GOD STATUS RE-ENABLED

wind hedge
#

Is it me or exitWith doesn't work AT ALL inside the damaged EH?

winter rose
#

it should work in a call

#

if it doesn't, use the ol' if then else

wind hedge
#

And no matter where I shot, to the body or legs, the hint was PART: HEAD

#

WTF

#

no wonders why _part == "BODY" wasn't working!

#

I don't know what is the point of having all the other body parts if the EH only detects the _selection as HEAD...

hallow mortar
#

Multiple selections can be damaged by a hit, and only the last one will show up if you use a hint, because new hints overwrite existing ones. Try it with systemChat.

wind hedge
wind hedge
# hallow mortar Multiple selections can be damaged by a hit, and only the last one will show up ...
VAL_fn_handleDamageAiEH = {
    params ["_unit"];
    _unit addEventHandler ["handledamage", {
        params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];
        if !(local _unit) exitWith {};
        if (isNil {_unit getVariable "parts_handle"}) then {_unit setVariable ["parts_handle", true];};
        if !(_unit getVariable ["parts_handle", true]) exitWith {}; // Duplication Prevention
        hint format ["PART: %1", _selection];
        _unit setVariable ["parts_handle", false];
        _unit spawn {sleep 0.1; _this setVariable ["parts_handle", true];};
    }];
};```
hallow mortar
wind hedge
#

So now the question is... is there a reliable way to get the correct damaged location? including vest shots?

winter rose
#

hint will only display the last hint indeed

ivory locust
winter rose
winter rose
wind hedge
ivory locust
wind hedge
winter rose
#

you collect them all and you compare with >

wind hedge
#

Well, if "_directhit" was recently added, perhaps we could get a reliable way to get the REAL "big damage" location... something like "_impactedSelection" or whatever

#

It is mindblowing that there is no reliable way to just figuring out where a unit was originally hit without doing walls of scripted code workarounds in there

winter rose
#

Reforger fixes that, buy it

hallow mortar
#

The directHit param was just turning on an existing engine check. It also.....doesn't actually tell you if it's a direct hit, it can only tell whether it was fall damage or not.
(Note: the directHit param in HitPart does work as the name implies, it uses a different method that wasn't transferrable to HandleDamage)

wind hedge
# winter rose Reforger fixes that, buy it

Already bought, but my 5800X3D + RX6700XT runs Arma 3 at 200 FPS (Malden) and 120 in Reforger, but my main problem is that none of the players I play Arma 3 with likes Reforger

winter rose
#

anyway
that's not available easily, "it is how it is"

wind hedge
wind hedge
winter rose
#

no

hallow mortar
wind hedge
#

Thank you both for clearing this up

#

Now I understand why most knowledgeable guys here mostly keep quiet about the damaged EH...

#

It is a mess

kindred zephyr
winter rose
#

no idea
if damage is only "" without any instigator, then it's a fall damage afaik

wind hedge
hallow mortar
#

Yes. Projectile classname being "" is also a good indicator.

wind hedge
#

so: sqf if (_projectile isEqualTo "" && {isNull _source} && !(_directHit)) then {//fallDamage};

kindred zephyr
#

oh, its fairly recent

#

explains alot

wind hedge
#

I thought that "_directHit" was added to detect explosion damage... since fall damage was already doable before...

#

Perhaps the wiki is wrong or I am wrong...

#

Because in the wiki it says: directHit: Boolean - false for fall damage

hallow mortar
#

The request for it came from wanting to detect explosion damage. However, the check that does that in HitPart is complex in some mysterious way and it was not possible to copy it to HandleDamage. Instead, we got access to a less smart check that already existed in the engine, but can only detect fall damage.

wind hedge
winter rose
kindred zephyr
#

directHit will deliver false but explosives iirc does return instigators and sources

wind hedge
#

Fun fact... 100% of the many mods on the WORKSHOP that claim to make the Ai drop their weapon on arms/hand damage and/or drop headgear on headshot are broken and will cause those two things even when shooting to the legs and the body!

#

๐Ÿคฃ

kindred zephyr
#

someone made a ticket last year regarding damages triggering for the head in random instances too now that you mention that

#

it was one of the blue names

#

but dont recall whom

wind hedge
#

Well, the whole thing works in such "mysterious ways" that no one has figured out a way to trully make it work for other purposes (not even the devs it seems)... And all who "think they do" they really don't... Maybe the guys at ACE do... or maybe they just scraped all the vanilla stuff and redid the whole thing from scratch

hallow mortar
# winter rose can be for blastwave too

The one in HitPart detects explosive splash damage correctly, but according to Dedmen the one in HandleDamage doesn't. If that changed later in dev branch, that's awesome, but that's not the information I (or the wiki) have :U

wind hedge
quaint star
winter rose
hallow mortar
#

The preset types like "wheeled_APC" aren't real pathfinding types in their own right, they're just aliases for specific vehicle types to save you having to remember the exact classname when you want a vehicle of that rough category.
There isn't a pathfinding type specified in vehicle config; pathfinding is probably done by AI/FSM based on a variety of parameters like precision, terrain coefficient, tracked vs wheeled, etc., not using a defined type.

weary smelt
quaint star
#

Thank you all for the answers

wind hedge
#

the "random" command doesn't work inside EHs right? Because even if I set sqf If (random 100 < 1) then {}; it always fires as if it was sqf If (random 100 < 99) then {};

south swan
#

wut

sullen sigil
#

if ((random 100) < 1) then {};

south swan
#
less1 = 0;
less99 = 0;
player addEventHandler ["Fired", {
  if (random 100 < 1) then {less1 = less1 + 1;};
  if (random 100 < 99) then {less99 = less99 + 1;};
  systemChat str [less1, less99];
}];```the final output *after firing 100 times* is [1, 99] ![blobdoggoshruggoogly](https://cdn.discordapp.com/emojis/748124048025714758.webp?size=128 "blobdoggoshruggoogly")
#

[1, 199] after 200 shots, [3, 249] after 250 shots. random 100 < 99 seems to be a bit too frequent, but whatever blobdoggoshruggoogly

#

[4, 397] after 400 shots. All seems to work as intended blobdoggoshruggoogly

modern meteor
#

Is there a way to receive the coordinates of a task location on the map?

modern meteor
#

Thank you, I'll have a look. Looking for a way to spawn enemies around task locations which are randomly generated.

wind hedge
meager granite
wind hedge
#

So EHs have issues with exitWith...

meager granite
#

If EH needs a return value, you can't use exitWith to return it.

wind hedge
#

That nails my problem then... thank you!

meager granite
#

Wrong:

player addEventHandler ["HandleDamage", {
    if(condition) exitWith {1}; // Instant death
    0; // No damage
}];
```Correct:
```sqf
player addEventHandler ["HandleDamage", {
    if(condition) then {
        1; // Instant death
    } else {
        0; // No damage
    };
}];
#

This is also correct:

player addEventHandler ["HandleDamage", {
    private _final_damage = 0; // No damage
    if(condition) then {_final_damage = 1;}; // Instant death
    _final_damage;
}];
wind hedge
#

so sqf call {if (true) exitWith {}; if (false) exitWith {};}; won't work but sqf switch (true) do {}; would work just fine!?

#

My god if I knew that before I wouldn't have lost so many hours on it...

meager granite
#
player addEventHandler ["HandleDamage", {
    call {
        if(condition) exitWith {1}; // Instant death
        0; // No damage
    };
}];
```will work fine
#

Event handler's code scope must have return value as last statement

#

return of the call is last statement in that example

#

All in all, don't use exitWith in root scope inside event handlers, if it supposed to return something to the engine

#

If event handler shouldn't return anything to the engine, it doesn't matter

wind hedge
#
player addEventHandler ["HandleDamage", {
    call {
        if(condition) exitWith {_unit spawn val_fn_x;}; // Instant death
        if(condition) exitWith {_unit spawn val_fn_y;}; // Instant death
    };
    _damage
}]; ``` <--------------- That would also work right
meager granite
#

Yes it will, but it won't return values of your functions because

#

I guess you meant _damage = call {...

#

In that case it won't work

#

because _damage will be script thread, not function result

#
player addEventHandler ["HandleDamage", {
    private _damage = call {
        if(condition) exitWith {_unit spawn val_fn_x;}; // Instant death
        if(condition) exitWith {_unit spawn val_fn_y;}; // Instant death
    };
    _damage // Damage is SCRIPT return of spawn command here, invalid return
}];
#
player addEventHandler ["HandleDamage", {
    private _damage = call {
        if(condition) exitWith {_unit call val_fn_x;}; // Instant death
        if(condition) exitWith {_unit call val_fn_y;}; // Instant death
    };
    _damage // Damage is now whatever these functions return
}];
#

But only if you had any conditions fire, otherwise it will be nil

#
player addEventHandler ["HandleDamage", {
    private _damage = call {
        if(condition) exitWith {_unit call val_fn_x;}; // Instant death
        if(condition) exitWith {_unit call val_fn_y;}; // Instant death
        0; // Some default value if neither condition fires
    };
    _damage // Damage is now whatever these functions return
}];
wind hedge
meager granite
#
player addEventHandler ["HandleDamage", {
    call {
        if(condition) exitWith {_unit call val_fn_x;}; // Instant death
        if(condition) exitWith {_unit call val_fn_y;}; // Instant death
        0; // Some default value if neither condition fires
    };
}];
```same thing
meager granite
#

spawn command returns thread handle, not thread\function return

wind hedge
winter rose
#

ab-so-lutely readable code

meager granite
wind hedge
meager granite
#

Also if your condition fails, EH returns nothing and engine uses default damage behaviour

#

So pretty much same as returning original _damage

#

Also why stack everything in one line, it makes it unreadable

wind hedge
meager granite
#

if !(local _unit) exitWith {0};
is the same as
if !(local _unit) exitWith {_damage};
because exitWith will not make EH return 0, but will make it return nothing and engine will default to original intended damage of _damage

#

But either way, HandleDamage on remote units does nothing when it fires errorously

#

So it doesn't matter

wind hedge
#

Ok so that is a complete waste, removed

#

My sole objective here was to isolate the REAL _selection rather than the "replicas" that the handledamage EH does with adjacent _selections...

#

When a particular REAL _selection is detected, the EH should make the AI drop its weapon (hand damage), its headgear (head damage) or if the Ai has a vest it should increase the damage a little bit (20%)

#

Ohhh and I added some force applied to ai units getting hit on the leg so they fall and then stand up again....

#

Believe it or not but that messy code I did was working quite well but I don't even know how ๐Ÿ˜…

meager granite
#

What's with _handleInProgress?

wind hedge
# meager granite What's with `_handleInProgress`?

It was my attempt to make the call EXITWITH instead of just going though all the conditions below, because I added the "BODY" first and the "HEAD" last and still the HEAD was firing when I was shooting the unit in the BODY....

#

So the result was me shooting the Ai unit in the body would trigger the Ai unit loosing its headhear 100% of the time and the HINT would say "HEAD", with that last code I posted it mostly posted BODY (The hint) but sometimes the correct _selection would fire and then the proper effect would trigger, unlike before when it was 100% HEAD or 100% body and never the other parts

#

I was just desperate and trying anything to make it work...

#

A shot in the dark if you will

meager granite
#

if (vest _unit != "") then {_damage = _damage * 1.2;}; Why damage increase if unit has a vest? Did you mean it the other way around it?

wind hedge
#

Yes, I want the units with vests take more damage because I hate how bullet spongy the Ai can get when fully geared

#

So I want the same "one/two" shots kills in all my missions even if the enemy Ai have vests (and I know I could just remove their vest but then they don't look as dangerious...

#

And yes, I am weird like that, sorry ๐Ÿ˜…

#

I prefer adding more enemies that take one/two shots to take down rather than few enemies that require 4/5 pistol shots to take down...

meager granite
#

Reorganized your code a little bit, I guess this is what you intended

#

It can be restructured even more to get rid of these exitWiths and some ifs

#

Another point I'd make is that checking by selection name might not always work because unit models change with uniforms and selection names change too

#

There was even an example of that with vanilla assets

#

Also _deltaDamage > 0.4 is a lot of damage, if unit has one of top vests you're very unlikely to pass more than 0.4 damage at once with a pistol shot

wind hedge
meager granite
#
CAManBase
["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"]
B_Soldier_VR_F
["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","hand_l","hand_r","arms","hands","leg_l","leg_r","legs","body"]
```The only different one is VR costume, because it needs to highlight body parts thus has different selections and more hit parts
#

Might still be a case for modded units, they might still call selections differently

#

So I'd advise to check _hitPoint instead

#

But that's a minor edge case

#

Checked 1.14 configs and indeed there are czech named selection names:

class HitHead {
    armor = 0.7;
    material = -1;
    name = "hlava_hit";
wind hedge
meager granite
#

I think these selection names leaked into some uniform models, underwear one for sure

wind hedge
#

But worst case scenario the only downside to the current implementation is that the effects won't trigger (weapon drop, headgear drop etc) so it is not such a big downside

#

just tried the code you optimized and it is just so good now... works like a dream

meager granite
#

๐Ÿ‘

wind hedge
meager granite
#

Join one of the servers with "King of the Hill by Sa-Matra" missions

#

There is also RHS version

#

Usually has plenty of players

queen cargo
#

better disable it again @grizzled cliff

#

i still see like a ton of shit that has to be changed in a kinda important project before you are allowed to name yourself as "SQF God"

tough abyss
south swan
#

insert a Headless Client unit

#

although that seems tad outdated

#

current location

#

and give it a Variable Name after placing

tough abyss
#

thanks for the help

pulsar bluff
meager granite
modern meteor
#

Hello, I am testing a spawn script. In this case I want to spawn units at player position and initiate a patrol. Unfortunately nothing happens when I execute the script. What am I doing wrong?

fnc_SpawnOpUnits = {

    _opUnitList = [

    "B_recon_M_F",
    "B_recon_M_F", 
    "B_recon_M_F",
    "B_recon_M_F",
    "B_recon_M_F",
    "B_recon_M_F",
    "B_recon_M_F",
    "B_recon_M_F",
    "B_recon_M_F",
    "B_recon_M_F"
    
    ];

    //hint "Spawning...";
    
    amount = 5;
    location = getPos player;
    
    _selector = 0;
    _pick = _opUnitList select _selector;
    
    for [{_x = 1}, {_x < amount}, {_x = _x + 1}] do {
        
        _grp = createGroup [west, true];
        _grp allowFleeing 0;
        _grp enableDynamicSimulation true;
        
        _newOpUnit = _pick createUnit[(getPos location), _grp];
        
        sleep 0.5;
        
        [_grp, (getPos location), 60] call bis_fnc_taskPatrol;
        
        if(_selector <= 11) then {
            
            _selector = _selector + 1;
            
        } else {
            
            _selector = 0;
        };
    };
    
    //hint "Done";
    
};
meager granite
#

You're not running with -showScriptErrors parameter to see when your scripts error out.

#

Otherwise this script is really bad

south swan
#

if you've posted exactly what you're trying to run - you're not running any code at all, as all of posted is "assign this piece of code to this variable"

proven charm
#

one problem I see is that you set the "location" with getpos and then later u use getpos "location" which isn't going work

south swan
#

and _pick = _opUnitList select _selector; outside of the actual loop, meaning the loop (when actually called) would only spawn the first unit in the list

modern meteor
#

Ok, thanks guys. Apologies, I have very basic scripting knowledge. I understand my errors with getpos "location" but not sure how to solve the other things.

#

My objective is to spawn a group of units patrolling around a coordinate on the map. In the example above I use the player as a reference point.

modern meteor
#

I know the code does not look pretty but at least I got it working in the end. Here is the code:

_opUnitList = [

    "CUP_O_TK_INS_Soldier",
    "CUP_O_TK_INS_Mechanic", 
    "CUP_O_TK_INS_Soldier_FNFAL",
    "CUP_O_TK_INS_Bomber",
    "CUP_O_TK_INS_Soldier_MG",
    "CUP_O_TK_INS_Sniper",
    "CUP_O_TK_INS_Soldier_TL",
    "CUP_O_TK_INS_Commander",
    "CUP_O_TK_INS_Soldier_AT",
    "CUP_O_TK_INS_Guerilla_Medic"
    
];

opUnitSpawned = [];

_total = (count _opUnitList);
rnd = 1;


for "rnd" from 1 to _total do {   
    _pick = _opUnitList select rnd;

    hint "Spawning Soldier";
    sleep 0.5;
    
    grp = createGroup west;
    
_myUnit = grp createUnit ["B_Soldier_F", [6219.83,5448.38,0.00161791],["myMarker1","myMarker2"], 50, "NONE"];    
    [grp, (getPos player), 60] call bis_fnc_taskPatrol;
    rnd = rnd + 1;
hint "Done!";
    
};

I would like to use this code to spawn the units around multiple mission objectives which are assigned to the player so that the area around these objectives gets populated. Does anybody know how to do this?

cosmic lichen
#

why use for and not forEach?

#

rnd var will also exceed limits of array

#

and you don't need to increment rnd

trim wraith
#

Hello, I have a general scripting question:
Is there any advantage to having a conditional function call for e.g. different vehicle classes like Wheeled_APC_F, APC_Tracked_01_base_F, MBT_01_base_F, MBT_02_base_F, etc in the init (or caller, I'm not proficient in the jargon) file with layered if and elseifs, then have separate .sqf function files for each item, or is it better to have init check with all vehicle classes checked and applied at the same time and have a layered elseif conditionals for all class functions in a single file? For example:
init file

if (_veh isKindOf "Wheeled_APC_F") then {
        _veh spawn lgm_fnc_VehicleFunction1;
    };
elseif (_veh isKindOf "APC_Tracked_01_base_F") then {
        _veh spawn lgm_fnc_VehicleFunction2;
    };
elseif (_veh isKindOf "MBT_01_base_F") then {
        _veh spawn lgm_fnc_VehicleFunction3;
    };
else (_veh isKindOf "MBT_02_base_F") then {
        _veh spawn lgm_fnc_VehicleFunction4;
    };

with 4 different VehicleFunctionX.sqf files
or
init file

        _veh spawn lgm_fnc_VehicleFunction;
    }; 

with only 1 VehicleFunction.sqf file that has a similar conditinal layout to the example above.

Thank you.

little raptor
#

And your question doesn't really make sense. What you're doing in those scripts is completely different. So one doesn't have any advantage over the other, since they don't really compare

#

One does different things per vehicle type, other does one thing for several types

pliant stream
trim wraith
#

Sorry if it didn't make sense. I'm not really a coder and sqf is even more of a challenge on my already lacking c knowledge. The main aim is to have the same function defined to apply different values to vehicles based on their classes. For example, I want to have x3 speed multiplier on an APC while x3 speed multiplier on a tank, when a player driver enters a vehicle.

south swan
#

i doubt performance really matters until you start spawning 50 vehicles per frame blobcloseenjoy

trim wraith
#

My question is to whether use class check on the caller function so it can call different function files depending on the vehicle class, or have the caller function call a single file and make the speed change distinctions based on class in that single file.

little raptor
trim wraith
little raptor
#

Either one is fine

#

If it's too long, or used frequently, you can move it to its own function

stable dune
little raptor
#

According to biki

#

But it does stop when condition is met, yes

#

It's only marginally slower

#

But if you were to make that into a switch it would look like: switch (true) do { case (_veh isKindOf "tank"): ... } which I don't like

stable dune
quiet gazelle
#

is return an SQF keyword? i can find nothing about it on the wiki, but VScode highlights it red

meager granite
#

There is no lineIntersectsASL that ignores sea level?

still forum
still forum
winter rose
pliant stream
#

SQF doesn't have functions so it's rather unclear what the semantics of a return command would be.

still forum
#

I'd expect same as if(true)exitWith{X}

pliant stream
#

Though you could easily enough pair it with a function command to disambiguate:

doSomething = function // Takes code, returns code. Sets a function flag.
{
  if (_this) then
  {
    return 42; // Exits the nearest scope with a function flag.
  };
  0
};
#

Or alternatively:

doSomething =
{
  function; // Marks this scope as a function scope, akin to scopeName naming a scope.
  if (_this) then
  {
    return 42; // Exits the nearest scope with a function flag.
  };
  0
};
pliant stream
sullen sigil
#

breakOut

pliant stream
#

Actually it would probably be entirely useless. If you're unconditionally exiting the current scope, you might as well just end the scope.

pliant stream
still forum
#

it does

#

it has alt syntax that returns value

pliant stream
#

Oh, that's news to me.

#

But then i only do A2. ๐Ÿ˜›

sullen sigil
#

hate return commands fr

digital hollow
meager granite
hallow mortar
#

Try terrainIntersectAtASL? It doesn't say whether it ignores water or not

winter rose
#

should be terrain only (hopefully)

meager granite
#

One is bool, another is position

ivory locust
still forum
#

Well I'd love to know what is actually wrong in the old host then that needes to be updated

modern meteor
#
_myUnit = grp createUnit [pick, tasklocation,["myMarker1","myMarker2"], 50, "NONE"];

This sometimes spawns units in the water. Is there a way to avoid this and only spawn on terrain?

manic sigil
hallow mortar
#

or BIS_fnc_findSafePos

ivory locust
foggy stratus
#

I'm trying to override a BI function with my mod, but it fails when starting arma because it can't find commonDefinitions.inc include file (it's assuming my mod path). This is the first line of the function: #include "common_definitions.inc"

#

Can I put a more specific path in there so it finds the include file?

digital hollow
#

There are a few, all different

\a3\missions_f_oldman\Systems\scripts\ActionQueue\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Checkpoint\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Economy\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\FastTravel\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Phone\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Reputation\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SmartMarkers\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SyndikatAgent\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SyndikatCommon\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SyndikatTeam\common_definitions.inc
foggy stratus
#

Perfect, thanks, its the phone one.

modern meteor
patent abyss
#

Hey, everyone. Fairly new to Arma 3 scripting here but I'm no stranger to text code.
I'm trying to setup a Warlords mission - it's nearly complete but I'm at a near standstill after fighting with this for a hours on end...

Adding custom assets into the Request Menu through the description.ext & I've managed to get one unit to show up for BLUFOR and OPFPR.

I cannot add in more than one unit, I either get an error about my description.ext when loading this mission saying I'm missing a brace '}' or that '}' was encountered when '=' was expected.
OR, I get an error saying the unit is already used elsewhere in the script or just no error at all, making me assume it's working - but there's no additional units in the request menu, just the one unit(s) for each faction.

#

If you wish to see my script, I'll throw it in a text file and upload it here if I have perms or just DM.

ivory locust
patent abyss
#

thanks for the help ya'll lmao laughpepe

digital hollow
#

Sometimes having to describe the problem is enough to help you solve it =)

patent abyss
#

That's literally me in a nutshell. I need to get it out of my head to get a better look at it man_of_culture

winter rose
#

aka rubber-ducking (to) the solution!

opal zephyr
#

Can I use "initPlayerLocal.sqf" in an addon? It doesnt seem to be running for me

opal zephyr
#

Is there a method thats equivalent?

little raptor
#

functions with postInit and checking with waitUntil {!isNull player} maybe

#

(and making sure it's not dedicated, etc. so as not to cause an infinite loop)

opal zephyr
#

Thanks

tender fossil
#

What are the limits to single callExtension call in Arma 2: OA v1.64? Input/output max length in bytes etc.?

stray flame
#

I am having a headache and a half over trying to get custom audio to play over radio from a unit. Any suggestions?

#

in description.ext I have this:



class CfgSounds {
Sound[]={};
    class Welcome_1
    {
        name = "Welcome_1";
        sound[] = {"Sound\Welcome.ogg", +25, 1};
        titles[] = {};
    };

    class Prisonner_Thanks
    {
        name = "Prisonner";
        sound[] = {"Sound\Prisonner_Thanks2.ogg", +150, 1 };
        titles[] = {Welcome to the station};
    };

class CfgRadio{
sounds[] = {};
    class Radio_Welcome
    {
        name = "";
        sound[] = {"Sound\Welcome1.ogg", db - 5, 1.0 };
        title = "Subtitles are said here";
    };
    };
};
#

in a trigger, I have

["Events\Commander_Hello.sqf"] remoteExec ["execVM",2];
#

Within this commander_hello.sqf, I have



[Com, "Radio_Welcome"] remoteExec ["sideRadio"];
#

Com = unit I want to talk

#

issue:
Nothing is happening. Even trying to do it
[Com, "Radio_Welcome"] remoteExec ["sideRadio"];

just directly via command console wont do anything.

#

In another place, I have a "Say 3D" command for a unit with a different voiceline, and it works fine.

digital hollow
#

sideRadio works with CfgRadio CfgSentences (pasted wrong thing, sorry)

stray flame
#

is CfgRadio not just a part in description.ext?

digital hollow
stray flame
#

ho no he doesnt put his script and stuff in his description

#

or what he writes in it

digital hollow
#

the example mission link works

stray flame
#

okay this is a little bit helpful but

#

I dont see how that helps me get it transmitted over radio

#

and I dont want a conversation its just one unit talking to the players

#

hmmm

sullen sigil
#

Is there a way to convert vectorDir to azimuth that I'm just entirely oblivious to?

#

much easier for me to work in azimuth then convert to vectorDir meowsweats

granite sky
#

always works in vectors :P

digital hollow
#

[0,0,0] getDir _vector

oblique anchor
#

Yo, anyone knows how do I make addaction to only be for a specific player to see? other players can see the action on that player

granite sky
#

you can also do an arctan, but that getDir usage might be faster.

sullen sigil
#

wouldnt have even thought of that thank you ๐Ÿ™‚

sullen sigil
#

making it slightly more understandable in exchange for performance probably isnt the worst idea meowsweats

digital hollow
stray flame
#

I am

#

mad

#

I went on such a tangent for that

#

at least I know how to get proper lipsync but holy hell

sullen sigil
#

Using bezierInterpolation to get an approximation for the distance along that curve should be fine though, right? meowsweats

stray flame
sullen sigil
stray flame
#

where would I put call?

sullen sigil
#

dont use remoteexec until youve figured out what you want it to do on one pc first.
Com sideRadio "Radio_Welcome";

#

i didnt mean call tf was i on about

#

just without remoteexec is what i meant

stray flame
#

YEAH I feel like im having a stroke with hte awnsers im getting

sullen sigil
#

mood

stray flame
#

remoteexec is not what i have seen as an issue

sullen sigil
#

does Com sideRadio "Radio_Welcome"; work

#

dont use remoteexec until you have it working properly for just your computer in sp first it will save you a lot of headache

stray flame
#

I may try but I belive it worked on say3d but heck, may aswell

#

I never edit a MP mission in sp

#

I only lan host edit

sullen sigil
#

thats uh
concerning

stray flame
#

its simply the best way I have found to make sure as many things as possible work as reliably as they can

sullen sigil
#

convert your thingies to remoteexec once youve got it sorted without first it saves you lots of headache in the long run

stray flame
#

Remoteexec shouldnt be the issue unless I did it twice

#

I remoteExec an entire script with the stuff for dialogue inside

sullen sigil
#

my point stands

stray flame
#

maybe, my problem is

#

I am doing a double remoteexec

sullen sigil
#

you are remoteexec'ing an execvm that remoteexecs a command

stray flame
#

yes I might

#

and I am going to try to untangle that little ball of yarn

sullen sigil
#

is there any specific reason for this to be scheduled btw

stray flame
#

Removing the remoteexec in the script does not work

#

but I do figure it wont hurt either cuz the script is already well

sullen sigil
stray flame
#

no

stable dune
stray flame
#

I can try

sullen sigil
stray flame
#

no a word form the man

stray flame
sullen sigil
#

yeah that

stray flame
#
allowedFunctions[] = {"BIS_fnc_execVM"};


respawnOnStart = 0;


zeusCompositionScriptLevel=2; 






class CfgSounds {
Sound[]={};
    class Welcome_1
    {
        name = "Welcome_1";
        sound[] = {"Sound\Welcome.ogg", +25, 1};
        titles[] = {};
    };

    class Prisonner_Thanks
    {
        name = "Prisonner";
        sound[] = {"Sound\Prisonner_Thanks2.ogg", +150, 1 };
        titles[] = {Welcome to the station};
    };
};
class CfgRadio{
sounds[] = {};
    class Radio_Welcome
    {
        name = "";
        sound[] = {"\Sound\Welcome1.ogg", +15, 1.0 };
        title = "Subtitles are said here";

    };
};
stable dune
#

It doesn't give error?
You have one }
Too much there,
CfgRadio should be own

#

I think you have radion currently in cfgSounds

sullen sigil
#

^

#

cfgsounds should have a closing } below prisonner_thanks closing }

stray flame
#

let me edit the message and tell me if im doing it right

#

is this right?

sullen sigil
#

yes

stray flame
#

I will try it then

sullen sigil
#

wait no

stray flame
#

hm?

sullen sigil
#

you have an extra };

stray flame
#

at the end?

sullen sigil
#

chop the one underneath Radio_Welcome's closing } off

stray flame
#

like that?

sullen sigil
#

yes

#

lift a finger for every opening bracket lower a finger for every closing bracket

stray flame
#

I would use notepad++ but sometimes im lazy

#

okay okay we are seeing results

#

but he only like

#

tapped the radio once, I will check the file path

#

okay so, I am still having issue with something

#

I dont know whats up

#

but it seems like everything is working except somehow the broadcast of the radio message

#

it just does the sound of a radio beginning broadcast and then nothing

#

there is an animation played by the character talking so I know the script works.

stray flame
#

magic, it works

dreamy kestrel
#

Q: so with entities you can include classes, and whether to include crews, I assume that includes AI in drone positions? but does not let you specify a range about an object, position, etc? so if we used this, we would need some points of interest about which to narrow the result set?
https://community.bistudio.com/wiki/entities

meager granite
#

entities [...] select {_x distance player < 1000}

granite sky
#

If you need it to be fast then entities [...] inAreaArray [getPosATL player, 1000, 1000]

sullen sigil
#

I do believe I'm being daft however I've no access to a dedi server right now to test -- setVelocity on an object created on the server with createVehicle is correct usage, right, due to the object being local to the server?

granite sky
#

Assuming that it's still local to the server, yes.

#

If a player gets into the vehicle as driver then the locality changes to that player's client and then any subsequent setVelocity needs to run there instead.

dreamy kestrel
#

nice thank you both for the feedback

shut reef
#

Is there a way to open the "mission load" window of 3den from the main menu?
I can't seem to find how it's actually opened, the ui menu config seems to refer to something in-engine, not actually calling an exposed function.

warm hedge
#

I do not think there is a way. I've tried to see how it's done recently but it indeed is Engine driven

crystal lagoon
#

The saga of my radio jamming script is at an end. I just need some help understanding a specific value inside it

#
YourFunctionName = {
  params ["_jammer","_gain"];
  _jammerArea = [getpos _jammer,200,200,0,false,200];
  while {alive _jammer} do {
    {
        _gain = if (_x inArea _jammerArea) then [{0},{1}];
        _x setVariable ["tf_receivingDistanceMultiplicator", _gain];
        _x setVariable ["tf_sendingDistanceMultiplicator", _gain];
    } foreach allPlayers;
    sleep 5;
  };
  {
    _x setVariable ["tf_receivingDistanceMultiplicator", 1];
    _x setVariable ["tf_sendingDistanceMultiplicator", 1];
  } foreach allPlayers;
};
#

Specifically the getpos value

crystal lagoon
#

I've seen a similar getpos value in another script

sharp grotto
#

the getpos is part of the above command ^^

crystal lagoon
#

I see

#

I just tested it and it works.

stable dune
#

Yeh sorry

crystal lagoon
#

np

#

I'm just not gonna monkey around with it longer than I have to

stable dune
#
_val = if (true) then [{ "true" }, { "false" }];
hint _val;```

Is in example.
Just read 1st ![notlikemeow](https://cdn.discordapp.com/emojis/700311897937018890.webp?size=128 "notlikemeow")
stable dune
crystal lagoon
#

No, it comes from an init file

#
call compileScript ["jammer.sqf"];

[jammerName] spawn YourFunctionName;
[secondJammerName] spawn YourFunctionName;
\\\add more as needed
stable dune
#

Because using allPlayers, I bet you are using that on MP.
So that will spawn for every client current script.
So every client will check same thing and will add current values every 5 sec forEach player.
You should change that to spawn from server or if you want every client do check for own then pop out allPlayers part and change _x to player.

But still, you asked getPos value.

Just add in script

_pos = getPos _jammer;
systemChat str(_pos);
_pos2 = _jammer modelToWorld [0,0,0];
systemChat str(_pos2);
crystal lagoon
#

Oh, I just wanted to know what it meant. The person before pointed me to the right line, it's inArea

crystal lagoon
stable dune
# crystal lagoon You mean an initServer file?

Well yes, but depends how does tf_.. variables are checked. If those are checked local , then you need setVaribales for each client like it's currently.
Because setVariable add current value local.
So if you run it only server it will add current variables on server and only change those on server.
Well Im not best person to explain.
But see
https://community.bistudio.com/wiki/Variables
https://community.bistudio.com/wiki/Multiplayer_Scripting
https://community.bistudio.com/wiki/setVariable

crystal lagoon
#

tf relates to the TFAR mod

shut reef
manic kettle
# crystal lagoon You mean an initServer file?

The tf variables are LOCAL. I recommend against trying to use allPlayers in this context. Simply run this from the init, add a check so it runs only on players, find if they are in the area or not, set the variable to player. Repeat every 5 seconds or so.

#

In my version I also play a white noise sound effect to let players know they are being jammed. You could try something similar. Like a systemChat or hint msg even works. Just a suggestion

stable dune
crystal lagoon
#

I'll be honest, arma coding makes my fucking head spin

manic kettle
#

If that's in init.sqf then it's going to run on the server and all the clients too. So if it's 20 players it'll set the variable 20 times...
You could run it from the serverInit... but honestly that's a lot of traffic that could be avoided by just running it player side

crystal lagoon
#

There's another code I found that runs on initPlayerlocal but it's way more complex and I couldn't really wrap my head around some of it

#

Mostly numbers and true/false values

manic kettle
#

You don't have to do much. Just remove all the forEach allPlayers and replace _x with player. Then run it from init.sqf

At the top stick this
if !hasInterface exitWith{};

crystal lagoon
#

Like this?

YourFunctionName = {

  if !hasInterface exitWith{};

  params ["_jammer","_gain"];
  _jammerArea = [getpos _jammer,200,200,0,false,200];
  while {alive _jammer} do {
    {
        _gain = if (player inArea _jammerArea) then [{0},{1}];
        player setVariable ["tf_receivingDistanceMultiplicator", _gain];
        player setVariable ["tf_sendingDistanceMultiplicator", _gain];
    }
    sleep 5;
  };
  {
    player setVariable ["tf_receivingDistanceMultiplicator", 1];
    player setVariable ["tf_sendingDistanceMultiplicator", 1];
  }
};```
manic kettle
#

Probably? I'm confused what you're doing with your gain, but the rest looks ok...

crystal lagoon
#

Some wizard on the forums posted it in response to a request for help and it works better than what I had

#

Previously, the players would have their radios permanently disabled if they destroyed the jamming device while they were in the radius

manic kettle
#

Yep that's why you reset it after the while loop

crystal lagoon
#

The other one I was looking at is in this post

still forum
winter rose
#

[1, 0] select bool is known
if (cond) then [{then}, {else}] is not ๐Ÿ˜†

still forum
#

if !hasInterface exitWith{};
missing parenthesis ๐Ÿ‘€ ahhh

#

I mean.. Its... a style.. but.. eh..

winter rose
still forum
#
  {
    player setVariable ["tf_receivingDistanceMultiplicator", 1];
    player setVariable ["tf_sendingDistanceMultiplicator", 1];
  }

that btw does nothing
you want to either get rid of the {} or add a call infront
(don't add a call infront)

#

params ["_jammer","_gain"];
Why is the gain a parameter? its always overwritten

#

Actually this does nothing at all either

    {
        _gain = if (player inArea _jammerArea) then [{0},{1}];
        player setVariable ["tf_receivingDistanceMultiplicator", _gain];
        player setVariable ["tf_sendingDistanceMultiplicator", _gain];
    }

Was this code written by AI?

#

the top is using 2 space indent, inside the while is using 4 space indent, and the bottom is using 2 space indent again.. whaa

#

ahhh I can't let this be ๐Ÿ˜„

YourFunctionName = {

  if (!hasInterface) exitWith {}; // Executed on non-player
  if (!canSuspend) exitWith {_this spawn YourFunctionName}; // Called from unscheduled

  params ["_jammer"];
  private _jammerArea = [getpos _jammer, 200, 200, 0, false, 200];
  while {alive _jammer} do {
    private _gain = [1,0] select (player inArea _jammerArea); // if player in area gain is zero
    player setVariable ["tf_receivingDistanceMultiplicator", _gain];
    player setVariable ["tf_sendingDistanceMultiplicator", _gain];
    sleep 5;
  };

  // reset jamming if jammer died
  player setVariable ["tf_receivingDistanceMultiplicator", 1];
  player setVariable ["tf_sendingDistanceMultiplicator", 1];
};
winter rose
#

I can't let this be
the code fixers curse

full swan
still forum
still forum
# still forum ahhh I can't let this be ๐Ÿ˜„ ```sqf YourFunctionName = { if (!hasInterface) e...

Also pretty sure tf_receivingDistanceMultiplicator is wrong.
Code says the smaller the value, the larger the range you can receive.
So you wouldn't set that to zero to disable receiving/jam the signal... You want to set it to a high value
in TFAR 1.0 it would make more sense to use TFAR_globalRadioRangeCoef global variable.
That's smaller==smaller range, larger == larger range (minimum value is 0.0001)

full swan
#

I checked the RPT, it's empty

#

it's inside a spawned block inside a function that is spawned from a while loop inside a spawned block from init.sqf

#

well.. After further experiments, it seems that I've somehow killed the sleep function in every script ๐Ÿ˜„ It doesn't respond anywhere

#

but it works when launched from debug console...

winter rose
#

my bet is that you run this sleep somewhere unscheduled - where is this code?

full swan
full swan
winter rose
#

and where is that function called?

#

run diag_activeScripts? I suspect a thread saturation

stray flame
#

ima just drop a quick question and get back to it later, I just wanna know if its worth diving into.

Can you put lipsync from the .lip files onto characters doing say or say3d?

#

without conversation or something like that.
Also worth mentioning its for MP

winter rose
stray flame
#

well, how so?

#

like atm I have

#

Captive_1 say3D "Prisonner_Thanks";

winter rose
#

with say (and say3D too I suspect), if the file is voice1.ogg, the lip should be voice1.lip and next to the ogg file
that's it

stray flame
#

so it will automatically sync to the .lip with the same name?

winter rose
#

ye

stray flame
#

thats really cool

#

thanks for the help

winter rose
#

anytime!

winter rose
#

because one must not spawn a thread for each unitโ€ฆ gooby pls

tough abyss
#

I am curious @queen cargo, could you give some examples of those things that should be changed and why?

full swan
#

the functions are spawned only after a set of conditions which are hard to accomplish

winter rose
#

doesn't explain why sleep doesn't work

full swan
#

[3,0,0,1] before satisfied conditions (debug console)
[5,0,0,1] right before sleep
[4,0,0,1] after (ran from debug console)

tough abyss
#

I assume you are either talking about ACE or ACRE, no?

queen cargo
#

simple and fast example?
ACE3, interaction menu
not only the functions are a mess right now, its also the concept behind it which is not optimal solved

full swan
#

so the spawned block just crashes? ๐Ÿ˜„

#

without error or anything? ๐Ÿ˜„

queen cargo
#

never checked ACREs code as there is no need for me

#

i do know its quite some solid stuff

full swan
#

11:35:36 Starting mission: 11:35:36 Mission file: quickie_kavala 11:35:36 Mission world: Altis 11:35:36 Mission directory: C:\Users\ffredyk\Documents\Arma 3\missions\quickie_kavala.Altis\ 11:35:36 EPE manager release (1|38|0) 11:35:36 EPE manager release (0|1|0) 11:35:38 [CBA] (xeh) INFO: [86387,1241.04,0] PreInit started. v3.15.8.220912 11:35:38 [CBA] (settings) INFO: Reading settings from settings file. 11:35:38 [CBA] (settings) INFO: Finished reading settings from settings file. 11:35:38 [CBA] (xeh) INFO: [86387,1241.12,0] PreInit finished. 11:35:44 soldier[O_G_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:44 soldier[O_G_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:44 soldier[O_G_Soldier_LAT2_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:44 soldier[O_G_Soldier_LAT2_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:45 Mission id: e7eccdee5e253db63f26f1c1caf865f9e092c373 11:35:48 [CBA] (xeh) INFO: [86516,1250.95,0] PostInit started. MISSIONINIT: missionName=quickie_kavala, missionVersion=54, worldName=Altis, isMultiplayer=false, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false 11:35:48 [CBA] (versioning) INFO: [86516,1250.96,0] VERSIONING:cba=3.15.8.220912 11:35:48 [CBA] (xeh) INFO: [86516,1250.96,0] PostInit finished.
End of RPT

winter rose
#

your machine is cursed, apply gasoline and match

lone glade
#

Feel free to PR your changes then....

winter rose
#

just for the lolz, canSuspend returns true?

queen cargo
#

but also think that i could find something in there too (like you can find in every project)

tough abyss
#

Why do you think the interaction menu's code is a mess?

winter rose
full swan
#

๐Ÿคฃ

queen cargo
#

not my job @lone glade, my job is to rage about it

#

check the backlog of skype @tough abyss (or wait ~2 hours so that im back to my PC)

trim wraith
#

I have a question about live editing: Is this method viable for general use with any mod, or does such an approach require some specific scripting in the mod for it to work?

#

This is from the Antistasi GitHub, and building the mod from there and having this makes the recompile function button work as intended, refreshing the shown function in game. However, I wasn't able to get it with a standalone mod I'm working on.

tough abyss
#

I no longer have Skype installed, I'm afraid.

still forum
trim wraith
#

Thank you, I'll try to figure this out but restarting the mission would work as well

#

With the mission restart method, you simply work with loose mod directory instead of with packaged .phos, right?

jade abyss
#

Same here, no need to anymore. Only installed it for A3 Groupchats

trim wraith
#

Otherwise you'd need to repackage the mod and restart the game if I know correctly

still forum
#

... ish

#

not in @mod/addons folder
but the mod basically placed directly in game folder
in my case
Arma 3/z/TC/addons/main/config.cpp for TacControl

queen cargo
#

there is the webclient too

trim wraith
#

You have no other mod packages or loose files anywhere else for this?

#

Or any special directory calling code?

queen cargo
#

meh

still forum
#

If you have filePatching on, Arma looks up files by their path, in game directory

queen cargo
#

was not right link ... but its something like that

lone glade
#

you can probably access the logs through outlook

jade abyss
#

pff, meh.

still forum
#

in my case my script is in ingame path z/TC/addons/main/init.sqf
So if I put it in
Arma 3/z/TC/addons/main/init.sqf, Arma will load it from there, instead of loading whatever is in my mod's PBO

So I load my normal mod as PBO, but I also have these files in game directory which will override the ones that were in PBO

trim wraith
#

Thank you

#

One last thing: with this, I'd need to restart the mission to see changes in the function viewer, and recompile function button wouldn't work with it, right?

still forum
#

recompile would also work with that

#

if you set it up

#

(allow recompile in CfgFunctions, enable filepatching, call that recompile func)

trim wraith
#

I tried the same approach, but I think instead of trying mission restart, I went with recompile (without having the above-mentioned recompile function embedded) and failed.

still forum
#

all that recompile thing does, is load the script from disk and put it in the variable again

#

as with filePatching, it loads the script from the separate file, instead of pbo. It doesn't matter if it loads because of mission restart, or loads because you run that recompile func

queen cargo
#

in short: the global variables require a "hack" to be extended
also, the functions are not rly optimized in it

trim wraith
#

Alright, thanks a lot.

queen cargo
#

as said

#

when i got more time

#

i could explain further

#

or you just check the skype backlog ...

#

or the functions

#

quite sure if i would dig deeper i would find even more crap in there (just like i did when i just checked out one time CBA ...)

tough abyss
#

Sure. Give me some specifics if you are up to it, when you got some time.

queen cargo
#

and for the PR
no, just no
i wont align to some stupid GVARWhatever shit rules
hell fucking no!
it just makes shit more confusing to read and harder to debug

#

but it is cool because "YEEE WI UZ MACROZ"

lone glade
#

No it doesn't, GVAR = mod_pbo_varName

queen cargo
#

just that you cant just C&P the var into your clipboard

#

no you have to resolve it first per hand

#

like with every other crap macro in there

#

a waste of time

lone glade
#

You avoid overlapping vars ...

queen cargo
#

pff

#

you dont

#

you just do it differently

#

instead of writing the var by yourself aligned to some convention

#

you let the macro do that for you

#

which either shows youre not capable of doing that

#

or you just wanted to use macros because "they are cool"

lone glade
#

or because it's easier to maintain ?

queen cargo
#

its like saying that youre not allowed to have non-constant constants in your code (eg. foo(10) would not be allowed and the 10 has to be made into a macro)
thats bullshit which costs time

#

also wrong

sullen sigil
#

is creating a new eachframe missioneventhandler for each setvelocitytransformation then deleting it once the transformation is finished an awful idea

queen cargo
#

where is a macro saving you time to maintain

#

...

#

hell

sullen sigil
#

i feel like it is for some reason but i do not know why

queen cargo
#

i could continue like this forever -.- but have to rly leave now

tough abyss
#

I assume you are talking about magic variables.

lone glade
#

good grief

tough abyss
#

Which really is about providing a useful meaning to a value

jade abyss
#

but it is cool because "YEEE WI UZ MACROZ" <-- Totaly agrees...

still forum
#

do the returned ID numbers increase, or do they reset back to low number when they're deleted?

#

I assume increase, which would be bad when you get into the millions range

#

I think mission eventhandlers are implemented in a way where it doesn't waste any memory (there are differences between the different handler types)

queen cargo
#

@lone glade while im away, feel free to create some arguments why it is easier to maintain with the macros
i will nicely negate all of em

lone glade
#

Oh you don't need to wait

queen cargo
#

actually i have to

#

im gone

lone glade
#

it's easier for everyone to type GVAR(size) instead of mod_pbo_varName

queen cargo
#

bb

still forum
#

no typing mistakes in mod_pbo

daring zinc
#

(edited)

the irony

#

:P

still forum
#

who u mean? ^^

drowsy geyser
#

Is it possible to disable the ability to "disable ai" when hosting a scenario?

fleet sand
little raptor
#

You can run a loop and check if it changes tho

drowsy geyser
#

I have some conditions like this:
waitUntil {!(isnull someplayername) && time >0};
But if ai disabled I get error

winter rose
#

ah you mean "disable AI for the slot"

drowsy geyser
#

Yes

winter rose
#
if (isNil "somePlayerName") exitWith {};
waitUntil { sleep 0.1; !isNull somePlayerName && time > 0 };
drowsy geyser
#

Thank you!

trim wraith
#

Is there any way to read a vehicle`s parameters in a script file? For example, reading maxSpeed or accelAidForceSpd of a vehicle (and operating on it) direclty without resorting to velocity and direction?

winter rose
trim wraith
#

I want to read a vanilla vehicle's maxSpeed, then set accelAidForceSpd to 1/5th of maxSpeed, then add high accelAidForceCoef to it.

tough abyss
#

We all know that X39 is the SQF god.

winter rose
#

configOf to get the vehicle's config, then e.g getNumber

#
private _maxSpeed = getNumber (configOf vehicle player >> "maxSpeed"); // the path may be wrong
kindred zephyr
#

however what you just described is not possible, what you want to modify, both are config entries

trim wraith
# winter rose reading config yes, modifying config no

how do I fetch the parameter value? I try:

private _maxspeed = maxSpeed _veh;

but the syntax parser doesn't recognice maxSpeed
Is using the

_value = getNumber (configFile >> "CfgVehicles" >> "Thing" >> "maxSpeed");

In the Config wiki the right way to do this?

kindred zephyr
trim wraith
#

wouldn't this apply immediate velocity changes to current speed? for example, wouldn't it add +10 forward speed immediately and not gradually compared to accelAidForceCoef, which decreases as the speed reaches accelAidForceSpd?

winter rose
hallow mortar
#
  • actual calculation would be more complex, probably have a cap to avoid insane boost at low speed, safety to prevent negative boosting when above the target speed, etc
astral bone
#

is it a mod or does ["hello world"] call BIS_fnc_error in the eden editor work?

#

oh wait, I could just ask my original question- How does switch execution order work? xD

#
private _myFunc = {
    systemChat "0";
    case 1: { systemChat "1" };
    systemChat "2";
};
``` from the switch wiki page, this is acceptable to the game, and has a thing that says "order can be difficult to understand" but doesn't elaborate.
#

oh wait wrong part xD

#

well, uh- I just realized this is pointless

hallow mortar
#

That seems like a really niche quirk that you almost certainly don't need to exploit tbh

astral bone
#

Not only that, but I also can't use switches, I don't think. I need to compare numbers, including if greater/less than

hallow mortar
#
switch (true) do {
    case (_num1 < _num2) : { ...```
astral bone
#

Oh huh-

#

Well I'ma write my code to get it working I think, b/c I am having a hard time even doing that xD

winter rose
astral bone
#

"What if I do X? Oh what about Y! I could do Z maybe?"

cyan tide
#

How do I work with an unpacked pbo file when scripting ArmA3? Because if I work with the pbo file, I cannot update it in the game, I have to close the game and open it again to change my pbo file, which causes a lot of time wasted. I found this thread on the forum but no one seems to have posted a solution.https://forums.bohemia.net/forums/topic/184587-pboprefix-and-filepatching/

winter rose
cyan tide
#

Yes, I thought about it, I'll try it, but doing it with PBOPREFIX on the wiki seems to make my job much easier.

winter rose
#

what does it have to do with script? AFAIK you can't read it

digital hollow
#

Is your folder [symlinked] in the Arma 3 install folder?

cyan tide
cyan tide
winter rose
#

then make it work in a mission, then pack it

#

doing it with PBOPREFIX on the wiki seems to make my job much easier.
no idea what that has to do with it

winter rose
cyan tide
digital hollow
sullen sigil
#

trust lou on that one its lead to me being able to make mods in 2 days

cyan tide
#

actually at the bottom of the page there are these tags and the updated date, it should work in arma 3 but I guess it doesn't work properly.

cyan tide
winter rose
#

really, if script only I only recommend you to debug them in a mission, I really don't see what issue having a PBO solves
PBOing should only eventually be used for MP testing, and for release, period

cyan tide
#

myAddon file contains my pbo unpacked data, i have only 1 pbo file

prisma glen
#

He's got the antipathy down pat

sullen sigil
trim wraith
digital hollow
winter rose
trim wraith
#

yes, this works

astral bone
#

getVariable undefied, is it any when formatted?

#
hint "";
_max = _this getVariable "ratchet_ace_maxFuelCargo";
_cur = _this getVariable "ace_refuel_currentfuelcargo";
hint format ["%1 \n %2",_max,_car];
-1
any```
#

oh no wait

#

_car xD
_cur is now <null> which makes more sense then it being any

tough abyss
#

Anyone knows what script I can use?

tough abyss
hallow mortar
#

You need to create a GroundWeaponHolder(_Scripted?) and add the magazine to its inventory

tough abyss
hallow mortar
#

Magazines can't exist on their own. You need to create a holder object (classname GroundWeaponHolder) which is a sort of invisible container, and put the magazine in it.

still forum
# cyan tide x\myMod\addons\myAddon

IF the pbo prefix was correctly applied to the pbo
Then you'll have
Arma 3/x/myMod/addons/myAddon/config.cpp
right?

You can open the pbo in Notepad++
if the prefix was correctly applied, you will see
prefix NUL x\myMod\addons\myAddon
close to the start of the pbo
if that is not there, the prefix wasn't correctly applied when packing pbo (setting prefix depends on what tool you use to pack pbo)

astral bone
#

Yall ever forget how math works?
"Why is there 100 left over after I filled up a 650 barrel with 50 already in it with 700? Why isn't it 50?" b/c you already had 50 maybe xD

granite sky
#

Addon builder UI is pretty awful for prefixes and you want to script that.

granite sky
#

And yeah, we use filepatching for developing Antistasi :P

ivory locust
#

@still forum Seems like sqf::distance_2d is returning zero for everything

still forum
#

mh code looks correct t ome

#

Also you probably should't call sqf for distance_2d
Intercept has native c++ vector functions to do that

ivory locust
#

Ah I see

#

I'll try them instead
types::vector3::distance_2d is working, thank you

proven charm
winter rose
granite sky
#

Nah, we're a mod these days.

summer merlin
#

Can someone send me a link to animation tutorial/scripting basics? I can't find a noob friendly one? It's a shame to play arma 400+ hours and not know how to script

jade abyss
simple trout
lone glade
#

There really isn't any up to date

#

the BIKI is your best bet

tough abyss
#

What are you trying to do? Almost all animations are done by model config and not in scripts

granite sky
#

Oddly enough my workflow now is better than when it was a mission :P

simple trout
#

you have been looking at math equations for too long. It's okay john we don't need good dive bombers

winter rose
granite sky
#

(this is because my workflow was deeply suboptimal before)

#

Nah, just never figured it'd run from the editor with a bit of folder mapping.

simple trout
granite sky
#

So I'd build the thing to PBO and back Arma out to the main menu each time.

simple trout
#

Lol, I do the same

#

Really feels like I'm compiling a c++ application everytime

granite sky
#

Mod + filepatching is just save file and restart mission.

#

Unless you messed with hpp, in which case it's rebuild time.

simple trout
#

lol, we really need a better solutions for members.hpp

#

file_exists cmd does exists

#

At this point could BI just bring back the Java Support from Take on Helicopters? lol

winter rose
#

stahp or I will have to ban you all
heathens

#

:D

simple trout
#

Hold on Lou, what if I promise you 25% percent of all the bitcoins I mine in Java, if you bring back Java /s

ivory locust
#

J*va ๐Ÿ˜ท

faint oasis
#

Hi, is it possible to move an helicopter just above a specific point ? Because i'm making a custom "slingload load/unload" waypoints but the "move" command is not accurate enough for that so is it possible to move an helicopter with very good accuracy like the vanilla "load/unload" command ?

granite sky
#

Because the waypoint terminates at 50m or something?

faint oasis
granite sky
#

You could do the last bit with some setVelocityTransform horror. Not having any better ideas at the moment.

#

Maybe if you control the waypoint speed and you know what heli it is you could set the waypoint a bit beyond and it'll be pretty accurate.

#

Hmm no, waypoint updates are too random for that.

faint oasis
#

i will try the setVelocityTransform to see if it's good or not

granite sky
#

setVelocityTransform stuff will work but it's a lot of work.

#

Fairly simple case at least.

winter rose
#

can't you hook (hehe) the slingload waypoint itself, as the helicopter's AI does the job already?

granite sky
#

hmm, wonder what happens if you put an invisible landing pad in mid-air :P

sullen sigil
#

ai does try to land on it iirc but has object avoidance

#

and terrain

faint oasis
# winter rose can't you hook (hehe) the slingload waypoint itself, as the helicopter's AI does...

sadly not because i want to lift objects that don't have "Memory Points" in their models and their P3D are binarized so i can't modify them. I wanted to modify the P3D of the "Container" but it is binarized so i can't do nothing. I didn't try to put an array instead of a memorypoint in the config but i'm pretty sure it's not working. They added this to the "createRope" but i'm not sure if they added this in the config.

digital hollow
faint oasis
digital hollow
#

there's a rope connected EH

winter rose
#

that or the normal slingload waypoint that completed

faint oasis
#

ok but how can i hide the object that can be slingloaded without losing the feature ? Because i tried "HideObjectGlobal" but the object is like frozen.

hallow mortar
#

If the real object is big enough, you can simply put the slingload proxy inside it

#

Also, if modifying the P3D was a possibility, this must be a mod, right? So you can make your own invisible slingload-capable object and include it in the mod

faint oasis
sullen sigil
#

hiding object just makes it no longer exist in the physical plane iirc

faint oasis
faint oasis
hallow mortar
faint oasis
#

then yeah but the object need to be slingloadable and need to have the same size of the container

hallow mortar
#

Well, that's up to you

faint oasis
#

this is not a real problem but i need to attach the container to this object

hallow mortar
#

If only there was some sort of script command which you could use to attach things To other things

faint oasis
#

for now the best thing is probably the setVelocityTransformation

sullen sigil
#

is this for a cargo container

faint oasis
sullen sigil
#

are those really not sling loadable by default?

faint oasis
hallow mortar
faint oasis
#

it's not a question of mass, it's a question of memory points. I checked the p3d itself using a converter and there is no memorypoints inside

#

except 3 that are for the doors

digital hollow
#

Shameless self-promo but you can easily rig those with Sling Load Rigging, albeit not via vanilla magic rope.

faint oasis
sullen sigil
#

its ampersands mod

faint oasis
#

ah yeah

#

i saw his mod

sullen sigil
#

(quite a good one)

faint oasis
#

but it's a manual thing, and i want something for the AI

digital hollow
#

If you don't want to worry about attach/detach collision, my initial idea was to use the bait object to get the chopper in place, then script the ropes, and delete the bait object.

faint oasis
#

Btw so thank you, now i will try the setVelocityTransformation to see what i can do.

sullen sigil
#

dont expect to be able to use velocity on setvelocitytransformation

#

if setvelocity does not work on the object then the velocity parts are ignored

faint oasis
#

yeah i checked and it seems to be something animated with lerp. The only thing i hope is the rope are following the animated vehicle.

sullen sigil
#

so long as theyre attached to it theyll b fine

faint oasis
#

awesome then

sullen sigil
#

currently having to alter how quickly the interval passes to make acceleration effect on a static object for selveltransform notlikemeowcry

granite sky
#

Note that if your setVelocityTransformation becomes sufficiently complex, it might be cleaner just to set pos/vel/dir in a loop yourself instead.

#

As far as I know it's just a shortcut to lerping everything yourself.

faint oasis
#

i think i will use the linearinterpolation function because to be honnest it's all i need.

#

the dir will be the same, the velocity will be stopped, so i just need to lerp the positions

sullen sigil
#

my main problem is getting the distance along the curve that will happen prior to doing it and I think I may have to end up using bezierInterpolation to add together the distance between steps notlikemeowcry

opal zephyr
#

Does "playSound3d" suspend the code until the sound is complete? It seems to be delaying my code running until its done playing...

crystal lagoon
still forum
#

Well as I said, it doesn't really, because youre not setting receiving distance thing correctly

#

people inside jammer won't be able to send

#

but they can still receive

crystal lagoon
#

I'm fine with it. I don't want to monkey around more than I have to and gives zeuses the ability to inform squad leads of stuff.

#

I can try the initplayerlocal one, but I don't really understand it

summer merlin
#

I watched many videos, but apperantly, everytime I try anything I always fuc_ up and it doesnt work

#

Nvm

#

Nvm I'll try again,

#

but a link to good tutorial won't hurt

tough abyss
#

There are no tutorials about animations that I am aware of. And from my experience tutorials won't help you learning scripting.

#

It's all trial and error. Hard work.

coarse dragon
#

is there a way to teleport the player?

sullen sigil
#

setposasl

stray flame
#

hey, ive read that when you spawn groups using scripts, its a good idea to have deletewhenempty on the groups in order to save on long term prefromance

#

I have a script where I have tried to do that without much sucess

#

_grpG4 = [getMarkerPos "Enemy_Garrison_3", east, ["OPTRE_Ins_ER_Warlord","OPTRE_Ins_ER_Guerilla_AR","OPTRE_Ins_ER_Militia_MG","OPTRE_Ins_ER_Guerilla_BR","OPTRE_Ins_ER_Guerilla_AR","OPTRE_Ins_ER_Rebel_AT"],0] call BIS_fnc_spawnGroup;   
_wptG4 = _grpG4 addWaypoint [getMarkerPos "Enemy_Garrison_3",5];
_wptG4 setWaypointType "SCRIPTED";
_wptG4 setWaypointScript "\z\lambs\addons\wp\scripts\fnc_wpGarrison.sqf";

sleep 1;

_grpG4p = [getMarkerPos "Enemy_Garrison_3", east, ["OPTRE_Ins_ER_Insurgent_BR"],0] call BIS_fnc_spawnGroup;  
_wptG4p = _grpG4p addWaypoint [getMarkerPos "Enemy_Garrison_2",5];
_wptG4p setWaypointType "SCRIPTED";
_wptG4p setWaypointScript "\z\lambs\addons\wp\scripts\fnc_wpPatrol.sqf";

//rules

sleep 2;
{_x deleteGroupWhenEmpty true;} forEach [_grpG4, _grpG4p]; 
//where the fault is




#

any suggestions?

sullen sigil
#

you need to specify the group

#

which is done with _x in forEach loops

stray flame
#

I have tried but no sucsess with _x

#

do you mean it should be written as it does now?

sullen sigil
#

yes

stray flame
#

ah

#

whats wrong now?

#

hu

#

okay I solved it

#

somehow

#

Idk maybe the _x didnt save

sullen sigil
#

it did not

#

as you can see in that message

sullen sigil
#

Yeah is eachFrame so returned ID number increases once deleted with sqf addMissionEventHandler ["EachFrame", { removeMissionEventHandler [_thisEvent, _thisEventHandler]; }];

tough parrot
#

modes don't work for the land command

manic kettle
#

i'm trying to script the cage onto a vanilla APC using
car1 setObjectTexture [4, (getObjectTextures car1) select 4];
Where select 4 is "a3\armor_f\data\cage_olive_co.paa"

Any clue why this wont work?

south swan
#

wut

manic kettle
south swan
#

select 4 is "select 5th element of provided array". car1 setObjectTexture [4, (getObjectTextures car1) select 4]; is "set 5th texture of 'car1' object to whatever it's 5th texture is right now"

#

which translates pretty accurately to "do nothing"

manic kettle
#

wat

#

so im trying to edit the 5th hiddenselection (slat cage), it starts from 0
Given the 5th texture, which is the cage

south swan
#

and you set the texture to whatever it already is

manic kettle
#

hmmmm i see i see

#

thats a big brain move right there

south swan
#

because getObjectTextures car1 is "get current textures", and (getObjectTextures car1) select 4 is "get 5th current texture"

manic kettle
#

using getTexture with the options in seems to give me the standard vanilla textures

manic kettle
south swan
#

you edit the thing to your liking, start the mission, check getObjectTextures output there and use the texture paths it returns. I suppose that would be the easier solution. Or you browse the "TextureSources" subclass of vehicle class and find the texture arrays in its "textures" property

#

also, remember that hiding/showing the vehicle parts isn't done by retexturing, it's animation. Textures are only responsible for colors and such

#

for example, "B_APC_Wheeled_01_cannon_F" needs this animateSource ["showSLATHull", 1]; to show the hull cage and this setObjectTexture [4, "texturepath"]; would only color it if it's already shown

manic kettle
#

Ah makes sense

queen cargo
#

Btw. Still waiting for arguments list @lone glade

#

Not yet home but thought lil gentle reminder helps

lone glade
#

I'm still waiting for you to stop your salt factory

tough parrot
sullen sigil
#

abort landing if lineintersectssurfaces finds terrain beneath it on each frame ๐Ÿ˜Ž

#

(dont do that)

tough parrot
#

well at least not with the land command

sullen sigil
#

make it move above itself

solar geode
#

@lone glade while im away, feel free to create some arguments why it is easier to maintain with the macros
i will nicely negate all of em

#

The most simple fucking one.

#

They rename a PBO

#

No need to ass about replacing it in every single file.

wary needle
#

is it possible to use deformer on pub zeus? if so how?
in comp form btw

warm hedge
#

Deformer is for Eden

solar geode
#

The same reason you use interfaces, abstractions and million other things.

#

It's not rocket science.

jade abyss
#

and, why would you rename a .pbo?!

solar geode
#

Why wouldn't you? A something goes out of scope of a module and suddenly they are two modules.

still forum
#

If a pbo gets to big they might split it into two or such

solar geode
#

They change their name from ACE to X39PETPEEVE

#

It's all covered.

tough abyss
#

ACE team decided to use these macros despite them having zero benefits and overcomplicating things needlesly

#

obviously

jade abyss
#

Still makes no real sense at all.

tough abyss
#

face -> wall

jade abyss
#

Exactly Commy2

tough abyss
#

irony warning

solar geode
#

How does it not make any sense? Unless you're a future teller and you know what your project will look like in a years time, you have to take into account potential restructuring.

crystal lagoon
#

It's also server side.

solar geode
#

Abstracting away crap is needed in larger projects.

jade abyss
#

rolleyes

tough parrot
granite sky
#

what orders is the heli pilot on?

tough parrot
granite sky
#

wait, what's ambiguous about that

solar geode
#

You're right. Who the fuck needs things like namespaces.

tough parrot
solar geode
#

Pointless in every single language that implements them.

granite sky
#

oh, interpolating between [0,0,1] and [0,0,-1]? Yeah you want an extra stage for that.

#

but I'm fairly sure that you don't actually want your heli upside down here :P

solar geode
#

Oh wait, someone here is making an object oriented sqf thing.

#

Wait what

#

Objects in most languages can be EXTENDED

#

oooooooooooo

#

Why would you ever extend an object. :O

jade abyss
#

Seems like you have some Problems oO Keep arguing like an adult.

solar geode
#

I'm not the one rolling my eyes.

tough parrot
granite sky
#

Your flyInHeights don't seem to match the movement?

stray kindle
#

Most of CBA should be in Arma 3 by default. Macros are a nice way to ease development. It's especially nice if you don't have to type the same few letters over and over and over again. If you really want to get rid of the macros in the built version one could use a preprocessor during the build process.

tough parrot
jade abyss
#

and? Did i made up such childish stuff like that above? Nope. I am just not in the mood, to argue with somebody, that is arguing like the stuff before.

granite sky
#

the end dir & up are mismatched.

#

Assuming you want the thing flat at the end, you'd need something like

_endDir = vectorDir _heli;
_endDir = vectorNormalized [_endDir#0, _endDir#1, 0];
neat monolith
#

Hello, How can I play a video inside a mission activated by a trigger? I am useing it this:

private _video = ["A3\Missions_F_EPA\video\A_in_intro.ogv"] spawn BIS_fnc_playVideo;

And I see it, but the rest of the players on the server not

granite sky
#

You could try ["A3\Missions_F_EPA\video\A_in_intro.ogv"] remoteExec ["BIS_fnc_playVideo", 0];

jade abyss
#

" Unless you're a future teller "

granite sky
#

I wouldn't necessarily expect the heli to just stay where you put it afterwards though.

#

Arma AI never does what you want it to do :P

tough parrot
granite sky
#

should just use interval > 1 really, and make sure it finishes the final setVelocityTransformation

stray kindle
#

One could argue about the helper functions. They aren't needed in most mods. And if you're only using one or two things from CBA then probably you don't need CBA.

jade abyss
#

+restructuring almost always happens, that happens. So, pff

granite sky
#

ok, I changed those two things and it's pretty good apart from kinda stopping kinda dead above the UGV :P

#

would be good with with some quadratic position interp.

#

AI -> setVelocityTransformation transition is nearly seamless.

solar geode
#

It's clearly hyperbole. As you say restructuring is the reality of a lot of apps.

jade abyss
#

erm, @stray kindle , cba was in General Chat :D

granite sky
#

Also using start = end for the dir & up works fine until it actually reaches 9m, and then you get a bit of backswing. Would depend on how well the AI was controlling the approach though.

solar geode
#

Why not plan ahead and reduce your workload in the future?

tough parrot