#arma3_scripting

1 messages Β· Page 34 of 1

hollow yoke
#

do you guys have a suggested text editor for sqf? is there anything that can deal with syntax errors, or does highlighting?

hallow mortar
#

A lot of people use Visual Studio Code; I think it's free. Notepad++ is the other one - there are syntax highlighters available but I don't think it does error checking

tough abyss
#

I personally use notepad++ but it's only syntax highlighting

sullen sigil
#

Visual studio is indeed free, though you'll need to download an SQF package

#

As for syntax errors, advanced developer tools by leopard on the steam workshop can help you with that

hallow mortar
#

IIRC it's a lot easier to find an up-to-date SQF package for VSCode than it is for N++

sullen sigil
#

Very useful πŸ‘

tough abyss
#

vim

#

or emacs if you're really cool

wary sandal
wary sandal
#

what is this unit logo supposed to mean? i tried placing an unit with the exact same settings and it doesn't show up like that

willow hound
#

@wary sandal In vanilla A3, the icon in the bottom right is related to the options in the Special States section of the object attributes (e.g. if you tick the Simple Object checkbox, the icon will be grey).

lapis ivy
#

Hello.
I have 2 game slots for blue and red on a mission. These two slots are side commanders. I want to show the text to all players when they start the mission, for example:

"nameplayer" blue side commander... sleep 10
"nameplayer" red side commander...
But. The nameplayer should contain the nickname of the player who took the commander slot. I don't quite understand how I can pass this to BIS_fnc_typeText2

hallow mortar
hallow mortar
fickle sigil
#

1:21:11 NetServer: cannot find channel #737700707, users.card=19
1:21:11 Message not sent - error 0, message ID = ffffffff, to 737700707

#

anyone know this issue

#

and what it means

hollow yoke
sudden yacht
#

anyway to turn a live camera feed image upside down?

#
 
_camera = "camera" camCreate [0,0,0];  
_camera cameraEffect ["Internal", "Back", "pipgaterendertg"]; _camera camSetFov 1; _camera camSetTarget thegatepiptarget; 
_camera camPreparePos (thegatepiptarget modelToWorld [0,-1,0]); _camera camCommitPrepared 0;```
open fractal
#

have you considered turning the camera upside down

#

it might conflict with following the target idk

sudden yacht
#

anyway to display GPS data live to say a screen?

sudden yacht
#

No luck πŸ˜›

pulsar bluff
#

no

pulsar bluff
#

_monitor setvectorup [0,0,-1];

hallow mortar
#

When UI to Texture lands in [future update] you'll be able to do it

wary sandal
#

is there a BIS function to mimic the "press any key to continue" screen you can see on some compaigns?

cosmic lichen
wary sandal
#

i'll try this function

#

thanks

dreamy kestrel
#

Q: if I have a terrain object, "road", "main road", whatever, how might I verify what it actually is? for instance, I can tell player isKindOf "Man", but can I tell _road isKindOf "Road"? furthermore typeOf _road does not return anything, or more specifically, returns "".

halcyon temple
copper raven
#

if _weapon is a vehicle weapon, i.e., shot from a vehicle, then that vehicle is _vehicle, otherwise null (a unit fired the weapon)

halcyon temple
#

right, so as in the context you mentioned, i.e, man fired but from a vehicle weapon _vehicle == objectParent _unit?

copper raven
sharp skiff
#

im searching for a Cleanup script to delete droped objects, dead bodies etc. the only stuff i find is no longer downloadable since it is hosted on Armaholic! and im not good at scripting myself! Thanks

halcyon temple
#

no I think you're right, if if the event is fired and unit is on foot, _weapon is not of _vehicle, so it will return objNull for _vehicle .

copper raven
dreamy kestrel
#

Q: maybe a road follow up question, isOnRoad supports different roads, main roads, trails, etc?

halcyon temple
#

@copper raven thx m8

copper raven
warm iris
#

Hi, I'm current creating a mission however I'm running into the arma limitation of uniforms, as the flow of the mission does include a playstyle for a player or set of players to take clothes currently out of their faction is there any scripting way around the faction clothing limitation or would I have to resort to mods for this?

open hollow
#

hello, i want to use this syntax of compatibleItems

_items = compatibleItems [weapon, slot]

but im not sure how to take check if the slot is aviable for that weapon
since getarray (configFile >> "CfgWeapons" >> "arifle_Katiba_GL_F" >> "WeaponSlotsInfo) wont work

warm iris
copper raven
#

"true" configClasses (configFile >> "CfgWeapons" >> "arifle_Katiba_GL_F" >> "WeaponSlotsInfo") apply { configName _x } will give you the classnames of the slots (for use with that command)

copper raven
hallow mortar
warm iris
#

Alright, would this work in the case of them being able to pick up said uniform from ground and wear it? As that's the thing I'm trying to get working

copper raven
warm iris
#

So would I be able to achieve this through just adding an invisy civ into the group or would I need to script around this?

copper raven
#

invis would be the side you want, while having the actual units be civilians

#

(and group them ofc)

warm iris
#

Ah right I think I'm following correctly, so the playable unit as civilian, the group leader an insivible indfor?

copper raven
#

yes

#

alternatively you can just use createGroup resistance and join the units into it

warm iris
#

Alrighty, I'll give both a go and see what works best!

short coral
#

I don't think I'm doing something right hoping if you can spot it.
Im very new to scripting trying to allow 3rd person for only a certain class but it not doing what I want it to. Here is what I have.

TAG_allowTPV = B_Pilot_F;
if (B_Soldier_F) then {
    [] spawn {
        for "_i" from 0 to 9 do {
            waitUntil { (cameraView == "EXTERNAL") || (cameraView == "GROUP") };
            (vehicle player) switchCamera "INTERNAL";
            systemChat "This is a first person only server";
            _i = 0;
        };
    };
};  
copper raven
# short coral I don't think I'm doing something right hoping if you can spot it. Im very new t...

B_Pilot_F, B_Soldier_F those are classnames and should be put in quotes.

if (B_Soldier_F) then {
i assume you want to check if player is not of type B_Pilot_F, correct way is typeOf player isNotEqualTo "B_Pilot_F", or fix the global variable and use that instead,
TAG_allowTPV = "B_Pilot_F";, then
if (typeOf player isNotEqualTo TAG_allowTPV) then ...

for "_i" from 0 to 9 do {
looks like you want an infinite loop here, change this to for "_i" from 0 to 1 step 0 do {, then you won't need to _i = 0;

(cameraView == "EXTERNAL") || (cameraView == "GROUP")
could be better, change this to cameraView in _disallowedCameraViews, and define private _disallowedCameraViews = ["EXTERNAL", "GROUP"]; above your for loop. rest looks fine

toxic tundra
#

@_everybody who tried to use the unitCaputre for Helimissions but failed at the point where when the recording ends the heli takes of again due to pilot ai.

The so far only Solution is to use one of the captured recording lines and make a while loop to set the helicopter to its position. in my case i use the last captured line of the landing recording and give it the time frame 0 like there in the first line "[[0,["
Would look like this:

wpLZIdle = [[0,[1,7582.61,118.219],[-0.0875363,0.995607,-0.0332165],[0.115344,0.0432502,0.992384],[0,0,0]]];
[blackhawk1, wpLZIdle] spawn BIS_fnc_Unitplay;

Note here to edit the velocity values to 0 vector => "[0,0,0]" at the end of one line. So the aircraft won't move.

Then so make the caputred flight work you will need to add a seccond line (in my expiriance) with a time difference. So i copied the first line of my wpLZidle and only edited the time frame to 0.5 like here:

wpLZIdle = [[0,[1,7582.61,118.219],[-0.0875363,0.995607,-0.0332165],[0.115344,0.0432502,0.992384],[0,0,0]],[0.05,[5996.35,7582.61,118.219],[-0.0875363,0.995607,-0.0332165],[0.115344,0.0432502,0.992384],[0,0,0]]];
[blackhawk1, wpLZIdle] spawn BIS_fnc_Unitplay;

Then you have your finished flight recorded sqf file for the idle.
To execute it i use an trigger that plays 3 secconds after the helicopter landed in that trigger zone. condition "blackhawk1 in thisList".

this is the executed code for idleing the heli in that position:

0 spawn {
while {!triggerActivated evacNow} do { 
rec = [] spawn pickUpTroopsWaiting;
hint "The Blackhawk will wait until everyone alive in the Evaczone has entered";
sleep 0.01;
};};

evacNow is my trigger for when taking off when everybody of the squad alive and inside lz zone has entered the heli.

#

if you are also interested in how to achieve that... here you go.
condition for the evacNow Trigger:

anybodyFromSquadInCircle = false;
everybodyInVehicle = true;
{if (alive _x && (group _x) == primarySquad && !(_x in blackhawk1)) then {everybodyInVehicle = false}; } forEach evacZone;
publicVariable "everybodyInVehicle";
{if (_x in evacZone || _x in blackhawk1 && blackhawk1 in evacZone) then {anybodyFromSquadInCircle = true;}} forEach units primarySquad; publicVariable "anybodyFromSquadInCircle";

triggerActivated bh1landed && everybodyInVehicle && anybodyFromSquadInCircle || triggerActivated evacRadio

Have fun with realistic helicopter flights by ai. πŸ˜„

short coral
# copper raven `B_Pilot_F`, `B_Soldier_F` those are classnames and should be put in quotes. > ...

~~this is what I got still same issue

TAG_allowTPV = "B_Pilot_F";
private _disallowedCameraViews = ["EXTERNAL", "GROUP"];
if (typeOf player isNotEqualTo "B_Pilot_F") then {
    [] spawn {
        for "_i" from 0 to 1 step 0 do {
            waitUntil {cameraView in _disallowedCameraViews};
            (vehicle player) switchCamera "INTERNAL";
            systemChat "This is a first person only server";
        };
    };
};

Also I do have a question for the add action would everyone have to activate it or does it depend on the ation?~~
Nvm Thank you for your help sharp I re-read it and got it

junior schooner
#

how do I make a m4 scorcher shoot at a marker position
my current code is:

{

    m2 doArtilleryFire [getMarkerPos "marker_1", "32Rnd_155mm_Mo_shells", 2];


},[], 6, false, true, "", "_target distance _this < 5"];```
m2 being the scorcher
#

the code does not work

#

the m4 does not shoot

willow hound
#

@junior schooner Can you manually fire at the position if you get into the gunner seat of m2? It could be that the target is not within the minimum and maximum ranges of the Scorcher.

#

Does the Scorcher have AI crew? As far as I know, it needs to have a gunner in order for *ArtilleryFire to work.

junior schooner
#

It has a gunner

#

It has all the members

wary sandal
#

Does anyone know why my marshal won't do anything when i use createGroup and createUnit?

// Add the marshal
private _marshalGroup = createGroup [west, false];
private _marshal = _marshalGroup createUnit ["B_Deck_Crew_F", [-0.060, -147.688, 9.456], [], 0, "NONE"];

_marshal setDir -145; // This won't work
_marshal disableAI "RADIOPROTOCOL";
_marshal allowDamage false;
_marshal switchMove "Acts_JetsMarshallingStraight_loop"; // This won't work

_light = "Chemlight_red" createVehicle [0, 0, 0];
_light attachTo [_marshal, [0, 0, 0], "lefthand"]; 

_light1 = "Chemlight_red" createVehicle [0, 0, 0];
_light1 attachTo [_marshal, [0, 0, 0], "righthand"];

_marshal spawn {
    sleep 1;
    _this playMove "Acts_JetsMarshallingStraight_in"; // this and
    _this playMove "Acts_JetsMarshallingStraight_loop"; // this won't work
};
#

when i place down an unit in the eden and play the anim it works

short coral
#

@copper raven

TAG_allowTPV="B_Pilot_F","B_Fighter_Pilot_F";
if (typeOf player isNotEqualTo TAG_allowTPV) then {
    [] spawn {
        private _disallowedCameraViews = ["EXTERNAL", "GROUP"];
        for "_i" from 0 to 1 step 0 do {
            waitUntil {cameraView in _disallowedCameraViews};
            (vehicle player) switchCamera "INTERNAL";
            systemChat "This is a first person only server";
        };
    };
};

How would I be able to add more classes or would I not be able to in this case?

little raptor
# wary sandal Does anyone know why my marshal won't do anything when i use ``createGroup`` and...

try this

// Add the marshal
private _marshalGroup = createGroup [west, false];
private _marshal = _marshalGroup createUnit ["B_Deck_Crew_F", [-0.060, -147.688, 9.456], [], 0, "NONE"];

_marshal setDir -145; // This won't work
_marshal disableAI "RADIOPROTOCOL";
_marshal allowDamage false;

isNil {
    _marshal switchMove "Acts_JetsMarshallingStraight_loop"; 
    _marshal playMoveNow "Acts_JetsMarshallingStraight_in"; 
    _marshal playMove "Acts_JetsMarshallingStraight_loop"; 
};

_light = "Chemlight_red" createVehicle [0, 0, 0];
_light attachTo [_marshal, [0, 0, 0], "lefthand"]; 

_light1 = "Chemlight_red" createVehicle [0, 0, 0];
_light1 attachTo [_marshal, [0, 0, 0], "righthand"];
#

_marshal setDir -145; // This won't work
wait wat?

#

are you sure it's even defined? thonk

copper raven
halcyon temple
#

hey guys
Attempt to override final function in log, is this success or fail?

#

and in the function viewer, "Recompile All", is this ALL functions, or filtered ones? πŸ™‚

short coral
copper raven
#

remove isNotEqualTo

#

and either invert the condition with ! or put exitWith instead of then and move the code into parent scope

short coral
# copper raven remove `isNotEqualTo`
private TAG_allowTPV = ["B_Pilot_F","B_Fighter_Pilot_F"];
if (typeOf player in TAG_allowTPV) exitWith {

should I call Tag_allowTVP something else getting error for undefined variable

copper raven
#

because you are trying to private declare a global variable

wary sandal
#

it doesn't

short coral
#

so do I just remove private

wary sandal
#

well now for some reasons it works haha @little raptor

#

can you explain me what you did

stable dune
wary sandal
#

indeed

#

black magic

halcyon temple
stable dune
little raptor
little raptor
little raptor
#

and if you put the function file on your P drive in the same path as the in game path (minus the P:\ ofc) you can recompile it

wary sandal
#

anyways thank you

#

can this text that highlights units be removed? not sure how this is called in english

sullen sigil
#

Yes that's in game settings

wary sandal
#

what about from the mission?

sullen sigil
#

I don't think so, it's only in game settings

little raptor
sullen sigil
#

wont that hide crosshair too

#

Ah, there's an array for it nvm

little raptor
#

yeah I guess

sullen sigil
wary sandal
#

seems to be it

sullen sigil
#

Try showHud [false, true]

halcyon temple
#

I'm trying a dev environment. I mean if I got it right, and understood it correctly, I can use the PBO file as kju put it, a dummy pbo, and use the prefix to use unpacked data.

It's on the P:. I mean I think it is. This is what I did, from what I understood:

P: driver, yeh
My mod is in P:\x\tag\addons\mymod
packed it with mikero's pboProject with source folder being : P:\x
junction'ed "P:\x" to arma directory.
blobdoggoshruggoogly

copper raven
# short coral I dont get it

you can't declare a private global variable, it doesn't make sense.

private globalVariable = 5; // error
private _localVariable = 5; // ok
short coral
little raptor
halcyon temple
#

If I edit a file the changes are reflected in the function viewer at least...

sullen sigil
#

you can however

private globalvariable = 5;
private _localVariable = globalVariable;```
wary sandal
#

i guess i will leave that to the user to disable

sullen sigil
#

You can set the game settings on the server

wary sandal
#

also while we're at it, is _hud = shownHUD; the same thing as private _hud = shownHUD; ?

copper raven
sullen sigil
#

No wait

sullen sigil
#

No he didn't ignore me

dreamy kestrel
#

Q: re: BIS_fnc_moduleEffectsShells in terms of BIS_fnc_moduleEffectsEmitterCreator...
the module I drop in using 3den editor allows specifying color, permanence...
but it is also suggesting this is a smoke grenade, but I think it is really shells, not grenades, for starters.
is this accurate?

copper raven
short coral
# copper raven you can't declare a `private` global variable, it doesn't make sense. ```sqf pri...
TAG_allowTPV = ["B_Pilot_F","B_Fighter_Pilot_F"]; //Here  
if (typeOf player in TAG_allowTPV) exitWith { // and here

    [] spawn {
        private _disallowedCameraViews = ["EXTERNAL", "GROUP"];
        for "_i" from 0 to 1 step 0 do {
            waitUntil {cameraView in _disallowedCameraViews};
            (vehicle player) switchCamera "INTERNAL";
            systemChat "This is a first person only server";
        };
    };
};

That is the full script sharp but as for other classes they can still use 3rd so im doing something wrong in one of two spots

wary sandal
#

i was wondering

dreamy kestrel
copper raven
# short coral ```sqf TAG_allowTPV = ["B_Pilot_F","B_Fighter_Pilot_F"]; //Here if (typeOf pla...
TAG_allowTPV = ["B_Pilot_F","B_Fighter_Pilot_F"]; //Here  
if (typeOf player in TAG_allowTPV) exitWith {}; // exit this scope if they are the allowed unit 
[] spawn { // otherwise continue executing
  private _disallowedCameraViews = ["EXTERNAL", "GROUP"];
  for "_i" from 0 to 1 step 0 do {
    waitUntil {cameraView in _disallowedCameraViews};
    (vehicle player) switchCamera "INTERNAL";
    systemChat "This is a first person only server";
  };
};
copper raven
#

one less callstack per iteration

dreamy kestrel
#

huh, interesting, thanks...

little raptor
dreamy kestrel
#

oh that... was vaguely aware of that, but that too. πŸ™‚

dreamy kestrel
copper raven
halcyon temple
#

@little raptor
sorry bump it. If

My mod is in P:\x\tag\addons\mymod
packed it with mikero's pboProject with source folder being : P:\x
junction'ed "P:\x" to arma directory.

This should work right? File edits are reflected in the function viewer.

little raptor
#

junction'ed "P:\x" to arma directory.
not sure why you did that but yeah it should work.

boreal parcel
#

can anyone tell me what these values might be and how I would get them?
The names are assigned to Empty markers and my assumption was it was literally just positions however I dont think thats the case. if it helps this is in Invade and Annex from ahoy world

missionBlacklistPositions[] = {
        {{14800, 16500}, 1200}, // Terminal
        {{23500, 18400}, 1500}, // Salt Flats
        {{11500, 11675}, 1200}, // AAC Airfield
        {{26960, 24690}, 1200}  // Molos Airfield
    };
sullen sigil
#

Probably blacklisted positions for some spawning criteria or something

dreamy kestrel
sullen sigil
#

From the looks of it those are just coordinates

halcyon temple
#

I understood that the prefix would point from arma dir, i.e, if pbo prefix is "x\tag\addons\mymod", the engine would look for unpacked data at "gamedir\x\tag\addons\mymod". It is all kind of overwhelming, I had a hard time understanding all documentation and posts I went over on this.

copper raven
#

with a radius probably

copper raven
sullen sigil
#

Yeah just checked on altis they're 2d map positions

arctic haven
#

can someone help me set up triggers? im not the best at scripting...

boreal parcel
#

ok, then it should be fine to just remove the altitude cords from the logged positions in the editor right?

dreamy kestrel
little raptor
#

I think you also need filepatching

halcyon temple
#

is the engine "aware" of P:, does it look for it on startup?

sullen sigil
boreal parcel
#

can you get 2D cords in the 3D editor?

sullen sigil
#

Yes, bottom left of your screen

#

there

copper raven
#

optionally you can right click, log > log position to clipboard

sullen sigil
#

That too, just chop off the last coordinate

boreal parcel
#

yep I see that now, I guess ill round the numbers as well to try and match what they did just incase they arent handling floating points
[5437.23,7633.93]

#

apparently in the map if you log position to clipboard it already chops off the last coord

sullen sigil
#

Oh, works

#

If you just want to get rid of the blacklists then set the radius of the values you posted to 0

boreal parcel
#

gotcha

sullen sigil
#

I have a question of my own
If I want code to be a variable, how do I do that? Not the result of it, but the code itself. ACE has an array of code that I want to pushBack my own into

dreamy kestrel
sullen sigil
#

Ah, thank you -- didn't see it was enclosed in {} meowsweats

dreamy kestrel
sullen sigil
#

Yeah should remain fixed anyways as will be using player variables and mathsing them

dreamy kestrel
sullen sigil
#

i do not believe in scoping

dreamy kestrel
sullen sigil
#

isNil is just another way of saying last born child that nobody really cares about

arctic haven
#

So I am trying to have player only be shot at by AI if they have their guns out so far I have "this setCaptive 1;" in the Players Init and a trigger with "currentWeapon player != "" " Condition and "if (currentWeapon player != "") then

{

player setCaptive false;

}; " on activation my problem is i cant find the right deactivation when a player puts his gun away. as of now if you spawn iin weaponless you wont be shot at. but if you pick up a gun and put it down you will be... Any ideas? TYIA

slender beacon
#

I'm trying to get thrown grenades and check if they reach a specific area, but I don't know what the exact classname of the modded grenade projectiles are. Is there a way I can check for inheritance or general type of grenades? I want to be able to use this script with modded grenades too.
I'm using nearObjects to get my nade projectiles.

sullen sigil
copper raven
sullen sigil
#

^

arctic haven
#

Thanks guys I will try that out!

sullen sigil
#

Use sharps as mine will only work if your condition is always activating

#

(Not good for performance to be running code that often)

arctic haven
#

I play arma, What are FPS?

sullen sigil
#

however many you decide to let your code give you πŸ˜‰

arctic haven
dreamy kestrel
copper raven
#

yes

sullen sigil
#

I had no idea allVariables was a thing

#

wtf

wary sandal
#

What have I done wrong again lol?

[findDisplay 46, 1, 1, {
    player sideChat "Space key pressed for 1 second";
}] call BIS_fnc_holdKey;
#

i followed the wiki example and put this in init.sqf, it should trigger when i hold the space key for 1 second but it doesn't trigger

sullen sigil
#

Where've you got 46 for space from?

sullen sigil
#

I can only see it as C

#

Yeah, 46 is the DIK keycode for C

wary sandal
#

46 is the mission display

hallow mortar
#

That's findDisplay 46 - the mission display - not a keycode

tepid vigil
#

There exists createGuardedPoint, but is there any way to remove these points once created with this command?

sullen sigil
#

Oh shit yeah duh

#

36 is still J anyway

#

I believe space is 57

wary sandal
sullen sigil
#

Holding space on map?

wary sandal
sullen sigil
#

Oh 12 is map mb

#

Does the wiki example work?

wary sandal
#

this is pretty much the wikiexample except that i changed the key

sullen sigil
#

Does the wiki example work if you don't change the key and hold J for 5 seconds

wary sandal
#

just tested

#

it doesn't

#

weird

sullen sigil
#

There you go then

dreamy kestrel
sullen sigil
dreamy kestrel
sullen sigil
#

youre scaring me

wary sandal
sullen sigil
# wary sandal wdym

that wont work if its the wiki example because the wiki example doesnt work

wary sandal
#

oh bruh

#

is the function broken or is it just the wiki example?

sullen sigil
#

Just tested wiki example myself and it works fine -- you sure you're testing it properly?

wary sandal
#

player spawns in water

sullen sigil
#

try playerInit.sqf

wary sandal
#

try sending me your mission

#

i'll check

sullen sigil
#

I literally just run it in debug console

wary sandal
#

bruh

#

now it works when i run it from the debug console

#

i'm losing my mind

tough abyss
#

The display likely doesn't exist yet when you're doing the init

#

Wrap it in a spawn with a waitUntil display 46 exists

#

I.e.

[] spawn {
waitUntil { findDisplay 46 != displayNull };
// rest of the code here
};
#

@wary sandal

halcyon temple
jade acorn
#

to be clear, soldierOne is your unit's variable name?

halcyon temple
#

the jet is moving thought...

#

but i'll give it a try

jade acorn
#

moveOut should execute even if your vehicle is moving. Might not play the animation of walking out

hallow mortar
#

I don't think it does the parachute/ejection seat though so you might...die

jade acorn
#

we can consider this being ejected anyway troll_smiling

halcyon temple
#

i'll spawnequip a parachute

sullen sigil
#

How cheap are lineIntersectsSurfaces? Initial thought is fairly?

true frigate
#

Alright, who taught the AI how to script in Arma? Own up
(I mean, its not really what I asked, and it doesn't work, but I'm pretty impressed it got so far)

sullen sigil
#

which ai is this

true frigate
#

GPT-3

#

it's just the chat on OpenAI, maybe if I specifically trained a model it would be better

#

I'll give it half merit, it forgot to check if the player actually crouched or just changed animation state

granite sky
#

lol @ AI

wary sandal
#

i have no idea about the load/initialisation order of stuff hence why i couldn't figure out

#

80% of the time it works now

#

no idea why sometimes it doesn't

granite sky
#

Code is wrong because displayNull != displayNull returns false in SQF.

#

should be !isNull findDisplay 46

wary sandal
#

didn't think about that

halcyon temple
#

hey guys, back again...

diag_log format [
    "%1 | %2",
    _position,
    typeName (_position)
];// "[3123.09, 7982.63, 100] | ARRAY"
diag_log format [
    "%1 | %2",
    (_position select 0),
    typeName (_position select 0)
];// "3123.09 | SCALAR"
diag_log format [
    "%1 | %2",
    (_position select 1),
    typeName (_position select 1)
];// "7982.63 | SCALAR"
diag_log format [
    "%1 | %2",
    ((_position select 2) + _altitude),
    typeName ((_position select 2) + _altitude)
];// "200 | SCALAR"
diag_log format [
    "%1 | %2",
    _altitude,
    typeName (_altitude)
];// "100 | SCALAR"

this line...

(objectParent player) setPos [(_position select 0), (_position select 1), (_altitude - 10)];

Error in expression <objectParent player) setPos [(_position select 0), (_position select 1), (_altit>
Error position: <select 0), (_position select 1), (_altit>
Error select: type Number, expected Array, String, Config entry

winter rose
#

stop breaking the game!

halcyon temple
#

?

#

xD

winter rose
#

!quote 5

lyric schoonerBOT
winter rose
#

hue hue hue

halcyon temple
#

oh... suggestions?

winter rose
#

setPosASL, setPosATL, etc

halcyon temple
#

ok

winter rose
#

also: it is possible that somewhere in your code you are replacing _position's value

halcyon temple
#

nope

winter rose
#

k

halcyon temple
#
_this spawn {
    params ["_type", "_altitude"];
    private ["_position", "_altitude", "_veh"];

    _position = [
        (getPos player) select 0,
        (getPos player) select 1,
        _altitude
    ];
    diag_log format ["%1 ! %2", _position, typeName (_position)];
    diag_log format ["%1 ! %2", (_position select 0), typeName (_position select 0)];
    diag_log format ["%1 ! %2", (_position select 1), typeName (_position select 1)];
    diag_log format ["%1 ! %2", ((_position select 2) + _altitude), typeName ((_position select 2) + _altitude)];
    diag_log format ["%1 ! %2", _altitude, typeName (_altitude)];

    params ["_veh", "_position"];

    if (!isNull (objectParent player)) exitWith {

        (objectParent player) setPos [(_position select 0), (_position select 1), (_altitude - 10)];
granite sky
#

uh

halcyon temple
#

or...

winter rose
#

you use params yes

#

so _position becomes the passed altitude

winter rose
granite sky
#

Did you write that entire diagnostic without noticing the bogus params line? :P

halcyon temple
#

yap

winter rose
#

don't drink and drive code 😝

halcyon temple
winter rose
#

(also don't code tired, I am guilty of it too and came back to horrible code after sleep)

winter rose
#

setPosASL = Above Sea Level
setPosATL = Above Terrain Level

halcyon temple
#

got it

halcyon temple
winter rose
#

I swear, I have lost countless hours to it

#

or the best: working for 4 hours straight on an issue, taking it by every end twice etc
going home
sleeping
next morning: "oh, it's just one-lineable - here - done"

gniiiiii!

halcyon temple
#

mooooaaaaaarrrrrr logs

winter rose
#

delete them
no logs
no trace
no problem

halcyon temple
#

been at it the whole day thou... moooooaaaarrrrr code

#

I've heard programmers are transformers, they transform caffeine to code...

lapis ivy
#

Hello. How do I make playsound private for the player? The mission is multiplayer. The sound will play if the player has entered the trigger. After the trigger exits, the sound should stop.

lapis ivy
#

On the server, the sound is played for everyone, no matter where the player is.

copper raven
#

localize the condition around each machine

#

e.g., player inArea thisTrigger or something

tough abyss
#

Is it possible to edge detect objects in arma 3?

#

As in their contour edges of objects?

#

Or would I have to run my own Bresenham's Line Algorithm to detect the edges using AA?

fair drum
#

there are a few intersection commands that might get what you want

hallow mortar
#

With Reshade yes. In scripting, no unless you want to run some kind of insane raytracing sweep

tough abyss
#

You've seen the next generation night vision yes?

#

With edge detection and AR?

hallow mortar
#

I understand what you want to do, but it's not practically possible with script commands

tough abyss
#

What about using C++ ? Extension wise?

hallow mortar
#

If Reshade can do it then presumably another DLL extension can. However, it will be complicated since you're doing graphics injection, and it will have similar limitations to Reshade (being BattlEye blocked, limited interaction through in-game methods, can't be a Workshop mod)

tough abyss
#

Damn... disappointing.

#

I only want to the rendering to be active when the GPNVGS are running

#

Cannot seem to satisfy my high tech realistic warfare game craving

sullen sigil
#
_uniform = uniform player;
{(_uniform in _x)} forEach parseSimpleArray KJW_Radiate_Setting_UniformProtection``` seems to be complaining of `_uniform |#| in _x` being type number ![thonk](https://cdn.discordapp.com/emojis/700311400152825906.webp?size=128 "thonk")
#

KJW_Radiate_Setting... is an array of arrays containing classnames and numbers -- i.e [["class1",0,1,2],["class2",0,2,1]]

tough abyss
#
Systemchat format ["Type of %1,(typeName _x)]; 
#

?

sullen sigil
#

ah, bracketing was wrong in addon settings 🀦

dreamy kestrel
#

Q: trying to arrange the smoke shells... not working so well, and the emitter function is returning false, nothing apparently in the log to indicate whether there was an issue.

_target = player;
_deleteWhenEmpty = true;
_grp = createGroup [sideLogic, _deleteWhenEmpty];
_effect = _grp createUnit ['ModuleSmoke_F', getPosATL _target, [], 0, 'CAN_COLLIDE'];
{_effect setVariable _x} forEach [['type', 'SmokeShellOrange'], ['repeat', true]];
[_effect, 'BIS_fnc_moduleGrenade'] call BIS_fnc_moduleEffectsEmitterCreator;
dreamy kestrel
dreamy kestrel
sullen sigil
#

Check the functions notes in function viewer to see if they help

dreamy kestrel
#

I'm wondering if I need "BIS_fnc_moduleEffectsShells" and not "BIS_fnc_moduleGrenade"

dreamy kestrel
#

Hrm, if I am reading the BIS_fnc_moduleGrenade logic correctly, it only likes being placed via curator, at best, i.e. 3den editor... apparently does not respond to programmatic instances?

dreamy kestrel
#

Am I reading this correctly? this appears to never look to _this for the function name... how did this ever work? or didn't it? literally the first few lines of BIS_fnc_moduleEffectsEmitterCreator...

_logic = _this param [0,objnull,[objnull]];
_params = getArray (configFile >> "CfgVehicles" >> (typeOf _logic) >> "effectFunction");

_fnc = "";
_nr = 1;
if ((count _params) > 1) then {
_fnc = _params param [0,"",[""]];
_nr = _params param [1,1,[1]];
} else {
_fnc = _params param [0,"",[""]];
};
if (_nr < 1) then {_nr = 1};

First thing it tries to do is lift effectFunction from the _logic config; fine. but there are none, verified in debugger: []
then via count _params cond branches...

// yellow flag!
... else {
_fnc = _params param [0,"",[""]];
};

_params? huh? but we just established it was EMPTY! so why would that have anything...
unless I am missing something here, the correct line(s) should be:

_fnc = _this param [1,"",[""]];
_nr = _this param [2,1,[1]];

At least according to the little bit of docs there are:
https://community.bistudio.com/wiki/BIS_fnc_moduleEffectsEmitterCreator
Am I missing something there or is this a bug? Goal here is to avoid the 3den editor and/or curator. Really needing this to be procedural, programmatic.
πŸ™‡β€β™‚οΈ @copper raven for the bit of viewer advice. very instructional, and a bit revealing, if disconcerting to my chagrin. certainly explains why I am apparently not seeing anything emitted.
So it appears as though perhaps a 'simple' rewrite of at least the emitter function is in order...
Hopefully not too much further than that, i.e. into the actual emission functions themselves.

tough abyss
dense stump
#

hello, i have a question, i'm trying to make gui for arty support, and most part of it is ok, but i can't understand how to work with map control.

What i have:

  • RscMapControl which is displaying in my dialog, it has CT_MAP_MAIN Type and ST_Picture style.
  • list of units and some other variables, for arty options.

What i can't understand:

  • what i need to write, to attach mapClick event to my map control?
    I try to attach event handler like that: ```sqf
    _mapCtrl = (findDisplay 1234) displayCtrl 1801;
    _mapCtrl ctrlAddEventHandler ["MapSingleClick", {
    params ["_units","_pos","_alt","_shift"];

      [_units, _pos] call di_gui_onMapClicked;
    

    }];

di_gui_onMapClicked =
{
params ["_units","_pos"];

_mapCtrl = (findDisplay 1234) displayCtrl 1801;

player setVariable ["testMap1", _units, true];
player setVariable ["testMap2", _pos, true];

};


But it's not working, i also try to use onMapSingleClick.
What i do wrong?

I mean when i try to check this variables they are empty, so it means that event not shooting, why?

- second question - i want to center map on unit, when it's selected, i know which one was selected, but i can't understand how to center map on it.

- third question - i have this code, which must drawEllipse on my map control, but i can't see it, i have no idea where he draw it. Center of ellipse must be on unit position, but it's not working and i dk why.

```sqf
switch (typeOf _unit) do
        {
            case "O_VRF_D30": {
                _mapCtrl drawEllipse[_unit, 10, 10,0,[1,0,0,1],"#(rgb,8,8,3)color(1,0.6,0,1)"];
            };
        };
tough abyss
dense stump
tough abyss
#

There's lots of things that don't give errors that should, unfortunately

#

Hold on, does MapSingleClick even exist as a valid uiEventHandler? I don't see it listed on the biki.

#

I know it can be used as a missionEventHandler for the main map, but not sure about UI.

dense stump
tough abyss
#

Mm. Yeah. That's the issue then. You'll have to use a click EH and map the coordinates from the UI map to the real map.

dense stump
tough abyss
#

Some math will be required, and I'm not able to write the code for you at the moment, but something like this:

#
  • Figure out the real map coordinates of some spot on the UI map (ideally, the top-left corner)
  • In the click EH, use the coordinates of the click and find the horizontal (dx) and vertical (dy) distance from the top-left corner of the UI map
  • Take the real map coordinates from step 1, and add dx/scale horizontal and dy/scale vertical distance, where scale is the scale ratio of the UI map to the main map
dense stump
tough abyss
#

No, that's for other things

#

There may be a shortcut way to do the above; I am not an expert in developing UI for this game. However, the method above is a way you could accomplish what you want.

#

An example of how it works would be:
Step 1: Let's say the top-left corner of the UI map corresponds to the coordinates (1000, 1000) on the main map.
Step 2: Let's say the click is at coordinates (23, 50) from the top-left corner of the UI map.
Step 3: Let's say the UI map is half the scale of the main map, aka scale is 0.5. We take the coordinates from step 1 (1000, 1000), and then add (23, 50)/scale, which results in a true map position of (1046, 1100).

still forum
dense stump
tough abyss
#

I'm not sure. I presume you can, as I'm not sure how else it'd work.

#

Actually -- posScreenToWorld can work, though ctrlMapScreenToWorld is more appropriate.

dense stump
# tough abyss I'm not sure. I presume you can, as I'm not sure how else it'd work.

there is already a lot of mods with maps like that, but if everyone write his own math for that purpose, that's strange, i think bis have something built-in like on main map, cause you also can setup marker there, so it must be already done, well thx

try to find how to do that, maybe posScreenToWorld works fine, cause if rely on the description, that's what i need

tough abyss
#

I mistook posScreenToWorld for a different command earlier, my apologies. It will work, but I would suggest using ctrlMapScreenToWorld instead.

dense stump
tough abyss
#

Yeah it will work for ctrl map

#

should have everything you need

dense stump
#

yeah i already dig all that XD

#

but i not worked with eh before that, and with gui, so it's a little bit stucky.

Cause as i can see i have a problem with LB control too, cause his Event handler don't push me _lbSelection param, but it have correct definition, maybe it's cause i override it in dialog init function, will fix it later.

But the map is most difficult part, cause it all works throw event handlers

tough abyss
#

Your second question is more complicated, but the answer to your third question is simple: You need to draw inside of a Draw EH.

copper raven
tough abyss
dense stump
# tough abyss Your second question is more complicated, but the answer to your third question ...

huh, well i think it can be changed on marker.

The idea is:

  • user can see selected units min and max range on map(as i understand, i can only calculate them throw physic parameters, but for test i can do them static) it's close to how vanilla artillery computer works. Draw throw event handler, - need to try that, as in bis example, yeah hope that will work.

  • when user click on map we create marker, and he can see a dispersion zone, which can be edited throw slider, i think it's easier to do that throw marker.

I already write ammo selection, dispersion, slider delay and other thing.

looks like that for now

dense stump
tough abyss
#

Yes, something like this:

#
_map ctrlMapSetPosition [];
_map ctrlMapAnimAdd [1, ctrlMapScale _map, _unit];
ctrlMapAnimCommit _map;
#

where _map is your map ctrl and _unit is the selected unit

#

should do the trick

tough abyss
#

trying to make a script that spawns a aerial target and attaches it to a artillery shell (code goes in objects init box) can't seem to get the target to change to east ```sqf

this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
_ciwstarget = "CBA_B_InvisibleTargetAir" createVehicle [0,0,0];
_group = createGroup east;
[_ciwstarget] joinSilent _group;
_ciwstarget attachto [_projectile, [0,0,0]];
}];

copper raven
tough abyss
#

thanks

#

so ive got


this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    _group = createGroup east;
    _ciwstarget = "CBA_B_InvisibleTargetAir" createUnit [[0,0,0],_group];
    _ciwstarget attachto [_projectile, [0,0,0]];
}];
``` but it doesnt seem to be spawning the target at all now
copper raven
#

because you're using the wrong syntax of createUnit

tough abyss
#

oh ok

copper raven
#

there are two, one returns the unit the other doesn't

tough abyss
#

i've got this and it still is not working syntax looks correct```sqf
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
_group = createGroup east;
_ciwstarget = _group createUnit ["CBA_B_InvisibleTargetAir",[0,0,0], [], 0, "FORM"];
_ciwstarget attachto [_projectile, [0,0,0]];
}];

#

the target isnt getting attached

chrome hinge
#

Greetings, im trying to use a command for making a independent side forget a target from blufor. If i dont use the command side knowsabout is locked at 4 for long time, and if i use the forget command knowsabout of green side doesnt go to 0 but starts to slowly decrease. Any ideas how i can yank it all the way to 0? The command im using is: { _x forgetTarget SO1 } foreach (allGroups select { side _x == independent });

winter rose
wary sandal
#

why in the living hell did my dynamic blur break

winter rose
#

because!

wary sandal
#
_blurEffect = ppEffectCreate ["DynamicBlur", 400];

blurEffectEnable = false;
_blurEffect spawn {
    waitUntil {
        blurEffectEnable
    };
    _this ppEffectEnable true;
    _this ppEffectAdjust [5];
    _this ppEffectCommit 0.9;
    waitUntil { 
        !blurEffectEnable
    };
    _this ppEffectAdjust [0];
    _this ppEffectCommit 0.9;
    waitUntil {
        ppEffectCommitted _this
    };
    ppEffectDestroy _this;
};
#

it worked like a few hours ago

#

lol

winter rose
#

here it will only happen once

#

like "enable - wait - disable - end".

chrome hinge
#

They break because arma is very realistic and dreams you try to build in arma break like dreams in real life

wary sandal
#

ppEffectCommit should make the screen blurry

winter rose
#

yep

#

but if you repeat it, the ppEffect index needs to be incremented - e.g 401

wary sandal
#

that's not issue

#

oh god i think i know why it's happening

winter rose
#
private _priority = 400;
while {
    _blurEffect = ppEffectCreate ["DynamicBlur", _priority];
    _blurEffect < 0
} do {
    _priority = _priority + 1;
};
#

magic?

wary sandal
#

it's because i'm using BIS_fnc_holdKey

#

it breaks the blur

#

wtf

winter rose
#

welp, check its code to find out

wary sandal
winter rose
#

read the function's code?

wary sandal
#

oh yeah

#

had to remove the bis_fnc

winter rose
#

in the functions viewer or whatever is accessible yes

winter rose
wary sandal
#

it didn't show up because i typed bis_fnc before holdKey

winter rose
#

what about holdKeyS?

wary sandal
#

missinput

winter rose
#

anyway, that's Eden Enhanced - no official support πŸ˜›

wary sandal
#

well i'm looking at the code but i have no idea where to look at

#

i'm not in that kind of stuff

#

there's no mention of blur

dreamy kestrel
dreamy kestrel
wary sandal
#

playing an .ogv video on the USS liberty screens doesn't seem to work, only audio plays in

#
ship setObjectTexture [0, "a3\missions_f_exp\video\exp_m07_vout.ogv"];
for "_i" from 0 to 1 step 0 do {
    ["a3\missions_f_exp\video\exp_m07_vout.ogv", [10, 10]] spawn BIS_fnc_playVideo;
    sleep 10;
};
hallow mortar
#

I assume ship is one of the screen objects and not the ship itself

wary sandal
#

more precisely, the rear storage bay

#

when i change the object texture screens turn into this

south swan
#

does it have any hiddenselections to retexture? Does getObjectTextures ship return any?

wary sandal
south swan
#

then it doesn't look retexturable πŸ€·β€β™‚οΈ

wary sandal
#

is it possible to add an invisible screen canvas on top of the screen?

hallow mortar
#

try using a Briefing Room Screen or Briefing Room Desk object instead. They're specifically designed for this.

#

you can also put a User Texture object in front of the screen and use that, if you like

wary sandal
hallow mortar
#

No?

wary sandal
#

how then

#

it's about the only answer i found

hallow mortar
#

Open the Editor, press F1, go to the Props tab, and type "user texture" into the search box

wary sandal
#

any way of resizing them?

#

it's not gonna fit otherwise

winter rose
#

just setObjectScale

hallow mortar
#

The Briefing Room Screen object is the same screen so it's the same size. You can carefully position one exactly in front of the existing screen so it appears mostly seamless

wary sandal
#

issue is that the legs are floating

hallow mortar
#

I think you mean the wall-mount brackets leave a clear space above the deck to allow easy cleaning

#

If it really bothers you just put a chair or a couple of plastic cases or something in front of it. No one will notice

wary sandal
#

attention to detail

sullen sigil
#

please tell me theyre simple objects

wary sandal
#

(jk)

dreamy kestrel
wary sandal
#

well now the video is completely glitched out aviator

#

the video plays normally outside Arma

torpid mica
#

I just have a quick off Topic question about scripting in general. Does anybody know how to program with lua? If someone wants to help me pls dm me.

wary sandal
#

you met the right person

wary sandal
#
tv setObjectTextureGlobal [0, "video.ogv"];
for "_i" from 0 to 1 step 0 do
{
    0 = ["video.ogv", [10, 10]] spawn BIS_fnc_playVideo;
    sleep 3 + 1; // length of the video + 1
};

(the video now appears semi normal after a restart)

#

i tried setting the aspect parameter to false to stretch the video to bounds but it does nothing

little raptor
winter rose
#

( ) plz

jade acorn
#

that screen displays only half of whatever texture you put there

#

another half is usually displayed on a briefing table object

south swan
#

so, User Texture time?

jade acorn
#

so your video would have to be in 2:1 ratio AND only playing in the upper half

wary sandal
wary sandal
#

so i have to edit the original video?

wary sandal
jade acorn
#

this is how the original texture for briefing desk and screen looks like

#

screen displays upper half, desk the lower half afaik

#

so make the video same resolution but the sequence has to be played only in the upper half of that file

#

i hope you get what I'm trying to say here

wary sandal
#

what about i double the vertical resolution and fill the lower half with black?

jade acorn
#

project resolution is 2048x2048 but visible part is 2048x1024

wary sandal
#

yeah right

#

i was confused

#

thanks for editing

#

let's pray that my video editor supports the .ogv format i guess

jade acorn
#

you can always convert it to something less retarded and then re-export it back to ogv

#

not sure what can edit ogv but windows media player can play them

wary sandal
#

everyone's talking about ogvs like it's a format we use everyday

#

never ever heard about it personally

south swan
jade acorn
#

I assume you expected the source to just be partially displayed instead of being adjusted to texture object size

south swan
#

nah, i've expected having at least one of: a) non-uniform scaling; or b) something that's at least close in aspect ratio

tough abyss
#

Unfortunately making objects with custom uvmaps is usually necessary to get the aspect ratio to look good

#

Which was a fun thing to figure out for oval shaped portals

wary sandal
#

one thing that i'm still missing is the proper way for sleep (3 + 1)

jade acorn
#

sleep 4?

wary sandal
#

don't know

jade acorn
#

number there is not a constant

wary sandal
#

every time the video ends there's a short blackout

granite sky
#

sleep 3 + 1 won't do what's intended due to the sleep taking precedence over the +

jade acorn
#

you just put number of seconds you want to make the script be on hold

granite sky
#

It's just (sleep 3) + 1

jade acorn
#

I mean if video is 4s long then make it repeat after 3.5

south swan
#

inb4 itermediate r2t to fix the aspect ration notlikemeow

tough abyss
#

Just use scriptDone to see if the video's done

wary sandal
#

πŸ’€

jade acorn
south swan
#

If called in scheduled environment, the next line of code will not process until the video is stopped or finished.

tough abyss
#

I mean... yeah probably

south swan
#
for "_i" from 0 to 1 step 0 do
{
    0 = ["video.ogv", [10, 10]] call BIS_fnc_playVideo;
    sleep 1; // length of the video + 1
};```?
tough abyss
#

I'd think a millisecond of black screen is preferable to cutting the video off early

#

I sincerely doubt a waitUntil scriptDone will cause a noticeable black screen delay

#

Seeing as it'll be checking nearly every frame in typical circumstances

#
tv setObjectTextureGlobal [0, "video.ogv"];
for "_i" from 0 to 1 step 0 do
{
 private _handle = ["video.ogv", [10, 10]] spawn BIS_fnc_playVideo;
    waitUntil { scriptDone _handle };
};
wary sandal
jade acorn
tough abyss
#

If there's actually a noticeable black screen, sure

#

Which I still don't think is a given unless the scheduler is running slow

jade acorn
#

you're right

south swan
#
while {true} do {["a3\missions_f_exp\video\exp_m07_vout.ogv", [10, 10]] call BIS_fnc_playVideo; }```seemes to properly loop at my machine
wary sandal
#

you did it in init.sqf right?

south swan
#

no, i did it in separate spawned thread, because it never stops looping

#
[] spawn {while {true} do {["a3\missions_f_exp\video\exp_m07_vout.ogv", [10, 10]] call BIS_fnc_playVideo; }}``` being the full code
south swan
tough abyss
#

I am curious as to why a for loop with step 0 is being used instead of just a while {true}

#

is this some sort of extreme unnecessary micro-optimization?

wary sandal
#

it's to flatter your ego that you code differently and efficiently

#

(also it immediately makes me an arma 3 coding expert)

tough abyss
#

well stahp it

#

unless you're writing microcontroller code or similar, readability >>> micro-optimization

south swan
#

or unless you've actually profiled it to be the slowest spot

tough abyss
#

^

#

which, if a while {true} is your slowest spot, you're in pretty good shape

#

So you want to put values into an array, then?

#

Depends how you're wanting to access them

#

if they just need to be variables, use global vars

#

if you need to access them via an index, use an array

#

if you want to access them via a key, use a hashmap

granite sky
#

Is this classname -> number or object -> number?

tough abyss
#

What's an example of how you'd like to access the values?

wary sandal
tough abyss
#

interesting, perhaps the unscheduled approach suggested earlier is better, then

#

What's the "value" you're looking for?

granite sky
#

Different objects with the same classname can have different values?

tough abyss
#

And what's the number for?

#

As I currently understand, you have an array of vehicles in an area, and you want to assign them to number values for some unspecified reason

#

if you detail what your goal is, there's probably an efficient way to go about it

#

Ah, I see

#

in that case, I would use setVariable to set the number on the vehicles themselves

#

and then read it with getVariable when totaling them up

#

There's other ways to do it, yes, but less efficient

south swan
#

array/hashmap/whatever

granite sky
#

If two vehicles of the same type/classname always have the same value then you'd just make a static hashmap from classname -> value.

south swan
#

hashmap over classnames and TAG_vehicleWeights getOrDefault [typeOf _x, 0] should be plenty efficient

tough abyss
#

I mean I suppose in a sense a hashmap could be more efficient...

#

but on the caveat the same vehicle types always have the same value

granite sky
#

If every vehicle has a different arbitrary value then setVariable in init is sensible.

wary sandal
tough abyss
#

interesting, seems there's a guaranteed black screen if the video actually finishes playing then

#

so I guess cutting it off slightly early is indeed the best solution

#

probably some sort of delay caused by the internal resource freeing/allocation if I had to guess

wary sandal
#
for "_i" from 0 to 1 step 0 do
{
    _handle = ["natowavefunni.ogv", [10, 10]] spawn BIS_fnc_playVideo;
    sleep 2;    
};
#

tried cutting it one second early, still happens

#

the delay is about half a second, dunno what is causing it

#

what i could do is increase the video length but it would create a large file

tough abyss
#

wonder if using the skipVar could help

#

I don't see why it would, but it's arma, so meowsweats

wary sandal
#

skipVar?

tough abyss
#

one of the params for that function lets you specify a missionNamespace var to set to true to skip the video

wary sandal
#

what does it do?

tough abyss
#

although apparently using this works fine:
missionNamespace setVariable ["BIS_fnc_playVideo_skipVideo", true];

wary sandal
#

it restarts the video ?

tough abyss
#

it instantly ends it from what I understand, so you'd still have to restart manually

#

but the internals may be different

#

so it (could) fix the problem

#

depends how big the array is and what searching algorithm you're using

#

linear search isn't too slow unless working with very large arrays seeing as it's O(N)

wary sandal
#

like this?

for "_i" from 0 to 1 step 0 do
{
    missionNamespace setVariable ["BIS_fnc_playVideo_skipVideo", false];
    _handle = ["natowavefunni.ogv", [10, 10]] spawn BIS_fnc_playVideo;
    sleep 2;
    missionNamespace setVariable ["BIS_fnc_playVideo_skipVideo", true];
};
tough abyss
#

yeah

wary sandal
#

still the same

tough abyss
#

if you're using get with a key it's a hashmap, so lookup is O(1) time which is fast

#

seems like a hashmap is what you want

dull warren
#

helo, is there a default volume value for fadesound??

tough abyss
lapis ivy
#

Is it possible to turn off the player's flashlight using a script?
I need to crash the flashlight of a player that enters a trigger. The mission is multiplayer.
Here is what I have:

if (player inArea light_weapon && player isFlashlightOn (currentWeapon player) && dayTime > 20.00 || dayTime < 5.00) then
{
    player enableGunLights "ForceOff";
    sleep 0.1;
    player enableGunLights "ForceOn";
    sleep 0.2;
    player enableGunLights "ForceOff";
    sleep 0.7;
    player enableGunLights "ForceOn";
} else { hint "No Flashlight"; };```
This only works for AIs that are in the player's group.
south swan
lapis ivy
#

lol

#

Thanks, I didn't know it was...

south swan
#

took a good 3 minute search on the page. I consider that properly hidden from sight

wary sandal
#

(unrelated but just saying)

wary sandal
lapis ivy
wary sandal
#

so you would actually do something like (dayTime > 20.00 && dayTime < 5.00) since you want the time to be not less than 8pm and not more than 5am if that makes sense

lapis ivy
#

Yes, it makes sense. Thanks for the help.

halcyon temple
#

hey guys

#

trying to figure out how to go about enabling camera rotation or free cam, when cam is created, set on a target and committed.

south swan
halcyon temple
#

rather to able to follow a target, but being able to "look around"

winter rose
#

there is a "camCommand" something perhaps
check the wiki for Camera commands, it's in there πŸ™‚

#

@halcyon temple ^

halcyon temple
#

thx @winter rose , question thou, is it CamCurator, and if so, the pitch mentioned, is to related to all axis or just x axis?

lapis ivy
#

How to stop the cycle? I can not understand.
While the player is in the trigger, they need to play this sound. If it exits, I need to stop the audio loop.

if (player inArea thisTrigger) then
{   
   while {true} do
   {  
    playSound "scrip_house";
   };
};
south swan
#

while {player inArea thisTrigger} do {//whatever}?

halcyon temple
#
if (condition) exitWith {
    
};

blobdoggoshruggoogly

south swan
#

bit of overkill for one-liner with while already having a condition, but works

lapis ivy
#

My arma has hung 3 times already...

winter rose
lapis ivy
#
while (player inArea thisTrigger) do
{
  if (player inArea thisTrigger) then {
    playSound "scrip_house";
    sleep 24; 
   }; 
};
#

oh

#

I do not understand

halcyon temple
lapis ivy
#

πŸ˜„

lapis ivy
#

All I have achieved with the while loop is that my arma is crashing now πŸ˜„

winter rose
#

(given thislist, I'd wager so)

halcyon temple
winter rose
#

don't, a trigger activation code is unscheduled - aka you just asked the game to play the sound, 10000Γ—, in the same frame πŸ˜„

lapis ivy
#

I need the sound to play only for one person who is in the trigger, and if he leaves the trigger, then there was no sound. Mission multiplayer

lapis ivy
lapis ivy
winter rose
#

neither of the codes will work

halcyon temple
#

sounds about right 🀣

halcyon temple
#

@winter rose something like this

_entity addEventHandler ["Fired", {
    _eventIDs pushBack [_entity, _thisEvent, _thisEventHandler, _projectileCameraModule];

    _this spawn {
        params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
        private ["_cam", "_entity", "_camView", "_camVisionMode", "_camVisionModeType", "_camVisionModeIndex"];

        _camStatus = true;

        setAccTime 0.0666666666666667;

        // _cam = "camera" camCreate (position _projectile);
        _camView = cameraView;
        _projectile switchCamera "External";

        _cam = "CamCurator" camCreate (position _projectile);

        // _cam cameraEffect ["External", "Back"];

        if (_unit isEqualTo _gunner) then {
            _entity = _unit;
        } else {
            _entity = _gunner;
        };

#
        _cam camCommand "CamCurator";
        _cam camCommand "maxPitch 89";
        _cam camCommand "minPitch -89";
        _cam camCommand "speedDefault 0.1";
        _cam camCommand "speedMax 2";
        _cam camCommand "ceilingHeight 5000";
        _cam camCommand "atl off";
        _cam camCommand "surfaceSpeed off";

        _camVisionMode = currentVisionMode [_entity];
        _camVisionModeType = _camVisionMode select 0;
        _camVisionModeIndex = _camVisionMode select 1;

        switch (_camVisionModeType) do {
            case 0: {
                camUseNVG false;
                false setCamUseTI _camVisionModeIndex;
            };

            case 1: {
                camUseNVG true;
            };

            case 2: {
                true setCamUseTI _camVisionModeIndex;
            };
        };

        waitUntil {
            if ((isNull _projectile) || !_camStatus) exitWith {
                true;
            };

            // _cam camSetTarget _projectile;
            // _cam camSetRelPos [0, -0.5, 0];
            // _cam camCommit 0;

            false;
        };

        uiSleep 0.5333333333333333;

        // _cam cameraEffect ["Terminate", "Back"];
        camDestroy _cam;
        _entity switchCamera _camView;

        setAccTime 1;
    };
}];

but I would like to be able to "freely" move the camera

#

better yet "rotate" the cam... more specificity

winter rose
# lapis ivy error while

let's try on mobile

thisTrigger spawn {
  params ["_triggerList"];
  while stuff, if not in _triggerList leave
};
halcyon temple
#

@lapis ivy waitUntil might work for you

winter rose
#

it is called "unscheduled"

halcyon temple
#

requires something like spawn... got it

winter rose
halcyon temple
#

I'ma gonna sleep first... xD

lapis ivy
#
thisTrigger spawn {
params ["_triggerList"];
while {true} do 
{ 
    if (!(player inArea thisTrigger)) exitWith {}; 
    playSound "scrip_house"; 
    sleep 24;  
};
};

Will it work? He ignores my sleep and loads the sound 100,000 million times

#

oh

#

maby

#
thisTrigger spawn {
params ["_triggerList"];
while {true} do 
{ 
    if (!(player inArea thisTrigger)) exitWith {}; 
    playSound "scrip_house"; 
  };
 sleep 24;  
};
halcyon temple
#

damn...

halcyon temple
#

@lapis ivy sqf thisTrigger spawn { params ["_triggerList"]; while { true } do { if (!(player inArea thisTrigger)) exitWith {}; playSound "scrip_house"; sleep 24; }; };
but lou said #arma3_scripting message

south swan
#
thisTrigger spawn {
    if (missionNamespace getVariable ["TAG_spookySound", false]) exitWith {};
    TAG_spookySound = true;
    params ["_thisTrigger"];
    while { player inArea _thisTrigger } do {
        playSound "scrip_house";
        sleep 24;
    };
    TAG_spookySound = false;
};``` ![meowsweats](https://cdn.discordapp.com/emojis/707626030613135390.webp?size=128 "meowsweats")
halcyon temple
#
thisTrigger spawn {
    params ["_triggerList"];
    while { true } do {
        if (!(player inArea _triggerList/* like artemoz mentioned */ )) then {false;};
        playSound "scrip_house";
        sleep 24;
    };
};```

might work ![blobdoggoshruggoogly](https://cdn.discordapp.com/emojis/748124048025714758.webp?size=128 "blobdoggoshruggoogly")
lapis ivy
#

Thanks guys!

winter rose
#

while player in triggerlist πŸ˜‰

halcyon temple
south swan
#

doesn't get updated in a separate spawned thread, though

winter rose
#

yep, sacrifices have to be made

winter rose
south swan
#

although the arrays are passed by reference πŸ€”

#

brain = broken

winter rose
#

the result is an array, but that array is a copy afaik

#

aka you get a different array every time, not the original detection one (otherwise you could modify it from the outside!)

halcyon temple
#

enough for today, tomorrow I'll try and fix the camera...
😴

winter rose
#

rest well, see ya soon\β„’

astral bone
#

the joy of programming. Forgetting sqf doesn't like the last thing in an array to have a ','

south swan
#

not the only language to do that

astral bone
#

you get my point :P

#

Can I make a zeus have all addons available mid game

hollow yoke
#

I didn't find anything on the wiki for this, is it possible to make respawns only show up to one squad, not the rest of the faction?

#

i figure it may be complicated, may require a custom respawning script?

hollow yoke
#

oh hey no way

#

that's awesome, ill be back in a bit after messing with it

#

I couldn't find that for the life of me, much appreciated

pallid flare
#

so i have a vehicle and i have 2 .paa's, one for the exterior and one for the interior , is it possible to use setObjectTexture and replace the interior and exterior of the vehicle ?

copper raven
warm hedge
#

Maybe possible, maybe not. Which vehicle it is?

cursive elk
#

is it possible to add other vehicle turrets to an object via scripting?

warm hedge
#

Maybe in a ugly way

dreamy kestrel
gaunt tendon
outer bay
#

I haven't been able to test this in multiplayer, but does calling an AAN Article from the add action menu display it for the user who performed the action, or all players?

pulsar bluff
#

anyone know where the code is for the zeus flare module

stable dune
stable dune
pulsar bluff
#

roger thank you

winter rose
dreamy kestrel
#

Q: if I want to derive a class from the baked in class CfgVehicles { class Logic {}; };, then I need to define at least that as a stub in my description.ext correct?

warm hedge
#

Context aka your goal?

dreamy kestrel
warm hedge
#

You

dreamy kestrel
warm hedge
#

I asked what I've said because I don't know why you want that

dreamy kestrel
#

okay, well to rephrase, I have a class that needs to derive from Logic. so I need to stub that in, correct?

warm hedge
#

Hmm guess I barely understand what you want. Firstly, even if you define CfgVehicles in Description.ext, will never take effect to actual game. Second, if you want to add something that inherits from logic, indeed you need to declare it

dreamy kestrel
#

Why wouldn't it take effect in the actual game? I am not expecting A3 have support for the things I am declaring. I have a framework around that.

hallow mortar
#

CfgVehicles just doesn't work fully in mission description.ext

#

It only works for limited definition of certain special classes (sound effect emitters IIRC). The rest of CfgVehicles can only be patched by mods.

dreamy kestrel
hallow mortar
#

#arma3_config but I don't think this is going to work, because you can't patch CfgVehicles in mission description.ext, the config will not be loaded, you can only patch it in a mod

dreamy kestrel
#

again, I KNOW. I am working on a mod!!!

warm hedge
#

What, this is a scripting topic

#

And you even said description.ext

hallow mortar
# dreamy kestrel again, I KNOW. I am working on a mod!!!

It doesn't matter if you're also making a mod. You said you're trying to use description.ext to change CfgVehicles. You can't. You need to use a mod file like config.cpp or whatever. Changes you make in description.ext won't work.

drowsy geyser
#

is there any way to enable radial blur via command?

drowsy geyser
#

yes, i mean enable it if player has disabled it in video options

warm hedge
#

Don't think there's any way

drowsy geyser
#

what a shame

hallow mortar
#

Does ppEffectEnable do it or is that a separate level of control?

dreamy kestrel
#

anyway the config I wanted to load from mission config appears to load correctly, so. that much is what I needed for the framework, thank you.

hallow mortar
#

You can't modify existing classes or create new ones. The only part of CfgVehicles that works in description.ext is a limited set of special effects emitters.

dreamy kestrel
warm hedge
#

Yes it will work if you define CfgVehicles in description.ext. But none of entries in it doesn't reflect what actual config from vanilla game/Mods (unless you declare CfgVehicles in some special ways)

dreamy kestrel
#

thanks, I have what I needed to know. 🍻

tough abyss
#

i am attempting to make ciws shoot at an artillery round but the invisible target either isnt attaching or is not changing side i had


this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    _ciwstarget = "CBA_B_InvisibleTargetAir" createVehicle [0,0,0];
    _group = createGroup east;
    [_ciwstarget] joinSilent _group;
    _ciwstarget attachto [_projectile, [0,0,0]];
}];

but someone helped me to get this but it won't attach


this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    _group = createGroup east;
    _ciwstarget = _group createUnit ["CBA_B_InvisibleTargetAir",[0,0,0], [], 0, "FORM"];
    _ciwstarget attachto [_projectile, [0,0,0]];
}];
still forum
drowsy geyser
dreamy kestrel
still forum
#

what exactly did you try? maybe you did it wrong

dreamy kestrel
dreamy kestrel
# dreamy kestrel simply: ```hpp class CfgVehicles { import Logic; class MY_Effect_F : Log...

although maybe this is one of those 'special ways' things are loaded (or not).
i.e. when I do, typeOf player iskindof 'man' // true
the only way I have been able to get it to sort of work is with class Logic; but I do not think that is quite kosher.
when I try, 'MY_Effect_F' iskindof 'logic' // false
even though I can load a config from missionConfigFile, seems misaligned with configFile.
seems like maybe a bit deeper dive into mod addons may be in order.

proven charm
dreamy kestrel
proven charm
warm hedge
dreamy kestrel
#

but again sort of, isKindOf does not see my derived class as a kind of Logic.
I can probably work around this...

#

idk I appreciate some of the special ways it kind of 'works' and sometimes does not.
on a 50% scale, kind of 60% leaning towards maybe a mod addon with a proper config.cpp and such would be worth the effort.
thanks for the responses.

dreamy kestrel
#

hmm okay so this may be the thing that decides it for me... trying to createUnit from one of those Logic derived classes. failing to do so, yields objNull.

_y = getPosASL player;
_grp = createGroup [sideLogic, true];
_logic = _grp createUnit ['MY_SmokeGrenade_F', _y, [], 0, 'none'];
[_grp, _logic] // i.e. [L Bravo 3-1,<NULL-object>]
still forum
#

As you were told before, you cannot create/modify vehicle classes in description.ext

winter rose
wary sandal
#

ghostping 🀨

winter rose
tough abyss
#

Perhaps an addon vs. mission editing biki page is in order πŸ˜›

#

as iirc there's currently no centralized location to see all of the important distinctions between the two

outer bay
#

Question: Many functions on the wiki don't have a target/player parameter (i.e. the AAN banner https://community.bistudio.com/wiki/BIS_fnc_AAN). If I were to use this in multiplayer where an addAction calls the AAN script, how do I know if it will call for all clients or just the one who performed the action?

tough abyss
#

iirc (almost?) all GUI-related functions are local only

outer bay
#

Perfect, thanks!

west flicker
#

Sorry if this is the wrong channel, but I'm trying to have a bar gate open and close remotely (from a terminal nearby). I have addAction created to open the gate but can't seem to get the action to open the gate. This is the script I found in the forums but can't seem to get it working. I've named the gate bargate1
this addAction ["Open Gate", {bargate1 animate ["Door_1_Rot", 1]; } ];

copper raven
#

btw with that code you will only open the bargate, never close

west flicker
#

The action appears, but it doesn't open the gate

copper raven
#

what bargate is it?

#

(classname)

west flicker
#

I plan on making another action that will close the gate with door_1_rot, 0

#

How do I find that? I am very new to scripting and editing

copper raven
#

hover over it in editor

west flicker
#

Bar Gate(bargate1)
Land_Zavora

copper raven
#

it probably uses a different animation name, as that's not a vanilla bargate (or dlc bargate maybe)

#

select it in the editor, open debug console, and put animationNames (get3DENSelected "object" select 0)

west flicker
#

it says "door_1"

copper raven
#

use that over "Door_1_Rot"

west flicker
#

You are amazing

#

Thank you so much! That worked perfectly

stable dune
#

Is there EH to objects (like plastic canister) which detect if that get hit by from bullet?
Explosion eh works on objects but i do not get any other to works on them

stable dune
#

Yeah! Thanks alot!

#

Do not know what i missed, but now it works. great!

tough abyss
#

@stable dune Fair warning about the HitPart EH for future reference: the EH code only runs on the shooter's client, so make sure you take that into account

#

The biki mentions it but a lot of people seem to miss it :P

stable dune
boreal parcel
#

heyo, I see in the cba example for the addClassEventHandler there is car, will that also work on tanks, apcs etc?

hallow mortar
#

It's checking isKindOf. So putting car will affect things that are isKindOf "car" and putting tank will affect things that are isKindOf "tank". You can inspect a vehicle in the Config Viewer to see what sorts of things isKindOf will match it with. Note that base classes like car and tank are not very specific - most wheeled vehicles have the base class car and most tracked vehicles have the base class tank; there is no vanilla APC base class as they usually belong to one of those two. You can use more specific classnames as well, up to and including the exact classname of a type of vehicle.

tough abyss
#

^ also note that the above only applies if calling the function with the _allowInheritance parameter set to true

#

otherwise the class has to match exactly

hallow mortar
#

Well, it's true by default

tough abyss
#

indeed but worth mentioning in case they're using a version with the value set to false

boreal parcel
#

alright thank you for the information

#

also apparently RHS USAF's m6a2 is a car, not a tank lol

wary sandal
#

why doesn't unitcapture record slingloading?

south swan
#

probably because it was written way before slingloading became an official mechanic πŸ€·β€β™‚οΈ

wary sandal
#

so i have to setSlingLoad manually

#
private _result = [[0, -400, 50], 0, "B_Heli_Transport_03_F", west] call BIS_fnc_spawnVehicle;
_result params ["_heron", "_heronCrew", "_heronGroup"];

[_heron, _helidata] spawn BIS_fnc_unitPlay;

private _container = "Land_Cargo10_red_F" createVehicle (getPosASL _heron vectorDiff [0, 0, 10]);
_heron setSlingLoad _container;
#

the container doesn't appear at all

tough abyss
#

if the container isn't spawning in at all, then not sure

wary sandal
#

but it does some funky physics stuff and detaches

tough abyss
#

slingloading after already starting the unitplay probably doesn't help

#

but I wouldn't expect slingloading to work perfectly with unitcapture to begin with, tbh

#

given unitPlay is quite literally just a sequence of setVelocityTransformation calls

wary sandal
#

i wished i could do something cool looking

#

could maybe use AI but it's too stupid for what i want to do

torn solstice
#

Does anyone know how to whitelist the independent side for specific players?

hallow mortar
#

In what context? Whitelist for what?

torn solstice
#

I want specific players to have access to the independent side.

hallow mortar
#

I'm not sure if that's possible as such. Missions don't have a lot of control over the slotting screen.
You could have an init.sqf thing that checks their UID and gives them a fullscreen warning if it doesn't match [once they load in], something like that, but it wouldn't prevent them from taking the slot entirely.

wary sandal
#

so i tell the ai to tell somewhere and it lands 20 meters off

#

that's why i wanted to use unit play

wary sandal
#

why aren't my huron's lights turning up?

private _result = [[0, -380, 10], 0, "B_Heli_Transport_03_F", west] call BIS_fnc_spawnVehicle;
_result params ["_heron", "_heronCrew", "_heronGroup"];

(_heronCrew select 0) action ["LightOn", _heron];
_heron setPilotLight true;
#

i tried both the action LightOn and setPilotLight method as you can see

south swan
#

LightsOn: Turns on the headlights of an empty vehicle. If vehicle is AI-controlled, see notes under the LightOff action.
LightsOff: ... If the vehicle is AI-controlled (either as the lone driver, or as the commander/gunner) then the light status depends on the AI's behaviour mode ("combat" or "stealth" = lights off, any other mode = lights on).
πŸ€”

south swan
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
torn solstice
#

thanks

torn solstice
# hallow mortar I'm not sure if that's possible as such. Missions don't have a lot of control ov...

Im trying to do this in an initPlayerLocal.sqf. No dice. Original script found here: https://forums.bohemia.net/forums/topic/170769-request-whitelist/

if (!isServer) then
{
"BIS_fnc_MP_packet" addPublicVariableEventHandler compileFinal preprocessFileLineNumbers "server\antihack\filterExecAttempt.sqf";
};

while {true} do
{
    private ["_reserved_units", "_reserved_uids", "_uid"];


    waitUntil {!isNull player};
    waitUntil {(vehicle player) == player};
    waitUntil {(getPlayerUID player) != ""};


    // Variable Name of the Player Character to be restricted. //
    _reserved_units = ["indy1", "indy2", "indy3", "indy4"];


    // The player UID is a 17 digit number found in the profile tab. //
    _reserved_uids =
    [
   

    ];


    // Stores the connecting player's UID //
    _uid = getPlayerUID player;

    if ((player in _reserved_units)&& (_uid in _reserved_uids)) then
        {
        cutText ["","Black Faded"];
        disableUserInput true;
        sleep 2;
        titleText ["SCANNING BIOMETRICS...", "PLAIN"];
        sleep 5;
        cutText ["","Black Faded"];
        titleText ["ACCESS GRANTED... Welcome Tombstone.", "PLAIN"];
        sleep 5;
        cutText ["","Black in", 0];
        disableUserInput false;
        };

    if ((player in _reserved_units)&& !(_uid in _reserved_uids)) then
        {
        cutText ["","Black Faded"];
        disableUserInput true;
        sleep 2;
        titleText ["SCANNING BIOMETRICS...", "PLAIN"];
        sleep 5;
        cutText ["","Black Faded"];
        titleText ["ACCESS DENIED. You will be kicked to the lobby in 5 seconds!", "PLAIN"];
        sleep 5;
        cutText ["","Black in", 0];
        disableUserInput false;
        failMission "Returning to lobby.";
        };
};
south swan
#

(player in _reserved_units) wouldn't work if _reserved_units is an array of strings πŸ€·β€β™‚οΈ

torn solstice
#

I tried it as an array of variables and same thing

south swan
#

what "same thing"

torn solstice
#

not running what is in the if statements.

hallow mortar
#

No offense but I'm not reading all that
player in _reserved_units <- use getPlayerUID or whatever the command is

torn solstice
#

gotcha

south swan
#

player in [array, of, units] works on my machine πŸ€·β€β™‚οΈ

#

this setVarible ["ReservedSlot", true]; in unit's Init and then player getVariable ["ReservedSlot", false]; in mission works on my machine

#

vehicleVarName player in ["array", "of", "stings"] works on my machine

hallow mortar
#

Oh if that's for checking the unit not the player then yeah don't use getPlayerUID

#

I don't see anything obviously wrong here. Try inserting some systemChat outputs to see which bits are running and which aren't.

#

Keep in mind that this uses suspension so many parts of it won't take effect while the mission is still in the briefing phase; suspension is paused until the mission actually starts

torn solstice
#

I will test all of that now... thank you.

torn solstice
#

its almost as if the initPlayerLocal.sqf file isnt running once I join our dedicated server

royal bramble
#

I'm having some issues with this

private _myArray = missionNamespace getVariable "TFI_Arsenals"; 
_name = str (player);
_test = _myArray findIf { _x == _name};
hint format["%1", _test]

This should just look through the array to see if player is in it. But I get an error that says i'm using an array.

warm hedge
#

What is TFI_Arsenals?

#

@royal bramble

royal bramble
#

It's a global variable that contains multiple object names. I know that's fine because I used it in other scripts. But I am trying to check if a object is already in the array.

#

@warm hedge

warm hedge
#

Sorry meant what exactly it contains

#

Can you copyToClipboard it and post it here?

tough abyss
#

isEqualTo

copper raven
warm hedge
#

isEqualTo would fix the error but only a temporary fix

tough abyss
#

Under the assumption it's truly meant to be an array of objects, and happens to have arrays in it for some reason, isEqualTo is the way to go

warm hedge
#

At least I want to understand what exactly is the goal

tough abyss
#

i am attempting to make ciws shoot at an artillery round but the invisible target either isnt attaching or is not changing side i had


this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    _ciwstarget = "CBA_B_InvisibleTargetAir" createVehicle [0,0,0];
    _group = createGroup east;
    [_ciwstarget] joinSilent _group;
    _ciwstarget attachto [_projectile, [0,0,0]];
}];

but someone helped me to get this but it won't attach


this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    _group = createGroup east;
    _ciwstarget = _group createUnit ["CBA_B_InvisibleTargetAir",[0,0,0], [], 0, "FORM"];
    _ciwstarget attachto [_projectile, [0,0,0]];
}];
warm hedge
#

There is a command to force a turret to look somewhere, lockTurret whatever

#

Which I forgot rn, will post the exact comand asap

royal bramble
tough abyss
#

actually to lead it i would need to do some vector logic

#

but even then it would change on launch angle

#

hmmm

warm hedge
royal bramble
#

Is it an array in an array?

warm hedge
#

Yes

#

Also what are you tring to achieve Mastar?

royal bramble
warm hedge
#

So the array should contain objects that has Arsenal?

warm hedge
#

Then do not str the object, it converts the object into a string not something you can compare with an object

#

Also if you just want to detect if it is in the array you can use in command

royal bramble
warm hedge
#

Huh?

sudden yacht
#

Apparently AI do not use thermals in vehicles???

warm hedge
#

If you want to store objects into an array, store it

warm hedge
sudden yacht
#

I used the command.

#

currentVisionMode gunner car2;

#

Car2 being a APC, the nato LAV there.

#

Returned 0

#

Indicating standard sighting.

warm hedge
#

I do not think it is a thing for an AI

#

I barely know how AI behaves though

sudden yacht
#

Well thank you for the reply πŸ™‚

real tartan
#

is there a server version of getLoadedModsInfo ? i.e.: get mods loaded on server via SQF

still forum
#

Why can't you just use getLoadedModsInfo?

real tartan
#

trying to compare it with client, so I run it from initPlayerLocal.sqf, I try [] remoteExec ["getLoadedModsInfo ", 2], but don't know how to get result from there

#

so maybe if I wrap getLoadedModsInfo into function and call it remote, it will give me result

south swan
#

yeah, getting a local return from remotely executed things is a nice puzzle to solve πŸ˜›

still forum
#

you can remoteExec back to remoteExecutedOwner, which will pass the data to the client and run a function on it

remoteExec itself will never return you a result. But you can use remoteExec to send the result over, later

south swan
#

unless you're running on headless client, because remoteExecing from that apparently always results in remoteExecutedOwner returning 0 🀣

still forum
#

#ticket :U πŸ˜„

south swan
#

it was already ticketed. And closed with "#wontFix, #itsProbablyAFeature"

still forum
#

Welp if it says that it'll be right, sad tho

south swan
#

back to the topic of mods info: if server info is expected to be needed, then "just setting it in a public variable form server side once and then just working with that variable on clients" would be direct and easy way πŸ€·β€β™‚οΈ

#

O_o

stable dune
#

Hi,
How do I create particles which are local effect to shown everybody?
Can I just remoteExec function where i create particles to object?

copper raven
south swan
# south swan O_o

just so the deleted message doesn't go unanwered: sqf missionNamespace setVariable ["TAG_TotallyAutomatedModsInfo", getLoadedModsInfo, true]; // execute on server once πŸ˜›

still forum
#

missing TAG_ 😒

icy seal
#

Any way to make it so that a CT_BUTTON has to be enabled on all player GUI's for the GUI to close?

#

is it a case of making the CT_BUTTON send some info when enabled (and disabled) to the server and executing a script when all values in said script indicate enabled?

winter rose
still forum
#

Thats also how I understand it

#

0 when the remoteExec came from a HC?
not when receiving one on a HC

winter rose
#

would this be enough?

#

(well, "running this command on a HC (…)")

south swan
#

"running this for the code that was initiated by a HC"

winter rose
#

ah yeah true

#

Running this command in code received from a Headless Client always returns 0 by design. ship it?

#

done, thx πŸ‘

halcyon temple
#

hey guys

#

question xD

is this possible, does it make sense?

_cfgFactionClasses = [
    "getNumber (_x >> 'priority') == 1 && -1 < getNumber (_x >> 'side') && getNumber (_x >> 'side') < 4" configClasses (configfile >> "CfgFactionClasses"),
    [],
    {
        getNumber (_x >> "side");
    },
    "ASCEND"
] call BIS_fnc_sortBy;

{
    _factionSideColorHEX = ([(getNumber (_x >> "side")) call BIS_fnc_sideType, false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBAtoHTML;
    _varName = "_color" + (configName _x);
    TGF_color setVariable [_varName, _factionSideColorHEX];

} forEach _cfgFactionClasses;
warm hedge
#

Well, would require to tell what exactly you want to do

still forum
halcyon temple
#

get hex color with getVariable

south swan
#

@cyan dust they're ready for the second round

cyan dust
#

Also, ticket says the same

halcyon temple
#

so...

TGF_color = getVariable "_colorBLU_F"
south swan
still forum
halcyon temple
#

string

radiant siren
#

Is there a way to add an addAction onto a memory point say for a tank turret?

halcyon temple
#

BIS_fnc_colorRGBAtoHTML give a string

little raptor
#

-1 < getNumber (_x >> 'side')
when is the side ever negative?

warped abyss
#

When ScriptAI to randomly make Arma scripts after putting a couple of words in?

halcyon temple
still forum
halcyon temple
#

TGF_color is an object, not but

still forum
#

You're not making sense

#

please explain in proper sentences and not just snippets of sentences and small words

halcyon temple
#

ok, xD, all I need to know

#

I'm making menus, or diary entries, and use faction colors a bit in each... So I was thinking of a way to just get factions colors in hex for html syntax, and get strings of color

little raptor
little raptor
radiant siren
warm hedge
halcyon temple
copper raven
#

you could compute the hex colors, store them, and then simply use select with a sideid, rather than computing everything everytime

little raptor
#

it seems to me you're trying to use it as a hashmap:
TGF_color setVariable [_varName, _factionSideColorHEX];

#

but SQF already does have hashmaps

little raptor
south swan
halcyon temple
halcyon temple
# copper raven you could compute the hex colors, store them, and then simply use `select` with ...

this works, thx

TGF_color = [];
{
    TGF_color pushBack [
        getNumber (_x >> "side"),
        configName _x,
        (getNumber (_x >> "side")) call BIS_fnc_sideType,
        ([
            (getNumber (_x >> "side")) call BIS_fnc_sideType,
            false
        ] call BIS_fnc_sideColor) call BIS_fnc_colorRGBAtoHTML
    ];
} forEach ([
    "getNumber (_x >> 'priority') == 1 && -1 < getNumber (_x >> 'side') && getNumber (_x >> 'side') < 4" configClasses (configfile >> "CfgFactionClasses"),
    [],
    {getNumber (_x >> "side");},
    "ASCEND"
] call BIS_fnc_sortBy);

{
    diag_log format ["%1: %2: %3: %4", _x select 0, _x select 1, _x select 2, _x select 3];
} forEach TGF_color;

// "0: OPF_F: EAST: #FF800000"
// "1: BLU_F: WEST: #FF004C99"
// "2: IND_F: GUER: #FF008000"
// "3: CIV_F: CIV: #FF660080"
copper raven
#

it could be a lot better blobdoggoshruggoogly

halcyon temple
#

xD

#

TGF_color["#FF800000", "#FF004C99", "#FF008000", "#FF660080"];

kindred zephyr
#

This is more of a technical question:

I know presence checking can be expensive, so is there an advantage of running a controlled loop that checks presence every x seconds using inAreaArray againts using triggers that check in the same intervals?

I recently changed from a lot of different triggers into a single controlled loop that only executes on server but I don't really feel the difference, they behave almost the same if not a little bit slower since everything is done in series in the controlled loop instead of doing it in parallel.

Does trigger for precense checking have an inherent advantage due it being a engine-side solution or they basically behave as the inArea/inAreaArray commands?

astral bone
#

Err- I want to run code everytime a unit is created, no matter how it's created, and the default loadout for said unit is loaded. I am thinking maybe using EntityCreated and then put a _obj spawn { Do stuff to loadout };
Would this work? Would it work in single player, or just MP? For all objects spawned or just units? How might I check if object is a unit?

little raptor
kindred zephyr
little raptor
astral bone
radiant siren
#

Anything for the EH "reloaded" for it to work at the beginning of the reload and not at the end of it?

an example:
(spawn object at the beginning of the reload and not at the end of the reload)

hallow mortar
#

You can't change the basic behaviour of event handlers like that. Try using a userAction EH to look for the reload action instead - that should happen at the start. Only works on players though.

little raptor
valid abyss
#

I'm being paid to make a script for a community and i need to secure the pbo while it is tested on the server owner's dedicated server. Is there any way to encrypt the pbo file?

jade acorn
#

you can obfuscate a pbo

#

Mikero's Eliteness can do it afaik, there's also a paid obfuSQF app

valid abyss
#

hmm

#

i guess that could work

#

only problem would be id have to find out how to hide the scripts in a way the server owner would never find them and rip them without paying me

#

and im not looking to buy software to do it either

jade acorn
#
  1. Why not test your script on your own server? Just configure it in the same way the other guy is
  2. No type of encryption cannot be decrypted so if you want to keep everything fair and simple, add a license and write a binding agreement
valid abyss
jade acorn
#

and writing to cache is core engine function

#

stream it to him through Discord πŸ˜›

valid abyss
#

besides the person im working with wouldnt have it any way but their way which makes it quite difficult to navigate

radiant siren
hallow mortar
# valid abyss besides the person im working with wouldnt have it any way but their way which m...

Well if it needs to be run on their client, they...have to download it. And the engine needs to be able to read it, so it can't be too encrypted. If obfuscation/binarisation isn't good enough, well...that's kind of all there is. Arma isn't really designed to facilitate users charging each other for exclusive stuff.
If you're being paid for this you should have a written agreement on what you're being paid for and how much you'll be paid. If they agree to that then that's [I am not a lawyer] something you can enforce outside the game.

valid abyss
#

i think i know how to obfuscate it though

radiant siren
jade acorn
# radiant siren i figured lol
player addEventHandler ["GestureChanged",
{
    params ["_unit", "_gesture"];
    if (_gesture == "GestureReloadM4SSAS") then {
    [player, 0.2] remoteExecCall ["setAnimSpeedCoef", 0, player]; 
    player forceWalk true;
    player removeEventHandler ["GestureChanged", _thisEventHandler];};
}];```something like this
radiant siren
jade acorn
#

I tried it with gesturereloadmx while having MX and it worked, so your gesture is wrong probably

valid abyss
radiant siren
real tartan
#

is there an event handler on create or delete marker on map ?

jade acorn
#

definitely for Zeus, not sure if there's one for players