#arma3_scripting

1 messages Β· Page 702 of 1

little raptor
#

but only the music will be heard

#

not the environment

meager epoch
#

@little raptor btw, which one is the correct way?
"sound1", "sound1.ogg" or "music/sound1.ogg"

meager epoch
#

Well thats the problem then blobdoggoshruggoogly

little raptor
#

whatever you named the class in cfgMusic

meager epoch
#

Its sound1 i think

little raptor
#

can't you be more original?! what on earth is sound1?! didn't you think what would happen if someone else has a music by that name?!

meager epoch
little raptor
#

always add tags to your variables

#

it reduces the chance of collisions

#

e.g. :BT_sound1 is still better

meager epoch
#

alrighty

#

ty

past wagon
#

What is the conventional format for the description written at the beginning of a script? And if everyone does it differently, could I please have a couple examples of how people do it? Thanks

little raptor
#

you can also look at the BIS/CBA/ACE functions to see how they do it

somber radish
#

I got a question on sound

#

I am trying to have a modify weapon function

#
Player addEventHandler ["Fired", { 
 params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

If (_weapon == primaryWeapon _unit) then {
 [_projectile, _unit] spawn {
 params ["_projectile", "_unit"];
 Private    _ShooterData = (getShotParents _projectile);
 Private     _HHH = createVehicle ["B_20mm_Tracer_Red", (GetPos _projectile)]; 
            _HHH SetShotParents _ShooterData;
            _HHH attachTo [_projectile, [0, 0, 0]];
            detach _HHH; 
            _HHH setVelocityModelSpace (velocityModelSpace _projectile); 
            deleteVehicle _projectile;
            
playSound3D ["A3\Sounds_F\weapons\Cannons\cannon_1.wss", _unit, false, getPosASL _unit, 5, 1, 0, 0, false];
}}}];

Everything works, except for the sound, I have tried to configure this in the cfg sounds as well and then use the Say3d command, no error message and seems to fire just fine, except there is no sound

#

Any suggestions?

#

Is it the fileFormat?

copper raven
#

should work if the file path is correct

#

except for that false at the end

#

local: Boolean - (Optional, default false) If true the sound will not be broadcast over network Since Arma 3 v2.05.147858

#

try without it

somber radish
#

hmmm

#

ok ill try

somber radish
#

Didnt work

#

I tried giving it a wrong filepath just to see and then I did get an error message

copper raven
#

try playSound3D ["A3\Sounds_F\weapons\Cannons\cannon_1.wss", _unit] just that

#

if that doesn't work, then your path is wrong

somber radish
#

hmm

#

ok ill give it ago

jade acorn
#

hi, i've found a mission intro script which includes following two lines:

#define DELAY_CURSOR    0.10;```
could someone explain what is the purpose of those? It's not a macro, it's not used or undefined in any other place of the code, just placed at the lower parts of the code where some cutText things are defined and black screen goes away.
copper raven
#

it is a macro

jade acorn
#

but it's not called anywhere else, no ##some_thing## or lines inheriting any part of them

copper raven
#

where are you looking for it?

jade acorn
#
if ([] call BIS_fnc_didJIP) exitWith {};
titleCut ["","BLACK IN", 6000];

playmusic "intro";

sleep 10;


[
    [
        ["Lorem","<t color='#33FF99' align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"],
        ["Ipsum","<t color='#33FF99' align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"],
        ["Dolor sit amet","<t color='#33FF99' align = 'center' shadow = '1' size = '1.0'>%1</t>"]
    ]
] spawn BIS_fnc_typeText;

playmusic "intro";

#define DELAY_CHARACTER    0.10;
#define DELAY_CURSOR    0.10;

sleep 8;
    ["", "yada"] call Bis_fnc_infoText;
sleep 2;
    ["yadayada", "dayada"] call Bis_fnc_infoText;
sleep 3;
    [rank player, name player] call Bis_fnc_infoText;
sleep 1;
    "dynamicBlur" ppEffectEnable true;   
    "dynamicBlur" ppEffectAdjust [6];   
    "dynamicBlur" ppEffectCommit 0;     
    "dynamicBlur" ppEffectAdjust [0.0];  
    "dynamicBlur" ppEffectCommit 5;  
titleCut ["", "BLACK IN", 2];```
copper raven
#

is that the entire file?

jade acorn
#

yes

#

I'm either blind or it's just thrown there

copper raven
#

then it serves no real purpose

jade acorn
#

so the DELAY_X is just a custom macro that is not hardcoded in engine, right (I assume that because I couldn't find anything similar on biki)?

copper raven
#

i think the guy who wrote this just doesn't understand how preprocessor works

#

these macros are just probably from some BIS function, you can try looking up infoText or typeText and im sure you will find it in their source

jade acorn
#

okay, I'll try that, thank you

#

and second question, I'd like to play a video/cutscene during the scenario, for which I need all other sounds to be either lowered down or suppressed completely. fadeEnvironment and fadeMusic work, however fadeSound, from what I've read, is not usable at all because a) it's overwritten by user settings and b) audio in this video also counts as Sound that will be faded. Is there any way to simply make everything quiet besides the video and/or sounds defined in my cutscene script?

#

I thought about teleporting the player somewhere in the corner of the map and place him inside a building, and after the cutscene he teleports back to the previous place, but maybe there's something more... efficient

copper raven
#

was gonna say teleport him yeah, can't think of anything else right now

#

and yeah fadeSound will also make the cutscene quiet

placid tinsel
#

I have a question about sound as well.
I set the sound to play via trigger effects. But if player goes in menu everything pauses but sound keeps playing (on zero volume I guess). So when player returns from menu he hears sound not from the point where he stopped. Same thing with music. How can I avoid that?

broken steppe
#

Hey I have a question regarding waypoints, Im working on a little paradrop script and currently I get an error code which I dont understand. It says 1 element provided 3 needed, but I cant figure out where I provide to little arguments. Here is part of the code which is not working:

    _resultgroup = [[0,0,0], 180, "LIB_C47_Skytrain", side player] call BIS_fnc_spawnVehicle;
    
    _transport = _resultgroup select 0;
    
    {_x moveInCargo _transport} foreach (units _newpara);
    
    _transport setPosASL (getPosASL _transport vectorAdd [0, 0, 1250]);
    
    _mPos vectorAdd [0,0,500];
    
    _grp = _resultgroup select 2;
    
    _grp addWaypoint [_mPos];

Adding the unit into the cargo plane and moving the plane into the air works, but when I try to add the waypoint I get the error.

winter rose
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
broken steppe
winter rose
broken steppe
placid tinsel
winter rose
placid tinsel
#

I am making sp campaign

jade acorn
winter rose
#

ye

#

well, it's not your keyboard's fault I mean πŸ˜„

placid tinsel
#

But in my case it happens not sometimes but every time

winter rose
#

yeaaah…?

placid tinsel
#

In my mission I mean

winter rose
#

yep

jade acorn
#

so... how can I block usage of ESC button when a dialogue is playing? πŸ˜›

winter rose
#

use DIK!

#

@jade acorn ↑

jade acorn
#

thank you mr house

winter rose
#

you're welcome, skeletor!

placid tinsel
#

But what if player has his pause menu button set not to ESC

winter rose
placid tinsel
#

Ok. Thank you for the advice. I'll try to implement this

broken steppe
#

Sorry for asking again, but when I spawn my plane for the paradrop above land everything is fine and the planes goes to the waypoints as intended. But when I spawn the plane at [0,0,100] (above water) it spawns and just crashes into the water. Any ideas why the plane behaves that way?

winter rose
#

and don't apologise for asking, I mean, that's the meaning of this channel πŸ˜„

little raptor
broken steppe
#
_resultgroup = [[0,0,100], 180, "LIB_C47_Skytrain", side player] call BIS_fnc_spawnVehicle;
    
    _transport = _resultgroup select 0;
    
    {_x moveInCargo _transport} foreach (units _newpara);
    
    _transport setPosASL (getPosASL _transport vectorAdd [0, 0, 1250]);
    
    _grp = _resultgroup select 2;
    
    _mPos vectorAdd [0,0,500];
    
    _grp addWaypoint[_mPos,0];
    
    _grp addWaypoint [[0,0,500],0];
#

Thats the code

little raptor
#

Use your own code

broken steppe
#

It is my own code

winter rose
#

set pos ASL right after then

little raptor
broken steppe
#

Its the first thing that comes up when googling how to spawn crewed vehicles

broken steppe
little raptor
#

If it's unscheduled

#

You might want to give the plane a velocity instead

broken steppe
#

So something along the line of:

_transport setVelocity [200, 200, 0];
little raptor
#

Otherwise it's gonna crash again

#

Look at vectorDir and vectorMultiply

broken steppe
little raptor
#

because you must make sure it's unscheduled

broken steppe
#

It is executed in a trigger

little raptor
#

directly?

#

or do you execVM it or something?

broken steppe
#

Yes, in the "On Activation field"

little raptor
#

ok it's unscheduled then

broken steppe
broken steppe
#

Is the Script set by setWaypointScript executed on waypoint completion or directly?

winter rose
#

same as script set in waypoint directly

#

if you want to execute the script immediately, use execVM

broken steppe
# winter rose same as script set in waypoint directly

So if I have a Waypoint _wp1 and write the following code: _wp1 setWaypointScript "eject.sqf"; It should execute eject.sqf upon reaching _wp1 right? Because right now it is not executed, although the waypoint is reached. I put eject.sqf in the mission folder in documents (right next to mission.sqm).

winter rose
undone flower
#
    while {true} do {
         playMusic "Track_C_18";
         sleep 170;
    };
}```
why this isn't working? also i'm running this on a "game logic" object init
winter rose
#

because it's simply code

#

remove the outer {}
also, you can't sleep in an object init

read the errors you get in Eden πŸ˜‰

winter rose
#

you gotta stop using init fields to begin with πŸ˜„

#

but spawn will do

undone flower
winter rose
#

just before the first {, [] spawn {

undone flower
#

I see... and what field do I put the code in? since object inits won't work in this case

winter rose
#

wat? sorry I don't understand

undone flower
#

you said I should stop using the init fields

#

then where do I put this code?

winter rose
#

in script files, .sqf πŸ™‚

#

for the music part, you can create an init.sqf file that will run for every player, even if they join later

winter rose
#

…that too

winter rose
#

yep, still works

for a single player mission init fields are more or less safe; it's for multiplayer that the hell is breaking out

somber radish
#

So I finally made my ingame pc, but its killing the fps big-time. Any advice on how to make this more fps friendly?

Tally_Fnc_IngamePC = {
Params ["_Screen"];
_Screen SetObjectTextureGlobal [0, "Pictures\Alphabet\Signs\Space.jpg"];
_Screen SetVariable ["Pixels", [], true]; 

Private _xAxis = 1.6;
Private _yAxis = 2.355;
Private _Selector = 0;
Private _AlphSel  = 0;
Private _Resolution = 0.1;
Private _Overlap     = 0.0015;
Private _Shift        = (_Resolution - _Overlap);



For "_I" from 0 to 494 do {
                            Private _Pix = createSimpleObject ["UserTexture1m_F", (GetPosAsl _Screen), false];
                            _Pix AttachTo [_Screen, [(_xAxis),0.05,(_yAxis)]]; 
                            _Pix setdir 180; 
                            _Pix setObjectScale _Resolution; 
                            _Pix SetObjectTextureGlobal [0, "Pictures\Alphabet\Signs\Space.jpg"];

                            (_Screen GetVariable "Pixels") PushbackUnique _Pix;

                            
                            _xAxis = (_xAxis - _Shift);
                            _Selector = (_Selector + 1);
                            _AlphSel = (_AlphSel + 1);

                                If     (_Selector == 33)
                                then {_yAxis = (_yAxis - _Shift);
                                      _xAxis = 1.6;
                                      _Selector = 0;};
                                      
                                If (_AlphSel == ((Count _Alphabet) - 1)) 
                                then {_AlphSel = 0};
                            };
};
winter rose
#

yes: don't draw per-pixel πŸ˜„

somber radish
#

lol!

winter rose
#

you are using 1m texture for 10cm squares, there is that too

somber radish
#

Any smalle objects available?

winter rose
#

I don't think so, but you could have an addon

somber radish
#

truee.. (I dont like addons)

little raptor
undone flower
undone flower
#

is there a way to add magazines to vehicle pylons that don't have magazines?

real tartan
#

I do have markers with variables, want to find marker with highest number. Number is set as variable to marker.

private _inZones = _markers select { _unit inArea _x };
private _max = _inZones select { _x getVariable ["number", 0] } 
little raptor
livid wraith
#

hmmm, MakePBO doesn't seem to like the new import directive, or is there some magic i'm missing ?

meager epoch
#

How can I have the alarm sound ring untill a certain condition is met?
Putting it from Effects only plays it for a couple of seconds.

little raptor
#

also what is the condition?

meager epoch
#

I want the alarm to stop once everyone is dead

meager epoch
little raptor
meager epoch
#

Ill see what the condition will be later, might make it stop after some time or smth else idk, doesnt matter

#

The condition is not the problem, making it play for more than 5 seconds is where im stuck

little raptor
#

the sound is looped anyway

#

so you don't have to do anything about it

#

just store the returned source

#

and delete it when you want the sound to stop

little raptor
proper sail
#

If bots spawned by a HC jump into a vehicle spawned on server

#

does the HC now own the vehicle

little raptor
#

I think so yes.

#

but why should it matter anyway?

proper sail
#

thanks

hushed tendon
#

Hello. I'm making an infection gamemode (MP mission) and I'm trying to make it so when the player dies (as Blufor) they will then respawn but then control a playable zombie that gets spawned in (as Opfor) and be able to control it (Like how zeus is able to control units)
(Cause I don't want players to go to the lobby and switch to a zombie controllable unit for many reasons).
The commands I've found that seem the closest to what I want so far are selectplayer which seems to only work in SP and remoteControl which from what I saw seems to be for vehicles. I tried remoteControl but I still had my original unit's camera view and the controlled unit couldn't interact with doors and such.
Are there possibly some better commands out there for this or am I missing some commands?
(I'd preferably like to control the units like zeus does)

copper raven
proper sail
#

Ah ok

#

Ill have to test it out then, many thanks.

copper raven
#

not sure though, need to test πŸ˜„

#

yep

little raptor
west grove
#

is there a debug command to show current draw calls, etc?

#

i could swear i have seen something like that

west grove
#

how much is the game drawing on screen right now

#

i want to figure out what affects my terrain performance

winter rose
#

Ctrl+F draw[a-zA-Z]+3D πŸ˜„

#

maybe a perf diag command, dunno

little raptor
#

afaik there's no such thing

west grove
#

there's lots of stuff for the diagnostics exe, but sadly nothing that seems to help my cause

winter rose
#

oh you mean, object drawing

snow pumice
#

Hey i have an question about hashmaps:
lets say i have as key the playerid of 4 players i just save something like an object as value
theoretically could i change 2 values at the same time, like unlikely and maybe only theoretically but if i say only the server can change the hashmap and he would change 2 values at the same time, would this give a problem?
and if not why, is there something like an scheduler for the hashmap?

winter rose
#

you can change the hashmap as much as you want server-side, then publicVariable it (or setVariable public but still)

snow pumice
winter rose
#

"at the same time" doesn't exist

#

it's one change then the other, and there is no multithread concurrent issue

#

no race condition in SQF in that case, if you prefer πŸ™‚

snow pumice
#

okay thank you

little raptor
#

it works in MP too

smoky heart
#

how tf are people getting mods into pub zeus?

hushed tendon
winter rose
smoky heart
#

It does involve scripting

winter rose
smoky heart
#

im curios how to do it

winter rose
little raptor
#

you can make a function and remoteExec that

smoky heart
winter rose
winter rose
winter rose
smoky heart
#

You know what never mind i wouldn't be able to even get my point across cause i myself barely understand what im trying to ask

winter rose
#

okido ^^ if you happen to do so, don't hesitate

smoky heart
#

its not hacking tho it was something else

#

i just can't describe it since it was my first time hearing about it

winter rose
#

you mean, "creating objects by scripting"?
you can, but in your own mission with your scripts, just not on a public server

#

though there are some custom compositions allowed now πŸ€” IDK if it's only vanilla ones or all of them

hushed tendon
#

Thanks! @little raptor @winter rose
Spent so long trying to figure this out, but it's going to help a lot though.

little raptor
#

add one in initPlayerLocal.sqf

#

I think you also need one in onPlayerRespawn.sqf

#

it gives you the new unit that spawns instead

#

since it runs locally you won't need remoteExec anymore

buoyant abyss
#

Alright, so I'm trying to do the command:

[timeline] call BIS_fnc_timeline_play;

But I need it to work on a dedicated server, so that'd mean I'd have to remote-exec it.
Wondering how to.

winter rose
#

with remoteExec! πŸ™‚

buoyant abyss
little raptor
winter rose
#

see example 4 too

tender fossil
#

Sorry for stupid question but how would I access this from script? I need a Location type variable and my brain doesn't work (once again!) after getting the 5G chip yesterday

mission.sqm

class Groups
    {
      // ...
        class Item112
        {
            side="LOGIC";
            class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={6627.4536,6,2308.7083};
                    id=306;
                    side="LOGIC";
                    vehicle="Logic";
                    leader=1;
                    skill=0.60000002;
                    text="respawn1";
                };
            };
        };
      // ...
};
#

^^^^ Note! Arma 2

winter rose
#

what do you want to access?
name that logic and use that name?

buoyant abyss
tender fossil
winter rose
#

I… don't get it?

#

getPosASL?

tender fossil
#

getPosASL Item112?
getPosASL respawn1?
Que πŸ˜„

winter rose
#

I guess the latter yes? in the editor, name the logic "myLogic" then getPosASL myLogic πŸ˜„

#

go home, u drunk

tender fossil
#

B-but... I don't even drink! I was born like this!

winter rose
#

OH SHβ€”

tender fossil
#

Tbh, this is the con of being very deep learner. I keep making stupid mistakes and getting confused all the time because I haven't completed my puzzle (with its missing pieces) about the topic I'm studying yet

winter rose
#

surface, then deep, then deeper πŸ˜‰ but I totally get you with the "oh look, let's nerd that squirrel"

tender fossil
#

The pro of it is that usually deep learners have better results - in the end, given that they've had enough inspiration and perspiration to go through the whole topic πŸ˜„

fair drum
#

curious, does commy2 hang out here or does he just use a different handle on discord.

winter rose
#

he used to but not anymore, Y ?

tender fossil
#

@fair drum I think he was banned from here?

fair drum
#

nah, I just follow his responses on the A3 Dev subreddit. curious to why he doesn't direct people here since reddit has garbage formatting

tender fossil
#

I remember there being an argument between him and the mods after which he ended up getting banned

#

Can't recall the reason though...

fair drum
#

patiently waits for mod input loooool

#

doesn't matter. I redirect people here anyways

winter rose
#

some #offtopic_politics poopstorm

#

aaanyway.

fair drum
#

many discords are realizing that's not a good channel to have haha

somber radish
tiny wadi
#

How do I get the current status of a check box from sqf?

#

Can't find a script command but maybe im blind

#

Yeah im blind nvm, cbChecked

somber radish
hushed tendon
#

I'm trying to teleport a unit from a initPlayerLocal.sqf.

params ["_playerUnit", "_didJIP"];
_playerUnit setPos (getPos playerSpawn);

I tried this but it doesn't teleport the player because apparently isPlayer _playerUnit = false. So how would I go about getting the actual player so I can teleport them?

leaden haven
#

I used this in my mission:

params ["_unit","_baseLoc"];

private _pos = [_baseLoc, 1, 10, 3, 0, 20, 0] call BIS_fnc_findSafePos;

_unit setpos _pos;

This is a function, but it works just fine, just use _unit and _baseloc as parameters.

hushed tendon
leaden haven
#

An addaction on a laptop.

#
this addAction [""Teleport to FOB"", {[player, [5309.6,10749.3,0]] call KER_fnc_teleport;
hushed tendon
#

That MP?

leaden haven
#

Yes.

hushed tendon
#

huh

#

I assumed player wouldn't work even though it is initPlayerLocal.sqf because of MP

leaden haven
#

In MP player is different on each computer and on dedicated server it is objNull by default (however this doesn't mean there couldn't be one). When user is joining dedicated server mission, at the moment of onPlayerConnected the player object is remote to the joining client, as the player unit is created on the server, but once control of the unit is passed to the user moments later, the player objects becomes local to the client and stays local. See Multiplayer Scripting's player topic for additional helpful information.

#

By the time you are playing it is local to the client.

ripe sapphire
#

Yo bros how do i find the list of memory points of a unit

past wagon
#

can someone link me to the wiki page for creating a function? I remember a page that talked about creating a function, but I cant find it.

copper raven
past wagon
#

btw @leaden haven try this for the language:

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
past wagon
#

if I just want to make my own script to "call" multiple times, can I just do this:

call "myScript.sqf";
```if not, what do I do instead? im a bit confused about whether or not I need a function, and how I need to create that function.
#

I dont quite get the difference between a function and a script. (i know a function is a type of script)

copper raven
past wagon
ripe sapphire
#

You just define it in description.ext

past wagon
#

ah

#

yeah that makes sense. problem is ive never used description.ext before

copper raven
#

read the link i sent, has everything in there

past wagon
#

ok

#

so, I need to do something like this in description.ext?

class CfgFunctions
{
    class myTag
    {
        class myCategory
        {
            class myFunction {file = "myFile.sqf";};
        };
    };
};
#

do I need a "tag" class?

copper raven
#

pretty sure yeah, it needs to be two classes deep, then the actual file, tag>category>fnc

copper raven
#
class CfgFunctions
{
    class myTag
    {
        class myCategory
        {
            file = "functions";
            class myFunction {};
        };
    };
};

should look for functions/fn_myFunction.sqf

past wagon
#

okay

past wagon
copper raven
#

cpp

past wagon
#

thanks

#
class CfgFunctions
{
    class TRI
    {
        class gameModes
        {
            class TDM { file = "TDM.sqf"; };
        };
        {
            class FFA { file = "FFA.sqf"; };
        };
        {
            class AAD { file = "AAD.sqf"; };
        };
        class misc
        {
            class vehicleCleanup { file = "vehicleCleanup.sqf"; };
        };
    };
};

so my gamemode functions are now TRI_fnc_TDM, TRI_fnc_FFA, TRI_fnc_AAD, my misc function is TRI_fnc_vehicleCleanup. I'm not sure about what I want to put for the tag. What would the purpose be in my case? this is just for a mission that im making for me and my friends to play.

#

also, im not 100% ive done the stuff correctly

copper raven
copper raven
dim terrace
#

are there some scripting commands to get current air temperature? πŸ€”

jade acorn
#

you mean for ACE?

copper raven
#

ace for example does calculation based on overcast/humidity etc, but its not the actual thing

warm hedge
#

Or, the heat haze? IIRC I saw some config values but never thought it does something

dim terrace
west grove
#

hmm is there a script command to check if an ai unit is following me?

west grove
warm hedge
#

Aha that makes sense. What Lexx said, the only thing we can do is just to get vehicle's temperature

dim terrace
#

script or config wise? Afair there are settings for different seasons

west grove
#

i havent found any config entries for that

dim terrace
#

internal exe has something like that

west grove
#

for example a terrain like tanoa should be hot all around, but if you set the month to winter, thermals will be wrong there

#

anyways, it's not related to scripting :>

winter rose
west grove
#

oh right, this one

warm hedge
#

If they make one!

west grove
#

but i meant my stuff :p

dim terrace
# west grove for example a terrain like tanoa should be hot all around, but if you set the mo...
            // Maximum and minimum temperatures (night and day) specified for every month - the game temperatures will vary in those limits // _VBS3_TI
            temperatureDayMax[]  ={ 10,  12,  15, 20, 25, 35, 35, 35, 25, 20,  10,  10};
            temperatureDayMin[]  ={-10, -6, -5, -1,  5,  6,  7, 10,  5,  2, -5, -10};

            temperatureNightMax[]={  5,   6,   8, 10, 13, 18, 26, 25, 15, 13,   8,   4};
            temperatureNightMin[]={-10, -10, -10, -5,  0,  4,  5,  6,  5,  0,  -5, -10};
#

I guess I could fetch it from world & then calculate it based on day time & overcast

winter rose
#

πŸ‘€

dim terrace
#

TI in A2:AO was ported from VBS afair

west grove
#

but i cant find these entries in any vanilla config?

warm hedge
#

Is that a thing on A3 also?

#

Or... maybe hardcoded?

dim terrace
#

from DefaultWorld to be precise

west grove
#

huh

#

oh wow, found it under weather now. that makes a lot sense

#

someone should fix tanoa weather then.

#

the values are wrong

winter rose
#

teasing aside, is a get (set?) weather command cookin'? πŸ˜‹

ripe sapphire
#

Yo bros how do i convert azimuth to vector?
Its for camSetDir

dim terrace
#
            // How much we limit the minimum (resp. maximum) temperature during the day (resp. night) if the sky is clear  // _VBS3_TI
            // 0 means no limit (the max and min will stay as stated above), 1 means full limit (the min and max will be equal)
            overcastTemperatureFactor = 0.4;``` I guess I will make some function based on those inputs
warm hedge
#

configFile >> "CfgWorlds" >> "Tanoa" >> "Weather" >> "temperatureDayMax" ->
temperatureDayMax[] = {10,12,15,20,25,35,35,35,25,20,10,10};Okay, so A3 thinks Tanoa is in the Northern hemisphere

ripe sapphire
dim terrace
warm hedge
#

Minutes please

dim terrace
#

Livonia might be wrong too

west grove
#

very likely wrong πŸ™‚

#

seems nobody ever bothered with these values before

#

and considering the current ongoing heatwave, i'm wondering if altis is still representative in 2035 πŸ˜„

ivory lake
#

would explain the complaints about thermals being useless in oldman

warm hedge
#

Yeah Tanoa's value is just inherited from CAWorld directly

#

It seems, yeah. Enoch on the other hand isn't?

little raptor
warm hedge
#

Well, regarded to the topic about the temperature, take it to #arma3_feedback_tracker shall we, if we have a topic still?

dim terrace
#

or feedback tracker πŸ˜‰

warm hedge
#

That's better? I guess

dim terrace
#

I might later post some function here to get current air temperature

prime current
#

Any reference materials on starting to script for zeus games?

I got a premade mission and I got some scripts I want to implement in. Unfortunately being a day old in Arma kinda makes that venture a hassle.

ripe sapphire
peak pond
#

I have a mission where, after running for an hour or so, players can no longer join in progess - they get an infinite loading screen and are disconnected after about 15 min. I suspect the JIP queue may be too long.

I ran #exportJIPqueue, the resulting file has time = 8008.061, about 1000 cryptic event entries, _initMessages - Total: 119937 (in breakdown, it's >90% Type_56), about 10MB's worth of ------------------- over and over, and finally _initMessagesRE - Total: 9, Type_375 : 9, and _jipMarkerInfos - Total: 8.

Any ideas what this means, if long JIP queue is in fact the problem, and how I can debug this?

errant jasper
#

Haven't looked at an exported JIP queue before, but it 10MB seems excessive, and that is around 15 JIP messages (1.28kB) being generated each second.

winter rose
#

daheck are you doing here

peak pond
#

Yeah, sounds right. I wonder if there is a way to determine what causes the JIP events?

winter rose
peak pond
#

The biggest mods involved by other authors are ACE and ALIVE.

#

Do you know if there's a tool to detect the source of the excessive JIP events?

winter rose
#

exportJIPMessages, logNetwork/logNetworkTerminate, other than that, check your mods

peak pond
#

Ok, I'll look into those network ones

#

My exported JIP queue seemed to be mostly Type_56 events. Any idea what that is?

winter rose
winter rose
peak pond
#

Makes sense. I'll look into it further... thanks for the help.

errant jasper
#

While it probably is a mod causing the issue, it may in fact be the mission just so you are aware

peak pond
#

Ok, I've had this happen in a few missions actually. They all basically have a main base with some player services I scripted (repair, rearm, recruit AI, etc), and use ALIVE modules to set up an AO. Since I'm a newer author, I figure there's a good chance it's my own mistake somewhere...

#

There is one bit of code I wrote which I expect to run very often. It is a CBA XEH on every unit's init (ALIVE spawns and despawns a lot of units as player/zeus moves around):

class Extended_InitPost_EventHandlers {
    class CAManBase {
    class jib_inventory {
        init = "_this call jib_inventory_fnc_setupAIInventory";
    };
    };
};
#

fn_setupAIInventory.sqf:

// Setup AI inventory custom items
params ["_unit"]; // AI unit
if (
    not local _unit
    || isPlayer _unit
    || {side _unit != west}
) exitWith {};
if (
    _unit isKindOf "B_Soldier_SL_F"
    || {_unit isKindOf "B_Soldier_TL_F"}
) then {
    [_unit, "ItemAndroid"] call jib_inventory_fnc_maybeAddItem;
} else {
    [_unit, "ItemMicroDAGR"] call jib_inventory_fnc_maybeAddItem;
};

fn_maybeAddItem.sqf:

// Add item to unit if not already in inventory
params [
    "_unit",         // Unit to add item to
    "_item",         // Item classname to add
    ["_quantity", 1] // Quantity to add
];
while {
    {_x == _item} count (items _unit) < _quantity
} do {
    _unit addItem _item;
};
errant jasper
#

That is fine. Nothing network-wise going one here

peak pond
#

Ok. I'll keep poking...

winter rose
#

unless the functions themselves have any JIP thing ^^

peak pond
#

addItem has the GE label in docs. Do you think that could be the culprit?

winter rose
#

one command is not the culprit (but remoteExec)

errant jasper
#

Honestly, no. AFAIK the only commands available to scripters/modders that modify the JIP queue is remoteExec, remoteExecCall or the old BIS_fnc_MP.

peak pond
#

Hmmm, there is not a single remoteExec, remoteExecCall or the old BIS_fnc_MP in my code.

#

So, addItem, even though it has GE (global effect), shouldn't cause a JIP message? Because this one is definitely called thousands of times in my mission.

errant jasper
#

It will definititely cause network traffic, but not a JIP message

peak pond
#

Ok, I think that should be fine, as it is mostly spaced out over time.

#

Yeah maybe.

patent goblet
peak pond
#

Regarding my JIP queue issue, seems my own mod is at fault. I watched the size of the exported JIP queue over time and saw that it constantly grows. After removing a feature from my mod, the queue size stays constant.

Seems the problem is in the following code snippet:

// Called once per second, _x is helicopter with AI crew
crew _x select {
    alive _x && { not isPlayer _x };
} apply {
    [_x, _x] call ace_medical_treatment_fnc_fullHeal;
    _x setUnitLoadout typeOf _x;
    [_x] call jib_inventory_fnc_setupAIInventory; // Shown above in Discord
};
_x setDamage 0;
_x setFuel 1;
_x setVehicleAmmo 1;
winter rose
#

β†’ jib_inventory_fnc_maybeAddItem

hollow thistle
#

// Called once per second
why you're healing the AI once per second.

#

fullHeal adds the healing event to the patient log. However the log is limited to 8 entries per patient, so that should not overflow your jip queue.

peak pond
#

The jib_inventory sources are above in my older message.

winter rose
#

ah yep, missed maybeAddItem
therefore what veteran said!

hollow thistle
#

you can try using the target event instead of the function so the log entries are not added at all.

#
["ace_medical_treatment_fullHealLocal", _patient, _patient] call CBA_fnc_targetEvent;
#

but I don't see how that would flood the JIP queue.

#

logEntries is an array variable that's set on the unit.

hollow thistle
peak pond
#

I didn't know about CBA target event, but in this case the units are already local, as this code is run on server.

peak pond
# hollow thistle we have no context for this snipet, how and on what it's executed.
// Setup to auto service AI and its vehicle
if (not isServer) exitWith {};
params [
    "_object",  // Service provider
    "_distance" // Service max distance
];
if (isNil "_distance") then {_distance = 7};
[_object, _distance] spawn {
    params ["_object", "_distance"];
    while {true} do {
        uiSleep 1;
        _object nearEntities ["AllVehicles", _distance] select {
            _driver = driver _x;
            not isNull _driver
                && { not isPlayer _driver };
        } apply {
            crew _x select {
                alive _x && { not isPlayer _x };
            } apply {
                [_x, _x] call ace_medical_treatment_fnc_fullHeal;
                _x setUnitLoadout typeOf _x;
                [_x] call jib_inventory_fnc_setupAIInventory;
            };
            _x setDamage 0;
            _x setFuel 1;
            _x setVehicleAmmo 1;
        };
    };
};
#

This function is called in the object init for helipads where AI combat support units spawn, so that they are healed/rearmed/repaired/refueled when they RTB.

winter rose
#

This function is called in the object init
gniiiiiiiii

hollow thistle
#

I don't see what could cause such big growth of the JIP queue then 😐

#

btw:

params [
    "_object",  // Service provider
    "_distance" // Service max distance
];
if (isNil "_distance") then {_distance = 7};

=>

params [
    "_object",  // Service provider
    ["_distance", 7] // Service max distance
];
peak pond
hollow thistle
#

yes, it's added by the function you're calling.

peak pond
hollow thistle
#

Replace with the event as I told you and it will heal them without adding log entries.

#

But as I said it's limited to 8 entries.

#

So it won't grow beyond that.

peak pond
hollow thistle
#

What would make difference? using event instead of function or using target instead of local event?

peak pond
#

Event instead of function.

hollow thistle
#

well.. I just told ya what's the difference... event heals without adding log entry.

peak pond
#

Ah, i see what you mean.

#

Again, not sure if this ACE medical bit is the root of my issue yet, but regardless I may use this event, as the ACE medical logs are not necessary in my use case.

#

Let me do further testing with my code snippet and checking the JIP queue, then I'll report back the results in a bit.

hollow thistle
#

try commenting out features one by one, first healing, then adding the items. Observe if it grows, || adapt, survive, win ||.

winter rose
#

@hollow thistle I don't know ACE at all, but basically what is happening here is always adding an Event Handler instead of "just" healing?

hollow thistle
#

no

#

targetEvent is just better remoteExec... simplyfing it a lot.

#

It just sends the event over network to the target or executes the event locally if target is local.

snow pumice
#

hey,
i am are currently working on an money system, so it would be very important that nothing like a race condition or so can happen.

as @winter rose told me it's one change then the other, and there is no multithread concurrent issue [...] no race condition in SQF in that case, if you prefer

so just to be very clear / so that i can understand it:
I am planing to remoteExecCall an function on the server which edits an hashmap.
Theoretically when 2 clients would remoteExecCall the script on the same time what would happen?
I know that this barley can be the case but if it would this just would mean that the script gets added to the stack and executed when its time to. (call adds provided Code to the stack and wait for it to execute, then returns the code's last returned value.)

so there just would be some kind of qoue and one of the two scripts is getting executed first but they can't be executed at the same time / parallel

am i right with this?

still forum
#

Theoretically when 2 clients would remoteExecCall the script on the same time what would happen?
one of them executes the first, and after that the second one

still forum
#

I know that this barley can be the case
No actually its impossible for that to ever happen

#

Even network messages that the server receives are in a queue.
A server cannot process two network messages at the same time, thus it will also not receive your remoteExec's at the same time

peak pond
hollow thistle
#

oof, it should replace the "set loadout" in the queue I guess but maybe it's appending instead.

winter rose
hollow thistle
#

I guess that's something for FT ticket and Dedmen investigation.

winter rose
#

ticket-worthy?

still forum
#

if haz repro, probably

winter rose
#

@peak pond could you prepare an easy (vanilla) repro mission plz? :3

peak pond
#

Is there somewhere to open a ticket with this?

peak pond
#

No prob, just trying to fix my mission so people can JIP...

winter rose
#

PS: I zoomed on your profile pic… and validate it, carry on πŸ˜„

peak pond
#

Do you know an appropriate category and severity for this bug report?

winter rose
#

severity… major?

peak pond
#

lol

winter rose
#

category… Performance

peak pond
#

I don't like sounding the alarm, but...

winter rose
#

there is minor or major, nothing "normal" so Major it is

peak pond
#

fair enough, thanks again for the help

winter rose
past wagon
#

if I call a function, do I need to pass any variables I want to use into the function with parameters?

still forum
#

no

past wagon
#

okay

still forum
#

local variables, scopes n stuff

past wagon
#

yeah, the variables stay defined when using call then

#

just checking

#

This is my description.ext. I am getting an error on line 9: '{' encountered instead of '='```cpp
class CfgFunctions
{
class TRI
{
class gameModes
{
class teamDeathmatch { file = "functions\gameModes\teamDeathmatch.sqf"; };
};
{ //ERROR HERE
class freeForAll { file = "functions\gameModes\freeForAll.sqf"; };
};
{
class attackAndDefend { file = "functions\gameModes\attackAndDefend.sqf"; };
};
{
class captureTheFlag { file = "functions\gameModes\captureTheFlag.sqf"; };
};
class misc
{
class vehicleCleanup { file = "functions\misc\vehicleCleanup.sqf"; };
};
};
};

past wagon
#

okay

#

what am I forgetting to do?

little raptor
past wagon
#

wait, can all functions from the same category go together like this?

class CfgFunctions
{
    class TRI
    {
        class gameModes
        {
            class teamDeathmatch { file = "functions\gameModes\teamDeathmatch.sqf"; };
            class freeForAll { file = "functions\gameModes\freeForAll.sqf"; };
            class attackAndDefend { file = "functions\gameModes\attackAndDefend.sqf"; };
            class captureTheFlag { file = "functions\gameModes\captureTheFlag.sqf"; };
        };
        class misc
        {
            class vehicleCleanup { file = "functions\misc\vehicleCleanup.sqf"; };
        };
    };
};

is that what im doing wrong?

past wagon
#

okay

winter rose
#

I swear one day I will redo this CfgFunctions page as it is mixing up things and in the wrong order

little raptor
#

du eet nau

winter rose
#

hey! don't team up on me now

#

as a matter of fact, I am

past wagon
#

I have a unit named blue1 and I need to get that variable as a string during the mission. When I use str, I get "B Alpha 1-1:1". I need to get "blue1"

cerulean cloak
#

How would I find what mod adds a specific object?

little raptor
cerulean cloak
little raptor
#

configAddonSources or something

cerulean cloak
little raptor
#

there's also a variant that takes a class name

#

unitAddons

cerulean cloak
#

Turns out it's Clafghan

jade acorn
chrome wraith
#

Noob question -- if I execVM a .sqf through the init.sqf, will it be evaluated on each client separately? Say, for example, MyScript.sqf checks the UID of a player against a predefined list of UIDs, and ends the mission for them if they're on the list. Will that end the mission for everyone? Or just that specific player?

undone flower
#

how many triggers can I have on a mission before the performance gets affected?

little raptor
#

the script itself executes locally

#

but might have global effect

undone flower
winter rose
#

depends on your PC; it's not a static value

past wagon
chrome wraith
# little raptor depends on the command/function you use to end the mission

Okay, I’m using an if-then clause

banList= [β€œsomeSteam64”];
banUID = getPlayerUID player;
If (banUID in banList) then {endMission β€œEND1”;};

I don’t think the script works yet, but I’ll iron out the syntax later. I just want to make sure I’m at least using the right commands. The wiki says BIS_fnc_endMission should be used to get the mission to end for everyone at the same time, so I assume endMission has the potential to send only one player to the debrief screen.

Sorry to ask such a specific question, but it seems like this is the best place to get some coaching.

little raptor
#

where?

#

BIS_fnc_endMission has local effect

chrome wraith
#

Ah, I misread. Thanks.

#

"To end mission properly so that everyone goes to debriefing at the same time, this command should be executed on every machine."

#

^ in regards to endMission

#

Scripting on no-sleep is addictive.

little raptor
chrome wraith
#

Woah that's some neat formatting. I've obviously got a lot to learn. Thanks man!

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
chrome wraith
#

That's amazing. Thanks, dude. I figured it had something to do with local variables.

chrome wraith
#

Oh?

little raptor
#

you were using weird quotes

#

what you had:

β€œsomeSteam64”
```but it should be:
```sqf
"someSteam64"
chrome wraith
#

Sorry, I meant that I don't know when to use private variables, or preface a variable with an underscore.

little raptor
#

well I was referring to your error

little raptor
#

and it's not used outside of that script

chrome wraith
#

Gotcha. Much appreciated!

tidal ferry
#

Hey, question

#

Not sure if this would belong in scripting or not, but is it possible to load an .SQE (composition file) in a running mission?

#

Or only in 3den?

cold cloak
#
[east, "task1", ["Empty magazine at Target", "Shoot at Target", objNull] "assigned", 1, true, "kill", false] call BIS_fnc_taskCreate;

cannot find the error here, again

#

debug says it's missing a ] but idk where it's supposed to go

cold cloak
#

um

#

where

little raptor
#

before "assigned"

willow hound
#

description parameter: objNull is not a marker
destination parameter is missing (that's probably where you wanted objNull)

past wagon
#

you mean just vehicleVarName

#

?

little raptor
#

no

#
unit1 = blabla;
unit1 setVehicleVarName "unit1";
#

now:

str unit1 //"unit1";
undone flower
#

how do I check if the player is in a vehicle?

willow hound
#
vehicle player != player
copper raven
#

!isNull objectParent player

undone flower
#

better yet, how do I prevent the player from leaving or ejecting from a vehicle?

willow hound
#

Lock the vehicle πŸ™‚

undone flower
#

can't get in but still can get out

willow hound
#

With ACE?

undone flower
#

a jet

#

i'm only using CBA, if that matters

copper raven
#

i guess you can use getout event handler, and put them back in

willow hound
#

Locked vehicle usually goes both ways; what's out can't get in and what's in can't get out.

#

Is it the ejection seat that still works?

undone flower
#

when the jet is grounded, cant get out or eject. as soon as it starts moving the "eject" action shows up and I can eject regardless of lock state

copper raven
#

so its the ejection seat

undone flower
#

mhm, looks like so

willow hound
#

I think ejection seats are handled differently, I don't know if you can disable them somehow.

robust hornet
#

any simple scripts for AA to fire randomly in the air? haven't had much luck with anything found online

undone flower
copper raven
#
isNil {
  private _missile = createVehicle [<ammo_class>, [0, 0, 0], [], 0, "CAN_COLLIDE"];
  _missile setPosASL <asl_pos>;
  private _magnitude = vectorMagnitude _missile;
  _missile setDir <dir>;
  _missile setVelocity (vectorDir _missile vectorMultiply _magnitude);
  _missile setMissileTarget <target>
}

idk something like that

#

giving speed is probably redundant as ammo has a launch velocity already iirc, edited, should be more proper

digital rover
#

Working on tank commander override/"commander designate"...

wanna see something horrible?

#
    params ["_vehicle","_lookAt"];
    private _turretCfg = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret";
    private _horRotSpeed = [_turretCfg,"maxHorizontalRotSpeed", nil] call BIS_fnc_returnConfigEntry;
    private _turretAngularSpeed = 45 * _horRotSpeed; // degrees/sec

    private _gunRotSource = [_turretCfg,"animationSourceBody", nil] call BIS_fnc_returnConfigEntry;
    private _gunDirRel = -(deg (_vehicle animationSourcePhase _gunRotSource));
    if (_gunDirRel<0) then {_gunDirRel = _gunDirRel + 360};
    private _dirTo = _vehicle getRelDir _lookAt;
    private _traverseDist = abs (_gunDirRel - _dirTo);
    _traverseDist = (360 - _traverseDist) min _traverseDist;
    private _traverseTime = _traverseDist/_turretAngularSpeed;
    systemChat str [_gunDirRel, _dirTo, _traverseDist, _traverseTime];

    private _dummy = createAgent ["B_RangeMaster_F", [0, 0, 0], [], 0, "NONE"];
    _dummy allowDamage false;
    private _cameraView = cameraView;
    moveOut player;
    _dummy moveInGunner _vehicle;
    _dummy switchCamera _cameraView;
    _dummy doWatch _lookAt;
    private _time = time;
    waitUntil {time >= _time + _traverseTime * 1.2};
    moveOut _dummy;
    deleteVehicle _dummy;
    player moveInGunner _vehicle;
    player switchCamera _cameraView;
robust hornet
past wagon
little raptor
past wagon
#

ok

winter rose
past wagon
#

i just need to get that as a string from the unit

winter rose
#

if they come from the editor, they have a varname

past wagon
#

okay...

#

only if I give it a variable name tho, right?

#

vehicleVarName is just the variable name assigned to a vehicle

past wagon
#

ok

copper raven
#

that code is not functional though, you need to generate positions, fill in the gaps

tight cloak
#

trying to use holdaction add

#

aint working, dont know why. any pointers?

#

[
    "generator",                                            // Object the action is attached to
    "Initiate Backup Power",                                        // Title of the action
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Idle icon shown on screen
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Progress icon shown on screen
    "_this distance _target < 5",                        // Condition for the action to be shown
    "_caller distance _target < 7",                        // Condition for the action to progress
    {},                                                    // Code executed when action starts
    {},                                                    // Code executed on every progress tick
    { _this remoteExec "mechanics\radiostart.sqf" },                // Code executed on completion
    {},                                                    // Code executed on interrupted
    [],                                                    // Arguments passed to the scripts as _this select 3
    12,                                                    // Action duration [s]
    0,                                                    // Priority
    true,                                                // Remove on completion
    false                                                // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, generator];    // MP compatible implementation

#

comes up with an error i cant quite see (blips off quickly) and doesnt add it to the object id like it to

#

ignore me

#

im a complete, utter, bumbling bambling baboon

#

******* "" on object name

#

im an idiot

#

only question that remains is;
how do i make it exec a file after its done

#

currently _this remoteExec ------
returns an error saying it expected an array, as is said in the wiki

#

(still learning sqf)

#

how on earth can i get it to exec the file then?

copper raven
tight cloak
#

yes

#

also if possible id like to know if i can execute say a sound file on interrupted / at start

copper raven
#

see second pinned message, you want to use https://community.bistudio.com/wiki/execVM like that, though the best way is to use cfgFunctions or something similar, and just remoteExec the function instead, like you do with the holdAction one

tight cloak
#

i did tho

#

{ _this remoteExec "mechanics\radiostart.sqf" },

#

and it said it expected an array which is why im confused

copper raven
#

no you didn't, read what i wrote again

tight cloak
#

im confused

#

so i should use it as a function instead?

copper raven
#

you can but don't have to, i just said it will be more effective

tight cloak
#

wait so to execute an sqf file i should do what? currently i read that as "execute it as you have"
and i can also use playsound for the tick / start

#

because im already asking it to execute an sqf file via remoteExec

copper raven
#

you can use playsound i already answered that

plain sable
#

Is there a function that will allow you to crush the grass in a certain radius (as it happens when a player crawls along it)?

winter rose
tender fossil
#

Can I refer to units set in the editor/mission.sqm with ```sqf
for {[i...
missionNamespace getVariable format ["unit%1",_i];

#

Arma 2: CO v1.64 again

#

This is an example unit from mission.sqm:

        class Item11
        {
            side="GUER";
            class Vehicles
            {
                items=1;
                class Item0
                {
                    position[]={6854.9751,45.859566,2502.2217};
                    azimut=218;
                    id=16;
                    side="GUER";
                    vehicle="ru_Profiteer4";
                    player="PLAY CDG";
                    leader=1;
                    skill=0.60000002;
                    text="civ4";
                    init="this setpos [getpos this select 0, getpos this select 1, (getpos this select 2) - 0.01];this setpos [getpos this select 0, getpos this select 1, (getpos this select 2) + 0.75];";
                    description="Civ 4";
                };
            };
        };
#

If I refer to the unit with this

for [{_i=1}, {_i <= civscount - 1}, {_i=_i+1}] do         
  {
  // ...
    _wantedCiv = missionNamespace getVariable format ["civ%1",_i];
    diag_log _wantedCiv;
  // ...

all I get is <NULL-Object> spam

winter rose
#

also this for is slow

tender fossil
#

Well, taking a closer look it actually prints the unit that I've spawned as

winter rose
#

use for "_i" from 0 to civsCount -1 do

tender fossil
#

But the rest of the code just fails silently... Ugh

tender fossil
tender fossil
#

Ok, scripted Arma for 6 hours and I want to throw my PC out of the window now... The game should carry a black box warning for content creators KEKW

winter rose
#

"be wary: Ezcoo, drop that now"

robust hornet
#

Hey guys I'm getting an error running a script (https://forums.bohemia.net/forums/topic/197937-release-gom-ambient-aa-v121/) from this section

};

            //make sure weapon is of projectile type
            _weapons = weapons _gun;
            _projectileIndex = _weapons findIf {

                _mag = getArray (configfile >> "CfgWeapons" >> _x >> "magazines") select 0;
                _ammo = getText (configfile >> "CfgMagazines" >> _mag >> "ammo");
                _ammo isKindOf "BulletCore" AND toUpper _ammo find "SMOKE" isequalto -1;

            };

says there's an undefined variable in _mag expression

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
little raptor
robust hornet
little raptor
#

Not the vehicle itself

robust hornet
#

right, thanks mate

half moon
#

I'm trying to fix code from a mod that was abandoned a few years back. This code should place a gas mask to the target, but it doesn't do anything (interactions appear just fine). Is there anything obvious I'm missing that's wrong?

/* your code */
params ["_player", "_target"];

//First figure out which unit has the mask, preferring the target
if (_target call CBRN_fnc_hasMaskInInventory) exitWith {
    private _masks = (items _target) arrayIntersect (CBRN_allLevel1Masks);
    
    //Remove our item
    _target removeItem (_masks # 0);
    
    //Take the targets glasses and add it to their inventory (or ground if they run out of space)
    [_target, goggles _target, true] call CBA_fnc_addItem;
    
    //Finally put the mask on the target
    _target linkItem (_masks # 0);
};

//If it's player that has it then do that
if (_player call CBRN_fnc_hasMaskInInventory) exitWith {
    private _masks = (items _player) arrayIntersect (CBRN_allLevel1Masks);
    
    //Remove our item
    _target removeItem (_masks # 0);
    
    //Take the targets glasses and add it to their inventory (or ground if they run out of space)
    [_target, goggles _target, true] call CBA_fnc_addItem;
    
    //Finally put the mask on the target
    _target linkItem (_masks # 0);
};
winter rose
#

CBRN_allLevel1Masks might be undefined, dunno

west grove
#

i am using fn_exportEditorPreviews to create editor preview images. for some objects the camera zooms in too much. .. i'm trying to figure out right now to fix that, but no matter what i try, the camera doesn't budge. has anyone had any experience with this before?

#

nevermind, i just figured it out

#

thanks for the help, guys

winter rose
#

gniiiiii
the usual 7yo internet topic where you have the exact same problem as the guy and it ends "nvm fixed it" and you're stuck with hairloss forever πŸ˜„

undone flower
west grove
#

the fn_exportEditorPreviews.sqf sets camera fov _cam campreparefov 0.075; - i simply tweaked that value until it worked with my model.

#

it's some manual work, but still faster than trying to come up with anything else

winter rose
#

I was mostly kidding but I always suffer silently in such occasions πŸ˜„ thanks for telling!

neon dragon
#

Where did u guys learn scripting cus 3 of my friends got arma and ive turned into a mission creator for them and so that the missions are better i gotta learn scripts

winter rose
west grove
#

well, about 15 years ago i've read how you start a fireplace in operation flashpoint. from there it went downhill

west grove
#

good old times where starting a fireplace was considered a tough task

winter rose
#

the fire place no, having it on was lit

west grove
#

i seem to remember it was one of the most common questions at the time "how do i start the campfire"

frank mango
winter rose
#

I realised while typing it, but hell yeah to both! πŸ˜„

frank mango
#

Is this why Arma has both unlit and lit (and ability to turn it on/off) campfires

winter rose
#

I guess, so that Humanity can move to its next goalpost πŸ˜„

frank mango
#

Arma 4 will be full of things then... its had almost 10 years of scripts to add pallapallairl

winter rose
#

I can confirm, it will be possible to have up to two bonfires! 200% rate!

west grove
#

script a simple computer based on campfires being set on and off

#

and then play doom on it

winter rose
#

we can even do analog signal with smoke particles!

frank mango
tender fossil
#

Well, I'll try for the last time before I give up. This is the last call for help before I move permanently in trash bin meowtrash

winter rose
#

sqfbin? :3

tender fossil
#

playerarrays.sqf

civstringarray    = ["Civ1", "Civ2", "Civ3", "Civ4", "Civ5", "Civ6", "Civ7", "Civ8", "Civ9", "Civ10","Civ11", ...];

init.sqf

// ...

execVM "briefing.sqf";
call compile preprocessfile "triggers.sqf";

if(!debug)then{["basicintro"]execVM "introcam.sqf";};

if(local server)then{execVM "targets.sqf";};

waitUntil { ( (time > 1) and ((alive player) or (local server)) ) };

_h = [] execVM "playerarrays.sqf";

// ...
winter rose
#

mraw!

tender fossil
#

Kinda cyberpunk btw

winter rose
#

if ( ((call compile format ["%1_wanted;", (civstringarray select _i)]) == 1) )

WAT

#

and can't you setVariable, young man? πŸ‘€

tender fossil
#

I pasted it from other parts of (not my) code, haven't touched that part yet πŸ™‚

winter rose
#

gniiiΒ²

tender fossil
#

I'm editing an ancient mission with legacy code

still forum
#

that hurts me brain

tender fossil
tender fossil
winter rose
#

instead of "trying to patch something one doesn't know", is it possible to get to "a system one could understand" from what you have? or is it too deeply rooted in the old system 😬

tender fossil
#

Depends on who you ask πŸ˜›

#

My issue is that _wantedCiv returns always nullObj, no matter what I do

winter rose
#

objNull 😁

tender fossil
#

Whoops πŸ˜„

winter rose
#

have you tried debugging civarray, _i, and parenthese (_i+1)?

cold cloak
#

anyone here know how to make the enemy force retreat if there's too many casualties? and when they retreat a task to be completed

tender fossil
little raptor
#

when they flee: fleeing becomes true

little raptor
#

but why is it one index ahead?

tender fossil
tender fossil
little raptor
#

sure but what about:

civstringarray select _i)
civarray select _i+1

#

that code is just...oooooof

#

question1: what's wrong with a simple forEach

#

why for?

tender fossil
little raptor
#

question 2: why on earth are they storing an array of variables?

#

just use setVariable

tender fossil
little raptor
#

the main problem with that code is that the values are not bound properly

#

they're just using global variables in one place, object varspace in another...

little raptor
#

but still it's not worth it imo

#

you can write something better in less than 10 minutes

#
{
  if (_x getVariable ["wanted", false]) then {
    _bounty = _x getVariable ["wanted_bounty", 0];
    //blablabla
  };
} forEach civs;
tender fossil
#

This is what you get when you put a game designer to code... πŸ˜„

tender fossil
cold cloak
#
if -- fleeing true, call BIS_fnc_taskCompleted;
#

smth like that?

winter rose
cold cloak
#

uuh

#

yeah

#

but I got like 20 groups of Muhajideen attacking you

winter rose
#

so you will have to use units, the side of your enemy, and findIf (or count if you want a percentage of them fleeing)

little raptor
cold cloak
#

brih

#

bruh

winter rose
#

brah

cold cloak
#

you get the point

winter rose
#

broh

austere hawk
#

does AI fleeing work well when they are under fire? Or do they just crawl in the opposite direction then, but continue making as much progress as a snail

little raptor
cold cloak
#

is mujahideen the variable for the faction or?

little raptor
#

array of enemy units

cold cloak
#

I don't know what that means tho..

austere hawk
#

it means you got a bit of reading to do

cold cloak
#

Mh.

austere hawk
cold cloak
#

uuh

#

help

winter rose
#

do you:

  • want to learn scripting? welcome, read the wiki πŸ˜‰
  • want to recruit (even for free) someone to write you a script? #creators_recruiting is the place
little raptor
# cold cloak uuh

if you want all enemies, you can simply type:

mujahideen = units east;
#

(assuming they're on the east side)

cold cloak
#

thank you Leo

little raptor
#

also according to the wiki you should only check the group leader

#

the whole group will flee together

cold cloak
#

aight, should I put it the script to a SQF or a trigger?

#

@little raptor

little raptor
#

Β―_(ツ)_/Β―

#

wherever you want

cold cloak
#

I mean, I put it on a trigger condition and I got some generic expression error

little raptor
#

no

#

it's not a trigger condition

#

plus it must be executed scheduled

#

because of the sleep

cold cloak
#

oh

#

would an eventhandler work?

#

probably not

#

idk

#

im pretty clueless

past wagon
#

say I have 8 people, and 8 locations. I want each of those players to be set (randomly) to each of those locations. I want each player to have a unique location from a selection.

winter rose
little raptor
# cold cloak im pretty clueless

you can execute it from a trigger On Activation statement like this for example:

[] spawn {
_mujahideen = units east;
{
  _x allowFleeing 0.85;
} forEach _mujahideen;
waitUntil {
  sleep 3;
  _mujahideen findIf {alive _x && !fleeing _x} < 0
};
["sometask", "SUCCEEDED"] call BIS_fnc_taskSetState;
}
cold cloak
#

aight, thanks man

little raptor
real tartan
winter rose
#

or (bad practice)```sqf
["<t size='2'>Big</t> text", { hint parseText _this }] remoteExec ["call"];

tender fossil
#

My day today πŸ˜„

random loom
#

Is there any way to determine if a text is unicode?

#

Or alternatively, convert text to not be unicode

winter rose
random loom
#

it mentions that it doesn't support UNICODE

winter rose
#

then use lnbSortBy?

#

ah wait, 2.06

#

soon\β„’

winter rose
#

@tough abyss … ?

tough abyss
#

Hey

#

Yeah hello

#

So I wanna make a custom banner

#

How do I do that

#

I've never done such a thing

jade acorn
#

you open a software like gimp or photoshop and paint a banner.

tough abyss
jade acorn
#

uhh, I don't know the Thing.

#

but if you click both of the links Dr House posted a while ago, you'll know how to start.

#

first one is about showintg the banner in game, second one can give you a base canvas on which you can paint your stuff.

tough abyss
#

Cus I was searching arma 3 folders and couldn't find it

#

Thanks guys

jade acorn
#

just make sure to make the image brighter than you want, because it will be darker ingame for some reason

#

so, now two questions from me.

  1. If shadows are handled by engine and game mechanics at all, is it possible to execute a script when player is within the shadowed area?
  2. If not, can I do similar thing with light beams, so an EH or any script could be executed when player finds himself within the range of a flashlight?
#

I have flashlights in mind because afaik the lighthouse beam is handled locally and it would be weird in MP

winter rose
#
  1. not (afaik) though you could try getLighting for the lolz (note that a player could have his shadows disabled)
  2. try getLighting then yes
jade acorn
#

okay, I'll try that

still forum
#

getLighting doesnt do shadows

#

when player is within the shadowed area?
No, engine doesn't know if things are in shadow

winter rose
hushed tendon
#

I'm trying to add a music EH to allow the while loop to choose another song to play after the current has finished but I must not be doing it right. (Aka ambient music)

private _musicArray = getArray (missionConfigFile >> "CfgMusic" >> "tracks");
private _musicPlaying = false;

while{true} do {
    _randomMusic = selectRandom _musicArray;

    _musicID = playMusic _randomMusic;
    addMusicEventHandler ["MusicStop", {_musicPlaying = false;hint "done";}];
    _musicPlaying = true;

    waitUntil {_musicPlaying == false};
    sleep 1;
    hint "New Song";
};
little raptor
#

getArray (missionConfigFile >> "CfgMusic" >> "tracks");
unless you're adding them yourself, I don't think that entry is necessarily updated with all songs

hushed tendon
#

I'm trying to play a random song, then when the song stops start a new one. Should I do this another way?

little raptor
#

also _musicPlaying was a local variable

#

what you wrote was never gonna work anyway

#

altho the event handler is not gonna be reliable if you expect something else to interfere with it

#

also I don't think it'll work after loading from a save

#

so perhaps just use the loop

#

Β―_(ツ)_/Β―

hushed tendon
# little raptor so perhaps just use the loop

This seems to work

private _musicArray = getArray (missionConfigFile >> "CfgMusic" >> "tracks");

while{true} do {
    musicPlaying = false;
    _randomMusic = selectRandom _musicArray;

    playMusic _randomMusic;
    addMusicEventHandler ["MusicStop", {musicPlaying = false;hint "done";}];
    musicPlaying = true;

    waitUntil {musicPlaying == false};
    sleep 1;
    hint "New Song";
};
still forum
#

waitUntil {musicPlaying == false};
->
waitUntil {!musicPlaying};

winter rose
hushed tendon
#

Can a pass a script into itself? Like

_sqf = [_sqf] execVM "someFile.sqf";
little raptor
#

wat?

hushed tendon
little raptor
#

what you wrote doesn't obviously

hushed tendon
#

Figured as much. Was worth a shot though

little raptor
#

what is the point anyway?

hushed tendon
#

Terminating a script from inside itself. Was going to give a player and addAction to terminate the intro sqf. But I do know another way I could do it (but not from inside the sqf)

little raptor
#

you can do that

west grove
#

assign it to a variable that isnt private?

little raptor
#
terminate _thisScript
hushed tendon
west grove
#

_thisScript is probably not available in this place

#

so _thisScript changed to thisScript should do the trick

little raptor
#

Was going to give a player and addAction to terminate the intro sqf

#

the script you want to terminate is outside addAction then

little raptor
#

it holds the handle to the currently spawned code

west grove
#

well but that won't work from another script

#

what he wants to do is run a script and then terminate it from somewhere else

#

so myScript = [] execVM "someFile.sqf"; .. then later use terminate myScript and it should probably work, i guess.

#

but dunno. i'm just a noob

hushed tendon
#

I'll work with this to make it easy initPlayerLocal.sqf

_introSQF = [_playerUnit] execVM "introLocal.sqf";

_playerUnit addAction
[
    "Cancel Intro",    // title
    {
        params ["_target", "_caller", "_actionId", "_arguments"]; // script
        terminate _introSQF;
    },
    nil,        // arguments
    1.5,        // priority
    true,        // showWindow
    true,        // hideOnUse
    "",            // shortcut
    "true",     // condition
    50,            // radius
    false,        // unconscious
    "",            // selection
    ""            // memoryPoint
];
little raptor
#

you can't terminate it like that

little raptor
hushed tendon
#

Oh yeah

little raptor
#

yes

#

same way you do it with VR blocks

hushed tendon
#

If I wanted to run some code for a player that joins the server for the first time how would I do that? I saw onPlayerConnected but that seems to run every time they join.

tender fossil
tender fossil
#

I think you could just add a variable like _hasJoinedPreviously = false/true and save it to their profileNamespace. Disclaimer: I'm not the best scripter πŸ˜„

#

Then you could have persistence even between e.g. server restarts

little raptor
#

the code never runs for them again

#

because it's in profileNamespace

tender fossil
#

Server could send another variable, e.g. a RNG'd code that would have to match and if it didn't, it would run the code again

hushed tendon
little raptor
#

for their entire life!

hushed tendon
#

yup

little raptor
#

(well kinda)

little raptor
#

check if the UID exists

#

if not run the code for them

tender fossil
#

If it's a popular mission he'll need a database soon, no? Just trying to keep the solution simple πŸ˜›

hushed tendon
#

It's like 2 minutes long where they can do nothing and it's a replayable scenario so they would get annoyed

tender fossil
#

Ah, like a cutscene?

hushed tendon
#

Yeah intro with music and some background info

tender fossil
#

What about playing the intro anyway and just adding some hint or such text that'd tell to e.g. press ESC to skip the intro?

hushed tendon
#

Would this work in the intro.sqf?

(findDisplay 46) displayAddEventHandler ["KeyDown", "terminate thisScript;"]; //Kills intro.sqf when Spacebar is pressed
tender fossil
undone flower
#

yo can anyone give me some insight on how do I make this trigger of mine only activate when there's no more vehicles of a given side present?

distant oyster
distant oyster
past wagon
#

if I have an element of an array, how can I get the index for that element in the array?

winter rose
#

find

past wagon
#

okay

#

ah, thanks

tough abyss
#

It says that the object I'm looking for is in a folder called Orange

#

but i can't find the orange folder in PBO

#

am ib eing stupid or

#

bruh i cant upload images

#

A3_Structures_F_Orange_Humanitarian_Flags

#

Says to go there

#

but that doesn't exist

#

I'm already in Structures in PBO but can't find the folder

distant oyster
#

from UNPACKED data

#

for your steam install: steamapps\common\Arma 3\Orange\Addons\structures_f_orange.pbo

tough abyss
#

holy shit thank you

#

now gotta find out how to convert p3d to png

#

les go

winter rose
tough abyss
#

I want to import it to photoshop so i can edit it

winter rose
#

… a p3d is a 3D model.

tough abyss
#

but can't cus it's p3d

#

aight so i mesesd up hol up

winter rose
#

hence the "what" πŸ˜„

tough abyss
#

I'd be here for 2 hours looking for a p3d to png converter

#

lol

winter rose
#

not that the thought didn't amuse me, but… πŸ˜ƒ

tight cloak
#

so when starting the mission. inside initplayerlocal.sqf i have

if (side player == west) then {

        _subtitles = [
            [ "System",            "Loading, please wait. This may take some time...", 0],
            [ "System",            "Almost done, final touches...", 10],
            [ "System",            "Loading complete, transmitting data...", 20]
        ];
        _subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
        sleep 30;
        0 fadeMusic 0;
        sleep 0.1;
        titlecut ["","BLACK IN",7];
        playMusic "EventTrack01a_F_Tacops";
        6 fadeMusic 1;
        _camera = "camera" camCreate [12031.02,4828.08,0.92];
        _camera cameraEffect ["internal", "back"];
        sleep 30;
        _camera cameraEffect ["terminate", "back"];
        camDestroy _camera;
};
#

followed by ```sqf
[] spawn _EndSplashScreen;
_video = ["MissionIntro.ogv"] call BIS_fnc_playVideo; BIS_fnc_playVideo;

#

i was hoping this would set the player camera to a fixated point as specified, give them scenery to look at whilst some scripts time to startup in the background and make sure they are running and give everyone time to load in. then show a cutscene

#

if i remove the video at the end, and remove the cam terminate lines then it does just that but wont show the video or leave the camera

#

so your stuck staring at scenery

#

if i dont remove them. it plays the video with the text over the top and then returns you to normal after. but loses the scenery wait screen

#

i tried using sleep to delay the executions but it seems to ignore it, any idea why?

somber radish
#

Any way to do a ingame screenshot?

#

I was thinking about some sort of satellite surveillance function But I do not wanna use the r2t function. Id rather have a stillshot being updated every few second

warm hedge
#

No... Unfortunately. Maybe with some extensions

somber radish
#

pff

#

ok

#

never mind then

warm hedge
#

I know yeah. Sadly RV Engine is not flexible enough like Source Engine

low sierra
#

When i'm on foot zooning with right mouse button, if i press left control, the screen zoom out. This is supposed to happens?

#

Thanks in advance.

past wagon
#
_winner = ( allPlayers inAreaArray _mapTrigger ) select 0;
[parseText "<t color='#000000'>" + name _winner + "<t color='#ffffff'> WINS!", -1, 0, 6, 0, 0] remoteExec ["BIS_fnc_dynamicText"];
```Why am I getting `error: type text`?
crude vigil
past wagon
#

ah

#

thank you

#

I have also been using parseText in this line of code and it has been working for a while for some reason.

#
[parseText "<t size='1.0'><t color='#0000ff'>BLUE</t> TEAM WINS!", -1, 0, 6, 0, 0] remoteExec ["BIS_fnc_dynamicText"];
crude vigil
#

Then the error comes from + operator cos you are parsing till name winner

#

that function must be handling parsing internally but maybe it also accepts Structured Text

#

parseText "<t color='#000000'>" + name _winner + "<t color='#ffffff'> WINS!"
parseText "<t color='#000000'>" finishes first then + operator is trying to add name _winner to a Structured text, since + operator does not support (Structured) Text + String, it returns error.
Parentheses are your friend in this scenario :)

copper raven
#

use format instead

peak pond
#

Hi, could someone help me set up my environment for file patching? I am developing a mod and would like to be able to test code changes while the game is running. I have done quite a bit of setup already, mostly following this guide https://community.bistudio.com/wiki/CMA:DevelopmentSetup#Develop_with_unpacked_data but it still does not work.

So far, I have installed Arma 3 development branch via steamcmd, created directory junction to locate my mod source (and PBO) inside the Arma 3 directory, added a trivial function (print message to systemChat) to the mod addon for testing, and can run arma3diag_x64.exe with -filePatching and the mod enabled. In game, however, it appears to only use the packaged form of the mod, not the edit I make in the source code.

peak pond
peak pond
#

Ok, I have some progress after using Mikero's tools. Upon (arma3diag_x64.exe) game start, it appears to load the unpacked edited SQF function in my mod -- good! However, the source does not appear to be re-loaded upon mission restart in Eden editor. It only uses the source code from when I started the game. That is not sufficient for iterative development.

peak pond
#

In short, with file patching, how do I get the game to reload the SQF source after I edit some code?

peak pond
#

AHA! I needed the magical recompile = 1; attribute in my CfgFunctions entry. Now it works πŸ‘

keen orchid
#

anyone here know how to activate a keypoint animation via trigger?

little raptor
little raptor
winter rose
keen orchid
#

is there possibly a method

#

where i use pausing?

#

im not sure if its cause im using 3den enhanced but im noticing a 'pause' checkbox

#

if i could somehow manipulate that i could choose when to activate the animation

knotty aspen
#

hint "Lights going out."; _lighttypes= [ "Lamps_Base_F", "Land_LampAirport_F", "Land_LampSolar_F", "Land_LampStreet_F", "Land_LampStreet_small_F", "PowerLines_base_F", "Land_LampDecor_F", "Land_LampHalogen_F", "Land_LampHarbour_F", "Land_LampShabby_F", "Land_PowerPoleWooden_L_F", "Land_NavigLight", "Land_runway_edgelight", "Land_runway_edgelight_blue_F", "Land_Flush_Light_green_F", "Land_Flush_Light_red_F", "Land_Flush_Light_yellow_F", "Land_Runway_PAPI", "Land_Runway_PAPI_2", "Land_Runway_PAPI_3", "Land_Runway_PAPI_4", "Land_fs_roof_F", "Land_fs_sign_F" ]; for [{_i=0},{_i < (count_lighttypes)},{_i=_i+1}] do { _lights = getMarkerPos "facility" nearObjects [lighttypes select_i, 500]; {_x setDamage 0.95} forEach_lights; };

#

first time messing with scripting, and i picked up this script from a DayZ Medic video

#

it's meant to create a blackout in the surrounding area, and i can't get it to work. anybody know what the issue may be?

copper raven
#

forEach_lights?

#

also don't use that deprecated for syntax, infact, you shouldn't even use for here, just use forEach

knotty aspen
#

where would i use the forEach syntax? would i use it in replacement of the for syntax in line #27?

copper raven
#

yes

knotty aspen
#

the video is quite old, from 2017 i think, so that might be the reason why it's outdated

#

saw that people were saying it worked so i gave it a shot lol

#

it says i'm missing a semicolon somwhere

cosmic lichen
#

Post the code

cosmic lichen
#

Nah, that's crap

knotty aspen
#

oh lol

cosmic lichen
#

replace for with forEach as told above

knotty aspen
#

yeah, i switched that and it's still giving me an error about missing a semicolon now

cosmic lichen
#

That's why I said post the coder πŸ˜„

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
knotty aspen
#

oh

#

i see

#

sorry, very new to scripting stuff, havent used this channel before lol

cosmic lichen
#

No need to be sorry. All good

knotty aspen
#
_lighttypes= [
"Lamps_Base_F",  
"Land_LampAirport_F",  
"Land_LampSolar_F",  
"Land_LampStreet_F",  
"Land_LampStreet_small_F",  
"PowerLines_base_F",  
"Land_LampDecor_F",  
"Land_LampHalogen_F",  
"Land_LampHarbour_F",  
"Land_LampShabby_F",  
"Land_PowerPoleWooden_L_F",  
"Land_NavigLight",  
"Land_runway_edgelight",  
"Land_runway_edgelight_blue_F",  
"Land_Flush_Light_green_F",  
"Land_Flush_Light_red_F",  
"Land_Flush_Light_yellow_F",  
"Land_Runway_PAPI",  
"Land_Runway_PAPI_2",  
"Land_Runway_PAPI_3",  
"Land_Runway_PAPI_4",  
"Land_fs_roof_F",  
"Land_fs_sign_F"  
]; 
for [{_i=0},{_i < (count_lighttypes)},{_i=_i+1}] do
{
  _lights = getMarkerPos "facility" nearObjects [lighttypes select_i, 500];
  {_x setDamage 0.95} forEach_lights;
}; 
#

is that the right way to do it?

copper raven
#
{
    _x setDamage 0.95;
} forEach nearestObjects [getMarkerPos "facility", _lighttypes, 500];

just use it like that

knotty aspen
#

oh

#

i replaced the last 6 lines with that, and it's saying
"On Activation: Local variable in global space"

#

as an error message

#
_lighttypes= [
"Lamps_Base_F",  
"Land_LampAirport_F",  
"Land_LampSolar_F",  
"Land_LampStreet_F",  
"Land_LampStreet_small_F",  
"PowerLines_base_F",  
"Land_LampDecor_F",  
"Land_LampHalogen_F",  
"Land_LampHarbour_F",  
"Land_LampShabby_F",  
"Land_PowerPoleWooden_L_F",  
"Land_NavigLight",  
"Land_runway_edgelight",  
"Land_runway_edgelight_blue_F",  
"Land_Flush_Light_green_F",  
"Land_Flush_Light_red_F",  
"Land_Flush_Light_yellow_F",  
"Land_Runway_PAPI",  
"Land_Runway_PAPI_2",  
"Land_Runway_PAPI_3",  
"Land_Runway_PAPI_4",  
"Land_fs_roof_F",  
"Land_fs_sign_F"  
]; 
{
    _x setDamage 0.95;
} forEach nearestObjects [getMarkerPos "facility", _lighttypes, 500];
  {_x setDamage 0.95} forEach_lights;```
#

like that

#

?

copper raven
#

remove {_x setDamage 0.95} forEach_lights;

knotty aspen
#

oh woops wait

copper raven
#

and to avoid that error, wrap everything into a

call {
  ...
};
knotty aspen
#

where do i place it?

#

beginning or at the end?

copper raven
#

?

knotty aspen
#

the

#

call

#
_lighttypes= [ 
"Lamps_Base_F",   
"Land_LampAirport_F",   
"Land_LampSolar_F",   
"Land_LampStreet_F",   
"Land_LampStreet_small_F",   
"PowerLines_base_F",   
"Land_LampDecor_F",   
"Land_LampHalogen_F",   
"Land_LampHarbour_F",   
"Land_LampShabby_F",   
"Land_PowerPoleWooden_L_F",   
"Land_NavigLight",   
"Land_runway_edgelight",   
"Land_runway_edgelight_blue_F",   
"Land_Flush_Light_green_F",   
"Land_Flush_Light_red_F",   
"Land_Flush_Light_yellow_F",   
"Land_Runway_PAPI",   
"Land_Runway_PAPI_2",   
"Land_Runway_PAPI_3",   
"Land_Runway_PAPI_4",   
"Land_fs_roof_F",   
"Land_fs_sign_F"   
]; 
{ 
    _x setDamage 0.95; 
} forEach nearestObjects [getMarkerPos "facility", _lighttypes, 500];
call {
  ...
};
copper raven
#

put the code inside the brackets

#

entire code

knotty aspen
#

that's what i have so far

copper raven
#

did you read what i say?

knotty aspen
#

OH

#

OH I SEE

#

sorry im uh

#

a bit small brain currently

#

alright so it didn't give me error messages

#

gonna test the actual blackout rn

#

well, lights didn't go out

#

gonna try again in a different area, and it could also be the fact that i don't have all of the light variable names

#

thank you for the help

tired delta
#

Hello everyone, i have a small problem with spawing smoke grenades via a script on a didicated Server. I am using this to spawn the grenade "_smoke = "SmokeShellRed" createVehicle _pos;", the grenade spawns but no smoke is coming out of it. In the Editor it works just fine. Dose someone know what im doing wrong?

low sierra
#

@little raptor@winter rose, it's a script thing, i have a code that run when you press ctrl+key, and i want this code to run when the player use temporary zoom (it's a 3D mark to mark objects, so players may want to zoom to mark far away objects), but when he press ctrl the screen zoom out.

winter rose
low sierra
#

I tried to "cut" ctrl effect when inputAction "zoomTemp" is running, but i can't.

little raptor
#

as Lou said check ctrl, see what it's mapped to

low sierra
#

It's default Arma 3 controls, i never changed it.

#

Thanks for the answers.

#

I tried that to cancel ctrl effect while temporary zooning:sqf (findDisplay 46) displayAddEventHandler ["keyDown",{ params ["_control","_key","_keyShift","_keyCtrl","_keyAlt"]; private _onlyCtrl = !_keyShift && _keyCtrl && !_keyAlt; private _return = false; if (_key isEqualTo 0x1D && _onlyCtrl && inputAction "zoomTemp" > 0) then { systemChat "AAA"; _return = true; }; _return }];
While using temporary zoom, if i press ctrl, i receive the "AAA" message from systemchat, what means the event handler returned true canceling the key, but it stills zoom out.

low sierra
winter rose
#

I mean, your design is quite ok actually
pressing Ctrl = disabling modification key if there is zoom
you should do a display EH on ctrl itself I believe

low sierra
#

πŸ˜€

half moon
#
//[this, ["PERSE", {[getPosASL this, 25, 60, 1] call CBRN_fnc_spawnMist}]] remoteExec ["addAction", 0, true];;