#arma3_scripting

1 messages ยท Page 80 of 1

stark fjord
#

Then i dont know

hallow mortar
#

Any vanilla scripted damage handling?

sweet zodiac
hallow mortar
#

Does it do setDamage/setHit on the units involved?

dreamy kestrel
hallow mortar
#

Your issue as described was that death messages don't display the killer, right? Not that they completely fail to appear

#

Just refreshing my memory

sweet zodiac
hallow mortar
#

Well, it kinda smells like something is causing the killer to be lost. Nullifying the "real" damage and applying new damage with setDamage would do it, since there's no killer to attribute it to. Creating new bullets and not setting their shotParents would also do it...but are you really doing that for every enemy?

sweet zodiac
#

they are effectively one in the same, damage and getDammage are literally Aliases

hallow mortar
#

if you're just doing setDamage 0 that's not what's doing it

#

If the setDamage is the cause of death then that's what's doing it

stark fjord
dreamy kestrel
#

I'm not setting any damage, only the hit points at the moment... but that is the question, shouldn't damage approximate the other? if not take the average of major components?

hallow mortar
#

setDamage has no source, it's purely scripted and cannot be attributed to any unit. So the killer is null if someone dies because of setDamage.

sweet zodiac
stark fjord
#

seems to me its just an alias

dreamy kestrel
stark fjord
#

And i will setDammage and getDammage as much as i damn please

sweet zodiac
#

getDammage doesn't say to not use it though ๐Ÿ˜… only setDammage

dreamy kestrel
#

LOL nope you used one have to use the other...

winter rose
hallow mortar
winter rose
hallow mortar
#

please do not dammage the Lou, we need him

stark fjord
#

Yeah wiki would be more dammaged without him

sweet zodiac
dreamy kestrel
#

so no insights approximating damage based on hit points

stark fjord
#

I guess you could calculate it. I know wheels have minimal effect

sweet zodiac
#

Average it across all components? or maybe average only ones you deem Major, like Engine, Fuel, Hull, etc

dreamy kestrel
#

I mean it seems appropriate to average at least major components

winter rose
sweet zodiac
#

The pure dammmage you have caused us

stark fjord
#

To all funcs? Like vectorMmmultiply?

dreamy kestrel
#

alrightie then, thanks gents

versed belfry
#

Uhhh, am I using this incorrectly?

uni = uniformContainer player;
uni setMaxLoad 100;
sweet zodiac
#

what about adding another World to modelToWorldWorld

stark fjord
#

Yep, i was just about to ask

#

So you get ATL you use WorldWorldWorld

hallow mortar
sweet zodiac
#

You could get the maxLoad first then add an arbitrary amount to it

versed belfry
winter rose
#

try getContainerMaxLoad for a check
you can also increase the carry ability per unit using setUnitTrait

#
player setUnitTrait ["loadCoef", 0.5];
// can now carry twice the weight
// does not change the containers' capacity though
sweet zodiac
#

I don't believe the Load Coef is what he is looking for specifically

#

It was specifically adding an Item to an already full container in this case being a player's Uniform

inland iris
#

on activation?
this

winter rose
sweet zodiac
#

Ah

hallow mortar
#

Make sure you're doing this at a point where the unit actually has their final uniform. If they change uniform (loadout frameworks, arsenal, etc), maxLoad changes applied to the old one don't apply to the new

versed belfry
#

Def helps, that would solve one of my other issues with loadouts that are too heavy.

sweet zodiac
versed belfry
sweet zodiac
#

I have been messing with an Idea of updating Player Traits based on the Items and/or class they are

#

Stances, Ghillies and Speed affecting the camouflageCoef is something I quite like so far

hallow mortar
#

Ghillies already affect camouflage (if they're configured properly)

sweet zodiac
#

If they do I have no way to determine to what level at all

versed belfry
#

Ghillies are... weird, I've had better luck sneaking around AI without them than with them.

sweet zodiac
#

From what I could see it was the Unit's Classname that determined it not the uniforms

inland iris
hallow mortar
#

What happens if you don't have enough players and it never becomes full?

inland iris
hallow mortar
#

That wasn't the question, but OK

inland iris
hallow mortar
#

So if you have less players on the server than the number of seats, they're just stuck forever

inland iris
#

Than I have to zeus the heli

versed belfry
#

@sweet zodiac @hallow mortar Thanks for the help, turn out while I was executing it on the server I was not passing the uniform technically since player does not refer to me when executed on the server.

inland iris
#

the heli has around 18 seats and on a Scripted Op I am expecting 20ish players

versed belfry
#

I also learned how to use publicVariable properly today, so yay!

hallow mortar
#

...I think, hold on

sweet zodiac
#

I couldn't determine a difference between Ghillie and non Ghillie prior

hallow mortar
#

no, it is in the unit config not the uniform config

sweet zodiac
#

Now you can see my issue

hallow mortar
#

now where did I read that it was the uniform ๐Ÿค”

sweet zodiac
#

Okay I just tested the empty Positions thing, my Heli isn't landing even when the condition is true

#

Thanks Arma

#

I used a scripted waypoint checking for the Heli's Empty Positions and waiting until it == 0, side note EmptyPositions I don't believe accounts for FFV

inland iris
#

because the script is working but when the positions are empty afaik know sqf

hallow mortar
sweet zodiac
#

This should not be returning 3

hallow mortar
#

Well that's not even right for non-FFV, it's got 4 internal seats

sweet zodiac
#

Either I am handicapped or "" is straight up not working as advertised with emptyPositions

#

You also can't test for Copilot seat with it apparently

#

If the Additional Waypoint is too close the Helicopter just refuses to do it, that's concerning

hallow mortar
#

if you've got dev branch you can test it there

sweet zodiac
#

I don't like scripting on the Dev branch

#

Because any commands unique to it I have to wait to deploy essentially

hallow mortar
#

"test it", as in to see if it was actually fixed, not "write a whole script with it"

inland iris
#

something to do with this?

hallow mortar
#

Was _heli actually defined?

sweet zodiac
#

heli1 emptyPositions "Cargo" == 0 in the scripted Waypoints Condition, make sure the Helicopter has the variable name heli1

#

I haven't used Waypoints in a long time so I had to double check it

#

In my case this doesn't actually work at all because the Land waypoint I assume is just too close and the Pilot doesn't know how to handle it

inland iris
sweet zodiac
#

It will

#

Mine just wont land, could be because I am stupid and don't have a Pad for it to land on

sweet zodiac
inland iris
#

yep it did nt work

sweet zodiac
#

Because you didn't read what I said

sweet zodiac
#

well apart from the Helicopter of course

#

I just used the Littlebird for my testing

inland iris
#

changing the variable name should work no?

molten yacht
#

hmm

#

I need some help

#

in the "show" condition of this holdAction

#

I need getGPS && X, but for X I need to check if someone is in the truck in one of the front seats

#

because they're supposed to be checking the truck's GPS history

#

I would be okay if they just needed to be the driver, if that's easier

#

how would I do this

#

_caller in crew of truck?

winter rose
#

_unit in _vehicle

open fractal
#

driver would work universally, as in ```sqf
driver vehicle _caller == _caller

molten yacht
molten yacht
open fractal
#

in would be any seat

#

so you can run that check and then the driver check

sweet zodiac
#

is getGPS a variable?

molten yacht
#

yes

#

it's "you have been told to go check the GPS history on the truck"

open fractal
#

if you're going to have that global variable for the truck you can do

driver gpsTruck == _caller
molten yacht
#

to be clear the truck just has gpsTruck as its name in editor

#

I think that's global

#

so I want getGPS && drive gpsTruck == _caller?

open fractal
#

driver

molten yacht
#

er, yeah

#

sorry, I'm very tired

open fractal
#

I think so, so long as the module correctly handles _caller

#

it's likely to be _this and not _caller

winter rose
molten yacht
#

you are correct

#

it's _this

sweet zodiac
#

and _target is the thing the action is on

winter rose
boreal parcel
#

so im thinking about how to manage ai for multiple zones to be handled later. Would it be efficient to store them as an array in a missionNamespace variable? Like:
missionNamespace setVariable ["zone_1_units", [unitObj1, unitObj2], true]

open fractal
#

lazy eval gaming ๐Ÿ˜Ž

winter rose
#

always

open fractal
#

I don't recall how easy it is to manipulate arrays within hashmaps

little raptor
boreal parcel
#

so im not really sure how to use a hasmap. From what I have ready they are like dictionaries in python right? key : value. since it can only have one value, wouldnt I just be stored an array there later and doing the same thing I would be with an array anyway?

boreal parcel
little raptor
open fractal
little raptor
#

yeah

open fractal
#

cool

sweet zodiac
#

I feel like keeping track of Elements in Hashmaps is easier on the brain than Arrays

little raptor
#

well as long as you use set, resize, pushback , etc. not =

boreal parcel
#

I just dont understand the use of a hashmap here

#

since im using setVariable

#

and getVariable

little raptor
sweet zodiac
#

If it works, it works

little raptor
open fractal
#

in my mind the use in this case would be using the zone identifier as a key and broadcasting the hashmap, I'm not sure if that's more or less efficient though

little raptor
#

yeah that

sweet zodiac
#

Hashmaps don't keep order as well so keep that in mind

little raptor
boreal parcel
#

hmm. So your saying it would probably be better to just keep a global zone units hashmap rather than assigning a variable to each zone trigger and storing an array of units

little raptor
open fractal
#

would it make a difference in terms of looping through and broadcasting all of the zones, for example, vs broadcasting one hashmap for MP performance

boreal parcel
nocturne bluff
#

Add it to the wiki!

lethal cave
#

well i probably should, good advice

boreal parcel
#

when I set trigger statements it seems to run them on creation? why is that? I know at the very least for some reason TRA_fnc_spawnMilitary is being run on trigger creation

_trigger setTriggerStatements
[
    "true",
    format["thisTrigger setVariable [%1, true, true]; [thisTrigger, %2] call TRA_fnc_spawnMilitary;", str _activeVarName, _x],
    format["thisTrigger setVariable [%1, false, true]; [thisTrigger, %2] call TRA_fnc_deactivateZone;", str _activeVarName, _x]
];
little raptor
#

why do you set a variable on the trigger to indicate whether it's activated? and to make it worse you broadcast it? meowsweats

#

you can just use triggerActivated command

#

I know at the very least for some reason TRA_fnc_spawnMilitary is being run on trigger creation
what is the trigger activation type?

boreal parcel
#

hmm I was doing it that way so in the deactivation script can monitor if the zone is re-activated at any point in the next two minutes. I didnt know about the triggerActivated command though ill check that out

boreal parcel
#

activate is Anyplayer and Present though

little raptor
#

so you mean no player is in the trigger area but it gets activated nonetheless?

boreal parcel
#

oh

#

you know what I think I know what it is

#

yep thats my bad, I forgot the example had this for the empty condition, not true

boreal parcel
little raptor
boreal parcel
#

maybe I need to wait a few seconds before using triggerActivated?

little raptor
#

no

#

if the deactivation event triggers triggerActivated should be false too

boreal parcel
#

triggerActivated was called from the deactivation event, yet was true

#

it is called in TRA_fnc_deactivateZone

{
    // Create trigger
    _trigger = createTrigger["EmptyDetector", getMarkerPos _x, true];
    _trigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
    _trigger setTriggerArea [TRA_milActivationRadius / 2, TRA_milActivationRadius / 2, getDir this, true];

    // Set Trigger Statements
    _trigger setTriggerStatements
    [
        "this",
        format["[thisTrigger, %1] call TRA_fnc_spawnMilitary;", str _x],
        format["[thisTrigger, %1] call TRA_fnc_deactivateZone;", str _x]
    ];
} forEach _military;
little raptor
#

well show me that code instead

#

also are you testing this in MP?

boreal parcel
#

sure, I get Deactivation Aborted here in the middle.

params ["_trigger", "_marker"];
private ["_timerStart", "_deactivate"];
diag_log format["[TRA] Deactivating Zone: %1", markerText _marker];
_timerStart = diag_tickTime;
_deactivate = false;

while {!(triggerActivated _trigger) || !_deactivate} do {
    if ((_timerStart - diag_tickTime) >= TRA_zoneInactiveTime) then {
        _deactivate = true;
        diag_log format["Time Since Deactivation: %1", (_timerStart - diag_tickTime)];
    };
};

if (triggerActivated _trigger) exitWith {
    diag_log "Deactivation Aborted";
    false
};

{
    // Current result is saved in variable _x
    if (_x isKindOf "man") then {
        deleteVehicle _x;    
    } else {
        {
            // Current result is saved in variable _x
            unassignVehicle _x;
            deleteVehicle _x;
        } forEach crew _x;
    };
} forEach _trigger getVariable format["%1%2", _marker, "_units"];

true
boreal parcel
#

that last forEach I havent actually got to yet, may or may not work

little raptor
#

using while in that code makes no sense because it's unscheduled

boreal parcel
#

ah, I was thinking about spawning this function since I think ill need to sleep that while loop every 5 or so seconds

granite sky
#

The forEach wouldn't work due to precedence issues. The getVariable needs wrapping in brackets.

ashen ridge
#

In situations where switch case is suitable, if i use a sequence of ifs i will loose performance?

#

The difference is big?

little raptor
#

yes. no
but if with exitWith should be faster than switch

ashen ridge
#

Thanks.

boreal parcel
little raptor
#

did you fix what John said?

boreal parcel
#

yes

#

though the foreach doesnt run either, my diag_log was just above the foreach

granite sky
#

_timerStart - diag_tickTime looks backwards

boreal parcel
#

I do believe you are right

#

ah

#

and im diag_log inside the if statement, that was an accident

granite sky
#

if (whatever) exitWith { ... } is a much cleaner way to exit the while loop than your _deactivate var.

boreal parcel
#

I forgot you could exit loops with that, thank you

boreal parcel
# little raptor you can just use `triggerActivated` command

back to this once again, one of the reasons I was using a global variable was to check in the condition if that trigger is already activated for all clients, this way the trigger isnt activated when another player enters the zone. Will triggerActivated be good for this or could it be true for the player who activated it and false for other players?

flat oasis
#

wassup i get this error when doing action menu repair refuel command

stark fjord
#

_heli is string, stead of object like error message states?

flat oasis
stark fjord
#

yes that is a string...

flat oasis
#

so how to make it object? like what it should be

stark fjord
#

you could use a global variable, that you put into variable name in editor

opal zephyr
#

When using CBA does anyone know how to get a value from an addon option? Example is I have a setting appear in addon options and I want to be able to get the value of it in my script

flat oasis
stark fjord
#

then you are still assigning string...

#

object isnt a text.
Text is enclosed within quotes "

flat oasis
#

thanks

opal zephyr
little raptor
#

move your mouse over it and it tells you

#

you can also export all settings (vars) and paste them in a text file and inspect them for yourself

opal zephyr
#

Ah thats quite simple then, thankyou both very much :)

boreal parcel
#

how should I go about spawning a zone's ai/vehicles without suddenly tanking performance? I was thinking maybe give a 2-3 second sleep between each squad spawning in?

stark fjord
#

You could try 1 sec between unit i guess...

#

you could also preloadObject and stuff

#

oh nvm, with spawning in you can ignore preloadObject

open hollow
#

Hello, im doing a script that compares the mods you have loaded with a list of mods saved in a config in a mod, and if you have a missmatch i want to show an error.

the idea behind it, its preventing ppl to even try to join the server if the mods you have loaded are no the exact same as the server.

ive saved this big list in a mod, and made a function that executes when the game opens ( prestart =1) but im not sure on how to do it, since

the code in the fuction:

if !(hasInterface) exitwith {}; 
[] spawn {
    
    waitUntil {!isNull (findDisplay 0 )};
    private _mods_loaded =  ("true" configClasses (configFile >> "CfgPatches") apply {configName _x});
    private _mods_allowed = getArray (configFile >> "nsn_mods");
    _nope = _mods_loaded findif {!( _x in _mods_allowed) };
    if (_nope isnotequalto -1) then {
        (findDisplay 0 ) createDisplay "errorMessage";
    };
};```
any ideas on what im doing wrong? 


ive tryed to use `["warning text"] call BIS_fnc_guiMessage;`, but with out any sucess
sullen sigil
#

what's the issue

stark fjord
#

at that point why not just use verifySignatures = 2; in server cfg?

open hollow
open hollow
sullen sigil
#

systemchat working?

open hollow
sullen sigil
#

run a systemchat where stuff should be happening

stark fjord
open hollow
sullen sigil
#

then ur code isnt getting to that line

open hollow
#

yep, its not being executed notlikemeow

#

for some reason the spawn its not working there

#

and the code is executed before the display 0 is created meowsweats

boreal parcel
#

just a btw for here but it looks like sqfbin has fallen to some ad website now

#

anyway, anyone have any suggestions/changes I should make for this script to spawn units at an objective? its clearly not done but I want some advice about it.
I originally planned to sleep the for loops for a second or two between each spawn however maybe its just singleplayer, but it felt so much worse than spawning without any sleeps.
https://pastebin.com/7b8nKNEz

#

without sleep it feels like 2-3 seconds of 10-12 fps, with sleep its like every 3-5 seconds I bounced from 60 fps to 10 fps for 2 seconds

sweet zodiac
#

If I had to make a guess the poor FPS is due to several Units being created in quick succession

boreal parcel
#

I tried sleeping every 2 units for 2 seconds, its was horrid

#

guess I could try sleep every 1 unit

sweet zodiac
#

createUnit iirc is fairly expensive so there is likely only so much you can do

cold pagoda
#

So, I'd like to put this in the init field of a bunch of vehicles to save on performance.
I only want them to enable sim when a player is near them:

_distance = this distance player;
if (_distance <= 25) then {
    this enableSimulation true;
} else {
    this enableSimulation false;
};```

I'm putting this in the init of the vehicles:
```sqf
[this] call compile preprocessFile "enablesimvehs.sqf";```

I've tried a couple things, I'm thinking this isn't working because player is evaluated different in MP Dedicated?
sweet zodiac
#

player refers to the running machine's player object

cold pagoda
#

yea, thats what I thought..

sweet zodiac
#

enableSimulation is also global

#

so you would effectively be enabling simulation on the same objects for exactly how many players are in the distance

cold pagoda
#

I'm thinking that is what I'm wanting? But this is how I normally evaluate players in MP Dedicated:

_players = allPlayers select {alive _x};```

But the problem is, I need it to be concurrent, I need to always be running if that makes sense?
#

I normally put that in a trigger and have it evaluate by counting nearest object. but that is only activated when the trigger conditions are met.

sweet zodiac
#

Is it only certain objects you want to disable and enable sim on?

cold pagoda
#

yea, I have a motor pool with about 30 vehicles. I want them to only be enabled when a player is near them, within 25 meters so that (I assume) cpu cycles/PhysX are not used until needed?

sweet zodiac
#

You probably could have a loop running on the Server that just looks for players in a Triggers Area and then enables simulation on all of them if the Sim isn't already enabled and vice versa

#

Downside is if there are no players in the area they all stop simulating

#

regardless if someone is driving them

cold pagoda
#

hmm i could do this:

_allObjects = (allMissionObjects "" inAreaArray thisTrigger);
{  
          _x enableSimulation true;  
      } forEach (_allObjects inAreaArray thisTrigger);

Do you think that would achieve what I'm looking for?

sweet zodiac
#

Do these vehicles need to be simulated period?

#

or are they for looks

cold pagoda
#

they need to be simulated when they are training with them. so yes.

#

its not going to be used all the time, but the days they need to, it needs to be simulated. but what I've seen is, because there are so many, it causes frame drops. but when they are not simulated, there is better preformance

sweet zodiac
#

have you tried Dynamic Simulation?

cold pagoda
#

yea, but because that controls all vehicles I've had it at a higher value. Now that I'm thinking about it, I could just do that. hmmm

#

well it only affects vehicles I tell it too

#

yea, ill do that

sweet zodiac
#

It's definitely the better choice I think, if it's not sufficient at all then you should try a handcrafted solution imo

cold pagoda
#

yea, no I'm gonna do that and just force them all if empty 50m dynamic. that is a better solution

#

okay, another question lol
I created this a while ago.. I have a museum and I have speakers in the museum that play 2 songs. I have them playing sound 3d which works great. I have this activating in a trigger:

OnAct:

edbuildsong = true; 
publicVariableServer "edbuildsong"; 
 
if (isServer) then { 
    [] spawn { 
        private _speakers = [speakers, speakers1, speakers2]; 
        private _speakersin = [insidespeakers1, insidespeakers2, insidespeakers3, insidespeakers4]; 
 
        waitUntil { 
            private _song = selectRandom ["armysong.ogg", "orgarmysong.ogg"]; 
 
            if (_song == "armysong.ogg") then { 
                { 
                    playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40]; 
                } forEach _speakers; 
                { 
                    playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40]; 
                } forEach _speakersin; 
 
                uiSleep 130; 
                hint "armysong Complete"; 
            } else { 
                { 
                    playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40]; 
                } forEach _speakers; 
                { 
                    playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40]; 
                } forEach _speakersin; 
 
                uiSleep 70; 
                hint "Oarmysong Complete"; 
            }; 
 
            !edbuildsong 
        }; 
    }; 
}; ```

OnDeact:
```sqf
edbuildsong = false; 
publicVariableServer "edbuildsong";```

I've been reading about RemoteExecCall and the only difference to my understanding is that RemoteExec immediately sync over the network and RemoteExecCall waits unil all is synced?

Should I use remoteExecCall here?

Also, it seems that sometimes it becomes out of sync with the speakers when you move outside of the 40 meters. Basically, is there a better way?
sweet zodiac
#

playSound3D is global

#

Not sure what you would use remotExecCall for

cold pagoda
#

yea, I was just wondering because sometimes I see the speakers come out of sync.

sweet zodiac
#

Also you could forgo the publicVariableServer if this only fires Server side

cold pagoda
#

okay

sweet zodiac
#

So you have a trigger that Does this and it's ticked for Server only yeah?

cold pagoda
#

yea

#

everything is working, just the sync problem lol

#

but that is good advise about the publicVariable

sweet zodiac
#

I went and changed it up https://pastebin.com/5BDwrZvE It should do everything it did before but with less bloat and it's super easy to add more songs if you wanted to

#

deactivation can stay the same bar the publicVariableServer since It's running on the server anyways so no need to assign it for the server then broadcast it to itself

sweet zodiac
cold pagoda
sweet zodiac
#

I obviously didn't test it but I would imagine it works flawlessly, unless I am dumb which is likely

cold pagoda
#

it looks good! Ill test it though!

sweet zodiac
#

You can always revert if it doesn't work just make sure to backup things while you test

cold pagoda
#

yeppers, being a Windows SysAdmin, I've learned the importance through mistakes lol

#

whats your opinion of publicVariables in the init.sqf file? Should I use them?

sweet zodiac
#

Like the command or that you have Global Variables in it?

cold pagoda
#

that I have global variables in it. Are they necessary?

sweet zodiac
#

It's required if you want something to be accessed by multiple disjointed scripts and in the case of Multiplayer some you want to broadcast over the network which is what publicVariable is used for so that everyone is on the same page.

#

I tend to do it on a case by case basis, given how massive your file is and how it already works, I wouldn't be too concerned with it unless you suspect they actually cause problems and even then you need to find a solution that would actually improve it

#

I often find myself refactoring small things often for little to no benefit, it's a bad habit of mine

cold pagoda
#

yea hmm

molten yacht
#

I feel like Im taking crazy pills

#
player rspAdd = ["mike","jed"];
player hint str rspAdd;```

This is erroring on me
opal zephyr
#

You can always attach variables to the missionnamespace too Jaeger

molten yacht
#

with or without the first player

molten yacht
#

"Missing ;"

sweet zodiac
#

why is player even there

molten yacht
#

I tried several things

cold pagoda
molten yacht
#

the first player was added as a last ditch effort and changes nothing

sweet zodiac
#

remove both

boreal parcel
molten yacht
#

hmm

#

ok this has left me with a very interesting issue

sweet zodiac
#

Maybe just try a couple different approaches to unit Spawning for your Mission

opal zephyr
sweet zodiac
#

It's a global Variable attached to a mission that everyone can see

molten yacht
#
respawnInfo = [player] call BIS_fnc_getRespawnInventories;```
returns the current loadout (zeusGM in my case) in a single-entry array. Adding more loadouts manually results in `"["zeusGM","loadout2"]"` being returned instead. This has an external set of quotes on it that 
```sqf
rspAdd = ["zeusGM","loadout2"];
hint str rspAdd;```
does _not_ have. The hint doesn't have the second set of quotes.
#

Even thought they're both being cast to string

boreal parcel
sweet zodiac
molten yacht
#

....wait, I"m dumb

#

ignore that

#

goddamnit

boreal parcel
sweet zodiac
molten yacht
#

yeah no the second set of quotes is because I used sidechat to return the value the first time

#

I'm very tired and stupid as a result

sweet zodiac
#

Bahaahaha

#

Don't worry I lost 4 hours trying to get a GUI to work meanwhile it was broken because I had a waitUntil being a little too egregious

#

Literally just that funny box on the left

molten yacht
#

....I'm baffled now, instead, that when I get the default Respawn Loadout name for an NPC, it gives me... the 5th out of 10 available loadout name from cfgRespawnInventories. Which is the 7th of 10 available in cfgRoles.

sweet zodiac
#

I have no clue what you mean

#

What exactly are you trying to do?

molten yacht
#

"moony" is a player's specific loadout that inherits from TL which inherits from Rifleman

#

It's not the last one added or the first, it's not alphabetically the first or last

sweet zodiac
#

BIS_fnc_getRespawnInventories returns all of the available Loadouts for the Unit

molten yacht
#

right

#

so why.... does this random zeus-spawned unit have this person's loadout

#

and not just them

#

anyone I spawn has that loadout so far

#

even a civilian

#

I'm gonna try resetting the mission

sweet zodiac
#

Do you have a Loadout script?

molten yacht
#

ok that was something fucky

#

resetting the mission fixed it

#

I think it was an earlier tinkering command assigning that loadout to Everyone

sweet zodiac
#

meowfacepalm I am guilty of doing that too

molten yacht
#

I did figure it out

#

so there's a mod by Webknight that adds a funny little enemy that rips your head off and then steals your body, but doing this makes a new unit of the same class as you, that isn't you, and thereby doesn't have your respawn inventories

#

so the code I just came up with, meant to go on an internal eventhandler, is ```sqf
// assume player is dying unit, just for the sake of demonstration
// assume _newUnit is new unit, just for the sake of demonstration
private _respInv = [player] call BIS_fnc_getRespawnInventories;
{[_newUnit, _x] call BIS_fnc_addRespawnInventory;} forEach _respInv;

#

since I think you have to add respawn inventories one at a time

#

....bizzarely, trying to run the first part on one unit and then run the second part on a different unit gets me a "missing ;" error

#

hmm

#

oh well, doesn't matter

#

I'm actually looking at it and the onPlayerKilled.sqf is of interest

#

because I might be able to put half of this in OnPlayerKilled

opal zephyr
molten yacht
#

so I altered it when I was doing that to be a global variable, since I'm just tinkering around

#

so it was xxx = [_this] call etc etc and then {[_this, _x] ...... forEach xxx on the new unit

#

and it hated that

#

I'm really bafffled now though

opal zephyr
#

Whats the current problem?

molten yacht
#
private _vvva = _this getVariable tfar_squad;
_this sideChat str _vvva;```

gives me zero response

```sqf
private _vvva = _this getVariable [tfar_squad, 4];
_this sideChat str _vvva;```

gives me Error Type Any, expected String
#

even though that default value should be able to be an integer

#

now, double baffle:

#
private _vvva = _this getVariable [tfar_squad, "4"];
_this sideChat str _vvva;```
ALSO gives this error
#

what string does it want

meager granite
#

tfar_squad is undefined in current namespace (missionNamespace likely)

molten yacht
#

.....oh

meager granite
#

It doesn't even get to part where it operates entity namespace and where default can be used

molten yacht
#

so to put that on there I go to each player and go this setVariable ["tfar_squad",2,true];

meager granite
#
private _vvva = _this getVariable ["tfar_squad", 4];
_this sideChat str _vvva;
```You probably meant this
warm hedge
#

Also getVariable takes a string. Are you sure tfar_squad is a string?

molten yacht
#

I wanted tfar squad's contents, which are usually an integer

#

I'm having flashbacks to java and typing var instead of valueOf(var)

warm hedge
#

Also note that SQF does have only Number (basically float), there is no int

molten yacht
#

well, ok

#

fair

meager granite
#

Variable names are strings, you're supplying value of tfar_squad, not "tfar_squad" string to getVariable in your example

molten yacht
#

Okay...

#

I'm trying to fetch _oldUnit's tfar variable so their new unit doesn't need to completely reset their radio

meager granite
#
player setVariable ["test", 123];
player setVariable ["something", 321];
test = "something";
player getVariable "test"; // 123
player getVariable test; // 321
sweet zodiac
#

My slow brain had a hard time reading that

molten yacht
#

I'm still having a hard time reading it

#

ok

#

yeah ok I get it now

#
private _vvva = _this getVariable "tfar_squad";
_this sideChat str _vvva;```
was indeed what I wanted
opal zephyr
#

You can probably combine it into one life if you done use _vvva later

molten yacht
#

Yeah I did figure it out

#

I'm just waiting to hear what the right eventhandler to use is here

molten yacht
#

ok cool

#

Okay, I think a full version of all this is:

addMissionEventHandler ["TeamSwitch", {
  params ["_previousUnit", "_newUnit"];
  private _respInv = [_previousUnit] call BIS_fnc_getRespawnInventories;
  private _tsq = _previousUnit getVariable "tfar_squad";
  {[_newUnit, _x] call BIS_fnc_addRespawnInventory;} forEach _respInv;
  _newUnit setVariable ["tfar_squad", _tsq];
}];
#

But

#

where do I put this?

#

InitPlayer?

meager granite
#

init.sqf should be OK

molten yacht
#

thanks

boreal parcel
sweet zodiac
#

The main thing itself is also Spawned

#

It's so it doesn't have to wait for the squad to be done spawning to start spawning the next one

boreal parcel
#

oh alright

sweet zodiac
#

I have half a mind to put !! before my condition checks

boreal parcel
#

im done testing for tonight as its nearly 2 am, but I think this is the best I have gotten so far in terms of performance, not much different from yours. I could certainly be wrong though, plus I only spawned 19 patrolling infantry, 9 garrisoned inf, and 2 vehicles.
I cant seem to think of the general amount of infantry KP Liberation spawns per objective.
I think tomorrow im gonna rewrite the script a bit for a more dynamic enemy count based on the enemy awareness
https://pastebin.com/TCzS4jyy

molten yacht
#

Oh goddamnit

#

ugh

#

How would I make every AI group inside the trigger area go from "hold fire" to "weapons free"? Something like...

{_x setCombatMode "RED"; _x setBehaviorStrong "COMBAT";} forEach group in thisList```

But I don't know the precise bits of it.
stark fjord
molten yacht
#

it's only ever gonna be like 5 groups so it should be fine

#

benefits of running missions for only 8-10 players

stark fjord
#

Yeah no worries then

mystic shell
#

Hi, attempting to create a custom faction for the first time. I'm wondering if there is a list somewhere where I can find available basegame identities, and the face wear available to them?

mystic shell
ashen ridge
#

allMissionObjects also return simple objects? I ask that because i just found allSimpleObjects ๐Ÿ˜ฌ

ashen ridge
#

This come to hand for what i'm doing.

winter rose
narrow jolt
#

Hi, I have a short question. Is it possible to add Magazines to the vest? Like a combination of addItemToVest and addMagazine? Thanks a lot ๐Ÿ™‚

winter rose
flat oasis
#

sup i am doing spawn vehicle script and what it does is it checks if the trigger at spawn is activated if it is then it wont spawn else it should create the vehicle
but actually nothing happens not even error idk what to do

// Spawn.sqf

if(triggerActivated trigger2) then{
    hint "There is a vehicle in service";
}
else{
    "apache" createVehicle getMarkerPos "spawn_marker" ;
};
winter rose
narrow jolt
winter rose
winter rose
flat oasis
#
// init.sqf

repairAction1 addAction ["Repair,Refuel ", "repair.sqf"];

repairAction1 addAction ["Spawn Heli", "spawn.sqf"];
winter rose
#

also "apache" might not be a proper classname. place a hint in the else

flat oasis
winter rose
#

place the heli in Eden, right-click, Log > class to the clipboard, Ctrl+V in the script

winter rose
#

between quotes; createVehicle takes a string

flat oasis
#

still saying missing }

south swan
#

hint "test'; use the same quote on both sides, please?

flat oasis
little raptor
#

How did you use it?

little raptor
#

Get the container using vestContainer

twin oar
#

Do I add the ear plugs script in init.sqf?

#

player addAction ["Enable earuplugs ",{
params ["_plyr","_caller","_id"];
private _actMenu = (_plyr actionParams _id) select 0;
if (_actMenu isEqualTo "Disable earuplugs") then {
_actMenu = "Enable earuplugs";
call disableEarplugs;
} else {
_actMenu = "Disable earuplugs";
call enableEarplugs;
};
_plyr setUserActionText [_id,_actMenu];
},nil,0.8,false,true,"", ""]call BIS_fnc_MP;

narrow jolt
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
sullen sigil
#

plz

little raptor
twin oar
#

Sorry my apologies

little raptor
#

Well remove the call bis_fnc_mp part then put the script in initPlayerLocal.sqf

twin oar
#

Okay thanks!

little raptor
#

Also I don't see where you've defined the disableEarPlugs function

#

Is it really defined?

twin oar
#

I think so, it should just show up on my scroll menu

#

I just kept getting a Missing ]

little raptor
#

Showing up isn't a problem. It won't work tho

bitter palm
#

hello can anyone help me

little raptor
#

I think you're missing a }? I can't read your code because I'm on mobile

#

And I doubt others can either because it's not syntax highlighted

twin oar
#

I donโ€™t understand the syntax highlight sorry

twin oar
little raptor
#

When you removed the call, are you sure you didn't remove the ] next to it?

hallow mortar
# wicked roost

This message explains how to create syntax highlighting. You have to surround the code in the ` (not ') character as it shows.
Note that on mobile this will create a code block but not show the syntax highlighting colours - big thanks to Discord for that... - but people on desktop will be able to see it.

twin oar
#

Will update in a few when Iโ€™m at my pc and can properly do the highlight

#

My apologies

meager granite
#

Anybody has a convenient way to simulate lag between two local clients?

#

As in block sending or receiving from local client game process to local server game process?

#

Bet there is a software for that but I wonder if somebody can point me at a solution

hallow mortar
#

Well, he's already got the external network lag figured out

still forum
#

There is software for it, just need to find the name I saw it recently

meager granite
#

Oops, I thought I changed my mind and didn't post it ๐Ÿค”

still forum
#

"Clumsy"

meager granite
#

I wonder why there is exactly 3 frame delay between remoteExecCall to the same client and function firing?

#
somefunc = {systemChat (diag_frameno toFixed 0)};
systemChat (diag_frameno toFixed 0);
123 remoteExecCall ["somefunc", 2];
winter rose
#
  • sending
  • travelling
  • receiving
  • executing
    ๐Ÿ˜œ
#

(don't take my word for it, it is only a joke)

still forum
#

Good, keep wondering. Curiosity is good

granite sky
#

Mostly in Arma it just drives you slowly insane.

meager granite
#

I call it Armanormal activity

granite sky
#

consider game loop with unscheduled scripts -> receive network -> send network -> scheduled scripts :P

little raptor
meager granite
#

Executing this one a listen server with no other clients

south swan
#

and that wouldn't work outside of where it's run anyways because somefunc isn't publicVariable'd tanking

ashen ridge
little raptor
#

Did you do allMissionObjects ""?

ashen ridge
#

Oh! I believe i did allMissionObjects "All"

#

My fault ๐Ÿ˜ฌ

little raptor
#

Then that's your answer

#

And there's allObjects now

#

Much faster than allMissionObjects

winter rose
little raptor
#

Me too ๐Ÿ˜…

#

Will do once I'm home

winter rose
#

can't ask a single thing

thanks tho :p

ashen ridge
#

@winter rose really sorry.

#

Can i spawn a crater texture my self?

#

And may be make it permanent.

little raptor
#

Yes. They're decals tho

#

Not textures

#

i.e. they stick to the ground

#

actually not sure about crater decals think_turtle

#

There are crater objects tho

ashen ridge
#

I will check Eden first.

ashen ridge
#

Custom crater! meowheart sqf createSimpleObject ["a3\data_f\krater.p3d",_posASL];

agile cargo
#

Is there an elegant way to spawn blood spatters/pools on units that are spawning with 0 health? For ambience reasons

#

rather than manually placing a blood spatter object on each unit

manic sigil
agile cargo
#

blood pools under bodies

#

I'm thinking something like

    bloodPools = ["bloodPool1","bloodpool2"...];
    {
        selectRandom bloodPools createVehicle getPosATL _x;
    } forEach  synchronizedObjects deadBodies;
south swan
manic sigil
agile cargo
boreal parcel
#

is the object an addAction is on passed to the condition of the addAction at all?

#

like the _target provided to the script/code option

south swan
boreal parcel
#

oh, guess I should learn to read

#

how have I overlooked that so many times

silver rampart
#

Does anybody know how to make a Restricted ACE Arsenal like Rifleman, Grenadier, etc where these roles can only access the specific items?

winter rose
#

go to bed, stat

bitter palm
#

how to disable the PeripheralVision as a config or in the config for the ifa 2 iron front mod

#

on veteran

#

difficulty

#

at_gui is a mod and it disable the effects

#

in arma 2 they disabled but in iron front mod not

snow pumice
#

Hey

can i somehow put an icon in the text of drawIcon3D?
I tried parseText but i get the error Type Text, expects a string which makes sense.

Is there any way?
(I want to make a Playertags script, maybe other commands are better suited for this?)

sweet zodiac
#

Wait, but, what? is there some reason you can't just make the drawIcon3D you know, draw said Icon?

snow pumice
sweet zodiac
#

Oh that makes sense

#

I don't know of a way to do that, I don't believe it would be possible really without just another drawIcon3D but they would just collide visually

snow pumice
#

mhm yea
thanks for the answer

manic kettle
sweet zodiac
#

Oh, interesting, I just did this manually with mission specific scripts, I probably could find it again if you want a version that doesn't require a mod

#

I think it was something along the lines of adding a Variable to each player for their role, and checking it locally when they joined and added an Ace action to the Listed Crates that would basically Fake the Ace Arsenal by force opening a different Arsenal that was placed in the editor with the correct equipment

manic kettle
#

Yeah we used to have a script that did it that way too. But I updated to this version that has an arsenal for every role. Then check the players tags for each arsenal and add them all up.

#

Our community likes to go a little extra on the arsenal management. Not everyone goes that hard tho

sweet zodiac
#

Yeah my Implementation only supports having one Arsenal for each Role effectively and You can't change roles mid mission

#

It was a Cookie Cutter situation so to speak so I didn't design it with a lot of flexibility

manic kettle
#

While mine does allow mid mission switching I've never done it... I can't think of a use case in a milsim community that has set gear.
Maybe for an insurgent style op

sweet zodiac
#

If I was going to redesign it I would probably do it similar in the sense that several Tags could be used to determine which weapons they could access and have a couple Zeus Modules along with it and the ability for it to regenerate the Arsenal Contents when their "Tags" have been updated

#

Uniforms aren't a concern for my Group so I would only do it for Weaponry

manic kettle
#

Simple addaction and setVariable would be enough. Then just run the check whenever the arsenal gets accessed

sweet zodiac
#

I don't like the idea of checking it every time personally

#

It would lead to an unnecessary amount of checking

#

I would just do it once on mission start and subsequent times if their Tags update

manic kettle
#

What's the best way to check for nearby players around a point in a script that fires often?

#

I imagine there's a better way than looping through allPlayers

sweet zodiac
#

Small mock up, untested

_nearPlayers = [];
_nearMen = _position nearEntities ["Man", _radius];

{
  if (isPlayer _x) then {_nearPlayers pushback _x};
} forEach _nearMen;
#

there might be a nicer method

manic kettle
#

Yeah but that loops through all the ai which may be just as bad
Hmm...I can see how that might be better in some cases

sweet zodiac
#

It's a bit specific but if the classnames of the AI are different from the Players you could filter it like that, nearEntities can accept an Array of Strings instead of just a string.

#
_position nearEntities [["ClassName1", "ClassName2"], _radius]
lavish stream
#

Won't work in single player I don't think, but pretty fast. Can also replace My_Object with PositionAGL if using a marker.

#define MIN_DISTANCE 10
#define LOCATION My_Object
private _nearPlayers = playableUnits select {
    (LOCATION distance _x) < MIN_DISTANCE
};
sweet zodiac
#

That's real cheeky if that works

opal zephyr
#

I think the distance command can be pretty taxing

lavish stream
#

not even remotely.

opal zephyr
#

Ive found it to take longer than nearestObject in my testing

meager granite
#

With SQF the less commands you run, the better

opal zephyr
#

And if you're checking lots of objects against lots of players, then that adds up exponentially

meager granite
#

There is inAreaArray which is great for mass distance checks btw

sweet zodiac
#

Well it's only checking playableUnits if my understanding is correct

lavish stream
#

my example is checking players against one position, it's not taxing.

meager granite
#
playableUnits inAreaArray [LOCATION, MIN_DISTANCE, MIN_DISTANCE]
#

Or even preset your area to be a location, trigger or even marker and do:

playableUnits inAreaArray myLocation
#

Locations don't support Z, triggers do

#

But I haven't tested how well it works, that stuff is ancient

sweet zodiac
#

these are some damn spicy one liners, makes my version look horrific in comparison notlikemeowcry

sweet zodiac
#

playableUnits inAreaArray _trigger seems to be the fastest in my tests

#

My small test results while running on Perf Build, 23 Units including myself, take from this what you will.
swapped it to a Pastebin https://pastebin.com/GQKXk20c

#

I swapped out PlayableUnits to AllUnits to include AI for Testing purposes, I aimed to simulate 23 player Objects but your mileage may vary.

granite sky
#

Hmm. Are you running perf build?

#

The select version may be a lot faster on perf than on stable.

sweet zodiac
#

Oh shoot you right, I am running perf

#

I updated the message, I legit forgot about it even though it has a massive green stripe to indicate it

still forum
sweet zodiac
#

<.> how does having two semicolons there make it faster?

still forum
#

Thats just my thing to enable SimpleVM in my test stuff
;; == new thing

sweet zodiac
#

Oh that's nuts

lunar goblet
#

what would be the code to get an init to repeat itself?

#

i.e get a sound file to play on repeat from an object

manic sigil
#

Must be in a scheduled environment (eg, within [] spawn { here} or otherwise), and use Sleep # to delay the desired seconds.

ripe relic
#

Is there any kind of script that can simply change the color of a mission's fog? Ideally it would operate locally for all players so as to put less stress on the server.

#

I'd like to change the standard white/light gray fog to something like red for example.

warm hedge
#

Actually it seems to have the way via diag_setLightNew but haven't made the good script

manic sigil
#

Feels like the 'oh its permanent btw, but heres how to reset' shouldnt be a footnote, but ooooooh

warm hedge
#

Yeah I know what to pass, but I don't know how to make everything else normal

manic sigil
#

Mood

jade acorn
#

what's the name of a function that lets player hold space to execute code? I forgot to bookmark its page on biki and can't find it now

#

and it is a specific function with a progress bar, not holdaction nor holdKey

stark fjord
#

Add*

#

๐Ÿ˜›

jade acorn
#

it's displayed in lower third of screen, shows text "Press and hold [BUTTON]" and a progress bar below

#

I'm not delusional, it definitely exists, I used it once when I was working on a Far Cry mission and tried to add custom healing system with it, unfortunately I deleted this scenario so I have to find it in biki again

#

too bad I don't remember its name

stark fjord
#

Also not keyHold...

#

Idk then

jade acorn
#

omg

jade acorn
#

just not holdKey

#

thx lol

stark fjord
#

Ah, bohemia.. and their function naming. Good thing it isnt keyHoldHold

manic sigil
#

... okay, Im looking at it, but what is it for.

#

Am I missing the 'on execution' portion?

#

Theres arguments for what it says, how long you hold, but not 'code to be executed when it finishes'

jade acorn
#

now I recall I did something to it to work as a hold to heal action

manic sigil
#

It doesnt even return anything, you cant waitUntil, what even...

stark fjord
#

Check ze source.

jade acorn
#
    Allow for hold button interactions.

    Parameters:
        _this select 0 (Optional): STRING - Description of the performed action, displayed inside the progress bar.
        _this select 1 (Optional): NUMBER - Duration of the action. (Default: 2 seconds)
        _this select 2 (Optional): STRING or CODE - Condition that must be met for the action to display.
        _this select 3 (Optional): ARRAY - Arguments passed to the code executed.

    Returns:
    True if the action was successful, false if it was interrupted.
stark fjord
#

So its simple waitUntil

#

But tbf it needs to be fixed on wiki. No return listed, and function seems to be pointless

manic sigil
#

Question, since im AFK and cant test... would you have to define a variable for the return of the hold action, then waitUntil {thatVar}, or could you waitUntil { [] holdAction command} ๐Ÿค”

stark fjord
manic sigil
#

As in, put it inside the waitUntil?

stark fjord
#

Ye

#

Wierd as it is, cause its completely diffrent than other, callback based actions.

jade acorn
#

or as artemoz posted some time ago,

[] spawn {
private _success = [PARAMS] call BIS_fnc_keyHold;
if (_success) then {hint "Successful execution"} else {hint "Interrupted"};
}```
manic sigil
stark fjord
#

Idk, tbf, ill try it later

#

I guess if you did that call inside a spawn, it would be cleaner than waitUntil

jade acorn
#

another Q, what was the function name for displaying the warning window pausing simulation with custom text like "Do you want to do this?" and buttons OK or Cancel

#

I have a really bad memory meowsweats

stark fjord
jade acorn
#

ye, thx

stark fjord
#

In options you have select build config, select scriptedFSM

#

Can you screenshot real quick?

#

The top bar?

#

Try fsm attributes

#

Compile config

#

In steam path\arma3 tools\fsm something

winter rose
bitter palm
#

how to disable the PeripheralVision as a config or in the config for the ifa 2 iron front mod
on veteran
difficulty
at_gui is a mod and it disable the effects
in arma 2 they disabled but in iron front mod not

#

Or how to delete

winter rose
bitter palm
#

I think this is not what i mean, can i disable it as a addon/ mod how at gui mod?

winter rose
#

IDK myself
see how they do it in that mod?

bitter palm
#

Yes i has it same as the config for at gui but it doent worl

#

Work

stark fjord
#

Depbo the mod that does it, see how they do it, then undo/override it in your mod.

deep dew
#

how to active mission voting in Arma 3 server ?

winter rose
deep dew
#

oh i'm sorry.

winter rose
#

no probz at all, I hope you find what you want

bitter palm
#

Or can i play on mercenery (pro) in the difficulty settigs with the third person

stark fjord
#

You can make custom difficulty settings

bitter palm
#

And how?

stark fjord
#

Game settings?

bitter palm
#

I have but on profi it doent work

stark fjord
#

Im unsure what you mean. Also is it for sp or ingame hosting or dedicated server?

bitter palm
#

In arma 2 you has on the difficulty peripheral vision you can see in a unit green red and white dots

stark fjord
#

Wait... is this for a2 or a3

bitter palm
#

I will it disable it kills the realism in arma 2 there is a mod it disable these but in arma 2 with the iron front mod it wont work

I has write the config file for the mod but it dont work and on the difficulty settings you dont see this things at Expert but on veteran etc

#

And maybe it is ifa2mod= iron front mod for arma 2 or the config is false idk

#

Or delete these in the arma/ iron front folder

stark fjord
#

But anyways for a3 difficulty option for this is:
enemyTags and friendlyTags and it has nothing to do with scripting or config

#

Also idk how they are called in settings

bitter palm
#

And in arma 2 yes but on veteran they must disabled but i can see this dots

manic sigil
#

Inside the Arma community there are two wolves. One complains that it cant identify enemies, the other complains about the enemy identification helper.

bitter palm
#

Uff peripheral vision = enemy tags friendly tags etc

#

And it it is dont disabled on veteran in arma 2 and idk why

#

It make no sense

stark fjord
#

Also, this is for Arma 3, as is this channel

winter rose
stark fjord
bitter palm
#

Thanks

twin oar
#

Having an issue with the Warlords modules Dynamic "Airport" from the carriers in game

twin oar
#

Line that pops up on dyanmic airport feature from the USS liberty

class USAF_A10 : USAF_A10
{
    // ...
    tailhook = true;
    // ...
};
#

says missing ;

south swan
#

aaaand do you #define true anywhere? Or include any headers that include that?

twin oar
#

well it should already be defined by BIS_WL_Aircraft_Arrial

#

I used this from the forum

class CfgVehicles
{
    class AirportBase;
    class DynamicAirport_01_F: AirportBase
    {
        scope = 1;
        displayName = "Dynamic Airport";
        DLC = Jets;

        editorCategory = "EdCat_Structures";
        editorSubcategory = "EdSubcat_AircraftCarrier";
        icon = iconObject_1x1;

        // airplanes with "tailHook = true" will be able to land here
        isCarrier = true;

        ilsPosition[] = { -5, 150 };
        ilsDirection[] = { -0.5, 0.08, 3 };
        ilsTaxiIn[] = { 40, -60, 35, -80, 25, -80, 20, -70, -10, 110 };
        ilsTaxiOff[] = { 40, -60, 35, -80, 25, -80, 20, -70, -10, 110 };
    };
#

Just can't tell if it's not going to the right file

#

the above one says it is a config.cpp

#

I have a description.ext mission.spm and config.cpp

#

all packed into the PBO

south swan
#

replace true with 1 and try again, i guess blobdoggoshruggoogly

twin oar
#

Does that belong in the SQF or the .cpp

#

or the EXT

south swan
#

i don't see any mentions of dynamic airport support in what WL code i've browsed right now blobdoggoshruggoogly

twin oar
#

Is there anyway?

#

Chernarus 2035 doesnโ€™t have any Airports created that follow the lines the BIS_WL_Aircraft arrival sqf

#

So is my best bet to just place the aircraft and put a respawn timer then?

fresh wing
#

i guys i need help, i try making B_AAA_System_01_F ataque civilian in air vehicle i try this :
, but shis dont work

sweet zodiac
#

Why not make the Aircraft Opfor?

#

You can also make the Rating of the Pilot really low so they become an enemy to everyone

fresh wing
warm hedge
fresh wing
#

air craft is a jet?

warm hedge
#

I don't follow what you mean

fresh wing
#

my idea is for secure the island from civilians in helli only

warm hedge
meager granite
#

Anybody else thinks that limiting owner to just server is a strange engine design decision? Why can't client know which clients own certain entities? Sure they can't address other clients directly, but this knowledge is very useful for gameplay design features.

#

Wonder if this is fixable at this point

boreal parcel
#

why would the path not be found? its certainly in the sounds folder in the root of the mission with the name alarm.ogg

/* Path to the alarm file */
_alarmPath = "sounds\alarm.ogg";

/* Objects to play the alarm sound from */
_alarmObjs = nearestObjects[_markerPos, ["Land_Loudspeakers_F"], 200, true];

{
    playSound3D[_alarmPath, _x, false, [0,0,10], 1, 1, 100];
} forEach _alarmObjs;

#

also while im here, how should I go about looping said sound. I want to it play endlessly

boreal parcel
manic kettle
sweet zodiac
#

I had no idea it was server only

pulsar bluff
still forum
#

I don't even know if really only server knows the owner

#

Certainly during owner transfer it can happen that clients would have the wrong owner

stark fjord
# boreal parcel also while im here, how should I go about looping said sound. I want to it play ...

For perfect loops createSoundSource. However, if clients go too far out of range, sound will permanently stop playing. And since this is global, you will have to delete sound object and respawn it, but there is no good way of detecting if someone went too far. Also respawning it causes interruption of sound for those who can still hear it.

https://community.bistudio.com/wiki/createSoundSource

#

If you dont need perfect loop, say3D with sleep <sound duration> in a while loop should do.

candid sun
#

what's the best way to filter CfgWeapons for different types of weapon (e.g primary, secondary, sidearm, item, etc) - is it some combination of "scope" and "type"? is this documented anywhere?

#

(Arma 3)

lone glade
#

scope 2 or scopeArsenal 2 and their slots.

candid sun
#

scope == 2 is what? primaries?

lone glade
#

no, that means that the weapon scope is public

#

scopeArsenal means it's available in arsenal.

candid sun
#

ahh so that should exclude base classes?

lone glade
#

yes.

#

You're better using scopeArsenal, that removes debug weapons used by BI.

#

such as the spotter variant of the cyrus.

candid sun
#

thanks very much man, super helpful

#

can't find any mention of scopeArsenal in anything

lone glade
#

gimme a sec,

novel wasp
#

Hi, how to create mods & scripts ? did u have a web page for explain, or youtube tutorial ?

stark fjord
#

See pins of this channel

lone glade
#

scopeCurator

novel wasp
#

thanks

candid sun
#

this returns pretty much everything:
_weapons = "(getNumber (_x >> 'scopeCurator') == 0)" configClasses (configFile >> "CfgWeapons");

ashen ridge
#

The distance in nearestObject and nearestObjects (when the position parameter is an object) is measured between the model certer of the objects?

candid sun
#

scopeCurator == 1 and scopeCurator == 2 return a few hats and some optics?

lone glade
#

erf, BI and it's consistency

little raptor
#

Yes

candid sun
#

and lack of fkn documentation :'(

ashen ridge
#

So those are equivalent searchs:sqf nearestObject _object;``````sqf nearestObject ASLToAGL getPosWorld _object;

little raptor
#

Oh you meant the center of the object used as pos
dunno not sure about that one. But I guess yes

candid sun
#

i might just manually add all the entries, dunno if i can trust these config files

fresh wing
sweet zodiac
#

change the rating of the pilot to -8000 or something

#

that makes them considered Rogue and everyone will shoot them

tough abyss
#

a CfgWeapons entry is considered a weapon when
the config entry "type" is anything between 1 and 7.

#

type is a bit mask

#

2^0 == 1 for primary weapons
2^1 == 2 for handgun weapons
2^2 == 4 for launchers/ secondary weapons

fresh wing
#

can you give me example how to make that?
"the idea is have praetorian making to destroy all approach the island that is not on the independent side"

stark fjord
#

Warning to this is: all other ai will engage them too. Which is probs not what you want

sweet zodiac
#

Why not just make them opfor?

#

Deja vu

#

Oh It's because I suggested that when you asked ages ago

#

If you temporarily have them join an Opfor group it would do the job, otherwise the only real way I can think of is lowering the rating below -2000 for the Pilot or all players

tough abyss
#

5 would use the primary and secondary slot, but Arma 3 no longer supports this and it causes weird duplication bugs

nocturne bluff
#

Docs are decent now days ;D

sweet zodiac
plain sable
#

What script line do you need to use on a Object to Scale it bigger but its visible to everyone in Multiplayer?

#

( This setObjectScale 3.5 ) Isnt visible when i test it in Lan mode

sweet zodiac
#

object scale isn't something that really works in multiplayer

plain sable
#

qwq

sweet zodiac
#

iirc it only applies to SimpleObjects or attached Objects

plain sable
#

well its just like a Logo on a building i want to make bigger

sweet zodiac
#

attach the object to something else

#

Attach the logo to the building then resize the logo

plain sable
#

how?

fresh wing
sweet zodiac
#

_logo attachTo _building

fresh wing
#

in praetorian object

sweet zodiac
#

It's intended for Locations

candid sun
#

ah thanks commy

stark fjord
candid sun
#

where's this documented? i could only find docs on arma 1 cfgweapons

sweet zodiac
#

except sideEnemy which is the rogue side

#

they hate everyone equally including themselves

#

I guess that's not entirely accurate, everyone hates them, I don't think they actually engage anyone if they start as a civilian

#

I only ever messed with it once with like 40 civilians and I set them all to -2000 rating and watched the battle royale, was good fun

tough abyss
#

2^12 == 4096 is for binoculars which are weapons too

plain sable
#

I did ( _GDILogo attachTo _Buildingref; This setObjectScale 3.5 )

#

It still doesnt scale it in Lan mode

#

the refinery building need to be attach to something else?

tough abyss
#

I don't think it is documented anywhere

sweet zodiac
#

Only the logo should need to be attached to another thing

#

Oh you might have to put _Buildingref into an Array _GDILogo attachTo [_BuildingRef]

tough abyss
#

You could use this script as info source

fresh wing
manic sigil
#

Why can't I remove items with addItemCargo? :C Passing a negative number doesn't seem to be working.

winter rose
manic sigil
#

2.12.150301

winter rose
#

what version does the doc mention?

tough abyss
#

Works pretty good from what I see

manic sigil
#

... bluh.

#

Noted.

fresh wing
candid sun
#

thanks very much, you da man

sweet zodiac
#

It doesn't have the nice little 2.14 icon :c

plain sable
#

yay got it to work with ( [this, Buildingref] call BIS_fnc_attachToRelative; This setObjectScale 3.5 )

#

headpat @sweet zodiac for help

manic sigil
#

I mean, its more on me for not reading the fine print and double checking my own version, assuming that I was running the latest and all :/

sweet zodiac
#

Well 2.14 is dev right now

manic sigil
#

So what is the preferred 'delete item from vehicle cargo' method?

winter rose
candid sun
#

i bet you arma 3 has a large hadron collider function in game somewhere but it's undocumented...

sweet zodiac
#

Wait how do you remove from Cargo?

#

The only option I see is getting the cargo as an Array and removing things you don't want in it and adding it back, unless the Unit ones like removeItems works on them

#

I might be missing something, I am very tired

manic sigil
#

Which I mean, I'm currently aiming at removing first aid kits, so it works, but I'm not a fan.

tough abyss
#

This system certainly is weird and backwards

fresh wing
stark fjord
tough abyss
#

probably due to it being a mod on Arma 2 / ArmA / OFP

winter rose
sweet zodiac
#

:c

tough abyss
#

Especially weird is the mine detector , which actually is a secondary weapon

sweet zodiac
#

well at least we will have a way once 2.14 rolls around

winter rose
#

that's the idea

stark fjord
#

Simple work around: spawn ai with biggest backpack, order it to pickup items, despawn ai

candid sun
#

that's ridiculous

sweet zodiac
#

simple work around start server and get players to grab the items then kick them

candid sun
#

thanks so much for that _type link

#

saving me a lot of time here

tough abyss
#

Took me days to debug all this :/

tough abyss
#

how would i force the ai to stay in one stance?

tough abyss
#

thanks should work

candid sun
#

you are doing god's work

#

on an ace3 note, is it documented anywhere how to add custom things to the interaction menu?

lone glade
#

not yet, i'm on it.

#

if you need help I have some examples in my own projects

candid sun
#

it's cool, i'll wait for proper docs, nice one

fresh wing
velvet merlin
#

is there a way to adjust the audio volume via sqf of ogv videos played?

#

or do you have to adjust the volume in the video itself

fresh wing
#

ok guys im more close at end

#

but receive error lin 6 what is wrong?

south swan
#

allGroups doesn't sound like it returns sides

fresh wing
#

need replace _x to player side? is that?

#

player and X

#

civilian to west like that?

#

the value need to be 0 ?

#

like this ? west setFriend [civilian, 0];

wind flax
#

Is there a way to get all map markers (player drawn lines too)?

#

Basically what I want to do is save all the map markers, and then re-add them when the mission reloads

south swan
south swan
#

something like: there should be no arrows between yellow diamond-shaped blocks. Only box-diamond or vice versa blobdoggoshruggoogly

crisp sonnet
#

Okay, okay, okay, so.

this && !alive ka50 && triggerActivated HQSEIZE && triggerActivated noindi

Why this no work?

#

This is in the condition of a trigger

winter rose
#

no idea.
magic, maybe. or something is wrong

crisp sonnet
#

Nothing stupid that I've missed or anything?

winter rose
#

*hint hint more details please* ๐Ÿ˜‰

crisp sonnet
#

Both triggers it's waiting for are triggering correctly. The KA50 is dead. There are players in the trigger.

Trigger no fire

#

This is the 4th trigger that I've had that will not work with &&s

stark fjord
#

try to test by segements

#

first only triggerActivated HQSEIZE && triggerActivated noindi

#

if that works, move on to adding more

winter rose
#

^ yep - and what is this trigger's condition?

crisp sonnet
winter rose
#

server-only triggers?

crisp sonnet
crisp sonnet
#

Just regular triggers

#

Do they need to be server-only?

stark fjord
#

well...

winter rose
#

if you don't want to trigger multiple times

crisp sonnet
winter rose
#

not "server only" + multiple players = multiple triggers

crisp sonnet
#

Ah. Well so far it's just me in the trigger area as a player

winter rose
stark fjord
#

i use && alot and it works, all the time. BUT triggerActivated will only return activated on machine where it is actually activated

#

that

crisp sonnet
#

But so far I'm just testing with only one player and it's not firing, and it's the 4th trigger I've used with && that refused to trigger at all. I've verified that all the conditions independently are met, but the trigger isn't realizing that all the conditions are met.

stark fjord
#

okay, you could get around it by placing in onActivation of these triggers a ```
My_Trigger_1 = true;
publicVariable "My_Trigger_1";

and then in condition of your master trigger ```this && !alive ka50 && !isNil "My_Trigger_1" && !isNil "My_Trigger_2"```
crisp sonnet
#

The trigger is firing when I use "this" "!alive ka50" and the other conditions on their own. It's only when I use && to check that all of them are met at the same time that it won't trigger

stark fjord
#

Okay

crisp sonnet
#

Like, it's not an issue with the triggers its waiting on not firing, they're firing fine and it can detect that via triggerActivated, it's just when I check for them all with && that it doesn't work

stark fjord
#

complete all requirements and test (in debug console) systemChat format ["Cond1: %1, Cond %2, Cond %3", !alive ka50, triggerActivated HQSEIZE, triggerActivated noindi];

crisp sonnet
#

Let me see if it's specifically the triggerActivated parts that are making it fail by testing if it works with this && !alive ka50 as well

little raptor
#

are you sure those triggers are active at the same time?

#

did you check in debug console?

crisp sonnet
stark fjord
#

try printing it out in console.

little raptor
#

how do you know it hasn't been deactivated? test in debug console

crisp sonnet
#

Can we step back for a sec lmfao y'all are speaking enchanting table from my point of view XD

#

I'm still very new to scripting

crisp sonnet
# stark fjord ^

This is gonna take a while, it's the very last trigger in the entire mission so I currently have to run the entire mission through in order to get to it XD

stark fjord
#

plop down gm module in editor and just hack it ๐Ÿ˜›

#

also spawn yourself as friendly to enemy or civilian so you dont take fire

crisp sonnet
#

Yee I'm doing that rn but it still takes a little bit because a lot of the triggers for this mission are waiting for certain amounts of IRL time to pass...

stark fjord
#

for testing purposes just decrease timers

#

also noindi and HQSEIZE are non repeatable triggers yes?

crisp sonnet
#

Yes

#

They trigger once

stark fjord
#

Then perhaps they shouldnt deactivate Leopard20, going off this:

If trigger already activated at least once, triggerActivated will only return false if trigger is set to activate Repeatedly. In other words, a trigger set to activate Once will always return true once activated at least once (even if trigger is no longer activated).

crisp sonnet
#

Yeah that's the intended effect

stark fjord
#

keep testin ๐Ÿ˜›

crisp sonnet
#

They're supposed to activate once and stay activat....

#

Oh

#

I think I know what's going on

#

The mission starts with the trigger conditions met

stark fjord
#

AHA!

crisp sonnet
#

The OPFOR and INDFOR forces don't enter the area until later

stark fjord
#

but is ka50 dead?

crisp sonnet
#

But in that case... Shouldn't they just be triggered already and then be waiting for the KA50 to die and then a player to be in the trigger area?

stark fjord
crisp sonnet
#

Yeah man I have no idea what to do with that bit of script XD

stark fjord
#

you dont actually need to complete all requirements, you can run that at any point and time in game, go ahead treat yourself.

crisp sonnet
#

I am like

stark fjord
#

okay, put it in debug console yes?
and click local exec

crisp sonnet
#

Toddler level scripting

stark fjord
#

you know where to find debug console?

crisp sonnet
#

cond1 bool, cond true, cond true

#

!alive is returning a bool, HQSEIZE and NOINDI are both true

#

Why tf is !alive returning a bool

#

That should be false because it's alive

stark fjord
#

kill it and run again

crisp sonnet
#

Still a bool

stark fjord
#

funny

crisp sonnet
#

Weird

#

Hold on, crew were still alive

#

Wait did I remember to name the KA-50 ka50...

stark fjord
#

i was just about to ask

crisp sonnet
#

I...

stark fjord
#

and you blamed &&

crisp sonnet
#

Yeah because I've been having issues with && all mission

#

Watch it still not work now

stark fjord
#

lets watch

crisp sonnet
#

Setting the seize triggers to be repeatable so they can be false and aren't always active...

#

Okay ka50 is returning false now like it should

stark fjord
#

for testing purposes you could keep it as it is, and now test master trigger first, you know whats wrong with other two.
Changing bunch a variables between the test is not prudent

lofty oriole
#

if i wanted to do watchai battles should i create battles in eden or zeus?

crisp sonnet
#

Now we wait for the 2 minute timer to trigger

stark fjord
#

๐Ÿคฆโ€โ™‚๏ธ

crisp sonnet
#

I would've reduced the timer but

#

forgor

stark fjord
crisp sonnet
#

Man it's so cool watching your op play out when you've spent a while on it

stark fjord
#

so i take it worked?

crisp sonnet
#

Haven't got that far yet

#

IT TRIGGERED

#

AAAAA

#

We gud

stark fjord
#

awesome, and remember to use debug console for testing stuff ๐Ÿ˜›

#

as the name suggests it helps with well ... debugging

lofty oriole
stark fjord
# lofty oriole yeah thats what i meant sorry,

yeah, whichever you find easier to use, eden editor will allow you to do more advanced stuff later on, and also allows you to prepare battle first and then watch it, without having to do anything. But requires more setup

crisp sonnet
#

Okay so, does anyone have a parachute script for AI? Got a Xi'an full of spetsnaz but I need them to jump out and parachute to the ground. Don't know how to script it at all, if anyone has a working script for it that'd be madly helpful. Nothing too special, Xi'an reaches waypoint, AI jump out, pop a chute and then hit ground.

stark fjord
#

ACE3 does.

crisp sonnet
#

I'm using ACE3 already, no sign of a waypoint for it

stark fjord
#

oh, could be Zeus enhanced

#

reinforcements module, and select paradrop

crisp sonnet
#

I uh, I need it to be on existing AI

#

The reinforcement module makes AI and only works from the zeus interface

crisp sonnet
#

oh god

#

that's way beyond me

#

I'mma just helicopter spam I think.

stark fjord
#

wait thats only the first part

crisp sonnet
#

NOPE

crisp sonnet
#

You've lost me

stark fjord
#

i didnt. Youve lost it.

lavish stream
#

There's a pretty simple solution actually.

crisp sonnet
#

Never had it to lose it

stark fjord
#

you've lost a chance i guess then*

crisp sonnet
crisp sonnet
lavish stream
#

Give your passengers parachutes, have a waypoint for the Xi'an to hit, inside the waypoint activation do:
[MY_VEHICLE_NAME] call zen_common_fnc_ejectPassengers